Page MenuHome

Boolean merges CustomData inconsistently (UVs, VCols), breaks UV Map Node
Open, Confirmed, MediumPublic


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: rBbdf8450713be
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:

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.



Event Timeline

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.

The UV Map node node only reveals the bug:

Philipp Oeser (lichtwerk) lowered the priority of this task from Needs Triage by Developer to Confirmed, Medium.Aug 28 2019, 10:12 PM

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

3diff --git a/source/blender/modifiers/intern/MOD_boolean.c b/source/blender/modifiers/intern/MOD_boolean.c
4index ea42ddb03f4..53f112c3f78 100644
5--- a/source/blender/modifiers/intern/MOD_boolean.c
6+++ b/source/blender/modifiers/intern/MOD_boolean.c
7@@ -189,7 +189,7 @@ static Mesh *applyModifier(ModifierData *md, const ModifierEvalContext *ctx, Mes
8 }));
10 BM_mesh_bm_from_me(bm,
11- mesh_other,
12+ mesh,
13 &((struct BMeshFromMeshParams){
14 .calc_face_normal = true,
15 }));
16@@ -204,7 +204,7 @@ static Mesh *applyModifier(ModifierData *md, const ModifierEvalContext *ctx, Mes
17 }
19 BM_mesh_bm_from_me(bm,
20- mesh,
21+ mesh_other,
22 &((struct BMeshFromMeshParams){
23 .calc_face_normal = true,
24 }));

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

Philipp Oeser (lichtwerk) renamed this task from UV layout doesn't work with Boolean and UV Map Node to Boolean merges CustomData inconsistently (UVs, VCols), breaks UV Map Node.Aug 28 2019, 10:14 PM