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 / Animation not working as intended

Author
Message
Golelorn
8
Years of Service
User Offline
Joined: 20th Nov 2016
Location:
Posted: 8th Apr 2017 20:44 Edited at: 8th Apr 2017 21:17
Hi,

I have a placeholder object I'm using to learn. I've roughly animated it in blender. I have 72 animations, walk, swing, hit, and die. He walks fine. He swings fine. But once I add in the hit and die animations it makes him bend backwards for very animation... No scaling is on the bones, or mesh. I am unable to get it to work in .x. I have been using .dae.

Another issue, The playobjectanimation will not function unless I let the entire 72 keyframes play. If I just try PlayObjectAnimation( SkeletonEnemy, "", 1, 40, 1, .25 ) it starts at frame 40 plays to the end, and doesn't loop.

I appreciate any help in telling me why he is bent over backwards in AGK. He was not that way until I added keyframe 50 to 72. I delete those, and he matches Blender exactly, but the playobjectanimation still doesn't play the correct frames, unless I let the entire thing play.

Skeleton is with all the animatoins

and skeleton1 is the one with the animations that work correctly in AGK

Attachments

Login to view attachments
Golelorn
8
Years of Service
User Offline
Joined: 20th Nov 2016
Location:
Posted: 8th Apr 2017 21:55
OK, so I abandoned .dae, and exported to .x, correctly. Not sure what I was doing wrong before, and this is now working as intended. Playanimation works perfect. Not sure why the .dae was going so haywire.

To export to .x

Check export mesh, export normals, reference... as textures, export skin weights, apply modifiers, export armature bones, export rest position, export animations.


I tried out seconds with .dae. But it would always start out at 0 seconds. I used keyframe/fps, but it only worked on ending the animation. Couldn't figure out how to start it anything other than 0.

Hope this helps someone. I've spent the last week trying to figure out which export to use. .X seems to be the only one I can animate properly.
Golelorn
8
Years of Service
User Offline
Joined: 20th Nov 2016
Location:
Posted: 9th Apr 2017 02:09 Edited at: 9th Apr 2017 02:10
I now have to laugh... I don't know if I didn't notice before or something changed. But now the skeleton is holding the sword in the opposite hand in AGK... I have no idea how that is possible, and not screw the mesh up. The animations work perfectly. I actually redid the animation to have more fluid motion. So, I don't know if I somehow unknowingly flipped it, but it looks like somehow I did...

Really, shouldn't be this wonky.

Attachments

Login to view attachments
nz0
AGK Developer
17
Years of Service
User Offline
Joined: 13th Jun 2007
Location: Cheshire,UK
Posted: 9th Apr 2017 11:51
Just so as you don't find this out later, can you try cloning your animated object and confirm if it clones correctly?

I'm guessing you aren't planning on loading all instances of your animated models from disk...
Golelorn
8
Years of Service
User Offline
Joined: 20th Nov 2016
Location:
Posted: 9th Apr 2017 12:15 Edited at: 9th Apr 2017 12:16
I will try. I actually went back to using .dae(since the .x model decided he was lefthanded).

If I put in actual time in seconds instead of a math formula the start and end frames work. No idea why 32/33 was bugging it out, but it was.
Golelorn
8
Years of Service
User Offline
Joined: 20th Nov 2016
Location:
Posted: 9th Apr 2017 12:37
Hey nz0,

clonetest = CloneObject(SkeletonEnemy)
SetObjectPosition(Clonetest, 5,5,0)
SetObjectAnimationSpeed(Clonetest, .8)
PlayObjectAnimation(Clonetest, "", .1, 1, 1, 0)

Gave me two little skellies walking across my screen.
nz0
AGK Developer
17
Years of Service
User Offline
Joined: 13th Jun 2007
Location: Cheshire,UK
Posted: 9th Apr 2017 23:29
So just to clarify, you are exporting DAE from blender?

I have another problem thread regarding cloning .X animations
So SkeletonEnemy was loaded with LoadObjectWithChildren() ?
Mobiius
Valued Member
21
Years of Service
User Offline
Joined: 27th Feb 2003
Location: The Cold North
Posted: 10th Apr 2017 08:54
Quote: "No idea why 32/33 was bugging it out, but it was."

Because integer division.
You needed to use 32.0/33.0
Signature removed by mod because it's larger than 600x120... please resize and try again.
Golelorn
8
Years of Service
User Offline
Joined: 20th Nov 2016
Location:
Posted: 13th Apr 2017 03:01 Edited at: 13th Apr 2017 03:05
nZ0, yes I am using .dae. .X was flipping my image, although, I believe I found a solution. Exporting with the x-axis up(with right-handed coords). So, I may go back to .x, because .dae is extremely finicky. One mistake, and I have to redo my entire animation sheet(dope sheet).

I've noticed using .dae I have to have the bone roll to 0 degrees on all bones, and scale has to be 1 on all objects and armatures. I didn't need to be so careful with .x. I've finally gotten a model I made myself to work properly in .dae. But, again, its so finicky and prone to error I may just give up on it and use .x.

I finally was able to get .fbx usable on a model. I have zero idea why, and why it doesn't work on others.

Mobiius, I will see if that works.. Although, I could have sworn I was not using that for any other combos. Just for some reason 32/33 was not working. That will be much better that my current solution. Thank you, sir.

PS.
I've attached a blender file that works if you export to .x. Its very low poly. Hell, the sword has more polys than the person, lol. Also, the animation is only a test. But, if it helps someone learn, great. This will not work in .dae due to scaling issues. I've abandoned this little guy.

Attachments

Login to view attachments
nz0
AGK Developer
17
Years of Service
User Offline
Joined: 13th Jun 2007
Location: Cheshire,UK
Posted: 14th Apr 2017 12:18
OK, so I'm back to .X exported from Lightwave again.
The cloning problem has been acknowledged by Paul and I have a workaround, so I'll carry on with that method for now as it appears to be correct in all other aspects (so far!)

The fragmotion .X export was also correct for me in the trial version, but that would end up being another piece of software to buy JUST for converting .X
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: 14th Apr 2017 13:36
Quote: "I've noticed using .dae I have to have the bone roll to 0 degrees on all bones, and scale has to be 1 on all objects and armatures"


AGK can not handle scaling on bones(armatures). All scaling must be removed no matter what format you use.
The coffee is lovely dark and deep,and I have code to write before I sleep.
Jack
20
Years of Service
User Offline
Joined: 4th Oct 2004
Location: [Germany]
Posted: 15th Apr 2017 15:27
AGK is using the open asset import library to load 3d assets,
even though AppGameKit can't handle all formats provided in the lib.

http://www.assimp.org

I have found detailed information about UV maps limit, scaling of bones inside the manual of this lib.

[/url]
Golelorn
8
Years of Service
User Offline
Joined: 20th Nov 2016
Location:
Posted: 17th Apr 2017 01:57
Thanks, Jack!

I've learned quite abit in the 3 or 4 weeks I've been trying to use 3d. I think I will write something and post it once I have all the assets imported.

I downloaded a model from the unity store to test things out, and I'll be damned if it didn't work perfectly in AGK. .fbx format. I'm still leery of buying something, because the model I am assuming was done by a real pro. The animation was way too good. I'd hate to get stuck with something unusable or I have to put a ton of work into to fix.

I think I pretty much have everything figured out to export to .dae from blender.

Stab,

I recently tried to play a model that had only the mesh scaled, and it was warping in AGK. When I fixed the scaling it was fine. I've also noticed mesh can't be touching or there is warping. Now that is through blender, so maybe its because of that. I'm starting to think blenders exporting is the problem, and not AGK.
nz0
AGK Developer
17
Years of Service
User Offline
Joined: 13th Jun 2007
Location: Cheshire,UK
Posted: 19th Apr 2017 00:58
Golelorn: I've found that the animated character isn't the end of the story.
Once you have your animation, you quickly find that your character needs to have some programmatic control, such as where he points his arm (gun) or looks (head). Then you end up taking over that bone to animate manually anyway. Pretty soon, I've found that I've almost taken over half of my hard won animation effects exported from the 3D package to manual control

I like the animation object for structure and collection of bones and child objects, but I'm currently rethinking about how much animation I actually put into the model and how much I want to just manage myself once the rigged character is loaded.

Golelorn
8
Years of Service
User Offline
Joined: 20th Nov 2016
Location:
Posted: 2nd May 2017 23:12
nz0, I think(know) you're way ahead of me as a programmer. I didn't even know you can control the bones? I am not sure I want to tackle that, as I am still learning blender.


I have finally figured out what is wrong with blender and exports to .dae. Its a very specific problem if you're using the location copy constraint. Which is great for rendering 2d/iso spritesheets. But when converting to DAE constraints are wiped out. So you have a bone with essentially no parent, and the mesh is all over the place. I was only using this on the feet. Once I got rid of that constraint, it was perfect. Of course, it does take more work to manually adjust the foot bones. You can still use IK, just not the location copy constraint.

Definitely needs to be a guide with working from blender to AGK.

Login to post a reply

Server time is: 2024-11-24 16:29:23
Your offset time is: 2024-11-24 16:29:23