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 softimage-requ...@listproc.autodesk.com with 
"unsubscribe" in the subject, and reply to confirm.

Reply via email to