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_definitionsport of adefine_usd_portnode, 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
nameof the attribute. - Set the
customcheckbox to declare whether or not the attribute is user-defined. - Select the type of USD data from the
typedrop-down box. In addition, note that the data type of thevalueport isautobut 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,float3forNormal3forColor3f,stringforTokenorAsset, 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_valuebox and enter or connect thevalueto set. - To connect the attribute to another prim's attribute, check the
enable_connectionbox 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_primvarbox and set theinterpolation_method. - To set the value at a particular frame, check the
use_framebox and enter theframeto use. For an animated attribute, you can connect theframeoutput of atimenode.
- Enter the