Answered

Do armature transforms no longer get modified in editor?

Anonymous 4 years ago updated by Peter - Soxware Developer 4 years ago 4

I used to use a tool that would use the UMotionCallback to update the transform of props onto the hand bone transform so that I could preview held props while editing an animation. It seems that the armature transforms are no longer modified by the clip editor. Did something change with Unity/Umotion versions?

UMotion Version:
1.19p02
Unity Version:
2020.2.1f1

Answer

Answer
Answered

Hi,

thank you very much for your support request.

Related to the callback mechanism, nothing changed (to my knowledge). I also did a quick test and for me everything is working as expected:

using UnityEngine;
using System.Collections;

public class TestScript : MonoBehaviour
{
    public Transform TestBone = null;

    // Use this for initialization
    public void MyCallback ()
    {
        TestBone.Rotate(0, 90, 0);
    }
}

Assign this script to your character. Then assign any bone to the "TestBone" field. Make sure that UMotion calls the "MyCallback". Your script should get called and adds another 90 degree rotation to the bone.

PS: Oh you probably mean that the visualization of the bones is not updated according to the changes done via the custom script? That's currently by purpose, as the scripts are called after UMotion updated everything and indicates that the changes are coming from a script, not from UMotion.

Best regards,
Peter

Updated to latest UMotion Pro 1.24, but situation is unchanged.

Answer
Answered

Hi,

thank you very much for your support request.

Related to the callback mechanism, nothing changed (to my knowledge). I also did a quick test and for me everything is working as expected:

using UnityEngine;
using System.Collections;

public class TestScript : MonoBehaviour
{
    public Transform TestBone = null;

    // Use this for initialization
    public void MyCallback ()
    {
        TestBone.Rotate(0, 90, 0);
    }
}

Assign this script to your character. Then assign any bone to the "TestBone" field. Make sure that UMotion calls the "MyCallback". Your script should get called and adds another 90 degree rotation to the bone.

PS: Oh you probably mean that the visualization of the bones is not updated according to the changes done via the custom script? That's currently by purpose, as the scripts are called after UMotion updated everything and indicates that the changes are coming from a script, not from UMotion.

Best regards,
Peter

Hi Peter, I do something along the lines of this:

public Transform hand;
public Transform prop;

public void UMotionUpdate()
{
    prop.position = hand.position
    prop.rotation = hand.rotation
}

When editing an animation for a weapon for example, I can preview how it will look with different weapons.


Doing it this way allows me to keep the prop game objects outside of the armature and therefore not have to generate a new config for the pose editor each time.

However, the last time I used this tool was several updates ago (both Unity and Umotion), and it isn't working anymore. If I do a print(hand.position) the output shows the position not changing on UMotionUpdate, and I feel like this wasn't the case before.

Hmmm... this should work fine. If you create a new empty Unity project that includes just everything I need to look into your issue/reproduce your situation, I can provide you further assistance. Feel free to send this project to me via the email support form (or request a link to my Dropbox via said email form). I'm looking forward to help you.

Best regards,
Peter