AlembicCameraReader.kl

Types

AlembicCameraReader (object)

The AlembicCameraReader specializes the AlembicObjectReader interface for reading AlembicICamera data. It can be created using the AlembicArchiveReader.getCamera method.

/*
** Example: AlembicCameraReader
*/

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 cameraPaths[] = archive.getPathsOfType('Camera');

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

    AlembicCameraReader camera = archive.getCamera(cameraPaths[i]);
    report('samples: '+camera.getNumSamples());

    camera.readSample(2.4);
    report('focalLength: '+camera.getFocalLength());
    report('nearClippingPlane: '+camera.getNearClippingPlane());
    report('farClippingPlane: '+camera.getFarClippingPlane());
    
  }

}

/*
** Output:

samples: 1
focalLength: +8.70334680003044
nearClippingPlane: +1.0e-1
farClippingPlane: +32768.0

*/