Hi @Lawrence3DPK - you’ve hit on my issue - not all my three.js scene animations work off the same imports.
I’ve tried to replicate my setup without including all the barba.js code - if you’re not familiar with it what barba essentially does is creates a wrapper housing a container for each page, and writes ‘views’ inside each container… you can then assign separate js code to each ‘view’, so it only run when this ‘view’/page loads (via a function on enter).
To mimic this ‘code switching’ in my example, comment out each function at the top (initIndexAnims + initAboutmeAnims)
The imports at the top are what the Index animation (initIndexAnim) depends on… in my setup this code has to feature outside the ‘view’ function called by barba.js, because imports have to sit top line, rather than nested inside the view/page function… so it’s called by every page, including ‘about me’… that is, called outside the wrapper, not within the container.
(I’ve tried swapping the top line import for a dynamic import in the index view function, to no avail).
The about me page animation works off the inline script (/88/three.min.js).
I reckon, as you hint at, if I could get the about me page three.js code running off the same import as the index page one, problem solved!
As you know I’m a relative beginner, but understand that the more complex index anim needs to import not just three but also the svgrenderer and object loader… so I’m assuming it would be easier to make the more simple animation run off the top level import rather than the inline script… just not sure how to do that… even though it may be an elementary fix!
Hope all that makes sense… thanks in advance!