Shear operator fails to affect curve control point handles #78592

Closed
opened 2020-07-04 02:14:12 +02:00 by Sam Brubaker · 8 comments

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):
screen.png

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

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): ![screen.png](https://archive.blender.org/developer/F8662559/screen.png) The operator appears to only affect the locations of the curve control points and not their handles.
Author

Added subscriber: @rocketman

Added subscriber: @rocketman

Added subscriber: @mano-wii

Added subscriber: @mano-wii

Changed status from 'Needs Triage' to: 'Confirmed'

Changed status from 'Needs Triage' to: 'Confirmed'

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

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

Added subscriber: @ideasman42

Added subscriber: @ideasman42

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

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

This occurs because the pivot (center) of each handle that is used in the shear. I'm not sure why this happens (CC @ideasman42) Maybe we could always use `td->loc` to shear curves: ```lines = 10 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); ``` ```

This issue was referenced by 854f73b4a2

This issue was referenced by 854f73b4a2317e026b3d6f8c3598d9bded09337b

Changed status from 'Confirmed' to: 'Resolved'

Changed status from 'Confirmed' to: 'Resolved'
Germano Cavalcante self-assigned this 2020-08-05 20:06:51 +02:00
Sign in to join this conversation.
No Label
Interest
Alembic
Interest
Animation & Rigging
Interest
Asset Browser
Interest
Asset Browser Project Overview
Interest
Audio
Interest
Automated Testing
Interest
Blender Asset Bundle
Interest
BlendFile
Interest
Collada
Interest
Compatibility
Interest
Compositing
Interest
Core
Interest
Cycles
Interest
Dependency Graph
Interest
Development Management
Interest
EEVEE
Interest
EEVEE & Viewport
Interest
Freestyle
Interest
Geometry Nodes
Interest
Grease Pencil
Interest
ID Management
Interest
Images & Movies
Interest
Import Export
Interest
Line Art
Interest
Masking
Interest
Metal
Interest
Modeling
Interest
Modifiers
Interest
Motion Tracking
Interest
Nodes & Physics
Interest
OpenGL
Interest
Overlay
Interest
Overrides
Interest
Performance
Interest
Physics
Interest
Pipeline, Assets & IO
Interest
Platforms, Builds & Tests
Interest
Python API
Interest
Render & Cycles
Interest
Render Pipeline
Interest
Sculpt, Paint & Texture
Interest
Text Editor
Interest
Translations
Interest
Triaging
Interest
Undo
Interest
USD
Interest
User Interface
Interest
UV Editing
Interest
VFX & Video
Interest
Video Sequencer
Interest
Virtual Reality
Interest
Vulkan
Interest
Wayland
Interest
Workbench
Interest: X11
Legacy
Blender 2.8 Project
Legacy
Milestone 1: Basic, Local Asset Browser
Legacy
OpenGL Error
Meta
Good First Issue
Meta
Papercut
Meta
Retrospective
Meta
Security
Module
Animation & Rigging
Module
Core
Module
Development Management
Module
EEVEE & Viewport
Module
Grease Pencil
Module
Modeling
Module
Nodes & Physics
Module
Pipeline, Assets & IO
Module
Platforms, Builds & Tests
Module
Python API
Module
Render & Cycles
Module
Sculpt, Paint & Texture
Module
Triaging
Module
User Interface
Module
VFX & Video
Platform
FreeBSD
Platform
Linux
Platform
macOS
Platform
Windows
Priority
High
Priority
Low
Priority
Normal
Priority
Unbreak Now!
Status
Archived
Status
Confirmed
Status
Duplicate
Status
Needs Info from Developers
Status
Needs Information from User
Status
Needs Triage
Status
Resolved
Type
Bug
Type
Design
Type
Known Issue
Type
Patch
Type
Report
Type
To Do
No Milestone
No project
3 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: blender/blender#78592
No description provided.