FORUMS: list search recent posts

Stupid Math Question

COW Forums : Autodesk Maya

<< PREVIOUS   •   VIEW ALL   •   PRINT   •   NEXT >>
Adam Benson
Stupid Math Question
on Oct 27, 2009 at 12:01:02 am

Some times the simplest math turns out to be the stupidest math in Maya. Here's my problem. I need an equation that takes one value and subtracts it from 90.

float $newValue = (90-$someValue.rotateZ);

Except, that doesn't work. I've tried all kinds of variations of this.

float $newValue;
$newValue=90-$someValue.rotateZ;


Doesn't work. I've tried separating out everything with (). Nope.

I've even tried

$newValue=abs($someValue.rotateZ-90);

Again, Doesn't work. Plus, that's still wrong anyway!
I've also tried

int $ninty = 90;
float $newValue;
$newValue = $ninty - $someValue.rotateZ;


The only thing that works is

$newValue = $someValue.rotateZ - 90;

But who cares, that's a different value than I need. I need the value subtracted from 90, so that I can use that value to drive the other main expression. It's burning my freakin' brain!
Does anyone know how to subtract the rotation of one object from 90 to get a usable result? This should be working, but isn't. Of all the stupid things!!

The end result is supposed to work like what I imagine this would.

$gearRemain = 90 - landingGearLf.rotateZ;
landingGearRt.rotateZ=landingGearLf.rotateZ+$gearRemain;


Real simple. Doesn't work.

Thanks in advance for your help.


Adam Benson
Visual Effects Artist/Musician/Sound Engineer/Editor
http://www.SleepDeprivedProductions.com
http://www.SleepDeprivedFilms.com


Return to posts index

Adam Benson
Re: Stupid Math Question
on Oct 27, 2009 at 12:11:53 am

Nevermind. Came up with a whole new solution, that has nothing to do with this equation. Although, I'd still like to know why this simple math doesn't work.... if anyone knows.
Thanks again,
Adam

Adam Benson
Visual Effects Artist/Musician/Sound Engineer/Editor
http://www.SleepDeprivedProductions.com
http://www.SleepDeprivedFilms.com


Return to posts index

Michiel Duvekot
Re: Stupid Math Question
on Oct 27, 2009 at 3:21:48 am

if $someValue is the name of a transform, then you would want to do it this way:

float $newValue = 90 - `getAttr ($someValue + ".rotateZ") `;





Return to posts index

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