4

I'm creating an add-on with a custom object. When I select the object, I'd like to be able to edit some custom properties of the object with a small panel. I'd prefer to put it in the object properties menu, here:

enter image description here

How do I go about creating and adding a panel here?

batFINGER
  • 84,216
  • 10
  • 108
  • 233
Justin
  • 1,972
  • 4
  • 24
  • 43

1 Answers1

3

To create a custom panel you subclass bpy.types.Panel and set the space, region and context to suit. Setting the space and region to PROPERTIES and WINDOW will place the panel within the properties. Without a context it will show in every section, object will place it only in the object properties.

class testPanel(bpy.types.Panel):
    bl_label = "Test Panel"
    bl_idname = "OBJECT_PT_tester"
    bl_space_type = 'PROPERTIES'
    bl_region_type = 'WINDOW'
    bl_context = 'object'

    def draw(self, context):
        row = self.layout.row()
        row.label(text='stuff here')
sambler
  • 55,387
  • 3
  • 59
  • 192