ID names of different tabs

@BYOB @AFWS @jesterKing @ankitm
I am trying to make an add-on which adds a node setup in Compositing workspace. But in the Add-on template I do not know how to change the location of bl_info to Compositor workspace.

“location”: “View3D > Add > Mesh > New Object”

I know View3D is for 3D Viewport. What is the ID name for Compositor workspace?

Since that part is only for human reading, you can write a jargon, not necessarily standard. When the add-on is ready to be submitted, brendonmurphy or Jacuqes or Doctor might be able to help.

https://wiki.blender.org/wiki/Modules

1 Like

@ankitm
What the name of the class I have to use. I know that I need to use class OBJECT_OT_<name> for manupulating in Object in 3D Viewport. What is the class name I need to use for Add in Compositor.

I think the name of the class can be anything. I used NODE_OT_<name> and it works.

You seem to be asking multiple things.

bl_info = {
    "name": "Add Compositor Node Tree",
    "description": "Add Compositor Node Tree",
    "author": "blend_adarsh",
    "blender": (2, 81, 0),
    "version": (1, 0),
    "location": "Compositor > Sidebar > Create > Add Compositor Node Tree",
    "category": "Compositor"
}

import bpy


class NODE_PT_add_compositor_node_tree(bpy.types.Panel):
    """Creates a Panel in the compositor editor sidebar"""
    bl_label = "Add Compositor Node Tree"
    bl_idname = "NODE_PT_add_compositor_node_tree"
    bl_space_type = 'NODE_EDITOR'
    bl_region_type = 'UI'
    bl_category = 'Create'

    @classmethod
    def poll(cls, context):
        node_tree = context.space_data.node_tree
        return node_tree is not None and node_tree.bl_idname == 'CompositorNodeTree'
    
    def draw(self, context):
        layout = self.layout

        row = layout.row()
        row.operator("mesh.primitive_cube_add")


def register():
    bpy.utils.register_class(NODE_PT_add_compositor_node_tree)


def unregister():
    bpy.utils.unregister_class(NODE_PT_add_compositor_node_tree)

if __name__ == "__main__":
    register()
1 Like

Let me make my question clear.
I see that you have used the name of the class as NODE_PT_add_compositor_node_tree. Is this name user-defined? If so, is there a convention to write the name?

https://wiki.blender.org/wiki/Reference/Release_Notes/2.80/Python_API/Addons

3 Likes

The link you provided was so useful. Thanks a bunch. It is surprising that one cannot access that page without having that link!!