Rotation value on preview sequencer view and the value in sidebar don't match #98141

Closed
opened 2022-05-15 15:15:54 +02:00 by hamza.SMA · 7 comments

System Information
Operating system: Windows-10-10.0.19043-SP0 64 Bits
Graphics card: NVIDIA GeForce GTX 1050/PCIe/SSE2 NVIDIA Corporation 4.5.0 NVIDIA 472.39

Blender Version
Broken: version: 3.1.2, branch: master, commit date: 2022-03-31 17:40, hash: cc66d1020c
Worked: (newest version of Blender that worked as expected)

Short description of error
when we do rotation in the preview view sequencer by numberpad for eg 90° it is stored as 270° in transform pannel in the sidebar see video .

  to be precise   when we increase rotation on preview  sequencer view  by starting from 0°  the value of the rotation in the sidebar shows that it start from 360° and it is decreasing ....  

1.png

  also if we start from 0° on preview sequencer view and go negatively  the value of the rotation in the sidebar shows that it start from 0° and go positively ....  

2.png

  that happen also if we use the numberpad in sequencer view  

maybe the issue is orientation of the rotation and there is some modulo math applied when we rotate in the preview more than +360° or -360° so
i don't know is it important to have modulo for the preview? i don't know?
Exact steps for others to reproduce the error
see the video
0001-0500.mp4
also more clear
2022-05-17 00-19-19.mp4

**System Information** Operating system: Windows-10-10.0.19043-SP0 64 Bits Graphics card: NVIDIA GeForce GTX 1050/PCIe/SSE2 NVIDIA Corporation 4.5.0 NVIDIA 472.39 **Blender Version** Broken: version: 3.1.2, branch: master, commit date: 2022-03-31 17:40, hash: `cc66d1020c` Worked: (newest version of Blender that worked as expected) **Short description of error** when we do rotation in the preview view sequencer by numberpad for eg 90° it is stored as 270° in transform pannel in the sidebar see video . ``` to be precise when we increase rotation on preview sequencer view by starting from 0° the value of the rotation in the sidebar shows that it start from 360° and it is decreasing .... ``` ![1.png](https://archive.blender.org/developer/F13080514/1.png) ``` also if we start from 0° on preview sequencer view and go negatively the value of the rotation in the sidebar shows that it start from 0° and go positively .... ``` ![2.png](https://archive.blender.org/developer/F13080516/2.png) ``` that happen also if we use the numberpad in sequencer view ``` maybe the issue is orientation of the rotation and there is some modulo math applied when we rotate in the preview more than +360° or -360° so i don't know is it important to have modulo for the preview? i don't know? **Exact steps for others to reproduce the error** see the video [0001-0500.mp4](https://archive.blender.org/developer/F13075802/0001-0500.mp4) also more clear [2022-05-17 00-19-19.mp4](https://archive.blender.org/developer/F13080525/2022-05-17_00-19-19.mp4)
Author

Added subscriber: @hamza-el-barmaki

Added subscriber: @hamza-el-barmaki
hamza.SMA changed title from rotation on preview sequencer view don't match to rotation value in the sidebar to Rotation on preview sequencer view don't match to rotation value in the sidebar 2022-05-15 15:17:40 +02:00
hamza.SMA changed title from Rotation on preview sequencer view don't match to rotation value in the sidebar to Rotation value on preview sequencer view and the value in sidebar don't match 2022-05-16 21:22:34 +02:00

Added subscriber: @mano-wii

Added subscriber: @mano-wii

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

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

I can confirm.
Although the header and transform values are inverted, maybe they could match a little better.

Here a code I used to test:

diff --git a/source/blender/editors/transform/transform_convert_sequencer_image.c b/source/blender/editors/transform/transform_convert_sequencer_image.c
index cbc2cab0a7a..deae51a1149 100644
--- a/source/blender/editors/transform/transform_convert_sequencer_image.c
+++ b/source/blender/editors/transform/transform_convert_sequencer_image.c
@@ -197,11 +197,7 @@ void recalcData_sequencer_image(TransInfo *t)
 
     /* Rotation. Scaling can cause negative rotation. */
     if (t->mode == TFM_ROTATION) {
-      const float orig_dir[2] = {cosf(tdseq->orig_rotation), sinf(tdseq->orig_rotation)};
-      float rotation = angle_signed_v2v2(handle_x, orig_dir) * mirror[0] * mirror[1];
-      transform->rotation = tdseq->orig_rotation + rotation;
-      transform->rotation += DEG2RAD(360.0);
-      transform->rotation = fmod(transform->rotation, DEG2RAD(360.0));
+      transform->rotation = tdseq->orig_rotation - t->values_final[0];
     }
     SEQ_relations_invalidate_cache_preprocessed(t->scene, seq);
   }
@@ -209,9 +205,6 @@ void recalcData_sequencer_image(TransInfo *t)
 
 void special_aftertrans_update__sequencer_image(bContext *UNUSED(C), TransInfo *t)
 {
-  if (t->state == TRANS_CANCEL) {
-    return;
-  }
 
   TransDataContainer *tc = TRANS_DATA_CONTAINER_FIRST_SINGLE(t);
   TransData *td = NULL;
@@ -225,8 +218,14 @@ void special_aftertrans_update__sequencer_image(bContext *UNUSED(C), TransInfo *
     TransDataSeq *tdseq = td->extra;
     Sequence *seq = tdseq->seq;
     StripTransform *transform = seq->strip->transform;
-    Scene *scene = t->scene;
+    if (t->state == TRANS_CANCEL) {
+      if (t->mode == TFM_ROTATION) {
+        transform->rotation = tdseq->orig_rotation;
+      }
+      continue;
+    }
 
+    Scene *scene = t->scene;
     RNA_pointer_create(&scene->id, &RNA_SequenceTransform, transform, &ptr);
 
     if (t->mode == TFM_ROTATION) {

I can confirm. Although the header and transform values are inverted, maybe they could match a little better. Here a code I used to test: ```lines=15 diff --git a/source/blender/editors/transform/transform_convert_sequencer_image.c b/source/blender/editors/transform/transform_convert_sequencer_image.c index cbc2cab0a7a..deae51a1149 100644 --- a/source/blender/editors/transform/transform_convert_sequencer_image.c +++ b/source/blender/editors/transform/transform_convert_sequencer_image.c @@ -197,11 +197,7 @@ void recalcData_sequencer_image(TransInfo *t) /* Rotation. Scaling can cause negative rotation. */ if (t->mode == TFM_ROTATION) { - const float orig_dir[2] = {cosf(tdseq->orig_rotation), sinf(tdseq->orig_rotation)}; - float rotation = angle_signed_v2v2(handle_x, orig_dir) * mirror[0] * mirror[1]; - transform->rotation = tdseq->orig_rotation + rotation; - transform->rotation += DEG2RAD(360.0); - transform->rotation = fmod(transform->rotation, DEG2RAD(360.0)); + transform->rotation = tdseq->orig_rotation - t->values_final[0]; } SEQ_relations_invalidate_cache_preprocessed(t->scene, seq); } @@ -209,9 +205,6 @@ void recalcData_sequencer_image(TransInfo *t) void special_aftertrans_update__sequencer_image(bContext *UNUSED(C), TransInfo *t) { - if (t->state == TRANS_CANCEL) { - return; - } TransDataContainer *tc = TRANS_DATA_CONTAINER_FIRST_SINGLE(t); TransData *td = NULL; @@ -225,8 +218,14 @@ void special_aftertrans_update__sequencer_image(bContext *UNUSED(C), TransInfo * TransDataSeq *tdseq = td->extra; Sequence *seq = tdseq->seq; StripTransform *transform = seq->strip->transform; - Scene *scene = t->scene; + if (t->state == TRANS_CANCEL) { + if (t->mode == TFM_ROTATION) { + transform->rotation = tdseq->orig_rotation; + } + continue; + } + Scene *scene = t->scene; RNA_pointer_create(&scene->id, &RNA_SequenceTransform, transform, &ptr); if (t->mode == TFM_ROTATION) { ```
Author

i noticed also that if we set rotation 600° as preset then rotate using shortcut 'R' 'without any change'we can notice that the value will go to between 0° and 360°.
so there is a modulo by 360° which it will miss with any animation that was done .....
SO i propose to make addition instead of modulo '-360......360'

i noticed also that if we set rotation 600° as preset then rotate using shortcut 'R' 'without any change'we can notice that the value will go to between 0° and 360°. so there is a modulo by 360° which it will miss with any animation that was done ..... SO i propose to make addition instead of modulo '-360......360'

This issue was referenced by c968dae054

This issue was referenced by c968dae05441b8d2c68916260d728c4a8d01c464

Changed status from 'Confirmed' to: 'Resolved'

Changed status from 'Confirmed' to: 'Resolved'
Richard Antalik self-assigned this 2022-05-23 23:37:46 +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
No Assignees
4 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#98141
No description provided.