## Maya Training

Creating characters In Maya and Zbrush

## Maya Training

Creating character renders in Maya 2017 and Arnold

## Maya Training

Spach-Alspaugh House the complete courseware
You are here > Home > SimplyMaya Community Forums

# Not a member yet? Sign Up!

 Simply Maya User Community - Maya Tutorials How to detect odd or even numbers
 Register FAQ Members List Calendar Mark Forums Read

 27-02-2006, 12:40 PM #1 skywola Registered User     Join Date: Jan 2004 Location: Tempe, Arizona, USA Posts: 224 Thanks: 0 Thanked 0 Times in 0 Posts How to detect odd or even numbers How to Detect odd or even numbers in MEL int \$num = 1; if (\$num % 2 == 0) print(\$num + " even"); else print(\$num + " odd"); \$num++; __________________ "The Sage as an Astronomer: If you still see the stars as something above you, you lack the eye of knowledge." Friedrich Nietzsche
 27-02-2006, 11:59 PM #2 MattTheMan Registered User     Join Date: Apr 2005 Location: Fairfield, CT Posts: 2,436 Thanks: 0 Thanked 18 Times in 18 Posts i dont know MEL, but I know C++, so: cant u divide a number by 2, then store the result in a char with 8 places, then scan the char, if the char has a dot in it then its odd, if not its even. __________________ Live the life you love, love the life you live
 28-02-2006, 05:06 AM #3 skywola Registered User     Join Date: Jan 2004 Location: Tempe, Arizona, USA Posts: 224 Thanks: 0 Thanked 0 Times in 0 Posts In MEL - no . . . . MEL is a much easier language than C++, although C++ undoubtably has more power, and more bells and whistles, so to speak. __________________ "The Sage as an Astronomer: If you still see the stars as something above you, you lack the eye of knowledge." Friedrich Nietzsche
 28-02-2006, 09:00 AM #4 Alan Moderator     Join Date: Oct 2002 Location: London, UK Posts: 2,800 Thanks: 0 Thanked 5 Times in 5 Posts you've done it right by using the modulus command. If you get nothing back then it's even (i think! it's a bit early in the morning for maths! ) A __________________ Technical Director - Framestore Currently working on: Your Highness IMDB

A little bit about who we are
Links you might find useful
Catch up with SimplyMaya
SimplyMaya specialises in Maya tutorials. We offer over 1,000 individual Maya training videos, ranging from basic Maya tutorials through to intermediate Maya tutorials. Our tutorials are created by instructors with industry experience and are designed to get you up and running in Maya quickly without making it seem like hard work.

A Selection of our Bestselling Tutorials
Tutorials by Category
Other Resources on SimplyMaya