Tweaking last operator after duplicating+rotating group instance resets previous duplicate if 3D cursor is used for rotation #42472

Closed
opened 2014-11-02 14:09:41 +01:00 by Hadrien Brissaud · 13 comments

System Information
Win7x64 GTX660m

Blender Version
Broken: 2.72 and last buildbot
Worked: (optional)

Short description of error
Tweaking last operator after duplicating+rotating group instance resets previous duplicate

Exact steps for others to reproduce the error
This is so weird, apologies for the long list of steps.
I think I've narrowed it down to :

  1. use 3D cursor as pivot
  2. shift+D then R (duplicate and rotate)
  3. shift+R twice for repeating last action
  4. tweak rotation value in last operator panel

next-to-last duplicate has its transform reset (as if only duplicated and not rotated), but trying to move the one before it makes it reappear

groupInstanceBug.blend

**System Information** Win7x64 GTX660m **Blender Version** Broken: 2.72 and last buildbot Worked: (optional) **Short description of error** Tweaking last operator after duplicating+rotating group instance resets previous duplicate **Exact steps for others to reproduce the error** This is so weird, apologies for the long list of steps. I think I've narrowed it down to : 1. use 3D cursor as pivot 2. shift+D then R (duplicate and rotate) 3. shift+R twice for repeating last action 4. tweak rotation value in last operator panel # next-to-last duplicate has its transform reset (as if only duplicated and not rotated), but trying to move the one before it makes it reappear [groupInstanceBug.blend](https://archive.blender.org/developer/F121254/groupInstanceBug.blend)

Changed status to: 'Open'

Changed status to: 'Open'

Added subscriber: @hadrien

Added subscriber: @hadrien

Added subscriber: @mont29

Added subscriber: @mont29

Does not work with any object, only 'empty-like' objects seems affected (could reproduce the issue with empties, lamps, cameras, etc., but not with meshes, mballs nor curves). Weird. :/

Does not work with any object, only 'empty-like' objects seems affected (could reproduce the issue with empties, lamps, cameras, etc., but not with meshes, mballs nor curves). Weird. :/
Bastien Montagne self-assigned this 2014-11-02 15:26:45 +01:00

Added subscribers: @Sergey, @LukasTonne

Added subscribers: @Sergey, @LukasTonne

Sergey, Lukas, needs your insight here as depsgraph experts! :)

Real issue is, when doing undo, non-geometry objects are not tagged for recalc in DAG_on_visible_update() func (check line 2356 skips them).

For some reason, empties & co saved in undosteps have the right rotation value, but their final transform 'visual' matrix has not yet been updated. So when undostep is re-read, their final transform 'visual' matrix is restored as if unrotated.

Not quite sure what to do here (we can force recalc for all types of object in DAG_on_visible_update(), but I’m pretty sure this would not be seen as valid solution...

Sergey, Lukas, needs your insight here as depsgraph experts! :) Real issue is, when doing undo, non-geometry objects are not tagged for recalc in `DAG_on_visible_update()` func (check line 2356 skips them). For some reason, empties & co saved in undosteps have the right rotation value, **but** their final transform 'visual' matrix has not yet been updated. So when undostep is re-read, their final transform 'visual' matrix is restored as if unrotated. Not quite sure what to do here (we can force recalc for all types of object in `DAG_on_visible_update()`, but I’m pretty sure this would not be seen as valid solution...

The thing is, currently DAG_on_visible_update() only tags OB_RECALC_DATA, it doesn't tag for OB_RECALC and in order to make sure locations are correct OB_RECALC is to be used. So if some tagging is missing, then i wouldn't expect it to be an issue of empties only.

For me it sounds as the issue somewhere else than in DAG_on_visible_update().

The thing is, currently `DAG_on_visible_update()` only tags OB_RECALC_DATA, it doesn't tag for OB_RECALC and in order to make sure locations are correct OB_RECALC is to be used. So if some tagging is missing, then i wouldn't expect it to be an issue of empties only. For me it sounds as the issue somewhere else than in `DAG_on_visible_update()`.

Added subscriber: @ideasman42

Added subscriber: @ideasman42

Well, bug affects all kind of objects that do not have geometry (empties, cameras, lamps, etc.). So clearly, OB_RECALC_DATA also implies OB_RECALC_OB… That simplistic patch indeed solves the issue:

P161: #42472

diff --git a/source/blender/blenkernel/intern/depsgraph.c b/source/blender/blenkernel/intern/depsgraph.c
index 44a0b93..8b9c011 100644
--- a/source/blender/blenkernel/intern/depsgraph.c
+++ b/source/blender/blenkernel/intern/depsgraph.c
@@ -2357,6 +2357,10 @@ void DAG_on_visible_update(Main *bmain, const bool do_time)
 					ob->recalc |= OB_RECALC_DATA;
 					lib_id_recalc_tag(bmain, &ob->id);
 				}
+				else {
+					ob->recalc |= OB_RECALC_OB;
+					lib_id_recalc_tag(bmain, &ob->id);
+				}
 				if (ob->proxy && (ob->proxy_group == NULL)) {
 					ob->proxy->recalc |= OB_RECALC_DATA;
 					lib_id_recalc_tag(bmain, &ob->id);

Not sure though, whether the fact that a .blend file can be saved without being fully 'up to date' is a bug or not (that’s what happens here, those undo steps are saved while transform has not yet been propagated to final matrix), Campbell, any thoughts?

Well, bug affects all kind of objects that do not have geometry (empties, cameras, lamps, etc.). So clearly, `OB_RECALC_DATA` also implies `OB_RECALC_OB`… That simplistic patch indeed solves the issue: [P161: #42472](https://archive.blender.org/developer/P161.txt) ``` diff --git a/source/blender/blenkernel/intern/depsgraph.c b/source/blender/blenkernel/intern/depsgraph.c index 44a0b93..8b9c011 100644 --- a/source/blender/blenkernel/intern/depsgraph.c +++ b/source/blender/blenkernel/intern/depsgraph.c @@ -2357,6 +2357,10 @@ void DAG_on_visible_update(Main *bmain, const bool do_time) ob->recalc |= OB_RECALC_DATA; lib_id_recalc_tag(bmain, &ob->id); } + else { + ob->recalc |= OB_RECALC_OB; + lib_id_recalc_tag(bmain, &ob->id); + } if (ob->proxy && (ob->proxy_group == NULL)) { ob->proxy->recalc |= OB_RECALC_DATA; lib_id_recalc_tag(bmain, &ob->id); ``` Not sure though, whether the fact that a .blend file can be saved without being fully 'up to date' is a bug or not (that’s what happens here, those undo steps are saved while transform has not yet been propagated to final matrix), Campbell, any thoughts?

For the records, this is reproducible with a mere transform operation too, e.g.:

  • Add an empty;
  • Move it (G);
  • Repeat (shift-R) the operation twice or more;
  • Undo;

...and you get stupid object with valid transform data itself, but invalid transformation matrix (editing position then force the recomputing of final matrix and 'fixes' everything).

For the records, this is reproducible with a mere transform operation too, e.g.: * Add an empty; * Move it (G); * Repeat (shift-R) the operation twice or more; * Undo; ...and you get stupid object with valid transform data itself, but invalid transformation matrix (editing position then force the recomputing of final matrix and 'fixes' everything).

This issue was referenced by 01bda15832

This issue was referenced by 01bda15832bf2084618fdbf242cd550f0ebbf727

Changed status from 'Open' to: 'Resolved'

Changed status from 'Open' to: 'Resolved'

Closed by commit 01bda15832.

Closed by commit 01bda15832.
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#42472
No description provided.