How to properly register a FloatVectorProperty
? When I do:
box.prop(self, "amb_day_color")
where amb_day_color
is a FloatVectorProperty
, I get an error saying property not found even though I have defined it.
class Panel_ToolBoxPrelite(bpy.types.Panel):
bl_label = "Prelite ToolBox"
bl_space_type = 'VIEW_3D'
bl_region_type = 'UI'
bl_category = 'BG Toolbox'
amb_day_color: FloatVectorProperty(name="Ambient Day Color", subtype='COLOR', default=(130/255, 130/255, 130/255), min=0.0, max=1.0)
lit_day_color: FloatVectorProperty(name="Light Day Color", subtype='COLOR', default=(170/255, 170/255, 170/255), min=0.0, max=1.0)
amb_night_color: FloatVectorProperty(name="Ambient Night Color", subtype='COLOR', default=(30/255, 30/255, 30/255), min=0.0, max=1.0)
lit_night_color: FloatVectorProperty(name="Light Night Color", subtype='COLOR', default=(50/255, 50/255, 50/255), min=0.0, max=1.0)
def draw(self, context):
layout = self.layout
box = layout.box()
box.label(text="Display Prelite")
row = box.row()
row.operator(Operator_Display_Day_Prelite.bl_idname, text="Day")
row.operator(Operator_Display_Off_Prelite.bl_idname, text="Off")
row.operator(Operator_Display_Night_Prelite.bl_idname, text="Night")
layout.separator()
box = layout.box()
box.label(text="AutoPrelite")
box.prop(self, "amb_day_color")
box.prop(self, "lit_day_color")[![enter image description here][1]][1]
box.prop(self, "amb_night_color")
box.prop(self, "lit_night_color")
box.operator(Operator_Auto_Day_Prelite.bl_idname, text="Apply Day")
box.operator(Operator_Auto_Night_Prelite.bl_idname, text="Apply Night")
bpy.types.Scene
. Cheers $\endgroup$