Answered

Humanoid and weapon (generic) animation export

Tabornok 3 years ago updated by Peter - Soxware Developer 3 years ago 10

Hi,

My problem is, how can I separate from one humanoid project to a generic (weapon) and humanoid (character) animation?

The timeline does not work in a humanoid project.

Animation cannot be convert to humanoid to generic or gen. to human.

Only character movement is played.

There are two different animators, one for the weapon, one for the character, so I need a generic and human.

Would also solve my problem if I somehow could play the weapon animation, to adjust the character, but it doesn't work because you can't play it at once which is fucking annoying, because so it makes no sense to the program.

I did the animations in blender, but I'm fucked because they're not fucking correct, however, animation cannot be combined with this program. 

It's just fantastically complicated and useless... HELP

it's just that I can do generic animation, it just won't be correct for the character if I convert to humanoid.

Image 739

Image 740

Image 741

Image 742

UMotion Version:
Unity Version:
2020.3

Answer

Answer
Answered

Hi Tabornok,

thank you very much for your support request.

The timeline does not work in a humanoid project.

You mean Unity Timeline? Unity Timeline does support humanoid characters. What makes you think that Unity Timeline does not support humanoid characters?

Animation cannot be convert to humanoid to generic or gen. to human.

You can convert animations with UMotion. Exporting to FBX is one way to do it (you can then decide in the FBX settings if you want the animation to be generic or humanoid).


When you want to directly export to *.anim, this is the way to go:

  1. Duplicate your humanoid character's FBX file.
  2. Change the rig of the duplicated character to "generic".
  3. Instantiate your generic character in the scene and assign the gun to it (at the same place in the hierarchy as in the original humanoid character).
  4. Create a new generic UMotion project and assign your new generic character + gun setup.
  5. Now import the animation clips of your humanoid UMotion project by selecting your humanoid UMotion project instead of individual *.anim clips.
  6. Now you have your humanoid animations imported in your generic project thus converted to generic and you can now export them to a generic *.anim.
There are two different animators, one for the weapon, one for the character, so I need a generic and human.

I recommend to only use two separate animators when the animations don't interact with each other. As in your case, the character and it's hands interact a lot with the gun, it's counter intuitive to use two separate animators. Try to use only one animator instead.

Please let me know in case you have any follow-up questions.

Best regards,
Peter

Answer
Answered

Hi Tabornok,

thank you very much for your support request.

The timeline does not work in a humanoid project.

You mean Unity Timeline? Unity Timeline does support humanoid characters. What makes you think that Unity Timeline does not support humanoid characters?

Animation cannot be convert to humanoid to generic or gen. to human.

You can convert animations with UMotion. Exporting to FBX is one way to do it (you can then decide in the FBX settings if you want the animation to be generic or humanoid).


When you want to directly export to *.anim, this is the way to go:

  1. Duplicate your humanoid character's FBX file.
  2. Change the rig of the duplicated character to "generic".
  3. Instantiate your generic character in the scene and assign the gun to it (at the same place in the hierarchy as in the original humanoid character).
  4. Create a new generic UMotion project and assign your new generic character + gun setup.
  5. Now import the animation clips of your humanoid UMotion project by selecting your humanoid UMotion project instead of individual *.anim clips.
  6. Now you have your humanoid animations imported in your generic project thus converted to generic and you can now export them to a generic *.anim.
There are two different animators, one for the weapon, one for the character, so I need a generic and human.

I recommend to only use two separate animators when the animations don't interact with each other. As in your case, the character and it's hands interact a lot with the gun, it's counter intuitive to use two separate animators. Try to use only one animator instead.

Please let me know in case you have any follow-up questions.

Best regards,
Peter


"The timeline does not work in a humanoid project." ***

in video


"Animation cannot be convert to humanoid to generic or gen. to human" ***


(in generic project) I opened it from a humanoid project the animations, so it doesn't work.

Generic character after import animations from project never started.


And I just noticed the keyframes are missing from the gun, and you can see that in the picture, I was animating a moving gun and now it's gone. I may be an idiot, but then I ask you how to do anything here safely, because if I do the animation in Blender, it stays there, it may be pointless to do animation there because it will never be correct in unity. 


https://forum.unity.com/threads/generic-to-humanoid-is-not-correct.1124848/

I don't even know how they thought that, you can never set the character to be correct as humanoid.


I understand you'd prefer one animator, however a gun animation is not played by the animator below the character, I had all the keyframes and the animator was common, of course different armature, so I have no idea how to put this together, and I couldn't find any help. 


Nothing ever works for me.


But maybe I don't give a shit about it and then I'll wipe it all the fuck off. I haven't been able to do an animation in a month. it's a joke. I'm not even gonna say it because it's making me nervous...


Thanks for showing me the video. This helps me to better understand your situation.

So this is your issue as I understand it:

  1. You have two separate animation files, the human animation and the gun animation.
  2. You want to edit both at the same time.

Have you purchased the animations from the asset store and have they been split from the beginning on, or have you split those animations yourself? If you've split the animations yourself, please try to use the combined ones instead. This should make your life much easier.


If you only have the split files (because you got them from the asset store), here is how you can combine two separate animations into one. You can do this with Unity's default animation window. Please close UMotion in the meantime.

    1. First, duplicate the character in your scene. Then remove the animator component from the gun (of the duplicated character).
    2. Open Unity's animation window and select your character.
    3. Select the e.g. reload animation from your animation list so that it is opened in the dope sheet.
    4. Click on the red record button.
    5. Now we need to create one key frame (at frame 0) for every position/rotation/scale transform of your gun. The easiest way to do this is by expanding the hierarchy of your gun (in Unity's hierarchy window), then select all transforms of it. Then right click on the "Position" text in the Inspector and click on "Add Key". Do the same for rotation and scale. In the end, you should have keys for all gun transforms in your animation at frame 0.
    6. Next, select the gun of your original character (that still has the animator component). This should now show you the animation for the gun in the animation window.
    7. Select the reload animation of the gun (if it isn't displayed already) from the animation list.
    8. Press CTRL + A to select all keys. Press CTRL + C to copy them.
    9. Now select the duplicated character again and (select the reload animation from the list).
    10. Select all gun transforms, then press CTRL + V to paste your key frames of the gun into the animation.
      In order for this to work it's important that the number of transforms in the gun's source animation and the ones that you've created in your character's reload animation are exactly the same!

      (PM-40 was the gun I used for testing this)

    That way you can combine all your animations into one. You can test your animation by scrubbing through it in Unity's animation window.

    You can now work with this animation by importing it into your humanoid UMotion project.


    Btw. what UMotion version are you using? I highly recommend updating to the latest one (from the asset store). That might fix the exception that you've seen when you tried to assign the generic character to your generic UMotion project.


    Let me know in case you have any follow-up questions.

    Best regards,
    Peter

      Thank you for the answer it was very helpful, I wouldn't have figured it out on my own probably.

      versio: v1.25p01


      I did what you said, although there have been problems with the animation after the combine, but it runs down I accept.


      The skeleton I made for the gun, I need to see how to build 2 armature in blender in one aniamation piece out.

      But unfortunately, he's still not running, but I think I'm looking in the right direction, I might need a month of research.


      look and cry or laugh I couldn't decide:


      And here is the blender export just for test:

      I accidentally managed to do this, once played once not? if I move it in the animation window, it will play XDD 

      I really don't know what's going on here xd

      The skeleton I made for the gun, I need to see how to build 2 armature in blender in one aniamation piece out.

      I haven't used Blender that much but I think there should definitely be a way to merge your two armatures into one in Blender. That might make it even easier as it avoids the steps to manually combine the animations in Unity.

      Regarding your animation not playing at runtime: As it plays correctly via the animation window, the animation itself seems to be correct. Please check if there are no additional animator components in your characters or guns hierarchy (especially the gun version that you are picking up at runtime; maybe a script is creating an animator component at runtime). Also check if there are no scripts that override the animation pose.


      Best regards,

      Peter

      v1.25p01

      UMotion V1.26 is the current up to date version. It includes several bug fixes compared to v1.25p01, you might want to consider updating.

      Best regards,

      Peter

      Na I managed to do it !!! 

      1 animator for weapon

      1 animator for character

      1. I combined the weapon and character animation for edit in Umotion, as humanoid project.

      2. After editing, I separated one for the gun and one for the character. (keyframes ctrl + c, ctrl + v)

      3. I put it in their own animator, and now it's played correct. :DDDDD

      When character bones and weapon bones are separated: Unfortunately, as I think it was not possible to play at the same time not supported by script. (under one animator)

      When character bones and weapon bones are combined: Unfortunately, as I think it was not possible to play at the same time not supported by script and inventory. (under one animator) with inventory it would be a lot of trouble, it would always be a different place for bones to fall.

      Thank you so much for your help, I hope someone else has learned from it, or he'll help you.

      Glad to hear that you've found a workflow that works for you.

      Best regards,

      Peter