|
Ok - I have a simple list of characters in my scene displayed in a drop down box… Selecting a character returns the value of the character as per the initial list derived from:
charList = []
scene = FBSystem().Scene
charList = scene.Characters
So I can populate a variable with an individual character…
However - the reason for doing this is to run an export script I have specifically for the chosen character - all the characters in my scene are duplicated apart from namespaces…
How do I find the Namespace of the selected character...? When I try:
varSelectedCharacter.LongName
...all I get is the name as it appears in the Navigator list...?
HELP...!!!
|
|
|
|
You’ll want to split the string being returned by the LongName to just include the namespace.
You’re probably getting something like “rig 1:Character” and you just want “rig 1”
Try the following
charList = []
scene = FBSystem().Scene
charList = scene.Characters
for char in charList:
theNameSpace = char.LongName.split(":")[0]
print theNameSpace
Seems like there should be an easier way to get the namespace...like getNameSpace()
the pyMoBu module has just that…
http://www.scottenglert.com/pymo...s.PMBComponent-class.html
Hope this helped :)
|
|
|