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
UsdVariantSets Class Reference

UsdVariantSets represents the collection of VariantSets that are present on a UsdPrim. More...

#include <variantSets.h>

Public Member Functions

USD_API UsdVariantSet AddVariantSet (const std::string &variantSetName, UsdListPosition position=UsdListPositionBackOfPrependList)
 Find an existing, or create a new VariantSet on the originating UsdPrim, named variantSetName.
 
USD_API bool GetNames (std::vector< std::string > *names) const
 Compute the list of all VariantSets authored on the originating UsdPrim.
 
USD_API std::vector< std::string > GetNames () const
 Return a list of all VariantSets authored on the originating UsdPrim.
 
UsdVariantSet operator[] (const std::string &variantSetName) const
 
USD_API UsdVariantSet GetVariantSet (const std::string &variantSetName) const
 Return a UsdVariantSet object for variantSetName.
 
USD_API bool HasVariantSet (const std::string &variantSetName) const
 Returns true if a VariantSet named variantSetName exists on the originating prim.
 
USD_API std::string GetVariantSelection (const std::string &variantSetName) const
 Return the composed variant selection for the VariantSet named variantSetName.
 
USD_API bool SetSelection (const std::string &variantSetName, const std::string &variantName)
 
USD_API SdfVariantSelectionMap GetAllVariantSelections () const
 Returns the composed map of all variant selections authored on the the originating UsdPrim, regardless of whether a corresponding variant set exists.
 

Friends

class UsdPrim
 

Detailed Description

UsdVariantSets represents the collection of VariantSets that are present on a UsdPrim.

A UsdVariantSets object, retrieved from a prim via UsdPrim::GetVariantSets(), provides the API for interrogating and modifying the composed list of VariantSets active defined on the prim, and also the facility for authoring a VariantSet selection for any of those VariantSets.

Definition at line 205 of file variantSets.h.

Member Function Documentation

◆ AddVariantSet()

USD_API UsdVariantSet AddVariantSet ( const std::string &  variantSetName,
UsdListPosition  position = UsdListPositionBackOfPrependList 
)

Find an existing, or create a new VariantSet on the originating UsdPrim, named variantSetName.

This step is not always necessary, because if this UsdVariantSets object is valid, then

varSetsObj.GetVariantSet(variantSetName).AddVariant(variantName);

will always succeed, creating the VariantSet first, if necessary. This method exists for situations in which you want to create a VariantSet without necessarily populating it with variants.

◆ GetAllVariantSelections()

USD_API SdfVariantSelectionMap GetAllVariantSelections ( ) const

Returns the composed map of all variant selections authored on the the originating UsdPrim, regardless of whether a corresponding variant set exists.

◆ GetNames() [1/2]

USD_API std::vector< std::string > GetNames ( ) const

Return a list of all VariantSets authored on the originating UsdPrim.

◆ GetNames() [2/2]

USD_API bool GetNames ( std::vector< std::string > *  names) const

Compute the list of all VariantSets authored on the originating UsdPrim.

Always return true. Clear the contents of names and store the result there.

◆ GetVariantSelection()

USD_API std::string GetVariantSelection ( const std::string &  variantSetName) const

Return the composed variant selection for the VariantSet named variantSetName.

If there is no selection, (or variantSetName does not exist) return the empty string.

◆ GetVariantSet()

USD_API UsdVariantSet GetVariantSet ( const std::string &  variantSetName) const

Return a UsdVariantSet object for variantSetName.

This always succeeds, although the returned VariantSet will be invalid if the originating prim is invalid

◆ HasVariantSet()

USD_API bool HasVariantSet ( const std::string &  variantSetName) const

Returns true if a VariantSet named variantSetName exists on the originating prim.

◆ operator[]()

UsdVariantSet operator[] ( const std::string &  variantSetName) const
inline

Definition at line 235 of file variantSets.h.

Friends And Related Function Documentation

◆ UsdPrim

friend class UsdPrim
friend

Definition at line 276 of file variantSets.h.


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