Page MenuHome

Shear operator fails to affect curve control point handles
Closed, ResolvedPublicBUG

Description

Version: 2.83.1 (Linux 64)

This bug requires no example file to reproduce.

  1. Create a Curve object with Free or Aligned Handle Types.
  2. Use the Shear operator/tool.

Below is an example of the expected result (left) vs what you actually get (right):

The operator appears to only affect the locations of the curve control points and not their handles.

Event Timeline

Germano Cavalcante (mano-wii) changed the task status from Needs Triage to Confirmed.Jul 7 2020, 10:36 PM
Germano Cavalcante (mano-wii) changed the subtype of this task from "Report" to "Bug".

I imagine that the original code was not made to support this case.
But I will confirm for now.

This occurs because the pivot (center) of each handle that is used in the shear.
I'm not sure why this happens (CC @Campbell Barton (campbellbarton))

Maybe we could always use td->loc to shear curves:

diff --git a/source/blender/editors/transform/transform_mode_shear.c b/source/blender/editors/transform/transform_mode_shear.c
index fa33c1550e7..1902ef8a513 100644
--- a/source/blender/editors/transform/transform_mode_shear.c
+++ b/source/blender/editors/transform/transform_mode_shear.c
@@ -40,6 +40,7 @@
 #include "BLT_translation.h"
 
 #include "transform.h"
+#include "transform_convert.h"
 #include "transform_mode.h"
 #include "transform_snap.h"
 
@@ -125,6 +126,7 @@ static void applyShear(TransInfo *t, const int UNUSED(mval[2]))
   int i;
   char str[UI_MAX_DRAW_STR];
   const bool is_local_center = transdata_check_local_center(t, t->around);
+  const bool transform_td_center = !is_local_center && t->data_type != TC_CURVE_VERTS;
 
   value = t->values[0];
 
@@ -178,12 +180,17 @@ static void applyShear(TransInfo *t, const int UNUSED(mval[2]))
 
       if (is_local_center) {
         center = td->center;
-        co = td->loc;
       }
       else {
         center = tc->center_local;
+      }
+
+      if (transform_td_center) {
         co = td->center;
       }
+      else {
+        co = td->loc;
+      }
 
       sub_v3_v3v3(vec, co, center);