I want to assign arbitrary data in the form of custom properties to a category of objects within my scene.
For the sake of this question, let's say that the arbitrary data is comprised of several named custom properties ranging from 0.0 to 255.0 in value, effectively several bytes of data.
Next I want to build a custom panel that will facilitate visualising and editing specific bits of an objects arbitrary data.
I've not had much luck finding an example of how to achieve this.
To elaborate on the question with some code, I know I can do this kind of thing:
class BM_PT_block_inspector(bpy.types.Panel):
bl_idname = "BM_PT_block_inspector"
bl_label = "Block"
bl_space_type = 'PROPERTIES'
bl_region_type = 'WINDOW'
bl_context = "object"
def draw(self, context):
layout = self.layout
obj = context.object
# toggle a pre-existing setting
self.layout.row().prop(obj, "show_wire", toggle=True, text="Wireframe", icon="SHADING_WIRE")
# show custom property values directly in panel
self.layout.row().prop(obj, '["my_prop_0"]')
self.layout.row().prop(obj, '["my_prop_1"]')
but I would like to be able to render UI elements like checkboxes in the panel that will essentially act as toggles for specific bits of the data stored in the active object's custom properties.