Hey guys.
Is there anyway I can get the mathematical formula behind an animation curve?
What I'm after is a custom lighting method in a visually and easily controlled environment. I've got a shader so far where I have control of how the light should influence the shading controlled by a curve(animation curve). Much like hooking up a Surface Luminance -> 2D Ramp -> Shader's Diffuse input. But I'm doing this with a curve instead of the ramp. Combine this with IPR rendering that updates on the fly when I'm tweaking the curve and I got a pretty sweet setup.
Now here's my thought. The animation curve ought to be resolution independent, so it's most likely math based right? I want that math" I want to be able to give this to a programmer and have him implement this in his game engine.
Any thoughts on this?
Thanks.
Replies
If anyone has an other easy solution outside of Maya for then I'm all ears.
If you've already looked into this method and it turned out animation curves were more useful, my mistake.
Edit: Looking at an animation curve, each keyframe seems to have a few values...its time, its value, its inAngle, and its outAngle. You might be able to query these.
Yeah maybe I could get the help of my programmer colleagues to have a look at that animation curve and see what we could make of it. I tried exporting the scene as a Maya Ascii file to see if I could make anything of it. Didn't seem as simple as I had hoped it to be. Perhaps a Collada exporter or something similar that allows you to export animation could be a way?
Hmm...
Thank you for input btw.
createNode animCurveTL -n "pPlane1_translateY";
setAttr ".tan" 3;
setAttr ".wgt" no;
setAttr -s 3 ".ktv[0:2]" 1 0 10 13.589232757275301 20 -7.4898579375440484;
setAttr -s 3 ".kit[1:2]" 9 2;
setAttr -s 3 ".kot[1:2]" 9 2;
.ktv I guess stands for Time/Value. At Frame 1, the plane was at 0. At Frame 10, the plane was at 13.589. At Frame 20, it was at -7.489.
.kit is the inTangent and .kot is the outTangent. I haven't played around with it enough to know what the values mean.
Edit: It adds a bunch of other values like .kix .kiy .kox and .koy if you use non-standard tangents.
I think you are on to something here.
I take it the [0:2] part of the ktv must be the declaring the number of keyframes? 0, 1 and 2?
The numbers in brackets for the kot is a bit trickier. Never really worked with math for curves like this.
In the Outliner window, in the Display menu, uncheck DAG Objects Only. A bunch of new nodes will appear. The ones that look like the graph editor are animation nodes. Click on one and bring up the Attribute Editor. Check "Expand Spreadsheet". There you go.
Thanks for all your help.