I know its impossible, but is there a way around it?
Basically, I want the user to select an internal text file then the script will find the classes in the text file, add a property for each one, then display the properties in the panel. Is there any way to do this without the user pressing a button?
This is the error I get:
RuntimeError: Calling operator “bpy.ops.object.createvar” error, can’t modify blend data in this state (drawing/rendering)
Launch a thread that will execute code after a short delay. This should allow the panel to exit out and not complain. Put your code to add the custom properties in the thread_reviewdef.
The next time the panel draw gets an event, it can try again to operate upon the newly create custom properties.