Page MenuHome

TEXTURE PAINT tab BUG- Undo a simple PAINT operation using CTRL-Z and it removes entire TEXTURE IMAGE-Workarounds and Thorough Steps to Repeatability BELOW.
Closed, ResolvedPublic


System Information
Operating system: Windows 10
Graphics card: Nvidia 900 series

Latest Blender 2.8 (c59370bf643f)
Undoing a Paint operation in Texture Paint Editor using (CTRL-Z) on a given texture results in removal of texture (object goes pink) and requires a multiple step workaround to get texture back.

note: Program crashed sometimes during this exact process. It is not every time, but it has occurred more than twice when repeating the steps below so it warrants reporting. During crash, the Entire program shuts down and closes instantly.


LOAD Program
A-Select All, Delete (clear grid)
Shift-A-select mesh- monkey (suzanne)

Click on UV editing tab (default unwrap is good, so do not unwrap)
In UV editor Header, click "+ New" and name a new image texture. Ex ("Bob"). When Menu Popup appears, Keep all defaults but select "UV grid" for Generated Type (This puts a checker board on the UVs on the left but does not affect the object yet).

Click on Shading Tab
Go to Properties Editor-Materials Icon on the right side. Add Default Material ("+NEW") in the Add Material Slot.

In the Shader Node Editor (bottom screen), click on BSDF node to select. Then press delete on keyboard.

In Same Shader Node Editor, go to ADD->texture->Image Texture
Inside Image Texture node, use drop down to select "Bob" UV grid image texture you just made in the UV editor.
Connect Color Output of "Bob" IMAGE TEXTURE Node to the Surface Input of Material Output node. You should see the UV Grid image wrapped on monkey at this point (LookDev or Render should be selected in the upper right of the 3D viewer).


Now Click on TEXTURE PAINT Tab on top screen. Monkey should be pink to indicate no texture applied.

On the right side In Properties Editor->Tools, you should see texture "bob". Click on it to select it. Monkey should then be wrapped in UV checkerboard texture.
Now paint in Texture Paint window on the checkered Monkey. Just click and drag over Object. The paint is white default and the painting operation is slightly laggy. But what if I want to simply UNDO that LAST PAINT OPERATION?

---------------------------HERE IS WHERE THE PROBLEM OCCURS----------------------------------


Now type "CTRL-Z" ONCE to revert back one operation to before you painted. INSTEAD OF GOING BACK ONE OPERATION TO THE CLEAN CHECKERBOARD WITHOUT THE PAINT, Monkey goes pink again (loses IMAGE TEXTURE). If you click on "MODE" dropdown in Properties->Tools->Texture Slots and select "Material", "Bob" texture is available to click on. BUT....CLICKING ON IT makes object BLACK with no uv grid texture.


1.)When you FIRST CTRL-Z after painting on object to undo AND it goes pink (texture removed). CLICK ON UV EDITING TAB NEXT to TEXTURE PAINT TAB on top screen UI (CYCLING to another arbitrary tab and then BACK to the TEXTURE TAB seems to RESET TEXTURE PAINT TAB. CLICK BACK TO TEXTURE PAINT TAB. DOING THIS appears to reset the PROPERTIES EDITOR-TOOLS-TEXTURE SLOTS because NOW "BOB" texture should now be available and WILL NOT make the OBJECT turn black. Click on IT and YOU GET the Checkerboard UV Image TEXTURE.

2.)If you don't use the cycling to one tab and back to texture paint tab method, and choose "bob", the object goes black and you must INSTEAD press CTRL-Z several times to get back to the checkerboard image texture. The object window is ALSO no longer IN TEXURE PAINT WINDOW and is now 3d view, object mode, so you still need to use cycle method (click on another tab and then back to TEXTURE PAINT tab to reset the workspace).

This seems like A LOT to go through just to UNDO one little paint operation on a TEXTURE. Hope this helps!

Event Timeline

I ran into the same issue where when painting in texture paint mode with the first stroke being painted onto the model, then hitting ctrl+z to undo, the material is switched to another (model becomes pink) or the materials texture image is replace or switched.

My work around to fix the issue after using the hotkey shortcut is to re-select the material in the material panel and also going to either the uv editor or image editor panel and reloading the image. This usually brings everything back.

At this point, I just use the main menu's "Edit > Undo" without using the hotkey for any "first stroke" scenarios. Undo hotkeys are fine for anything beyond the first stroke.

Developer note:

The cause of the issue is loading global undo is using a GPUTexture that is then freed by (setup_app_data -> BKE_blender_globals_clear).

Both source and destination are the same: ima->gputexture[i] = newimaadr(fd, ima->gputexture[i]);

Relates to T60809, which I'd like to fix first.

Sebastian Parborg (zeddb) lowered the priority of this task from Needs Triage by Developer to Confirmed, Medium.

I'll mark this as confirmed then.

@jason hightower (bogeystudios) could you re-test this bug? Some other fixes have been applied and I can no-longer redo the error you've reported.

Campbell Barton (campbellbarton) lowered the priority of this task from Confirmed, Medium to Needs Information from User.Jan 29 2019, 6:46 AM

@Campbell Barton (campbellbarton) I can still reproduce undo issues with texture paint with the example in T60954. Should I merge it in?

I can confirm this issue is still present in current build a1ae04d15a9f

Simpler repro procedure:

  1. open attached .blend file
  2. Make 1 paint stroke on cube
  3. Press Ctrl-Z
  4. Cube goes pink

At least in this case, this seems to happen when undoing the *first* paint operation.