quebrado,
Many thanks for your update and generous amount of information. It really did helped!
I managed to write a tool for our animators to be able to merge multiply takes within a single MB scene to edit. Once edits had been completed, the animator could export all the takes back to their original locations with a single click of a button. 12 take edits would of taken around 10 minutes to export. This new feature does it in 10 seconds. I also, setup FBX settings which I wont go into detail.
Here is a sample of the create attribute code I used. It should help others in the future:
def create_savepath_property(fbobject, path: str) -> None:
"""
Description: When merging animations within a MB scene, being able to save the individual takes source path location will
helps to export to the take to it's correct location. Especially when exporting multi takes.
How: Function creates a Property (attribute) called SavePath with a string argument!
This argument being the takes source path!
Param:
fbobject = FBTake.
path = Property string argument. This will be the takes source path location
"""
# Check property SavePath does not exist to avoid creating a property copy!
try:
# update existing property argument if it exists!
fbobject.PropertyList.Find('SavePath').Data = path
print(f"\n{fbobject.Name} has the following property arugment updated!")
print(f"Property: SavePath Argument: {path}\n\n")
except AttributeError:
# Create property and argument!
# Explanation of property syntax for fbobject.PropertyCreate()
# Parameters:
# SavePath - The name of the property.
# FBPropertyType.kFBPT_charptr - Type of the property see enum FBPropertyType.
# 'String' - DataType of the property is a text define in ANIMATIONNODE_TYPE_??? in fbdata.h.
# False - To specify if the property can be animated.
# True - To specify if the property is available as a custom property or dynamic and attached to the object.
# None - Use that param to specify the property that a reference refer to.
# Create property and argument!
fbobject.PropertyCreate('SavePath', FBPropertyType.kFBPT_charptr, 'String', False, True, None)
fbobject.PropertyList.Find('SavePath').Data = path
print(f"\n{fbobject.Name} has the following property and argument added!")
print(f"Property: SavePath Argument: {path}\n\n")
def get_savepath_argument(fbobject)-> str:
"""
Description: Querys a take's SavePath property argument, that being a the takes source string path!
Note: SavePath needs to be created beforehand. Merging takes will be the best time
to create the property and it's argument value.
param: fbobject, FBTake
"""
try:
argument = fbobject.PropertyList.Find('SavePath').Data
return argument
except AttributeError:
# Add your code here for errors!
pass