AlembicCurvesWriter.kl

Types

AlembicCurvesWriter (object)

The AlembicCurvesWriter specializes the AlembicObjectWriter interface for writing AlembicOCurves data. It can be created using the AlembicArchiveWriter.addCurves methods.

/*
** Example: AlembicCurvesWriter
*/

require AlembicWrapper;
require FileIO;

operator entry() {
  
  FilePath path = FilePath('${TEMP}/curves.abc').expandEnvVars();

  AlembicArchiveWriter archive(path.string());
  AlembicXformWriter xfo = archive.addXform('/xfo', Alembic_kConstantTimeSampling);
  AlembicCurvesWriter curves = archive.addCurves('/xfo/curves', Alembic_kConstantTimeSampling);

  xfo.writeSample(Mat44());

  Lines lines = Lines();
  lines.addPoints( 6 );

  lines.setPosition( 0, Vec3(1,0,0) );
  lines.setPosition( 1, Vec3(-1,0,0) );
  lines.addSegment( 0, 1 );

  lines.setPosition( 2, Vec3(0,1,0) );
  lines.setPosition( 3, Vec3(0,-1,0) );
  lines.addSegment( 2, 3 );

  lines.setPosition( 4, Vec3(0,0,1) );
  lines.setPosition( 5, Vec3(0,0,-1) );
  lines.addSegment( 4, 5 );

  curves.writeSample(lines);

  archive.reset();

  report(path.exists());
  report('Alembic file created: '+path.string());
}

/*
** Output:

true
Alembic file created: R:\Temp/curves.abc

*/

Methods

  AlembicCurvesWriter ( in AlembicCurvesWriter other )
  AlembicCurvesWriter ()
  addParamWriter ! ( in GeometryAttribute attribute, in AlembicGeometryScope scope, in SInt32 timeSampling )
AlembicCurvesWriter clone ? ()
Ref<AlembicGeometryAttributesWriter> getGeometryAttributesWriter ? ()
AlembicOObject getOObject ? ()
String getPath ? ()
  reset ! ()
Boolean valid ? ()
Boolean writeSample ! ( in Ref<Curves> geom )
Boolean writeSample ! ( in Ref<Lines> lines )