Auto generated panel

Hello, if i create a property in types.Object and a panel for modify it on the current object, a new panel ‘Properties’ is automatically created ?? I would like to know how avoid that. :confused:

Some code :


bl_info = {
    "name": "Test Pan",
    "category": "3D View"
}

import bpy
from bpy.props import BoolProperty
from bpy.types import Panel
from bpy.utils import register_class, unregister_class

class TestPan(Panel):
    bl_idname = "VIEW3D_PT_test_pan"
    bl_label = "Test"
    bl_space_type = 'VIEW_3D'
    bl_region_type = 'UI'

    @classmethod
    def poll(cls, context):
        return context.object is not None

    def draw(self, context):
        self.layout.prop(context.object, "test_prop")

def register():
    bpy.types.Object.test_prop = BoolProperty(name="Test Prop")
    register_class(TestPan)

def unregister():
    del bpy.types.Object.test_prop
    unregister_class(TestPan)

An idea ?

The script looks fine, I see though that above that “TestPan” a new panel appears, this is the “custom properties” panel of Blender and it’s not a problem don’t worry about it because users will understand what is going on.

I find that strange, the property appears three times (my panel, the Custom Property panel of the object, and this new panel), like a garland. ^^
But if it’s normal…
Thank you. :slight_smile:

Three times? This might be not good.
This is what it looks like in mine.

I wonder what would it be… Any ideas?

Yes, these two panels, and also in the Custom Properties panel of the object (Properties editor), which is more usual.

is there more code somewhere? or another addon that might cause this??

No, by default it’s the same thing.

Oh, then it looks like this is OK because custom properties indeed should appear in the properties window at the appropriate tab as well (i.e. Object tab). Users will recognize that and won’t be confused so don’t worry.

Ok, thank you.

Note : If i place the panel in the object tab of the properties editor (with space_type PROPERTIES and region_type WINDOW), the new properties panel continue to appear in the N panel of the viewport, so i suppose that it is impossible to hide it.

Yes it’s impossible to hide, for example even properties of cycles appear on the properties panel but at least you can collapse the panel for not taking up space.

Ok, thank you. :slight_smile: