Actual Question: I know I can get the value of a property in Python by a line of code like this:
shader = bpy.context.space_data.shading.type = 'WIREFRAME'
I know some modules access that data by getting the path to it as text and use that. So if I have the path in text, like this:
shader_path = "bpy.context.space_data.shading.type"
How do I use that string to access that value and read it or set it?
Background (likely unneeded): I have a script that will render images from a number of different cameras and the rendering properties (such as resolution, background, and shading type) will change from camera to camera. I'd like to be able to just store all the value locations in a list so I can step through it and save the values in a dictionary, in Python, then, when I'm done with the rendering, just step through the keys of the dictionary, take the value, and store it from where I got it. (I'm using a dictionary and not a PropertyCollection because this is short term and doesn't need to be stored long term and a dictionary will be easier to write.)
If there's a better way to do this, I'm open to it. I just don't want to be managing over half a dozen statements to get values and to reset them after the rendering, since I may be adding more property values that will need to be saved as I make changes over time - so I'd rather just be able to put the property location in a list and it's looped through. I think this is also a good idea since it's consistent with how classes are registered and unregistered now days.
eval
orexec
to run string statements / expressions but there usually is a better way to do it. stackoverflow.com/questions/2220699/… Why do you need to store the left part of the statement in a dictionary ? $\endgroup$