StOneDOes Posted March 25 Share Posted March 25 Can we please have a way to pause the current animation, and then resume it? Use case: Player is climbing a ladder and then stops. Animation needs to stop on the given frame, and then be resumed when the player starts moving again. I don't think this can be done with the existing functions; you can choose which frame to start from, but I don't think you would know which frame you have stopped at. 1 1 Quote Link to comment Share on other sites More sharing options...
Josh Posted Tuesday at 09:19 PM Share Posted Tuesday at 09:19 PM In this situation, if you finish climbing the ladder, would it matter where you start the next animation from? Wouldn't any starting point work, since it would just transition from the ladder animation to the walking animation (or maybe a "get to the top" animation played in between the two. I kind of started moving the animation frame data back to the main thread to make that available. I'm not sure how it will work yet, but it would be convenient for things like timng footsteps. 1 Quote My job is to make tools you love, with the features you want, and performance you can't live without. Link to comment Share on other sites More sharing options...
StOneDOes Posted Wednesday at 07:22 AM Author Share Posted Wednesday at 07:22 AM Apologies if the use case was unclear; First person view game, you are climbing a ladder, so you have an animation of your hands climbing upward. Now you stop climbing, midway on the ladder. I expect that I can make my hand animation pause where it was (otherwise my hands would keep moving). Then I decide to continue climbing, so I would like the animation to continue from where it was. Hope that is more clear. EDIT: Just in case you did understand me, but are just seeking further clarification; Quote In this situation, if you finish climbing the ladder, would it matter where you start the next animation from? Wouldn't any starting point work, since it would just transition from the ladder animation to the walking animation (or maybe a "get to the top" animation played in between the two. I don't think it would necessarily matter, but I'm not sure of the implication. When I'm finished climbing I would just transition back to either hands-idle, or if you had a weapon out it would be like hands-holster, then weapon-unholster, and then weapon-idle. I probably could achieve this whole thing with a bit of guesswork but it wouldn't be an exact science. I would need to track the milliseconds passed since animation started so that I could calculate which frame I should be up to. Quote Link to comment Share on other sites More sharing options...
Josh Posted Wednesday at 10:28 AM Share Posted Wednesday at 10:28 AM Internally, the animation state looks something like this: struct QueuedAnimation { int sequence; int length; float duration; float speed; int mode; int frameoffset; float currentframe; }; Each animation node (analog to a bone, that lives only in the animation threads) stores an STL vector of these to track the animation state. I am thinking about feeding this data back to the main thread, to let the user read. It's not quite as simple as "get the current frame of the animation" because at any given time there could be 20 different animations in the stack. The most recently played animation is at the end, and older animations get removed once the later animations finish their blend transition in. But in most cases you could probably just get the last animation, consider it to be the current most important one, and get the current frame of that. Quote My job is to make tools you love, with the features you want, and performance you can't live without. Link to comment Share on other sites More sharing options...
StOneDOes Posted Saturday at 02:05 AM Author Share Posted Saturday at 02:05 AM Ok Sure. I don't know a lot about the implementation of animations under the hood so I can't really provide anything more than just the end-user suggestion. While I am here though, I do want to ask, would it be possible to play an animation in reverse? 1 Quote Link to comment Share on other sites More sharing options...
Josh Posted Saturday at 02:05 AM Share Posted Saturday at 02:05 AM Just now, StOneDOes said: While I am here though, I do want to ask, would it be possible to play an animation in reverse? It would probably not be that hard to add. What would be the purpose of this? 1 Quote My job is to make tools you love, with the features you want, and performance you can't live without. Link to comment Share on other sites More sharing options...
StOneDOes Posted Saturday at 02:12 AM Author Share Posted Saturday at 02:12 AM So rather than me having to pay someone to make a climb ladder up, and a climb ladder down animation, (also things like holster weapon, unholster weapon), I can just play one of them and then reverse it, so climb ladder up, and then play the same animation in reverse for climb ladder down. Not sure if it will perfect, but I think it will suffice for holster and unholster weapon. I guess it just depends on the complexity of the animation, but I'm sure me or someone else will find it useful. 1 1 Quote Link to comment Share on other sites More sharing options...
Josh Posted Saturday at 04:22 PM Share Posted Saturday at 04:22 PM Not a bad idea. Another option would also be to create a reversed animation in the model editor interface. Not sure which is better, but both are possible. 1 Quote My job is to make tools you love, with the features you want, and performance you can't live without. Link to comment Share on other sites More sharing options...
StOneDOes Posted Saturday at 04:42 PM Author Share Posted Saturday at 04:42 PM If you can do it in the editor that would be fine also, so long as it supports naming the animation track and saving it as a new track in the existing model. I think this makes it more user friendly than calling for reverse in code, but I don't know how much larger it makes the model file? Quote Link to comment Share on other sites More sharing options...
Dreikblack Posted Saturday at 04:49 PM Share Posted Saturday at 04:49 PM 26 minutes ago, Josh said: Not a bad idea. Another option would also be to create a reversed animation in the model editor interface. Not sure which is better, but both are possible. I need reverse animation via code once Quake model animation support will be added 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.