Repository navigation
Preserve runtime animation layers on first assignment - #10132
Open
Harrison0223-svg wants to merge 2 commits into
Open
Harrison0223-svg wants to merge 2 commits into
Harrison0223-svg wants to merge 2 commits into
Conversation
Do not replace layers already created by addLayer when implicitly assigning an animation. Preserve their order, identity and named routing. Keep the original empty-component Base behavior. Refs playcanvas#6390 (layer loss only; additive scaling excluded). AI-assisted implementation and testing with OpenAI Codex.
Distinguish implicitly generated runtime metadata from authored graphs and guard only same-object reloads. Test runtime reload, clone reload and explicit graph replacement separately. Refs playcanvas#6390. AI-assisted implementation and testing with OpenAI Codex.
Author
|
Chrome 158 on Apple Silicon, automated verification by OpenAI Codex. At d6e3a1c, Locomotion/Walk and UpperBody/Wave kept their layer objects and active states across first assignment and a reload of the generated graph. Explicitly loading a separate empty graph cleared both layers. The base lost the runtime layers on first assignment. |
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Refs #6390 (first issue only).
If
addLayer()runs before the first component-levelassignAnimation(), the generated Base graph can replace the existing layer array while leaving its name lookup pointing at the wrong layer. The first assignment now preserves existing runtime layers, their order, and routing. Assigning first on an empty component still creates the normal Base layer.The generated graph is tagged separately from an authored empty graph because they mean different things: the former is metadata for layers created at runtime; the latter explicitly describes a graph with no layers. Reloading the component’s own generated graph therefore keeps its existing layers and tracks, while loading another graph or reloading an authored graph follows the normal replace path.
The separate additive-layer symptom in #6390 is out of scope. Directly assigned tracks were already lost on clone on the tested main baseline; this PR does not change that behavior.
Validation
npm testwith native Canvas: 4,991 passed, 50 pending, 0 failed. Lint, type generation, and type tests passed.AI-assisted implementation and testing. Scope and results refer to this revision.
Checklist