Hey guys,
I'm trying to store an animation curve as a texture. I have tried a few ways but can't get it right. I've got 28 frames with varying values between -1.0 to 1.0. I'd like to store it as a 1x28px texture.
I've tried letting a place2Texture's outU drive an animation curve and use that input as color in a material. But just renders as a solid color in the end.
Anyone have any ideas?
Thanks!
Replies
7 rows of python code was all it took.
I'm pretty much querying every frame in my range for it's value. Then creating new indexes with colors and positions in a ramp node. I.e. keyframe value = color and frame = position.
https://www.youtube.com/watch?v=jt4QE0A9IXg
eg instead of a greyscale strip you would have a wide 3 line image strip with the rgb being each line and depending on their value you set that channels transform to the colour strength.. eg red 255 would be scale x *2 red 0 would be scale * 0 and so on.
It's 28 frames from one animation curve(one value) in Maya stored in a 1x32px picture (32px because of power of 2). So far I'm just storing the same data in R, G & B. So I have an accuracy of 256 steps. But you could easily adapt this to get better precision or perhaps store multiple values in different color channels.