And I create drivers in other objects which should be controlled by this custom property. I’ve tried for hours now to get the Data path from this value to the Variable of the Driver…
I think I need to set the Prop and Path with driver.variables = xx but I can’t figure out how to get that data from the property to the driver. In UI I can simply Copy Data Path but not in python…
Hi,
First thank you so much for showing me that you could create a new custom property just by setting : myObj[‘myProp’] = someValue. I was looking for a way to change the property name without success.
If you want the expression to be more complex, like if statements, you can use one of the functions available in bpy.app.driver_namespace, like pi or cos.
Or you can define your own function in the text editor:
Make sure your script has a .py extension and check the “Register” button, so it loads each time you open your scene.
You access the function by using its driver_namespace: