From 85baac63f2343a97065ed4dc35b53cbe82a15cc5 Mon Sep 17 00:00:00 2001 From: othomson-roblox <64273528+othomson-roblox@users.noreply.github.com> Date: Wed, 29 Nov 2023 14:11:51 -0800 Subject: [PATCH] Support necessary export settings to import dynamic heads (#38) * Override with the correct region when grabbing selected object ids from different areas * Support add_leaf_bones and use_custom_props FBX export settings --- __init__.py | 23 ++++++++++++++++++++++- lib/export_fbx.py | 2 ++ 2 files changed, 24 insertions(+), 1 deletion(-) diff --git a/__init__.py b/__init__.py index 2e5f5a6..55e39ec 100644 --- a/__init__.py +++ b/__init__.py @@ -147,9 +147,30 @@ class RbxAddonPreferences(AddonPreferences): soft_max=10.0, default=1.0, # default: min slope: 0.005, max frame step: 10. ) + add_leaf_bones: BoolProperty( + name="Add Leaf Bones", + description="Append a final bone to the end of each chain to specify last bone length (use this when you intend to edit the armature from exported data)", + default=True, + ) + use_custom_props: BoolProperty( + name="Custom Properties", + description="Export Custom Properties", + default=True, + ) def draw(self, context): - self.layout.prop(self, "export_scale") + self.layout.label(text="Include") + include_box = self.layout.box() + include_box.prop(self, "use_custom_props") + + self.layout.label(text="Transform") + transform_box = self.layout.box() + transform_box.prop(self, "export_scale") + + self.layout.label(text="Armature") + armature_box = self.layout.box() + armature_box.prop(self, "add_leaf_bones") + self.layout.prop(self, "bake_anim", text="Bake Animation") bake_anim_box = self.layout.box() bake_anim_box.use_property_split = True diff --git a/lib/export_fbx.py b/lib/export_fbx.py index 44020b9..4ce8237 100644 --- a/lib/export_fbx.py +++ b/lib/export_fbx.py @@ -73,6 +73,8 @@ def export_fbx(scene, view_layer, target_object, exported_file_path, preferences path_mode="COPY", embed_textures=True, use_active_collection=True, + add_leaf_bones=preferences.add_leaf_bones, + use_custom_props=preferences.use_custom_props, ) finally: # Return to the previous active LayerCollection