Naah, arrays with multiple dimensions are ugly, because you need
multiple for-cycles to do the very same thing you can do like this with
a single cycle... I actually find it pretty elegant! :)
-André
Bernard Lebel wrote:
Ish, that is ugly :-)
Thanks!
Bernard
On 3/22/07, André Adam <a_adam(at)49games.de> wrote:
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