|
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
|