I just came across this problem with _RestrictData when the add-on loads. I understand why this problem shows up, as I have read some other threads regarding this problem, though I still don’t get how to fix it. One of the properties defined in the bpy.types.panel class requires bpy.data.materials.
My question is, what is the best workaround for this?
Hmm, okey. I have had properties in my panel class and it have worked, though I guess you shouldn’t because its a bad structure of the code and it maybe doesn’t work in some cases. Anyways, what I wanna do is I wanna create a list of all the materials in the scene. I thought using the enumproperty would work good here, but I can’t reach bpy.data.materials at startup. Is there a smarter way of creating this list of materials that will be visible in the panel, or should I use that hacky workaround you mentioned?^^