PDA

View Full Version : expression weirdness


DrYo
02-25-2008, 06:32 PM
Hi,

I'm fairly n00b-ish to MEL and expressions, so maybe someone here can shed a bit of light on this strange behavior within Maya.

All I want to do is automate the rolling of a wheel. I'm using an expression:

pCylinder1.rotateZ =
pCylinder1.translateX / polyCylinder1.radius;


I've set "Convert Units" to "None," so the expression is working solely in radians. I did create a different expression that used degrees, but the result was the same. I also tried parenting the wheel to a car body, but again, the same result.

When I move the object interactively in the viewport, the wheel spins in the wrong direction. When I create keyframes and play back the animation, the wheel spins in the correct direction. What gives? I've done this exact same thing in 3ds Max with no problems.

Thanks.

DrYo
02-26-2008, 08:50 PM
Any ideas? Is it a bug?

strarup
03-05-2008, 07:53 AM
Hi DrYO,


will have a look at it when I get home later today...

however have some questions... since I can see you written 2 different object names...
pCylinder1 and polyCylinder1...

are there 2 different objects... and if there is are they related and how... or is there only 1 object?

kind regards

Strarup

strarup
03-09-2008, 10:32 PM
Hi,


hmmm... aparently there is nothing wrong with your expression... except it produces a very little value... which barely isn't visible... had to multiply with arround 30 before it began look like it rolled... and also multiplied that with -1 to get it rolling into the direction I pulled it... :)

will suggest you to take a look at this tutorial by Javier "Goosh" Solsona "Working with Expressions & constrains"...
http://student.vfs.com/~m07goosh/Tutorials/cart/index.htm

to get a wheel expression... :)

hope that helps... :)


kind regards

Strarup

CGTalk Moderation
03-09-2008, 10:32 PM
This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.