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() );
}
m.