From e4f2d4b1791d3688be19dde03c01d47ee3718c0c Mon Sep 17 00:00:00 2001 From: Philipp Oeser Date: Wed, 4 Sep 2019 12:46:01 +0200 Subject: Fix T69482: Fbx export crashes blender Reviewers: Severin Maniphest Tasks: T69482 Differential Revision: https://developer.blender.org/D5671 --- io_scene_fbx/__init__.py | 47 +++++++++++++++++++++++------------------------ 1 file changed, 23 insertions(+), 24 deletions(-) (limited to 'io_scene_fbx') diff --git a/io_scene_fbx/__init__.py b/io_scene_fbx/__init__.py index 7f89ef3a..20ea9987 100644 --- a/io_scene_fbx/__init__.py +++ b/io_scene_fbx/__init__.py @@ -593,6 +593,29 @@ class ExportFBX(bpy.types.Operator, ExportHelper): def draw(self, context): pass + @property + def check_extension(self): + return self.batch_mode == 'OFF' + + def execute(self, context): + from mathutils import Matrix + if not self.filepath: + raise Exception("filepath not set") + + global_matrix = (axis_conversion(to_forward=self.axis_forward, + to_up=self.axis_up, + ).to_4x4()) + + keywords = self.as_keywords(ignore=("check_existing", + "filter_glob", + "ui_tab", + )) + + keywords["global_matrix"] = global_matrix + + from . import export_fbx_bin + return export_fbx_bin.save(self, context, **keywords) + class FBX_PT_export_main(bpy.types.Panel): bl_space_type = 'FILE_BROWSER' @@ -785,30 +808,6 @@ class FBX_PT_export_bake_animation(bpy.types.Panel): layout.prop(operator, "bake_anim_simplify_factor") - @property - def check_extension(self): - return self.batch_mode == 'OFF' - - def execute(self, context): - from mathutils import Matrix - if not self.filepath: - raise Exception("filepath not set") - - global_matrix = (axis_conversion(to_forward=self.axis_forward, - to_up=self.axis_up, - ).to_4x4()) - - keywords = self.as_keywords(ignore=("check_existing", - "filter_glob", - "ui_tab", - )) - - keywords["global_matrix"] = global_matrix - - from . import export_fbx_bin - return export_fbx_bin.save(self, context, **keywords) - - def menu_func_import(self, context): self.layout.operator(ImportFBX.bl_idname, text="FBX (.fbx)") -- cgit v1.2.3