AlembicPolyMeshReader.kl

Types

AlembicPolyMeshReader (object)

The AlembicPolyMeshReader specializes the AlembicObjectReader interface for reading AlembicIPolyMesh data. It can be created using the AlembicArchiveReader.getPolyMesh method.

/*
** Example: AlembicPolyMeshReader
*/

require AlembicWrapper;
require FileIO;

operator entry() {
  
  FilePath path = FilePath('${FABRIC_SCENE_GRAPH_DIR}/Python/Apps/Resources/Alembic/frog.abc').expandEnvVars();

  AlembicArchiveReader archive(path.string());
  String polyMeshPaths[] = archive.getPathsOfType('PolyMesh');

  for(Size i=0;i<polyMeshPaths.size();i++) {

    AlembicPolyMeshReader polyMesh = archive.getPolyMesh(polyMeshPaths[i]);
    report('samples: '+polyMesh.getNumSamples());

    PolygonMesh mesh = PolygonMesh();
    polyMesh.readSample(2.4, mesh);

    report(mesh.pointCount());
    report(mesh.polygonCount());
  }

}

/*
** Output:

samples: 50
6174
12294

*/