2 Star 1 Fork 1

五谷延年 / ueskeleton

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
properties.py 2.40 KB
一键复制 编辑 原始数据 按行查看 历史
五谷延年 提交于 2021-04-04 08:24 . import export
import bpy
from .functions import templates
from .functions import utilities
from .settings import tool_tips
class UESKELETONProperties(bpy.types.PropertyGroup):
"""
This class defines a property group that can be accessed through the blender api.
"""
# --------------------- read only properties ---------------------
module_name = __package__
# template constants
skeleton_templates_path = templates.get_skeleton_templates_path()
default_template = 'example'
# utility constants
picker_name = 'picker'
context = {}
# --------------------- read/write properties ---------------------
# scene variables
source_skeleton_name: bpy.props.StringProperty(default='', update=utilities.source_skeleton_picker_update)
# --------------------- user interface properties ------------------
selected_skeleton_template: bpy.props.EnumProperty(
name="Skeleton Template",
description=tool_tips.skeleton_template_tool_tip,
items=templates.safe_populate_templates_dropdown,
options={'ANIMATABLE'},
update=templates.set_template
)
# exporter properties
selected_export_template: bpy.props.EnumProperty(
name="Export Skeleton Template",
description=tool_tips.export_template_tool_tip,
items=templates.safe_get_skeleton_templates,
options={'ANIMATABLE'}
)
class UESKELETONSavedProperties(bpy.types.PropertyGroup):
"""
This class defines a property group that will be stored in the blender scene. This
data will get serialized into the blend file when it is saved.
"""
def register():
"""
This function registers the property group class and adds it to the window manager context when the
addon is enabled.
"""
bpy.utils.register_class(UESKELETONProperties)
bpy.utils.register_class(UESKELETONSavedProperties)
bpy.types.WindowManager.ueskeleton = bpy.props.PointerProperty(type=UESKELETONProperties)
bpy.types.Scene.ueskeleton = bpy.props.PointerProperty(type=UESKELETONSavedProperties)
def unregister():
"""
This function unregisters the property group class and deletes it from the window manager context when the
addon is disabled.
"""
bpy.utils.unregister_class(UESKELETONProperties)
del bpy.types.WindowManager.ueskeleton
del bpy.types.Scene.ueskeleton
1
https://gitee.com/wuguyannian/ueskeleton.git
git@gitee.com:wuguyannian/ueskeleton.git
wuguyannian
ueskeleton
ueskeleton
master

搜索帮助