Bone parenting fixed, anm2 reading, menu option for anim import

This commit is contained in:
William Herald Snyder
2020-12-05 00:53:59 -05:00
parent 30bf326b9e
commit c0c978af8b
7 changed files with 89 additions and 75 deletions

View File

@@ -151,9 +151,22 @@ class ImportMSH(Operator, ImportHelper):
maxlen=255, # Max internal buffer length, longer would be clamped.
)
animation_only: BoolProperty(
name="Import Animation Only",
description="Import animation and append as a new action to currently selected armature.",
default=False
)
def execute(self, context):
with open(self.filepath, 'rb') as input_file:
extract_scene(self.filepath, read_scene(input_file))
scene = read_scene(input_file, self.animation_only)
if not self.animation_only:
extract_scene(self.filepath, scene)
else:
extract_and_apply_anim(self.filepath, scene)
return {'FINISHED'}
def menu_func_import(self, context):