Skip to content

How-to

Sub-panels

Sub-panels are authored in the Generated Layout and generated as native Blender child panels using bl_parent_id and bl_order.

The body-then-children rule

This is the most important thing to understand about sub-panels:

Blender always draws child panels below the parent panel body. Loose parent-body rows cannot be interleaved between child panels.

PropUI models this as two zones — Main Panel Body first, then Sub-Panels. You cannot place a loose row after a sub-panel; move that row into a sub-panel instead. See Generated Layout.

Working with sub-panels

  • Add Sub-Panel creates a new sub-panel near the active sub-panel/container.
  • Sub-panels can nest up to depth 12.
  • Move Up / Move Down reorders among siblings.
  • Indent nests under the previous sibling; Outdent promotes one level.
  • Duplicate copies the sub-panel, its nested sub-panels, and their rows.
  • Collapse toggles editor visibility of the sub-panel's rows/nested panels.
  • Rows move in and out using Move Row To.

Empty sub-panels

An empty sub-panel stays in the editor but is skipped in generated output if it has no rows and no nested non-empty sub-panels.

Selected Sub-Panel controls

When the active layout item is a sub-panel:

  • Title: inline-editable title for the generated child panel.
  • Collapsed by Default: the generated child panel starts closed. By default sub-panels start open.

Info

The editor's own collapsed state is separate from the generated panel's default collapsed state.

Deleting a sub-panel

Controlled by Sub-Panel Delete:

  • Delete Sub-Panel Only: remove the sub-panel and promote its rows and child sub-panels up one level.
  • Delete Hierarchy: remove the sub-panel, its nested sub-panels, and their rows.

This default lives in Confirmations.

What gets generated

  • The parent panel body draws the Main Panel Body rows.
  • Each non-empty sub-panel gets its own draw function and Panel class.
  • Child panels inherit the parent panel spec and visibility gating.
  • Collapsed by Default emits Blender's default-closed behavior for that sub-panel.
  • Parent panels register before children and unregister in reverse.