Browse Source

Fixed mesh importing when multiple materials are present

Daniel J. Ramirez 7 years ago
parent
commit
62eda56e67
1 changed files with 6 additions and 4 deletions
  1. 6 4
      scene/resources/mesh.cpp

+ 6 - 4
scene/resources/mesh.cpp

@@ -1097,11 +1097,13 @@ void ArrayMesh::_bind_methods() {
 }
 
 void ArrayMesh::reload_from_file() {
-	for (int i = 0; i < get_surface_count(); i++) {
-		surface_remove(i);
-	}
+	VisualServer::get_singleton()->mesh_clear(mesh);
+	surfaces.clear();
+	clear_blend_shapes();
+
 	Resource::reload_from_file();
-	String path = get_path();
+
+	_change_notify();
 }
 
 ArrayMesh::ArrayMesh() {