mirror of
https://github.com/godotengine/collada-exporter.git
synced 2026-01-01 01:48:22 +03:00
Update to Blender 2.8
This commit is contained in:
@@ -21,8 +21,8 @@ from bpy.props import StringProperty, BoolProperty, FloatProperty, EnumProperty
|
||||
from bpy_extras.io_utils import ExportHelper
|
||||
bl_info = {
|
||||
"name": "Better Collada Exporter",
|
||||
"author": "Juan Linietsky",
|
||||
"blender": (2, 5, 8),
|
||||
"author": "Juan Linietsky, artell",
|
||||
"blender": (2, 80, 0),
|
||||
"api": 38691,
|
||||
"location": "File > Import-Export",
|
||||
"description": ("Export DAE Scenes. This plugin actually works better! "
|
||||
@@ -39,18 +39,18 @@ if "bpy" in locals():
|
||||
imp.reload(export_dae) # noqa
|
||||
|
||||
|
||||
class ExportDAE(bpy.types.Operator, ExportHelper):
|
||||
class CE_OT_export_dae(bpy.types.Operator, ExportHelper):
|
||||
"""Selection to DAE"""
|
||||
bl_idname = "export_scene.dae"
|
||||
bl_label = "Export DAE"
|
||||
bl_options = {"PRESET"}
|
||||
|
||||
filename_ext = ".dae"
|
||||
filter_glob = StringProperty(default="*.dae", options={"HIDDEN"})
|
||||
filter_glob : StringProperty(default="*.dae", options={"HIDDEN"})
|
||||
|
||||
# List of operator properties, the attributes will be assigned
|
||||
# to the class instance from the operator settings before calling
|
||||
object_types = EnumProperty(
|
||||
object_types : EnumProperty(
|
||||
name="Object Types",
|
||||
options={"ENUM_FLAG"},
|
||||
items=(("EMPTY", "Empty", ""),
|
||||
@@ -63,81 +63,81 @@ class ExportDAE(bpy.types.Operator, ExportHelper):
|
||||
default={"EMPTY", "CAMERA", "LAMP", "ARMATURE", "MESH", "CURVE"},
|
||||
)
|
||||
|
||||
use_export_selected = BoolProperty(
|
||||
use_export_selected : BoolProperty(
|
||||
name="Selected Objects",
|
||||
description="Export only selected objects (and visible in active "
|
||||
"layers if that applies).",
|
||||
default=False,
|
||||
)
|
||||
use_mesh_modifiers = BoolProperty(
|
||||
use_mesh_modifiers : BoolProperty(
|
||||
name="Apply Modifiers",
|
||||
description="Apply modifiers to mesh objects (on a copy!).",
|
||||
default=False,
|
||||
)
|
||||
use_exclude_armature_modifier = BoolProperty(
|
||||
use_exclude_armature_modifier : BoolProperty(
|
||||
name="Exclude Armature Modifier",
|
||||
description="Exclude the armature modifier when applying modifiers "
|
||||
"(otherwise animation will be applied on top of the last pose)",
|
||||
default=True,
|
||||
)
|
||||
use_tangent_arrays = BoolProperty(
|
||||
use_tangent_arrays : BoolProperty(
|
||||
name="Tangent Arrays",
|
||||
description="Export Tangent and Binormal arrays "
|
||||
"(for normalmapping).",
|
||||
default=False,
|
||||
)
|
||||
use_triangles = BoolProperty(
|
||||
use_triangles : BoolProperty(
|
||||
name="Triangulate",
|
||||
description="Export Triangles instead of Polygons.",
|
||||
default=False,
|
||||
)
|
||||
|
||||
use_copy_images = BoolProperty(
|
||||
use_copy_images : BoolProperty(
|
||||
name="Copy Images",
|
||||
description="Copy Images (create images/ subfolder)",
|
||||
default=False,
|
||||
)
|
||||
use_active_layers = BoolProperty(
|
||||
use_active_layers : BoolProperty(
|
||||
name="Active Layers",
|
||||
description="Export only objects on the active layers.",
|
||||
default=True,
|
||||
)
|
||||
use_exclude_ctrl_bones = BoolProperty(
|
||||
use_exclude_ctrl_bones : BoolProperty(
|
||||
name="Exclude Control Bones",
|
||||
description=("Exclude skeleton bones with names beginning with 'ctrl' "
|
||||
"or bones which are not marked as Deform bones."),
|
||||
default=True,
|
||||
)
|
||||
use_anim = BoolProperty(
|
||||
use_anim : BoolProperty(
|
||||
name="Export Animation",
|
||||
description="Export keyframe animation",
|
||||
default=False,
|
||||
)
|
||||
use_anim_action_all = BoolProperty(
|
||||
use_anim_action_all : BoolProperty(
|
||||
name="All Actions",
|
||||
description=("Export all actions for the first armature found "
|
||||
"in separate DAE files"),
|
||||
default=False,
|
||||
)
|
||||
use_anim_skip_noexp = BoolProperty(
|
||||
use_anim_skip_noexp : BoolProperty(
|
||||
name="Skip (-noexp) Actions",
|
||||
description="Skip exporting of actions whose name end in (-noexp)."
|
||||
" Useful to skip control animations.",
|
||||
default=True,
|
||||
)
|
||||
use_anim_optimize = BoolProperty(
|
||||
use_anim_optimize : BoolProperty(
|
||||
name="Optimize Keyframes",
|
||||
description="Remove double keyframes",
|
||||
default=True,
|
||||
)
|
||||
|
||||
use_shape_key_export = BoolProperty(
|
||||
use_shape_key_export : BoolProperty(
|
||||
name="Shape Keys",
|
||||
description="Export shape keys for selected objects.",
|
||||
default=False,
|
||||
)
|
||||
|
||||
anim_optimize_precision = FloatProperty(
|
||||
|
||||
anim_optimize_precision : FloatProperty(
|
||||
name="Precision",
|
||||
description=("Tolerence for comparing double keyframes "
|
||||
"(higher for greater accuracy)"),
|
||||
@@ -146,7 +146,7 @@ class ExportDAE(bpy.types.Operator, ExportHelper):
|
||||
default=6.0,
|
||||
)
|
||||
|
||||
use_metadata = BoolProperty(
|
||||
use_metadata : BoolProperty(
|
||||
name="Use Metadata",
|
||||
default=True,
|
||||
options={"HIDDEN"},
|
||||
@@ -173,19 +173,26 @@ class ExportDAE(bpy.types.Operator, ExportHelper):
|
||||
|
||||
|
||||
def menu_func(self, context):
|
||||
self.layout.operator(ExportDAE.bl_idname, text="Better Collada (.dae)")
|
||||
self.layout.operator(CE_OT_export_dae.bl_idname, text="Better Collada (.dae)")
|
||||
|
||||
|
||||
#classes = (CE_OT_export_dae)
|
||||
|
||||
def register():
|
||||
bpy.utils.register_module(__name__)
|
||||
def register():
|
||||
from bpy.utils import register_class
|
||||
|
||||
bpy.types.INFO_MT_file_export.append(menu_func)
|
||||
register_class(CE_OT_export_dae)
|
||||
|
||||
#bpy.types.INFO_MT_file_export.append(menu_func)
|
||||
bpy.types.TOPBAR_MT_file_export.append(menu_func)
|
||||
|
||||
|
||||
def unregister():
|
||||
bpy.utils.unregister_module(__name__)
|
||||
|
||||
bpy.types.INFO_MT_file_export.remove(menu_func)
|
||||
def unregister():
|
||||
from bpy.utils import unregister_class
|
||||
|
||||
unregister_class(CE_OT_export_dae)
|
||||
|
||||
#bpy.types.INFO_MT_file_export.append(menu_func)
|
||||
bpy.types.TOPBAR_MT_file_export.remove(menu_func)
|
||||
|
||||
if __name__ == "__main__":
|
||||
register()
|
||||
|
||||
Reference in New Issue
Block a user