Functions#
- void usdex::core::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.
- const char * usdex::core::buildVersion()
Verify the expected usdex modules are being loaded at runtime.
- void usdex::core::connectPhysicsJoint(pxr::UsdPhysicsJoint joint, const pxr::UsdPrim &body0, const pxr::UsdPrim &body1, const JointFrame &frame, const pxr::GfVec3f &axis=pxr::GfVec3f(1.0f, 0.0f, 0.0f))
Connects an existing joint to the specified body prims and realigns the joint frame accordingly.
- pxr::UsdGeomCamera usdex::core::defineCamera(pxr::UsdPrim prim, const pxr::GfCamera &cameraData)
Defines a basic 3d camera from an existing prim.
- pxr::UsdGeomCamera usdex::core::defineCamera(pxr::UsdPrim parent, const std::string &name, const pxr::GfCamera &cameraData)
Defines a basic 3d camera on the stage.
- pxr::UsdGeomCamera usdex::core::defineCamera(pxr::UsdStagePtr stage, const pxr::SdfPath &path, const pxr::GfCamera &cameraData)
Defines a basic 3d camera on the stage.
- pxr::UsdGeomBasisCurves usdex::core::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
UsdGeomBasisCurvesprim on the stage.- pxr::UsdGeomBasisCurves usdex::core::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
UsdGeomBasisCurvesprim on the stage.- pxr::UsdGeomBasisCurves usdex::core::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
UsdGeomBasisCurvesprim on the stage.- pxr::UsdGeomBasisCurves usdex::core::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
UsdGeomBasisCurvesprim on the stage.- pxr::UsdGeomBasisCurves usdex::core::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
UsdGeomBasisCurvesprim on the stage.- pxr::UsdGeomBasisCurves usdex::core::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
UsdGeomBasisCurvesprim on the stage.- pxr::UsdPhysicsFixedJoint usdex::core::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 usdex::core::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 usdex::core::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::UsdPhysicsPrismaticJoint usdex::core::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 usdex::core::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 usdex::core::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 usdex::core::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 usdex::core::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 usdex::core::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 usdex::core::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 usdex::core::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 usdex::core::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::UsdGeomXform usdex::core::defineXform(pxr::UsdStagePtr stage, const pxr::SdfPath &path, std::optional< const pxr::GfTransform > transform=std::nullopt)
Defines an xform on the stage.
- pxr::UsdGeomXform usdex::core::defineXform(pxr::UsdPrim parent, const std::string &name, const pxr::GfMatrix4d &matrix)
Defines an xform on the stage.
- pxr::UsdGeomXform usdex::core::defineXform(pxr::UsdPrim prim, std::optional< const pxr::GfTransform > transform=std::nullopt)
Defines a basic xform from an existing prim.
- pxr::UsdGeomXform usdex::core::defineXform(pxr::UsdPrim parent, const std::string &name, std::optional< const pxr::GfTransform > transform=std::nullopt)
Defines an xform on the stage.
- pxr::UsdGeomXform usdex::core::defineXform(pxr::UsdPrim prim, const pxr::GfMatrix4d &matrix)
Defines a basic xform from an existing prim.
- pxr::UsdGeomXform usdex::core::defineXform(pxr::UsdStagePtr stage, const pxr::SdfPath &path, const pxr::GfMatrix4d &matrix)
Defines an xform on the stage.
- bool usdex::core::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
SdfLayerto an identifier with an optional comment.- std::string usdex::core::getLayerAuthoringMetadata(const pxr::SdfLayerHandle layer)
Get metadata from the
SdfLayerindicating the provenance of the data.- pxr::TfToken usdex::core::getUsdLayerEncoding(const pxr::SdfLayerHandle layer)
Get the USD file format encoding of the given
SdfLayer.- bool usdex::core::hasLayerAuthoringMetadata(const pxr::SdfLayerHandle layer)
Check if the
SdfLayerhas metadata indicating the provenance of the data.- bool usdex::core::saveLayer(pxr::SdfLayerHandle layer, std::optional< std::string_view > authoringMetadata=std::nullopt, std::optional< std::string_view > comment=std::nullopt)
Save the given
SdfLayerwith an optional comment.- void usdex::core::setLayerAuthoringMetadata(pxr::SdfLayerHandle layer, const std::string &value)
Set metadata on the
SdfLayerindicating the provenance of the data.- const char * usdex::core::version()
Verify the expected usdex modules are being loaded at runtime.
- bool usdex::core::withPython()
Verify whether Python support is available.
- bool usdex::rtx::addDiffuseTextureToPbrMaterial(pxr::UsdShadeMaterial &material, const pxr::SdfAssetPath &texturePath)
Adds a diffuse texture to the PBR material.
- bool usdex::rtx::addEmissiveColorToPbrMaterial(pxr::UsdShadeMaterial &material, const pxr::GfVec3f &color, const float intensity=1000.0f)
Adds an emissive color to the PBR material.
- bool usdex::rtx::addEmissiveTextureToPbrMaterial(pxr::UsdShadeMaterial &material, const pxr::SdfAssetPath &texturePath, const float intensity=1000.0f)
Adds an emissive texture to the PBR material.
- bool usdex::rtx::addMetallicTextureToPbrMaterial(pxr::UsdShadeMaterial &material, const pxr::SdfAssetPath &texturePath)
Adds a metallic texture to the PBR material.
- bool usdex::rtx::addNormalTextureToPbrMaterial(pxr::UsdShadeMaterial &material, const pxr::SdfAssetPath &texturePath)
Adds a normal texture to the PBR material.
- bool usdex::rtx::addOpacityTextureToPbrMaterial(pxr::UsdShadeMaterial &material, const pxr::SdfAssetPath &texturePath)
Adds an opacity texture to the PBR material.
- bool usdex::rtx::addOrmTextureToPbrMaterial(pxr::UsdShadeMaterial &material, const pxr::SdfAssetPath &texturePath)
Adds an ORM (occlusion, roughness, metallic) texture to the PBR material.
- bool usdex::rtx::addRoughnessTextureToPbrMaterial(pxr::UsdShadeMaterial &material, const pxr::SdfAssetPath &texturePath)
Adds a roughness texture to the PBR material.
- pxr::UsdShadeShader usdex::rtx::computeEffectiveMdlSurfaceShader(const pxr::UsdShadeMaterial &material)
Get the effective surface Shader of a Material for the MDL render context.
- pxr::UsdShadeShader usdex::rtx::createMdlShader(pxr::UsdShadeMaterial &material, const std::string &name, const pxr::SdfAssetPath &mdlPath, const pxr::TfToken &module, bool connectMaterialOutputs=true)
Create a UsdShadeShader as a child of the UsdShadeMaterial argument with the specified MDL.
- pxr::UsdShadeInput usdex::rtx::createMdlShaderInput(pxr::UsdShadeMaterial &material, const pxr::TfToken &name, const pxr::VtValue &value, const pxr::SdfValueTypeName &typeName, std::optional< const usdex::core::ColorSpace > colorSpace=std::nullopt)
Create an MDL shader input.
- pxr::UsdShadeMaterial usdex::rtx::defineGlassMaterial(pxr::UsdPrim parent, const std::string &name, const pxr::GfVec3f &color, const float indexOfRefraction=1.491f)
Defines a Glass
UsdShadeMaterialinterface that drives both an RTX render context and the universal render context.- pxr::UsdShadeMaterial usdex::rtx::defineGlassMaterial(pxr::UsdPrim prim, const pxr::GfVec3f &color, const float indexOfRefraction=1.491f)
Defines a Glass
UsdShadeMaterialinterface that drives both an RTX render context and the universal render context.- pxr::UsdShadeMaterial usdex::rtx::defineGlassMaterial(pxr::UsdStagePtr stage, const pxr::SdfPath &path, const pxr::GfVec3f &color, const float indexOfRefraction=1.491f)
Defines a Glass
UsdShadeMaterialinterface that drives both an RTX render context and the universal render context.- pxr::UsdShadeMaterial usdex::rtx::definePbrMaterial(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
UsdShadeMaterialinterface that drives both an RTX render context and the universal render context.- pxr::UsdShadeMaterial usdex::rtx::definePbrMaterial(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
UsdShadeMaterialinterface that drives both an RTX render context and the universal render context.- pxr::UsdShadeMaterial usdex::rtx::definePbrMaterial(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
UsdShadeMaterialinterface that drives both an RTX render context and the universal render context.