Skip to content
Bananenbrot edited this page Aug 10, 2023 · 3 revisions

The Object Property is a bpy.type.Object variable. You can add a bpy.type.Object variable to the Properties by writing a new comment over the variable with the syntax:

#STB-Input-{Space}-Object

The Object Property is a property which allows you to select objects from your scene and use it in the script as a bpy.type.Object.
The Object Property returns bpy.data.objects['{objectname}'] to your script or an empty string '' if no object is selected.
The Property could be initialized as a string but will be overwritten if you select an object or it can be initialized as a bpy.type.Object.

Example

This Property is only displayed in the Panel.

#STB-Input-Panel-Object
MyObject = ''

This Property is displayed in the Panel and also in the Dialog.

#STB-Input-Panel-Object /// #STB-Input-Dialog-Object
MyObject = bpy.data.objects['Cube']
Clone this wiki locally