Re: How do people deal with "Elements"-like arrays in JScript?

Date : Thu, 22 Mar 2007 15:32:19 +0100
To : XSI(at)Softimage.COM
From : André Adam <a_adam(at)49games.de>
Subject : Re: How do people deal with "Elements"-like arrays in JScript?
Flattening the array is completely ok; that would look like this:

   var aVCArray = new VBArray(oVCProp.Elements.Array).toArray();
   for(i=0; i<aVC.length; i+=4){
     aVC[i] = oRed;
     aVC[i+1] = oGreen;
     aVC[i+2] = oBlue;
     aVC[i+3] = oAlpha;
   }

Hope that helps, cheers!

   -André


Bernard Lebel wrote:
A topic as old as time itself. Since I was already a Python user when
I started to deal with arrays in XSI I never had to worry about
JScript/XSI shortcomings in this area.

But now I have to use JScript.


So if you get the Elements property of an object, as in ClusterProperty.Elements, how do you keep separate the sub-arrays? (ie, avoid using VBArray which flattens everything)

Let say I have a vertexcolor cluster property, and I want to loop over
all four Elements sub-arrays at the same time, how can I do that?

Any pointer welcome.


Thanks
Bernard

--- Unsubscribe? Mail Majordomo(at)Softimage.COM with the following text in body: unsubscribe xsi


Search the XSI List archives here or use the advanced search form to search across mailing lists. Searching help is available.
This site supposedly brought to you by Benjamin Grosser and the Imaging Technology Group.