Page MenuHome

Undo steps with texture paint break across memfile steps
Open, Confirmed, HighPublic


Texture paint undo steps don't work properly when mixed with memfile undo (object mode operations).

  • Default cube.
  • Set texture paint mode, add 'Base Color' slot for painting.
  • Make one stroke.

  • Undo everything, redo everything.
  • All correct.

Now switch to object mode and undo, notice the image has been cleared.

Note that this is more of a limit in how image undo works than some mistake in the code. since 2.7x never supported this.

Image painting is an exception that needs special handling since it has undo data that exists outside global undo.

Reporting because this should be fixed before 2.8x release, or worse case we could limit texture paint undo/redo to the current painting session as 2.7x (would be a shame, but better then loosing the users work).



Event Timeline

Campbell Barton (campbellbarton) updated the task description. (Show Details)
Campbell Barton (campbellbarton) renamed this task from Texture paint steps break across memfile steps to Undo steps with texture paint break across memfile steps.
Campbell Barton (campbellbarton) triaged this task as Confirmed, High priority.

Strange that if I do UNDO again after object mode + UNDO, the image is back. For the records, tested with rBeff3728db912.

Has this bug already been fixed? I can't reproduce with the described steps.

Looked into this recently, the painting undo stack now works across mem-file undo steps in some situations (resolved rB1d7be99ba4886dcf95a72a8597098e109dc10f95), however there is still a problem.

Even though mem-file undo attempts to keep Image.cache between undo steps, there are still times when it's cleared.

This clears the ImBuf which is the current in-memory state of the image.

I'm not sure why this only happens in some cases, needs further investigation.

Can't reproduce this with Blender 2.81 build from 14th August later build and with Blender 2.80 last build

Operating system: Windows-10-10.0.18362 64 Bits
Graphics card: Radeon RX 580 Series ATI Technologies Inc. 4.5.13570 Core Profile Context 19.8.1 26.20.13001.29010

Thanks for checking.

This problem happens far less often then it used to, but it can still happen, so keeping this open.