MotionBuilder Forum
Welcome to Autodesk’s MotionBuilder Forums. Share your knowledge, ask questions, and explore popular MotionBuilder topics.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Editting match options in story clip in python

2 REPLIES 2
Reply
Message 1 of 3
evalinia
913 Views, 2 Replies

Editting match options in story clip in python

Hey all,

I've been hacking at it for a while now. Is there any way to edit the match options when scripting for a story clip? I.E. - Match Object, Match Time, Match Positions? Here's what I've got so far:

from pyfbsdk import *

lStory = FBStory()
story = lStory.RootFolder
for track in story.Tracks:
for clip in track.Clips:
if clip.Selected:
currentClip = clip
for affectedObjects in (currentClip.GetAffectedObjects()):
if '_root' in affectedObjects.Name:
charRoot = affectedObjects
mObj = currentClip.PropertyList.Find('Match Object')
mObj.ConnectSrc(rootJnt)
currentClip.Match()

I also have these that don't error out, but I can't find a way to edit them or even tell if they do anything (same applies for mObj above):
mClip = currentClip.PropertyList.Find('Match Clip')
mTime = currentClip.PropertyList.Find('Match Time')
mPos = currentClip.PropertyList.Find('Match Position')

I saw in the documentation that the Match property relies on specified pivot property of the animation clip, but that road is currently going nowhere.

Any help would be greatly appreciated!
2 REPLIES 2
Message 2 of 3
Phil.Hook
in reply to: evalinia

It's been a while since this question was raised, but thought I'd throw this in for future reference (since I just figured it out myself =P)...

 

'currentClip.PropertyList.Find('Match Object')' will return a FBPropertyListObject...

 

Use the GetSrc(<index>) method to get the actual object, and ReplaceSrcAt(<index>, <object>) method to replace it...

 

I imagine Match Time, Match Position will be much the same...

 

Cheers,

Phil

 

 

Message 3 of 3
evalinia
in reply to: Phil.Hook

Hi Phil!

 

It works out because I still hadn't cracked it! I'll take a look asap and report back. Thanks for replying back after all this time!

 

Cheers, 

Evelyn

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report