Skip to content
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

For blending non-numeric value/bezier tracks the weights should be store separate from the key values #8085

Open
TokageItLab opened this issue Oct 12, 2023 · 0 comments
Milestone

Comments

@TokageItLab
Copy link
Member

TokageItLab commented Oct 12, 2023

Describe the project you are working on

Stabilize Godot animation system

Describe the problem or limitation you are having in your project

In the old AnimationTree this was not working correctly to begin with, but with the integration of the blend application process by AnimationMixer, the problem surfaced as godotengine/godot#82949.

I sent godotengine/godot#83030 as a workaround, but it is not the correct fix. It only applies the last processed one first.

Describe the feature / enhancement and how it helps to overcome the problem or limitation

Allows non-numeric values to blend correctly.

Describe how your proposal will work, with code, pseudo-code, mock-ups, and/or diagrams

Correct fix

For discrete values, it is possible to blend the weights of consecutive values from 0 to 1 in a similar way to Boolean values, giving priority to the one with the highest weight.

For example, suppose that the iterates stack image paths and weights as following:

weights: [
  {
    resource: "Image1.tres",
    weight: 0.3
  },
  {
    resource: "Image2.tres",
    weight: 0.3
  },
  {
    resource: "Image3.tres",
    weight: 0.4
  },
  {
    resource: "Image1.tres",
    weight: 0.2
  }
]

In this case, the final value with the highest weight is Image1.tres: 0.3 + 0.2 = 0.5. Thus, for non-numeric values, we can manage the weights and values in pairs to achieve the correct blending.

Also, we should salvage the godotengine/godot#49411 in order to share a blending process for BezierTrack.

If this enhancement will not be used often, can it be worked around with a few lines of script?

Nope

Is there a reason why this should be core and not an add-on in the asset library?

This is fixing the core feature

@TokageItLab TokageItLab added this to the 4.3 milestone Oct 12, 2023
@TokageItLab TokageItLab self-assigned this Oct 12, 2023
@fire fire changed the title For blending non-numelic value/bezier tracks the weights should be store separate from the key values For blending non-numeric value/bezier tracks the weights should be store separate from the key values Oct 12, 2023
@TokageItLab TokageItLab modified the milestones: 4.3, 4.2 Oct 15, 2023
@TokageItLab TokageItLab modified the milestones: 4.2, 4.3 Nov 13, 2023
@TokageItLab TokageItLab removed their assignment Jan 16, 2024
@TokageItLab TokageItLab modified the milestones: 4.3, 4.x Jan 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant