from pyfbsdk import *
takes = FBSystem().Scene.Takes
numTakes = len(takes)
#new order for takes, this will swap the 2nd and 3rd positions
newOrder =
#copy takes in the new order you want them
for index in newOrder:
FBSystem().CurrentTake = takes
FBSystem().CurrentTake.CopyTake("%s_temp" % takes.Name)
#delete the old takes
for x in range(0,numTakes):
takes.FBDelete()
#remove the "_temp" from the take names
for take in takes:
take.Name = take.Name
In the Navigator Windos, open Takes section. There, you'll be able to rename all takes like any other component. Also, you may be able to rearrange take's orthers too.
I'm also interested in this, maybe someone has idea how to do this? 🙂
I'm trying to make Takes manager tool, and would be great if python would also allow to change order of takes.
re-indexing takes seems to be something MotionBuilder allows the user to do only through manually sorting via the Navigator.
some ways you could try to change this:
Duplicate takes and delete the originals:
- make a list of all takes
- duplicate them is the specific order you want them to be in
- delete the original takes that are in your list
** as for the take properties, you could recreate those properties via script on to each take before deleting the original takes
You could try to save out takes into different files and then merge them in the order you want them- This would be a very long process compared to duplicating and recreating the properties. the time is would take to save out each take as their own file and then create a new scene and merge each file in one at a time in the order you want would be VERY VERY timely.
Answered on another forum so posting here for visibility in future.
The easiest option IMO is to disconnect and reconnect the takes from the FBScene in the desired order. You may need to force some evaluations to ensure all relevant callbacks are made.
Wow, thanks for this solution! I just tried it and it works perfectly.
take.DisconnectDst(self.FBScene)
take.ConnectDst(self.FBScene)
Do you have some more experience with this? Is it stable and safe for use "in production" ? 🙂
BTW. I also found that it is possible to just narrow down the search to only Takes list, not the whole Scene, which seems a bit more safe and works even faster in bigger scenes...
TakesList = FBSystem().Scene.Takes[0].GetDst(1)
take.DisconnectDst(TakesList)
take.ConnectDst(TakesList)
In this case FBSystem().Scene.Takes[0].GetDst(1) give me pointer to Takes List plug, so I can reorder takes components only in this smaller part of scene, not whole scene.
Thanks again for this idea, I would never figured that out. FBPlug was black magic to me 😄
Can't find what you're looking for? Ask the community or share your knowledge.