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 / Creating custom float property crashing Mobu
  RSS 2.0 ATOM  

Creating custom float property crashing Mobu
Rate this thread
 
22217
 
Permlink of this thread  
avatar
  • dj120
  • Posted: 02 February 2009 03:11 PM
  • Total Posts: 7
  • Joined: 22 January 2009 12:21 AM

I’m trying to add a custom float property through python, but when I run my script mobu crashes.  Can anyone tell me what I’m doing wrong?  Is it a problem with my code or mobu?  Either way, it would be nice if it didn’t hard crash.

from pyfbsdk import *

####------------------------------------------------------------------------####
def AddFloatProperty modelnamevalue):
    
myProp model.PropertyCreate nameFBPropertyType.kFBPT_float'float' FalseTrue )
    
myProp.Data value
####------------------------------------------------------------------------####

selJoints FBModelList()
FBGetSelectedModelsselJointsNone True )

for 
sel in selJoints:
    
AddFloatPropertysel "TestFloatProperty" 1.0 )

Thanks, DJ



Replies: 0
avatar
  • KxL
  • Posted: 04 February 2009 02:27 AM

No sure which MB you use, but this is working in MB 2009:

myProp model.PropertyCreate nameFBPropertyType.kFBPT_float'Number' FalseTrueNone )


Replies: 0