Rigging

Rigging101 » Rigging128

Driving a key from a setDrivenKey node with an expression or connection? (3 posts)

About This Topic

Tags

No tags yet.

  1. fsanges

    offline
    Member
    Posted 8 years ago
    #

    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?

  2. lilacpalms

    offline
    Member
    Posted 8 years ago
    #

    Hi
    One way to do it is to rebuild the setDrivenKey using nodes and custom attributes which is basically a percentage of one value against another, for example...

    Create a cube and a sphere. Cube.ty will be the driver and sphere.tx will be the driven channel. Add 2 custom float attrs to the cube, one named driverHigh and one named drivenHigh. Set the value of driverHigh to 50 and the value of drivenHigh to 75, now create a condition node and pipe cube.ty into the first term and cube.driverHigh into the second term, leave the operation to equal and pipe cube.drivenHigh into the colourIfTrueR channel. Now take the outColorR channel of the condition node and pipe that into the sphere.tx attribute.

    Now when the cube is at a value of 50 units in Y the sphere will be 75 units in x, but for everything in between you'll need a couple more nodes. Create 2 multiplyDivide nodes (rename MD1 and MD2), connect cube.ty into MD1.input1X and cube.driverHigh into MD1.input2X and set the operation of MD1 to divide. now pipe the outputX of MD1 into the input1X of MD2 and enter a value of 10 into MD2.input2X and set the operation to multiply. Connect the output of MD2 into the colourIfFalseR attribute of the condition node and the sphere will move in relation to values set in the driver/drivenHigh attributes.

    Hope this helps

  3. kwilli30

    offline
    Member
    Posted 8 years ago
    #

    why not use a setRange or remapColor node to change the out value from your set driven key?

Reply

You must log in to post.

Rigging101 » Rigging128
1,099 posts in 307 topics over 110 months by 188 of 8,226 members. Latest: fashionpvp, d2q4p5z2j, gasheldonl