Open Ranoller opened 5 years ago
Sorry about corrections, but this bug is annoying me and it was not clear the origin of that track name change... I would to aclarate that i´m sure that is related with reparenting and adding that to the scene tree... or maybe...sometimes... saving?... but the behaviour is here. Godot is changing the name of tracks inside an animation in a packed scene and adding the main node scene name to that...
Original packed scene with the animation:
Working:
A Scene with 4 instances working:
I add a new scene..... all works:
I add other scene as a child of other.... all stills work:
I reparent and only one can follow the animation... the original track was renamed:
This is the auto-modified animation:
If you need to experiment by yourself: Godot3_1_bug_Catch.zip
Edit1: If someone is going to fix that i want to ask for deleting any system that allows a edited scene to change data inside their children and not edited PackedScenes, this breaks the encapsulation concept for the sake, and can break group work, and this should never happend.
Edit2: Testing more i see that the bug only happend when the reparented node is automatically renamed by godot to skip the node name used jet, if the node is not renamed, the animation track is not changed... but the deep problem is godot modifiying scenes by other scenes.
I don´t know hot to do that in c++ and godot codebase, but in: https://github.com/godotengine/godot/blob/master/editor/scene_tree_dock.cpp In this lines:
1183 bool autorename_animation_tracks = bool(EDITOR_DEF("editors/animation/autorename_animation_tracks", true));
1184
1185 if (autorename_animation_tracks && Object::cast_to<AnimationPlayer>(p_base)) {
i think is needed to test if ... p_base is a PackedScene or something like that,
Edit: More information. If you change editor_settings/editors/animation/autorename_animation_tracks to false, performing the operation that i did in the upper gifs make godot crash.
I think this issue it´s important to 3.1 stable, since can make a big headache to people without version control system....
The provided project seems to work fine in 3.2.2 RC 2 after reparenting the instance, can you confirm if it's solved for you too?
No, it´s not fixed. The problem is the "autorename" of nodes that godot performs. The operation that should be done to catch the bug is reparent a node, rename to some name that godot needs to change to not have duplicity(Ej. "Creature") , and reparent other time, and at this moment, godot changes the name to "Creature6", the animation changes to ../ parent and the others nodes doesn´t perform the animation... If you follow the gifs, i think it´s clear the problem.
I tested in Godot 3.2.2 RC2 with the attached demo.
More specifically, the problem is that the "PackedScenes" shares the track names in the AnimationPlayer, and the Parent Scene of that instanced scene, changes all track names in the PackedScene instead in the animation track of the "Instanced Scene", breaking all other animations. But main problem described here is still valid.
I think in 2 solutions:
I want to note my comment of 23/02/2019 and the "autorename animation tracks" project setting. It´s still valid. The bug is related with this setting.
Still valid in 3.3.2 and f030b0c
This is weird, because I remember similar issue being fixed. Maybe only some cases were fixed.
Godot version:
5e837b3f13ab1e3b31bb8d705e87820fa4eff21e
OS/device including version:
Win7
Issue description:
An Animation in PackedScene with an AnimationPlayer with a track called:
EnemyPath2D/PathFollow2D:unit_offset
is automatically renamed to:"../**InstancedPackedSceneName**/EnemyPath2D/PathFollow2D:unit_offset"
on reparenting other copy of the PackedScene in the Scene that contains that PackedScene....This change produces that only the first packed scene loaded in the currentscene can play the animation (because the "InstancedPackedSceneName" is stored in the animation), and only this instance can follow that track. The packed scene remains inservible by itself (That packed scene doesn´t have that track name outside the scene). This behaviour happend with the unsaved resource or the animation stored in an independent tres file.
To note that InstancedPackedSceneName is unique per Node (godot doesn´t allow instances with the same name) and relative to every scene (you can change manually), so , this name never should be added to the tracks from the original PackedScene or the original resource (Godot should not change animation tracks names ever, this is not good behaviour, it can break to many things). If you change that track name manually, the animation is reproduced in all nodes, but on next saving, godot by itself destroy the reference other time.
Minimal reproduction project:
Will try...