FBX Importer: Allow changes to bone orientation during import, allow ignoring "end" bones added by some modellers.

Revision: D732

Patch by jrestemeier (Jens Restemeier).
This commit is contained in:
Bastien Montagne 2014-09-08 14:32:41 +02:00
parent 0edbcbca6c
commit a6916776e7
3 changed files with 864 additions and 504 deletions

View File

@ -135,6 +135,42 @@ class ImportFBX_experimental(bpy.types.Operator, ImportHelper):
options={'HIDDEN'},
)
ignore_leaf_bones = BoolProperty(
name="Ignore leaf bones",
description="Ignore the last bone at the end of a chain that is used to mark the length of the previous bone",
default=False,
options={'HIDDEN'},
)
automatic_bone_orientation = BoolProperty(
name="Automatic Bone Orientation",
description="Try to align the major bone axis with the bone children",
default=False,
options={'HIDDEN'},
)
primary_bone_axis = EnumProperty(
name="Primary Bone Axis",
items=(('X', "X Axis", ""),
('Y', "Y Axis", ""),
('Z', "Z Axis", ""),
('-X', "-X Axis", ""),
('-Y', "-Y Axis", ""),
('-Z', "-Z Axis", ""),
),
default='Y',
)
secondary_bone_axis = EnumProperty(
name="Secondary Bone Axis",
items=(('X', "X Axis", ""),
('Y', "Y Axis", ""),
('Z', "Z Axis", ""),
('-X', "-X Axis", ""),
('-Y', "-Y Axis", ""),
('-Z', "-Z Axis", ""),
),
default='X',
)
def draw(self, context):
layout = self.layout
@ -154,6 +190,14 @@ class ImportFBX_experimental(bpy.types.Operator, ImportHelper):
sub.enabled = self.use_custom_props
sub.prop(self, "use_custom_props_enum_as_string")
layout.prop(self, "ignore_leaf_bones")
layout.prop(self, "automatic_bone_orientation"),
sub = layout.column()
sub.enabled = not self.automatic_bone_orientation
sub.prop(self, "primary_bone_axis")
sub.prop(self, "secondary_bone_axis")
def execute(self, context):
print("Using EXPERIMENTAL FBX export!")
keywords = self.as_keywords(ignore=("filter_glob", "directory"))

View File

@ -1100,5 +1100,7 @@ FBXImportSettings = namedtuple("FBXImportSettings", (
"use_cycles", "use_image_search",
"use_alpha_decals", "decal_offset",
"use_custom_props", "use_custom_props_enum_as_string",
"object_tdata_cache", "cycles_material_wrap_map", "image_cache",
"cycles_material_wrap_map", "image_cache",
"ignore_leaf_bones",
"automatic_bone_orientation", "bone_correction_matrix"
))

File diff suppressed because it is too large Load Diff