a08d888acb
- operator strings are referenced via the class property rather than a hard coded string - class names have been cleaned to have _OT_ or _PT_ depending on the kind of class it was. - Class names should mostly be CamelCase now.
36 lines
1.1 KiB
Python
36 lines
1.1 KiB
Python
import bpy
|
|
|
|
from typing import List, Optional
|
|
from .common import get_armature
|
|
from bpy.types import Object, ShapeKey, Mesh, Context, Operator
|
|
from functools import lru_cache
|
|
from ..core.register import register_wrap
|
|
from ..functions.translations import t
|
|
|
|
|
|
@register_wrap
|
|
class AvatarToolKit_OT_ExportResonite(Operator):
|
|
bl_idname = 'avatar_toolkit.export_resonite'
|
|
bl_label = t("Importer.export_resonite.label")
|
|
bl_description = t("Importer.export_resonite.desc")
|
|
bl_options = {'REGISTER', 'UNDO'}
|
|
filepath: bpy.props.StringProperty()
|
|
|
|
|
|
@classmethod
|
|
def poll(cls, context: Context):
|
|
if get_armature(context) is None:
|
|
return False
|
|
return True
|
|
|
|
def execute(self, context: Context):
|
|
#settings stolen from cats.
|
|
bpy.ops.export_scene.gltf('INVOKE_AREA',
|
|
export_image_format = 'WEBP',
|
|
export_image_quality = 75,
|
|
export_materials = 'EXPORT',
|
|
export_animations = True,
|
|
export_animation_mode = 'ACTIONS',
|
|
export_nla_strips_merged_animation_name = 'Animation',
|
|
export_nla_strips = True)
|
|
return {'FINISHED'} |