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: 

Plot All

1 REPLY 1
Reply
Message 1 of 2
maudrain
387 Views, 1 Reply

Plot All

Hi all,

 

I want to make a "PlotAll" on file loaded with the script and it doesn't work.

When I launch the script on a already loaded file it works but when i load the file with the script it doesn't work.

 

This code doesn't works :

 

lApp.FileOpen(lApp.FBXFileName, False, loadOptions)

character = FBApplication().CurrentCharacter

lStory = FBStory()

 

for comp in lSystem.Scene.Components:

if comp.ClassName() in ["FBModelSkeleton","FBConstraint", "FBCharacter","FBCharacterExtension","FBModel"] :

#print comp.ClassName()

comp.Selected = True

 

currentTake = lSystem.CurrentTake

currentTake.PlotAllTakesOnSelected(FBTime(0,0,0,1))

 

If I delete the OpenFile Line and plot the current OpenFile it works.

 

Do you have some clues?

Thanks

Tags (2)
1 REPLY 1
Message 2 of 2
TheAnti-Fish
in reply to: maudrain

Hello,

 

The line of code - lApp.FBXFileName - re-opens the current file. It also relies on the current file having been saved. Which is why it only works on an already loaded file.

  

If your file isn't saved, or you don't have a saved file open, it'll crash.

 

To work around this you'll have to either specify a file to open before plotting or iterate though a file/folder/list of files.

 

 

The Anti-Fish

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

Post to forums  

Autodesk Design & Make Report