I am writing a script and this script required adding a driver to an object,so I added it but I have 2 problems with it.
I have added a single property variable and set its ID and path. After I run the script, the variable added correctly and everything is fine, but I see that the path is colored in red and Blender said that my driver failed. I figure how to fix this, by selecting the ID object (spin object) one more time (which is already selected) as shown in the figure. So how can I fix this? Because I don't want to do this every time I run the script. and here is the script and the image.
newVar.name = "Array" newVar.type = 'SINGLE_PROP' newVar.targets[0].id = bpy.data.objects['Spin object'] newVar.targets[0].data_path = 'modifiers["Array"].count'
- When I change the value of the variable (array count), I didn't see the effect until I press update dependencies. I want it to be updated without pressing update dependencies every time I change the value of the variable. How can I do this?