This document is for a version of USD that is under development. See this page for the current release.
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
UsdPrimCompositionQueryArc Class Reference

This represents a composition arc that is returned by a UsdPrimCompositionQuery. More...

#include <primCompositionQuery.h>

Public Member Functions

Target and Introducing Nodes

These functions access either the target or the introducing nodes in the composition graph that this arc represents.

The returned node from GetTargetNode(), along with a layer obtained from the layer stack accessible through the node's GetLayerStack() function, can be used to create a UsdEditTarget to direct edits to the target of the arc. The same can be done with the introducing node but there are additional functions below that are more convenient for directly editing the included arcs.

It is important to be aware that the nodes returned by GetTargetNode() and GetIntroducingNode() are only valid through the collective lifetime of the UsdCompositionQuery and all the UsdPrimCompositionQueryArcs the query returns. After the query and all the arcs have gone out of scope every PcpNodeRef returned by these two functions will become immediately invalid and its behavior will be undefined.

USD_API PcpNodeRef GetTargetNode () const
 Returns the targeted node of this composition arc.
 
USD_API PcpNodeRef GetIntroducingNode () const
 Returns the node that introduces this arc into composition graph.
 
Arc Target Details
USD_API SdfLayerHandle GetTargetLayer () const
 Returns the root layer of the layer stack that holds the prim spec targeted by this composition arc.
 
USD_API SdfPath GetTargetPrimPath () const
 Returns the path of the prim spec that is targeted by this composition arc in the target layer stack.
 
USD_API UsdResolveTarget MakeResolveTargetUpTo (const SdfLayerHandle &subLayer=nullptr) const
 Creates and returns a resolve target that, when passed to a UsdAttributeQuery for one of this prim's attributes, causes value resolution to only consider node sites weaker than this arc, up to and and including this arc's site itself.
 
USD_API UsdResolveTarget MakeResolveTargetStrongerThan (const SdfLayerHandle &subLayer=nullptr) const
 Creates and returns a resolve target that, when passed to a UsdAttributeQuery for one of this prim's attributes, causes value resolution to only consider node sites stronger than this arc, not including this arc itself (unless subLayer is provided).
 
Arc Editing

This set of functions returns information about where the specific opinions are authored that cause this arc to be included in the composition graph.

They can be used to edit the composition arcs themselves.

USD_API SdfLayerHandle GetIntroducingLayer () const
 Returns the specific layer in the layer stack that adds this arc to the composition graph.
 
USD_API SdfPath GetIntroducingPrimPath () const
 Returns the path of the prim that introduces this arc to the composition graph within the layer in which the composition opinion is authored.
 
USD_API bool GetIntroducingListEditor (SdfReferenceEditorProxy *editor, SdfReference *ref) const
 Gets the list editor and authored SdfReference value that introduces this arc to the composition graph for reference arcs.
 
USD_API bool GetIntroducingListEditor (SdfPayloadEditorProxy *editor, SdfPayload *payload) const
 Gets the list editor and authored SdfPayload value that introduces this arc to the composition graph for payload arcs.
 
USD_API bool GetIntroducingListEditor (SdfPathEditorProxy *editor, SdfPath *path) const
 Gets the list editor and authored SdfPath value that introduced this arc to the composition graph for class arcs.
 
USD_API bool GetIntroducingListEditor (SdfNameEditorProxy *editor, std::string *name) const
 Gets the list editor and authored string value that introduces this arc to the composition graph for variant arcs.
 
Arc classification

Queries about the arc that are useful for classifying the arc for filtering.

USD_API PcpArcType GetArcType () const
 Returns the arc type.
 
USD_API bool IsImplicit () const
 Returns whether this arc was implicitly added to this prim meaning it exists because of the introduction of another composition arc.
 
USD_API bool IsAncestral () const
 Returns whether this arc is ancestral, i.e.
 
USD_API bool HasSpecs () const
 Returns whether the target node of this arc contributes any local spec opinions that are composed for the prim.
 
USD_API bool IsIntroducedInRootLayerStack () const
 Returns whether the composition opinion that introduces this arc is authored in the root layer stack.
 
USD_API bool IsIntroducedInRootLayerPrimSpec () const
 Returns whether the composition opinion that introduces this arc is authored directly on the prim's prim spec within the root layer stack.
 

Friends

class UsdPrimCompositionQuery
 

Detailed Description

This represents a composition arc that is returned by a UsdPrimCompositionQuery.

It contains the node in the composition graph that is the target of this arc as well as access to information about how the arc was introduced to the composition graph.

Root Arc

If this arc's arc type is PcpArcTypeRoot, then this arc represents the root node of the graph. The composition graph's root arc is not an authored arc; it exists to target the root node of the graph which represents any local opinions that may be defined for the prim in the root layer stack.

Definition at line 36 of file primCompositionQuery.h.

Member Function Documentation

◆ GetArcType()

USD_API PcpArcType GetArcType ( ) const

Returns the arc type.

◆ GetIntroducingLayer()

USD_API SdfLayerHandle GetIntroducingLayer ( ) const

Returns the specific layer in the layer stack that adds this arc to the composition graph.

This layer combined with the path returned from GetIntroducingPrimPath can be used to find the prim spec which owns the field that ultimately causes this arc to exist. If this arc is the root arc of the composition graph, it is not an authored composition arc and this returns a null layer handle.

◆ GetIntroducingListEditor() [1/4]

USD_API bool GetIntroducingListEditor ( SdfNameEditorProxy editor,
std::string *  name 
) const

Gets the list editor and authored string value that introduces this arc to the composition graph for variant arcs.

If this arc's type is variant, editor will be set to the name list editor of the introducing prim spec and name will be set to the authored value of the variant set name in the name list.

This returns true if the arc type is variant and there are no errors; it returns false for all other arc types.

◆ GetIntroducingListEditor() [2/4]

USD_API bool GetIntroducingListEditor ( SdfPathEditorProxy editor,
SdfPath path 
) const

Gets the list editor and authored SdfPath value that introduced this arc to the composition graph for class arcs.

If this arc's type is inherit or specialize, editor will be set to the corresponding path list editor of the introducing prim spec and path will be set to the authored value of the SdfPath in the path list.

This returns true if the arc type is either inherit or specialize and there are no errors; it returns false for all other arc types.

◆ GetIntroducingListEditor() [3/4]

USD_API bool GetIntroducingListEditor ( SdfPayloadEditorProxy editor,
SdfPayload payload 
) const

Gets the list editor and authored SdfPayload value that introduces this arc to the composition graph for payload arcs.

If this arc's type is payload, editor will be set to the payload list editor of the introducing prim spec and payload will be set to the authored value of the SdfPayload in the payload list.

This returns true if the arc type is payload and there are no errors; it returns false for all other arc types.

◆ GetIntroducingListEditor() [4/4]

USD_API bool GetIntroducingListEditor ( SdfReferenceEditorProxy editor,
SdfReference ref 
) const

Gets the list editor and authored SdfReference value that introduces this arc to the composition graph for reference arcs.

If this arc's type is reference, editor will be set to the reference list editor of the introducing prim spec and ref will be set to the authored value of the SdfReference in the reference list.

This returns true if the arc type is reference and there are no errors; it returns false for all other arc types.

◆ GetIntroducingNode()

USD_API PcpNodeRef GetIntroducingNode ( ) const

Returns the node that introduces this arc into composition graph.

This is the node where the authored composition opinion exists and is not necessarily the target node's parent. If this arc is the root arc then this function returns the same node as GetTargetNode which is the root node of the composition graph.

◆ GetIntroducingPrimPath()

USD_API SdfPath GetIntroducingPrimPath ( ) const

Returns the path of the prim that introduces this arc to the composition graph within the layer in which the composition opinion is authored.

This path combined with the layer returned from GetIntroducingLayer can be used to find the prim spec which owns the field that ultimately causes this arc to exist. If this arc is the root arc of the composition graph, it is not an authored composition arc and this returns an empty path.

◆ GetTargetLayer()

USD_API SdfLayerHandle GetTargetLayer ( ) const

Returns the root layer of the layer stack that holds the prim spec targeted by this composition arc.

◆ GetTargetNode()

USD_API PcpNodeRef GetTargetNode ( ) const

Returns the targeted node of this composition arc.

◆ GetTargetPrimPath()

USD_API SdfPath GetTargetPrimPath ( ) const

Returns the path of the prim spec that is targeted by this composition arc in the target layer stack.

◆ HasSpecs()

USD_API bool HasSpecs ( ) const

Returns whether the target node of this arc contributes any local spec opinions that are composed for the prim.

◆ IsAncestral()

USD_API bool IsAncestral ( ) const

Returns whether this arc is ancestral, i.e.

it exists because it was composed in by a namespace parent's prim index.

◆ IsImplicit()

USD_API bool IsImplicit ( ) const

Returns whether this arc was implicitly added to this prim meaning it exists because of the introduction of another composition arc.

These will typically exist due to inherits or specializes that are authored across a reference.

◆ IsIntroducedInRootLayerPrimSpec()

USD_API bool IsIntroducedInRootLayerPrimSpec ( ) const

Returns whether the composition opinion that introduces this arc is authored directly on the prim's prim spec within the root layer stack.

This is always true for the root arc.

◆ IsIntroducedInRootLayerStack()

USD_API bool IsIntroducedInRootLayerStack ( ) const

Returns whether the composition opinion that introduces this arc is authored in the root layer stack.

This returns true for any arcs where the composition opinion can be authored in the root layer stack. This is always true for the root arc.

◆ MakeResolveTargetStrongerThan()

USD_API UsdResolveTarget MakeResolveTargetStrongerThan ( const SdfLayerHandle &  subLayer = nullptr) const

Creates and returns a resolve target that, when passed to a UsdAttributeQuery for one of this prim's attributes, causes value resolution to only consider node sites stronger than this arc, not including this arc itself (unless subLayer is provided).

If subLayer is provided, it must be a layer in this arc's layer stack and it will cause value resolution to additionally consider layers in this arc but only if they are stronger than subLayer within this arc's layer stack.

◆ MakeResolveTargetUpTo()

USD_API UsdResolveTarget MakeResolveTargetUpTo ( const SdfLayerHandle &  subLayer = nullptr) const

Creates and returns a resolve target that, when passed to a UsdAttributeQuery for one of this prim's attributes, causes value resolution to only consider node sites weaker than this arc, up to and and including this arc's site itself.

If subLayer is provided, it must be a layer in this arc's layer stack and it will further limit value resolution to only the weaker layers up to and including subLayer within this layer stack. (This is only with respect to this arc; all layers will still be considered in the arcs weaker than this arc).

Friends And Related Function Documentation

◆ UsdPrimCompositionQuery

friend class UsdPrimCompositionQuery
friend

Definition at line 238 of file primCompositionQuery.h.


The documentation for this class was generated from the following file: