Skip to content
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

Error when the gltf file is updated, but another scene in Godot is focused #6

Open
Lamoot opened this issue Nov 12, 2024 · 2 comments

Comments

@Lamoot
Copy link

Lamoot commented Nov 12, 2024

The following screenshot shows an error I get when I re-export the .gltf file from Blender and the Godot addon tries to update the related nodes in their scene but can't find them.

  • level_01_demo is the scene where I'm building the level. This is where I placed the level_01_demo.gltf file.
  • When I re-exported the file from Blender I had another scene focused in Godot, the player character. The addon tries to update the nodes derived from the exported .gltf but it of course can't find them as they are in another scene.

update_but_on_a_different_scene

Ideally the addon in Godot would handle such cases and update the relevant scene. However it's likely tricky to get that working so at least a more graceful and informative fail would be enough.

@bikemurt
Copy link
Owner

bikemurt commented Nov 12, 2024

Yep, unfortunately that is expected. The scene that contains the imported node must be open during the import process. I have spent time in the past trying to resolve this and couldn't (reason given below).

This was behaviour I did not see in Godot 4.2.1 stable, so somewhere between there are 4.3, the import pipeline has changed, and if there are nodes which are linked to a GLTF file, then the scene that node is in should be open when the post import script is triggered (either manually via re-importing or by exporting a .gltf file).

There might be a solution if this addon were a Godot plugin proper, because then we would have some ability to check which scene is open in the editor. Since this is just a GDscript attached to a Node3D, I don't believe there is a way to determine which scene is open. @tool scripts also would not have that level of access.

I won't close the issue in case anyone else has any ideas.

@Lamoot
Copy link
Author

Lamoot commented Nov 13, 2024

The issue isn't such a problem when the user knows what is causing it. It's a then a simple matter of focusing the correct scene and re-exporting the gltf.

A lot of it would be mitigated if there were a way to detect the error from Godot's side before outputting the long list of red errors. In this case the process would be aborted and a helpful hint provided.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants