|
|
|
Tell us what you think of the site.
|
Autodesk Media & Entertainment User Community
|
Autodesk® 3ds Max®
|
|
Autodesk® Maya®
|
|
Autodesk® Softimage®
|
|
Autodesk® MotionBuilder®
|
|
Autodesk® Mudbox™
|
|
Autodesk® ImageModeler™
|
|
Autodesk® Sketchbook® Pro
|
|
Autodesk® Smoke on Mac®
|
| how to select an existing set in my scene?
|
|
|
Hi,
I’m just trying to hide an existing set in my scene, but having trouble. Here is what I have.
from pyfbsdk import *
mySet = FBSet('name of an existing set in my scene') mySet.Visibility = False
I think the first line is the problem. I think that is the class constructor used to create a new set. Is there an easy way just to select an existing set?
I don’t think I can use FBFindModelByName since a set isn’t a model right?
thx,
Brian
MotionBuilder 7.5 thru ...
3dsMax 2.5 thru ...
|
|
|
|
I’m kind of new to this but here’s some help.
mySet = FBSet('name of an existing set in my scene')
...this actually creates a new Set. If you want to select the first Set in your scene use…
mySet = FBSystem().Scene.Sets[0]
If you want to select the second Set replace the [0] with [1]. I’m not so familiar with choosing by name yet but that is possible.
To set the visibility you’ll want to access the PropertyList, use the Find function to pick out Visibility and set the value using Data…
mySet.PropertyList.Find('Visibility').Data = False
Hope that helps, as I said I’m kind of new to this so there may be better ways.
|
|
|
|
hey thanks. so i tried:
from pyfbsdk import *
mySet = FBSystem().Scene.Sets[0]
mySet.PropertyList.Find('Visibility').Data = False
but no luck…
MotionBuilder 7.5 thru ...
3dsMax 2.5 thru ...
|
|
|
|
That’s too bad; maybe there are no Sets in your scene now?
Anyway this should work better as it’ll search for a Set by name…
from pyfbsdk import *
aSets = FBSystem().Scene.Sets
for aLoop in aSets:
if aLoop.Name.find("name of an existing set in my scene") != -1:
aLoop.PropertyList.Find('Visibility').Data = False
else:
print
Notice that the .find in the first line of the loop is lower case, this is important though I can’t explain why yet :-/
!= -1: is a round about way of saying, is true.
It seems that there needs to be a least something after the else: statement so I add a print, there’s probably a better way of doing this.
|
|
|
|
ok thx, this now works, notice the new location of [0]
mySet = FBSystem().Scene.Sets
mySet[0].PropertyList.Find('Visibility').Data = False
and this also works:
aSets = FBSystem().Scene.Sets
for aLoop in aSets:
if aLoop.Name.find('clapper 1') != -1:
aLoop.PropertyList.Find('Visibility').Data = False
if aLoop.Name.find('calibratorB 1') != -1:
aLoop.PropertyList.Find('Visibility').Data = False
else:
print
MotionBuilder 7.5 thru ...
3dsMax 2.5 thru ...
|
|
|
|
Glad that worked :-)
I wonder why the positioning of the [0] made a difference. I’m using MB2009, maybe that’s it?
|
|
|
|
could be… i’m on MB 7.5 x2
MotionBuilder 7.5 thru ...
3dsMax 2.5 thru ...
|
|
|
|
|
|