PDA

View Full Version : MGeometryManager component filtering


chadmv
07-14-2009, 02:02 AM
I'm writing a custom viewport and I'm trying to render a mesh that has multiple shader assignments. I get the MGeometry with

MFnSingleIndexedComponent components;
MObject comp = components.create( MFn::kMeshPolygonComponent )
components.addElements( m_faceMaterialIds[i] )
MGeometry geom = MGeometryManager::getGeometry( m_pathMesh, geomRequirements, &comp )
cerr << "verts = " << geom.position().elementCount() << endl;

m_faceMaterialIds only contains the faces of the desired shader and I've verified this. But no matter what I specify for the components, I always get the full mesh. Even when I do

MFnSingleIndexedComponent components;
MObject comp = components.create( MFn::kMeshPolygonComponent )
components.addElement( 10 )
MGeometry geom = MGeometryManager::getGeometry( m_pathMesh, geomRequirements, &comp )
cerr << "verts = " << geom.position().elementCount() << endl;

I still get the full mesh. Am I doing something wrong or is there a problem with this function?

Thanks,
Chad

CGTalk Moderation
07-14-2009, 02:02 AM
This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.