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

Godot never saves the terrain resource after it was modified by a not-undoable action #101

Open
Zylann opened this issue Sep 24, 2019 · 3 comments
Labels
bug Something isn't working Partly fixed The issue is partially fixed or uses a workaround with downsides

Comments

@Zylann
Copy link
Owner

Zylann commented Sep 24, 2019

After investigating #100, I basically found that if I use the resize tool, generator or importer, and then save the scene right after that, it won't save the terrain data. i.e the scene saving process does not call the plugin's resource saver. It won't even show a star (*) next to the scene tab, supposed to show it was modified.

It looks like it will only save it if you perform an undoable action to it, like painting height or textures.

I already emit the changed signal on HTerrainData each time changes are done to terrain maps, but this appears to have no particular effect.
I wonder what I'm missing here, or if it's a Godot bug/flaw?

@Zylann Zylann added the bug Something isn't working label Sep 24, 2019
@Zylann
Copy link
Owner Author

Zylann commented Sep 24, 2019

Looks like calling property_list_changed_notify() makes the resource saved, but it doesn't make the * appear in the scene tab. So it still doesn't warn you if you close the scene or the editor...

But if it did, it would overlap with the original intent of that property, which is to update the inspector when the property list changes, i.e if you undo a change causing the inspector to change, it would leave the scene modified even if that undo changed the scene back to its non-changed state.

@Zylann
Copy link
Owner Author

Zylann commented Sep 24, 2019

Worked around in 2d2a8d7
Downside is, if you still use Ctrl+Z just after the non-undoable action, your scene might revert back to "non modified" and the terrain won't be saved.

To close this issue:

  • Either something should be exposed in Godot to handle this situation,
  • Or full-terrain changes should be made undoable (possible, but requires some work using cache files)

@Zylann Zylann added the Partly fixed The issue is partially fixed or uses a workaround with downsides label Sep 24, 2019
@Zylann
Copy link
Owner Author

Zylann commented Mar 26, 2020

This no longer applies to using the generator, which is now fully undoable. But it persists in other areas where undo isn't implemented:

  • Import
  • Resize
  • Globalmap baking
  • Removal of detail layer

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working Partly fixed The issue is partially fixed or uses a workaround with downsides
Projects
None yet
Development

No branches or pull requests

1 participant