ProfessorF Posted September 1, 2015 Share Posted September 1, 2015 Hi all, Okay so you have a character with multiple animations: idle, walk, run, etc. Is there a preferred way to do the animations? I've just been putting them all in one timeline and setting different start and stop points -- is that how you do it?Thanks in advance? - Nick Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted September 1, 2015 Share Posted September 1, 2015 Hey Prof! That's exactly how you do it: walk from key 0 to 20, run from 21 to 45 and so on Quote Link to comment Share on other sites More sharing options...
ProfessorF Posted September 1, 2015 Author Share Posted September 1, 2015 Thanks DeltaKosh. You're the man! You need to organize a Babylon.js Developer's Conference :-) Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted September 1, 2015 Share Posted September 1, 2015 I'm your man if you want me to talk at this conference altreality and HugoMcPhee 2 Quote Link to comment Share on other sites More sharing options...
JCPalmer Posted September 1, 2015 Share Posted September 1, 2015 That is not the only way, though it might be the most practical way given the capabilities of exporters. The other way, if you are using skeletons / bones would be to put each in it own BABYLON.Animation, inside of the animations ARRAY of each Bone. It is not surprising that very few people know this. Exporters dump everything in animations[0] & Fileloader.parseSkeleton() will only load the first, if there was more than 1. I have just coded a MORPH.SkeletonInterpolator as a subclass of POV.BeforeRenderer. This subclass will process MORH.SkeletalDeformation objects in it's event queue. SkeletalDeformations are a subclass of POV.MotionEvent, so they can actually incrementally move and rotate as the skeleton deforms, not just 'walk in place'. This is not a frame by frame replay system, so an animation could be expressed in as little as 2 poses. Walking probably 4, not 20. Not sure if it too late to mark a skeleton dirty in a before render or not. It has not been tested yet. May have to switch to an after render. The other great thing about an animations ARRAY for a bone that no one has a clue about: Having a reference skeleton for copying the animations from. Every time you wish have a rig do a common task like walking, you have to do all phases, even though someone less might have already done it. BabylonJS sorely needs a common humanoid skeleton. Unity has one. Right now for a MakeHuman runtime I am developing, 2 rigs are being looked at. I am not the expert in this area, so others are advising. The really good part is the new MHX2 importer for Blender is it creates the same shape keys I used in my speech testing, so the MH_runtime looks like it will be able to talk too. Quote Link to comment Share on other sites More sharing options...
ozRocker Posted September 1, 2015 Share Posted September 1, 2015 Are you saying its possible to morph animations now? So a character can run and shoot at the same time? Cool! Quote Link to comment Share on other sites More sharing options...
JCPalmer Posted September 3, 2015 Share Posted September 3, 2015 Yes, there is an extension called MORPH. It used a Mesh subclass, that the Tower of Babel exporter for Blender referenced if it found Blender shape keys. There was an experiment to see if meshes could talk, using a hand built head by Gryff. The tool is here: https://googledrive.com/host/0B6-s6ZjHyEwUSDVBUGpHOXdtbHc/ It was not perfect, but it quickly became obvious that unless a supply of bodies could be found that already had the mouth shape keys, speech could not be a "real" project. Make Human was coming out with a new version, 1.1, that looked like it would work, but it was not ready in December, so the project was mothballed. In the last week, I have restarted it. MH 1.1 is not yet production, but we are getting all the shape keys plus extras. I have fixed the exporter to get shape keys exported when you also have a skeleton. Have also written a skeleton interpolator in the MORPH extension, so it can run within the same before render as the vertex interpolator for shape keys. Lots of work still to be done. Quote Link to comment Share on other sites More sharing options...
ozRocker Posted September 3, 2015 Share Posted September 3, 2015 ohh, you're talking about morph targets / blend shapes. I was actually going to ask about that because I'm experimenting with it now. My original post was actually about combining armature animation, like a walking animation and a shooting animation together or smoothly transitioning from walking to standing idle Quote Link to comment Share on other sites More sharing options...
JCPalmer Posted September 3, 2015 Share Posted September 3, 2015 At first, I thought I would be not "combining animations", but realized we just have a terminology conflict. In my terminology, the skeletonInterpolator, only works with poses. It "performs" the animation from the current state to the desired pose. This is done in the time allotted, with integrated position & rotation changes. The base extension, POV, is queue based. You would use that directly is your mesh did not deform with either shape keys or armature. The MOPRH extension is built on top of POV, so position & rotation are in addition to deforming. So, you might have 4 poses that define running. You can construct an re-usable event series, which groups them. You could add that event series along with a # of repeats & acceleration to the queue. If events cause you to want change to a shooting pose, you can queue that series, deleting anything else in the queue if you wish. As discussed earlier, the poses would be frames of a BABYLON.Animation object inside the BABYLON.Bone.animations[]. I would just be reusing them for a slightly different purpose. 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.