-
-
Notifications
You must be signed in to change notification settings - Fork 21.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix import and saving related crashes #89780
Conversation
da4ee47
to
61c0ea0
Compare
I would remove the redundant |
* Don't add empty mesh to result when importing obj files * Check for null resources in `ResourceSaver`
61c0ea0
to
49ae632
Compare
Done! |
return ::ResourceSaver::save(p_resource, p_path, p_flags); | ||
} | ||
|
||
Vector<String> ResourceSaver::get_recognized_extensions(const Ref<Resource> &p_resource) { | ||
ERR_FAIL_COND_V_MSG(p_resource.is_null(), Vector<String>(), "It's not a reference to a valid Resource object."); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This one isn't entirely redundant as it exits a bit faster, but it's only skipping over the loop which is minimal
Thanks! |
Thank you! |
ResourceSaver
This adds the check from
core_bind
toResourceSaver
directly,could remove the one in, it helps catch broken cases when doing things from c++ResourceSaver.save
incore_bind
as it's now redundant, but just added it for nowThe obj side avoids doing any of the remaining code, makes things a bit clearer, and matches the code here:
godot/editor/import/3d/resource_importer_obj.cpp
Lines 441 to 445 in fe01776
For this specific case we might want to look at adding support for lines in obj files as they support it, or a more clear error message or warning when using unsupported features, but that's outside the scope of this