godot icon indicating copy to clipboard operation
godot copied to clipboard

4.4 Beta 1 - Animation Sub-Properties Create Wrong Key Type

Open xCISACx opened this issue 10 months ago • 6 comments

Tested versions

4.4.beta1

System information

Godot v4.4.beta1 - Windows 11 (build 22631) - Multi-window, 1 monitor - Vulkan (Forward+) - dedicated NVIDIA GeForce RTX 3060 Laptop GPU (NVIDIA; 31.0.15.4633) - AMD Ryzen 7 5800H with Radeon Graphics (16 threads)

Issue description

I noticed that 4.4 Beta 1 introduced individual property selection for animations, which is great. It's bugged however. Picking the Y value for Position when adding a track still creates a Vector2 key.

Image

The key also shows up as a red X in the timeline when a value is assigned to it.

Image

Steps to reproduce

1 - Create an animation 2 - Add a track for a property like Position's Y

Minimal reproduction project (MRP)

AnimationBug.zip

xCISACx avatar Jan 28 '25 17:01 xCISACx

Can you help narrow down when this broke?

Edited. This is a new feature, so I need to find the pull request and see if the original implementers are available.

fire avatar Jan 28 '25 21:01 fire

Can you help narrow down when this broke?

Edited. This is a new feature, so I need to find the pull request and see if the original implementers are available.

https://github.com/godotengine/godot/pull/97563

Might be this?

xCISACx avatar Jan 29 '25 02:01 xCISACx

The reason https://github.com/godotengine/godot/pull/97563 was implemented was for keying properties of subresources. Probably we should limit the selection to Ref<Resource>, since it is not intended for uses such as splitting Vector elements (although the bezier editor uses it as a hack). cc @SaracenOne

TokageItLab avatar Jan 30 '25 11:01 TokageItLab

Please keep the ability to be able to only pick one axis of a Vector2 to animate though.

It's very useful for when you only want to animate the Y axis for 2D where the fire point has to move up and down along the idle and running animations, for example.

I need it for the game I'm making and it's bugged in 4.3. I was hoping 4.4 would fix it.

On Thu, 30 Jan 2025, 11:53 Silc Lizard (Tokage) Renew, < @.***> wrote:

The reason #97563 https://github.com/godotengine/godot/pull/97563 was implemented was for keying properties of subresources. Probably we should limit the selection to Ref<Resource>, since it is not intended for uses such as splitting Vector elements (although the bezier editor uses it as a hack). cc @SaracenOne https://github.com/SaracenOne

— Reply to this email directly, view it on GitHub https://github.com/godotengine/godot/issues/102130#issuecomment-2624283364, or unsubscribe https://github.com/notifications/unsubscribe-auth/AI4N6V7WMUWP5LW3TMQJS7T2NIHC5AVCNFSM6AAAAABWA7CC2CVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDMMRUGI4DGMZWGQ . You are receiving this because you authored the thread.Message ID: @.***>

xCISACx avatar Jan 30 '25 13:01 xCISACx

There are two serious problems when dealing with each of the Vector elements separately:

  1. The property “x” does not distinguish whether it is a Vector2, Vector3 or other some type's element or other some class's property. It is a hack to use the element as a path, and is the cause of the underlying problem of incompatible bezier track and value track paths as reported in https://github.com/godotengine/godot/issues/43848 and https://github.com/godotengine/godot/issues/49431.

  2. This is not a good thing from a mathematical point of view. For example, each property of a quaternion should not be interpolated individually, but all should be interpolated with normalizing.

While this is a future decision that has not yet been made, I believe that when the rework of the bezier track occurs in 5.0, access from animation to the elements of such vectors "by using track path" will be discontinued, for the reasons stated above; The track path should have one path to VectorX, and access to each element should be the role of the editor. In other words, it should have such as “separate dimensions option” and be closer to AfterEffects or some DCCs behavior.

Image

I can guarantee that the track path with vector element will work during 4.x, but we can expect that it will be migrated to the original type of element when the project is converted to 5.0.

TokageItLab avatar Jan 30 '25 14:01 TokageItLab

I disagree that this use-case is unsupported. It is a regression for :x as a subproperty.

As far as I know beizer system in godot engine only operate on float,time values.

It is arbitrary that vector4,3,2 can or cannot be interpolated.

For a quaternion if you restrict interpolating of axis to the Vector3 component it is interpolate-able.

fire avatar Feb 23 '25 03:02 fire

Would switching the :x and :y tracks to be beziers solve the issue? It sounds to me like it should work as a workaround, and that :x and :y on value (non-bezier) tracks might not currently be supported. @TokageItLab does the workaround of using bezier tracks make sense for the example case of :y and :x ?

Given that a workaround exists, is there anything else we should practically do about this given the feature freeze and release candidate nature of 4.4?

lyuma avatar Mar 02 '25 01:03 lyuma

@lyuma It does not make sense because the Bezier insertion is broken at this point.

Image

The subproperty selection appears to have been added by https://github.com/godotengine/godot/pull/95554. I also investigated and https://github.com/godotengine/godot/pull/97563 does not seem to be relevant to this issue so if it was working correctly at https://github.com/godotengine/godot/pull/95554, then it should be bisected to find out the true cause of the problem.

TokageItLab avatar Mar 17 '25 15:03 TokageItLab

The reason #97563 was implemented was for keying properties of subresources. Probably we should limit the selection to Ref<Resource>, since it is not intended for uses such as splitting Vector elements (although the bezier editor uses it as a hack).

You should've used get_indexed to get sub members, which supports all Variant types out of the box, instead of this ad hoc hack that the PR has introduced.

The issue likely comes from https://github.com/godotengine/godot/pull/92842 which changed some things which the animation editor relies on implicitly. The value type of the track is defined by the type of the Variant that is stored in it. The linked PR dropped the value that comes from the caller that is adding the keyed property and is instead doing obj.get() which doesn't support indexed paths. Which Saracen tried to fix, but didn't fix fully.

obj.get_indexed() should resolve everything, I believe.

YuriSizov avatar May 06 '25 11:05 YuriSizov

Duplicate of #99115.

akien-mga avatar May 16 '25 16:05 akien-mga