Share

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.

  1. Right-click on the attribute_definitions port of a define_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.
  2. 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 the value port is auto but defaults to float — 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 for Normal3f or Color3f, string for Token or Asset, 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 the value to set.
    • To connect the attribute to another prim's attribute, check the enable_connection box and set the connection_mode, target_prim, and target_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 the interpolation_method.
    • To set the value at a particular frame, check the use_frame box and enter the frame to use. For an animated attribute, you can connect the frame output of a time node.

Was this information helpful?