1
$\begingroup$

I created a simple bpy.types.Panel to allow modification of custom scene properties, wanting it to appear only on the Scene property tab, and thus created it like this:

class MK8PanelSceneCourse(bpy.types.Panel):
    bl_label = "Mario Kart 8 Course"
    bl_idname = "SCENE_PT_mk8course"
    bl_space_type = "PROPERTIES"
    bl_region_type = "WINDOW"

This works fine, and the panel appears on the scene property tab as expected:

Scene tab

However, I noticed it also appears on every other tab. Here's an example with the World tab, where it's even the World name textbox:

World tab

How can I make it appear only on the scene tab?

$\endgroup$
1
$\begingroup$

It looks like I forgot to set up the bl_context member of my panel. Sadly, the documentation is not very clear about the possible values (it would be great it if someone could list them and link it in a comment).

For the scene tab, the panel code would be:

class MK8PanelSceneCourse(bpy.types.Panel):
    bl_label = "Mario Kart 8 Course"
    bl_idname = "SCENE_PT_mk8course"
    bl_space_type = "PROPERTIES"
    bl_region_type = "WINDOW"
    bl_context = "scene"
$\endgroup$
2
  • 2
    $\begingroup$ Mouse over icons on top of properties panel. Lowercase versions of blender.org/api/blender_python_api_2_77_0/… $\endgroup$
    – batFINGER
    Jul 3 '16 at 18:13
  • $\begingroup$ @batFINGER Thanks, I didn't know it would map exactly to the tooltips =) $\endgroup$
    – Ray
    Jul 3 '16 at 18:21

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.