3ds Max USD API Reference
Loading...
Searching...
No Matches
MAXUSD_NS_DEF::MappedAttributeBuilder Class Reference

Classes

class  Config
 
class  DataLayout
 
class  MappedData
 

Public Member Functions

MaxUSDAPI MappedAttributeBuilder (MeshFacade &maxMesh, std::shared_ptr< MappedData > data)
 Constructor. More...
 
MaxUSDAPI MappedAttributeBuilder (MeshFacade &&maxMesh, std::shared_ptr< MappedData > data)
 Constructor. This overload was added to allow passing a temporary MeshFacade as parameter.
 
MaxUSDAPI bool BuildPrimvar (pxr::UsdGeomMesh &target, const Config &config, const pxr::UsdTimeCode &timeCode, bool animated) const
 Creates a new primvar onto the target USD mesh and populate it with the the mapped data. More...
 
MaxUSDAPI bool PopulateAttribute (pxr::UsdAttribute &attribute, const DataLayout &layout, pxr::UsdGeomPrimvar *primvar, const pxr::UsdTimeCode &timeCode) const
 Populates a given attribute with the mapped data. More...
 
MaxUSDAPI DataLayout InferAttributeDataLayout () const
 Infers the data layout i.e. the interpolation scheme and whether it should be indexed or not. More...
 

Static Public Member Functions

static MaxUSDAPI pxr::SdfValueTypeName GetValueTypeName (const Type &type)
 Returns the SdfValueTypeName associated with this type. More...
 
static MaxUSDAPI size_t GetTypeDimension (const Type &type)
 Returns the dimension of the given type. More...
 
static MaxUSDAPI Type GetEquivalentType (const Type &type, int dimension)
 Returns a type equivalent to the given type for a given dimension. For example the equivalent to texcoord2farray for 3 dimensions would be texcoord3farray. When no direct equivalent exists, return a float array of the requested dimension. If an unkown type, fallback to float3Array. More...
 

Constructor & Destructor Documentation

◆ MappedAttributeBuilder()

MaxUSDAPI MAXUSD_NS_DEF::MappedAttributeBuilder::MappedAttributeBuilder ( MeshFacade maxMesh,
std::shared_ptr< MappedData data 
)

Constructor.

Parameters
maxMeshThe max mesh on which the data is mapped.
dataThe mapped data.

Member Function Documentation

◆ BuildPrimvar()

MaxUSDAPI bool MAXUSD_NS_DEF::MappedAttributeBuilder::BuildPrimvar ( pxr::UsdGeomMesh &  target,
const Config config,
const pxr::UsdTimeCode &  timeCode,
bool  animated 
) const

Creates a new primvar onto the target USD mesh and populate it with the the mapped data.

Parameters
targetThe target USD mesh where to create the new primvar.
configThe configuration for the new primvar.
timeCodeThe timecode at which to set the data.
animatedWhether or not the primvar is intended to be animated.
Returns
True on success, false otherwise.

◆ GetEquivalentType()

static MaxUSDAPI Type MAXUSD_NS_DEF::MappedAttributeBuilder::GetEquivalentType ( const Type &  type,
int  dimension 
)
static

Returns a type equivalent to the given type for a given dimension. For example the equivalent to texcoord2farray for 3 dimensions would be texcoord3farray. When no direct equivalent exists, return a float array of the requested dimension. If an unkown type, fallback to float3Array.

Parameters
typeThe type for which to get an equivalent type.
dimensionThe required dimension of the equivalent type. Should be 1, 2, or 3, any other value will be clamped in that range.
Returns
The equivalent type in the given dimension.

◆ GetTypeDimension()

static MaxUSDAPI size_t MAXUSD_NS_DEF::MappedAttributeBuilder::GetTypeDimension ( const Type &  type)
static

Returns the dimension of the given type.

Parameters
typeThe type for which to get the dimension.
Returns
The dimension of the type.

◆ GetValueTypeName()

static MaxUSDAPI pxr::SdfValueTypeName MAXUSD_NS_DEF::MappedAttributeBuilder::GetValueTypeName ( const Type &  type)
static

Returns the SdfValueTypeName associated with this type.

Parameters
typeThe type for which to get the name.
Returns
The value type name.

◆ InferAttributeDataLayout()

MaxUSDAPI DataLayout MAXUSD_NS_DEF::MappedAttributeBuilder::InferAttributeDataLayout ( ) const

Infers the data layout i.e. the interpolation scheme and whether it should be indexed or not.

Returns
The inferred data layout.

◆ PopulateAttribute()

MaxUSDAPI bool MAXUSD_NS_DEF::MappedAttributeBuilder::PopulateAttribute ( pxr::UsdAttribute &  attribute,
const DataLayout layout,
pxr::UsdGeomPrimvar *  primvar,
const pxr::UsdTimeCode &  timeCode 
) const

Populates a given attribute with the mapped data.

Parameters
attributeThe attribute to populate.
primvarThe primvar associated with the attribute, null if the attribute is not owned by a primvar.
layoutThe data layout (interpolation scheme and whether indexing is used)
timeCodeThe timecode at which to populate the attribute.
Returns
True on success, false otherwise.

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