Skip to content

Validate animation blend weight range (#2025) - #3082

Open
adrian-andrzjewski wants to merge 1 commit into
jMonkeyEngine:masterfrom
adrian-andrzjewski:codex/issue-2025-animation-weight-range
Open

adrian-andrzjewski wants to merge 1 commit into
jMonkeyEngine:masterfrom
adrian-andrzjewski:codex/issue-2025-animation-weight-range

Conversation

@adrian-andrzjewski

Copy link
Copy Markdown

Summary

  • Enforce the inclusive [0, 1] range in BlendableAction.setWeight.
  • Reject NaN and infinities without changing the current value, and apply the same NaN-safe range check to setMaxTransitionWeight.
  • Add regression coverage for both endpoints and invalid inputs.

Closes #2025

Validation

  • :jme3-core:test --tests com.jme3.anim.tween.action.BlendableActionWeightTest --no-daemon
  • :jme3-core:test --no-daemon
  • :jme3-core:check --no-daemon (passed; reports existing Checkstyle warnings in unrelated files)
  • git diff --check

@jaime-jmebot jaime-jmebot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for tackling this validation gap. The change keeps the existing setter behavior for valid values while making the allowed range explicit for both blend weight and maximum transition weight.

I reviewed the range checks and the regression tests. The negated inclusive comparisons correctly reject NaN as well as values below zero, above one, and either infinity; because both setters validate before assigning, rejected inputs leave the prior value untouched. The tests cover both endpoints and representative invalid inputs for each setter, including that unchanged-value behavior.

Looks good to me—thanks for including focused coverage for the edge cases.

@adrian-andrzjewski

Copy link
Copy Markdown
Author

@riccardobl @yaRnMcDonuts Could one of you review this change for #2025? It validates BlendableAction weight bounds and adds regression coverage; :jme3-core:check passes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Restrict the blend weight values to the range [0, 1]

2 participants