defineReference#
Fully qualified name: usdex::core::defineReference
- pxr::UsdPrim usdex::core::defineReference(
- pxr::UsdStagePtr stage,
- const pxr::SdfPath &path,
- const std::string &sourceIdentifier,
- std::optional<pxr::SdfPath> primPath = std::nullopt,
Define a reference to a prim from a USD file.
This creates a reference prim that targets the prims in the external USD file.
Resolution behavior for
sourceIdentifier:Absolute filesystem paths are resolved directly by the configured asset resolver.
Relative filesystem paths (including
./,../, or filenames without a leading root) are anchored to the resolved identifier of the stage’s current edit target layer, so the external file is located relative to that layer’s path.Identifiers containing a URI-like scheme (for example, containing
://) are resolved without anchoring to the stage’s current edit target layer.
- Parameters:
stage – The stage on which to define the reference
path – The absolute prim path at which to define the reference
sourceIdentifier – The identifier of the external USD file to reference
primPath – Absolute prim path in the external USD file for the root prim of this reference. If not provided, uses the default prim’s path
- Returns:
The newly created reference prim. Returns an invalid prim on error.