Align rotation adds some offset when snapping #42362

Closed
opened 2014-10-23 09:14:19 +02:00 by gandalf3 · 15 comments
Member

System Information
Archlinux

Blender Version
Broken: 2.72

Short description of error
Transform snapping with align rotation enabled consistently adds a small gap between the transformed object and the target object.

Exact steps for others to reproduce the error

  1. Open rotation_snap_test.blend
  2. Press G to grab the spike object (should be active by default)
  3. Move the cursor over the slanted face of the other object and press LMB to confirm (note that the object doesn't snap to the surface under the cursor, it goes a bit up and to the left. This seems to be another bug?)
  4. Note that the bottom of the spike object is a little below the surface of the target object. This distance seems to vary based on the rotations of the two objects.
**System Information** Archlinux **Blender Version** Broken: 2.72 **Short description of error** Transform snapping with align rotation enabled consistently adds a small gap between the transformed object and the target object. **Exact steps for others to reproduce the error** 1. Open [rotation_snap_test.blend](https://archive.blender.org/developer/F119350/rotation_snap_test.blend) 2. Press G to grab the spike object (should be active by default) 3. Move the cursor over the slanted face of the other object and press LMB to confirm (note that the object doesn't snap to the surface under the cursor, it goes a bit up and to the left. This seems to be another bug?) 4. Note that the bottom of the spike object is a little below the surface of the target object. This distance seems to vary based on the rotations of the two objects.
Author
Member

Changed status to: 'Open'

Changed status to: 'Open'
Author
Member

Added subscriber: @gandalf3

Added subscriber: @gandalf3

Added subscriber: @mont29

Added subscriber: @mont29

yeah, seems to be something wrong here… :/

yeah, seems to be something wrong here… :/
Bastien Montagne changed title from Align rotation adds imprecision when snapping to Align rotation adds some offset when snapping 2014-10-26 13:03:28 +01:00
Bastien Montagne self-assigned this 2014-10-26 13:03:28 +01:00

Added subscriber: @ideasman42

Added subscriber: @ideasman42

OK, so basically, issue is that the object is rotated (to align along hit face's normal) around its center, while it should be rotated around its hitting vertex (i.e. the vertex that is used to determine the snapping position).

Now, our transform code in general, and snapping one specifically, is quite horrible, but having a look at it I have a feeling this won't be that easy to achieve… So Campbell, question is, based on your knowledge of that area, do you think this is worth spending time to fix in current system, or better make it a TODO for when we redesign that code? Would rather avoid spending more time on it to find that there is no good solution. ;)

OK, so basically, issue is that the object is rotated (to align along hit face's normal) around its center, while it should be rotated around its hitting vertex (i.e. the vertex that is used to determine the snapping position). Now, our transform code in general, and snapping one specifically, is quite horrible, but having a look at it I have a feeling this won't be that easy to achieve… So Campbell, question is, based on your knowledge of that area, do you think this is worth spending time to fix in current system, or better make it a TODO for when we redesign that code? Would rather avoid spending more time on it to find that there is no good solution. ;)

@mont29, afraid I cant give a good answer off-hand,
there is some real bad stuff going on here, this is one area I didn't touch much (and hasn't been touched since Martin wrote it)

Suggest...

  • Check ~2.49 see if this is a regression.
  • Investigate the cause...
    ... if it can be fixed without lager, long term changes - go ahead! otherwise maybe do as part of larger reworking.

Note, after you snap the object a few times to the same surface, it gets closer and closer to the faces surface (another bug?)

@mont29, afraid I cant give a good answer off-hand, there is some real bad stuff going on here, this is one area I didn't touch much (and hasn't been touched since Martin wrote it) Suggest... - Check ~2.49 see if this is a regression. - Investigate the cause... ... if it can be fixed without lager, long term changes - go ahead! otherwise maybe do as part of larger reworking. Note, after you snap the object a few times to the same surface, it gets closer and closer to the faces surface (another bug?)

Added subscriber: @MarcClintDion

Added subscriber: @MarcClintDion

The offset seems to be influenced by the object dimensions. I've applied Scale after re-sizing but the results seem the same either way.

The longer the object becomes on the z-axis, the more the widget-ama-bob's offest along the y-axis becomes.

final.png

The offset seems to be influenced by the object dimensions. I've applied Scale after re-sizing but the results seem the same either way. The longer the object becomes on the z-axis, the more the widget-ama-bob's offest along the y-axis becomes. ![final.png](https://archive.blender.org/developer/F123100/final.png)

Ok, checked 2.49, bug is still present, so no regression here.

The fact that object is OK after second transform-snap on same surface is expected, since on second snapping there is no rotation, so everything works as expected. As said above, cause of the bug is that object is rotated around it’s center, when it should be rotated around it's snapping point.

Reading the code, I could not think of an easy way to do this currently, we'd need to pass upward hitting point, imho this should be kept as TODO then, that whole transform area needs refactor anyway.

Ok, checked 2.49, bug is still present, so no regression here. The fact that object is OK after second transform-snap on same surface is expected, since on second snapping there is no rotation, so everything works as expected. As said above, cause of the bug is that object is rotated around it’s center, when it should be rotated around it's snapping point. Reading the code, I could not think of an easy way to do this currently, we'd need to pass upward hitting point, imho this should be kept as TODO then, that whole transform area needs refactor anyway.

Changed status from 'Open' to: 'Archived'

Changed status from 'Open' to: 'Archived'

Thanks for the report, but for now this is not easily fixable, so closing as TODO.

Thanks for the report, but for now this is not easily fixable, so closing [as TODO](http://wiki.blender.org/index.php/Dev:2.5/Source/Development/Todo/Tools#Transform).

Added subscriber: @mano-wii

Added subscriber: @mano-wii

Changed status from 'Archived' to: 'Resolved'

Changed status from 'Archived' to: 'Resolved'

This seems to have already been resolved.
Maybe in 5ecc6a824a
or ddf99214dc

This seems to have already been resolved. Maybe in 5ecc6a824a or ddf99214dc
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
5 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#42362
No description provided.