Page MenuHome

Calling unregister function in custom_nodes.py example
Closed, InvalidPublic

Description

System Information
Operating system: Windows-7-6.1.7601-SP1 64 Bits
Graphics card: GeForce GTX 660 Ti/PCIe/SSE2 NVIDIA Corporation 4.5.0 NVIDIA 416.34

Blender Version
Broken: version: 2.83 (sub 13), branch: master, commit date: 2020-04-21 17:59, hash: rB13e3a1c53222
Worked: (newest version of Blender that worked as expected)

Short description of error
I'm using example from Blender scripts templates called custom_nodes.py. When I use it as it is everything is as expected. Then i'm trying to call unregister code of the same example and i'm getting next error:

Traceback (most recent call last):
  File "\custom_nodes.py", line 187, in <module>
  File "\custom_nodes.py", line 183, in unregister
RuntimeError: unregister_class(...):, missing bl_rna attribute from 'RNAMetaPropGroup' instance (may not be registered)

I think whether it is a bug or the example is incorrect.

Exact steps for others to reproduce the error

  • open custom_nodes.py script in text editor
  • run the script
  • rename register() to unregister() in the end of the example
  • read console

Event Timeline

You need to register before unregister.
By renaming register to unregister you are reversing the order.
And whenever you run the script you are creating other pyobjects.

Ok, is it possible to unregister MyCustomTree class from custom_nodes.py example after this class was registered? I just can't find where Blender keep this class after registration. bpy.types looks like keeps only built in classes.

I suggest asking this on user support sites -> https://www.blender.org/support/