It seems to be working in the state I put it, BUT, if you uncomment any of the following lines :
anim_sticker_come = animationGroups[0];
anim_sticker_go = animationGroups[1];
skeleton = skeletons[0];
It will stop working… It’s working locally though, so I don’t really understand what happens.
Any idea ? I think I’m missing something pretty big for my very basic demo to fail so early ?
And other questions related to this basic example :
locally, I used “ImportMesh” instead of “Append”, and it works. In the playground, it doesn’t. Know why ?
how come I get a message “You must at least create a camera” when there’s already a camera in the scene ?
if I add “const scene = createScene();” below my current code, I get an error “r.initFunction is not a function”
I really think I misunderstood something big, it seems a lot of things are working locally, but not on the playground
As Seb mentioned, to access the objects from the scene, you can use getYYYbyId series of functions.
For the camera bit, you have to keep in mind that the function called on ImportMesh/Append is a callback, which means it will only execute once the model is loaded. That means that the scene returned by createScene doesn’t have a camera at its moment of creation, only a while after once the mesh is loaded. A solution in this case would be to move the createDefaultCameraOrLight to outside the callback.
And for the last point, it’s not needed to call the createScene function on the playground, only define it. The playground takes care of the rest.
Understood ! Thanks for your help
The question I was initially here for was about animations (more precisely : how to play only a small part of an imported skeleton animation), but I think I figured it out ! I just didn’t understand at first that the range of the animation wasn’t the same in the gbl file than in my 3Ds max scene, I was trying to play frames 75 → 100, because the animation is 100 frames long in 3ds max, but I then noticed when opening my file in the sandbox, that the animation was only 1.6 frames long here
My final goal is to control animation with the page scroll, and not time, I’ll let you know (in an other thread) if I bump in other issues in the journey
Hehe, good idea They’ve got some pretty good beers !
The common ones, like the blond, are good but not exceptionnal.
But the uncommon ones are very interesting