PropertyHints
PropertyHints provide UI hints for properties presented in a UI. PropertyHints cover property-level hints, such as the display group a property belongs to (if any), and an expression that conditionally controls whether the property is shown in a UI or not.
Note that properties also have access to ObjectHints, for authoring property display names and hidden (in a UI) state.
The following simple example shows a prim with several properties. Each property specifies a display group. This example does not demonstrate prim-level hints for display groups (see PrimHints for an example that demonstrates this).
def "PrimWithPropertyHints" (
uiHints = {
string displayName = "Example prim"
bool hidden = 0
}
)
{
int exampleAttribute = 1 (
uiHints = {
string displayName = "An example attribute"
bool hidden = 0
string displayGroup = "Display Group 1"
string shownIf = "showProperties == 1"
}
)
rel exampleRelationship (
uiHints = {
string displayName = "An example relationship"
bool hidden = 0
string displayGroup = ""
string shownIf = "showProperties == 1"
}
)
bool showProperties = true
}
PropertyHints fields
displayGroup
USD type: string
The name of the display group the property belongs to. A property can only belong to a single display group.
A property can specify it belongs to a “nested” display group by using a “:”
separator in the display group name. For example, a property with
displayGroup set to “GroupA:NestedGroup” would belong to the
“NestedGroup” display group, which would be a child of the “GroupA”
display group. See Display Groups and Property Order for more examples.
shownIf
USD type: string
A string containing an expression (based off SdfBooleanExpression)
that controls if the property is shown in a UI or not. If the expression
evaluates to true, the property is shown, otherwise it is omitted in a UI.
This hint is used along with the object-level hidden hint to determine
property visibility.
See Working With Conditional UI Hints for more information about boolean expressions.