godot-proposals icon indicating copy to clipboard operation
godot-proposals copied to clipboard

When loading scene with broken dependencies, there should be an option to set any broken dependencies to null

Open blackears opened this issue 1 year ago • 10 comments

Describe the project you are working on

A game where scripts @export Resources that I've set in the inspector.

Describe the problem or limitation you are having in your project

Somehow one or more of my resources have broken and now I'm unable to open any project that references them. I can't even open the project to delete the reference. The Fix Dependencies window is no help because it just keeps the reference to the broken resource.

Describe the feature / enhancement and how it helps to overcome the problem or limitation

It will be possible to at least open scenes that have variables that references resources, even of those resources can't be loaded.

Describe how your proposal will work, with code, pseudo-code, mock-ups, and/or diagrams

On the fix dependencies window, there will be a button for just setting the resource to null.

image

If this enhancement will not be used often, can it be worked around with a few lines of script?

No. Not without opening your scene files in a text editor.

Is there a reason why this should be core and not an add-on in the asset library?

Requires changing how editor works.

blackears avatar Jan 18 '24 20:01 blackears

(please put backtics around annotations, to not tag random accounts)

AThousandShips avatar Jan 18 '24 20:01 AThousandShips

In 4.2 (or 4.3) you should be able to open that scene normally.

KoBeWi avatar Jan 18 '24 22:01 KoBeWi

I'm using 4.2.1. I cannot open the scene.

blackears avatar Jan 18 '24 22:01 blackears

Right, so it's only since 4.3. Try that version, I think it resolves this problem.

KoBeWi avatar Jan 18 '24 22:01 KoBeWi

Okay, I was able to open in 4.3 dev2

blackears avatar Jan 18 '24 23:01 blackears

No, I just tried again. After reloading my project it's failing in 4.3 too.

I'm getting errors about missing dependencies even though the resources are clearly in my resource file.

blackears avatar Jan 18 '24 23:01 blackears

I think the problem is a circular include - the resource included a PackedScene which I think had another Resource in its parameters which referred back to the initial resource.

blackears avatar Jan 19 '24 00:01 blackears

Any case where you can edit scene dependencies, but not open the scene, is a bug and should be fixed at the source. Circular dependencies are not supported, but maybe there is a way to have editor detect them and automatically remove the problem.

KoBeWi avatar Jan 19 '24 00:01 KoBeWi

This is THE window that makes sense to fix this, or at least find the problem, and can be all the way down in subscenes causing the problem. We can edit the .tscn in notepad, but having more options here would save a lot of time. Making a new 'empty' scene and moving a suspect scene to point to it is one option, as we can replace, but having a 'remove' button would also help us fix things here. Don't know if you'd want a 'remove fully' or 'replace with node3d/2d' options.
It's working significantly better in 4.3, but if it goes wrong, having a 'remove this fully' for now would be the safe way to get in and fix lower stuff as needed.

JyveAFK avatar May 01 '24 14:05 JyveAFK

This would also be useful to support a workflow where you don't commit LightmapGIData and VoxelGIData to reduce file sizes in VCS history, although a dedicated solution would likely fare better here (e.g. with baking being proposed when you first open the scene).

Calinou avatar May 01 '24 15:05 Calinou