I’d like to write a script that will tell me which drivers in a scene have problems. For example, the driver that I’ve highlighted in yellow has problems:
I want to return a list of every driver that has problems, rather than having to look at each driver in a scene individually and determine if it is valid.
Here’s what I have so far:
import bpy
for obj in bpy.context.scene.objects:
if obj.animation_data:
if obj.animation_data.drivers:
for d in obj.animation_data.drivers:
if d.driver.is_valid == False:
# Now what??
The issue is trying to figure out the name of the property that has the driver. I’ve looked in the API documentation and it’s not immediately obvious how to get that.
In the case of the screenshot above, I want to get (or create) the string value "Y Euler Rotation (forearm.IK.L)".
How do I do that?