Geometry Nodes: Show hint in empty output attributes panel
This is meant to add something to the sub-panel when it is empty so it looks more purposeful, but also add a hint that might be helpful when figuring out how to output a named attribute. Differential Revision: https://developer.blender.org/D12715
This commit is contained in:
@@ -1428,13 +1428,18 @@ static void output_attribute_panel_draw(const bContext *UNUSED(C), Panel *panel)
|
||||
uiLayoutSetPropSep(layout, true);
|
||||
uiLayoutSetPropDecorate(layout, true);
|
||||
|
||||
bool has_output_attribute = false;
|
||||
if (nmd->node_group != nullptr && nmd->settings.properties != nullptr) {
|
||||
LISTBASE_FOREACH (bNodeSocket *, socket, &nmd->node_group->outputs) {
|
||||
if (socket_type_has_attribute_toggle(*socket)) {
|
||||
has_output_attribute = true;
|
||||
draw_property_for_output_socket(layout, *nmd, ptr, *socket);
|
||||
}
|
||||
}
|
||||
}
|
||||
if (!has_output_attribute) {
|
||||
uiItemL(layout, IFACE_("No group output attributes connected."), ICON_INFO);
|
||||
}
|
||||
}
|
||||
|
||||
static void panelRegister(ARegionType *region_type)
|
||||
|
||||
Reference in New Issue
Block a user