found the culprit... I was running this on a live alembic file...for some reason it does not work. As soon as I freeze the mesh then it works great.
2016-12-13 20:38 GMT-02:00 Fabricio Chamon <[email protected]>: > ...and here is the blog post where Stephen shows his code: > https://xsisupport.com/2013/03/25/aha-setting-dataarray2d-with-jscript/ > > btw I'm on soft 2015 SP2 > > 2016-12-13 20:34 GMT-02:00 Fabricio Chamon <[email protected]>: > >> Hey, >> >> lots of questions these days, sorry. >> >> So I'm searching all day through the list and internet to find a solution >> for this... I'm trying to set per polygon ice attribute values on a mesh >> via sdk (javascript). >> The subject was already discussed, Stephen Blair have some studies on it, >> one solution was given but in the end I'm still not able to get it working. >> >> So here's roughly my code: >> >> var ICEAttr = highResGeo.AddICEAttribute("rbdId", siICENodeDataLong, >> siICENodeStructureSingle, siICENodeContextComponent2D ); >> var myDataArray = new Array(); >> var faces = highResGeo.Facets; >> for (i=0;i<faces.count;i++){ >> var face = faces(i); >> myDataArray[i] = parseInt(x); //does not matter, assume any value for x >> } >> >> //now here's the tricky part >> >> da1 = getSafeArray(myDataArray); >> da2 = getSafeArray([myDataArray]); >> ICEAttr.DataArray = da2; >> >> >> //helper function >> function getSafeArray(jsArr) { >> var dict = new ActiveXObject("Scripting.Dictionary"); >> for (var i = 0; i < jsArr.length; i++) >> dict.add(i, jsArr[i]); >> return dict.Items(); >> } >> >> >> >> >> This SafeArray stuff is the solution proposed by Stephen on his >> blog...but gives me : >> >> *WARNING : 3392 - Invalid offset specified while extracting data from >> this attribute: <Attribute: rbdId>* >> *// <Offset: -1>* >> >> Any hints on what I'm doing wrong ?? >> >> Thanks! >> >> >> >
------ Softimage Mailing List. To unsubscribe, send a mail to [email protected] with "unsubscribe" in the subject, and reply to confirm.

