Skip to content

Error when reparenting AnimationPlayer, can break animation tracks #83936

Closed
@KoBeWi

Description

@KoBeWi

Godot version

4.2 beta3

System information

Windows 10.0.19045 - Vulkan (Forward+) - dedicated NVIDIA GeForce GTX 1060 (NVIDIA; 30.0.15.1403) - Intel(R) Core(TM) i7-7700HQ CPU @ 2.80GHz (8 Threads)

Issue description

When you reparent AnimationPlayer, this error is written in the output:

Node not found: "../Node2D" (relative to "/root/@EditorNode@17151/@Panel@13/@VBoxContainer@14/@HSplitContainer@17/@HSplitContainer@25/@HSplitContainer@33/@VBoxContainer@34/@VSplitContainer@36/@VSplitContainer@62/@VBoxContainer@63/@PanelContainer@110/MainScreen/@CanvasItemEditor@9493/@VSplitContainer@9312/@HSplitContainer@9314/@HSplitContainer@9316/@Control@9317/@SubViewportContainer@9318/@SubViewport@9319/2D/Node2D/AnimationPlayer")

It comes from

Node *root = ap->get_node(ap->get_root_node());

Seems like the code is called at a wrong time. The paths are updated correctly though.

EDIT:
No the paths are not updated correctly. If you move root node, every animation tracks for nodes that aren't is children will be broken.

Steps to reproduce

  1. Create a new scene with a Node2D root;
  2. Add a child Node2D to the root;
  3. Add a child AnimationPlayer to the child Node2D;
  4. Create a new animation in the AnimationPlayer node with any name;
  5. Add a property track, pick the child Node2D and select any property (example: the modulate property);
  6. Create a key in the newly created property track;
  7. Reparent AnimationPlayer to the root Node2D;

Minimal reproduction project

N/A

Metadata

Metadata

Type

No type

Projects

  • Status

    No status

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions