HDK
|
Class used to refine GT prims so that they can be written to a USD file. More...
#include <refiner.h>
Classes | |
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) | |
~GusdRefiner () override | |
bool | allowThreading () const override |
Return true if the refinement allows threaded refinement of primitives. More... | |
void | addPrimitive (const GT_PrimitiveHandle >Prim) override |
void | refineDetail (const GU_ConstDetailHandle &detail, const GT_RefineParms &parms) |
const GprimArray & | finish () |
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 void * | operator new (size_t size) |
static void * | operator new (size_t size, void *p) |
static void | operator delete (void *p, size_t size) |
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.
using GusdRefiner::GprimArray = std::vector<GprimArrayEntry> |
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.
|
overridevirtual |
This method is called for all primitives generated during the refinement process.
Implements GT_Refine.
|
inlineoverridevirtual |
const GprimArray& GusdRefiner::finish | ( | ) |
void GusdRefiner::refineDetail | ( | const GU_ConstDetailHandle & | detail, |
const GT_RefineParms & | parms | ||
) |
GusdWriteCtrlFlags GusdRefiner::m_writeCtrlFlags |