Inside Sabertooth
Learn how Sabertooth uses 3ds Max to create 3D interactive projects, including HBO Go’s Game of Thrones interactive experience
  • 1/3
You are here: Forum Home / Autodesk® MotionBuilder® / Python / Accessing Adv Character Settings Options?
  RSS 2.0 ATOM  

Accessing Adv Character Settings Options?
Rate this thread
 
34765
 
Permlink of this thread  
avatar
  • AndyCo
  • Posted: 22 September 2009 10:35 PM
  • Total Posts: 9
  • Joined: 03 June 2009 06:54 AM

Hi,

Just wondering if its possible to get access to all the more advanced character setting options through Python (or ORSDK for that).  For example match source, all the slider properties for reach/pull, adjusting hip height, ankle height compensation etc.  If so how?

Thanks.



Replies: 0
avatar

Hello,

Yes you can access most properties on all objects in MotionBuilder, we have exposed a funtion called PropertyList that contains a list of all the properties for your object.

from pyfbsdk import *

#Getting properties works just like how it does on models, or textures or actors, etc.

#Keying all properties on a character
lCharacter FBApplication().CurrentCharacter
for each in lCharacter.PropertyList:
    if 
each != None#Make sure none of the properties return a value of none.
        
print each.Name #View all the properties

#Setting a particular property on a character
lProp lCharacter.PropertyList.Find("Match Source")        
if lProp:
    
lProp.Data True

The above example is how to set the property “Match Source”, you would do the same for the other properties you would like to set.

The difference for your other properties you are looking for is they are integers (not a boolean like Match Source)so you would just set the Data attribute to that value.

lProp.Data = 50

One small thing to note is, every once in a while the name you put in the Find function does not mate the UI name or the UI name without a space(both should work), so a trick is to set the property you want to acess to something crazy like 999, save out the FBX scene as ASCII, use something like Notepad to search for the value 999, and then you have your property name you need to add into the Find function.

Regards,

Kristine



KRISTINE MIDDLEMISS | SENIOR DEVELOPER CONSULTANT
AUTODESK DEVELOPER NETWORK Media & Entertainment
http://www.autodesk.com/joinadn

Replies: 0
avatar

PS, this is pretty much the same for OR SDK, the only difference is you don’t use the Data function the same. But search in the Samples that come with MotionBuilder for PropertyList and you will see the difference in syntax to be able to do it correctly.

~Kristine



KRISTINE MIDDLEMISS | SENIOR DEVELOPER CONSULTANT
AUTODESK DEVELOPER NETWORK Media & Entertainment
http://www.autodesk.com/joinadn

Replies: 0
avatar
  • AndyCo
  • Posted: 25 September 2009 04:20 AM

Thats great, thanks Kristine.



Replies: 0