So I want to dynamically change several render settings in a Python script. I need a function to be able to call the setting from an index or a key, so that it modifies the correct setting. Since there is about 10 settings I want to modify the only way I can get the desired result is by having a bunch of IF statements for each possible setting. That seems like a terrible way to do it. Is there a way to save the settings to a list or dictionary?
Heres an example:
import bpy
<b>bpy.data.scenes[0].cycles.samples = 1 </b><b># Number of samples</b><b>
lis = [bpy.data.scenes[0].cycles.samples]
lis[0] = (10)</b>
print ('Actual ' + str(bpy.data.scenes[0].cycles.samples))
print ('Modified ' + str(lis[0]))
Output:
Actual 1
Modified 10
It should produce:
Actual 10
Modified 10