Inside Sabertooth
Learn how Sabertooth uses 3ds Max to create 3D interactive projects, including HBO Go’s Game of Thrones interactive experience
  • 1/3
You are here: Forum Home / Autodesk® Maya® / MEL / [SOLVED] Animation - finding odd/even frames?
  RSS 2.0 ATOM  

[SOLVED] Animation - finding odd/even frames?
Rate this thread
 
52159
 
Permlink of this thread  
avatar
  • Nexus1con
  • Posted: 09 February 2011 04:14 AM
  • Location: Nottingham
  • Total Posts: 7
  • Joined: 13 May 2009 10:43 PM

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



Replies: 0
avatar
  • Nexus1con
  • Posted: 09 February 2011 04:36 AM

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



Replies: 0