core#
Fully qualified name: usdex::core
-
namespace core#
usdex::core provides higher-level convenience functions on top of lower-level OpenUSD concepts, so developers can quickly adopt OpenUSD best practices when mapping their native data sources to OpenUSD-legible data models.
Classes#
- JointFrame
Specifies a position and rotation in the coordinate system specified by
space
- NameCache
The
NameCache
class provides a mechanism for generating unique and valid names forUsdPrims
and theirUsdProperties
.- PrimvarData
A templated read-only class to manage the components of
UsdGeomPrimvar
data as a single object without risk of detaching (copying) arrays.- ValidChildNameCache
A caching mechanism for valid and unique child prim names.
Enumerations#
- ColorSpace
Texture color space (encoding) types.
- DiagnosticsLevel
Controls the diagnostics that will be emitted when the
Delegate
is active.- DiagnosticsOutputStream
Control the output stream to which diagnostics are logged.
- RotationOrder
Enumerates the rotation order of the 3-angle Euler rotation.
Functions#
- void activateDiagnosticsDelegate()
Activates the
Delegate
to specializeTfDiagnostics
handling.- pxr::UsdStageRefPtr addAssetContent(pxr::UsdStagePtr stage, const std::string &name, const std::string &format="usda", const pxr::SdfLayer::FileFormatArguments &fileFormatArgs=pxr::SdfLayer::FileFormatArguments(), bool prependLayer=true, bool createScope=true)
Create a specific Content Layer and add it as a sublayer to the stage's edit target.
- bool addAssetInterface(pxr::UsdStagePtr stage, const pxr::UsdStagePtr source)
Add an Asset Interface to a stage, which payloads a source stage's contents.
- pxr::UsdStageRefPtr addAssetLibrary(pxr::UsdStagePtr stage, const std::string &name, const std::string &format="usdc", const pxr::SdfLayer::FileFormatArguments &fileFormatArgs=pxr::SdfLayer::FileFormatArguments())
Create a Library Layer from which the Content Layers can reference prims.
- bool addDiffuseTextureToPreviewMaterial(pxr::UsdShadeMaterial &material, const pxr::SdfAssetPath &texturePath)
Adds a diffuse texture to a preview material.
- bool addMetallicTextureToPreviewMaterial(pxr::UsdShadeMaterial &material, const pxr::SdfAssetPath &texturePath)
Adds a single channel metallic texture to a preview material.
- bool addNormalTextureToPreviewMaterial(pxr::UsdShadeMaterial &material, const pxr::SdfAssetPath &texturePath)
Adds a normals texture to a preview material.
- bool addOpacityTextureToPreviewMaterial(pxr::UsdShadeMaterial &material, const pxr::SdfAssetPath &texturePath)
Adds a single channel opacity texture to a preview material.
- bool addOrmTextureToPreviewMaterial(pxr::UsdShadeMaterial &material, const pxr::SdfAssetPath &texturePath)
Adds an ORM (occlusion, roughness, metallic) texture to a preview material.
- bool addPhysicsToMaterial(pxr::UsdShadeMaterial &material, const float dynamicFriction, const std::optional< float > staticFriction=std::nullopt, const std::optional< float > restitution=std::nullopt, const std::optional< float > density=std::nullopt)
Adds physical material parameters to an existing Material.
- bool addPreviewMaterialInterface(pxr::UsdShadeMaterial &material)
Adds
UsdShadeInputs
to the material prim to create an "interface" to the underlying Preview Shader network.- bool addRoughnessTextureToPreviewMaterial(pxr::UsdShadeMaterial &material, const pxr::SdfAssetPath &texturePath)
Adds a single channel roughness texture to a preview material.
- void alignPhysicsJoint(pxr::UsdPhysicsJoint joint, const JointFrame &frame, const pxr::GfVec3f &axis=pxr::GfVec3f(1.0f, 0.0f, 0.0f))
Aligns an existing joint with the specified position, rotation, and axis.
- bool bindMaterial(pxr::UsdPrim prim, const pxr::UsdShadeMaterial &material)
Authors a direct binding to the given material on this prim.
- bool bindPhysicsMaterial(pxr::UsdPrim prim, const pxr::UsdShadeMaterial &material)
Binds a physics material to a given rigid body or collision geometry.
- bool blockDisplayName(pxr::UsdPrim prim)
Block this prim's display name (metadata)
- const char * buildVersion()
Verify the expected usdex modules are being loaded at runtime.
- bool clearDisplayName(pxr::UsdPrim prim)
Clears this prim's display name (metadata) in the current EditTarget (only)
- std::string computeEffectiveDisplayName(const pxr::UsdPrim &prim)
Calculate the effective display name of this prim.
- pxr::UsdShadeShader computeEffectivePreviewSurfaceShader(const pxr::UsdShadeMaterial &material)
Get the effective surface Shader of a Material for the universal render context.
- bool configureStage(pxr::UsdStagePtr stage, const std::string &defaultPrimName, const pxr::TfToken &upAxis, const double linearUnits, const double massUnits, std::optional< std::string_view > authoringMetadata=std::nullopt)
Configure a stage so that the defining metadata is explicitly authored.
- bool configureStage(pxr::UsdStagePtr stage, const std::string &defaultPrimName, const pxr::TfToken &upAxis, const double linearUnits, std::optional< std::string_view > authoringMetadata=std::nullopt)
Configure a stage so that the defining metadata is explicitly authored.
- pxr::UsdStageRefPtr createAssetPayload(pxr::UsdStagePtr stage, const std::string &format="usda", const pxr::SdfLayer::FileFormatArguments &fileFormatArgs=pxr::SdfLayer::FileFormatArguments())
Create a relative layer within a
getPayloadToken()
subdirectory to hold the content of an asset.- pxr::UsdShadeMaterial createMaterial(pxr::UsdPrim parent, const std::string &name)
Create a
UsdShadeMaterial
as a child of the Prim parent.- pxr::UsdStageRefPtr createStage(const std::string &identifier, const std::string &defaultPrimName, const pxr::TfToken &upAxis, const double linearUnits, const double massUnits, const std::string &authoringMetadata, const pxr::SdfLayer::FileFormatArguments &fileFormatArgs=pxr::SdfLayer::FileFormatArguments())
Create and configure a
UsdStage
so that the defining metadata is explicitly authored.- pxr::UsdStageRefPtr createStage(const std::string &identifier, const std::string &defaultPrimName, const pxr::TfToken &upAxis, const double linearUnits, const std::string &authoringMetadata, const pxr::SdfLayer::FileFormatArguments &fileFormatArgs=pxr::SdfLayer::FileFormatArguments())
Create and configure a
UsdStage
so that the defining metadata is explicitly authored.- void deactivateDiagnosticsDelegate()
Deactivates the
Delegate
to restore defaultTfDiagnostics
handling.- pxr::UsdGeomCamera defineCamera(pxr::UsdPrim prim, const pxr::GfCamera &cameraData)
Defines a basic 3d camera from an existing prim.
- pxr::UsdGeomCamera defineCamera(pxr::UsdPrim parent, const std::string &name, const pxr::GfCamera &cameraData)
Defines a basic 3d camera on the stage.
- pxr::UsdGeomCamera defineCamera(pxr::UsdStagePtr stage, const pxr::SdfPath &path, const pxr::GfCamera &cameraData)
Defines a basic 3d camera on the stage.
- pxr::UsdGeomBasisCurves defineCubicBasisCurves(pxr::UsdPrim prim, const pxr::VtIntArray &curveVertexCounts, const pxr::VtVec3fArray &points, const pxr::TfToken &basis=pxr::UsdGeomTokens->bezier, const pxr::TfToken &wrap=pxr::UsdGeomTokens->nonperiodic, std::optional< const FloatPrimvarData > widths=std::nullopt, std::optional< const Vec3fPrimvarData > normals=std::nullopt, std::optional< const Vec3fPrimvarData > displayColor=std::nullopt, std::optional< const FloatPrimvarData > displayOpacity=std::nullopt)
Defines a batched Cubic
UsdGeomBasisCurves
prim on the stage.- pxr::UsdGeomBasisCurves defineCubicBasisCurves(pxr::UsdStagePtr stage, const pxr::SdfPath &path, const pxr::VtIntArray &curveVertexCounts, const pxr::VtVec3fArray &points, const pxr::TfToken &basis=pxr::UsdGeomTokens->bezier, const pxr::TfToken &wrap=pxr::UsdGeomTokens->nonperiodic, std::optional< const FloatPrimvarData > widths=std::nullopt, std::optional< const Vec3fPrimvarData > normals=std::nullopt, std::optional< const Vec3fPrimvarData > displayColor=std::nullopt, std::optional< const FloatPrimvarData > displayOpacity=std::nullopt)
Defines a batched Cubic
UsdGeomBasisCurves
prim on the stage.- pxr::UsdGeomBasisCurves defineCubicBasisCurves(pxr::UsdPrim parent, const std::string &name, const pxr::VtIntArray &curveVertexCounts, const pxr::VtVec3fArray &points, const pxr::TfToken &basis=pxr::UsdGeomTokens->bezier, const pxr::TfToken &wrap=pxr::UsdGeomTokens->nonperiodic, std::optional< const FloatPrimvarData > widths=std::nullopt, std::optional< const Vec3fPrimvarData > normals=std::nullopt, std::optional< const Vec3fPrimvarData > displayColor=std::nullopt, std::optional< const FloatPrimvarData > displayOpacity=std::nullopt)
Defines a batched Cubic
UsdGeomBasisCurves
prim on the stage.- pxr::UsdLuxDomeLight defineDomeLight(pxr::UsdPrim parent, const std::string &name, float intensity=1.0f, std::optional< std::string_view > texturePath=std::nullopt, const pxr::TfToken &textureFormat=pxr::UsdLuxTokens->automatic)
Creates a dome light with an optional texture.
- pxr::UsdLuxDomeLight defineDomeLight(pxr::UsdStagePtr stage, const pxr::SdfPath &path, float intensity=1.0f, std::optional< std::string_view > texturePath=std::nullopt, const pxr::TfToken &textureFormat=pxr::UsdLuxTokens->automatic)
Creates a dome light with an optional texture.
- pxr::UsdLuxDomeLight defineDomeLight(pxr::UsdPrim prim, float intensity=1.0f, std::optional< std::string_view > texturePath=std::nullopt, const pxr::TfToken &textureFormat=pxr::UsdLuxTokens->automatic)
Creates a dome light with an optional texture.
- pxr::UsdGeomBasisCurves defineLinearBasisCurves(pxr::UsdStagePtr stage, const pxr::SdfPath &path, const pxr::VtIntArray &curveVertexCounts, const pxr::VtVec3fArray &points, const pxr::TfToken &wrap=pxr::UsdGeomTokens->nonperiodic, std::optional< const FloatPrimvarData > widths=std::nullopt, std::optional< const Vec3fPrimvarData > normals=std::nullopt, std::optional< const Vec3fPrimvarData > displayColor=std::nullopt, std::optional< const FloatPrimvarData > displayOpacity=std::nullopt)
Defines a batched Linear
UsdGeomBasisCurves
prim on the stage.- pxr::UsdGeomBasisCurves defineLinearBasisCurves(pxr::UsdPrim prim, const pxr::VtIntArray &curveVertexCounts, const pxr::VtVec3fArray &points, const pxr::TfToken &wrap=pxr::UsdGeomTokens->nonperiodic, std::optional< const FloatPrimvarData > widths=std::nullopt, std::optional< const Vec3fPrimvarData > normals=std::nullopt, std::optional< const Vec3fPrimvarData > displayColor=std::nullopt, std::optional< const FloatPrimvarData > displayOpacity=std::nullopt)
Defines a batched Linear
UsdGeomBasisCurves
prim on the stage.- pxr::UsdGeomBasisCurves defineLinearBasisCurves(pxr::UsdPrim parent, const std::string &name, const pxr::VtIntArray &curveVertexCounts, const pxr::VtVec3fArray &points, const pxr::TfToken &wrap=pxr::UsdGeomTokens->nonperiodic, std::optional< const FloatPrimvarData > widths=std::nullopt, std::optional< const Vec3fPrimvarData > normals=std::nullopt, std::optional< const Vec3fPrimvarData > displayColor=std::nullopt, std::optional< const FloatPrimvarData > displayOpacity=std::nullopt)
Defines a batched Linear
UsdGeomBasisCurves
prim on the stage.- pxr::UsdPrim definePayload(pxr::UsdStagePtr stage, const pxr::SdfPath &path, const pxr::UsdPrim &source)
Define a payload to a prim.
- pxr::UsdPrim definePayload(pxr::UsdPrim parent, const pxr::UsdPrim &source, std::optional< std::string_view > name=std::nullopt)
Define a payload to a prim as a child of the
parent
prim.- pxr::UsdPhysicsFixedJoint definePhysicsFixedJoint(pxr::UsdPrim prim, const pxr::UsdPrim &body0, const pxr::UsdPrim &body1, const JointFrame &frame)
Creates a fixed joint connecting two rigid bodies.
- pxr::UsdPhysicsFixedJoint definePhysicsFixedJoint(pxr::UsdStagePtr stage, const pxr::SdfPath &path, const pxr::UsdPrim &body0, const pxr::UsdPrim &body1, const JointFrame &frame)
Creates a fixed joint connecting two rigid bodies.
- pxr::UsdPhysicsFixedJoint definePhysicsFixedJoint(pxr::UsdPrim parent, const std::string &name, const pxr::UsdPrim &body0, const pxr::UsdPrim &body1, const JointFrame &frame)
Creates a fixed joint connecting two rigid bodies.
- pxr::UsdShadeMaterial definePhysicsMaterial(pxr::UsdStagePtr stage, const pxr::SdfPath &path, const float dynamicFriction, const std::optional< float > staticFriction=std::nullopt, const std::optional< float > restitution=std::nullopt, const std::optional< float > density=std::nullopt)
Creates a Physics Material.
- pxr::UsdShadeMaterial definePhysicsMaterial(pxr::UsdPrim parent, const std::string &name, const float dynamicFriction, const std::optional< float > staticFriction=std::nullopt, const std::optional< float > restitution=std::nullopt, const std::optional< float > density=std::nullopt)
Creates a Physics Material.
- pxr::UsdShadeMaterial definePhysicsMaterial(pxr::UsdPrim prim, const float dynamicFriction, const std::optional< float > staticFriction=std::nullopt, const std::optional< float > restitution=std::nullopt, const std::optional< float > density=std::nullopt)
Creates a Physics Material.
- pxr::UsdPhysicsPrismaticJoint definePhysicsPrismaticJoint(pxr::UsdPrim parent, const std::string &name, const pxr::UsdPrim &body0, const pxr::UsdPrim &body1, const JointFrame &frame, const pxr::GfVec3f &axis=pxr::GfVec3f(1.0f, 0.0f, 0.0f), std::optional< float > lowerLimit=std::nullopt, std::optional< float > upperLimit=std::nullopt)
Creates a prismatic joint, which acts as a slider along a single axis, connecting two rigid bodies.
- pxr::UsdPhysicsPrismaticJoint definePhysicsPrismaticJoint(pxr::UsdPrim prim, const pxr::UsdPrim &body0, const pxr::UsdPrim &body1, const JointFrame &frame, const pxr::GfVec3f &axis=pxr::GfVec3f(1.0f, 0.0f, 0.0f), std::optional< float > lowerLimit=std::nullopt, std::optional< float > upperLimit=std::nullopt)
Creates a prismatic joint, which acts as a slider along a single axis, connecting two rigid bodies.
- pxr::UsdPhysicsPrismaticJoint definePhysicsPrismaticJoint(pxr::UsdStagePtr stage, const pxr::SdfPath &path, const pxr::UsdPrim &body0, const pxr::UsdPrim &body1, const JointFrame &frame, const pxr::GfVec3f &axis=pxr::GfVec3f(1.0f, 0.0f, 0.0f), std::optional< float > lowerLimit=std::nullopt, std::optional< float > upperLimit=std::nullopt)
Creates a prismatic joint, which acts as a slider along a single axis, connecting two rigid bodies.
- pxr::UsdPhysicsRevoluteJoint definePhysicsRevoluteJoint(pxr::UsdPrim parent, const std::string &name, const pxr::UsdPrim &body0, const pxr::UsdPrim &body1, const JointFrame &frame, const pxr::GfVec3f &axis=pxr::GfVec3f(1.0f, 0.0f, 0.0f), std::optional< float > lowerLimit=std::nullopt, std::optional< float > upperLimit=std::nullopt)
Creates a revolute joint, which acts as a hinge around a single axis, connecting two rigid bodies.
- pxr::UsdPhysicsRevoluteJoint definePhysicsRevoluteJoint(pxr::UsdStagePtr stage, const pxr::SdfPath &path, const pxr::UsdPrim &body0, const pxr::UsdPrim &body1, const JointFrame &frame, const pxr::GfVec3f &axis=pxr::GfVec3f(1.0f, 0.0f, 0.0f), std::optional< float > lowerLimit=std::nullopt, std::optional< float > upperLimit=std::nullopt)
Creates a revolute joint, which acts as a hinge around a single axis, connecting two rigid bodies.
- pxr::UsdPhysicsRevoluteJoint definePhysicsRevoluteJoint(pxr::UsdPrim prim, const pxr::UsdPrim &body0, const pxr::UsdPrim &body1, const JointFrame &frame, const pxr::GfVec3f &axis=pxr::GfVec3f(1.0f, 0.0f, 0.0f), std::optional< float > lowerLimit=std::nullopt, std::optional< float > upperLimit=std::nullopt)
Creates a revolute joint, which acts as a hinge around a single axis, connecting two rigid bodies.
- pxr::UsdPhysicsSphericalJoint definePhysicsSphericalJoint(pxr::UsdPrim prim, const pxr::UsdPrim &body0, const pxr::UsdPrim &body1, const JointFrame &frame, const pxr::GfVec3f &axis=pxr::GfVec3f(1.0f, 0.0f, 0.0f), std::optional< float > coneAngle0Limit=std::nullopt, std::optional< float > coneAngle1Limit=std::nullopt)
Creates a spherical joint, which acts as a ball and socket joint, connecting two rigid bodies.
- pxr::UsdPhysicsSphericalJoint definePhysicsSphericalJoint(pxr::UsdPrim parent, const std::string &name, const pxr::UsdPrim &body0, const pxr::UsdPrim &body1, const JointFrame &frame, const pxr::GfVec3f &axis=pxr::GfVec3f(1.0f, 0.0f, 0.0f), std::optional< float > coneAngle0Limit=std::nullopt, std::optional< float > coneAngle1Limit=std::nullopt)
Creates a spherical joint, which acts as a ball and socket joint, connecting two rigid bodies.
- pxr::UsdPhysicsSphericalJoint definePhysicsSphericalJoint(pxr::UsdStagePtr stage, const pxr::SdfPath &path, const pxr::UsdPrim &body0, const pxr::UsdPrim &body1, const JointFrame &frame, const pxr::GfVec3f &axis=pxr::GfVec3f(1.0f, 0.0f, 0.0f), std::optional< float > coneAngle0Limit=std::nullopt, std::optional< float > coneAngle1Limit=std::nullopt)
Creates a spherical joint, which acts as a ball and socket joint, connecting two rigid bodies.
- pxr::UsdGeomPoints definePointCloud(pxr::UsdStagePtr stage, const pxr::SdfPath &path, const pxr::VtVec3fArray &points, std::optional< const pxr::VtInt64Array > ids=std::nullopt, std::optional< const FloatPrimvarData > widths=std::nullopt, std::optional< const Vec3fPrimvarData > normals=std::nullopt, std::optional< const Vec3fPrimvarData > displayColor=std::nullopt, std::optional< const FloatPrimvarData > displayOpacity=std::nullopt)
Defines a
UsdGeomPoints
prim on the stage.- pxr::UsdGeomPoints definePointCloud(pxr::UsdPrim parent, const std::string &name, const pxr::VtVec3fArray &points, std::optional< const pxr::VtInt64Array > ids=std::nullopt, std::optional< const FloatPrimvarData > widths=std::nullopt, std::optional< const Vec3fPrimvarData > normals=std::nullopt, std::optional< const Vec3fPrimvarData > displayColor=std::nullopt, std::optional< const FloatPrimvarData > displayOpacity=std::nullopt)
Defines a
UsdGeomPoints
prim on the stage.- pxr::UsdGeomPoints definePointCloud(pxr::UsdPrim prim, const pxr::VtVec3fArray &points, std::optional< const FloatPrimvarData > widths=std::nullopt, std::optional< const Vec3fPrimvarData > normals=std::nullopt, std::optional< const Vec3fPrimvarData > displayColor=std::nullopt, std::optional< const FloatPrimvarData > displayOpacity=std::nullopt)
Defines a point cloud using the
UsdGeomPoints
schema.- pxr::UsdGeomMesh definePolyMesh(pxr::UsdPrim parent, const std::string &name, const pxr::VtIntArray &faceVertexCounts, const pxr::VtIntArray &faceVertexIndices, const pxr::VtVec3fArray &points, std::optional< const Vec3fPrimvarData > normals=std::nullopt, std::optional< const Vec2fPrimvarData > uvs=std::nullopt, std::optional< const Vec3fPrimvarData > displayColor=std::nullopt, std::optional< const FloatPrimvarData > displayOpacity=std::nullopt)
Defines a basic polygon mesh on the stage.
- pxr::UsdGeomMesh definePolyMesh(pxr::UsdPrim prim, const pxr::VtIntArray &faceVertexCounts, const pxr::VtIntArray &faceVertexIndices, const pxr::VtVec3fArray &points, std::optional< const Vec3fPrimvarData > normals=std::nullopt, std::optional< const Vec2fPrimvarData > uvs=std::nullopt, std::optional< const Vec3fPrimvarData > displayColor=std::nullopt, std::optional< const FloatPrimvarData > displayOpacity=std::nullopt)
Defines a basic polygon mesh from an existing prim.
- pxr::UsdGeomMesh definePolyMesh(pxr::UsdStagePtr stage, const pxr::SdfPath &path, const pxr::VtIntArray &faceVertexCounts, const pxr::VtIntArray &faceVertexIndices, const pxr::VtVec3fArray &points, std::optional< const Vec3fPrimvarData > normals=std::nullopt, std::optional< const Vec2fPrimvarData > uvs=std::nullopt, std::optional< const Vec3fPrimvarData > displayColor=std::nullopt, std::optional< const FloatPrimvarData > displayOpacity=std::nullopt)
Defines a basic polygon mesh on the stage.
- pxr::UsdShadeMaterial definePreviewMaterial(pxr::UsdPrim prim, const pxr::GfVec3f &color, const float opacity=1.0f, const float roughness=0.5f, const float metallic=0.0f)
Defines a PBR
UsdShadeMaterial
driven by aUsdPreviewSurface
shader network for the universal render context.- pxr::UsdShadeMaterial definePreviewMaterial(pxr::UsdPrim parent, const std::string &name, const pxr::GfVec3f &color, const float opacity=1.0f, const float roughness=0.5f, const float metallic=0.0f)
Defines a PBR
UsdShadeMaterial
driven by aUsdPreviewSurface
shader network for the universal render context.- pxr::UsdShadeMaterial definePreviewMaterial(pxr::UsdStagePtr stage, const pxr::SdfPath &path, const pxr::GfVec3f &color, const float opacity=1.0f, const float roughness=0.5f, const float metallic=0.0f)
Defines a PBR
UsdShadeMaterial
driven by aUsdPreviewSurface
shader network for the universal render context.- pxr::UsdLuxRectLight defineRectLight(pxr::UsdPrim prim, float width, float height, float intensity=1.0f, std::optional< std::string_view > texturePath=std::nullopt)
Creates a rectangular (rect) light with an optional texture.
- pxr::UsdLuxRectLight defineRectLight(pxr::UsdStagePtr stage, const pxr::SdfPath &path, float width, float height, float intensity=1.0f, std::optional< std::string_view > texturePath=std::nullopt)
Creates a rectangular (rect) light with an optional texture.
- pxr::UsdLuxRectLight defineRectLight(pxr::UsdPrim parent, const std::string &name, float width, float height, float intensity=1.0f, std::optional< std::string_view > texturePath=std::nullopt)
Creates a rectangular (rect) light with an optional texture.
- pxr::UsdPrim defineReference(pxr::UsdPrim parent, const pxr::UsdPrim &source, std::optional< std::string_view > name=std::nullopt)
Define a reference to a prim as a child of the
parent
prim.- pxr::UsdPrim defineReference(pxr::UsdStagePtr stage, const pxr::SdfPath &path, const pxr::UsdPrim &source)
Define a reference to a prim.
- pxr::UsdGeomScope defineScope(pxr::UsdPrim prim)
Defines a scope from an existing prim.
- pxr::UsdGeomScope defineScope(pxr::UsdStagePtr stage, const pxr::SdfPath &path)
Defines a scope on the stage.
- pxr::UsdGeomScope defineScope(pxr::UsdPrim parent, const std::string &name)
Defines a scope on the stage.
- pxr::UsdGeomXform defineXform(pxr::UsdStagePtr stage, const pxr::SdfPath &path, std::optional< const pxr::GfTransform > transform=std::nullopt)
Defines an xform on the stage.
- pxr::UsdGeomXform defineXform(pxr::UsdPrim prim, std::optional< const pxr::GfTransform > transform=std::nullopt)
Defines a basic xform from an existing prim.
- pxr::UsdGeomXform defineXform(pxr::UsdPrim parent, const std::string &name, std::optional< const pxr::GfTransform > transform=std::nullopt)
Defines an xform on the stage.
- bool exportLayer(pxr::SdfLayerHandle layer, const std::string &identifier, const std::string &authoringMetadata, std::optional< std::string_view > comment=std::nullopt, const pxr::SdfLayer::FileFormatArguments &fileFormatArgs=pxr::SdfLayer::FileFormatArguments())
Export the given
SdfLayer
to an identifier with an optional comment.- const pxr::TfToken & getAssetToken()
Get the Asset token.
- const pxr::TfToken & getColorSpaceToken(ColorSpace value)
Get the
TfToken
matching a givenColorSpace
- const pxr::TfToken & getContentsToken()
Get the token for the Contents layer.
- DiagnosticsLevel getDiagnosticLevel(pxr::TfDiagnosticType code)
Get the
DiagnosticsLevel
for a givenTfDiagnosticType
.- DiagnosticsLevel getDiagnosticsLevel()
Get the current
DiagnosticsLevel
for theDelegate
.- DiagnosticsOutputStream getDiagnosticsOutputStream()
Get the current
DiagnosticsOutputStream
for theDelegate
.- std::string getDisplayName(const pxr::UsdPrim &prim)
Return this prim's display name (metadata)
- const pxr::TfToken & getGeometryToken()
Get the token for the Geometry layer and scope.
- std::string getLayerAuthoringMetadata(const pxr::SdfLayerHandle layer)
Get metadata from the
SdfLayer
indicating the provenance of the data.- const pxr::TfToken & getLibraryToken()
Get the token for the Library layer.
- pxr::UsdAttribute getLightAttr(const pxr::UsdAttribute &defaultAttr)
Get the "correct" light attribute for a light that could have any combination of authored old and new UsdLux schema attributes.
- pxr::GfTransform getLocalTransform(const pxr::UsdGeomXformable &xformable, pxr::UsdTimeCode time=pxr::UsdTimeCode::Default())
Get the local transform of an xformable at a given time.
- pxr::GfTransform getLocalTransform(const pxr::UsdPrim &prim, pxr::UsdTimeCode time=pxr::UsdTimeCode::Default())
Get the local transform of a prim at a given time.
- void getLocalTransformComponents(const pxr::UsdPrim &prim, pxr::GfVec3d &translation, pxr::GfVec3d &pivot, pxr::GfVec3f &rotation, RotationOrder &rotationOrder, pxr::GfVec3f &scale, pxr::UsdTimeCode time=pxr::UsdTimeCode::Default())
Get the local transform of a prim at a given time in the form of common transform components.
- void getLocalTransformComponents(const pxr::UsdGeomXformable &xformable, pxr::GfVec3d &translation, pxr::GfVec3d &pivot, pxr::GfVec3f &rotation, RotationOrder &rotationOrder, pxr::GfVec3f &scale, pxr::UsdTimeCode time=pxr::UsdTimeCode::Default())
Get the local transform of an xformable at a given time in the form of common transform components.
- void getLocalTransformComponentsQuat(const pxr::UsdGeomXformable &xformable, pxr::GfVec3d &translation, pxr::GfVec3d &pivot, pxr::GfQuatf &orientation, pxr::GfVec3f &scale, pxr::UsdTimeCode time=pxr::UsdTimeCode::Default())
Get the local transform of an xformable at a given time in the form of common transform components with quaternion orientation.
- void getLocalTransformComponentsQuat(const pxr::UsdPrim &prim, pxr::GfVec3d &translation, pxr::GfVec3d &pivot, pxr::GfQuatf &orientation, pxr::GfVec3f &scale, pxr::UsdTimeCode time=pxr::UsdTimeCode::Default())
Get the local transform of a prim at a given time in the form of common transform components with quaternion orientation.
- pxr::GfMatrix4d getLocalTransformMatrix(const pxr::UsdGeomXformable &xformable, pxr::UsdTimeCode time=pxr::UsdTimeCode::Default())
Get the local transform of an xformable at a given time in the form of a 4x4 matrix.
- pxr::GfMatrix4d getLocalTransformMatrix(const pxr::UsdPrim &prim, pxr::UsdTimeCode time=pxr::UsdTimeCode::Default())
Get the local transform of a prim at a given time in the form of a 4x4 matrix.
- const pxr::TfToken & getMaterialsToken()
Get the token for the Materials layer and scope.
- const pxr::TfToken & getPayloadToken()
Get the token for the Payload directory.
- const pxr::TfToken & getPhysicsToken()
Get the token for the Physics layer and scope.
- const pxr::TfToken & getTexturesToken()
Get the token for the Textures directory.
- pxr::TfToken getValidChildName(const pxr::UsdPrim &prim, const std::string &name)
Take a prim and a preferred name. Return a valid and unique name as the child name of the given prim.
- pxr::TfTokenVector getValidChildNames(const pxr::UsdPrim &prim, const std::vector< std::string > &names)
Take a prim and a vector of the preferred names. Return a matching vector of valid and unique names as the child names of the given prim.
- pxr::TfToken getValidPrimName(const std::string &name)
Produce a valid prim name from the input name.
- pxr::TfTokenVector getValidPrimNames(const std::vector< std::string > &names, const pxr::TfTokenVector &reservedNames={})
Take a vector of the preferred names and return a matching vector of valid and unique names.
- pxr::TfToken getValidPropertyName(const std::string &name)
Produce a valid property name using the Bootstring algorithm.
- pxr::TfTokenVector getValidPropertyNames(const std::vector< std::string > &names, const pxr::TfTokenVector &reservedNames={})
Take a vector of the preferred names and return a matching vector of valid and unique names.
- bool hasLayerAuthoringMetadata(const pxr::SdfLayerHandle layer)
Check if the
SdfLayer
has metadata indicating the provenance of the data.- bool isDiagnosticsDelegateActive()
Test whether the
Delegate
is currently active.- bool isEditablePrimLocation(const pxr::UsdPrim &prim, const std::string &name, std::string *reason)
Validate that prim opinions could be authored for a child prim with the given name.
- bool isEditablePrimLocation(const pxr::UsdStagePtr stage, const pxr::SdfPath &path, std::string *reason)
Validate that prim opinions could be authored at this path on the stage.
- bool isEditablePrimLocation(const pxr::UsdPrim &prim, std::string *reason)
Validate that prim opinions could be authored for a prim.
- bool isLight(const pxr::UsdPrim &prim)
Determines if a UsdPrim has a
UsdLuxLightAPI
schema applied.- pxr::GfVec3f linearToSrgb(const pxr::GfVec3f &color)
Translate a linear color value to sRGB color space.
- bool removeMaterialInterface(pxr::UsdShadeMaterial &material, bool bakeValues=true)
Removes any
UsdShadeInputs
found on the material prim.- pxr::GfVec3f sRgbToLinear(const pxr::GfVec3f &color)
Translate an sRGB color value to linear color space.
- bool saveLayer(pxr::SdfLayerHandle layer, std::optional< std::string_view > authoringMetadata=std::nullopt, std::optional< std::string_view > comment=std::nullopt)
Save the given
SdfLayer
with an optional comment.- void saveStage(pxr::UsdStagePtr stage, std::optional< std::string_view > authoringMetadata=std::nullopt, std::optional< std::string_view > comment=std::nullopt)
Save the given
UsdStage
with metadata applied to all dirty layers.- void setDiagnosticsLevel(DiagnosticsLevel value)
Set the
DiagnosticsLevel
for theDelegate
to filterTfDiagnostics
by severity.- void setDiagnosticsOutputStream(DiagnosticsOutputStream value)
Set the
DiagnosticsOutputStream
for theDelegate
to redirectTfDiagnostics
to different streams.- bool setDisplayName(pxr::UsdPrim prim, const std::string &name)
Sets this prim's display name (metadata).
- void setLayerAuthoringMetadata(pxr::SdfLayerHandle layer, const std::string &value)
Set metadata on the
SdfLayer
indicating the provenance of the data.- bool setLocalTransform(const pxr::UsdGeomXformable &xformable, const pxr::GfVec3d &translation, const pxr::GfVec3d &pivot, const pxr::GfVec3f &rotation, const RotationOrder rotationOrder, const pxr::GfVec3f &scale, pxr::UsdTimeCode time=pxr::UsdTimeCode::Default())
Set the local transform of an xformable from common transform components.
- bool setLocalTransform(pxr::UsdPrim prim, const pxr::GfMatrix4d &matrix, pxr::UsdTimeCode time=pxr::UsdTimeCode::Default())
Set the local transform of a prim from a 4x4 matrix.
- bool setLocalTransform(pxr::UsdPrim prim, const pxr::GfVec3d &translation, const pxr::GfVec3d &pivot, const pxr::GfVec3f &rotation, const RotationOrder rotationOrder, const pxr::GfVec3f &scale, pxr::UsdTimeCode time=pxr::UsdTimeCode::Default())
Set the local transform of a prim from common transform components.
- bool setLocalTransform(pxr::UsdPrim prim, const pxr::GfTransform &transform, pxr::UsdTimeCode time=pxr::UsdTimeCode::Default())
Set the local transform of a prim.
- bool setLocalTransform(const pxr::UsdGeomXformable &xformable, const pxr::GfMatrix4d &matrix, pxr::UsdTimeCode time=pxr::UsdTimeCode::Default())
Set the local transform of an xformable from a 4x4 matrix.
- bool setLocalTransform(const pxr::UsdGeomXformable &xformable, const pxr::GfTransform &transform, pxr::UsdTimeCode time=pxr::UsdTimeCode::Default())
Set the local transform of an xformable.
- bool setLocalTransform(const pxr::UsdGeomXformable &xformable, const pxr::GfVec3d &translation, const pxr::GfQuatf &orientation, const pxr::GfVec3f &scale=pxr::GfVec3f(1.0f, 1.0f, 1.0f), pxr::UsdTimeCode time=pxr::UsdTimeCode::Default())
Set the local transform of an xformable from common transform components using a quaternion for orientation.
- bool setLocalTransform(pxr::UsdPrim prim, const pxr::GfVec3d &translation, const pxr::GfQuatf &orientation, const pxr::GfVec3f &scale=pxr::GfVec3f(1.0f, 1.0f, 1.0f), pxr::UsdTimeCode time=pxr::UsdTimeCode::Default())
Set the local transform of a prim from common transform components using a quaternion for orientation.
- const char * version()
Verify the expected usdex modules are being loaded at runtime.
- bool withPython()
Verify whether Python support is available.
Typedefs#
- FloatPrimvarData
An alias for
PrimvarData
that holdsVtFloatArray
values (e.g widths or scale factors).- Int64PrimvarData
An alias for
PrimvarData
that holdsVtInt64Array
values (e.g ids that might be very large).- IntPrimvarData
An alias for
PrimvarData
that holdsVtIntArray
values (e.g simple switch values or booleans consumable by shaders).- StringPrimvarData
An alias for
PrimvarData
that holdsVtStringArray
values (e.g human readable descriptors).- TokenPrimvarData
An alias for
PrimvarData
that holdsVtTokenArray
values (e.g more efficient human readable descriptors).- Vec2fPrimvarData
An alias for
PrimvarData
that holdsVtVec2fArray
values (e.g texture coordinates).- Vec3fPrimvarData
An alias for
PrimvarData
that holdsVtVec3fArray
values (e.g normals, colors, or other vectors).
Variables#
- pxr::TfEnvSetting< bool > USDEX_ENABLE_TRANSCODING
Set the
USDEX_ENABLE_TRANSCODING
environment variable to enable/disable the use of transcoding withingetValidPrimName(s)
,getValidChildName(s)
, andgetValidPropertyName(s)
. Defaultstrue
(transcoding is enabled).