Posted: 26th Sep 2021 14:51
Hi, i hope someone can help me get started with my 1st 3D character to animate.
I've downloaded a character from Mixamo in both fbx and dae formats and also a basic "walk" in both formats to try to get him to move in AGK.
I have also imported into Blender and then exported as .obj as a third format option.
No problems using LoadObject to get the character displayed just standing but i seem to have tried everything to get the "walk" part loaded and working but without any success whatsoever.

Could someone point me in the right direction to get the animation part to work?

Thank you
Posted: 26th Sep 2021 15:18
You need to use LoadObjectWithChildren for animation and found you need
to call SetObjectScalePermanent to adjust the size of the model.

I currently use this function to animate the object.

+ Code Snippet
int LoadModel(const char* model, const char* model_texture, int px, int pz)
{
  int blockID = agk::LoadObjectWithChildren(model);
  agk::SetObjectImage(blockID, agk::LoadImage(model_texture), 0);
  agk::SetObjectScalePermanent(blockID, 0.25, 0.25, 0.25);
  agk::SetObjectPosition(blockID, px, 0, pz);
  agk::SetObjectScreenCulling(blockID, 1);
  
  agk::SetObjectAnimationSpeed(blockID, 25.0);
  agk::PlayObjectAnimation(blockID, "AnimStack::mixamo.com", 1, -1, 1, 0);
  
  return blockID;
}


Hope it helps.
Posted: 26th Sep 2021 16:17
Hi tboy
Many thanks for your coding.
Although i get some animation, mainly flashing object, its not really animating for me.
I have tried to simplify your coding and applied it directly but animation speed may be far far far too fast or something else is wrong.
Even trying to adjust animation speed to 0.01 doesn't change anything for the better, a value of "0" doesn't do anything either.
+ Code Snippet
LoadObjectWithChildren(10,"Walking.dae")
LoadImage(10,"Remy_Body_Diffuse.png")
setobjectimage(10,10,0)
SetObjectScalePermanent(10, 1,1,1)
setobjectposition(10,0,0,0)
SetObjectScreenCulling(10, 1)
SetObjectAnimationSpeed(10, 1)
PlayObjectAnimation(10, "", 1, -1, 1,1 )


Can you spot anything in my code which is causing it not to work?

Thanks again
Posted: 26th Sep 2021 16:50
Hmm stranger and stranger.
Loading object using LoadObject( loads the object as expected but unfortunately static
Loading object using LoadObjectWithChildren( totally distorts the object beyond recognition but it does give some sort of motion.

However loading the dae object back into Blender allows perfect image with animation.

Still stuck i'm afraid.
Posted: 26th Sep 2021 17:41
The Mixamo to AppGameKit workflow can be a bit of a pain, you need to export the files from blender v2.79 else you get the distortion thing going on, I have not managed to get any animated models at all with versions above 2.79 to work

I always use FBX for best results

When exporting from blender 2.79 make sure FBX scale is set, that should take care of the scaling issue

I believe the distortion comes from bones being scaled in the animation but what I can not figure out is why animations with no bone scaling still distort (and if you run in debug you get an error saying the bones are scaled), it seems blender 2.79 does not export the bone scaling and works fine

Like I said, its a pain
Posted: 26th Sep 2021 18:25
Hi PartTimeCoder
I'm using Blender v2.8 but did what you said and it works but minus the textures.
i'll spend a few days trying to sort that out then i should be ok.

Thank you all very much for your help
Posted: 26th Sep 2021 18:29
@Battoad

I had the distortion problem before, but I found out that if you export the FBX file from mixamo as FBX 7.4 format it seems to correct the issue, I don't use Blender.

In terms of speed, I usually enable VSync but export the character animation from mixamo using 30 FPS.

Let me know how you get on.

This is what I am working on at the moment.

Posted: 26th Sep 2021 18:39
@tboy
Yes brill. downloading from Mixamo as fbx v 7.4 works without having to go back into Blender.
I forgot that i didnt load the textures before but that works as well.

Its cracked, a big thank you
Posted: 26th Sep 2021 19:11
Yes brill. downloading from Mixamo as fbx v 7.4 works without having to go back into Blender.


Awesome, but when I download from Mixamo I usally load into blender and add a bone or 2 for attachments, a sword, a gun,, hat, backpack etc etc, does it affect blenders output or does it still distort?