How to add texture to the new face made by boolean operation?

How can I add material or texture to the new face( B ) made by boolean difference operation?

Here is the example pic, A is the original face that has material.
B is the new face made by using boolean.

1 Like

Well, it comes textured-- with the same material as the rest of the cube.

What do you want? A different material?

You’re not going to be able to assign materials without applying the boolean. (Would be pretty cool if there was a material assign modifier, too bad.)

Which makes it kinda tricky to dynamically create a new material for the cut faces.

One thing that comes to mind is that booleans don’t assign any created verts to any vertex groups. Last I checked, at least. So you could use that to make a vertex modulated uv warp modifier after the boolean (on some add UV slot) and then check the UV in the mats. If you set all faces’ UVs to 0,0 and then warp, you could just check to see if UV == 0,0 to identify that it was a newly created face. (Have to be kind of careful, because it will interpolate across faces with both old and new verts, so you need to design your test based around that.)

Untested though. Not entirely sure how booleans decide to assign UV for new verts, although it looks like they do, and it looks like they wouldn’t do anything unexpected on a map where everything was mapped to 0,0.

Yes, i want to assign a new material to it while not applying the modifier.
But i find if you have a new material in the material slot not applying to any vertex/line/face, the rim(newly created face ) will automatically use it as material.
Dont know if tha’s just me…
gonna test it few more times
Thanks for replying!

It is possible to use a different texture for boolean cutting through Vertex Color, but this can only do that using the same material tree.

You fill in the vertex color completely black for one object and completely white for another. Just select a color on Vertex Paint and Shift+K.

Then you use the Attribute node and connect to the Fac of some Mix node.

BooleanCut.blend (579.1 KB)

1 Like

Wow, that seems be a great solution!
it doesn’t have to B&W right? just two different color should work?

1 Like

Sounds like a Blender limitation if this is not possible in an easier fashion. Say a worn piece of metal with a new shiny cut hole through it based on the material of the cutting piece. Should be possible to implement though; newly created faces around the cutting piece that are coplanar to the cutting piece faces. This is so trivial to do with software that support CSG primitives. In fact here they have a checkbox to ignore material :slight_smile:

You can try to paint in other colors, but B&W and grayscale are the most ideal if you plug the Color to Fac input. For example, if you paint Vertex Color to gray, it will result in a mix between the two textures.

It is even possible to fade if you paint some vertices.

Vertex Color of “Cube for Boolean”
blender_2020-02-17_03-18-20

Result
blender_2020-02-17_03-17-25

1 Like

Ok, got it, thanks for reminding!

1 Like

You’re welcome! :smile:

By default, Blender assigns the material of the second object to the result of the boolean…
You only need to add a material slot to the original object, with the material of the second object.

3 Likes

Thanks, i do find this work.
But it seems you cannot change it ?

You need to change it in the second object, since the Boolean modifier handles this automatically.

If you want a new material instead of the material of the second object, you need to add the slot, ‘apply’ the modifier, and then change the material in that slot.

1 Like

Thank you,
Bookmarked already!