PDA

View Full Version : angleBetween problem


ACFred
04-30-2002, 07:42 AM
Howdy. Here's the code snippet:


for ($inc=0; $selectCount-1; $inc++)
{
$rval1 = $jointRotVal[$inc] ;
$rval2 = $jointRotVal[$inc+1];
$getAngle = `angleBetween -euler -v1 $rval1 -v2 $rval2 -ch on`;
}

Here's the problem:

angleBetween -euler -v1 0 -6.362 -1.264 -v2 0 -2.162 -3.444
// Error line 118: Invalid linear unit: 0 -6.362 -1.264 //

Basically, I'm just iterating through a series of joint location coordinates to figure out the angle between them so I can accomplish some other things.

$jointRotVal is a VECTOR
$rVal1 and $rVal2 are both strings, but I've tried making them vectors as well to different but equally frustrating results.

Am I just building my statement incorrectly? It looks OK to me, but maybe I'm missing something a fresh set of eyes will spot.

Thanks in advance.

Alec
alec@community3d.com

jschleifer
04-30-2002, 08:46 AM
Heya,

I've found that maya has probs with vectors in mel scripts.. try putting them explicitly with the .x, .y, and .z..


for ($inc=0; $selectCount-1; $inc++)
{
$rval1 = $jointRotVal[$inc] ;
$rval2 = $jointRotVal[$inc+1];
$getAngle = `angleBetween -euler -v1 ($rval1.x) ($rval1.y) ($rval1.z) -v2 ($rval2.x) ($rval2.y) ($rval2.z) -ch on`;

}

-jason


for ($inc=0; $selectCount-1; $inc++)
{
$rval1 = $jointRotVal[$inc] ;
$rval2 = $jointRotVal[$inc+1];
$getAngle = `angleBetween -euler -v1 $rval1 -v2 $rval2 -ch on`;
}

ACFred
04-30-2002, 09:26 AM
Damn, I thought I'd tried calling them explicitly. That did it.

Thanks Jason.

CGTalk Moderation
01-13-2006, 05:00 AM
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.