View Full Version : Driving a key from a setDrivenKey node with an expression or connection?
fsanges 06-04-2009, 01:34 PM Does anyone knows if its possible to drive a specific key from a setdrivenkey curve?
ex. The SDK node kneeJ_translateX has 2 keys, you can see on the graph editor that the first key is (0 , 0 ) and the second is (10 , 20) (on the attribute editor is (Time , Value)). Is there a way to drive those numbers with a custom attribute?
|
|
Leffler
06-06-2009, 03:38 PM
Wo, good question. I´ve also been wondering about if this is possible. Would be awesome in for example the foot roll, where it would be adjustable when the toe should start rotate
Sorry for not answering your question, but will try now in Maya ... :)
//Otto
theflash
06-06-2009, 06:22 PM
I think you won't be able to use direct connection. However, you can use script to update your set driven key. You can access properties of animation curve node (sdk node) like this
for 1st key,
getAttr kneeJ_translateX.keyTimeValue[0].keyTime
getAttr kneeJ_translateX.keyTimeValue[0].keyValue
for 2nd key,
getAttr kneeJ_translateX.keyTimeValue[1].keyTime
getAttr kneeJ_translateX.keyTimeValue[1].keyValue
I am sure you should be able to to setAttr on these.
Or if you want you can create an expression to assign the value directly, without using setAttr command.
Boucha
06-07-2009, 01:29 AM
This is pretty interesting and I did a quick test.
The SDK node can be interconnected and manipulated. For example, animate a ball bounce.
You can then manipulate the animation of the ball by connecting a custom attribute or any expression/nodes to the input and output attribute of the set driven key node.
For the time and value we need a different solution...
for example, we can write an expression to get the attribute of the desired attribute and set that attribute to the set driven keys time or value attribute..
Lets say we have a ball bouncing...the ball goes up and down which is translate Y attribute. We can create a custom float attribute (for this eg... lets say ball.tyValue for value and ball.time for time) to control this translate Y animation...
//Create an expression:
//Get and store the attributes value
float $ty = `getAttr ball.tyValue`;
float $time = `getAttr ball.time `;
//Set the values to the SDK attributes
keyframe -index 1 -absolute -valueChange $ty ball_translateY;
keyframe -option over -index 1 -absolute -timeChange $time ball_translateY;
This way you can manipulate the value and time of the SDK node...
This same technique can be implemented in driving a key with a set driven key node...
tonytouch
06-07-2009, 09:18 AM
great question ... one of these , that i also wondered , if this is gonna work . so one is able to animate the setDrivenKeys
maybe this would be a great idea for a python_plugin ... ( to prevent expressions )
easy , would be to use regular python_commands in the plugin ... more difficult , to directly set the values , with api-commands --- it might be a bit complicated , if you dont "just want" to change the value of the key , but also its position ( time ) .
this would be definetely be worth to try out ...
CGTalk Moderation
06-07-2009, 09:18 AM
This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.
vBulletin v3.0.5, Copyright ©2000-2012, Jelsoft Enterprises Ltd.