Add-on Panel missing from Active Tool & Workspace Settings

Hello Everyone!

I have created a few add-ons (e.g. https://github.com/Shriinivas/writinganimation) for Blender 2.8. For capturing the user input, I have been creating the UI Panels in ‘Active Tools & Workspace Settings’ tab using the following code:

bl_label = "Writing Animation"
bl_idname = "CURVE_PT_writinganim"
bl_space_type = 'PROPERTIES'
bl_region_type = 'WINDOW'
bl_context = '.objectmode'#Active only in object mode

I had successfully tested this upto the build dated May 4th. But since May 15th build the add-on panel is not seen on ‘Active Tools & Workspace Settings’ anymore. The add-on is installed correctly and is available from the F3 menu, but the UI panel is not accessible.

Has there been any change recently with respect to displaying of add-on UI?
I would appreciate any help.

Thank you
Shrinivas

Something similar happened to me the same day, I updated Blender and boom, the addon I was making looked awful due to some changes in the UI, and just today I readed that it was a bug and with the update version it is fixed, but not good for ui addons yeah, so in my case I had to add some thingsa I was playing with overwriting the original ui class or registering and unregistering it to fit it all in a good way.

I can give you a working code of a panel in my addon:

import bpy
from bpy.types import Panel

class NSMUI_PT_panel(Panel):
    bl_idname = "NSMUI_PT_Panel"
    bl_label = "New Sculpt-Mode UI"
    #bl_category = "Test Addon"
    bl_space_type = "VIEW_3D"
    bl_region_type = "UI"

    def draw(self, context):

        if(context.mode != "SCULPT"):
            layout = self.layout
            row = layout.row() # define una fila
            row.operator('nsmui.ot_panel_setup', text="Sculpt-Mode Setup")

Also in my case this panel is located in the ‘Misc’ tab

I tried with your bl info ‘space_type’ and ‘region_type’ and now the ui is located in the render settings panel, at the very bottom, look for it maybe is there

Yes, that’s right. The UI appears under render settings if bl_context is commented out. But it appears in all the tabs except Active Tools and Workspace settings :). The other setting suggested by you:

    bl_space_type = "VIEW_3D"
    bl_region_type = "UI

works. With this there is a new Misc tab on tools panel in 3d view, displaying the add-on UI. But again, I have published a video, which shows the panel under Active Tools and Workspace settings, so as far as possible, I would like to retain the panel position.
Secondly, with the latest build, there are now a few other errors related to scene.update and depsgraph. Looks like quite a bit of add-on API changes underway. So I guess, it’s better to wait for a few more days to let the things settle down.

Thank you very much for your help, though!

Best regards
Shrinivas

I see… Well in that case I don’t know about how to retain the UI in that place…

I have found that they changed the default code but also they let commented the old one plus a note for the new settings

  class WorkSpaceButtonsPanel:
# bl_space_type = 'PROPERTIES'
# bl_region_type = 'WINDOW'
# bl_context = ".workspace"

# Developer note: this is displayed in tool settings as well as the 3D view.
bl_space_type = 'VIEW_3D'
bl_region_type = 'UI'
bl_category = "Tool"

There they use a parent class so the child ui class inherits from the parent class the space and region configuration…

The start of the child class:

class WORKSPACE_PT_main(WorkSpaceButtonsPanel, Panel):
bl_label = "Workspace"
bl_options = {'DEFAULT_CLOSED'}

def draw(self, context):

ALSO! I just found this that sure is useful for you, it’s about the change of the ui for the tool settings
https://www.mail-archive.com/[email protected]/msg109111.html

Is a change from 10th May

It seems like internally the tool settings have been moved to the 3D view… so now is a fact we can draw panels from the 'VIEW_3D' space(?) I think so

Ok I get this code works and it shows in the tool settings in both the properties space and the 3d viewport

import bpy
from bpy.types import Panel

class TEST_PT_uiPanel(Panel):
    bl_space_type = 'VIEW_3D'
    bl_region_type = 'UI'
    bl_category = "Tool"
    bl_label = "TEST UI PANEL"

def draw(self, context):
    layout = self.layout
    row = layout.row() 
    row.operator('render.render', text="TEST BUTTON")

def register():
    from bpy.utils import register_class
    register_class(TEST_PT_uiPanel)

def unregister():
    from bpy.utils import unregister_class
    unregister_class(TEST_PT_uiPanel)

And a screenshot! I hope it is helpful for you!!

So the code I gave you in a first moment was right but need to write also this: bl_category = "Tool", to be able to show the panel in the tool settings of the properties space

1 Like

Yep! Now it’s working as desired. Thank you very much :slight_smile:

1 Like

Happy to hear that! hehe Nice addon btw! keep up the great work :slight_smile:

Oh thank you! :blush: