Don't abort loading when ext_resource is missing#85159
Don't abort loading when ext_resource is missing#85159akien-mga merged 1 commit intogodotengine:masterfrom
ext_resource is missing#85159Conversation
|
I think that Open anyway should set (and later unset) |
54a25b4 to
875d8dc
Compare
|
Changed to use |
875d8dc to
c7e5d35
Compare
|
Quoting current usages: godot/scene/resources/resource_format_text.cpp Lines 160 to 167 in c2f8fb3 godot/scene/resources/resource_format_text.cpp Lines 469 to 476 in c2f8fb3 godot/core/io/resource_format_binary.cpp Lines 455 to 460 in c2f8fb3 godot/core/io/resource_format_binary.cpp Lines 688 to 693 in c2f8fb3 So, abort on missing resources, if Now, if (p_ignore_broken_deps) {
ResourceLoader::set_abort_on_missing_resources(false);
}
// Load, etc.
if (!p_ignore_broken_deps && dependency_errors.has(p_resource)) {
// Show dependency dialog. There will be dep errors, but we won't enter this branch.
}
if (p_ignore_broken_deps) {
ResourceLoader::set_abort_on_missing_resources(true); // Restore.
}What do you think? |
|
Makes sense, changed. |
c7e5d35 to
eb4928e
Compare
eb4928e to
1de0415
Compare
|
Reverted to my original fix. The only call for Line 6919 in 1faf2f5 The the abort is already disabled in the editor, and according to your comments it is working as intended, so the problem is text format code not handling it properly. Also the new fix was breaking binary format, so it was bad anyway. |
|
In any case, I'm willing to attempt to add such a refactor myself in another PR. If this PR is already enough to fix a known issue, I won't oppose to merging it and we can keep the discussion over actual code showing what I'm trying to tell. PS: I've realized why abort-on-missing-resources looks reversed. It depends on what is aborted. The editor sets to |
ext_resource is missing
|
Thanks! |
|
fixes #86154 |
|
I had a similar problem where no preload is involved. My guess is that strong-type variables are causing cyclic GDScript parsing. Consider some code like this: After removing a type notation in the attached GDScript, my scene is working again. I wish that this PR also fixes any problem that may arise in this hypothetical situation. I will report back if the problem persists in 4.3. |
|
GDScript does support cyclic dependencies since 4.0. Also it shouldn't be affecting scenes... |
That is a surprise to me. I will try making a minimal working example. |
|
Though by cyclic dependencies I mean scripts only. Preloading other resources, especially scenes, in a cyclic way won't work and will make the scenes non-openable until you remove the preloads. |
Thanks for the clarification. I had another look into my scripts and figured out that a script contained a preload which I failed to notice. I found the correct way to reproduce the problem and you may have a look. In summary:
|
|
Thanks, there's already an existing issue about this bug, I attached your project there: #79545 (comment) |
Thank you. You have done great help in this PR. |
|
Cherry-picked for 4.2.2. |

Fixes #85152
Bugsquad edit: Fixes #86154
Resource loaders have inconsistent error values in case of missing files. If a loader returns error that indicates missing file, it's safe to ignore it; the resource will be replaced by null when you Open Anyway.
There are more errors related to files, not sure if ignore them all (the premise is technically the same).