mirror of
https://github.com/CopterExpress/clever-show.git
synced 2026-06-09 05:24:32 +00:00
Addon: UI integration start
This commit is contained in:
@@ -3,11 +3,12 @@ from bpy.types import PropertyGroup
|
||||
from bpy.props import PointerProperty, StringProperty, BoolProperty, EnumProperty, FloatProperty
|
||||
from . operators.export import ExportSwarmAnimation
|
||||
from . operators.check import CheckSwarmAnimation
|
||||
from . ui.drone_panel import DronePanel
|
||||
|
||||
bl_info = {
|
||||
"name": "clever-show animation (.anim)",
|
||||
"author": "Artem Vasiunik & Arthur Golubtsov",
|
||||
"version": (0, 6, 1),
|
||||
"version": (0, 6, 2),
|
||||
"blender": (2, 83, 0),
|
||||
"location": "File > Export > clever-show animation (.anim)",
|
||||
"description": "Export > clever-show animation (.anim)",
|
||||
@@ -54,11 +55,15 @@ class CleverShowProperties(PropertyGroup):
|
||||
class CleverDroneProperties(PropertyGroup):
|
||||
is_drone: BoolProperty(name="Is drone")
|
||||
|
||||
armed: BoolProperty(
|
||||
name="Armed"
|
||||
)
|
||||
|
||||
|
||||
class CleverLedProperties(PropertyGroup):
|
||||
is_led: BoolProperty(
|
||||
name="Is LED color",)
|
||||
effect: EnumProperty(
|
||||
led_effect: EnumProperty(
|
||||
name="LED effect",
|
||||
items=[('fill', 'Fill', ""),
|
||||
('blink', 'Blink', ""),
|
||||
@@ -69,12 +74,13 @@ class CleverLedProperties(PropertyGroup):
|
||||
('rainbow', 'Rainbow', ""),
|
||||
('rainbow_fill', 'Rainbow fill', ""),
|
||||
],
|
||||
defaul="fill"
|
||||
default="fill"
|
||||
)
|
||||
|
||||
|
||||
classes = (CleverShowProperties, CleverDroneProperties, CleverLedProperties,
|
||||
ExportSwarmAnimation, CheckSwarmAnimation)
|
||||
ExportSwarmAnimation, CheckSwarmAnimation,
|
||||
DronePanel,)
|
||||
|
||||
def menu_func(self, context):
|
||||
self.layout.operator(
|
||||
|
||||
16
blender-addon/clever-show-addon-src/ui/drone_panel.py
Normal file
16
blender-addon/clever-show-addon-src/ui/drone_panel.py
Normal file
@@ -0,0 +1,16 @@
|
||||
from bpy.types import Panel
|
||||
|
||||
class DronePanel(Panel):
|
||||
bl_label = "Drone"
|
||||
bl_idname = "OBJECT_PT_drone"
|
||||
bl_space_type = 'PROPERTIES'
|
||||
bl_region_type = 'WINDOW'
|
||||
bl_context = "object"
|
||||
|
||||
def draw_header(self, context):
|
||||
self.layout.prop(context.object.drone, "is_drone", text="")
|
||||
|
||||
def draw(self, context):
|
||||
layout = self.layout
|
||||
layout.enabled = context.object.drone.is_drone
|
||||
layout.prop(context.object.drone, "armed")
|
||||
Reference in New Issue
Block a user