[Bf-blender-cvs] [f4a98832943] master: UI: Correct output attribute name in proximity node

Hans Goudey noreply at git.blender.org
Mon Mar 1 16:33:00 CET 2021


Commit: f4a988329438ccaae5fdd9eb861db065d5f518b2
Author: Hans Goudey
Date:   Mon Mar 1 09:32:48 2021 -0600
Branches: master
https://developer.blender.org/rBf4a988329438ccaae5fdd9eb861db065d5f518b2

UI: Correct output attribute name in proximity node

I made an incorrect comment in patch review that "Location"
should be used instead of position. "Position" is more appropriate
here since it refers to generic data rather than an object origin.
"Position" is also the name we chose for the attribute for this reason.

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

M	source/blender/blenloader/intern/versioning_290.c
M	source/blender/nodes/geometry/nodes/node_geo_attribute_proximity.cc

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

diff --git a/source/blender/blenloader/intern/versioning_290.c b/source/blender/blenloader/intern/versioning_290.c
index b05d5ae7d26..5e2582a184a 100644
--- a/source/blender/blenloader/intern/versioning_290.c
+++ b/source/blender/blenloader/intern/versioning_290.c
@@ -1763,5 +1763,12 @@ void blo_do_versions_290(FileData *fd, Library *UNUSED(lib), Main *bmain)
    */
   {
     /* Keep this block, even when empty. */
+
+    FOREACH_NODETREE_BEGIN (bmain, ntree, id) {
+      if (ntree->type == NTREE_GEOMETRY) {
+        version_node_socket_name(ntree, GEO_NODE_ATTRIBUTE_PROXIMITY, "Location", "Position");
+      }
+    }
+    FOREACH_NODETREE_END;
   }
 }
diff --git a/source/blender/nodes/geometry/nodes/node_geo_attribute_proximity.cc b/source/blender/nodes/geometry/nodes/node_geo_attribute_proximity.cc
index 2ab76540bdf..f09a9bf056e 100644
--- a/source/blender/nodes/geometry/nodes/node_geo_attribute_proximity.cc
+++ b/source/blender/nodes/geometry/nodes/node_geo_attribute_proximity.cc
@@ -32,7 +32,7 @@ static bNodeSocketTemplate geo_node_attribute_proximity_in[] = {
     {SOCK_GEOMETRY, N_("Geometry")},
     {SOCK_GEOMETRY, N_("Target")},
     {SOCK_STRING, N_("Distance")},
-    {SOCK_STRING, N_("Location")},
+    {SOCK_STRING, N_("Position")},
     {-1, ""},
 };
 
@@ -172,7 +172,7 @@ static void attribute_calc_proximity(GeometryComponent &component,
   OutputAttributePtr distance_attribute = component.attribute_try_get_for_output(
       distance_attribute_name, result_domain, CD_PROP_FLOAT);
 
-  const std::string location_attribute_name = params.get_input<std::string>("Location");
+  const std::string location_attribute_name = params.get_input<std::string>("Position");
   OutputAttributePtr location_attribute = component.attribute_try_get_for_output(
       location_attribute_name, result_domain, CD_PROP_FLOAT3);



More information about the Bf-blender-cvs mailing list