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.

3 Dimensional Chat / Flag 3D Animation in Blender for AGK2 or DBPro

Author
Message
Chrissell
6
Years of Service
User Offline
Joined: 2nd Apr 2013
Location:
Posted: 28th Nov 2018 22:10
Hi Ive been trying to export a 3D animated flag form Blender into AGK2, gameguru or DBpro in the .X format. My animation runs from 0 to 100. When I play the animation in Blender fine is works but when I try and play it in gameguru,agk2 or DBpro its static? wont animate. I can import a static frame which looks really nice. Just having trouble importing the animations. I also have been making the keyframes in Blender as Location,rotation,scale. Any tips would be welcome. Is it possible?
C.R.Sellen
lucastyler
User Offline
Joined: 29th Jan 2019
Location:
Posted: 31st Jan 2019 06:08
Same here. I'm having trouble importing the animations
Golelorn
2
Years of Service
User Offline
Joined: 20th Nov 2016
Location:
Posted: 31st Jan 2019 12:34 Edited at: 31st Jan 2019 12:36
Are you sure you're exporting the bones? What is the code you're using to load and animate?

If you're exporting out of Blender to .X make sure the options export animations and export armature are selected.

edit: I don't think it accepts the NLA editor. You have to use the Dope sheet, and create 1 massive animation. I could be wrong, but if I recall correctly that's how it is.
Chrissell
6
Years of Service
User Offline
Joined: 2nd Apr 2013
Location:
Posted: 4th Feb 2019 20:26
Thanks for the replies. Ive just saved the animation as a .MP4 file from Blender and played it in AGK2 and it looks nice.

Just when using this code. It doesnt seem to animate in the engine.

// Project: FlagAnimTest
// Created: 2018-11-24

// show all errors
SetErrorMode(2)

// set window properties
SetWindowTitle( "FlagAnimTest" )
SetWindowSize( 1024, 768, 0 )
SetWindowAllowResize( 1 ) // allow the user to resize the window

// set display properties
SetVirtualResolution( 1024, 768 ) // doesn't have to match the window
SetOrientationAllowed( 1, 1, 1, 1 ) // allow both portrait and landscape on mobile devices
SetSyncRate( 30, 0 ) // 30fps instead of 60 to save battery
SetScissor( 0,0,0,0 ) // use the maximum available screen space, no black borders
UseNewDefaultFonts( 1 ) // since version 2.0.22 we can use nicer default fonts


LoadObjectWithChildren(1,"FlagUKFeb.obj")
LoadImage(1,"US.jpg")
SetObjectImage(1,1,1)

name$ = GetObjectAnimationName(1,1)

RotateObjectLocalY(1,90)

do
PlayObjectAnimation(1,name$,1,100,0,1)
Sync()
loop
C.R.Sellen
Golelorn
2
Years of Service
User Offline
Joined: 20th Nov 2016
Location:
Posted: 8th Feb 2019 20:12 Edited at: 8th Feb 2019 20:16
.obj does not export bones or animation. So, that is the biggest issue.

For me the easiest to work with is FBX or DAE. When you export out of blender with FBX you need to select "Selected Objects Only" Just export the Armature and Mesh(both will need to be selected!). Then change the scale to FBX Units Scale or your object will be stupid massive. Then go over to the armature tab unselect "LeafBones" and select "Deform Bones only".

DAE animations are in seconds, not frames. So, it may be best just to use FBX.





Also, your playanimation is in your do loop. I believe this will make it play the 1st frame on a loop?

If getobjectisanimating(id) = 0 then animate is a good way to test it in the main do loop.

Attachments

Login to view attachments
Chrissell
6
Years of Service
User Offline
Joined: 2nd Apr 2013
Location:
Posted: 10th Feb 2019 14:53
Hi Thanks for the replies.
I think im doing something wrong in Blender before exporting. I get an error message when I compile and run in AGK2 saying
that the object is not set up for animation. I have attatched a pic of my blender screen with the dopesheet. So you can see
if there is anything wrong there?
Thanks
C.R.Sellen

Attachments

Login to view attachments
Golelorn
2
Years of Service
User Offline
Joined: 20th Nov 2016
Location:
Posted: 10th Feb 2019 22:45
Usually, that means you did not export the bones or mesh.
Chrissell
6
Years of Service
User Offline
Joined: 2nd Apr 2013
Location:
Posted: 21st Feb 2019 21:59
I think I need to do some more reading on animation in Blender. I have done a simple animation in Blender with bones and meshes and it all worked fine. I must try making a flag with bones and see if that works.
Thanks very much for the help.
C.R.Sellen
Golelorn
2
Years of Service
User Offline
Joined: 20th Nov 2016
Location:
Posted: 24th Feb 2019 02:33
Personally, I think a shader would work a lot better to move the vertices around on a flag.

Good place to start.
https://forum.unity.com/threads/waving-flag-shader-feedback-please.19575/

I have some free time, and need a break from my current project. If you want to send me the blender file and your texture, I will write a shader and document the code.
Chrissell
6
Years of Service
User Offline
Joined: 2nd Apr 2013
Location:
Posted: 25th Feb 2019 12:36
That would be so great.
I tried doing a simple animated flag with bones and it worked in AGK2. Was well pleased. I need to spend a bit more time on it to make it look more detailed.
I will attach my blender and texture file with this message.
Thanks for your help
C.R.Sellen

Attachments

Login to view attachments
fubarpk
Moderator
14
Years of Service
Recently Online
Joined: 11th Jan 2005
Location: Adelaide
Posted: 12th Mar 2019 11:04
Chafari has a great thread that shows quite clearly how to export .x animations in blender
https://forum.thegamecreators.com/thread/223848
fubar
Chrissell
6
Years of Service
User Offline
Joined: 2nd Apr 2013
Location:
Posted: 13th Mar 2019 12:26
Thanks I will give it a try
C.R.Sellen
smerf
14
Years of Service
User Offline
Joined: 24th Feb 2005
Location: nm usa
Posted: 18th Mar 2019 06:40 Edited at: 18th Mar 2019 06:45




only use.x and these export settings from blender only way ive ever been able to make it work



all you need mate enjoy
A child's dream never dies.





Attachments

Login to view attachments
Chrissell
6
Years of Service
User Offline
Joined: 2nd Apr 2013
Location:
Posted: 31st Mar 2019 20:17
Thanks for your help Smerf
C.R.Sellen

Login to post a reply

Server time is: 2019-06-26 06:44:41
Your offset time is: 2019-06-26 06:44:41