ClusterProperty elements for specified subdivision level

Discussions concerning programming of SOFTIMAGE©
Post Reply
User avatar
mslaf
Posts: 3
Joined: 02 Aug 2012, 10:28
Location: Poland
Contact:

ClusterProperty elements for specified subdivision level

Post by mslaf » 11 Jul 2013, 09:49

Hi,

How to access elements of the cluster properties like UVs, Vertex Colors for specified subdivision level?

So for eg. the code below returns a valid number of triangles (and other geometry subcomponents) but I don't know how to match them with cluster elements? Obviously the GetClusterProperty approach, doesn’t work here:\

Code: Select all

	// Get a polymesh Cube.
	X3DObject lX3DObject = Application().GetSelection().GetItem( 0 );
	PolygonMesh lPolygonMesh = lX3DObject.GetActivePrimitive().GetGeometry();
	CGeometryAccessor lGeometryAccessor = lPolygonMesh.GetGeometryAccessor( siConstructionModeDefault, siCatmullClark, 4 );

	// Returns 3072 (subdivision level 4)
	Application().LogMessage( CValue( lGeometryAccessor.GetTriangleCount() ).GetAsText() );

	CRefArray lTextureProjections = lGeometryAccessor.GetUVs();
	if ( lTextureProjections.GetCount() != 0 )
	{
		ClusterProperty lTextureProjection = lTextureProjections[ 0 ];
		CClusterPropertyElementArray lClusterPropertyElementArray = lTextureProjection.GetElements(); 
		CDoubleArray lTextureCoordinates = lClusterPropertyElementArray.GetArray();
		// Returns 24 (subdivision level 1)
		Application().LogMessage( CValue( lTextureCoordinates.GetCount() / lClusterPropertyElementArray.GetValueSize() ).GetAsText()  );
	}
 
First of all is it possible to access this information and if it is, then how to do it:)

m.

Post Reply

Who is online

Users browsing this forum: No registered users and 35 guests