Modernize (or Remove) GPencil Undo System #84703

Closed
opened 2021-01-14 11:25:09 +01:00 by Bastien Montagne · 6 comments

Current usage of ED_undo_gpencil_step from ed_undo_step_impl is logically broken in both undo_name and undo_index cases. It would only work (do something) in case undo_direction is valid, i.e. only when undoing/redoing one step (the ctrl-Z shortcut), not when undoing e.g. a step from the history.

However, this seems to not be an actual problem in practice, because from quick investigation, it looks like GPencil undo mode/code is never actually used (its global static undo_nodes list seems to always be empty when undoing or redoing, so ED_undo_gpencil_step never gets called).

What seems to happen is that undo_nodes is filled with one or two steps during interactive edit (stroke drawing etc.), but once the modal edit is done the whole undo_nodes is cleared and a regular memfile (aka global) undo step is stored instead.

This needs further investigation to fully assess current status of this code, and decide then whether it is worth integrating GPencil undo into modern undo system/stack (as hinted in current TODO comments in ed_undo_step_impl), or if we can get fully rid of it.

Current usage of `ED_undo_gpencil_step` from `ed_undo_step_impl` is logically broken in both `undo_name` and `undo_index` cases. It would only work (do something) in case `undo_direction` is valid, i.e. only when undoing/redoing one step (the `ctrl-Z` shortcut), not when undoing e.g. a step from the history. However, this seems to not be an actual problem in practice, because from quick investigation, it looks like GPencil undo mode/code is never actually used (its global static `undo_nodes` list seems to always be empty when undoing or redoing, so `ED_undo_gpencil_step` never gets called). What seems to happen is that `undo_nodes` is filled with one or two steps during interactive edit (stroke drawing etc.), but once the modal edit is done the whole `undo_nodes` is cleared and a regular memfile (aka global) undo step is stored instead. This needs further investigation to fully assess current status of this code, and decide then whether it is worth integrating GPencil undo into modern undo system/stack (as hinted in current TODO comments in `ed_undo_step_impl`), or if we can get fully rid of it.
Author
Owner

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

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

Added subscriber: @mont29

Added subscriber: @mont29

Added subscriber: @ZedDB

Added subscriber: @ZedDB

Seems like this could be modernizing the GP undo system: #95450

Seems like this could be modernizing the GP undo system: #95450
Author
Owner

Changed status from 'Confirmed' to: 'Archived'

Changed status from 'Confirmed' to: 'Archived'
Author
Owner

This task is no more relevant as-is.

This task is no more relevant as-is.
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
2 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#84703
No description provided.