vector array Error

Become a member of the CGSociety

Connect, Share, and Learn with our Large Growing CG Art Community. It's Free!

Thread Tools Search this Thread Display Modes
  01 January 2006
vector array Error

I tried this command ,then error occur in line2

vector $a[] = {<<0,0,0>>,<<5,0,0>>};
float $b = $a[0].x;

single vector work fine like this

vector $c = <<0,0,0>>;
float $d = $c.x;

is there some fault ?
  01 January 2006
I believe this is a mel limitation.
You cannot access $a[0].x directly, but have to pass trough another variable:

vector $a[] = {<<0,0,0>>,<<5,0,0>>};
vector $dummy = $a[0];
float $b = $dummy.x;

I'll try to look in the help to be sure there's no other way...

  01 January 2006
Ummm, yeah, there are a number of faults. Mainly, you can't declare vecotrs inside of array, and arrays inside of vectors. The two are seperate, if you need to make a multi-column, multi-row variable like that, just use a matrix instead.
  01 January 2006
Yeah, this particular mel limitation is a real bummer (;_;). I wrote my own matrix / vector plugin because Mel's types bothered me so much. I can't speak for expressions, since I've never used them, but most other Mel things that require a vector can also work with float arrays of size 3 (i.e. float [3]).

  01 January 2006
I'll try using both temporary nonarray vector and matrix as the situation demand.

Thank you for all replys!
  01 January 2006
Thread automatically closed

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.
CGTalk Policy/Legalities
Note that as CGTalk Members, you agree to the terms and conditions of using this website.
Thread Closed share thread

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Society of Digital Artists

Powered by vBulletin
Copyright 2000 - 2006,
Jelsoft Enterprises Ltd.
Minimize Ads
Forum Jump

All times are GMT. The time now is 11:08 AM.

Powered by vBulletin
Copyright ©2000 - 2018, Jelsoft Enterprises Ltd.