RE: setting ICEAttribute.DataArray in JScript

2013-03-25 Thread Matt Lind
todesk.com] On Behalf Of Ho Chung Nguyen Sent: Sunday, March 24, 2013 8:43 PM To: softimage@listproc.autodesk.com Subject: RE: setting ICEAttribute.DataArray in JScript - In Jscript, the array needs to be converted to safearray before you can set it on ICE attribute data. Check out the code bel

Re: setting ICEAttribute.DataArray in JScript

2013-03-25 Thread Eugen Sares
Ok, here's the complete JScript for creating MaterialIDs. A lot of hoops to jump through for something seemingly simple... For some obscure reason the viewport does not update with the shader colors. You have to render to see the result. Also, I don't know why string attribute "Materials" can onl

Re: setting ICEAttribute.DataArray in JScript

2013-03-25 Thread Eugen Sares
Doh... you have to "wrap" the string twice in a safe array and use DataArray2D... You thought of this at the dentist's? Normally pain's no good for the brain... Many thanks!! Am 25.03.2013 15:11, schrieb Stephen Blair: http://wp.me/powV4-2E1 On 25/03/2013 4:29 AM, Eugen Sares wrote: Thanks,

Re: setting ICEAttribute.DataArray in JScript

2013-03-25 Thread Stephen Blair
http://wp.me/powV4-2E1 On 25/03/2013 4:29 AM, Eugen Sares wrote: Thanks, Ho Chung! Writing to the MaterialID attribute works (array of integers), but not to Materials (array of strings). Workaround would be to create an ICE array via scripting, I got that working already, but still I wonder wh

Re: setting ICEAttribute.DataArray in JScript

2013-03-25 Thread Eugen Sares
Thanks, Ho Chung! Writing to the MaterialID attribute works (array of integers), but not to Materials (array of strings). Workaround would be to create an ICE array via scripting, I got that working already, but still I wonder why the problem is. Could you please check this code? NewScene("",

RE: setting ICEAttribute.DataArray in JScript

2013-03-24 Thread Ho Chung Nguyen
ataArray = safearr -Original Message- From: softimage-boun...@listproc.autodesk.com [mailto:softimage-boun...@listproc.autodesk.com] On Behalf Of Stephen Blair Sent: Tuesday, March 12, 2013 7:29 PM To: softimage@listproc.autodesk.com Subject: Re: setting ICEAttribute.DataArray in JScript

Re: setting ICEAttribute.DataArray in JScript

2013-03-12 Thread Stephen Blair
Last time I tried, I gave up on JScript (it seemed impossible) and got something to work in Python. si = Application from win32com.client import constants as C# win32com.client.constants oObj = si.Selection(0) oICEAttrMats = oObj.ActivePrimitive.AddICEAttribute("MyString", C.siIC

Re: setting ICEAttribute.DataArray in JScript

2013-03-12 Thread Eugen Sares
Ok... I'm trying this workaround: - Create custom ICEAttributes instead of the factory ones via scripting, with exactly the same type. - Create a simple ICE graph that reads from the custom attributes and writes to the factory attr via scripting. I've managed to write the "MaterialID" this way

Re: setting ICEAttribute.DataArray in JScript

2013-03-11 Thread Stephen Blair
I don't think it is possible. MaterialID becomes undefined/uninitialized pretty quick... http://screencast.com/t/HeNPz4qgwlh On 11/03/2013 12:25 PM, Eugen Sares wrote: Thanks, Steven! IsDefined is read-only, by the looks. So how do I write to it to define it (outside of ICE), when it cannot be

Re: setting ICEAttribute.DataArray in JScript

2013-03-11 Thread Eugen Sares
Thanks, Steven! IsDefined is read-only, by the looks. So how do I write to it to define it (outside of ICE), when it cannot be written until it's defined?? Am 11.03.2013 17:15, schrieb Stephen Blair: MaterialID isn't defined. Seems that you cannot set MaterialID.DataArray unless IsDefined is

Re: setting ICEAttribute.DataArray in JScript

2013-03-11 Thread Stephen Blair
MaterialID isn't defined. Seems that you cannot set MaterialID.DataArray unless IsDefined is True On 11/03/2013 11:44 AM, Eugen Sares wrote: Whereas this throws a warning: NewScene("", "false"); var oObj = CreatePrim("grid", "MeshSurface", "", ""); SetValue("grid.polymsh.geom.subdivu", 2, null

Re: setting ICEAttribute.DataArray in JScript

2013-03-11 Thread Eugen Sares
Sorry, got interrupted... ;q Thanks, Francis, that works (2013 SP1 )! What still gives me troubles is setting the MaterialID attribute (exists on every polymesh by default), which is what I actually need. I cannot write to it. Reading works, though. Could you guys please have a look? This wor

RE: setting ICEAttribute.DataArray in JScript

2012-10-23 Thread Francis Brissette
), XSIMath.CreateVector3( 0.0, 0.0, 1.0 ), XSIMath.CreateVector3( 0.0, 0.0, 0.0 ) ] -- Francis -Original Message- From: softimage-boun...@listproc.autodesk.com [mailto:softimage-boun...@listproc.autodesk.com] On Behalf Of Stefan Kubicek Sent: October 23, 2012 14:58 To: softi

Re: setting ICEAttribute.DataArray in JScript

2012-10-23 Thread Stefan Kubicek
day, October 23, 2012 10:40 AM To: softimage@listproc.autodesk.com Subject: setting ICEAttribute.DataArray in JScript Hi, short question: how do I set/write the ICEAttribute.DataArray from JScript? Can't find a code example. It is a safe array, that much I found out. attr.DataArray = [23,44

RE: setting ICEAttribute.DataArray in JScript

2012-10-23 Thread Matt Lind
] On Behalf Of Eugen Sares Sent: Tuesday, October 23, 2012 11:30 AM To: softimage@listproc.autodesk.com Subject: Re: setting ICEAttribute.DataArray in JScript Thanks, guys! The Python example I found myself, but that does not help in JScript. GridData must reside in a CustomProperty, right? I would

Re: setting ICEAttribute.DataArray in JScript

2012-10-23 Thread Eugen Sares
image-boun...@listproc.autodesk.com [mailto:softimage-boun...@listproc.autodesk.com] On Behalf Of Eugen Sares Sent: Tuesday, October 23, 2012 10:40 AM To: softimage@listproc.autodesk.com Subject: setting ICEAttribute.DataArray in JScript Hi, short question: how do I set/write the ICEAttribute.Data

Re: setting ICEAttribute.DataArray in JScript

2012-10-23 Thread Alan Fregtman
ge-boun...@listproc.autodesk.com [mailto: > softimage-boun...@listproc.autodesk.com] On Behalf Of Eugen Sares > Sent: Tuesday, October 23, 2012 10:40 AM > To: softimage@listproc.autodesk.com > Subject: setting ICEAttribute.DataArray in JScript > > Hi, short question: > how d

RE: setting ICEAttribute.DataArray in JScript

2012-10-23 Thread Matt Lind
bject before it will work. Matt -Original Message- From: softimage-boun...@listproc.autodesk.com [mailto:softimage-boun...@listproc.autodesk.com] On Behalf Of Eugen Sares Sent: Tuesday, October 23, 2012 10:40 AM To: softimage@listproc.autodesk.com Subject: setting ICEAttribute.DataArr

Re: setting ICEAttribute.DataArray in JScript

2012-10-23 Thread Sam Cuttriss
> > this is in the help somewhere, damned if i can find it again. its python, but will print info about the a selections attributes: hopefully that helps. from win32com.client import constants xsi = Application #xsi.CreatePrim("Cone", "MeshSurface", "", "") attrs = xsi.Selection(0).ActivePrimiti

setting ICEAttribute.DataArray in JScript

2012-10-23 Thread Eugen Sares
Hi, short question: how do I set/write the ICEAttribute.DataArray from JScript? Can't find a code example. It is a safe array, that much I found out. attr.DataArray = [23,44,50]; is not working. // WARNING : 3392 - Invalid offset specified while extracting data from this attribute... Thanks,