From 3b6430ef831d0abcc8a9754fc95992a214fd5ebd Mon Sep 17 00:00:00 2001 From: Marc Gilleron Date: Sun, 13 Aug 2017 00:08:53 +0200 Subject: [PATCH] Fix cubic mesher not setting up mesh materials --- voxel_mesher.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/voxel_mesher.cpp b/voxel_mesher.cpp index 52f7adc..49429e7 100644 --- a/voxel_mesher.cpp +++ b/voxel_mesher.cpp @@ -132,7 +132,6 @@ void VoxelMesher::set_library(Ref library) { void VoxelMesher::set_material(Ref material, unsigned int id) { ERR_FAIL_COND(id >= MAX_MATERIALS); _materials[id] = material; - _surface_tool[id].set_material(material); } Ref VoxelMesher::get_material(unsigned int id) const { @@ -185,7 +184,8 @@ Ref VoxelMesher::build(const VoxelBuffer & buffer, unsigned int chann for (unsigned int i = 0; i < MAX_MATERIALS; ++i) { _surface_tool[i].begin(Mesh::PRIMITIVE_TRIANGLES); - } + _surface_tool[i].set_material(_materials[i]); + } float baked_occlusion_darkness; if (_bake_occlusion)