usdrt::UsdGeomSubset
Defined in usdrt/scenegraph/usd/usdGeom/subset.h
Functions
usdrt::UsdGeomSubset::CreateElementTypeAttr: See GetElementTypeAttr() , and also Create vs Get Property Methods for when to use Get vs Create. If specified, author
defaultValue
as the attribute's default, sparsely (when it makes sense to do so) ifwriteSparsely
istrue
- the default forwriteSparsely
isfalse
.usdrt::UsdGeomSubset::CreateFamilyNameAttr: See GetFamilyNameAttr() , and also Create vs Get Property Methods for when to use Get vs Create. If specified, author
defaultValue
as the attribute's default, sparsely (when it makes sense to do so) ifwriteSparsely
istrue
- the default forwriteSparsely
isfalse
.usdrt::UsdGeomSubset::CreateIndicesAttr: See GetIndicesAttr() , and also Create vs Get Property Methods for when to use Get vs Create. If specified, author
defaultValue
as the attribute's default, sparsely (when it makes sense to do so) ifwriteSparsely
istrue
- the default forwriteSparsely
isfalse
.usdrt::UsdGeomSubset::Define: Attempt to ensure a UsdPrim adhering to this schema at
path
is defined (according to UsdPrim::IsDefined()) on this stage.usdrt::UsdGeomSubset::GetElementTypeAttr: The type of element that the indices target. Currently only allows "face" and defaults to it.
usdrt::UsdGeomSubset::GetFamilyNameAttr: The name of the family of subsets that this subset belongs to. This is optional and is primarily useful when there are multiple families of subsets under a geometric prim. In some cases, this could also be used for achieving proper roundtripping of subset data between DCC apps. When multiple subsets belonging to a prim have the same familyName, they are said to belong to the family. A familyType value can be encoded on the owner of a family of subsets as a token using the static method UsdGeomSubset::SetFamilyType(). "familyType" can have one of the following values:
usdrt::UsdGeomSubset::GetIndicesAttr: The set of indices included in this subset. The indices need not be sorted, but the same index should not appear more than once.
usdrt::DestructionSchemaDestructibleBaseAPI::GetPath: Return the SdfPath to this schema object's held prim.
usdrt::DestructionSchemaDestructibleBaseAPI::GetPrim: Return this schema object's held prim.
usdrt::UsdGeomSubset::UsdGeomSubset: Construct a UsdGeomSubset on UsdPrim
prim
. Equivalent to UsdGeomSubset::Get(prim.GetStage(), prim.GetPath()) for a validprim
, but will not immediately throw an error for an invalidprim
.usdrt::UsdGeomSubset::UsdGeomSubset: Construct a UsdGeomSubset on the prim held by
schemaObj
. Should be preferred over UsdGeomSubset (schemaObj.GetPrim()), as it preserves SchemaBase state.usdrt::UsdGeomSubset::operator bool: Boolean operator.
usdrt::UsdGeomSubset::~UsdGeomSubset: Destructor.
Variables
usdrt::UsdGeomSubset::schemaType: Compile time constant representing what kind of schema this class is.
-
class UsdGeomSubset : public usdrt::UsdTyped
Encodes a subset of a piece of geometry (i.e. a UsdGeomImageable) as a set of indices. Currently only supports encoding of face-subsets, but could be extended in the future to support subsets representing edges, segments, points etc.
To apply to a geometric prim, a GeomSubset prim must be the prim’s direct child in namespace, and possess a concrete defining specifier (i.e. def). This restriction makes it easy and efficient to discover subsets of a prim. We might want to relax this restriction if it’s common to have multiple families of subsets on a gprim and if it’s useful to be able to organize subsets belonging to a family under a common scope. See ‘familyName’ attribute for more info on defining a family of subsets.
Note that a GeomSubset isn’t an imageable (i.e. doesn’t derive from UsdGeomImageable). So, you can’t author visibility for it or override its purpose.
Materials are bound to GeomSubsets just as they are for regular geometry using API available in UsdShade (UsdShadeMaterial::Bind).
For any described attribute Fallback Value or Allowed Values below that are text/tokens, the actual token is published and defined in UsdGeomTokens. So to set an attribute to the value “rightHanded”, use UsdGeomTokens->rightHanded as the value.
Public Functions
-
inline explicit UsdGeomSubset(const UsdPrim &prim = UsdPrim())
Construct a UsdGeomSubset on UsdPrim
prim
. Equivalent to UsdGeomSubset::Get(prim.GetStage(), prim.GetPath()) for a validprim
, but will not immediately throw an error for an invalidprim
.
-
inline explicit UsdGeomSubset(const UsdSchemaBase &schemaObj)
Construct a UsdGeomSubset on the prim held by
schemaObj
. Should be preferred over UsdGeomSubset(schemaObj.GetPrim()), as it preserves SchemaBase state.
-
inline virtual ~UsdGeomSubset()
Destructor.
-
inline operator bool() const
Boolean operator.
- Returns
Return true if the contained prim is an instance of this schema using
IsA
, and false otherwise.
-
inline UsdAttribute GetElementTypeAttr() const
The type of element that the indices target. Currently only allows “face” and defaults to it.
Declaration
uniform token elementType = "face"
C++ Type
TfToken
Usd Type
SdfValueTypeNames->Token
Variability
SdfVariabilityUniform
Allowed Values
face
-
inline UsdAttribute CreateElementTypeAttr() const
See GetElementTypeAttr(), and also Create vs Get Property Methods for when to use Get vs Create. If specified, author
defaultValue
as the attribute’s default, sparsely (when it makes sense to do so) ifwriteSparsely
istrue
- the default forwriteSparsely
isfalse
.
-
inline UsdAttribute GetIndicesAttr() const
The set of indices included in this subset. The indices need not be sorted, but the same index should not appear more than once.
Declaration
int[] indices = []
C++ Type
VtArray<int>
Usd Type
SdfValueTypeNames->IntArray
-
inline UsdAttribute CreateIndicesAttr() const
See GetIndicesAttr(), and also Create vs Get Property Methods for when to use Get vs Create. If specified, author
defaultValue
as the attribute’s default, sparsely (when it makes sense to do so) ifwriteSparsely
istrue
- the default forwriteSparsely
isfalse
.
-
inline UsdAttribute GetFamilyNameAttr() const
The name of the family of subsets that this subset belongs to. This is optional and is primarily useful when there are multiple families of subsets under a geometric prim. In some cases, this could also be used for achieving proper roundtripping of subset data between DCC apps. When multiple subsets belonging to a prim have the same familyName, they are said to belong to the family. A familyType value can be encoded on the owner of a family of subsets as a token using the static method UsdGeomSubset::SetFamilyType(). “familyType” can have one of the following values:
UsdGeomTokens->partition: implies that every element of the whole geometry appears exactly once in only one of the subsets belonging to the family.
UsdGeomTokens->nonOverlapping: an element that appears in one subset may not appear in any other subset belonging to the family.
UsdGeomTokens->unrestricted: implies that there are no restrictions w.r.t. the membership of elements in the subsets. They could be overlapping and the union of all subsets in the family may not represent the whole.
Declaration
uniform token familyName = ""
C++ Type
TfToken
Usd Type
SdfValueTypeNames->Token
Variability
SdfVariabilityUniform
Note
The validity of subset data is not enforced by the authoring APIs, however they can be checked using UsdGeomSubset::ValidateFamily().
-
inline UsdAttribute CreateFamilyNameAttr() const
See GetFamilyNameAttr(), and also Create vs Get Property Methods for when to use Get vs Create. If specified, author
defaultValue
as the attribute’s default, sparsely (when it makes sense to do so) ifwriteSparsely
istrue
- the default forwriteSparsely
isfalse
.
Public Static Functions
-
static inline UsdGeomSubset Define(const UsdStageRefPtr &stage, const SdfPath &path)
Attempt to ensure a UsdPrim adhering to this schema at
path
is defined (according to UsdPrim::IsDefined()) on this stage.
Public Static Attributes
-
static const UsdSchemaType schemaType = UsdSchemaType::ConcreteTyped
Compile time constant representing what kind of schema this class is.
See also
UsdSchemaType
-
inline explicit UsdGeomSubset(const UsdPrim &prim = UsdPrim())