(On Hold) Rework Properties UI Editor #159
@ -946,6 +946,10 @@ class CLOUDRIG_PT_settings(CLOUDRIG_PT_base):
|
|||||||
if rig.cloudrig.ui_edit_mode:
|
if rig.cloudrig.ui_edit_mode:
|
||||||
if hasattr(bpy.ops.pose, 'cloudrig_add_property_to_ui'):
|
if hasattr(bpy.ops.pose, 'cloudrig_add_property_to_ui'):
|
||||||
layout.operator('pose.cloudrig_add_property_to_ui', icon='ADD')
|
layout.operator('pose.cloudrig_add_property_to_ui', icon='ADD')
|
||||||
|
if hasattr(bpy.ops.object, 'cloudrig_ui_element_add'):
|
||||||
|
layout.operator('object.cloudrig_ui_element_add', icon='ADD')
|
||||||
|
else:
|
||||||
|
print("Why didn't the class register")
|
||||||
|
|
||||||
if ui_data:
|
if ui_data:
|
||||||
for panel_name, panel_data in ui_data.items():
|
for panel_name, panel_data in ui_data.items():
|
||||||
|
@ -9,6 +9,7 @@ from . import (
|
|||||||
object,
|
object,
|
||||||
parenting,
|
parenting,
|
||||||
properties_ui,
|
properties_ui,
|
||||||
|
properties_ui_editor,
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
@ -23,6 +24,7 @@ modules = [
|
|||||||
parenting,
|
parenting,
|
||||||
properties_ui,
|
properties_ui,
|
||||||
component_params_ui,
|
component_params_ui,
|
||||||
|
properties_ui_editor,
|
||||||
]
|
]
|
||||||
|
|
||||||
# Dictionary of modules that have a Params class, and want to register
|
# Dictionary of modules that have a Params class, and want to register
|
||||||
|
22
rig_component_features/properties_ui_editor.py
Normal file
22
rig_component_features/properties_ui_editor.py
Normal file
@ -0,0 +1,22 @@
|
|||||||
|
from ..generation.cloudrig import CloudRig_UIElement
|
||||||
|
from bpy.types import Operator
|
||||||
|
|
||||||
|
class CLOUDRIG_OT_ui_element_add(Operator):
|
||||||
|
"""Add a UI element"""
|
||||||
|
|
||||||
|
bl_idname = "object.cloudrig_ui_element_add"
|
||||||
|
bl_label = "Add Property to UI"
|
||||||
|
bl_options = {'REGISTER', 'UNDO'}
|
||||||
|
|
||||||
|
# Copy the definition of a single UIElement, which will be added
|
||||||
|
# by this operator, when the "OK" button is clicked.
|
||||||
|
__annotations__ = CloudRig_UIElement.__annotations__
|
||||||
|
|
||||||
|
def execute(self, context):
|
||||||
|
return {'FINISHED'}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
registry = [
|
||||||
|
CLOUDRIG_OT_ui_element_add
|
||||||
|
]
|
Loading…
Reference in New Issue
Block a user