Regression: Deleting a material slot in 3.4 assigns faces to the material below instead of the material above #103051

Closed
opened 2022-12-09 01:17:44 +01:00 by unizen · 10 comments

Operating system: Windows 10

Version:
Broken: 3.4
Worked: 3.3 and earlier

Description:

Deleting a material slot will re-assign the faces previously assigned to that material to the material in the slot below, instead of the slot above, as in previous versions of Blender.

I see no good reason for this change, and it will likely confuse anyone who is used to combining materials the old way. So I'm assuming it is a bug and not an intended change.

Steps to reproduce:

On the default cube, create 3 material slots with 3 different materials.
Set a different viewport color for each material for easier visualization.
In edit mode, select all faces and assign to the material in the middle slot.
In object mode, remove the middle material slot.
Notice that the faces of the mesh have been re-assigned to the material in the bottom slot instead of the top slot

(doing these same steps in 3.3 or earlier you will notice the faces have been assigned to the material in the top slot)

Operating system: Windows 10 Version: Broken: 3.4 Worked: 3.3 and earlier Description: Deleting a material slot will re-assign the faces previously assigned to that material to the material in the slot below, instead of the slot above, as in previous versions of Blender. I see no good reason for this change, and it will likely confuse anyone who is used to combining materials the old way. So I'm assuming it is a bug and not an intended change. Steps to reproduce: On the default cube, create 3 material slots with 3 different materials. Set a different viewport color for each material for easier visualization. In edit mode, select all faces and assign to the material in the middle slot. In object mode, remove the middle material slot. Notice that the faces of the mesh have been re-assigned to the material in the bottom slot instead of the top slot (doing these same steps in 3.3 or earlier you will notice the faces have been assigned to the material in the top slot)
Author

Added subscriber: @unizen

Added subscriber: @unizen
Member

Added subscriber: @OmarEmaraDev

Added subscriber: @OmarEmaraDev
Member

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

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

Looking into it.

Looking into it.
Omar Emara changed title from [3.4] Deleting a material slot assigns faces to the material below instead of the material above to Regression: Deleting a material slot in 3.4 assigns faces to the material below instead of the material above 2022-12-09 10:09:47 +01:00
Member

Added subscriber: @HooglyBoogly

Added subscriber: @HooglyBoogly
Member

I haven't bisected, but this is most likely caused by f1c0249f34.
Maybe just >= instead of >?

diff --git a/source/blender/blenkernel/intern/mesh.cc b/source/blender/blenkernel/intern/mesh.cc
index deaa9aec3f7..c8589faf16a 100644
--- a/source/blender/blenkernel/intern/mesh.cc
+++ b/source/blender/blenkernel/intern/mesh.cc
@@ -1353,7 +1353,7 @@ void BKE_mesh_material_index_remove(Mesh *me, short index)
   }
   MutableVArraySpan<int> indices_span(material_indices.varray);
   for (const int i : indices_span.index_range()) {
-    if (indices_span[i] > 0 && indices_span[i] > index) {
+    if (indices_span[i] > 0 && indices_span[i] >= index) {
       indices_span[i]--;
     }
   }
I haven't bisected, but this is most likely caused by f1c0249f34. Maybe just >= instead of >? ``` diff --git a/source/blender/blenkernel/intern/mesh.cc b/source/blender/blenkernel/intern/mesh.cc index deaa9aec3f7..c8589faf16a 100644 --- a/source/blender/blenkernel/intern/mesh.cc +++ b/source/blender/blenkernel/intern/mesh.cc @@ -1353,7 +1353,7 @@ void BKE_mesh_material_index_remove(Mesh *me, short index) } MutableVArraySpan<int> indices_span(material_indices.varray); for (const int i : indices_span.index_range()) { - if (indices_span[i] > 0 && indices_span[i] > index) { + if (indices_span[i] > 0 && indices_span[i] >= index) { indices_span[i]--; } } ```
Hans Goudey self-assigned this 2022-12-09 16:48:58 +01:00
Member

Agh, such a small thing! Thanks for looking into it @OmarEmaraDev and thanks for the report @unizen.

Agh, such a small thing! Thanks for looking into it @OmarEmaraDev and thanks for the report @unizen.

This issue was referenced by ef40604b87

This issue was referenced by ef40604b87fa4d1b8231a9813363392026001540

This issue was referenced by bdd34f4fa2

This issue was referenced by bdd34f4fa25c7382bac452db82af639bab453046
Member

Changed status from 'Confirmed' to: 'Resolved'

Changed status from 'Confirmed' to: 'Resolved'
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#103051
No description provided.