First, I want to make sure I'm using the right terms and talking about the proper part of the Blender workspace. From reading a few different answers on SE:Blender, and a few other sources, my understanding is that the area in the blue box below is often called the "Properties area," and that the area in the red box is the "Properties Editor." But I've also read things that make me think the area in the blue box is not called a "Properties area," or anything like that.
So, first, can someone provide me the correct names for these areas? And, since I'm not sure of names, I'll just call them the highly technical terms of "Red Area," and "Blue Area."
A user on SE:Blender sent me an example script that created a tab and panel in the red area, so there was another panel for a specific use. I tried it a couple months ago and it worked. I've been heavily involved elsewhere for awhile and came back to this issue about 2-3 weeks ago. I copied his script in and it didn't work - no panel in the Red Area.
So I went into the Script Editor and picked the "Ui Panel" from the templates and ran that. It looked to me like it was supposed to add a panel to the Red Area, but it didn't. I checked the tabs in the 3D View and nothing was added there at all.
Then I copied the script in the image above from this answer to test it:
import bpy
from bpy.props import FloatVectorProperty, BoolProperty
class CarPanel(bpy.types.Panel):
"""Creates a Panel in the Object properties window"""
bl_label = "Car Details"
bl_idname = "OBJECT_PT_hello"
bl_space_type = 'PROPERTIES'
bl_region_type = 'WINDOW'
bl_context = "object"
@classmethod
def poll(cls, context):
return context.object.get("Capot", False)
def draw(self, context):
layout = self.layout
car = context.object
layout.prop(car, '["Capot"]')
#bools don't show well (1 or 0 integer)
layout.prop(car, "switch")
layout.prop(car, '["bool"]')
col = layout.column()
col.prop(car, '["prop"]')
# car color property
row = layout.row()
row.prop(car, "car_color")
# object color rgba
row = layout.row()
row.prop(car, "color")
def register():
# define a registered property (available for all Object types size=4 gives rgba)
bpy.types.Object.car_color = FloatVectorProperty(subtype='COLOR', size=3)
bpy.types.Object.switch = BoolProperty()
bpy.utils.register_class(CarPanel)
def unregister():
bpy.utils.unregister_class(CarPanel)
if __name__ == "__main__":
register()
I did not see a panel added in the Red Area or anywhere else at all.
Last example - I went to Blender documentation and this page has this script:
import bpy
class ObjectSelectPanel(bpy.types.Panel):
bl_idname = "OBJECT_PT_select"
bl_label = "Select"
bl_space_type = 'PROPERTIES'
bl_region_type = 'WINDOW'
bl_context = "object"
bl_options = {'DEFAULT_CLOSED'}
@classmethod
def poll(cls, context):
return (context.object is not None)
def draw_header(self, context):
layout = self.layout
layout.label(text="My Select Panel")
def draw(self, context):
layout = self.layout
box = layout.box()
box.label(text="Selection Tools")
box.operator("object.select_all").action = 'TOGGLE'
row = box.row()
row.operator("object.select_all").action = 'INVERT'
row.operator("object.select_random")
bpy.utils.register_class(ObjectSelectPanel)
I ran it and it seems to have no effect at all.
So what am I doing wrong? Why don't these scripts seem to do anything and what do I need to do to add a panel to the Red Area? (And what are the proper names for the Red Area and Blue Area?)