Boolean merges CustomData inconsistently (UVs, VCols), breaks UV Map Node #68732

Open
opened 2019-08-16 15:25:36 +02:00 by Sebastian Koenig · 9 comments

System Information
Operating system: Linux-5.0.0-25-generic-x86_64-with-Ubuntu-19.04-disco 64 Bits
Graphics card: GeForce GTX 1080/PCIe/SSE2 NVIDIA Corporation 4.5.0 NVIDIA 430.34

Blender Version
Broken: version: 2.81 (sub 2), branch: master, commit date: 2019-08-16 08:35, hash: bdf8450713
Worked: (optional)

Short description of error
The UV Map of an object with Boolean Modifier doesn't work when the UV is assigned to the texture with the UV Map node.

Exact steps for others to reproduce the error
Open this file:
boolean_uv_map.blend
The UV layout of the bigger cube is not used. Once you unplug the custom UV Map node in the shader, the UV Map works again. It also works when you disable the Boolean Modifier.

**System Information** Operating system: Linux-5.0.0-25-generic-x86_64-with-Ubuntu-19.04-disco 64 Bits Graphics card: GeForce GTX 1080/PCIe/SSE2 NVIDIA Corporation 4.5.0 NVIDIA 430.34 **Blender Version** Broken: version: 2.81 (sub 2), branch: master, commit date: 2019-08-16 08:35, hash: `bdf8450713` Worked: (optional) **Short description of error** The UV Map of an object with Boolean Modifier doesn't work when the UV is assigned to the texture with the UV Map node. **Exact steps for others to reproduce the error** Open this file: [boolean_uv_map.blend](https://archive.blender.org/developer/F7667328/boolean_uv_map.blend) The UV layout of the bigger cube is not used. Once you unplug the custom UV Map node in the shader, the UV Map works again. It also works when you disable the Boolean Modifier.
Author
Member

Added subscriber: @sebastian_k

Added subscriber: @sebastian_k

#72539 was marked as duplicate of this issue

#72539 was marked as duplicate of this issue

Added subscriber: @capnm

Added subscriber: @capnm

This only works if you use the same uvmap name as the uvmap of the cutter object.
If you apply the boolean modifier, you can see that both uvmaps are merged into new one. The problem is that both, the old destroyed uvmap and the new one with the name of the cutter uvmap are preserved here.

image.png

The UV Map node node only reveals the bug:

image.png

This only works if you use the same uvmap name as the uvmap of the cutter object. If you apply the boolean modifier, you can see that both uvmaps are merged into new one. The problem is that both, the old destroyed uvmap and the new one with the name of the cutter uvmap are preserved here. ![image.png](https://archive.blender.org/developer/F7668772/image.png) The UV Map node node only reveals the bug: ![image.png](https://archive.blender.org/developer/F7668850/image.png)
Member

Added subscriber: @lichtwerk

Added subscriber: @lichtwerk
Member

I also think the data should be merged into the layers of the source object (so the UVMap node would keep working).

For UVs, this seems to go the other way around, VCols are seemingly fine though?
Havent checked the exact logic of CustomData_bmesh_merge and friends ( CustomData_merge, CustomData_update_typemap), I think this could be improved (to the point that this feels like a bug)

We could just flip the order the order of BM_mesh_bm_from_me in the modifier like
P1088: #68732 snippet



diff --git a/source/blender/modifiers/intern/MOD_boolean.c b/source/blender/modifiers/intern/MOD_boolean.c
index ea42ddb03f4..53f112c3f78 100644
--- a/source/blender/modifiers/intern/MOD_boolean.c
+++ b/source/blender/modifiers/intern/MOD_boolean.c
@@ -189,7 +189,7 @@ static Mesh *applyModifier(ModifierData *md, const ModifierEvalContext *ctx, Mes
                           }));
 
       BM_mesh_bm_from_me(bm,
-                         mesh_other,
+                         mesh,
                          &((struct BMeshFromMeshParams){
                              .calc_face_normal = true,
                          }));
@@ -204,7 +204,7 @@ static Mesh *applyModifier(ModifierData *md, const ModifierEvalContext *ctx, Mes
       }
 
       BM_mesh_bm_from_me(bm,
-                         mesh,
+                         mesh_other,
                          &((struct BMeshFromMeshParams){
                              .calc_face_normal = true,
                          }));

But this then flips the VCols...
So real solution is probably in smarter way of handling CustomData merging (as mentioned above)

I also think the data should be merged into the layers of the source object (so the UVMap node would keep working). For UVs, this seems to go the other way around, VCols are seemingly fine though? Havent checked the exact logic of `CustomData_bmesh_merge` and friends ( `CustomData_merge`, `CustomData_update_typemap`), I think this could be improved (to the point that this feels like a bug) We could just flip the order the order of BM_mesh_bm_from_me in the modifier like [P1088: #68732 snippet](https://archive.blender.org/developer/P1088.txt) ``` diff --git a/source/blender/modifiers/intern/MOD_boolean.c b/source/blender/modifiers/intern/MOD_boolean.c index ea42ddb03f4..53f112c3f78 100644 --- a/source/blender/modifiers/intern/MOD_boolean.c +++ b/source/blender/modifiers/intern/MOD_boolean.c @@ -189,7 +189,7 @@ static Mesh *applyModifier(ModifierData *md, const ModifierEvalContext *ctx, Mes })); BM_mesh_bm_from_me(bm, - mesh_other, + mesh, &((struct BMeshFromMeshParams){ .calc_face_normal = true, })); @@ -204,7 +204,7 @@ static Mesh *applyModifier(ModifierData *md, const ModifierEvalContext *ctx, Mes } BM_mesh_bm_from_me(bm, - mesh, + mesh_other, &((struct BMeshFromMeshParams){ .calc_face_normal = true, })); ``` But this then flips the VCols... So real solution is probably in smarter way of handling CustomData merging (as mentioned above)
Philipp Oeser changed title from UV layout doesn't work with Boolean and UV Map Node to Boolean merges CustomData inconsistently (UVs, VCols), breaks UV Map Node 2019-08-28 22:14:18 +02:00

Added subscribers: @crantisz, @lateasusual

Added subscribers: @crantisz, @lateasusual
Member

Added subscriber: @HooglyBoogly

Added subscriber: @HooglyBoogly
Member

I can confirm that this is still an issue with the Exact boolean method.

I can confirm that this is still an issue with the Exact boolean method.
Philipp Oeser removed the
Interest
Modeling
label 2023-02-09 15:29:40 +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
6 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#68732
No description provided.