24 #ifndef _GUSD_GU_USD_H_
25 #define _GUSD_GU_USD_H_
52 #define GUSD_PATH_ATTR "usdpath"
53 #define GUSD_PRIMPATH_ATTR "usdprimpath"
54 #define GUSD_FRAME_ATTR "frame"
55 #define GUSD_VARIANTS_ATTR "usdvariants"
56 #define GUSD_CONSTRAINT_ATTR "usdconstraint"
57 #define GUSD_PURPOSE_ATTR "usdpurpose"
58 #define GUSD_ACTIVE_ATTR "usdactive"
59 #define GUSD_VISIBLE_ATTR "usdvisible"
61 #define GUSD_OVERTRANSFORMS_ATTR "usdovertransforms"
62 #define GUSD_OVERPOINTS_ATTR "usdoverpoints"
63 #define GUSD_OVERPRIMVARS_ATTR "usdoverprimvars"
64 #define GUSD_OVERALL_ATTR "usdoverall"
66 #define GUSD_WRITESTATICTOPOLOGY_ATTR "usdwritestatictopology"
67 #define GUSD_WRITESTATICPRIMVARS_ATTR "usdwritestaticprimvars"
68 #define GUSD_WRITESTATICGEO_ATTR "usdwritestaticgeo"
73 #define GUSD_REFINE_ADDPATHATTRIB "usd:addPathAttribute"
74 #define GUSD_REFINE_PATHATTRIB "usd:pathAttribute"
75 #define GUSD_REFINE_ADDPRIMPATHATTRIB "usd:addPrimPathAttribute"
76 #define GUSD_REFINE_PRIMPATHATTRIB "usd:primPathAttribute"
77 #define GUSD_REFINE_ADDINSTANCELEVELATTRIB "usd:addInstanceLevelAttrib"_UTsh
78 #define GUSD_REFINE_INSTANCELEVELATTRIB "usd:instanceLevelAttrib"_UTsh
79 #define GUSD_REFINE_ADDMATERIALPATHATTRIB "usd:addMaterialPathAttribute"
80 #define GUSD_REFINE_ADDVISIBILITYATTRIB "usd:addVisibilityAttribute"
81 #define GUSD_REFINE_IMPORTCOMPUTEDVISIBILITY "usd:importComputedVisibility"
82 #define GUSD_REFINE_ADDXFORMATTRIB "usd:addXformAttribute"
83 #define GUSD_REFINE_NONTRANSFORMINGPATTERN "usd:nonTransformingPrimvarPattern"
84 #define GUSD_REFINE_PRIMVARPATTERN "usd:primvarPattern"
85 #define GUSD_REFINE_IMPORTINHERITEDPRIMVARS "usd:importInheritedPrimvars"
86 #define GUSD_REFINE_ATTRIBUTEPATTERN "usd:attributePattern"
87 #define GUSD_REFINE_RELATIONSHIPPATTERN "usd:relationshipPattern"_UTsh
88 #define GUSD_REFINE_TRANSLATESTTOUV "usd:translateSTtoUV"
89 #define GUSD_REFINE_ITERATIONS "usd:iterations"_UTsh
90 #define GUSD_REFINE_UNPACKTOPOLYGONS "usd:unpacktopolygons"_UTsh
91 #define GUSD_REFINE_PIVOTLOCATION "usd:pivotlocation"_UTsh
99 static bool OffsetArrayFromRange(
const GA_Range&
r,
103 static bool ComputeRangeIndexMap(
const GA_Range& r,
138 static bool GetTimeCodesFromAttr(
const GA_Range& rng,
142 static bool GetTimeCodesFromPackedPrims(
const GA_Range& rng,
148 static bool GetPrimPathsFromStringAttr(
const GA_Attribute& attr,
152 static bool GetPrimPathsFromStringAttr(
const GA_Attribute& attr,
161 static bool GetTokensFromStringAttr(
const GA_Attribute& attr,
163 const char* nameSpace=
nullptr);
165 static bool GetTokensFromStringAttr(
const GA_Attribute& attr,
168 const char* nameSpace=
nullptr);
192 static void RegisterPackedPrimBuildFunc(
const TfToken& typeName,
193 PackedPrimBuildFunc
func );
197 static bool AppendPackedPrims(
208 static bool AppendPackedPrimsFromLopNode(
225 static GA_Offset AppendExpandedRefPoints(
234 static bool AppendExpandedPackedPrims(
242 bool unpackToPolygons,
245 bool translateSTtoUV,
249 static bool AppendExpandedPackedPrimsFromLopNode(
256 bool unpackToPolygons,
258 bool importInheritedPrimvars,
260 bool translateSTtoUV,
273 static bool WriteVariantSelectionsToAttr(
281 static bool WriteVariantSelectionsToPackedPrims(
292 static GA_Offset AppendRefPointsForExpandedVariants(
301 static GA_Offset AppendPackedPrimsForExpandedVariants(
309 static bool GetPackedPrimStageIdsViewportLODsAndPurposes(
322 static bool ComputeTransformsFromAttrs(
const GA_Detail& gd,
327 static bool ComputeTransformsFromPackedPrims(
const GA_Detail& gd,
349 static bool SetTransformAttrs(
GU_Detail& gd,
352 OrientAttrRepresentation orientRep,
353 ScaleAttrRepresentation scaleRep,
356 static bool SetPackedPrimTransforms(
GU_Detail& gd,
360 static bool MultTransformableAttrs(
GU_Detail& gd,
364 bool keepLengths=
false,
368 static bool ImportPrimUnpacked(
GU_Detail& gd,
371 const char*
lod =
nullptr,
376 bool translateSTtoUV =
true,
Definition of a geometry attribute.
GT_API const UT_StringHolder time
#define PXR_NAMESPACE_OPEN_SCOPE
#define GUSD_PRIMPATH_ATTR
A range of elements in an index-map.
GLuint GLsizei const GLuint const GLintptr * offsets
GusdUSD_Traverse::PrimIndexPair PrimIndexPair
static const UT_StringHolder theEmptyString
Methods for USD scene traversal.
std::pair< UsdPrim, exint > PrimIndexPair
#define PXR_NAMESPACE_CLOSE_SCOPE
Container class for all geometry.
#define GUSD_VARIANTS_ATTR
GA_API const UT_StringHolder rest
GLint GLint GLint GLint GLint GLint GLint GLbitfield GLenum filter