Page MenuHome

CollectionProperty declarations throwing errors randomly
Closed, ArchivedPublic


System Information
Operating system: Win 10
Graphics card: NVIDIA GTX 1060

Blender Version
Broken: 2.80, 2019-01-22

Short description of error
CollectionProperty randomly throwing registration error.

Exact steps for others to reproduce the error
Declarations are as follows:

class RenderLayersToInclude(bpy.types.PropertyGroup):
layerName: bpy.props.StringProperty()
isIncluded: bpy.props.BoolProperty()
class ConfigCreatorOperator(bpy.types.Operator):

	layersToInclude : bpy.props.CollectionProperty(type=RenderLayersToInclude)
    def invoke(self, context):

Full error is as follows

TypeError: CollectionProperty(...): expected an RNA type, failed with: RuntimeError: , missing bl_rna attribute from 'RNAMetaPropGroup' instance (may not be registered)
Traceback (most recent call last):
File "E:\dmw\dmwTools\blenderScripts\modules\dmw\rqmanager\blender\", line 44, in invoke


File "E:\dmw\software\blender\2.80-beta\2.80\scripts\modules\", line 657, in getattribute

return super().__getattribute__(attr)

AttributeError: 'ConfigCreatorOperator' object has no attribute 'layersToInclude'



Event Timeline

Jacques Lucke (JacquesLucke) triaged this task as Needs Information from User priority.

Did you register RenderLayersToInclude before you registered ConfigCreatorOperator?

Yes... I registered RenderLayersToInclude before ConfigCreatorOperator

Error is not consistant... It'll error out very randomly / unpredictable. There are no preferences or any initialization lines before registering.

Here is registration code (snapshot)

Can you share a small complete example that we can use to reproduce the issue?

Find bug behavior in above video attachment. It errors out very randomly. No specific pattern.

Find source code below (video is recorded with following source code only)

Jacques Lucke (JacquesLucke) claimed this task.

I found two problems in the code.

  1. The dtrClasses object is a set instead of tuple or list. In Python sets have no ordering guarantees (yet?). That is probably the reason why the problem only appears sometimes.
  2. You call register_class in the unregister function.
  1. You're correct. I changed it to tuple and no there's no error after that. Thanks for correction. I didn't know ordering issue with sets. New learning today :)
  1. It's my bad. While trimming code base to provide example for you, I made that mistake.

We can close this ticket.