About Store Forum Documentation Contact



Post Reply 
Custom Characters and Animation query
Author Message
3DRaddict Offline
Member

Post: #1
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! grin
04-19-2015 08:10 PM
Visit this user's website Find all posts by this user Quote this message in a reply
Esenthel Offline
Administrator

Post: #2
RE: Custom Characters and Animation query
Hello,

There are a few animation tutorials in the "10 - Animation" folder of Tutorials project.

You can also take a look at Game.Chr source code:
https://github.com/Esenthel/EsenthelEngi...mation.cpp
04-19-2015 10:21 PM
Find all posts by this user Quote this message in a reply
3DRaddict Offline
Member

Post: #3
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
Visit this user's website Find all posts by this user Quote this message in a reply
Pherael Offline
Member

Post: #4
RE: Custom Characters and Animation query
You need to double click your animation and then select "loop" option.
04-20-2015 08:35 AM
Find all posts by this user Quote this message in a reply
3DRaddict Offline
Member

Post: #5
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
Visit this user's website Find all posts by this user Quote this message in a reply
3DRaddict Offline
Member

Post: #6
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
Visit this user's website Find all posts by this user Quote this message in a reply
Pherael Offline
Member

Post: #7
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
Find all posts by this user Quote this message in a reply
3DRaddict Offline
Member

Post: #8
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
Visit this user's website Find all posts by this user Quote this message in a reply
3DRaddict Offline
Member

Post: #9
RE: Custom Characters and Animation query
Quote:Also, I've noticed the bone orientation displays all wrong, even though there there is no distortion of the mesh or animation.

[Image: testdummy_frag.jpg]

No response on this... so I couldn't waste any more time fiddling around with 'Fragmotion' to get it right. I repeated the whole exercise using '3dsMax', with far better results:

[Image: testdummy_max.jpg]

With this correct bone orientation, I can now experiment with the EE ragdoll stuff.
04-27-2015 06:20 PM
Visit this user's website Find all posts by this user Quote this message in a reply
Pixel Perfect Offline
Member

Post: #10
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
Find all posts by this user Quote this message in a reply
3DRaddict Offline
Member

Post: #11
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:
[Image: fragMotion_testdummy_bvh_animation.jpg]

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
Visit this user's website Find all posts by this user Quote this message in a reply
TheElk Offline
Member

Post: #12
RE: Custom Characters and Animation query
@3DRaddict

I made a video on how to bone in fragmotion it is located in this post.



http://www.esenthel.com/community/showth...fragmotion

or





or just watch it.lol

Thank you
TheElk
04-27-2015 10:26 PM
Visit this user's website Find all posts by this user Quote this message in a reply
Rofar Offline
Member

Post: #13
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
Find all posts by this user Quote this message in a reply
3DRaddict Offline
Member

Post: #14
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. smile
04-27-2015 10:43 PM
Visit this user's website Find all posts by this user Quote this message in a reply
Pixel Perfect Offline
Member

Post: #15
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
Find all posts by this user Quote this message in a reply
Post Reply