-
-
Notifications
You must be signed in to change notification settings - Fork 21.8k
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
Update instances of scenes which have been reimported. #57606
Conversation
90a7474
to
eeff93d
Compare
Note from yesterday:
ERROR: Condition "!is_ancestor_of(p_node)" is true. Returning: false |
393de8c
to
ffc5494
Compare
ffc5494
to
828be43
Compare
828be43
to
f71dfd7
Compare
Still not quite ready yet, but big update on this:
|
f71dfd7
to
6624c2f
Compare
Okay, with some recent changes I'd actually say this is almost ready. I'd quite like to add abitrary property resource remapping too, but at the very least, I'd say this 'ready' now, in that, it does what it says and doesn't seem to crash or throw errors anymore. Although this seemed like a pretty simple feature, it turned out to be a massive pain with loads of special-case bespoke code required to make the reimporting appear as seamless as possible. Lots of bespoke edge-cases which I had to track down and fix, and while I've debugged this pretty intensely already, this will likely still require some meaningful testing. At the very least though, I've added an editor setting feature flag so we can treat it as a more experimental feature if needed. |
b78f7e2
to
af68ba4
Compare
Does this also handle the case where a glTF (or other file type) is made local to the scene (or children made editable), then re-exported from Blender? All the replies I've read mention inheriting a new scene, but not when the model is made local to an existing scene or when the children are made editable. My workflow is:
If I then add a new animation to a model in Blender, and re-export the file, Godot will re-import the file without the new animation. I have to delete the model from the scene, restart Godot, then repeat steps 1-5. Changing scene tabs doesn't help, closing and re-opening the scene doesn't help, restarting Godot without deleting the model from the scene doesn't help. Having Godot pick up the animation changes automatically would be awesome, and would save me tons of time. I'm using Godot 4.0 alpha 11. |
70b9aca
to
26568b2
Compare
Found a bug.
The error case is the origin is different when called getting global transform (universe) versus it's local "global" transform (scene global) in nested scenes. |
26568b2
to
7f2cb40
Compare
Test plan global transforms:
Variations
|
1c13e80
to
d99916e
Compare
I patched. So the change was I calculated the transform of the node 2d and node 3d like There was also a missing path to that scene that is saved when a node is instanced. |
d99916e
to
962d2bd
Compare
This comment was marked as outdated.
This comment was marked as outdated.
b9e7c35
to
d8cbe4d
Compare
@@ -3874,7 +3876,7 @@ Error EditorNode::load_scene(const String &p_scene, bool p_ignore_broken_deps, b | |||
Ref<SceneState> state = sdata->get_state(); | |||
state->set_path(lpath); | |||
new_scene->set_scene_inherited_state(state); | |||
new_scene->set_scene_file_path(String()); | |||
new_scene->set_scene_file_path(lpath); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@godotengine/import Does anyone know what this does? I did this to cover a case where opening a nested scene file loses a reference to the blend file as per the test case when updating.
d8cbe4d
to
b314759
Compare
b314759
to
4628736
Compare
The approach is very interesting, although EditorNode is need of a massive clean up after 4.0. |
Thanks! |
Reimporting a .blend file crashes the editor for me (4.0 beta15), but only if the scene is used in any currently open scenes, so i guess this is related to this change. Is this a known issue or unsupported special case with imported .blends? |
Just want to confirm. This change only fixes the reimport issue #38853 for Godot 4 right? |
This is a PR meant to address the limitation that reimporting a modified scene from something like a GLTF or FBX file will not have these changes immediately reflected in instances of the currently open scenes. This should resolve most issues, the one thing it doesn't yet do is reload resources merely referenced in a reimported scene. This can be addressed by another pass to recursive walk all nodes and properties to correct any stray resources, but an easier and faster method could be to add a means to directly the override the resources in the cache.
Closes #55420
Closes #55372
Closes #14338
Closes #38853
Closes #38853