Call for Submission
NAB 2012 Best of the Best Show Reel
Submit your work today!
  • 1/3
You are here: Forum Home / Autodesk® Softimage® / XSI SDK / Access ICE Attribute Values
  RSS 2.0 ATOM  

Access ICE Attribute Values
Rate this thread
 
35989
 
Permlink of this thread   Subscribe to this thread
avatar
  • Total Posts: 7
  • Joined: 18 December 2008 09:35 AM

Hi all,

Sorry for a newbie question. Is there any way to access the value of the ICE Attributes of a point cloud (May be a simulated ICE tree)? I want to access them from a script.

For example I want to access the point position attribute data for each point of a ICE Tree.

Is there any way?

Thanks

Satyajit



Replies: 0
avatar

Use the PointCloudGeometry object ? (see the SDK docs)



Replies: 0
avatar

Thanks a lot Stephen,

I’ve successfully accessed the point positions via pointsarray, but that’s it. It’s not an ICE attribute. It’s like vertex positions of a poly object.

I’m still not able to get the ICE attributes, namely position, orientation, shapes, scale etc.

Can you please elaborate a little how to get those data?

Satyajit



Replies: 0
avatar

gDebug 1;

var 
pc Dictionary.GetObject( "PointCloud" )
var pc.ActivePrimitive.Geometry;
if( gDebug ) LogMessage( classname(g) )

var g.GetICEAttributeFromName( "NbPoints" )
var = new VBArray( x.DataArray ).toArray()
if( gDebug ) LogMessage( a
.length )
if( gDebug ) LogMessage( a[0] )


var oIceAttrib g.GetICEAttributeFromName( "Shape" )
if( gDebug ) LogMessage( oIceAttrib
.DataType ) // 32768 = siICENodeDataShape

var = new VBArray( oIceAttrib.DataArray ).toArray()
if( gDebug ) LogMessage( a
.length ) // 1 element for each point in pointcloud
if( gDebug ) LogMessage( a[0].Type ) // 4 = Shape

if ( a[0].Type == siICEShapeSphere ) LogMessage( "Sphere" )


Replies: 2
/img/forum/dark/default_avatar.png

I am trying to query a user attribute… but so far it always returns an empty ICEAttributes collection.

I have a pretty simple setup just for test. I emit particles, in the ice tree I do a getData of self.position pipe this in my self.myUserData attribute.

When I query my data using the same trick:
var x = g.GetICEAttributeFromName( “myUserData” )

I get an empty list… yet I pipe the pointPosition in this data, I would get the same value as the pointPosition.

Do you guys know if this is a limitation of the SDK or a bug?  I am on xsi 7.01

Thanks

P.S.: This is just a proof of concept… I know that there is no point in copying the pointPosition value in a user attribute to query it :)

Author: Sylvain Berger

Replied: 12 November 2009 07:14 AM  
/userdata/avatar/efhfqre47_sblair3.jpg

Try DataArray2D

Author: StephenBlair

Replied: 12 November 2009 09:41 AM  
avatar

Oh! Wow! Thanks a TON Stephen. This clears a lot of doubts. Time to dig in it.

Dig result1: Got to learn to use VBArray. JScript Array doesn’t work!

Thanks again, man!



Replies: 0
avatar
  • bkeane
  • Posted: 02 September 2010 02:39 PM

Sweet! Thanks, Stephen-- this saved my bacon!



Replies: 0




   
  Settings Choose Theme color: