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® / Autodesk MotionBuilder 2009 / quick script for plot to skeleton, plot to control rig
  RSS 2.0 ATOM  

quick script for plot to skeleton, plot to control rig
Rate this thread
 
19748
 
Permlink of this thread  
avatar
  • abedford
  • Posted: 27 November 2008 10:50 PM
  • Total Posts: 21
  • Joined: 11 February 2007 11:31 PM

Hi guys, okay, does anyone know of a script whereby you can plot to control rig and back to skeleton in like a hotkey? I have to work with a lot of files, and find plotting laborious, unless you want to plot to all takes but thats overkill, and i have to use constraints in some takes and not in others so thats not an option.

Cheers.



Replies: 0
avatar
  • KxL
  • Posted: 28 November 2008 03:59 AM

It should be something like that (you need to select character in scene):

from pyfbsdk import *

lOptions FBPlotOptions()
lOptions.ConstantKeyReducerKeepOneKey True
lOptions
.PlotAllTakes False
lOptions
.PlotOnFrame True
lOptions
.PlotPeriod FBTime000)
lOptions.PlotTranslationOnRootOnly True
lOptions
.PreciseTimeDiscontinuities True
lOptions
.RotationFilterToApply FBRotationFilter.kFBRotationFilterGimbleKiller
lOptions
.UseConstantKeyReducer True


for lCharacter in FBSystem().Scene.Characters:
    if 
lCharacter.Selected == True:
        
lCharacter.PlotAnimation (FBCharacterPlotWhere.kFBCharacterPlotOnSkeleton,lOptions )
        lCharacter
.PlotAnimation (FBCharacterPlotWhere.kFBCharacterPlotOnControlRig,lOptions )

PS. IMHO you should post this in Python section :)



Replies: 0
avatar
  • sin3d
  • Posted: 10 December 2008 02:24 PM

ha, this is the first script I wrote, just found this post. I have quite similar way but without have to select the character. I haven’t put this script into production yet, if you found any mistake please let me know.

from pyfbsdk import *

myPlotOptions FBPlotOptions ()
myPlotOptions.ConstantKeyReducerKeepOneKey False
myPlotOptions
.PlotAllTakes False
myPlotOptions
.PlotOnFrame True
myPlotOptions
.PlotPeriod FBTime 000)
myPlotOptions.PlotTranslationOnRootOnly False
myPlotOptions
.PreciseTimeDiscontinuities False
myPlotOptions
.RotationFilterToApply FBRotationFilter.kFBRotationFilterNone
myPlotOptions
.UseConstantKeyReducer False

TheChar 
FBApplication().CurrentCharacter
if TheChar.ActiveInput == True:
    
TheChar.PlotAnimation(FBCharacterPlotWhere.kFBCharacterPlotOnSkeletonmyPlotOptions)
else:
    
TheChar.PlotAnimation(FBCharacterPlotWhere.kFBCharacterPlotOnControlRigmyPlotOptions)

Then raise to my question I posted in the Python forum, how to assign a hotkey to this script?



Replies: 0
avatar
  • abedford
  • Posted: 10 December 2008 04:39 PM

cheers guys, yeah ive got that working now, awesome. Yeah having this in some hotkey would be awesome, but its still a lot better than my current workflow.

To plot onto skel and then back i just copied the script and re-pasted it into the same script and seems to work fine.

yeah, so… hot key anyone :)



Replies: 0
avatar
  • sin3d
  • Posted: 11 December 2008 12:53 AM

I posted the answer in Python forum....remember you need to edit the scripts Plotting options above to your needs.
http://area.autodesk.com/for...t-to-python-script/#95952



Replies: 0