Addon: UI integration start

This commit is contained in:
Artem30801
2020-07-08 14:08:44 +03:00
parent 91f869bf22
commit 2a39242b4e
2 changed files with 26 additions and 4 deletions

View File

@@ -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(

View 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")