Woseseltops / RU-HumLab-XR

0 stars 0 forks source link

Make avatar eyes look at participant #23

Open timjzee opened 1 year ago

timjzee commented 1 year ago

Something like this: https://www.youtube.com/watch?v=NZmQPSKf7YY

But use Poses from mocap instead of Maya.

timjzee commented 1 year ago

Or this: https://forums.unrealengine.com/t/anyone-know-how-i-could-do-this-with-a-metahuman/554928/3

Seems more elegant

timjzee commented 1 year ago

https://docs.unrealengine.com/5.3/en-US/control-rig-in-animation-blueprints-in-unreal-engine/

timjzee commented 1 year ago

This works if we also enable CTRL_lookAtSwitch, and we need transform world location to the location of the CTRL_C_eyesAim control.

Control Z = World X Control X = World Z Control Y = World Y + 20

Use Inverse Transform Location on the Focus location: https://forums.unrealengine.com/t/converting-a-vector-from-world-space-to-local-space-and-vice-versa-in-blueprint/302441/2

timjzee commented 1 year ago

Next steps:

timjzee commented 1 year ago

Getting this working required modifying the Control Rig like this

Also eyes should be set to converge to prevent weird asymmetries between eyes.

Next Steps:

timjzee commented 1 year ago

Getting this to work while an animation is being played turns out to be very difficult. It should be doable using a "Layered blend per bone" with a Branch Filter or Blend Mask that specifies which bones should be blended between the animation and the eye aim. However, this doesn't work for some reason:

I have figured out a workaround that involves:

However, this probably also requires the facial animation to also include the head rotation. Let's try that.

timjzee commented 1 year ago

something to look at: https://www.reddit.com/r/unrealengine/comments/ngtc2w/control_rig_outputs/ https://docs.unrealengine.com/5.3/en-US/control-rig-in-animation-blueprints-in-unreal-engine/ https://docs.unrealengine.com/5.3/en-US/animation-blueprint-blend-nodes-in-unreal-engine/#layeredblendperbone

May be useful for debugging: https://docs.unrealengine.com/5.3/en-US/BlueprintAPI/Components/SkeletalMesh/GetSocketLocation/ https://docs.unrealengine.com/5.0/en-US/skeletal-mesh-sockets-in-unreal-engine/

timjzee commented 1 year ago

Problem: Eye aim does not consider rotation of the head.

Things to try:

timjzee commented 1 year ago

Solution ended up being: feeding the body animation into the control rig adjustments