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:
Hans Goudey
2021-10-27 08:54:24 -05:00
parent b6bed63b5b
commit 212b02b548

View File

@@ -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)