brilliant!! thanks Stephen!

2013/2/15 Stephen Blair <stephenrbl...@gmail.com>

>  o = Selection(0)
>
>
> a = o.ActivePrimitive.Geometry.GetICEAttributeFromName("Materials")
>
> x = new VBArray( a.DataArray2D ).toArray()
> y = new VBArray( x[0] ).toArray()
> for ( var i = 0; i < y.length; i++ )
> {
>     LogMessage( y[i] )
>
> }
>
>
> On 15/02/2013 4:16 PM, Stephen Blair wrote:
>
> Here's the Python way:
>
> Application.SelectObj("Pedestrian_Mesh.Actor_Copies", None, None);
> o = Application.Selection(0)
>
> a = o.ActivePrimitive.Geometry.GetICEAttributeFromName("Materials")
> print len(a.DataArray2D)
> print len(a.DataArray2D[0] )
> print a.DataArray2D[0][0]
> for s in a.DataArray2D[0][0]:
>     print s
>
> # 1
> # 1
> # (u'', u'Sources.Materials.PedestrianLib.Shoes',
> u'Sources.Materials.PedestrianLib.Hair',
> u'Sources.Materials.PedestrianLib.Legs',
> u'Sources.Materials.PedestrianLib.Skin',
> u'Sources.Materials.PedestrianLib.Shirt')
> # Sources.Materials.PedestrianLib.Shoes
> # Sources.Materials.PedestrianLib.Hair
> # Sources.Materials.PedestrianLib.Legs
> # Sources.Materials.PedestrianLib.Skin
> # Sources.Materials.PedestrianLib.Shirt
>
>
>
> On 15/02/2013 3:48 PM, Fabricio Chamon wrote:
>
>  ...but how to access the string array (values) of this attribute?
>
>
> 2013/2/15 Stephen Blair <stephenrbl...@gmail.com>
>
>>  Hi
>>
>>
>>
>> It is a string.
>>
>> // Using one of the CrowdFX sample scenes:
>>
>> SelectObj("Pedestrian_Mesh.Actor_Copies", null, null);
>> o = Selection(0)
>>
>>
>> //o.ActivePrimitive.Geometry.GetICEAttributeFromName("Materials").DataArray.toArray()
>> // WARNING : 3391 - This ICEAttribute doesn't refer to a 1D array:
>> <Attribute: Materials>
>>
>> a = o.ActivePrimitive.Geometry.GetICEAttributeFromName("Materials")
>> LogMessage( a.DataType )
>> // INFO : 131072
>>
>> http://download.autodesk.com/global/docs/softimage2013/en_us/sdkguide/si_om/siICENodeDataType.html
>>
>>
>>
>> On 15/02/2013 3:08 PM, Fabricio Chamon wrote:
>>
>> thanks guys! I rebuilt the scene and started incremental saving
>> too...Really hard scenario to work on, I hope this will get fixed soon.
>>
>>  Another question: it seems really easy, but I can't get the ActorCopies
>> ICE materials array via script. I feel it should be a singleton(which it
>> is), 1D Array. This js code:
>>
>>
>> oActorCopies.ActivePrimitive.Geometry.GetICEAttributeFromName("Materials").DataArray.toArray()
>>
>>  returns:
>>
>>  This ICEAttribute doesn't refer to a 1D array: <Attribute: Materials>
>>
>>  and
>>
>>
>> oActorCopies.ActivePrimitive.Geometry.GetICEAttributeFromName("Materials").
>> *DataArray2D*.toArray()
>>
>>  returns
>>
>>  ERROR : Type mismatch
>>
>>  any clues ?
>>
>>
>>
>
>
>

Reply via email to