[SOLVED] Animation - finding odd/even frames?

[SOLVED] Animation - finding odd/even frames?

Anonymous
Not applicable
538 Views
1 Reply
Message 1 of 2

[SOLVED] Animation - finding odd/even frames?

Anonymous
Not applicable
Hi, I'm extremely new to MEL and have limited programming ability so bear with me!

I'm trying to animate a Hummingbird's wings beating with an expression
heres what I think the mel should be doing

if (frame == EVEN ) { //even, or use the modulo operator maybe?
masterControl.wingBeat = 10
(else)
masterControl.wingBeat = -10
}
most of that's probably wrong but hey 🙂

ive tried testing this by saying
if (frame == 1) {
masterControl.wingBeat = 10
}
and that doesnt work at all

I'm using Maya 2011 if that changes anything
wingBeat is a custom attribute on the rig

Cheers,
Steve
0 Likes
539 Views
1 Reply
Reply (1)
Message 2 of 2

Anonymous
Not applicable
if (frame %2 == 0) {
setAttr masterControl.wingFlap 10;
}
else {
setAttr masterControl.wingFlap -10;
}
is the solution 🙂
does take a while to compute but made my life alot easier!
hope it helps someone else eventually
0 Likes