3DRaddict
Member
|
Custom Characters and Animation query
I've hit another brick wall through lack of a relevent EE example/tutorial...
I've used Fragmotion to build a custom animated character which I've dragged into my EE project with no problems. The animation plays in the Animation Editor as expected. I place the character as an Object in the World Editor and give it the OBJ_CHAR class. I load the World into my Application and my custom character is displayed correctly. My query is with regard to producing the character's animation... this maybe easy to some, but what are the simple steps I must take in the code to get it working?
At the moment I'm the one who is animating...just going around in circles!
|
|
04-19-2015 08:10 PM |
|
Esenthel
Administrator
|
RE: Custom Characters and Animation query
|
|
04-19-2015 10:21 PM |
|
3DRaddict
Member
|
RE: Custom Characters and Animation query
As mentioned, I've been approaching it from having placed my animated character using the World Editor.
As an alternative, I did test it out using 'Sample01_Animation' in the Animations folder. All I did was replace the necessary lines:
Quote:chr=UID(1001384129, 1096106840, 3660194238, 2908128480); // load character
and
Quote:skel.animate(UID(3547006458, 1207610096, 2290556553, 1866117958), Time.time());
The animation just sticks at the first frame, whereas in the Animation Editor it runs perfectly. Also, I've noticed the bone orientation displays all wrong, even though there there is no distortion of the mesh or animation.
Here is the sample project containing my test animated character:
https://dl.dropboxusercontent.com/u/2104...helProject
|
|
04-20-2015 08:13 AM |
|
Pherael
Member
|
RE: Custom Characters and Animation query
You need to double click your animation and then select "loop" option.
|
|
04-20-2015 08:35 AM |
|
3DRaddict
Member
|
RE: Custom Characters and Animation query
Ahaa... thanks.
I guess there must be a 'loop' flag that one can set in code... I'll have to dig into the docs to see if I can find it.
@Esenthel:
I would be interested to know the reason for this:
Quote:Also, I've noticed the bone orientation displays all wrong, even though there there is no distortion of the mesh or animation.
In 'Fragmotion' the bones are all aligned correctly with the mesh, prior to export.
Even though I can use this example to directly place animated characters in my application, I would still like to pursue the original alternative of placing them in my World using the World Editor, and then access them from my code.
|
|
04-20-2015 09:05 AM |
|
3DRaddict
Member
|
RE: Custom Characters and Animation query
I'm now playing around with 'Sample12_Animations' in the 'Game Basics' folder, which is more geared towards my original query.
All I've done is replace 'Warrior' in the 'Sample' World with my animated character and replaced the custom animation UID with my own here:
Quote:attack.set(skel, UID(3547006458, 1207610096, 2290556553, 1866117958));
My animation plays only once on pressing 'Enter', but not continually like I require.
(This time I've ensured 'Loop' is set in the Animation Editor)
It really strikes me that the best way for me to proceed with minimum hassle is to load all my characters using code (as per my previous post) and not use the World Editor.
|
|
04-20-2015 04:15 PM |
|
Pherael
Member
|
RE: Custom Characters and Animation query
attack is Motion class. Motion class is help class for single (one time played) animation. Use skel.animete(...) for looped animation.
|
|
04-20-2015 04:23 PM |
|
3DRaddict
Member
|
RE: Custom Characters and Animation query
Thank you, Pherael, for your assistance. I think that, at last, I've caught on.
In all the years I've been programming, I've never really spent much time on character animations (most of the stuff I do is involved with hard core physical objects). However my Surfing simulation Project is dictating that I have to learn character animation, and fast !
|
|
04-20-2015 05:02 PM |
|
Pixel Perfect
Member
|
RE: Custom Characters and Animation query
Came to this a bit late but here is how to fix in Fragmotion incase anyone else needs to do this:
Set animation off (T Pose stance) and select the skeleton tab. Select each bone by name and double click on it to bring up the bone dialog box. Is there any rotation set for the bones or are they all set to zero?
My tests have shown where these are present in Fragmotion they are exported successfully to b3d and do import correctly in EE and the correct bone orientation is displayed.
|
|
04-27-2015 07:05 PM |
|
3DRaddict
Member
|
RE: Custom Characters and Animation query
@pixelperfect
I understand what you are saying... but not too sure if it applies in my particular case.
I have taken a .bvh animation (with first frame a Tpose) and loaded it into fragMotion... no mesh at this stage.
I then did a 'merge import' of my 'testdummy' mesh and skinned it to the skeleton, as so:
The bone orientations ARE zero, and exporting as a .b3d, then importing to EE gives the results I've posted here about.
I would be surprised and extemely happy if anyone could take my fragMotion .ugh file, and produce a correctly working animation with properly orientated bones in Esenthel.
Here's the zipped fragMotion file: https://dl.dropboxusercontent.com/u/2104...mation.rar
|
|
04-27-2015 10:15 PM |
|
TheElk
Member
|
RE: Custom Characters and Animation query
|
|
04-27-2015 10:26 PM |
|
Rofar
Member
|
RE: Custom Characters and Animation query
Export to ms3d and then import to Esenthel. Even better, before importing to Esenthel, open the ms3d in Milkshape and resave it. If you can't get that to work, I will grab your file and try it.
|
|
04-27-2015 10:28 PM |
|
3DRaddict
Member
|
RE: Custom Characters and Animation query
@TheElk
I actually watched your video before undertaking this project (very instructive and helpful!). The only difference is that I'm not building a skeleton from scratch... I'm using an existing .bvh skeleton and fixing a mesh to it.
@Rofar
I owned Milkshape a few years ago, but lost it somewhere along the way. So if you could try it out on my file, and set my mind at ease.
|
|
04-27-2015 10:43 PM |
|
Pixel Perfect
Member
|
RE: Custom Characters and Animation query
(04-27-2015 10:15 PM)3DRaddict Wrote: ...The bone orientations ARE zero, and exporting as a .b3d, then importing to EE gives the results I've posted here about.
Ah ok, a little misunderstanding here ... the bone orientations being zero IS the problem, it's basically saying they are all aligned in the same direction which is what you demonstrated in your example screen shot. You need to set the orientations for each bone was what I was meaning.
Unfortunately this isn't done automatically for you when creating the bones initially! The ELK's video demonstrates the bones being aligned.
[EDIT] Just saw Rofar's suggestion. If exporting it to Milkshape, opening it and resaving it fixes the bone orientations without having to do it manually then all the better. That's a useful tip!
(This post was last modified: 04-27-2015 11:34 PM by Pixel Perfect.)
|
|
04-27-2015 10:54 PM |
|