HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
XUSD_AttributeUtils.h File Reference
#include "HUSD_API.h"
#include <SYS/SYS_Deprecated.h>
#include <SYS/SYS_Types.h>
#include <pxr/pxr.h>
#include <pxr/usd/sdf/attributeSpec.h>
+ Include dependency graph for XUSD_AttributeUtils.h:

Go to the source code of this file.

Functions

template<typename UT_VALUE_TYPE >
HUSD_API const char * HUSDgetSdfTypeName ()
 Returns the SdfValueTypeName string best corresponding to the UT type. More...
 
template<typename UT_VALUE_TYPE >
HUSD_API bool HUSDsetAttribute (const UsdAttribute &attribute, const UT_VALUE_TYPE &value, const UsdTimeCode &timecode, bool clear_existing=true)
 Sets the given attribute to the given value. More...
 
HUSD_API bool HUSDsetAttribute (const UsdAttribute &attribute, const PRM_Parm &parm, const HUSD_TimeCode &timecode)
 
HUSD_API bool HUSDsetNodeParm (PRM_Parm &parm, const UsdAttribute &attribute, const UsdTimeCode &timecode, bool save_for_undo=false)
 
HUSD_API bool HUSDsetNodeParm (PRM_Parm &parm, const UsdRelationship &relationship, bool save_for_undo=false)
 
template<typename UT_VALUE_TYPE >
HUSD_API bool HUSDgetAttribute (const UsdAttribute &attribute, UT_VALUE_TYPE &value, const UsdTimeCode &timecode)
 Gets the value of the given attribute at specified timecode. More...
 
HUSD_API bool HUSDsetConnectionNodeParm (PRM_Parm &parm, const UsdShadeConnectionSourceInfo &src_info, bool save_for_undo=false)
 Sets the parameter to specify the given source for a connection. More...
 
HUSD_API bool HUSDgetFirstConnectedSrc (const UsdAttribute &attribute, UsdShadeConnectionSourceInfo &src_info_value)
 Obtains the source the given destination attribute is connected to. More...
 
HUSD_API bool HUSDgetFirstConnectedSrc (const UsdShadeInput &shade_input, UsdShadeConnectionSourceInfo &src_info_value)
 
HUSD_API bool HUSDgetFirstConnectedSrc (const UsdShadeOutput &shade_output, UsdShadeConnectionSourceInfo &src_info_value)
 
template<typename UT_VALUE_TYPE >
HUSD_API bool HUSDgetAttributeSpecDefault (const SdfAttributeSpec &spec, UT_VALUE_TYPE &value)
 
template<typename UT_VALUE_TYPE >
HUSD_API bool HUSDsetMetadata (const UsdObject &object, const TfToken &name, const UT_VALUE_TYPE &value)
 Gets obj's metadata given its name (eg, "active" or "customData:foo:bar"). More...
 
template<typename UT_VALUE_TYPE >
HUSD_API bool HUSDgetMetadata (const UsdObject &object, const TfToken &name, UT_VALUE_TYPE &value)
 Gets obj's metadata given its name (eg, "active" or "customData:foo:bar"). More...
 
HUSD_API bool HUSDclearMetadata (const UsdObject &object, const TfToken &name)
 
HUSD_API bool HUSDhasMetadata (const UsdObject &object, const TfToken &name)
 Metadata utilities. More...
 
HUSD_API bool HUSDisArrayMetadata (const UsdObject &object, const TfToken &name)
 
HUSD_API exint HUSDgetMetadataLength (const UsdObject &object, const TfToken &name)
 
template<typename UT_VALUE_TYPE >
HUSD_API bool HUSDgetCustomData (const UsdObject &object, const TfToken &name, UT_VALUE_TYPE &value)
 Fetch custom data. More...
 
template<typename UT_VALUE_TYPE >
HUSD_API bool HUSDgetAssetInfo (const UsdObject &object, const TfToken &name, UT_VALUE_TYPE &value)
 Fetch asset info. More...
 
template<typename UT_VALUE_TYPE >
HUSD_API bool HUSDgetValue (const VtValue &vt_value, UT_VALUE_TYPE &ut_value)
 Conversion function between VtValue and UT_* value objects. More...
 
template<typename UT_VALUE_TYPE >
HUSD_API VtValue HUSDgetVtValue (const UT_VALUE_TYPE &ut_value)
 
HUSD_API SdfValueTypeName HUSDgetAttribSdfTypeName (const PI_EditScriptedParm &parm)
 Returns the best suited Usd attribute type given the Houdini parameter. More...
 
HUSD_API VtValue HUSDgetShaderParmValue (const PRM_Parm &parm, const HUSD_TimeCode &timecode)
 Returns the value of the best suited Usd type given the Houdini parameter. More...
 
HUSD_API VtValue HUSDgetShaderParmDefaultValue (const PRM_Parm &parm)
 
HUSD_API SdfValueTypeName HUSDgetShaderAttribSdfTypeName (const PRM_Parm &parm)
 Returns the type of a shader input attribute given the VOP node input. More...
 
HUSD_API SdfValueTypeName HUSDgetShaderInputSdfTypeName (const VOP_Node &vop, int input_idx, const PRM_Parm *parm_hint=nullptr)
 
HUSD_API SdfValueTypeName HUSDgetShaderOutputSdfTypeName (const VOP_Node &vop, int output_idx, const PRM_Parm *parm_hint=nullptr)
 
HUSD_API VOP_TypeInfo HUSDgetVopTypeInfo (SdfValueTypeName sdf_type_name)
 

Function Documentation

HUSD_API bool HUSDclearMetadata ( const UsdObject object,
const TfToken name 
)
template<typename UT_VALUE_TYPE >
HUSD_API bool HUSDgetAssetInfo ( const UsdObject object,
const TfToken name,
UT_VALUE_TYPE &  value 
)

Fetch asset info.

HUSD_API SdfValueTypeName HUSDgetAttribSdfTypeName ( const PI_EditScriptedParm parm)

Returns the best suited Usd attribute type given the Houdini parameter.

template<typename UT_VALUE_TYPE >
HUSD_API bool HUSDgetAttribute ( const UsdAttribute attribute,
UT_VALUE_TYPE &  value,
const UsdTimeCode timecode 
)

Gets the value of the given attribute at specified timecode.

template<typename UT_VALUE_TYPE >
HUSD_API bool HUSDgetAttributeSpecDefault ( const SdfAttributeSpec spec,
UT_VALUE_TYPE &  value 
)
template<typename UT_VALUE_TYPE >
HUSD_API bool HUSDgetCustomData ( const UsdObject object,
const TfToken name,
UT_VALUE_TYPE &  value 
)

Fetch custom data.

HUSD_API bool HUSDgetFirstConnectedSrc ( const UsdAttribute attribute,
UsdShadeConnectionSourceInfo src_info_value 
)

Obtains the source the given destination attribute is connected to.

HUSD_API bool HUSDgetFirstConnectedSrc ( const UsdShadeInput shade_input,
UsdShadeConnectionSourceInfo src_info_value 
)
HUSD_API bool HUSDgetFirstConnectedSrc ( const UsdShadeOutput shade_output,
UsdShadeConnectionSourceInfo src_info_value 
)
template<typename UT_VALUE_TYPE >
HUSD_API bool HUSDgetMetadata ( const UsdObject object,
const TfToken name,
UT_VALUE_TYPE &  value 
)

Gets obj's metadata given its name (eg, "active" or "customData:foo:bar").

HUSD_API exint HUSDgetMetadataLength ( const UsdObject object,
const TfToken name 
)
template<typename UT_VALUE_TYPE >
HUSD_API const char* HUSDgetSdfTypeName ( )

Returns the SdfValueTypeName string best corresponding to the UT type.

HUSD_API SdfValueTypeName HUSDgetShaderAttribSdfTypeName ( const PRM_Parm parm)

Returns the type of a shader input attribute given the VOP node input.

HUSD_API SdfValueTypeName HUSDgetShaderInputSdfTypeName ( const VOP_Node vop,
int  input_idx,
const PRM_Parm parm_hint = nullptr 
)
HUSD_API SdfValueTypeName HUSDgetShaderOutputSdfTypeName ( const VOP_Node vop,
int  output_idx,
const PRM_Parm parm_hint = nullptr 
)
HUSD_API VtValue HUSDgetShaderParmDefaultValue ( const PRM_Parm parm)
HUSD_API VtValue HUSDgetShaderParmValue ( const PRM_Parm parm,
const HUSD_TimeCode timecode 
)

Returns the value of the best suited Usd type given the Houdini parameter.

template<typename UT_VALUE_TYPE >
HUSD_API bool HUSDgetValue ( const VtValue vt_value,
UT_VALUE_TYPE &  ut_value 
)

Conversion function between VtValue and UT_* value objects.

HUSD_API VOP_TypeInfo HUSDgetVopTypeInfo ( SdfValueTypeName  sdf_type_name)
template<typename UT_VALUE_TYPE >
HUSD_API VtValue HUSDgetVtValue ( const UT_VALUE_TYPE &  ut_value)

Conversion function between from UT_* value objects and a VtValue with a matching GfValue inside.

HUSD_API bool HUSDhasMetadata ( const UsdObject object,
const TfToken name 
)

Metadata utilities.

HUSD_API bool HUSDisArrayMetadata ( const UsdObject object,
const TfToken name 
)
template<typename UT_VALUE_TYPE >
HUSD_API bool HUSDsetAttribute ( const UsdAttribute attribute,
const UT_VALUE_TYPE &  value,
const UsdTimeCode timecode,
bool  clear_existing = true 
)

Sets the given attribute to the given value.

HUSD_API bool HUSDsetAttribute ( const UsdAttribute attribute,
const PRM_Parm parm,
const HUSD_TimeCode timecode 
)

Sets the given attribute to the value of a given parm.

Note
HUSD_TimeCode allows evaluating a parameter at a given frame while authoring an attribute value at the default time code.
HUSD_API bool HUSDsetConnectionNodeParm ( PRM_Parm parm,
const UsdShadeConnectionSourceInfo src_info,
bool  save_for_undo = false 
)

Sets the parameter to specify the given source for a connection.

template<typename UT_VALUE_TYPE >
HUSD_API bool HUSDsetMetadata ( const UsdObject object,
const TfToken name,
const UT_VALUE_TYPE &  value 
)

Gets obj's metadata given its name (eg, "active" or "customData:foo:bar").

HUSD_API bool HUSDsetNodeParm ( PRM_Parm parm,
const UsdAttribute attribute,
const UsdTimeCode timecode,
bool  save_for_undo = false 
)
HUSD_API bool HUSDsetNodeParm ( PRM_Parm parm,
const UsdRelationship relationship,
bool  save_for_undo = false 
)