FORUMS: list search recent posts

how to store a baked animation curve in an array using MEL

COW Forums : Autodesk Maya

<< PREVIOUS   •   VIEW ALL   •   PRINT   •   NEXT >>
Daniel Tan
how to store a baked animation curve in an array using MEL
on Feb 22, 2010 at 10:16:19 am

Hi, everyone,

hope you all are doing great as usual. :)

im having a bit problem here with MEL.

I want to store all frames info of a baked animation curve into an array, in order to modify each frame's data while scripting using MEL.

how should i do it? since im learning MEL by myself currently, need lots of help.. thanks.. maybe a sample code can help me.. :)

thanks in advance.. take care. :)

danny


Return to posts index

Michiel Duvekot
Re: how to store a baked animation curve in an array using MEL
on Feb 22, 2010 at 5:19:09 pm

You could do something like this:

float $values[] = `keyframe -query -valueChange pCube1.translateX`;

for ($i =0; $i < `size $values`; $i++){
$values[$i] *=2.0;
keyframe -edit -index $i -valueChange $values[$i] pCube1.translateX;
}



Michiel
http://www.thnkr.com


Return to posts index

Daniel Tan
Re: how to store a baked animation curve in an array using MEL
on Feb 23, 2010 at 8:29:39 am

Hi,

thanks a lot, Michiel. :))

:)


Return to posts index


Daniel Tan
Re: how to store a baked animation curve in an array using MEL
on Feb 26, 2010 at 7:24:44 am

Hi, Michiel,

when im done with modifying values in the array, then I want to load the data is the array back to the baked curve, how should I do that with MEL?

thanks.. :)


Return to posts index

Michiel Duvekot
Re: how to store a baked animation curve in an array using MEL
on Feb 26, 2010 at 10:15:21 pm

Well, if you follow my example, there's nothing more you need to do. Maybe I'm misunderstanding the question?

Michiel
http://www.thnkr.com


Return to posts index

Daniel Tan
Re: how to store a baked animation curve in an array using MEL
on Mar 4, 2010 at 12:13:21 pm

Hey, Michiel,

yeah, your code does help me.. thanks a lot. but thats for reading from the baked animation curve to a MEL array &a[]. I ve achieved it with the help of your code..

However, Now, in MEL, i ve made some changes to each value in the array $a[], and I want to restore it back to the animation curve... how should i write the code now?

basically now i want the reverse action of what your previous code did. :)

hope you understand me now.. sorry for having not explained it clearly. thanks a looooot


Return to posts index


Michiel Duvekot
Re: how to store a baked animation curve in an array using MEL
on Mar 9, 2010 at 3:08:23 pm

Sorry, I'm not understanding your problem. My example modifies the values of all keyframes (it multiplies them by 2.0). You say you want the reverse of that?

If you're read values and stored them in an array, which I didn't do, then you need to use something like keyframe -t [int frame] -valueChange [float value] pCube1_translateX;



Return to posts index

<< PREVIOUS   •   VIEW ALL   •   PRINT   •   NEXT >>
© 2017 CreativeCOW.net All Rights Reserved
[TOP]