Updating scene properties when the active_object changes 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.
If no object is active/selected display scene's properties which the user changes to generate geometry.

If some object is active/selected display the object's custom properties (which are saved to the object when generated) so the user can change them and re-generate the object or generate a new one.

Each generated objects should have 1 property group with all the properties inside, so there is no mess.