Texture Painting with Paint mask enabled, (de)selecting faces causes a mess with texture slots. #81167

Closed
opened 2020-09-25 15:48:28 +02:00 by Vlado Tasner · 11 comments

System Information
Operating system: Windows-10-10.0.19041-SP0 64 Bits
Graphics card: GeForce GTX 1060 6GB/PCIe/SSE2 NVIDIA Corporation 4.5.0 NVIDIA 436.48

Blender Version
Broken: version: 2.90.1, branch: master, commit date: 2020-09-23 06:43, hash: 3e85bb34d0
Worked: 2.83.6
Apparently caused by 9582797d4b

Short description of error
Texture Painting with Paint mask enabled, using right click select, I went to deselect one face (shift Rclick), and the whole object "switched" to just one texture (the one assigned to first material).

Exact steps for others to reproduce the error
#81167.blend

  • Open File (should be in Texture Paint mode, Paint Mask selection is on)
  • Select a different face
  • all geometry part should switch to blue appaerance

steps from scratch:

  1. Have an object, let's say there are 3 cubes (same mesh, 1 object)
  2. Create 3 materials, Mat1 Mat2 Mat3, assign each material to their cubes
  3. Create 3 textures, Tex1 Tex2 Tex3. In material editor drag those textures to their respective materials (so you can see the texture in texture painting mode)
  4. Switch to Texture Painting
  5. Enable Paint mask
  6. Pain something on first cube. Only Tex1 should be affected
  7. Press Shift Right Click (using RClick select) to deselect one face, doesn't matter which cube
  8. Notice how Tex1 is showed on every cube
    8a) I cannot paint on any other cube except the one where Tex1 is actually supposed to be
  9. Tab into edit mode, Tab out, it's okay now.

I searched to find similar bug posted, didn't find any, I'm sorry if this is a duplicate or if it's known issue (glanced through those).

**System Information** Operating system: Windows-10-10.0.19041-SP0 64 Bits Graphics card: GeForce GTX 1060 6GB/PCIe/SSE2 NVIDIA Corporation 4.5.0 NVIDIA 436.48 **Blender Version** Broken: version: 2.90.1, branch: master, commit date: 2020-09-23 06:43, hash: `3e85bb34d0` Worked: 2.83.6 Apparently caused by 9582797d4b **Short description of error** Texture Painting with Paint mask enabled, using right click select, I went to deselect one face (shift Rclick), and the whole object "switched" to just one texture (the one assigned to first material). **Exact steps for others to reproduce the error** [#81167.blend](https://archive.blender.org/developer/F8931752/T81167.blend) - Open File (should be in Texture Paint mode, Paint Mask selection is on) - Select a different face - all geometry part should switch to blue appaerance steps from scratch: 1) Have an object, let's say there are 3 cubes (same mesh, 1 object) 2) Create 3 materials, Mat1 Mat2 Mat3, assign each material to their cubes 3) Create 3 textures, Tex1 Tex2 Tex3. In material editor drag those textures to their respective materials (so you can see the texture in texture painting mode) 4) Switch to Texture Painting 5) Enable Paint mask 6) Pain something on first cube. Only Tex1 should be affected 7) Press Shift Right Click (using RClick select) to deselect one face, doesn't matter which cube 8) Notice how Tex1 is showed on every cube 8a) I cannot paint on any other cube except the one where Tex1 is actually supposed to be 9) Tab into edit mode, Tab out, it's okay now. I searched to find similar bug posted, didn't find any, I'm sorry if this is a duplicate or if it's known issue (glanced through those).
Author

Added subscriber: @Wicked100

Added subscriber: @Wicked100
Member

Added subscriber: @lichtwerk

Added subscriber: @lichtwerk
Member

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

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

Can confirm, wil check on this.

Can confirm, wil check on this.
Member

Added subscriber: @fclem

Added subscriber: @fclem
Member

Apparently caused by 8084b7e6e2

CC @fclem

Apparently caused by 8084b7e6e2 CC @fclem
Member

Added subscriber: @Jeroen-Bakker

Added subscriber: @Jeroen-Bakker
Member

I came to a different bisect: 9582797d4b Also checked that the commit before this one still worked.

I came to a different bisect: 9582797d4b Also checked that the commit before this one still worked.
Jeroen Bakker self-assigned this 2020-10-06 16:35:45 +02:00
Member

Cause is that the per material index buffers (cache->surface_per_mat ibuf) is reset and contain all the indexes. They aren't rebuild to contain the indexes per material anymore.
Researching if this has to do with DRW_ibo_request(cache->surface_per_mat- [x], &mbufcache->ibo.tris); in draw_cache_impl_mesh.c.

Issue can be fixed by invalidating the whole draw cache when changing masks, but that makes the existing optimization obsolete. I am looking into reusing the index buffers similar we do for custom data masks changes.

Cause is that the per material index buffers (`cache->surface_per_mat` ibuf) is reset and contain all the indexes. They aren't rebuild to contain the indexes per material anymore. Researching if this has to do with `DRW_ibo_request(cache->surface_per_mat- [x], &mbufcache->ibo.tris);` in `draw_cache_impl_mesh.c`. Issue can be fixed by invalidating the whole draw cache when changing masks, but that makes the existing optimization obsolete. I am looking into reusing the index buffers similar we do for custom data masks changes.

This issue was referenced by 1ceb91d1b3

This issue was referenced by 1ceb91d1b3947fda67a70a2eff785a964e625ca2
Member

Changed status from 'Confirmed' to: 'Resolved'

Changed status from 'Confirmed' to: 'Resolved'
Thomas Dinges added this to the 2.91 milestone 2023-02-08 16:20:22 +01:00
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#81167
No description provided.