1

In short my question is how can I remove/delete an panel/class/operator which: a. I don't know the full name b. and I don't know where it is stored in Blender system.

In other words, how I can undo a script that I run several times... when I only have the script?

Below you could find the script.

the original code from github

more on mocap operation could be found in this tutorial OpenCV facial mocap:

if relevant, some additional details on what I did: I tested a mocap script. Thus, I had to run also the below mentioned script. Which displays a panel on the UI and also a small button on the tool menu.

Currently it doesn't function. I don't know why. So I decided to uninstall then reinstall the scripts later. Reboot.

I run it before from different files. I unregistered and deleted the scripts from all of them, but the operator exists somewhere in the system.

cannot figure out how to remove the panels+actions created by the script.

I tried the following which didn't work.

OpenCvClass = bpy.types.WorkSpaceTool.bl_rna_get_subclass_py('ui_plus.opencv')

bpy.utils.unregister_class(OpenCvClass)

Sorry, I struggle to paste the code properly, this question though relates to the forum's Meta:

   import bpy

class OBJECT_MT_OpenCVPanel(bpy.types.WorkSpaceTool): """Creates a Panel in the Object properties window""" bl_label = "OpenCV Animation" bl_space_type = 'VIEW_3D' bl_context_mode='OBJECT' bl_idname = "ui_plus.opencv" bl_options = {'REGISTER'} bl_icon = "ops.generic.select_circle"

    def draw_settings(context, layout, tool):

        row = layout.row()
        op = row.operator("wm.opencv_operator", text="Capture", icon="OUTLINER_OB_CAMERA")

def register():
    bpy.utils.register_tool(OBJECT_MT_OpenCVPanel, separator=True, group=True)

def unregister():
     bpy.utils.unregister_tool(OBJECT_MT_OpenCVPanel)

if __name__ == "__main__":
    register()

donbonbon
  • 107
  • 1
  • 14
  • 2
    Please use proper code formatting -> Select the code and hit Ctrl + K... In general, you do not have to re-boot anything, it's enough to hit F3 and type Reload Scripts in order to refresh. Where does this operator come from? Can you provide a link? – brockmann Feb 18 '21 at 17:08
  • If you just ran the script in the text editor it should be gone after starting Blender again. Calling the unregister function should also unregister the panel. Are you sure that the panel you're referring to is in fact create by this script and not a script/add-on that you've install through the user preferences (Edit > Preferences > Add-ons)? – Robert Gützkow Feb 18 '21 at 20:33
  • thanks for the guidance @brockmann I incorporated the proposed changes in the edited text as proposed – donbonbon Feb 18 '21 at 20:37
  • @Robert Gützkow - Thanks for the observation. Though, I didn't created via the Add-0n. – donbonbon Feb 18 '21 at 20:56
  • 1
    @brockmann Your refresh proposal solved my problem. Thanks first. How can I credit you for the answer ? As I don't have enough credits I cannot close the question, I can 'Answer Your Question' and mention you... which is strange, you answered it. – donbonbon Feb 18 '21 at 21:11
  • You can ping @RobertGützkow, the close-god, able to close anything. – brockmann Feb 22 '21 at 10:37
  • I've closed this as a duplicate, since reloading the scripts worked. Not an exact match, but I hope that's a solution everybody is happy with? – Robert Gützkow Feb 22 '21 at 10:57
  • Updated the answer over there @RobertGützkow ... should be fine, I think. – brockmann Feb 22 '21 at 12:54

0 Answers0