dd72297680dee18304e437eb32cf23471a01217c
The boolean modifier Exact solver has a solver option "Materials" with choices "Index Based" and "Transfer". The former uses only materials that were in the first operand object/mesh. The Transfer option copies new materials as needed from other object/mesh operands and uses those on the pieces of faces from those operands that survive into the output. Users very often use boolean to cut away from a main mesh, and in such cases usually don't care about the materials on the cutter operand, and don't want materials from them transferred, so the "Index Based" choice is the default in the modifier. It was regarded as in important bug/lack that the new Manifold solver did not have such an option, so this commit adds one. The Boolean Geometry Node at the moment does not have an option and always uses the "Transfer" method, for all three solvers. It is a matter of discussion whether such an option should be added in the node also, so this commit does not include such a change. The Manifold solver, up to this point, ignored the material_remaps argument and relied on the realize_instance code to remap the materials (it uses the Transfer strategy). This change overrides that remapping with the explicit mapping handed in through the API, if the mapping has non-zero size. Since the old way (ignoring the mapping argument) worked fine for the Boolean Geometry Node, I changed that code to make the map have size zero in the node, in the case that the solver is Manifold. This is a little hacky but I couldn't think of anything much better. Long term it might be nice to have the internal boolean API not take in remaps at all, but rather a remapping strategy choice. One thing that makes that difficult right now is that the modifier can get materials from either the object or the mesh (at least that used to be true) and the internal boolean api only knows about meshes. Another thing that would have made this task easier (for me) would be to have realize_instances take in a material mapping strategy as a parameter.
…
Blender
Blender is the free and open source 3D creation suite. It supports the entirety of the 3D pipeline—modeling, rigging, animation, simulation, rendering, compositing, motion tracking and video editing.
Project Pages
Development
License
Blender as a whole is licensed under the GNU General Public License, Version 3. Individual files may have a different but compatible license.
See blender.org/about/license for details.
Description
Languages
C++
78%
Python
14.9%
C
2.9%
GLSL
1.9%
CMake
1.2%
Other
0.9%
