Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

AppGameKit Classic Chat / Animated 3D Models

Author
Message
Nieb
10
Years of Service
User Offline
Joined: 13th May 2014
Location: Lurking
Posted: 15th Jul 2016 06:32 Edited at: 21st Jul 2016 00:04


For those attempting to get a fully animated model into AppGameKit, attached is package demonstrating how to do so. Enjoy!

This is the .X exporter used:
http://www.cgdev.net/axe/download.php#xexporter
Free for personal use, $150 for commercial license.


Original Post:

Attachments

Login to view attachments
Nieb
10
Years of Service
User Offline
Joined: 13th May 2014
Location: Lurking
Posted: 15th Jul 2016 16:03 Edited at: 20th Jul 2016 23:41
That's strange, I just lost the top half of the model!


Also it doesn't seem to be interpolating between the last and first frame on loop.

Here is what I am currently working with:
http://snieb.com/ModelTest_2016-07-15.zip
janbo
16
Years of Service
User Offline
Joined: 10th Nov 2008
Location: Germany
Posted: 15th Jul 2016 17:33
Strage... I have no knowledge of animating or modelling ... so I can only say that it works if you let the animation start from 0-55.
But you got a very nice model there, what do you want to do with it ?

Using AGKv2 Tier1
Nieb
10
Years of Service
User Offline
Joined: 13th May 2014
Location: Lurking
Posted: 15th Jul 2016 23:35 Edited at: 17th Jul 2016 17:43
The run animation starts at 40, ends at 55.
Just using this model to test/figure-out how to get a functional animated model into AGK.
It was made for another project a few years ago: http://tesseract.gg/

It 3/4 works if the Print() commands are disabled, funny stuff.


The FBX version has the bone meshes showing and scatter about for some reason..
Blendman
10
Years of Service
User Offline
Joined: 17th Feb 2014
Location: Arkeos
Posted: 17th Jul 2016 08:13
Does your model use scaled bones ?
Because, I think AppGameKit can't open an animated model with scaled bones without errors.
AGK2 tier1 - http://www.dracaena-studio.com
Nieb
10
Years of Service
User Offline
Joined: 13th May 2014
Location: Lurking
Posted: 17th Jul 2016 17:45 Edited at: 17th Jul 2016 17:48
No scaling, only position and rotation were used in the animations.
Has anyone successfully got an animated model into AppGameKit? Is there a tutorial/example somewhere?

Which version of FBX exactly does AppGameKit support? The exporter for 3dsmax has about a dozen options and you can choose Binary or ASCII for each option.
Paul Johnston
TGC Developer
22
Years of Service
User Offline
Joined: 16th Nov 2002
Location: United Kingdom
Posted: 18th Jul 2016 15:30 Edited at: 18th Jul 2016 15:30
Quote: "The FBX version has the bone meshes showing and scatter about for some reason.."

AGK doesn't explicitly add any meshes for the bones, so they must be part of the model mesh. Is there an exporter setting to add/remove them?

Quote: "Which version of FBX exactly does AppGameKit support? The exporter for 3dsmax has about a dozen options and you can choose Binary or ASCII for each option."

We use the Open Asset Import Library so support should be pretty good, binary or text shouldn't matter, but I would expect binary to be smaller in file size.
Nieb
10
Years of Service
User Offline
Joined: 13th May 2014
Location: Lurking
Posted: 19th Jul 2016 04:25 Edited at: 24th Jul 2016 18:19
@Paul Johnston:
I don't see a way to not export the bone meshes with FBX.

With the .X file it doesn't interpolate between the last to the first frame when looping. (it skips)
If I start on a frame other than zero, the mesh gets messed up, I'm guessing because it doesn't know the initial position of the bones.

The MD5mesh file wouldn't load at all. (It's a fully function model which I've made for another GameEngine)
Is there a way to load the MD5anim files?

Is there a way to set the frame rate of a given animation?

I have attached what I'm currently working with. It has a .X .FBX and MD5mesh file in it. It also has the 3dsMax2016 file.


I apologize for bombarding you with so many questions.

Attachments

Login to view attachments
Blendman
10
Years of Service
User Offline
Joined: 17th Feb 2014
Location: Arkeos
Posted: 19th Jul 2016 08:49 Edited at: 19th Jul 2016 08:51
@Nieb :
Have you tried the dae export (collada) to see if it's better for you ?


Frame rate : do you mean the speed of animation ?
if yes, you can change it with SetObjectAnimationSpeed()

I have exported animated models to AppGameKit with DAE and it works as I want.
I don't use 3Dsmax, but blender (2.76), to create the model, rig, skin setup (weight), animation and export my model+animation in dae.
AGK2 tier1 - http://www.dracaena-studio.com
Stab in the Dark software
Valued Member
21
Years of Service
User Offline
Joined: 12th Dec 2002
Playing: Badges, I don't need no stinkin badges
Posted: 19th Jul 2016 15:38
When I run your code in Debug mode I get these 2 errors.

Quote: "Bone transform matrix contains scale values, scaling of bones is not supported and will be ignored in main.agc at line 27
Object animation contains scale values, scaling of bones is not supported and will be ignored in main.agc at line 27"


You need to remove all scaling from the bones in the default positions and from the animation key frames.
If you intend to use the ragdoll physics in AppGameKit then you must also zero all the rotations of the bones in the
skeletons default pose. To get the animation to play smoothly, the first frame of the run animation must match the last frame.
I do not use 3dsmax so I can not tell you how to do it in max but you can Google it.
I have made instructional videos on how to do this for a modeling software called Fragmotion.

https://forum.thegamecreators.com/thread/216652

I have attached a the model I repaired with Fragmotion.
I removed the scaling and rotations and fixed just the run animation.
Try this code with this model.




The coffee is lovely dark and deep,and I have code to write before I sleep.

Attachments

Login to view attachments
Nieb
10
Years of Service
User Offline
Joined: 13th May 2014
Location: Lurking
Posted: 19th Jul 2016 18:10 Edited at: 19th Jul 2016 19:20
Much thanks for all the assistance guys!
I'm currently testing DAE.

Quote: "yes, you can change it with SetObjectAnimationSpeed()"

I did not see that one, my bad, Took a closer look at the command list and found a few more animation commands, thanks!
Perhaps a separate header for "Animation" rather then mixing them in with "Objects".
https://www.appgamekit.com/documentation/Reference/3D.htm

Quote: "You need to remove all scaling from the bones in the default positions and from the animation key frames."

The model has no scaling, I'm guessing the exporter exported the scale keyframes anyways even though they are all ( 1.0, 1.0, 1.0 ).

Quote: "To get the animation to play smoothly, the first frame of the run animation must match the last frame."

If the last frame matches the first frame there will be a stutter in the animation.

Nieb
10
Years of Service
User Offline
Joined: 13th May 2014
Location: Lurking
Posted: 19th Jul 2016 18:40 Edited at: 19th Jul 2016 18:49
DAE attempts:
Both showing bone meshes and issues with the player mesh.
There are only a few limited options for both of these exporters.

OpenCollada Exporter:


Autodesk DAE Exporter:


Here's to hoping the MD5 format will work.
It seems to be a well established format and designed explicitly for games.
I also have personal experience with the 3dsmax exporter and know that it works, the mesh comes out correctly, animates, and with no bone meshes.
Stab in the Dark software
Valued Member
21
Years of Service
User Offline
Joined: 12th Dec 2002
Playing: Badges, I don't need no stinkin badges
Posted: 19th Jul 2016 19:03 Edited at: 19th Jul 2016 19:16
Quote: "The model has no scaling, I'm guessing the exporter exported the scale keyframes anyways even though they are all ( 0.0, 0.0, 0.0 )."


The model does have scaling. If you open the player.x in notepad you can see the scaling.
The version I attached above has it removed.

Quote: "If the last frame matches the first frame there will be a stutter in the animation."


No, it will not. Did you try the model I fixed with the 2 lines of code?
The coffee is lovely dark and deep,and I have code to write before I sleep.
Nieb
10
Years of Service
User Offline
Joined: 13th May 2014
Location: Lurking
Posted: 19th Jul 2016 20:00 Edited at: 19th Jul 2016 20:26
All of the scaling keyframes say:

which is effectively no scaling.
(tag_weapon does have 0.9, 0.9, 0.9, but that bone is not attached to anything and is only used by the game)

Yes I tried your edited version:
http://snieb.com/player_frag.wmv
Notice the stutter?
Also all the vertical movement seems to have been lost.

Here is what it should look like:
http://snieb.com/player_tesseract.wmv
Blendman
10
Years of Service
User Offline
Joined: 17th Feb 2014
Location: Arkeos
Posted: 20th Jul 2016 11:03
Hi Nieb, in your player.x, I have find some scaling issue (line 29032) :


and (line 29207, 30667,30470...) :


I guess this 0.999999 or 1.000001 could be the matter (not sur)
AGK2 tier1 - http://www.dracaena-studio.com
Stab in the Dark software
Valued Member
21
Years of Service
User Offline
Joined: 12th Dec 2002
Playing: Badges, I don't need no stinkin badges
Posted: 20th Jul 2016 16:37 Edited at: 20th Jul 2016 16:42
Quote: "which is effectively no scaling.
(tag_weapon does have 0.9, 0.9, 0.9, but that bone is not attached to anything and is only used by the game)."


1.0,1.0,1.0 is no scaling anything else is scaling.
The bone is part of the model and gets loaded by AGK.

Quote: "Yes I tried your edited version:
http://snieb.com/player_frag.wmv
Notice the stutter?
Also all the vertical movement seems to have been lost"


I was in a hurry and created the error that caused the loss of the vertical movement.
This error also caused the run animation to stutter. I have attached the fixed model.
Use this line to get the run to play smoothly.



In conclusion the original model had scaling which caused the model to load deformed because
AGK ignores any animation frames with scaling.
The original run animation was not created correctly to play smoothly. It does not play smoothly in
3 different modeling programs I tested it in. I added 1 frame to the end of the run animation to fix this.
I did not fix any of the other animations which may have the same problem.
Your tesseract video shows it playing smoothly so I can only conclude it is not the same animation
or they compensated for it in the code of the engine.

P.S. I will create a video showing how I fixed this model in Fragmotion.
The coffee is lovely dark and deep,and I have code to write before I sleep.

Attachments

Login to view attachments
Nieb
10
Years of Service
User Offline
Joined: 13th May 2014
Location: Lurking
Posted: 20th Jul 2016 19:58 Edited at: 20th Jul 2016 20:01
I was able to find a .X exporter that works much better (no issues):
http://www.cgdev.net/axe/download.php#xexporter
The licensing price is a bit steep through.

Quote: "PlayObjectAnimation( Bones, "", 40, 56, 1, 0.5 )"

Duplicating the first frame at the end does indeed work.
That's interesting, it seems AppGameKit drops the time of last frame and only uses it to know how to return to the first frame. Good to know.

The top is how I'm used to seeing animation work.
It seems AppGameKit works like the bottom example.

Much thanks for working with me to figure this out!
I'll put together a demo project for others to learn from.
Nieb
10
Years of Service
User Offline
Joined: 13th May 2014
Location: Lurking
Posted: 20th Jul 2016 23:08
I've upload an animation demo.
Check original post.
Stab in the Dark software
Valued Member
21
Years of Service
User Offline
Joined: 12th Dec 2002
Playing: Badges, I don't need no stinkin badges
Posted: 20th Jul 2016 23:48 Edited at: 21st Jul 2016 16:32
That exporter is pricey. Does that exporter remove any scaling and zero the bones rotations?
Most models are created incorrectly because the modeler does not know that after creating
the bones rig that they must zero the rigs transforms ( rotations ) before assigning vertices and
animating. If the rigs transforms are not zeroed it can cause strange behavior when the model
animates. Also if you intend to use the 3D physics ragdoll in AppGameKit you must zero the transforms.
This can be done in 3dsmax, Bond1 made a video on how to do it in max.

https://www.youtube.com/watch?v=g1D2zWMnI1M

This forum member is making a exporter for max check it out.
Not sure if it exports animation.

https://forum.thegamecreators.com/thread/216609

I guess your model will use the character controller so check out my AppGameKit demo
on how to use the 3D physics.

https://forum.thegamecreators.com/thread/216683

P.S. The model in your demo does not have the bones rotations zeroed.
The coffee is lovely dark and deep,and I have code to write before I sleep.

Login to post a reply

Server time is: 2024-11-25 03:32:51
Your offset time is: 2024-11-25 03:32:51