godotengine / godot

Godot Engine – Multi-platform 2D and 3D game engine
https://godotengine.org
MIT License
91.14k stars 21.19k forks source link

AnimationPlayer with local-to-scene animation in inherited scene unnecessarily makes resource built-in to that scene #43448

Open Taywee opened 4 years ago

Taywee commented 4 years ago

Godot version:

3.2.3

OS/device including version:

Gentoo Linux

Issue description:

When an AnimationPlayer has local-to-scene animations in some specific configurations of inherited scenes, they can't reference the on-disk resources that the parent does. I need this because I have a root node with an AnimationPlayer that I have subscenes of, but I need to modify the animations in each instance in code (specifically, I'm using it for some really cool rewind behavior) and have them behave separately. I want each AnimationPlayer to reference the same on-disk resource because they all start with some primitive set of animations and keys that are modified per-instance. This doesn't prevent it from working, but it does mean that I have to manually reupdate each inherited scene whenever I change the root.

This doesn't appear to happen when the animation is not "Local To Scene", but I wouldn't expect local to scene to do something like this, based on its description, which claims that the resource is made unique in each instance of the scene, not that the resource can't be inherited.

Steps to reproduce:

Minimal reproduction project:

InheritanceTestLocal.zip

Taywee commented 4 years ago

I double-checked, and it doesn't matter if the animation is saved to disk. The same thing happens for built-in animations in Root. It doesn't seem to happen until a grandchild is made. A simple parent-child relationship appears to work fine, but once a grandchild is present, the child also doesn't properly want to reference the parent.

InheritanceTestBuiltIn.zip