Answered

Animate by blending between keyframes

iv2b 6 years ago updated 6 years ago 5

Hi, i've been trying to mimic overgrowth's approach to animations in unity (you can find the explanation here) and i was wondering if uMotion could help me in achieving that.

In short what this method involves is having very few keyframes and interpolating between them using curves, which is perfect for prototyping. For example a walk loop can be done with only 2 frames.

At first i got this done by splitting keyframes into animations (thus animations with only 1 frame), putting them in a blend tree and switching between them using a script. This however has a few issues: the mecanim graph becomes exceedingly complex over time, i need a script to handle the animations and animation speed is ignored (as the script sets in which point of the animation i'm at every frame).

Using transitions isn't a good solution either since it only provides linear interpolation.

So the only solutions i'm left with are baking keyframes into an animation and dealing with the playables API.

The former method would be handier as it'd allow for quicker development by letting the animator see the changes very quickly when making changes, plus having the final output be contained in an animation file means it's possible to make it work with mecanim as well.

The issue is that each property has its own curve, both in uMotion and in unity's own animator window, meaning that in order to do an "ease in" curve (as an example) i'd need to change the right tangent of every property for the specified node, which for a humanoid character can easily mean changing 50+ curves, while more complex curves would be essentially impossible.

As for using playables, clips do support ease in and ease out curves which can be used alongside single frame animations to get the desired result, but i'm still clueless as to how that would work when putting everything together (such as using them in blend trees for example) and i've yet to see examples of characters controlled via playables that don't involve janky scripts.

The ideal solution would be to have a single interpolation curve within uMotion itself. In a new or imported animation it'd just be a line going from 0 (start of the animation) to 1(end of the animation). It might be better/worse to have a curve for each keyframe.

Or alternatively a "speed" curve that in a new or imported animation would sit at a value of 1, allowing for a very similar effect but in a way that is probably easier to execute (as it'd be a matter of changing how long each frame lasts based on the curve).

In both these cases it'd be possible to quickly create more natural animations (for example making a decent looking jump animation becomes trivial with this approach) while possibly leading to a fully finished animation (overgrowth's character animator uses less than 20 keyframes!) just by refining it.

Is this already possible with uMotion in some way?

If not, would you consider adding this feature? And do you know how i could tackle this animation approach (either through playables or with other software that has the feature i'm looking for)?

Thank you in advance! :)

Answer

Hi,

thank you very much for your support request.

Personally, I would go for a custom script based solution. You could use ScriptableObjects to store structs with the single key frame poses (use one quaternion per bone/transform). Another ScriptableObject could define the blending behavior using a simple AnimationCurve. And then a simple script that applied the poses to the character (iterate through the transforms and apply the blended quaternions). I think that's also the way the overgrowth developer used (if I remember correctly he used his own engine).

You can convert existing *.anim files to your custom ScriptableObject's by getting the animation keys of the *.anim with the appropriate API method: https://docs.unity3d.com/ScriptReference/AnimationUtility.GetCurveBindings.html

If you want to use this to animate a lot of characters at the same time, use the job system / ECS to max out performance.

Best regards,
Peter

Answered

Chaining two animations with root motion

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

I am trying to chain two animations together. In the first the character turns 90 degrees and in the second he walks forward.When I add the second animation onto the first I use an additive layer to rotate the character and position him when the first animation stopped.It should work but the character instead of walking in the new forward direction continues to the side.

It looks like the root motion position is not a local as indicated but rather is the global position.

In fact it is the same problem if I try to rotate a single animation, for example a walk cycle at a 45 degree angle rather than forward.

How can I solve this?Thanks

Answer

Hi,
thank you very much for your support request.

The problem that you have here, is that the local rotation doesn't affect the local position of a transform in Unity (due to the order in which they are applied). So when you adjust the hips rotation, it will not affect the hips local position (which drives the root motion). What you would need in order to rotate the root motion of your character is to rotate a parent transform of the hips, but this is not directly supported for humanoid characters within UMotion (as hips don't have a humanoid parent bone).

To offset root motion of humanoid characters, one way is to use the Inspector shown when the *.anim file is selected (see Root Transform Rotation Offset). Add an offset of 90° before you import it into your UMotion project to get the desired effect:

Another way would be that you (temporary) switch to generic. Duplicate your character and change it's rig to generic. Then create a new UMotion project of type generic and import your previous UMotion project of type humanoid. Then you can add a rotation offset to the hips parent transform (using an additive layer) to offset the root motion. Then export the animation to *.FBX (I recommend saving the animation into your humanoid character's *.FBX file, this ensures that the humanoid avatar setup is correct).

For putting several animations in sequence, there are specific animation sequencing programs made for that exact purpose. In the case of Unity it's called "Unity Timeline". This tool allows you to place sever animations after each other, loop animations and blend from one animation to the other. This is more flexible and consumes less memory then creating long sequences as animation clips (as looping within an animation clip would mean that animation keys are duplicated). UMotion Pro has very good support for Unity Timeline.

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

Best regards,
Peter

Answered

On recording runtime animations and blend trees

zacphillipshemming 6 years ago updated by Peter - Soxware Developer 6 years ago 6

Hi Soxware,

We love the asset and have a quick question recording and baking animations. We are trying to solve a problem with melee combat animations. The animations are "in-place" and the character swings his weapon whilst standing still. As we wanted to be able to move whilst attacking/blocking we chose to use layers and layer upper body of the melee swings over the walking locomotion blend tree. This obviously produces incorrect results as the hips are rotated differently when the character is walking compared to the original "in-place" animtion. To solve the hip bone being in the wrong rotation, we have a second animator where we play the original "in-place" animation and set the layered animators hip bone to be the same as this second animator's (in lateUpdate). However we would prefer not to need two animators per character. Can we use the asset to record the "new" position of the hips for a melee swing animation and bake it in?.I hope I explained this well enough.

Thanks

Zac

Answer

Hi Zac,

thank you very much for your support request.

UMotion supports animation layers (similar to the animation layers of an animator component, but baked into the animation once exported). If you import two animations, you can e.g. copy the hips rotation of one animation and paste it into an override animation layer of the second animation (thus overriding the hips). You can also use the additive animation layer to add a fixed rotation offset to the hips.


In this video tutorial I'm using animation layers in practical use-cases: 

You can also check out the manual (click on the black info button in the animation layers window) for further information.


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

Best regards,
Peter

Answered

Two handed animations for gun

Anonymous 6 years ago updated by angeloT813 10 months ago 6

Could you give an overview of the workflow for creating a two handed weapon animation where the second hand should be parented to the weapon? I have tried simply parenting the second hand but as soon as I key the parent, the hand jumps out of position.

Answer

Hi,
thank you very much for your support request.

If you create this animation only for a single character (and don't want to share the animation with other characters), I recommend using a "generic" rig setup instead of "humanoid". Animations of type generic have higher quality but can't be shared with other characters (except if they have precisely the same skeleton). More information about humanoid: https://blogs.unity3d.com/2014/05/26/mecanim-humanoids/

If you want to use humanoid, be aware that there might be some small offsets/differences when the animation is played in game due to the lossy nature of the animation re-targeting of the humanoid animation system (probably not noticeable for the player due to camera distance).

  1. Anyway, before you start with UMotion, make the gun a child of the right hand.
  2. Create a new UMotion project and drag the character to the Pose Editor.
  3. Switch into Config Mode and run the IK Setup wizard.
  4. Stay in Config Mode and select the IK handle of the left hand.
  5. Open the "Constraints" tab and disable "IK Pinning Mode" in the "Child-Of Constraint".
  6. Switch back into Pose Mode.
  7. Bring the left hand into the pose where it correctly grabs the weapon.
  8. When you have the left hand's IK handle selected, you can now set the axe as parent (see "Channels"). Key everything.
  9. Set "none" as parent when you want to switch into one handed mode.

I recommend watching the Child-Of video tutorial before using it. There are some common pitfalls you should be aware of.

Please let me know if you have any further questions.

Best regards,
Peter

Answered

Having trouble "grabbing" bones in pose editor

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

Hello,

Having an annoying issue. Creating animations with a model in UMotion usually works well, but lately I find after several bone manipulations, I can no longer "Grab" or select the bones by clicking them like usual. I use stick mode, but switching does not fix the issue.

At first I figured it might have something to do with the focus of the camera, zooming in with the mouse wheel or something like that but compensations for this did not fix the issue.

My current fix is not one I can work with -- Im currently exiting unity and restarting it in order to be able to grab the bones again. This usually last me about 25 or so clicks before it cant find the bones again. I tried focusing on a bone ( I can select them in the clip editor, but that's no way to live ) and hitting the "Focus camera" option in the pose editor but it does nothing.

How do I get it so I can consistently click the bones and grab them?
( Note I already made some longer animations with the same model but it just randomly started happening )

Answer
Anonymous 6 years ago

Ok so I believe I've isolated the asset in question. Following the steps you provided, I got to the point where clicks stopped registering and started stripping the assets out and testing to see if the issue persist. I finally got to an asset called "Ultimate Billboard" a cheap billboard solution. After deleting it ( Link here https://assetstore.unity.com/packages/vfx/shaders/ultimate-billboard-multipurpose-billboard-fog-sprite-shader-111709 ) the latest version 1.0

My version of Unity is 2019.1.11f1

Anyway after deleting it Umotion worked normally. Weird because I hadn't used the billboards yet, I had just planned to and had the asset sitting there up until this point having made a few animations. Anyway, glad that's settled, thanks for the support!

Answered

Required human bone "Hips" not found

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

No work, F***.. If you do not support humanoid so wrote at least... When you try to add a humanoid object.

Image 49

Answer

Thanks for sending me the files. It works perfectly fine here, when the character is correctly configured as humanoid:

Try to import your character again into Unity, select the man.fbx and set Animation type to "Humanoid" then click on apply. This ensures that your character is configured correctly. Then drag&drop man.fbx into your scene and apply it to the UMotion Pose Editor.

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

Best regards,
Peter

Not a bug

Character bone eye shaking.

Vilaskis Shalashev 6 years ago updated 4 years ago 6

The video

Example files

I really don't know, is that problem of Umotion or Character, but the eyes of Santa is shaking randomly while move head.


Unity2019.2.4f1 HDRP 6.9.1

Answer

Hi Vilaskis,
I just noticed that there is indeed a bit of shaking happening on my PC (much less though). This is because your character is already very far away from the center. What you see is the precision limit of floating point values. Move your character to the center and your shaking should go away. HDRP might amplify this effect.

Best regards,
Peter

Answered

"Hips" is not unique: Found multiple transforms named "Hips" is an error I'm getting. What's causing it?

Anonymous 6 years ago updated 6 years ago 2

[The following thread was restored from the old support forum]


Human bone mapping for human bones "Hips" is not unique: Found multiple transforms named "Hips" is an error I'm getting. I'm not sure what's causing it actually. I only have one hip bone on the model. It is because of that I'm not able to animate my character gameobject. What am I doing incorrectly in this case?

https://puu.sh/AmGyO/d921ced2e5.png

Answer

Hi,
thanks for your support request.

According to this error there is a second bone somewhere in the hierarchy of your GameObject named "Hips". Please expand the whole hierarchy in order to check that (hold ALT then click on the arrow to collapse/expand all).

If you can still not find a bone named "Hips", could you please send me a Unity project that contains just your model so that I can take a closer look at this issue. You can send that project via the email support form. Thanks.

Best regards,
Peter

Answered

Crashing on game object mode.

molonamok 6 years ago updated by Peter - Soxware Developer 6 years ago 1

I have a humanoid character already setup with bones:

https://assetstore.unity.com/packages/3d/characters/humanoids/ariana-character-118803

Im trying to create some basic riding animations for a hover bike:

https://assetstore.unity.com/packages/3d/vehicles/air/aaa-pbr-hover-bike-144805

I have this bike set up for motion with a hover controller:

https://assetstore.unity.com/packages/templates/realistic-hovercraft-controller-44792

Eventually I would like to have a few character animations such as bcompensation for angle and general "look behind" stuff and such. I fugure once I have her seated on the bike that should be easy - but I dont really get that far.

So I have taken the ariana game object and thegame object of the bike and created a new project.

The bike does not yet have the hover controller attached.

So firstly - Im following the umotion startup video tutorial but when I add an ariana model my game object to a new umotion project it crashes umotion. and locks the game object, requiring a re-start of the scene. This happens pretty much every time.

Secondly I'm beginning to wonder if what I'm asking for will really work with Umotion. How do I acxtually get her to detect where the bike is and then move to the proper animation so that she will mount it.

Obviously I'm working with packages here because Im not a developer: Im very much an amateur to all of this and just trying to get my girl to sit on a bike.

Can anyone offer any advice?

A. Specifically to the crashing issue I am having?

B: General advice on the best way to animate my character on the vehicle? Do I need other tools?

Thanks very much.

Rmorph.

Answer

Hi Rmorph,

thank you very much for your support request.

"So firstly - Im following the umotion startup video tutorial but when I add an ariana model my game object to a new umotion project it crashes umotion. and locks the game object, requiring a re-start of the scene. This happens pretty much every time."

I'm sorry that this is happening. I've just replied to your bug report that you've sent to me via email. In order to keep things organized, let's continue discussing this topic via the email thread :-)

"Secondly I'm beginning to wonder if what I'm asking for will really work with Umotion. How do I acxtually get her to detect where the bike is and then move to the proper animation so that she will mount it."

If the player should be able to walk around with the character, then press a button so that the character mounts on the hoverbike then that's something you have to do via scripting. With UMotion, you can create all the required animations for that but the actual functionality would have to be created via scripting.


If you just want to create an opening cut-scene (where the character walks to the hoverbike, jumps on it and starts flying away) you can use UMotion together with Unity Timeline.


Anyway, I would say start simple with the character already mounted on the hoverbike. Here's how you can do this:

Make your character a child of the hoverbike (in the Unity Hierarchy window). That way your character is going to move with the hoverbike. If you want to animate parts of your hoverbike (e.g. the steering) together with your character, you should drag & drop the root transform of your hoverbike into UMotion's Pose Editor. If you just want to animate your character, then just drag the root transform of your character into UMotion's Pose Editor.

I recommend using "generic" mode for your character.

Best regards,
Peter

Answered

Blendshapes?

Larry Johnson 6 years ago updated by Peter - Soxware Developer 5 years ago 4

Does this app make it possible to create blendshapes?

Answer

Hi Larry,
thank you very much for your support requests.

Blend shapes have to be defined in a 3D modeling application (you need to deform vertices). In UMotion you can then animate the blend shape weights (i.e. the amount a blend shape contributes to the current look of your character). That way you can do for example facial animations.

When your character includes blend-shapes and it is assigned to UMotion for the first time, UMotion will automatically prompt you with a dialog asking if you want to add animation curves for the blend shapes to your UMotion project. By using the "Custom Property Constraint" you can always add curves for blend shapes manually (please refer to the manual at "Pose Editor / Constraint System / Custom Property").

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

Best regards,
Peter