How not to merge takes while merging two files in python

How not to merge takes while merging two files in python

Anonymous
Not applicable
1,012 Views
1 Reply
Message 1 of 2

How not to merge takes while merging two files in python

Anonymous
Not applicable

Hi,

 

I am trying to merge a rig file to an animation file.

However, I want not to merge the takes of the rig file. In GUI, I can just uncheck the takes and merge the file, but I am having problem do the same in python.

 

I got following code:

 

#Open animation file first
lFbxOptions = FBFbxOptions(True) 
FBApplication().FileOpen(AnimationFile,False,lFbxOptions)


#Setup options for merge
FbxMergeOptions = FBFbxOptions(True)
FbxMergeOptions.SetAll(FBElementAction.kFBElementActionMerge, True);
FBApplication().FileMerge(rigFile, False, FbxMergeOptions)

I got some suggestion in the forum to unselect the takes using following code:

 

for takeIndex in range( 0, FbxMergeOptions.GetTakeCount() ):
         FbxMergeOptions.SetTakeSelect( takeIndex, False )

But GetTakeCount() is always returning 0. 

 

So what is the correct way to unselect the takes while merging a second file using python script?

 

Thanks. 

0 Likes
1,013 Views
1 Reply
Reply (1)
Message 2 of 2

Anonymous
Not applicable

It looks like, GetTakeCount is dependent on how FBFbxOption was initialized in the constructor.

I was thinking to merge a 2nd file I would need to initialize using 'True' parameter as True is supposed to used as loading option.

However, it is working if I Init it using False (which is for saving)!

 

  

0 Likes