1 # ##### BEGIN GPL LICENSE BLOCK #####
3 # This program is free software; you can redistribute it and/or
4 # modify it under the terms of the GNU General Public License
5 # as published by the Free Software Foundation; either version 2
6 # of the License, or (at your option) any later version.
8 # This program is distributed in the hope that it will be useful,
9 # but WITHOUT ANY WARRANTY; without even the implied warranty of
10 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 # GNU General Public License for more details.
13 # You should have received a copy of the GNU General Public License
14 # along with this program; if not, write to the Free Software Foundation,
15 # Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
17 # ##### END GPL LICENSE BLOCK #####
23 "author": "Campbell Barton, Bastien Montagne, Jens Restemeier",
24 "version": (4, 20, 3),
25 "blender": (2, 81, 6),
26 "location": "File > Import-Export",
27 "description": "FBX IO meshes, UV's, vertex colors, materials, textures, cameras, lamps and actions",
29 "doc_url": "{BLENDER_MANUAL_URL}/addons/import_export/scene_fbx.html",
30 "support": 'OFFICIAL',
31 "category": "Import-Export",
37 if "import_fbx" in locals():
38 importlib
.reload(import_fbx
)
39 if "export_fbx_bin" in locals():
40 importlib
.reload(export_fbx_bin
)
41 if "export_fbx" in locals():
42 importlib
.reload(export_fbx
)
46 from bpy
.props
import (
53 from bpy_extras
.io_utils
import (
62 @orientation_helper(axis_forward
='-Z', axis_up
='Y')
63 class ImportFBX(bpy
.types
.Operator
, ImportHelper
):
65 bl_idname
= "import_scene.fbx"
66 bl_label
= "Import FBX"
67 bl_options
= {'UNDO', 'PRESET'}
69 directory
: StringProperty()
72 filter_glob
: StringProperty(default
="*.fbx", options
={'HIDDEN'})
74 files
: CollectionProperty(
76 type=bpy
.types
.OperatorFileListElement
,
80 items
=(('MAIN', "Main", "Main basic settings"),
81 ('ARMATURE', "Armatures", "Armature-related settings"),
84 description
="Import options categories",
87 use_manual_orientation
: BoolProperty(
88 name
="Manual Orientation",
89 description
="Specify orientation and scale, instead of using embedded data in FBX file",
92 global_scale
: FloatProperty(
94 min=0.001, max=1000.0,
97 bake_space_transform
: BoolProperty(
98 name
="!EXPERIMENTAL! Apply Transform",
99 description
="Bake space transform into object data, avoids getting unwanted rotations to objects when "
100 "target space is not aligned with Blender's space "
101 "(WARNING! experimental option, use at own risks, known broken with armatures/animations)",
105 use_custom_normals
: BoolProperty(
106 name
="Import Normals",
107 description
="Import custom normals, if available (otherwise Blender will recompute them)",
111 use_image_search
: BoolProperty(
113 description
="Search subdirs for any associated images (WARNING: may be slow)",
117 use_alpha_decals
: BoolProperty(
119 description
="Treat materials with alpha as decals (no shadow casting)",
122 decal_offset
: FloatProperty(
124 description
="Displace geometry of alpha meshes",
129 use_anim
: BoolProperty(
130 name
="Import Animation",
131 description
="Import FBX animation",
134 anim_offset
: FloatProperty(
135 name
="Animation Offset",
136 description
="Offset to apply to animation during import, in frames",
140 use_subsurf
: BoolProperty(
141 name
="Import Subdivision Surface",
142 description
="Import FBX subdivision information as subdivision surface modifiers",
146 use_custom_props
: BoolProperty(
147 name
="Import User Properties",
148 description
="Import user properties as custom properties",
151 use_custom_props_enum_as_string
: BoolProperty(
152 name
="Import Enums As Strings",
153 description
="Store enumeration values as strings",
157 ignore_leaf_bones
: BoolProperty(
158 name
="Ignore Leaf Bones",
159 description
="Ignore the last bone at the end of each chain (used to mark the length of the previous bone)",
162 force_connect_children
: BoolProperty(
163 name
="Force Connect Children",
164 description
="Force connection of children bones to their parent, even if their computed head/tail "
165 "positions do not match (can be useful with pure-joints-type armatures)",
168 automatic_bone_orientation
: BoolProperty(
169 name
="Automatic Bone Orientation",
170 description
="Try to align the major bone axis with the bone children",
173 primary_bone_axis
: EnumProperty(
174 name
="Primary Bone Axis",
175 items
=(('X', "X Axis", ""),
178 ('-X', "-X Axis", ""),
179 ('-Y', "-Y Axis", ""),
180 ('-Z', "-Z Axis", ""),
184 secondary_bone_axis
: EnumProperty(
185 name
="Secondary Bone Axis",
186 items
=(('X', "X Axis", ""),
189 ('-X', "-X Axis", ""),
190 ('-Y', "-Y Axis", ""),
191 ('-Z', "-Z Axis", ""),
196 use_prepost_rot
: BoolProperty(
197 name
="Use Pre/Post Rotation",
198 description
="Use pre/post rotation from FBX transform (you may have to disable that in some cases)",
202 def draw(self
, context
):
205 def execute(self
, context
):
206 keywords
= self
.as_keywords(ignore
=("filter_glob", "directory", "ui_tab", "filepath", "files"))
208 from . import import_fbx
213 dirname
= os
.path
.dirname(self
.filepath
)
214 for file in self
.files
:
215 path
= os
.path
.join(dirname
, file.name
)
216 if import_fbx
.load(self
, context
, filepath
=path
, **keywords
) == {'FINISHED'}:
220 return import_fbx
.load(self
, context
, filepath
=self
.filepath
, **keywords
)
223 class FBX_PT_import_include(bpy
.types
.Panel
):
224 bl_space_type
= 'FILE_BROWSER'
225 bl_region_type
= 'TOOL_PROPS'
227 bl_parent_id
= "FILE_PT_operator"
230 def poll(cls
, context
):
231 sfile
= context
.space_data
232 operator
= sfile
.active_operator
234 return operator
.bl_idname
== "IMPORT_SCENE_OT_fbx"
236 def draw(self
, context
):
238 layout
.use_property_split
= True
239 layout
.use_property_decorate
= False # No animation.
241 sfile
= context
.space_data
242 operator
= sfile
.active_operator
244 layout
.prop(operator
, "use_custom_normals")
245 layout
.prop(operator
, "use_subsurf")
246 layout
.prop(operator
, "use_custom_props")
248 sub
.enabled
= operator
.use_custom_props
249 sub
.prop(operator
, "use_custom_props_enum_as_string")
250 layout
.prop(operator
, "use_image_search")
253 class FBX_PT_import_transform(bpy
.types
.Panel
):
254 bl_space_type
= 'FILE_BROWSER'
255 bl_region_type
= 'TOOL_PROPS'
256 bl_label
= "Transform"
257 bl_parent_id
= "FILE_PT_operator"
260 def poll(cls
, context
):
261 sfile
= context
.space_data
262 operator
= sfile
.active_operator
264 return operator
.bl_idname
== "IMPORT_SCENE_OT_fbx"
266 def draw(self
, context
):
268 layout
.use_property_split
= True
269 layout
.use_property_decorate
= False # No animation.
271 sfile
= context
.space_data
272 operator
= sfile
.active_operator
274 layout
.prop(operator
, "global_scale")
275 layout
.prop(operator
, "decal_offset")
276 layout
.prop(operator
, "bake_space_transform")
277 layout
.prop(operator
, "use_prepost_rot")
280 class FBX_PT_import_transform_manual_orientation(bpy
.types
.Panel
):
281 bl_space_type
= 'FILE_BROWSER'
282 bl_region_type
= 'TOOL_PROPS'
283 bl_label
= "Manual Orientation"
284 bl_parent_id
= "FBX_PT_import_transform"
287 def poll(cls
, context
):
288 sfile
= context
.space_data
289 operator
= sfile
.active_operator
291 return operator
.bl_idname
== "IMPORT_SCENE_OT_fbx"
293 def draw_header(self
, context
):
294 sfile
= context
.space_data
295 operator
= sfile
.active_operator
297 self
.layout
.prop(operator
, "use_manual_orientation", text
="")
299 def draw(self
, context
):
301 layout
.use_property_split
= True
302 layout
.use_property_decorate
= False # No animation.
304 sfile
= context
.space_data
305 operator
= sfile
.active_operator
307 layout
.enabled
= operator
.use_manual_orientation
309 layout
.prop(operator
, "axis_forward")
310 layout
.prop(operator
, "axis_up")
313 class FBX_PT_import_animation(bpy
.types
.Panel
):
314 bl_space_type
= 'FILE_BROWSER'
315 bl_region_type
= 'TOOL_PROPS'
316 bl_label
= "Animation"
317 bl_parent_id
= "FILE_PT_operator"
318 bl_options
= {'DEFAULT_CLOSED'}
321 def poll(cls
, context
):
322 sfile
= context
.space_data
323 operator
= sfile
.active_operator
325 return operator
.bl_idname
== "IMPORT_SCENE_OT_fbx"
327 def draw_header(self
, context
):
328 sfile
= context
.space_data
329 operator
= sfile
.active_operator
331 self
.layout
.prop(operator
, "use_anim", text
="")
333 def draw(self
, context
):
335 layout
.use_property_split
= True
336 layout
.use_property_decorate
= False # No animation.
338 sfile
= context
.space_data
339 operator
= sfile
.active_operator
341 layout
.enabled
= operator
.use_anim
343 layout
.prop(operator
, "anim_offset")
346 class FBX_PT_import_armature(bpy
.types
.Panel
):
347 bl_space_type
= 'FILE_BROWSER'
348 bl_region_type
= 'TOOL_PROPS'
349 bl_label
= "Armature"
350 bl_parent_id
= "FILE_PT_operator"
351 bl_options
= {'DEFAULT_CLOSED'}
354 def poll(cls
, context
):
355 sfile
= context
.space_data
356 operator
= sfile
.active_operator
358 return operator
.bl_idname
== "IMPORT_SCENE_OT_fbx"
360 def draw(self
, context
):
362 layout
.use_property_split
= True
363 layout
.use_property_decorate
= False # No animation.
365 sfile
= context
.space_data
366 operator
= sfile
.active_operator
368 layout
.prop(operator
, "ignore_leaf_bones")
369 layout
.prop(operator
, "force_connect_children"),
370 layout
.prop(operator
, "automatic_bone_orientation"),
371 sub
= layout
.column()
372 sub
.enabled
= not operator
.automatic_bone_orientation
373 sub
.prop(operator
, "primary_bone_axis")
374 sub
.prop(operator
, "secondary_bone_axis")
377 @orientation_helper(axis_forward
='-Z', axis_up
='Y')
378 class ExportFBX(bpy
.types
.Operator
, ExportHelper
):
379 """Write a FBX file"""
380 bl_idname
= "export_scene.fbx"
381 bl_label
= "Export FBX"
382 bl_options
= {'UNDO', 'PRESET'}
384 filename_ext
= ".fbx"
385 filter_glob
: StringProperty(default
="*.fbx", options
={'HIDDEN'})
387 # List of operator properties, the attributes will be assigned
388 # to the class instance from the operator settings before calling.
390 use_selection
: BoolProperty(
391 name
="Selected Objects",
392 description
="Export selected and visible objects only",
395 use_active_collection
: BoolProperty(
396 name
="Active Collection",
397 description
="Export only objects from the active collection (and its children)",
400 global_scale
: FloatProperty(
402 description
="Scale all data (Some importers do not support scaled armatures!)",
403 min=0.001, max=1000.0,
404 soft_min
=0.01, soft_max
=1000.0,
407 apply_unit_scale
: BoolProperty(
409 description
="Take into account current Blender units settings (if unset, raw Blender Units values are used as-is)",
412 apply_scale_options
: EnumProperty(
413 items
=(('FBX_SCALE_NONE', "All Local",
414 "Apply custom scaling and units scaling to each object transformation, FBX scale remains at 1.0"),
415 ('FBX_SCALE_UNITS', "FBX Units Scale",
416 "Apply custom scaling to each object transformation, and units scaling to FBX scale"),
417 ('FBX_SCALE_CUSTOM', "FBX Custom Scale",
418 "Apply custom scaling to FBX scale, and units scaling to each object transformation"),
419 ('FBX_SCALE_ALL', "FBX All",
420 "Apply custom scaling and units scaling to FBX scale"),
422 name
="Apply Scalings",
423 description
="How to apply custom and units scalings in generated FBX file "
424 "(Blender uses FBX scale to detect units on import, "
425 "but many other applications do not handle the same way)",
427 bake_space_transform
: BoolProperty(
428 name
="!EXPERIMENTAL! Apply Transform",
429 description
="Bake space transform into object data, avoids getting unwanted rotations to objects when "
430 "target space is not aligned with Blender's space "
431 "(WARNING! experimental option, use at own risks, known broken with armatures/animations)",
435 object_types
: EnumProperty(
437 options
={'ENUM_FLAG'},
438 items
=(('EMPTY', "Empty", ""),
439 ('CAMERA', "Camera", ""),
440 ('LIGHT', "Lamp", ""),
441 ('ARMATURE', "Armature", "WARNING: not supported in dupli/group instances"),
442 ('MESH', "Mesh", ""),
443 ('OTHER', "Other", "Other geometry types, like curve, metaball, etc. (converted to meshes)"),
445 description
="Which kind of object to export",
446 default
={'EMPTY', 'CAMERA', 'LIGHT', 'ARMATURE', 'MESH', 'OTHER'},
449 use_mesh_modifiers
: BoolProperty(
450 name
="Apply Modifiers",
451 description
="Apply modifiers to mesh objects (except Armature ones) - "
452 "WARNING: prevents exporting shape keys",
455 use_mesh_modifiers_render
: BoolProperty(
456 name
="Use Modifiers Render Setting",
457 description
="Use render settings when applying modifiers to mesh objects (DISABLED in Blender 2.8)",
460 mesh_smooth_type
: EnumProperty(
462 items
=(('OFF', "Normals Only", "Export only normals instead of writing edge or face smoothing data"),
463 ('FACE', "Face", "Write face smoothing"),
464 ('EDGE', "Edge", "Write edge smoothing"),
466 description
="Export smoothing information "
467 "(prefer 'Normals Only' option if your target importer understand split normals)",
470 use_subsurf
: BoolProperty(
471 name
="Export Subdivision Surface",
472 description
="Export the last Catmull-Rom subdivision modifier as FBX subdivision "
473 "(does not apply the modifier even if 'Apply Modifiers' is enabled)",
476 use_mesh_edges
: BoolProperty(
478 description
="Export loose edges (as two-vertices polygons)",
481 use_tspace
: BoolProperty(
482 name
="Tangent Space",
483 description
="Add binormal and tangent vectors, together with normal they form the tangent space "
484 "(will only work correctly with tris/quads only meshes!)",
487 use_custom_props
: BoolProperty(
488 name
="Custom Properties",
489 description
="Export custom properties",
492 add_leaf_bones
: BoolProperty(
493 name
="Add Leaf Bones",
494 description
="Append a final bone to the end of each chain to specify last bone length "
495 "(use this when you intend to edit the armature from exported data)",
496 default
=True # False for commit!
498 primary_bone_axis
: EnumProperty(
499 name
="Primary Bone Axis",
500 items
=(('X', "X Axis", ""),
503 ('-X', "-X Axis", ""),
504 ('-Y', "-Y Axis", ""),
505 ('-Z', "-Z Axis", ""),
509 secondary_bone_axis
: EnumProperty(
510 name
="Secondary Bone Axis",
511 items
=(('X', "X Axis", ""),
514 ('-X', "-X Axis", ""),
515 ('-Y', "-Y Axis", ""),
516 ('-Z', "-Z Axis", ""),
520 use_armature_deform_only
: BoolProperty(
521 name
="Only Deform Bones",
522 description
="Only write deforming bones (and non-deforming ones when they have deforming children)",
525 armature_nodetype
: EnumProperty(
526 name
="Armature FBXNode Type",
527 items
=(('NULL', "Null", "'Null' FBX node, similar to Blender's Empty (default)"),
528 ('ROOT', "Root", "'Root' FBX node, supposed to be the root of chains of bones..."),
529 ('LIMBNODE', "LimbNode", "'LimbNode' FBX node, a regular joint between two bones..."),
531 description
="FBX type of node (object) used to represent Blender's armatures "
532 "(use Null one unless you experience issues with other app, other choices may no import back "
533 "perfectly in Blender...)",
536 bake_anim
: BoolProperty(
537 name
="Baked Animation",
538 description
="Export baked keyframe animation",
541 bake_anim_use_all_bones
: BoolProperty(
542 name
="Key All Bones",
543 description
="Force exporting at least one key of animation for all bones "
544 "(needed with some target applications, like UE4)",
547 bake_anim_use_nla_strips
: BoolProperty(
549 description
="Export each non-muted NLA strip as a separated FBX's AnimStack, if any, "
550 "instead of global scene animation",
553 bake_anim_use_all_actions
: BoolProperty(
555 description
="Export each action as a separated FBX's AnimStack, instead of global scene animation "
556 "(note that animated objects will get all actions compatible with them, "
557 "others will get no animation at all)",
560 bake_anim_force_startend_keying
: BoolProperty(
561 name
="Force Start/End Keying",
562 description
="Always add a keyframe at start and end of actions for animated channels",
565 bake_anim_step
: FloatProperty(
566 name
="Sampling Rate",
567 description
="How often to evaluate animated values (in frames)",
569 soft_min
=0.1, soft_max
=10.0,
572 bake_anim_simplify_factor
: FloatProperty(
574 description
="How much to simplify baked values (0.0 to disable, the higher the more simplified)",
575 min=0.0, max=100.0, # No simplification to up to 10% of current magnitude tolerance.
576 soft_min
=0.0, soft_max
=10.0,
577 default
=1.0, # default: min slope: 0.005, max frame step: 10.
579 path_mode
: path_reference_mode
580 embed_textures
: BoolProperty(
581 name
="Embed Textures",
582 description
="Embed textures in FBX binary file (only for \"Copy\" path mode!)",
585 batch_mode
: EnumProperty(
587 items
=(('OFF', "Off", "Active scene to file"),
588 ('SCENE', "Scene", "Each scene as a file"),
589 ('COLLECTION', "Collection",
590 "Each collection (data-block ones) as a file, does not include content of children collections"),
591 ('SCENE_COLLECTION', "Scene Collections",
592 "Each collection (including master, non-data-block ones) of each scene as a file, "
593 "including content from children collections"),
594 ('ACTIVE_SCENE_COLLECTION', "Active Scene Collections",
595 "Each collection (including master, non-data-block one) of the active scene as a file, "
596 "including content from children collections"),
599 use_batch_own_dir
: BoolProperty(
600 name
="Batch Own Dir",
601 description
="Create a dir for each exported file",
604 use_metadata
: BoolProperty(
610 def draw(self
, context
):
614 def check_extension(self
):
615 return self
.batch_mode
== 'OFF'
617 def execute(self
, context
):
618 from mathutils
import Matrix
619 if not self
.filepath
:
620 raise Exception("filepath not set")
622 global_matrix
= (axis_conversion(to_forward
=self
.axis_forward
,
626 keywords
= self
.as_keywords(ignore
=("check_existing",
631 keywords
["global_matrix"] = global_matrix
633 from . import export_fbx_bin
634 return export_fbx_bin
.save(self
, context
, **keywords
)
637 class FBX_PT_export_main(bpy
.types
.Panel
):
638 bl_space_type
= 'FILE_BROWSER'
639 bl_region_type
= 'TOOL_PROPS'
641 bl_parent_id
= "FILE_PT_operator"
642 bl_options
= {'HIDE_HEADER'}
645 def poll(cls
, context
):
646 sfile
= context
.space_data
647 operator
= sfile
.active_operator
649 return operator
.bl_idname
== "EXPORT_SCENE_OT_fbx"
651 def draw(self
, context
):
653 layout
.use_property_split
= True
654 layout
.use_property_decorate
= False # No animation.
656 sfile
= context
.space_data
657 operator
= sfile
.active_operator
659 row
= layout
.row(align
=True)
660 row
.prop(operator
, "path_mode")
661 sub
= row
.row(align
=True)
662 sub
.enabled
= (operator
.path_mode
== 'COPY')
663 sub
.prop(operator
, "embed_textures", text
="", icon
='PACKAGE' if operator
.embed_textures
else 'UGLYPACKAGE')
664 row
= layout
.row(align
=True)
665 row
.prop(operator
, "batch_mode")
666 sub
= row
.row(align
=True)
667 sub
.prop(operator
, "use_batch_own_dir", text
="", icon
='NEWFOLDER')
670 class FBX_PT_export_include(bpy
.types
.Panel
):
671 bl_space_type
= 'FILE_BROWSER'
672 bl_region_type
= 'TOOL_PROPS'
674 bl_parent_id
= "FILE_PT_operator"
677 def poll(cls
, context
):
678 sfile
= context
.space_data
679 operator
= sfile
.active_operator
681 return operator
.bl_idname
== "EXPORT_SCENE_OT_fbx"
683 def draw(self
, context
):
685 layout
.use_property_split
= True
686 layout
.use_property_decorate
= False # No animation.
688 sfile
= context
.space_data
689 operator
= sfile
.active_operator
691 sublayout
= layout
.column()
692 sublayout
.enabled
= (operator
.batch_mode
== 'OFF')
693 sublayout
.prop(operator
, "use_selection")
694 sublayout
.prop(operator
, "use_active_collection")
696 layout
.column().prop(operator
, "object_types")
697 layout
.prop(operator
, "use_custom_props")
700 class FBX_PT_export_transform(bpy
.types
.Panel
):
701 bl_space_type
= 'FILE_BROWSER'
702 bl_region_type
= 'TOOL_PROPS'
703 bl_label
= "Transform"
704 bl_parent_id
= "FILE_PT_operator"
707 def poll(cls
, context
):
708 sfile
= context
.space_data
709 operator
= sfile
.active_operator
711 return operator
.bl_idname
== "EXPORT_SCENE_OT_fbx"
713 def draw(self
, context
):
715 layout
.use_property_split
= True
716 layout
.use_property_decorate
= False # No animation.
718 sfile
= context
.space_data
719 operator
= sfile
.active_operator
721 layout
.prop(operator
, "global_scale")
722 layout
.prop(operator
, "apply_scale_options")
724 layout
.prop(operator
, "axis_forward")
725 layout
.prop(operator
, "axis_up")
727 layout
.prop(operator
, "apply_unit_scale")
728 layout
.prop(operator
, "bake_space_transform")
731 class FBX_PT_export_geometry(bpy
.types
.Panel
):
732 bl_space_type
= 'FILE_BROWSER'
733 bl_region_type
= 'TOOL_PROPS'
734 bl_label
= "Geometry"
735 bl_parent_id
= "FILE_PT_operator"
736 bl_options
= {'DEFAULT_CLOSED'}
739 def poll(cls
, context
):
740 sfile
= context
.space_data
741 operator
= sfile
.active_operator
743 return operator
.bl_idname
== "EXPORT_SCENE_OT_fbx"
745 def draw(self
, context
):
747 layout
.use_property_split
= True
748 layout
.use_property_decorate
= False # No animation.
750 sfile
= context
.space_data
751 operator
= sfile
.active_operator
753 layout
.prop(operator
, "mesh_smooth_type")
754 layout
.prop(operator
, "use_subsurf")
755 layout
.prop(operator
, "use_mesh_modifiers")
757 #sub.enabled = operator.use_mesh_modifiers and False # disabled in 2.8...
758 #sub.prop(operator, "use_mesh_modifiers_render")
759 layout
.prop(operator
, "use_mesh_edges")
761 #~ sub.enabled = operator.mesh_smooth_type in {'OFF'}
762 sub
.prop(operator
, "use_tspace")
765 class FBX_PT_export_armature(bpy
.types
.Panel
):
766 bl_space_type
= 'FILE_BROWSER'
767 bl_region_type
= 'TOOL_PROPS'
768 bl_label
= "Armature"
769 bl_parent_id
= "FILE_PT_operator"
770 bl_options
= {'DEFAULT_CLOSED'}
773 def poll(cls
, context
):
774 sfile
= context
.space_data
775 operator
= sfile
.active_operator
777 return operator
.bl_idname
== "EXPORT_SCENE_OT_fbx"
779 def draw(self
, context
):
781 layout
.use_property_split
= True
782 layout
.use_property_decorate
= False # No animation.
784 sfile
= context
.space_data
785 operator
= sfile
.active_operator
787 layout
.prop(operator
, "primary_bone_axis")
788 layout
.prop(operator
, "secondary_bone_axis")
789 layout
.prop(operator
, "armature_nodetype")
790 layout
.prop(operator
, "use_armature_deform_only")
791 layout
.prop(operator
, "add_leaf_bones")
794 class FBX_PT_export_bake_animation(bpy
.types
.Panel
):
795 bl_space_type
= 'FILE_BROWSER'
796 bl_region_type
= 'TOOL_PROPS'
797 bl_label
= "Bake Animation"
798 bl_parent_id
= "FILE_PT_operator"
799 bl_options
= {'DEFAULT_CLOSED'}
802 def poll(cls
, context
):
803 sfile
= context
.space_data
804 operator
= sfile
.active_operator
806 return operator
.bl_idname
== "EXPORT_SCENE_OT_fbx"
808 def draw_header(self
, context
):
809 sfile
= context
.space_data
810 operator
= sfile
.active_operator
812 self
.layout
.prop(operator
, "bake_anim", text
="")
814 def draw(self
, context
):
816 layout
.use_property_split
= True
817 layout
.use_property_decorate
= False # No animation.
819 sfile
= context
.space_data
820 operator
= sfile
.active_operator
822 layout
.enabled
= operator
.bake_anim
823 layout
.prop(operator
, "bake_anim_use_all_bones")
824 layout
.prop(operator
, "bake_anim_use_nla_strips")
825 layout
.prop(operator
, "bake_anim_use_all_actions")
826 layout
.prop(operator
, "bake_anim_force_startend_keying")
827 layout
.prop(operator
, "bake_anim_step")
828 layout
.prop(operator
, "bake_anim_simplify_factor")
831 def menu_func_import(self
, context
):
832 self
.layout
.operator(ImportFBX
.bl_idname
, text
="FBX (.fbx)")
835 def menu_func_export(self
, context
):
836 self
.layout
.operator(ExportFBX
.bl_idname
, text
="FBX (.fbx)")
841 FBX_PT_import_include
,
842 FBX_PT_import_transform
,
843 FBX_PT_import_transform_manual_orientation
,
844 FBX_PT_import_animation
,
845 FBX_PT_import_armature
,
848 FBX_PT_export_include
,
849 FBX_PT_export_transform
,
850 FBX_PT_export_geometry
,
851 FBX_PT_export_armature
,
852 FBX_PT_export_bake_animation
,
858 bpy
.utils
.register_class(cls
)
860 bpy
.types
.TOPBAR_MT_file_import
.append(menu_func_import
)
861 bpy
.types
.TOPBAR_MT_file_export
.append(menu_func_export
)
865 bpy
.types
.TOPBAR_MT_file_import
.remove(menu_func_import
)
866 bpy
.types
.TOPBAR_MT_file_export
.remove(menu_func_export
)
869 bpy
.utils
.unregister_class(cls
)
872 if __name__
== "__main__":