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

Updating view when levels where changed? #52

Open
sommerper opened this issue Feb 8, 2025 · 8 comments
Open

Updating view when levels where changed? #52

sommerper opened this issue Feb 8, 2025 · 8 comments

Comments

@sommerper
Copy link

sommerper commented Feb 8, 2025

Hi!

After having made some changes in a level in ldtk I have to close the scene in Godot an open it again to see the changes.

Is there a way to make that happen automatically?

I'm using Godot 4.4 beta 1

Thanks!

@sourencho
Copy link

Have you tried reloading the scene?

[ Reload Saved Scene] , you can open Editor Settings - Shortcuts and search it then assign [ alt + R ] to it

@sommerper
Copy link
Author

Yes. But that doesn’t happen automatically. Ldtk supports executing a script when a level is saved. Maybe it’s possible to trigger godot into reloading the assets somehow. I believe the unity plunging for ldtk does something similar.

@heygleeson
Copy link
Owner

This should be the default behaviour. Godot should automatically detect file changes and trigger a reimport.

What versions of Godot/godot-ldtk-importer are you using?

@sommerper
Copy link
Author

Hmm... maybe it's a Godot issue then

I'm using ldtk 2.0.1
and now Godot 4.4.beta3

Image

Image

As you can see here I have changed the tileset and the level layout in ldtk and saved it. When returning to Godot it does say that it imports the level. But no change has happened.

Image

Pressing Alt R doesn't do anything but closing the level and opening it again shows the updated level. Although not the correct tileset.

Image

Maybe it has something to do with the way Godot keeps track of files with the new UID system?

@heygleeson
Copy link
Owner

Ah, okay! I have been warned out there being issues with the Godot 4.4 beta! I will try to find some time to look into this.

@heygleeson
Copy link
Owner

After some experimenting in 4.4, it seems like this is related to Godot's cache of imported scenes (the LDTK World scene is saved in /.godot/, Level scenes get saved in the project folder when using "Pack Levels".)

The only consistent solution I could find is to not have any scenes open that have the LDTK World scene as a parent/child node. Having just the LDTK Scene open will automatically refresh/reload on reimport without issues.

So for now - keybind to "Reload Saved Scene" to force a refresh.

Definitely a weird issue - it could be that the importer's approach to creating Level Scenes is missing detail to say that it technically belongs to an imported resource.

If anyone has more insight on this, please share.

@sourencho
Copy link

Thanks for looking into this!
What do you mean by keybind?

@heygleeson
Copy link
Owner

Your suggestion, actually!

[Reload Saved Scene] , you can open Editor Settings - Shortcuts and search it then assign [ alt + R ] to it

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

3 participants