Motionbuilder: Way to play one take after the next? ( Python )


I’ve been trying to find a way to trigger a command after the timeline has finished playing. My goal being to build a tool which allows me to play multiple takes one after the other.

Has anyhow done anything similar or could point me in the right direction?

Thanks for your help.


I’m sure you can trigger it off with a script, but I’m not sure how to get the signal from the play button itself.

from pyfbsdk import *
import time
player_control = FBPlayerControl()
for each_take in FBSystem().Scene.Takes:
    # Set current take
    FBSystem().CurrentTake = each_take
    while player_control.IsPlaying:

The only annoying thing is, if I triggered the player_control.Play(), then queried the player_control.IsPlaying, it was also return False unless I added the time.sleep() in there… But then this made the UI appear to freeze throughout the takes so you can’t actually see the player playing :confused:


Thanks Ryan, yeah I was getting similar issues to you. I have been playing with the system.OnUIIdle.Add and I thin that might be the key, but I haven’t got it to work yet.