Get driver value from driven python maya

Get driver value from driven python maya

maxime-picot
Contributor Contributor
720 Views
2 Replies
Message 1 of 3

Get driver value from driven python maya

maxime-picot
Contributor
Contributor

Hello!

I would like to retrieve the driver values ​​for my driven keys but I cannot retrieve them.

For example, I have my object A driver with a custom attribute and object B driven
When :
A = 0
B = 2

 

A = 5
B = 10

 

A = -5
B = -3

 

I have this line which allows me to retrieve the values ​​of the driven:

cmds.keyframe(driven_attr, query=True, valueChange=True)

So I manage to have:
B = [2,10,-3]

but how to get the value of A when B = 2?

 

Is there something similar to get the driver values ​​corresponding to these values?

0 Likes
Accepted solutions (1)
721 Views
2 Replies
Replies (2)
Message 2 of 3

mcw0
Advisor
Advisor
Accepted solution

setDrivenKeyframes are not keys but floats.  So use the same query but change "valueChange" to "floatChange".

Message 3 of 3

maxime-picot
Contributor
Contributor

Wonderful ! Thanks you !

0 Likes