Fix SpatialMaterial support for the merger libraries.

This commit is contained in:
Relintai 2022-02-09 00:34:54 +01:00
parent e9269bc0b3
commit 1486959067
2 changed files with 24 additions and 0 deletions

View File

@ -331,6 +331,18 @@ void VoxelLibraryMerger::_setup_material_albedo(const int material_index, const
Ref<SpatialMaterial> 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;

View File

@ -670,6 +670,18 @@ void VoxelLibraryMergerPCM::_setup_material_albedo(const int material_index, con
Ref<SpatialMaterial> 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;