I am writing a Add-On which adds a panel to the 3d view. It should let users create primitive meshes and set details like name, subdivide, color or noise to manipulate the mesh.
Currently the used details are stored in a list per object as part of the add-on. The intention is to use the list to give the user the opportunity to see what the values are on existing objects created by the addon.
What I try to achieve:
I want the panel to be drawn always. Inside the panel are some properties which the user can manipulate and then press 'generate' so that a new object is generated with the new property values. A user should be able to select an already generated object, see the values of that object, manipulate them and generate a new object.
For example we have another object which has the name B. It has different values. If I select B, the values in the Panel need to change. The user should be able to change some of the values and generate a fully new object! The old object isn't manipulated. I only want to add some comforting behaviour.
The problem
bpy doesn't allow scene properties to be updated inside the scope of poll
or draw
, this means I can't automatically update the scene properies shown on the UI if one of my custom primitives is active.
The question
If there is no way to set properties from inside the draw-method, how would I achieve this?
Here's what the panel looks like.