PDA

View Full Version : vector declaration


chayanvinayak
07-02-2008, 05:52 PM
Hi ,

following line of code is giving me Syntax error :
eval("global vector $" + $driven[$i] + "_joint_attrib[] = {vector("+$r+"),vector("+$s+"),vector("+$t+")}");

thanks
my complete code is :

vector $r = `getAttr ($driven[$i]+".rotate")`;
vector $s = `getAttr ($driven[$i]+".scale")`;
vector $t = `getAttr ($driven[$i]+".translate")`;

eval("global vector $" + $driven[$i] + "_joint_attrib[] = {vector("+$r+"),vector("+$s+"),vector("+$t+")}");

ashishdantu
07-04-2008, 03:09 AM
hi chayan,

from the docs - "A vector is a triple of floating point numbers" .. so i guess in mel the vector type variables can carry only floats as their elements. not vectors !

i tested it to confirm it like so

vector $test = << <<1,2,3>>, 7.7, 9.1>>;

and i get // Error: Line 1.27: Matrix element must be a scalar numeric type. //

maybe someone can correct me if i'm wrong here ! ?

stao
07-04-2008, 03:57 AM
HI,

What are you trying to do for

_joint_attrib[] = {vector("+$r+"),vector("+$s+"),vector("+$t+")}

?




Hi ,

following line of code is giving me Syntax error :
eval("global vector $" + $driven[$i] + "_joint_attrib[] = {vector("+$r+"),vector("+$s+"),vector("+$t+")}");

thanks
my complete code is :

vector $r = `getAttr ($driven[$i]+".rotate")`;
vector $s = `getAttr ($driven[$i]+".scale")`;
vector $t = `getAttr ($driven[$i]+".translate")`;

eval("global vector $" + $driven[$i] + "_joint_attrib[] = {vector("+$r+"),vector("+$s+"),vector("+$t+")}");

Aikiman
07-04-2008, 04:11 AM
shouldnt you terminate your global variable as well as the eval command?

CGTalk Moderation
07-04-2008, 04:11 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.