Home › Forums › Puzzles › How to reverse an animation clip from its current frame rather than at its last
- This topic has 11 replies, 4 voices, and was last updated 2 years, 4 months ago by fred7.
-
AuthorPosts
-
2019-08-01 at 2:27 pm #17440D3PixelCustomer
Hi
I have a model with 20 parts, I have a HTML button called “disassemble” that plays all animation clips so the model explodes outwards. It does this with a 0.5 sec offset of each part so they all play quickly rather than waiting for a previous clip to finish. It takes about 4 seconds to complete.
However, how can I make it play in reverse if the user presses “assemble” while the disassemble animation is still playing. I need to reverse the animation clips from their current frame for a smooth effect but having difficulty working out the puzzle to make this happen.
Any help would be much appreciated.
3D Animation and Web3D services - www.d3pixel.co.uk
2019-08-02 at 7:18 am #17446Yuri KovelenovStaff2019-08-02 at 1:57 pm #17455D3PixelCustomerHi Yuri
I will try and do this in JS instead then. Thanks for answering.
3D Animation and Web3D services - www.d3pixel.co.uk
2019-08-02 at 3:23 pm #17459Yuri KovelenovStaffYou can check the code generated by the play animation and pause/resume animation puzzles. It can be seen from visual_logic.js. A quick and dirty solution would be just add the reverse function to the resume animation puzzle code, so that it always changes the direction of animation once resumed.
2019-08-02 at 5:06 pm #17461D3PixelCustomerGreat, will look there first thanks.
3D Animation and Web3D services - www.d3pixel.co.uk
2019-08-03 at 11:19 am #17474D3PixelCustomerHi Yuri
Adding
rev = true; if (rev) timeScale *= -1;
to
case "RESUME":
doesn’t reverse the frames as I assume the rev parameter is being passed in constantly as false from the puzzle so I can not override it later in the case statement. Adding in the entire timeScale code from PLAY check into the RESUME check also did not reverse the frames.
Any ideas?
Thanks3D Animation and Web3D services - www.d3pixel.co.uk
2019-08-05 at 7:16 am #17497Yuri KovelenovStaff2019-08-05 at 9:44 am #17533D3PixelCustomerFantastic, that worked perfectly. So I should have been modifying the action, I get that now. Thanks Yuri.
3D Animation and Web3D services - www.d3pixel.co.uk
2019-08-05 at 10:06 am #17537Yuri KovelenovStaff2022-08-22 at 12:51 pm #55092fred7CustomerHello,
Is this now possible to do with puzzles? I need exactly the same. I got a structure which flips open and can be closed again with two HTML buttons. For the shape key object it works perfectly. Just need it for the animated object.Please see the screenshot attached.
Thank You!
Attachments:
You must be logged in to view attached files.2022-08-22 at 2:07 pm #55094kdvParticipantUse the
get animation frame
puzzle to set the last frame in the reversed animation or the first frame in the direct animation.Puzzles and JS coding. Fast and expensive.
If you don’t see the meaning in something it primarily means that you just don’t see it but not the absence of the meaning at all.
2022-08-22 at 2:34 pm #55095fred7CustomerMany thanks! Tried that puzzle before, but did put it wrong.
-
AuthorPosts
- You must be logged in to reply to this topic.