Add attributes to prims in Bifrost-USD
You can add an attribute to a prim using a define_usd_attribute
node, or a similar node that is specialized for a specific predefined attribute. These nodes can be connected to the attribute_definitions
port of a define_usd_port
node — this could be the define_usd_port
node that originally defined the prim, or another one that targets the same path.
Right-click on the
attribute_definitions
port of adefine_usd_port
node, and select an option from the Create Node menu.- Usd::Attribute::define_usd_transform lets you quickly scale, rotate, and translate the prim.
- Usd::Attribute::define_usd_display_color lets you quickly set a color for display in the viewport.
- Usd::Attribute::define_usd_display_color lets you set any attribute.
In the case of
define_usd_transform
, you need to specify the attribute's details.- Enter the
name
of the attribute. - Set the
custom
checkbox to declare whether or not the attribute is user-defined. - Select the type of USD data from the
type
drop-down box. In addition, note that the data type of thevalue
port isauto
but defaults tofloat
— you must right-click on the port and change this to a Bifrost data type that is compatible with the selected USD data type, for example,float3
forNormal3f
orColor3f
,string
forToken
orAsset
, and so on. - If you want to also set the attribute to a specific value (rather than simply define that the attribute exists), check the
enable_value
box and enter or connect thevalue
to set. - To connect the attribute to another prim's attribute, check the
enable_connection
box and set theconnection_mode
,target_prim
, andtarget_attribute
. - To declare to renderers that the attribute is associated with geometric primitives and can vary over the surface or volume, check the
enable_primvar
box and set theinterpolation_method
. - To set the value at a particular frame, check the
use_frame
box and enter theframe
to use. For an animated attribute, you can connect theframe
output of atime
node.
- Enter the