This commit is contained in:
raccoon
2025-01-28 07:39:37 +05:00
parent fb5a718243
commit 89d3c504e6
2 changed files with 25 additions and 21 deletions

View File

@@ -3,8 +3,8 @@ from datetime import datetime
import bpy import bpy
_FUTURE = bpy.app.version >= (2, 80, 0) _FUTURE = bpy.app.version >= (2, 80, 0)
from bpy.props import EnumProperty, StringProperty, BoolProperty, IntProperty from bpy.props import BoolProperty, EnumProperty, IntProperty, StringProperty
from bpy.types import UIList, Operator, Panel, Context, Scene from bpy.types import Context, Operator, Panel, Scene, UIList
if _FUTURE: if _FUTURE:
from bpy.types import Collection as Group from bpy.types import Collection as Group
else: else:
@@ -41,26 +41,30 @@ def fbx_export(context: Context) -> None:
print("[%s] Batch FBX export begin" % datetime.now()) print("[%s] Batch FBX export begin" % datetime.now())
settings_ascii = dict( settings_ascii = dict(
# Common
version='ASCII6100', version='ASCII6100',
use_selection=True,
global_scale=1.0,
axis_forward='-Z', axis_forward='-Z',
axis_up='Y', axis_up='Y',
global_scale=1.0,
object_types=context.scene.fbx_object_types, object_types=context.scene.fbx_object_types,
use_mesh_modifiers=True, use_selection=True,
mesh_smooth_type='OFF', # Mesh
mesh_smooth_type='FACE',
use_mesh_edges=False, use_mesh_edges=False,
use_mesh_modifiers=True,
use_tspace=False, use_tspace=False,
use_armature_deform_only=False, # Armature
add_leaf_bones=False, add_leaf_bones=False,
armature_nodetype='NULL',
primary_bone_axis='Y', primary_bone_axis='Y',
secondary_bone_axis='X', secondary_bone_axis='X',
armature_nodetype='NULL', use_armature_deform_only=False,
# Animation
use_anim=context.scene.fbx_use_anim, use_anim=context.scene.fbx_use_anim,
use_default_take=False, use_default_take=False,
path_mode='RELATIVE', # File
batch_mode='OFF', batch_mode='OFF',
use_batch_own_dir=False, path_mode='RELATIVE',
) )
settings_binary = dict( settings_binary = dict(
@@ -73,31 +77,31 @@ def fbx_export(context: Context) -> None:
bake_space_transform=True, bake_space_transform=True,
global_scale=1.0, global_scale=1.0,
object_types=context.scene.fbx_object_types, object_types=context.scene.fbx_object_types,
use_custom_props=False, use_custom_props=True,
use_selection=True, use_selection=True,
# Mesh # Mesh
mesh_smooth_type='FACE', mesh_smooth_type='FACE',
use_mesh_modifiers=False,
use_mesh_edges=False, use_mesh_edges=False,
use_mesh_modifiers=False,
use_tspace=False, use_tspace=False,
# Armature # Armature
add_leaf_bones=False, add_leaf_bones=False,
armature_nodetype='NULL',
primary_bone_axis='Y', primary_bone_axis='Y',
secondary_bone_axis='X', secondary_bone_axis='X',
use_armature_deform_only=False, use_armature_deform_only=False,
armature_nodetype='NULL',
# Animation # Animation
bake_anim=context.scene.fbx_use_anim, bake_anim=context.scene.fbx_use_anim,
bake_anim_use_all_bones=True,
bake_anim_use_all_actions=True,
bake_anim_use_nla_strips=True,
bake_anim_force_startend_keying=True, bake_anim_force_startend_keying=True,
bake_anim_step=1.0,
bake_anim_simplify_factor=1.0, bake_anim_simplify_factor=1.0,
bake_anim_step=1.0,
bake_anim_use_all_actions=True,
bake_anim_use_all_bones=True,
bake_anim_use_nla_strips=True,
# File # File
path_mode='RELATIVE',
embed_textures=False,
batch_mode='OFF', batch_mode='OFF',
embed_textures=False,
path_mode='RELATIVE',
) )
settings = settings_binary if _FUTURE or context.scene.fbx_force_binary else settings_ascii settings = settings_binary if _FUTURE or context.scene.fbx_force_binary else settings_ascii