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: 

Script equivalent of "Plot All (all Properties)"?

7 REPLIES 7
Reply
Message 1 of 8
ZoltanE
1366 Views, 7 Replies

Script equivalent of "Plot All (all Properties)"?

What is the script equivalent of the "Plot All (all Properties)"
menu item?

I checked out quite a few scripts but I only saw examples for
plotting on characters by calling the PlotAnimation() function.

I could iterate through all animated objects and plot each one
but I reckon a more direct solution would be faster.
7 REPLIES 7
Message 2 of 8
sismikkk
in reply to: ZoltanE

Up ! 6 years later...

Message 3 of 8
evan.cox
in reply to: sismikkk

Populate your list of selected objects...
objs = # your list here
pyfbsdk.FBSystem().CurrentTake.PlotTakeOnObjects( pyfbsdk.FBTime(0,0,0,0), objs )
Message 4 of 8
sismikkk
in reply to: evan.cox

It tells me 

AttributeError: 'FBTake' object has no attribute 'PlotTakeOnObjects'

I had the same issue when trying to use "PlotAllTakesOnProperties". Only method i could use was "PlotAllTakesOnSelectedProperties".

But then i couldn't manage to get all properties selected with this code :

 

gplot = FBPlotOptions ()
gplot.PlotPeriod = FBTime(0,0,0,1)

modelList = FBModelList ()
FBGetSelectedModels (modelList, None, True)
for model in modelList:

    propList = model.PropertyList
    for prop in propList:
        prop.Selected = True
        prop.SetFocus(True)
        
FBSystem().CurrentTake.PlotAllTakesOnSelectedProperties(gplot.PlotPeriod)

Neither 

prop.Selected = True

or

prop.SetFocus(True)

worked =/ 

Message 5 of 8
sismikkk
in reply to: sismikkk

Ok so my previous code didn't return me any model cause no model were selected, so i replaced it with 

for model in FBSystem().Scene.RootModel.Children:

Now i get all the models i'm interested in but still none of prop.Selected = True or prop.SetFocus(True) works.

Message 6 of 8
sismikkk
in reply to: sismikkk

And i just found out that i can't use PlotAllTakesOnProperties because this function is not present in motionbuilder 2013 (that i'm using) and i was reading the 2014 motionbuilder documentation =(

Message 7 of 8
bujinkan02
in reply to: sismikkk

Hi,

 

I've tried this code and it seems to work fine (Mobu 2013 SP2). You don't need to set the focus on the property you want to plot, the selected attribute is enough, SetFocus just highlight the property in the property editor GUI.

 

from pyfbsdk import *

gplot = FBPlotOptions ()
gplot.PlotPeriod = FBTime(0,0,0,1)

modelList = FBModelList ()
FBGetSelectedModels (modelList, None, True)

for model in modelList:
    propList = model.PropertyList
    for prop in propList:
        prop.Selected = True

FBSystem().CurrentTake.PlotAllTakesOnSelectedProperties(gplot.PlotPeriod)

Cheers

Message 8 of 8
sismikkk
in reply to: bujinkan02

Thank you ! I used another way but your code works too !

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

Post to forums  

Autodesk Design & Make Report