Node editor: Changing object pointers for multiple nodes registers as a single action for undo #54580

Closed
opened 2018-04-12 16:50:53 +02:00 by Konstantins Visnevskis · 8 comments

System Information
win 8.1x64, 3x gtx580

Blender Version
2.79a

Short description of error
Either changing object pointers for multiple nodes or repeated changes of a single node object pointer registers as a single action for undo. Executing Undo reverts all the pointer changes simultaneously, regardless if there were 1 or 10 of them.

obj-ref.blend
Exact steps for others to reproduce the error

  • In the node editor, change the Object parameter of one, then another Texture Coordinate nodes.
  • Do Undo.
  • Object parameter of both changes gets undone.

If this is hard to correct due to some inherent property of particular parameter type, maybe when changing it, the node affected could get selected, as node selection seems to register with undo fine.

**System Information** win 8.1x64, 3x gtx580 **Blender Version** 2.79a **Short description of error** Either changing object pointers for multiple nodes or repeated changes of a single node object pointer registers as a single action for undo. Executing Undo reverts all the pointer changes simultaneously, regardless if there were 1 or 10 of them. [obj-ref.blend](https://archive.blender.org/developer/F2670011/obj-ref.blend) **Exact steps for others to reproduce the error** - In the node editor, change the Object parameter of one, then another Texture Coordinate nodes. - Do Undo. - Object parameter of both changes gets undone. If this is hard to correct due to some inherent property of particular parameter type, maybe when changing it, the node affected could get selected, as node selection seems to register with undo fine.

Added subscriber: @KonstantinsVisnevskis

Added subscriber: @KonstantinsVisnevskis
Member

Added subscriber: @lichtwerk

Added subscriber: @lichtwerk
Member

This is true for any pointer property afaics [changing any of these wont register in undo on first sight], so nothing particular to the Node editor.
This might be a known limitation, or a design decission, needs further clarification...

This is true for any pointer property afaics [changing any of these wont register in undo on first sight], so nothing particular to the Node editor. This might be a known limitation, or a design decission, needs further clarification...
Member

Added subscriber: @ideasman42

Added subscriber: @ideasman42
Member

@ideasman42 : is that something to be investigated further?

@ideasman42 : is that something to be investigated further?
Campbell Barton was assigned by Philipp Oeser 2018-06-19 16:01:22 +02:00
Member

Soo, looked into this a bit further and it seems like PROP_POINTER buttons indeed dont get undo pushes.
For a little detour: these are not flagged with UI_BUT_UNDO because they are of type UI_BTYPE_SEARCH_MENU (when they get defined via uiDefAutoButR )
Code is explicitly stating (here ) that

/* buttons with value >= UI_BTYPE_SEARCH_MENU don't get undo pushes */

as can be followed [here ]] and https:*developer.blender.org/diffusion/B/browse/master/source/blender/editors/interface/interface_handlers.c;668f39519cec669e970e136af020636794f927d3$741 (we dont get an uiAfterFunc with undostr, so no undo push [ https://developer.blender.org/diffusion/B/browse/master/source/blender/editors/interface/interface_handlers.c;668f39519cec669e970e136af020636794f927d3$844 | here ...)

If we actually allow SEARCH_MENU buttons [only the ones that represent PROP_POINTER] like in D3489
blender seems to go properly through undosys_step_encode, undosys_step_decode and I didnt run into problems yet.
(but it may very well be that I dont oversee all consequences this might have...)

I think @ideasman42 needs to have a look here though, current behavior could as well be by design and report could be closed...

Soo, looked into this a bit further and it seems like `PROP_POINTER` buttons indeed dont get undo pushes. For a little detour: these are not flagged with `UI_BUT_UNDO` because they are of type `UI_BTYPE_SEARCH_MENU` (when they get defined via [uiDefAutoButR ](https://developer.blender.org/diffusion/B/browse/master/source/blender/editors/interface/interface_utils.c;668f39519cec669e970e136af020636794f927d3$137)) Code is explicitly stating ([here ](https://developer.blender.org/diffusion/B/browse/master/source/blender/editors/include/UI_interface.h;668f39519cec669e970e136af020636794f927d3$281)) that > /* buttons with value >= UI_BTYPE_SEARCH_MENU don't get undo pushes */ as can be followed [here ]] and [[ https:*developer.blender.org/diffusion/B/browse/master/source/blender/editors/interface/interface_handlers.c;668f39519cec669e970e136af020636794f927d3$741 | here ]] (we dont get an `uiAfterFunc` with undostr, so no undo push [[ https://developer.blender.org/diffusion/B/browse/master/source/blender/editors/interface/interface_handlers.c;668f39519cec669e970e136af020636794f927d3$844 | here ](https:*developer.blender.org/diffusion/B/browse/master/source/blender/editors/interface/interface.c;668f39519cec669e970e136af020636794f927d3$3260)...) If we actually allow SEARCH_MENU buttons [only the ones that represent `PROP_POINTER`] like in [D3489](https://archive.blender.org/developer/D3489) blender seems to go properly through `undosys_step_encode`, `undosys_step_decode` and I didnt run into problems yet. (but it may very well be that I dont oversee all consequences this might have...) I think @ideasman42 needs to have a look here though, current behavior could as well be by design and report could be closed...

This issue was referenced by 6bb825e083

This issue was referenced by 6bb825e0837e5e090c32567d335fe677e33e5ab0

Changed status from 'Open' to: 'Resolved'

Changed status from 'Open' to: 'Resolved'
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#54580
No description provided.