Python scripts calling bpy.ops.paint.image_paint operates undo steps for "individual calls" rather than "all calls" during modal operation #54496
Labels
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
No due date set.
Dependencies
No dependencies set.
Reference: blender/blender#54496
Loading…
Reference in New Issue
No description provided.
Delete Branch "%!s(<nil>)"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
System Information
5820K and GTX970
Windows 10
Blender Version
Latest daily build (but same problem in earlier ones too)
Short description of error
I have a modal operator which uses image_paint function.
After using it, if I do an undo, I would expect all paint operations during modal operation to be undone.
However every call to image_paint adds another item to the undo list which means I have to undo through every mouse move.
If I have moved the mouse more than (max undo items) then I can't get back to the position before I started the operator at all (making the undo pointless)
This doesn't seem to be the consistent with other modal operator. For example, in the docs https://docs.blender.org/api/blender_python_api_current/bpy.types.Operator.html the modal excecution example (with the addition of UNDO added to bl_options) moves a cube. Many changes can be made to the position of the cube during the modal operation. However one undo (correctly in my option) puts the cube back in the original place before the operator is run.
I did try using UNDO_GROUPED in my bl_options as well as UNDO - neither worked.
If I am doing something wrong or stupid in my code - sorry!
Exact steps for others to reproduce the error
Load the attached scene.
Press Run Script
Hover over cube.
Right click
Press space
Type in Simple Paint Operator to activate operator
Press mouse button to stop the operator
Try Undoing - it undo things one mouse move at a time
modal_paint.blend1
Added subscriber: @RevDr
Undo with bpy.ops.paint.image_paint operates for individual calls rather than all callsto Undo with bpy.ops.paint.image_paint operates for "individual calls" rather than "all calls" during modal operationUndo with bpy.ops.paint.image_paint operates for "individual calls" rather than "all calls" during modal operationto Python scripts calling bpy.ops.paint.image_paint operates undo steps for "individual calls" rather than "all calls" during modal operationAdded subscriber: @ZedDB
I can reproduce this on 2.8 too.
Added subscriber: @ideasman42
Added subscriber: @dr.sybren
Please always report an exact version number.
I can't reproduce this as-is, when trying to paint Blender tells me "Missing Textures, detected!".
@ideasman42 Can you tell whether this is a bug or a known limitation? It looks like the latter to me.
Hi,
That scene was originally made for 2.79 which causes the "missing textures, detected" error on latest version.
I have updated the scene to work on today's build :
2.83Alpha - Data 2020-02-04 11:40 Hash
cd0a028624
and can confirm the issue still exists.
Updated scene file is attached.modal_paint_2.blend
Given it is no longer 2.79, the process to cause problem is now....
Load the attached scene.
Press Run Script
Hover over cube.
Press F3
Type in Simple Modal Operator to activate operator
Move mouse around to paint on cube
Press mouse button to stop the operator
Try Undoing - it undo things one mouse move at a time