Skip to content

Commit

Permalink
Fixed set_name error when importing OBJ files.
Browse files Browse the repository at this point in the history
A different method was used to fix the error in
4c69b61, but it had the
unintentional side effect of shifting the names of the meshes over
by one.

Instead, this method simply does not attempt to add a mesh to the
list (upon encountering an "o" command) if a vertex has not been
registered yet. Much nicer :)
  • Loading branch information
drwhut committed Sep 29, 2023
1 parent fa91cc7 commit 5268128
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion editor/import/resource_importer_obj.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -361,7 +361,7 @@ static Error _parse_obj(const String &p_path, List<Ref<Mesh>> &r_meshes, bool p_
}

if (l.begins_with("o ") || f->eof_reached()) {
if (!p_single_mesh) {
if (!p_single_mesh && vertices.size() > 0) {
mesh->set_name(name);
r_meshes.push_back(mesh);
mesh.instance();
Expand Down

0 comments on commit 5268128

Please sign in to comment.