[Bf-blender-cvs] [1140e001a07] blender-v3.4-release: Fix T102329: assert when cutting node tree link

Jacques Lucke noreply at git.blender.org
Mon Nov 7 16:12:18 CET 2022


Commit: 1140e001a07b7912debbd3166d61f77499b60158
Author: Jacques Lucke
Date:   Mon Nov 7 16:12:07 2022 +0100
Branches: blender-v3.4-release
https://developer.blender.org/rB1140e001a07b7912debbd3166d61f77499b60158

Fix T102329: assert when cutting node tree link

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

M	source/blender/editors/space_node/drawnode.cc

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

diff --git a/source/blender/editors/space_node/drawnode.cc b/source/blender/editors/space_node/drawnode.cc
index df31a0342cb..c66b8ad4ff0 100644
--- a/source/blender/editors/space_node/drawnode.cc
+++ b/source/blender/editors/space_node/drawnode.cc
@@ -1581,10 +1581,12 @@ void draw_nodespace_back_pix(const bContext &C,
   GPU_matrix_pop();
 }
 
-static float2 socket_link_connection_location(const bNodeSocket &socket, const bNodeLink &link)
+static float2 socket_link_connection_location(const bNode &node,
+                                              const bNodeSocket &socket,
+                                              const bNodeLink &link)
 {
   const float2 socket_location(socket.locx, socket.locy);
-  if (socket.is_multi_input() && socket.is_input() && !(socket.owner_node().flag & NODE_HIDDEN)) {
+  if (socket.is_multi_input() && socket.is_input() && !(node.flag & NODE_HIDDEN)) {
     return node_link_calculate_multi_input_position(
         socket_location, link.multi_input_socket_index, socket.total_inputs);
   }
@@ -1620,8 +1622,8 @@ static void calculate_inner_link_bezier_points(std::array<float2, 4> &points)
 static std::array<float2, 4> node_link_bezier_points(const bNodeLink &link)
 {
   std::array<float2, 4> points;
-  points[0] = socket_link_connection_location(*link.fromsock, link);
-  points[3] = socket_link_connection_location(*link.tosock, link);
+  points[0] = socket_link_connection_location(*link.fromnode, *link.fromsock, link);
+  points[3] = socket_link_connection_location(*link.tonode, *link.tosock, link);
   calculate_inner_link_bezier_points(points);
   return points;
 }
@@ -2212,8 +2214,11 @@ static std::array<float2, 4> node_link_bezier_points_dragged(const SpaceNode &sn
 {
   const float2 cursor = snode.runtime->cursor * UI_DPI_FAC;
   std::array<float2, 4> points;
-  points[0] = link.fromsock ? socket_link_connection_location(*link.fromsock, link) : cursor;
-  points[3] = link.tosock ? socket_link_connection_location(*link.tosock, link) : cursor;
+  points[0] = link.fromsock ?
+                  socket_link_connection_location(*link.fromnode, *link.fromsock, link) :
+                  cursor;
+  points[3] = link.tosock ? socket_link_connection_location(*link.tonode, *link.tosock, link) :
+                            cursor;
   calculate_inner_link_bezier_points(points);
   return points;
 }



More information about the Bf-blender-cvs mailing list