mirror of
https://github.com/godotengine/godot.git
synced 2026-01-05 06:11:29 +03:00
Fix GLTF crash when the material is not set.
Sometimes there are meshes that doesn't have materials, so make sure to check this case before extracting the name.
This commit is contained in:
@@ -2796,7 +2796,7 @@ Error GLTFDocument::_parse_meshes(Ref<GLTFState> state) {
|
||||
mat = mat3d;
|
||||
}
|
||||
|
||||
import_mesh->add_surface(primitive, array, morphs, Dictionary(), mat, mat->get_name());
|
||||
import_mesh->add_surface(primitive, array, morphs, Dictionary(), mat, mat.is_valid() ? mat->get_name() : String());
|
||||
}
|
||||
|
||||
Vector<float> blend_weights;
|
||||
|
||||
Reference in New Issue
Block a user