Home Technical Talk

[Maya] Storing animation curve as a texture?

polycounter lvl 19
Offline / Send Message
kodde polycounter lvl 19
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

  • kodde
    Options
    Offline / Send Message
    kodde polycounter lvl 19
    Solved this with a solution suggested by my colleague.
    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.
  • kodde
    Options
    Offline / Send Message
    kodde polycounter lvl 19
    Here's what I wanted to use this for if anyone interested. ShaderFX project as usual :P

    https://www.youtube.com/watch?v=jt4QE0A9IXg
  • Flynny
    Options
    Offline / Send Message
    Flynny polycounter lvl 9
    Is that all one image strip or a series of frames? Interesting, I'm thinking along these lines for a shader in Unity..

    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.
  • kodde
    Options
    Offline / Send Message
    kodde polycounter lvl 19
    Yes it is.
    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.
Sign In or Register to comment.