Blax Posted November 3, 2015 Share Posted November 3, 2015 Hi. Please, escape me - animation does not allow me to sleep on nights And have all chances will be my personal nightmare )))I just do not understand how it works. http://www.babylonjs-playground.com/#1UGLI9#3if we change loopMode in animation process - we have the same result - animation play to end and stop.Next, if we swap modes: http://www.babylonjs-playground.com/#1UGLI9#4we also can not change animation loopMode. Why? Perhaps loopMode cant be changed, while animation played? Try:http://www.babylonjs-playground.com/#1UGLI9#5click just stopped animation. And:http://www.babylonjs-playground.com/#1UGLI9#6Oh, no... restart() do nothing again ((( More:http://www.babylonjs-playground.com/#1UGLI9#8, http://www.babylonjs-playground.com/#1UGLI9#9 If we click - sphere not return in original state. Please, open the animation logic for new bee - it really unclear and seems unlogic (( Quote Link to comment Share on other sites More sharing options...
Blax Posted November 3, 2015 Author Share Posted November 3, 2015 After little more: http://www.babylonjs-playground.com/#1UGLI9#10 How animations interact? -3 + 3 = 0, but we see other. Сompletely confused Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted November 3, 2015 Share Posted November 3, 2015 Hello,let me help me kill your nightmares the loopMode defines how the animation behaves when it needs to loop. For instance, using relative means that computed value will be relative to first key (meaning that if loop == 1 then animation = key0 + current value). For your example because key0 = 0 this has no impact.When using cycle, the value just cycle infinitely: http://www.babylonjs-playground.com/#1UGLI9#11 For your key/antikey question, animations on the same property are not additive. only the last is used Quote Link to comment Share on other sites More sharing options...
Blax Posted November 5, 2015 Author Share Posted November 5, 2015 Big thank to you, Deltakosh!One half nightmare's is killed, but i still can't sleep )) Remains three important question: 1. What is doung restart() for Animatable?2. Why we can't return in initial state, if delete animation? (in my try's mesh still changed (scaled) if i runtime delete animation). I must just save key0 state and restore it for animated property, yes?3. Can i change loopMode on runtime? In my case i can see anything changing Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted November 5, 2015 Share Posted November 5, 2015 Let keep fighting then 1. it stop the pause. So if you pause() the animatable, you can restart(continue) the animation with restart()2. correct. For performance reasons, animations change the current state of objects so you need to save initial state if you want to restore it3. Nope (unless changing it on every animatable involved in the animation) Blax 1 Quote Link to comment Share on other sites More sharing options...
Blax Posted November 9, 2015 Author Share Posted November 9, 2015 Thanks again, Deltakosh! Will be trying Quote Link to comment Share on other sites More sharing options...
Blax Posted November 9, 2015 Author Share Posted November 9, 2015 Brrrrr... not all ) http://www.babylonjs-playground.com/#UUQJR then, how animation state shows in animationStarted property? (i only out to log this param). Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted November 9, 2015 Share Posted November 9, 2015 animationStarted is false because.....animation is not YET started you will have to wait for the first frame to be rendered to get a true Quote Link to comment Share on other sites More sharing options...
Blax Posted November 10, 2015 Author Share Posted November 10, 2015 mmmm If it were so simple... How about this?:http://www.babylonjs-playground.com/#UUQJR#1 Animation is started (you see flashing and scaling boxes? ), and frame not first, but "false","false","false" and "false" Quote Link to comment Share on other sites More sharing options...
Wingnut Posted November 10, 2015 Share Posted November 10, 2015 Hi guys! I did a source search and I cannot find anywhere that Animatable.animationStarted is ever set true. I suspect that animationStarted should be set in the Lines 84-100 area. Good find, Blax! Do you know what Coffee Royale is, Blax? It's coffee with booze in it. Deltakosh's daughter is probably quite annoying at her current age (1), and Deltakosh likely starts drinking Coffee Royale daily at about 4:30 AM Seattle time. So, he's pretty well schnockered-up by 9 AM every day. Just kidding, of course. Deltakosh is RARELY wrong about ANYTHING in BJS, so when he IS wrong about something, we all throw a giant party to celebrate that he is human just like us. Maybe we will have another party SOON! heh Quote Link to comment Share on other sites More sharing options...
Blax Posted November 10, 2015 Author Share Posted November 10, 2015 Hi, Wingnut! >> Do you know what Coffee Royale is, Blax? I rarely drink coffe and rarely booze drink: In the morning, and then..... only-only in the evening First, I think set animationStarted manualy, but afraid it broke something inside animation logic.We need expert opinion, just still wait Deltakosh Quote Link to comment Share on other sites More sharing options...
Wingnut Posted November 10, 2015 Share Posted November 10, 2015 http://www.babylonjs-playground.com/#UUQJR#2 I hijacked the Animatable and forced a setting at line 90. Not well tested, but I am seeing some 'true' at the console sometimes. Temporary fix. We wait for the experts = good idea. I turned-off the box 2 color animation... temporarily. Quote Link to comment Share on other sites More sharing options...
Vousk-prod. Posted November 10, 2015 Share Posted November 10, 2015 I'm pretty sure Animatable is not DK's work, I think it's something JCP added afterwards in the engine (but I can be wrong). Quote Link to comment Share on other sites More sharing options...
Wingnut Posted November 10, 2015 Share Posted November 10, 2015 Ahhh... interesting! A Blender support device... possibly. Thanks VP. See the looper in line 85? yuh yuh yuh. Multiple Animations on a single Animatable. With my kludge... if ANY of them is running... .animationStarted = true (I think). hmm. Maybe that's not good/right. Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted November 10, 2015 Share Posted November 10, 2015 @vousk: nope it was mine @Blax: you found a bug well done dude! I'll fix it right now! Quote Link to comment Share on other sites More sharing options...
Vousk-prod. Posted November 10, 2015 Share Posted November 10, 2015 Oh right, I remember now, "Automaton" was the mysterious concept introduced by JCP, not "Animatable" Wingnut 1 Quote Link to comment Share on other sites More sharing options...
Vousk-prod. Posted November 10, 2015 Share Posted November 10, 2015 BTW, Animatable still contain mysterious stuff to my ears , because it leads to a specific problem I encountered few month ago. If I remember well, when creating many animations with Animation.CreateAndStartAnimation (for instance we use this function to create a new anim while others still running), they all register in the same single Animatable (sounds good), but to do that, the following happens : first, Animatable is created for the first animation, then, this Animatable is stopped at the second Animation creation and a new Animatable is created with both Animations, etc...That's not totally ok because when setting a onAnimationEnd callback, it is called when the first Animatable stops, not at the real first Animation end (even if the duration time wasn't reached). Also, the "final" Animatable produced contains only the latest onAnimationEnd callback, and not all onAnimationEnd callbacks created for each Animation. Many solutions possible. Maybe we can discuss them to choose the best one :1. call scene.beginDirectAnimation in Animation.CreateAndStartAnimation instead of calling scene.beginAnimation : I think (not totally sure) that would create as many Animatables as Animations, each one corresponding to one single Animation, with its own onAnimationEnd callback. Drawbacks : we loose the interest of having only one Animatable for all those "quick" anims (CreateAndSartAnimation is meant to be a quick animation constructor)2. put an onAnimationEnd callback in Animation also, and call those callbacks on real animation end, and not on complete Animatable end/stop. This version is elegant and logical. Interest : that would be more usefull and obvious to allow distinct end callbacks for each animation created. But, first, in this case should we keep Animatable's onAnimationEnd callback and second I remember there was another problem or strange fact, but I don't remember what :lol: Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted November 10, 2015 Share Posted November 10, 2015 Rats! Actually the behavior should the 1. I have to fix it. Sorry about that Quote Link to comment Share on other sites More sharing options...
Vousk-prod. Posted November 10, 2015 Share Posted November 10, 2015 Oh, now I'm talking about that, is there a way to launch an animation backward ? If we use scene.beginAnimation(100, 0) it doesn't work. Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted November 10, 2015 Share Posted November 10, 2015 does speed ratio = -1 work? Quote Link to comment Share on other sites More sharing options...
Vousk-prod. Posted November 10, 2015 Share Posted November 10, 2015 Sorry about that With all the giant stuff you do all the time for everyone, no need for you to tell us "sorry", for anything ! Blax 1 Quote Link to comment Share on other sites More sharing options...
Vousk-prod. Posted November 10, 2015 Share Posted November 10, 2015 does speed ratio = -1 work? Oh, that's a nice idea, I never tried. Will test that next time I need that kind of anim. Quote Link to comment Share on other sites More sharing options...
Vousk-prod. Posted November 10, 2015 Share Posted November 10, 2015 does speed ratio = -1 work? I've just tried, unfortunatly it works only if loop is set to true. Loop false :scene.beginAnimation(mesh, 0, 100, false, -1); doesn't work (jump to frame 0)scene.beginAnimation(mesh, 100, 0, false, -1); doesn't work (jump to frame 0) Loop true :scene.beginAnimation(mesh, 0, 100, true, -1); doesn't work (jump to frame 0 and stay on it)scene.beginAnimation(mesh, 100, 0, true, -1); works (anim from 100 to 0, but anim is looping - of course -) Quote Link to comment Share on other sites More sharing options...
Vousk-prod. Posted November 10, 2015 Share Posted November 10, 2015 Hmm, another question, how can we go to a specific frame ? I can do scene.beginAnimation(mesh, 6, 7); to go frame 7 but that's not really efficient (and it introduces a slight movement not desired).scene.beginAnimation(mesh, 7, 7); doesn't work (and maybe it's a bit heavy to start an anim to go at one single frame.I presume difficulty for reaching a single frame is that correct value need to be interpolated taking all easings specified on the anim in consideration. Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted November 10, 2015 Share Posted November 10, 2015 You get the point: It is hard to evaluate the value of a key without having to compute all the plumbing Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.