This repository was archived by the owner on Jan 28, 2025. It is now read-only.
Hot Reload often breaks Animation #61
Labels
enhancement
New feature or request
good first issue
Good for newcomers
help wanted
Extra attention is needed
Context
I'm experimenting with vue-babylonjs as basis for a live visuals programming workflow. The idea is to run a development server (webpack-dev-server with vue-loader), visit the it once (in a while) with the browser, then edit the code, save and have hot reload update (parts of) the scene graph.
As this is probably not your intended workflow I wasn't expecting much to be working out of the box, but found it doing quite all right. One component that breaks though is
Animation
.What happens is: I visit the page with a scene graph with an animation, the scene loads and animation animates. I then edit the animation node, e.g. change
:duration
value and save the file. Hot reload figures out what has changed, adjusts theAnimation
node and more often than not something will go wrong: either the animation runs but with corrupted state (e.g. rotation would seem to restart before the end value is reached) or the animation runs once but ends up throwingReloading the page in the browser starts the scene graph with the new settings and without issues. I think the problem has to do with how Hot Reload attempts to update the DOM and how Vue-BabylonJS then virtually attempts to "propagate" the update to the scene graph. But I don't know enough about how vue and vue-babylonjs work underneath to understand what goes wrong exactly.
Minimally Reproducible Example
The minimal component I'm experiencing this problem with is here, and the whole project
To Reproduce
Steps to reproduce the behavior:
yarn serve
HotAnimationIssue.vue
, changing duration to some other valueExpected behavior
Animation continues with new settings
Environment (please complete the following information):
The text was updated successfully, but these errors were encountered: