2020-12-11 21:49:40 +00:00
|
|
|
""" Contains Blender properties and UI for .msh materials. """
|
|
|
|
|
|
|
|
import bpy
|
|
|
|
from bpy.props import StringProperty, BoolProperty, EnumProperty, FloatVectorProperty, IntProperty
|
|
|
|
from bpy.types import PropertyGroup
|
|
|
|
from .msh_material_ui_strings import *
|
|
|
|
from .msh_model import *
|
|
|
|
|
|
|
|
|
|
|
|
class SkeletonProperties(PropertyGroup):
|
|
|
|
name: StringProperty(name="Name", default="Bone Name")
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class SkeletonPropertiesPanel(bpy.types.Panel):
|
|
|
|
""" Creates a Panel in the Object properties window """
|
|
|
|
bl_label = "SWBF Skeleton Properties"
|
|
|
|
bl_idname = "SKELETON_PT_swbf_msh"
|
|
|
|
bl_space_type = 'PROPERTIES'
|
|
|
|
bl_region_type = 'WINDOW'
|
|
|
|
bl_context = "data"
|
|
|
|
bl_options = {'DEFAULT_CLOSED'}
|
|
|
|
|
|
|
|
|
|
|
|
@classmethod
|
|
|
|
def poll(cls, context):
|
2022-01-11 19:02:17 +00:00
|
|
|
return context.object.type == 'ARMATURE' and context.object.data.swbf_msh_skel and len(context.object.data.swbf_msh_skel) > 0
|
2020-12-11 21:49:40 +00:00
|
|
|
|
|
|
|
|
|
|
|
def draw(self, context):
|
|
|
|
if context.object is None:
|
|
|
|
return
|
|
|
|
|
|
|
|
layout = self.layout
|
|
|
|
|
|
|
|
skel_props = context.object.data.swbf_msh_skel
|
|
|
|
|
2022-01-07 18:45:50 +00:00
|
|
|
layout.label(text = "Bones In MSH Skeleton: ")
|
|
|
|
|
2020-12-11 21:49:40 +00:00
|
|
|
for prop in skel_props:
|
|
|
|
layout.prop(prop, "name")
|
|
|
|
|
|
|
|
|