Fix T69482: Fbx export crashes blender

Reviewers: Severin

Maniphest Tasks: T69482

Differential Revision: https://developer.blender.org/D5671
This commit is contained in:
Philipp Oeser 2019-09-04 12:46:01 +02:00
parent 01e5dd5dd8
commit e4f2d4b179
Notes: blender-bot 2023-02-14 00:56:28 +01:00
Referenced by issue blender/blender#69482, Fbx export crashes blender
1 changed files with 23 additions and 24 deletions

View File

@ -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)")