save or export the selection with characters

save or export the selection with characters

ljc091111
Explorer Explorer
365 Views
2 Replies
Message 1 of 3

save or export the selection with characters

ljc091111
Explorer
Explorer

hi,

I  am working on python script, I have a fbx with three different characters, I want to save or export only one characters or the selection to  a  new fbx. Could you help me with some ideas how it could be achieved? Thank you.

0 Likes
366 Views
2 Replies
Replies (2)
Message 2 of 3

Mocappy
Advocate
Advocate

Hi,

Depends how your scene is set up, but a couple of options:

Namespaces - Easiest options is to put all the objects belonging to the character in a unique CHARACTER_NAMEPSACE. Then you can use FBSystem().Scene.NamespaceSelectContent(CHARACTER_NAMEPSACE, True) to select all the character objects, and then set FBFbxOptions SaveSelectedModelsOnly = True and FBApplication().FileSave to FILE_PATH, using FBFbxOptions to set save options for the file.

 

Hierachy - assuming all your characters are parented under single hierarchies, you could select the entire hierarchy and then SaveSelectedModelsOnly.

 

Characters - more complicated, but you can get a list of FBSystem().Scene.Characters, and then for each CHARACTER, get each nodeID in FBBodyNodeId.values.values() and then use nodeID to GetModel in CHARACTER and select it. Then  SaveSelectedModelsOnly.

 

Hopefully, one of these helps,

 

0 Likes
Message 3 of 3

ljc091111
Explorer
Explorer

thx

0 Likes