Answered

Can I convert a Generic Animation clip to a Humanoid type within a Script?

moonrjung 2 years ago updated by Peter - Soxware Developer 2 years ago 1

Hi, I bought this Asset. Good Job. 

I wrote a script which reads a bvh motion file and constructs a skeleton and animation clip (non-legacy) 
from it. This script also applies this animation clip in run time by using AnimatorOverrideController. 
I have no problem with animating the skeleton. 

But when I wanted to retarget the motion to a different human character, it did not work.

I found that the animation clip generated is of a generic type, not a humanoid type. 

Is there any way for me to convert an animation clip of a generic type to a humanoid type in the Script? 

I skimmed over the source code of the asset. I found the following method:

AnimationConverter.Convert(clipsToConvertList.ToArray(), configuration, out logMessages);

Is there any way for me to use this method from my script?

Animation Converter Version:
Unity Version:

Answer

Answer
Answered

Hi,

thank you very much for your support request.

Yes you can access the Animation Converter's functionality via C# scripts. Here you can find the documentation of the Animation Converter's scripting API: https://www.soxware.com/animconverter-manual/ScriptingAPI.html

The Animation Converter's editor window uses the scripting API mentioned above. You can use it as a usage example.

I would recommend that before writing your code, try to do your conversion manually using the window. Then write your script that automates the steps you previously performed manually.

Please note that the functionality of the animation converter is only available at edit time. Your script needs to be placed in an "Editor" folder within your Unity project in order to work.

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


Best regards,
Peter

Answer
Answered

Hi,

thank you very much for your support request.

Yes you can access the Animation Converter's functionality via C# scripts. Here you can find the documentation of the Animation Converter's scripting API: https://www.soxware.com/animconverter-manual/ScriptingAPI.html

The Animation Converter's editor window uses the scripting API mentioned above. You can use it as a usage example.

I would recommend that before writing your code, try to do your conversion manually using the window. Then write your script that automates the steps you previously performed manually.

Please note that the functionality of the animation converter is only available at edit time. Your script needs to be placed in an "Editor" folder within your Unity project in order to work.

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


Best regards,
Peter