Fix materials shown under wrong category

This commit is contained in:
Marc Gilleron 2021-08-01 15:40:41 +01:00
parent 6d6d8fb368
commit bab5436de7

View File

@ -62,6 +62,8 @@ bool VoxelTerrain::_get(const StringName &p_name, Variant &r_ret) const {
}
void VoxelTerrain::_get_property_list(List<PropertyInfo> *p_list) const {
// Need to add a group here because otherwise it appears under the last group declared in `_bind_methods`
p_list->push_back(PropertyInfo(Variant::NIL, "Materials", PROPERTY_HINT_NONE, "", PROPERTY_USAGE_GROUP));
for (unsigned int i = 0; i < VoxelMesherBlocky::MAX_MATERIALS; ++i) {
p_list->push_back(PropertyInfo(
Variant::OBJECT, "material/" + itos(i), PROPERTY_HINT_RESOURCE_TYPE, "ShaderMaterial,SpatialMaterial"));