diff --git a/library/voxel_library_merger.cpp b/library/voxel_library_merger.cpp index 401fce4..6937319 100644 --- a/library/voxel_library_merger.cpp +++ b/library/voxel_library_merger.cpp @@ -331,6 +331,18 @@ void VoxelLibraryMerger::_setup_material_albedo(const int material_index, const Ref spmat; + switch (material_index) { + case MATERIAL_INDEX_VOXELS: + spmat = material_get(i); + break; + case MATERIAL_INDEX_LIQUID: + spmat = liquid_material_get(i); + break; + case MATERIAL_INDEX_PROP: + spmat = prop_material_get(i); + break; + } + if (spmat.is_valid()) { spmat->set_texture(SpatialMaterial::TEXTURE_ALBEDO, texture); return; diff --git a/library/voxel_library_merger_pcm.cpp b/library/voxel_library_merger_pcm.cpp index 4b10d88..3a63ca9 100644 --- a/library/voxel_library_merger_pcm.cpp +++ b/library/voxel_library_merger_pcm.cpp @@ -670,6 +670,18 @@ void VoxelLibraryMergerPCM::_setup_material_albedo(const int material_index, con Ref spmat; + switch (material_index) { + case MATERIAL_INDEX_VOXELS: + spmat = material_get(i); + break; + case MATERIAL_INDEX_LIQUID: + spmat = liquid_material_get(i); + break; + case MATERIAL_INDEX_PROP: + spmat = prop_material_get(i); + break; + } + if (spmat.is_valid()) { spmat->set_texture(SpatialMaterial::TEXTURE_ALBEDO, texture); return;