i am trying to get duck typing behavior in vex where I can scale a space seperated user selection of point attrs regardless of type
this wrangle code is working but it relies on predefined variables and would need extending for matrices and arrays ect
anybody have a nicer solution?
cheers in advance
string attrs[] = split( chs("attrs") ); string pattrs[] = detailintrinsic(geoself(), "pointattributes"); string a; string pa; int type = 0; int typesize; int tmpi = 0; float tmpf = 0.0; vector tmpv = {0,0,0}; foreach(a; attrs) { foreach(pa; pattrs) { if( pa == a ) { type = pointattribtype( geoself(), a ); typesize = pointattribsize( geoself(), a ); if (type == 0) { tmpi = point( geoself(), a, @ptnum ); setpointattrib( geoself(), a, @ptnum, tmpi * ch("scale"), "set"); } if (type == 1) { if (typesize == 3) { tmpv = point( geoself(), a, @ptnum ); setpointattrib( geoself(), a, @ptnum, tmpv * ch("scale"), "set"); } else { tmpf = point( geoself(), a, @ptnum ); setpointattrib( geoself(), a, @ptnum, tmpf * ch("scale"), "set"); } } } } }