diff --git a/blender-addon/clever-show-addon-src/__init__.py b/blender-addon/clever-show-addon-src/__init__.py index 2c021d5..dfe9435 100644 --- a/blender-addon/clever-show-addon-src/__init__.py +++ b/blender-addon/clever-show-addon-src/__init__.py @@ -5,6 +5,7 @@ from bpy.props import PointerProperty, StringProperty, BoolProperty, EnumPropert from . operators.export import ExportSwarmAnimation from . operators.check import CheckSwarmAnimation from . ui.drone_panel import DronePanel +from . ui.led_panel import LedPanel from . ui.swarm_panel import SwarmPanel bl_info = { @@ -72,14 +73,12 @@ class CleverShowProperties(PropertyGroup): ('prop', "By object property", ""), ], default="prop", - options=set(), # not animateable ) drones_name: StringProperty( name="Name identifier", description="Name identifier for all drone objects", default="clever", - options=set(), # not animateable ) speed_limit: FloatProperty( @@ -106,11 +105,17 @@ class CleverDroneProperties(PropertyGroup): default=True, ) - class CleverLedProperties(PropertyGroup): is_led: BoolProperty( - name="Is LED color",) - led_effect: EnumProperty( + name="Is LED color", + ) + + group: StringProperty( + name="LED group name", + default="ALL", + ) + + effect: EnumProperty( name="LED effect", items=[('fill', 'Fill', ""), ('blink', 'Blink', ""), @@ -128,7 +133,8 @@ class CleverLedProperties(PropertyGroup): classes = (CleverShowProperties, CleverDroneProperties, CleverLedProperties, ExportSwarmAnimation, CheckSwarmAnimation, - DronePanel, SwarmPanel, + DronePanel, SwarmPanel, LedPanel, + ) def menu_func(self, context): diff --git a/blender-addon/clever-show-addon-src/ui/drone_panel.py b/blender-addon/clever-show-addon-src/ui/drone_panel.py index a107707..dc89fbe 100644 --- a/blender-addon/clever-show-addon-src/ui/drone_panel.py +++ b/blender-addon/clever-show-addon-src/ui/drone_panel.py @@ -1,7 +1,7 @@ from bpy.types import Panel class DronePanel(Panel): - bl_label = "Drone" + bl_label = "Clever-Show Drone" bl_idname = "OBJECT_PT_drone" bl_space_type = 'PROPERTIES' bl_region_type = 'WINDOW' @@ -12,5 +12,9 @@ class DronePanel(Panel): def draw(self, context): layout = self.layout + layout.use_property_split = True + # layout.use_property_decorate = True + layout.enabled = context.object.drone.is_drone + layout.prop(context.object.drone, "armed") diff --git a/blender-addon/clever-show-addon-src/ui/led_panel.py b/blender-addon/clever-show-addon-src/ui/led_panel.py index e69de29..627e0b5 100644 --- a/blender-addon/clever-show-addon-src/ui/led_panel.py +++ b/blender-addon/clever-show-addon-src/ui/led_panel.py @@ -0,0 +1,21 @@ +from bpy.types import Panel + +class LedPanel(Panel): + bl_label = "Clever-Show LED" + bl_idname = "MATERIAL_PT_led" + bl_space_type = 'PROPERTIES' + bl_region_type = 'WINDOW' + bl_context = "material" + + def draw_header(self, context): + self.layout.prop(context.material.led, "is_led", text="") + + def draw(self, context): + layout = self.layout + layout.use_property_split = True + layout.use_property_decorate = True + + layout.enabled = context.material.led.is_led + + layout.prop(context.material.led, "group") + layout.prop(context.material.led, "effect")