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 / Import Take; Plot Control Rig; Key full-body pose; Plot skeleton; Export
  RSS 2.0 ATOM  

Import Take; Plot Control Rig; Key full-body pose; Plot skeleton; Export
Rate this thread
 
58476
 
Permlink of this thread  
avatar
  • outspend
  • Posted: 27 July 2011 08:09 AM
  • Total Posts: 10
  • Joined: 19 October 2009 04:54 AM

Hey everyone,

I’m looking to script a bit of my process:

I’d like to take my base fbx (assume:  prepared with actor snapped, character active/characterized, a certain character pose saved in the scene for looping, and my optical rom take from the pertinent mocap session loaded) and >>

- import a .c3d take from my mocap session folder (merged to existing c3d in a new take)
- plot this imported take to control rig for the scene’s character
- Apply and Key my pose to the first and last frame of this take on layer 1 of the control rig (full body)
- plot all of this to the skeleton
- export the char skeleton out with _Plotted to the take name

I’m early on in my experience with Python, but something tells me this is a fairly simple/common task to build some familiarity.  If any of you can identify what commands I will most likely need to become more familiar with, or even examples for me to look @, to accomplish the above I would appreciate it.



Replies: 1
/img/forum/dark/default_avatar.png

EDIT 1:  The constructor FBCharacterPose is creating all of my duplicate “test pose” poses...at the risk of newbing it up here, how do I just specify an existing pose rather than creating a new one as well?

EDIT 2:  Nevermind, got it - will post updated in reply.  Still having issues getting a full body key on the Control Rig.  I can apply the pose just fine, but am having trouble getting the control rig correctly selected via script so that I can lay down the key - anyone have any thoughts on this?

So far I’ve got everything but this but working.  Anyone have any help to offer RE character poses?  Specifically why the following code creates another iteration of the pose “test Pose” Every time it runs?:)
Right now I’ve just got it setup to snap to the last frame in the timeline and apply this pose - which works regardless of the aforementioned problem....though as of yet it doesn’t actually KEY the pose on that end frame.  Do I need to be more explicit to get it to key?  I’ll post my entire script once I iron out this bit.

from pyfbsdk import *
Player = FBPlayerControl()
Scene = FBSystem().Scene
System = FBSystem()
FBApplication().CurrentCharacter = FBSystem().Scene.Characters[0]
char = FBApplication().CurrentCharacter
poseName = “test Pose”

System.CurrentTake.SetCurrentLayer(1)

Player.GotoEnd ()

targetPose = FBCharacterPose(poseName)
for pose in Scene.CharacterPoses:
if pose.Name == poseName:
#found our pose
targetPose = pose
print “found targetPose: ‘%s’ in scene” % targetPose.Name

FBKeyControl().AutoKey = True
poseOptions = FBCharacterPoseOptions()
poseOptions.mCharacterPoseKeyingMode = FBCharacterPoseKeyingMode.kFBCharacterPoseKeyingModeFullBody
poseOptions.SetFlag = FBCharacterPoseFlag.kFBCharacterPoseNoFlag
targetPose.PastePose(char, poseOptions )

Author: outspend

Replied: 28 July 2011 03:02 AM  
avatar
  • OmniZ3D
  • Posted: 15 November 2011 01:43 PM

Having the same issue, with a poses and keying implemented via script.
Any progress or discoveries on this?



Replies: 0