All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
GusdRefiner Class Reference

Class used to refine GT prims so that they can be written to a USD file. More...

#include <refiner.h>

+ Inheritance diagram for GusdRefiner:


struct  GprimArrayEntry

Public Types

using GprimArray = std::vector< GprimArrayEntry >

Public Member Functions

 GusdRefiner (GusdRefinerCollector &collector, const SdfPath &pathPrefix, const std::string &pathAttrName, const UT_Matrix4D &localToWorldXform)
virtual ~GusdRefiner ()
virtual bool allowThreading () const override
 Return true if the refinement allows threaded refinement of primitives. More...
virtual void addPrimitive (const GT_PrimitiveHandle &gtPrim) override
void refineDetail (const GU_ConstDetailHandle &detail, const GT_RefineParms &parms)
const GprimArrayfinish ()
- Public Member Functions inherited from GT_Refine
 GT_Refine ()
 Default constructor. More...
virtual ~GT_Refine ()
 Destructor. More...
template<typename Range , typename Body >
void refineRange (const Range &range, const Body &body)

Public Attributes

bool m_refinePackedPrims
bool m_useUSDIntrinsicNames
bool m_forceGroupTopPackedPrim
bool m_buildPointInstancer
bool m_buildPrototypes
TfToken m_pointInstancerType
GusdWriteCtrlFlags m_writeCtrlFlags

Additional Inherited Members

- Static Public Member Functions inherited from GT_Refine
static voidoperator new (size_t size)
static voidoperator new (size_t size, void *p)
static void operator delete (void *p, size_t size)

Detailed Description

Class used to refine GT prims so that they can be written to a USD file.

When we write a USD file, we create a GT_GEODetail prim from the current detail, then refine it using a GusdRefiner.

The basic idea is that the refiner looks at each prim, if it is a type that can be written to USD it adds it to the "gprim array", if not it continues to refine it.

The refiner supports namespace hierarchy. Some prims types are added to the the gprim array and then add thier children as well. Packed prims do this. The packed prim becomes a group node in USD. A PackedF3DGroup is similar.

The refiner calculates the primPath (location in the USD file). This can come from an attribute on the prim being refined or it can be computed. The computed path is based on a prefix provided by the client, a prim name and possibly a hierarchy pf group names supplied by packed prims.

The gprim array can contain prims from several OBJ nodes. The obj nodes provide a coordinate space and a set of options. We stash this stuff with the prims in the prim array.

Definition at line 67 of file refiner.h.

Member Typedef Documentation

Definition at line 94 of file refiner.h.

Constructor & Destructor Documentation

GusdRefiner::GusdRefiner ( GusdRefinerCollector collector,
const SdfPath pathPrefix,
const std::string pathAttrName,
const UT_Matrix4D localToWorldXform 

Construct a refiner for refining the prims in a detail. Typically the ROP constructs a refiner for its cooked detail, and then as we process GT prims, if a GEO Packed Prim is encountered, We create a new refiner and recurse. We need to keep track of the transform as we recurse through packed prims. Note that we only write packed prims that have been tagged with a prim path. We kee track of the transform of the last group we wrote in parentToWorldXform localToWorldXform is initialized to the OBJ Node's transform by the ROP.

virtual GusdRefiner::~GusdRefiner ( )

Definition at line 112 of file refiner.h.

Member Function Documentation

virtual void GusdRefiner::addPrimitive ( const GT_PrimitiveHandle prim)

This method is called for all primitives generated during the refinement process.

Implements GT_Refine.

virtual bool GusdRefiner::allowThreading ( ) const

Return true if the refinement allows threaded refinement of primitives.

Reimplemented from GT_Refine.

Definition at line 114 of file refiner.h.

const GprimArray& GusdRefiner::finish ( )
void GusdRefiner::refineDetail ( const GU_ConstDetailHandle detail,
const GT_RefineParms parms 

Member Data Documentation

bool GusdRefiner::m_buildPointInstancer

Definition at line 143 of file refiner.h.

bool GusdRefiner::m_buildPrototypes

Definition at line 148 of file refiner.h.

bool GusdRefiner::m_forceGroupTopPackedPrim

Definition at line 139 of file refiner.h.

TfToken GusdRefiner::m_pointInstancerType

Definition at line 153 of file refiner.h.

bool GusdRefiner::m_refinePackedPrims

Definition at line 129 of file refiner.h.

bool GusdRefiner::m_useUSDIntrinsicNames

Definition at line 133 of file refiner.h.

GusdWriteCtrlFlags GusdRefiner::m_writeCtrlFlags

Definition at line 155 of file refiner.h.

The documentation for this class was generated from the following file: