[Bf-blender-cvs] [212b02b5488] master: Geometry Nodes: Show hint in empty output attributes panel

Hans Goudey noreply at git.blender.org
Wed Oct 27 15:54:34 CEST 2021


Commit: 212b02b5488982e83083a033150d11384181aa49
Author: Hans Goudey
Date:   Wed Oct 27 08:54:24 2021 -0500
Branches: master
https://developer.blender.org/rB212b02b5488982e83083a033150d11384181aa49

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

===================================================================

M	source/blender/modifiers/intern/MOD_nodes.cc

===================================================================

diff --git a/source/blender/modifiers/intern/MOD_nodes.cc b/source/blender/modifiers/intern/MOD_nodes.cc
index 292ba04490c..c88940c00c2 100644
--- a/source/blender/modifiers/intern/MOD_nodes.cc
+++ b/source/blender/modifiers/intern/MOD_nodes.cc
@@ -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)



More information about the Bf-blender-cvs mailing list