Answered

How to add properties to a clip?

Anonymous 5 years ago updated by Peter - Soxware Developer 5 years ago 6

When editing an imported animation clip, how do you add additional properties to be modified? For example, I'm editing a clip that has only rotation properties, but I need to access scale.

This seems like a very basic function that isn't covered in the Animated Properties section of the manual, nor any tutorials I can find. 

UMotion Version:
Unity Version:

Answer

Answer
Answered

Hi,
thank you very much for your support request.

I guess your animation is of type humanoid: You can only manipulate the rotation of humanoid bones. This is because in real-life, rotation is the only type of movement that the joints of our bones are able to do.

If you want to manipulate the scale (or the translation) of bones/joints, you need to configure your character as "generic". In config mode, you can decide if you want to hide some of the properties of your bones (e.g. if you don't need translation on some bones you can hide it there):

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

Best regards,
Peter

Answer
Answered

Hi,
thank you very much for your support request.

I guess your animation is of type humanoid: You can only manipulate the rotation of humanoid bones. This is because in real-life, rotation is the only type of movement that the joints of our bones are able to do.

If you want to manipulate the scale (or the translation) of bones/joints, you need to configure your character as "generic". In config mode, you can decide if you want to hide some of the properties of your bones (e.g. if you don't need translation on some bones you can hide it there):

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

Best regards,
Peter

Is this a limitation enforced by Unity or a design choice of UMotion? Changing the character setup to generic might not be feasible as there are quite a few things in our code that depend on the character being humanoid.

The reason for access to properties other than rotation is to add cartoony embellishments like when Mario's fists grow big when he punches.

Looks like it's a Unity limitation. I guess I'll have to do some sort of work around.

Hi,

this is a Unity limitation.


If you want you can try to overcome the limitation by using a custom script (just write a "scaler component" with a public variable that controls the scaling which you then animate from within UMotion using the "Custom Property Constraint").

// Assign this script to bones you want to scale
public ScaleModifier : MonoBehaviour
{
   public Vector3 Scale = new Vector3(1f, 1f, 1f); // Access this via a "Custom Property Constraint" from within UMotion
   // (see manual "Pose Editor / Constraint System / Custom Property" headline "Component Property")

   public void Update()
   {
      transform.localScale = new Vector3(1f, 1f, 1f); // Reset scaling before executing the animator (not sure if this is necessary)
   }

   public void LateUpdate() // Executed after the animator
   {
       transform.localScale = Scale;
   }

   public void UMotionUpdate() // Add this to the UMotion Callback system
   {
      LateUpdate();
   }
}


If you want to preview the results inside UMotion, let UMotion's Callback System call the "UMotionUpdate" method:

Note: "Bake Into Exported Clip" won't work in this case (as humanoid doesn't support scaling).

Best regards,
Peter

Hey thanks, that functionality is super powerful and the ability to preview in UMotion is a huge quality of life feature. Currently I have to enter each Vector3 component as a separate custom property. I don't suppose it would be possible to add support for adding the property as a Vector3 in the future? I know under the hood it would still have to treat each component separately but automatically adding and grouping the Animation Property for each V3 component would be a QoL improvement.

Hi,
thanks for the feedback. I've added this to my "ideas for the future" list.

Best regards,
Peter