Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

[RELEASED] Realistic Eye Movements

Discussion in 'Assets and Asset Store' started by Faikus, Feb 12, 2015.

  1. Faikus

    Faikus

    Joined:
    Jan 3, 2011
    Posts:
    239
    This feature will have to wait unfortunately; I have to implement some others first.
     
    Alvare32 likes this.
  2. Slowbud

    Slowbud

    Joined:
    Jul 19, 2015
    Posts:
    81
    @Faikus Hi Faikus, when updating (delete old, install new) to new version 2.1.0 Sept.25.2020, will it break my installed ones and I need to configure all new (Eyes and Eyelids configuration), or do I just need to take care of the new parameters?
     
  3. Faikus

    Faikus

    Joined:
    Jan 3, 2011
    Posts:
    239
    Just delete the old folder before importing the new version, because some files have moved/been renamed. Your characters will keep their configuration intact. The only thing you might want to do is to set Head Control to Final IK if you use that, but even if you don't REM will just give a warning and work as before.
     
  4. Slowbud

    Slowbud

    Joined:
    Jul 19, 2015
    Posts:
    81
    Now these are 2 great news. Thanks. Before I had to solve Final IK conflicts by the script execution order.
     
  5. Slowbud

    Slowbud

    Joined:
    Jul 19, 2015
    Posts:
    81
    @Faikus When setting Head Control to Final IK, I get "USE_FINAL_IK not defined" ?
    "Full Body Biped IK" and "LookAtIK" is on the same figure.
     
  6. Faikus

    Faikus

    Joined:
    Jan 3, 2011
    Posts:
    239
    Yes, as in the previous version, you still have to define USE_FINAL_IK if you want to use it. You can do that either by uncommenting the line in the script or adding USE_FINAL_IK to the player defines. Check the manual (now online: link) under "Head Control: Final IK"
     
    Last edited: Sep 25, 2020
  7. dmenefee

    dmenefee

    Joined:
    Oct 14, 2019
    Posts:
    142
    Hi. I've updated R.E.M. as per your instructions (removing the old folder, importing), and because I'm using a UMA I find that I must add the components at runtime. So I also edited the preset loader to get the UMA.json file from StreamedAssets (I copied it there from the newly updated R.E.M.). No errors, yet when the component is active my characters' eyes roll away from forward. Do I need to do anything else for these to make them work properly?

    thanks!
     
  8. Faikus

    Faikus

    Joined:
    Jan 3, 2011
    Posts:
    239
    When REM is initializing the head and eyes of the character must be looking forward. Is it possible that at the time of initialization something is moving the character's head away from forward?

    (Edit) I just noticed UMA has changed their Mecanim mappings compared to the version I was using. Try this new UMA preset: link.
     
    Last edited: Sep 27, 2020
    dmenefee likes this.
  9. dmenefee

    dmenefee

    Joined:
    Oct 14, 2019
    Posts:
    142
    Beautiful! That worked perfectly, thank you. I've just started work on refining my characters, so I'll be using this *very* cool asset to enhance dialogue and lipsync and such.
     
    Alvare32 and Faikus like this.
  10. Tapps-VR

    Tapps-VR

    Joined:
    Mar 10, 2017
    Posts:
    5
    Hello, Faikus.
    Great asset!

    There's one thing I'm trying to do and I'm not sure how:
    It would be important for me to be able to animate the eyelids to convey the right emotions as the character speaks, but I'd hate to lose REM's effects, like the lids following the eyes and the blinking. Is there a way to combine hand-made animation for the eyelids and REM's movements?

    Another thing I'm missing is how to transition control of the eyes, lids and head from REM to a hand-made animation.
    For instance: As the character speaks, she walks around, looks at stuff in the scene (all hand made animation), and then switches to looking at the character. Is there a way to transition smoothly from one to the other?

    Thanks!
     
    Last edited: Oct 27, 2020
  11. Faikus

    Faikus

    Joined:
    Jan 3, 2011
    Posts:
    239
    I've planned to implement a smooth way to animate a global weight in and out for one of the next updates. I'll also take a look into making REM's eyelid animations additional to existing animations instead of replacing them.
     
  12. Tapps-VR

    Tapps-VR

    Joined:
    Mar 10, 2017
    Posts:
    5
    Thanks for the quick reply!
    That's good to know!
    But since we're already in development, do you have any tips on how we could implement those things on our side?
     
  13. Faikus

    Faikus

    Joined:
    Jan 3, 2011
    Posts:
    239
    You would have to make changes for the head, eye, and eyelid movements. Head is easiest, as that already has a headWeight parameter that you can animate. For eyes, you could add something in the EyeAndHeadAnimator.UpdateEyeMovements function. The eyes' orientations are set in the lines
    leftEyeAnchor.localRotation = ...
    and
    rightEyeAnchor.localRotation = ...

    You could instead set that to a lerp between what it is set to now and what it was set to by your animation and animate the lerp in and out.

    For eyelids, if they are controlled by bones, you could do something similar in ControlData.UpdateEyelidBonesOfOneLid. If they are controlled by blendshapes, that is more complicated, because blendshapes are not reset every frame for animation unlike bones. I will figure something out for the next update.
     
  14. jpingen

    jpingen

    Joined:
    Jan 28, 2019
    Posts:
    22
    Hi, I'm currenly tweaking the EyeAndHeadAnimator a bit to suit our requirements. I noticed there exists a HeadTweenMethod setting:

    Code (CSharp):
    1. enum HeadTweenMethod
    2. {
    3.     SmoothDamping,
    4.     CriticalDamping
    5. }
    6. HeadTweenMethod headTweenMethod = HeadTweenMethod.SmoothDamping;
    However, nowhere in the script is this setting changed, it is constant set to SmoothDamping. Could you perhaps give some explanation on what the CriticalDamping setting would do? From the sound of it (less smooth movement?) it may be what we're looking for
     
  15. Faikus

    Faikus

    Joined:
    Jan 3, 2011
    Posts:
    239
    This "archived" code is an alternative approach using Keijiro Takahashi's implementation of the critical damping method (link). I left the code in there as I might offer several head smoothing methods in the future (and for those who might be interested in alternative tweenings), but I haven't updated the CriticalDamping method in a while so it might not work out of the box if you switch REM to it. You can use it as starting point for implementing a head movement with another "feel" than the current one (hard to describe the difference in words), but you'll probably have to tweak some parameters.
     
  16. zorgitron

    zorgitron

    Joined:
    Apr 18, 2016
    Posts:
    8
    Hi Faikus,
    There is a variable in the editor for setting the eyes to be closed to various degrees by default, using negative numbers "eyelidswideshut" I think. I examined the scripts for a few days, but can't confidently find/undrstand where that variable is being set. It looks like its in the Blink01() function...

    I would like to set this number by code to make a character look sleepy to various degrees either in Start or as and Update. How could I do that? Thank you!
     
  17. Faikus

    Faikus

    Joined:
    Jan 3, 2011
    Posts:
    239
    You can set the variable via controlData:

    Code (CSharp):
    1. var eyeAndHeadAnimator= GetComponent<EyeAndHeadAnimator>();
    2. eyeAndHeadAnimator.controlData.eyeWidenOrSquint = -0.5f;
    The more negative the number, the more closed the eyes; positive numbers widen the eyes. Note that if your eyelids are controlled by blendshapes only negative numbers are supported.
     
  18. amynox

    amynox

    Joined:
    Oct 23, 2016
    Posts:
    177
    Hi,

    I just bought this asset but sadly it does not work with my "pedesterians" models.

    Basicly they dont have any bones or gameobject for eyes (all is baked in the head). BUT they have BlendShapre for : Looking Up, Down, Left and Right and same for Eyes Blinking (1 slider for each eye). So i feel that they have what it take to work with your asset but will need "some" code change...

    Can you help with this please ? I can send you a model if this is can help.

    Other than that the asset is working great with the Player model (High def one)

    Thank you so much
     
  19. Faikus

    Faikus

    Joined:
    Jan 3, 2011
    Posts:
    239
    Eye movement via blendshapes is not supported. What I do with such models is to replace the eyes with separate game objects. You can do that by setting the alpha value of the pixels for the eyes in the texture to zero and activate alpha clipping in the shader. Then you add eye game objects as children of the head. This is quickly done, and you also get much better looking eyes this way.
     
    amynox likes this.
  20. amynox

    amynox

    Joined:
    Oct 23, 2016
    Posts:
    177
    It works ! Thank you !
     
  21. Stryder2384

    Stryder2384

    Joined:
    Sep 1, 2020
    Posts:
    2
    Hey Faikus, amazing asset!

    Is there a way to reset the look target? I have multiple characters brought in through the Daz to Unity Bridge with poses from Daz. One of my characters worked perfectly, but others seem to be looking to the side or their eyes seem to be reversed.. It looks to me like the setup is done the same for all the characters, and they're the same model, so I'm not sure what I did wrong...

    Also, one small feature thought/request. What if you could animate a character's mouth by saving snapshots similar to how you have your eyelid controls setup? You could swap between preset mouth poses (smiling, frowning, etc) randomly, or trigger them to events in your looktarget controller.

    Anyway, again, amazing asset!
     
  22. Faikus

    Faikus

    Joined:
    Jan 3, 2011
    Posts:
    239
    Hey Stryder,

    REM requires the character to look straight ahead with respect to its transform at start of Play mode. Maybe some of the poses make them look sideways? Try turning their heads and eyes straight with respect to the transform outside play mode. In Play mode, the animation will take over anyway, so they will be animated as before.

    For the mouth, the LookTargetController has events for looking at /away from the player and such. You can subscribe to these events and activate any facial expressions.

    Best,
     
  23. Stryder2384

    Stryder2384

    Joined:
    Sep 1, 2020
    Posts:
    2
    Excellent, thank you! I'll test out rotating the heads/eyes around to see if I can get it to work. Thanks for the quick reply, and I didn't know that the events could be used that way. Thanks again!
     
  24. Dirrogate

    Dirrogate

    Joined:
    Feb 18, 2014
    Posts:
    157
    @Faikus As always, this is an asset that always gets added to every project I start (and it's been so for the past few years).
    Now, I've started working with Mozilla's WebXR exporter - more precisely, the AR flavor done by Depanther: https://github.com/De-Panther/unity-webxr-export

    Everything works great with Unity Webgl and the WebXR exporter (DePanther's fork) until I switch to "AR" mode. Then the eyes/head do not follow the AR camera.
    Sometimes.... when it does work and a character looks at you in AR - it's a whole world of a difference! and quite breathtaking.

    If you have the time, could you look into why when in AR mode, it does not work predictably?
    Kind Regards
     
  25. Faikus

    Faikus

    Joined:
    Jan 3, 2011
    Posts:
    239
    It seems this library updates the camera objects for the left and right eye, but that information is not accessible via Unity's usual XR interface, XRNodes. Until there is more offical support for WebAR in Unity, just assign CameraARL (in WebXRCameraSet/Cameras) to the LookTargetController's Third Person Player Eye Center.
     
    Dirrogate likes this.
  26. Dirrogate

    Dirrogate

    Joined:
    Feb 18, 2014
    Posts:
    157
    Thank you so much! the one thing I didn't try was assigning the AR cameras (tried main cam, and even the main rig)
    It all works beautifully now!
     
  27. Wyldfire42

    Wyldfire42

    Joined:
    Aug 7, 2020
    Posts:
    5
    Hello,

    Really like the effect of this asset! I'm having a little difficulty trying to do a particular thing though and while it's not a bug with the asset as far as I can tell, I think you might be able to help.

    Basically the model I'm using this on has a clone that I use with a different camera setup for use in a dialog as a "portrait". Since I don't want the in-scene model and the portrait model to blink and look around differently, I'm trying to "copy" the eye and eyelid positions to the other model. This is working fine for the eye rotations, but I can't seem to get the blinks to work.

    I can see the blend shape influences changing in the Inspector, but in code when I call GetBlendShapeWeight() on the SharedMeshRenderer I always get 0. I've verified I have the right index for the blend shape I see changing in the inspector by printing its name via .sharedMesh.GetBlendShapeName().

    Is there some gotcha to GetBlendShapeWeight()? Is there a better way for me to "copy" the blinks?
     
  28. Faikus

    Faikus

    Joined:
    Jan 3, 2011
    Posts:
    239
    Make sure you run your code after REM each frame. Check the blendshapes in LateUpdate and set your script to run last in the Script Execution Order.
     
  29. Wyldfire42

    Wyldfire42

    Joined:
    Aug 7, 2020
    Posts:
    5
    Do blend shape weights reset to 0 at the start of each frame?
     
  30. Faikus

    Faikus

    Joined:
    Jan 3, 2011
    Posts:
    239
    Yes, REM resets the blendshapes it uses at the start of each frame so when it runs again later in the frame it knows whether an animation has changed them and can lerp its own target values depending on eyelid weight and such.
     
  31. ContactVR

    ContactVR

    Joined:
    Feb 19, 2021
    Posts:
    12
    Hello everyone. New to Unity here: I want to make my UMA avatar to reproduce the user's gaze using a HTC Vive eye-tracking device in Unity (just like in NeosVR), and I got a hunch that REM, in combination with relevant SDKs like TobiiXR or SRanipal might do the work. In short, I don't know how to use the input data of the SDKs to make REM's magic. Any suggestions?
     
  32. Faikus

    Faikus

    Joined:
    Jan 3, 2011
    Posts:
    239
    If you want to just playback recorded eye tracked data constantly, for example in a multi-player app, REM's main point, the procedural eye animation, would not make sense. If you want to use it anyway, maybe because you want to use REM's procedural animation in some situations and switch to playback of tracked data in others, here is some code as starting point you can use to record and playback the eyes:

    Create a GazeDetector for the recording character and call DetectGaze in LateUpdate:
    Code (CSharp):
    1. using RealisticEyeMovements;
    2. using UnityEngine;
    3. using System.Collections.Generic;
    4. using ViveSR.anipal.Eye;
    5.  
    6. public class GazeDetector
    7. {
    8.     #region fields
    9.  
    10.         readonly Transform cameraXform;
    11.         readonly EyeAndHeadAnimator eyeAndHeadAnimator;
    12.  
    13.         Vector3 lastCombinedGazeDirectionLocal;
    14.         Vector3 lastLeftEyeDirectionLocal;
    15.         Vector3 lastRightEyeDirectionLocal;
    16.      
    17.         Vector3 lastCombinedGazeOriginLocal;
    18.         Vector3 lastLeftEyeOriginLocal;
    19.         Vector3 lastRightEyeOriginLocal;
    20.  
    21.         float lastLeftBlink01;
    22.         float lastRightBlink01;
    23.  
    24.     #endregion
    25.  
    26.  
    27.     public GazeDetector(Transform cameraXform, EyeAndHeadAnimator eyeAndHeadAnimator)
    28.     {
    29.         this.cameraXform = cameraXform;
    30.         this.eyeAndHeadAnimator = eyeAndHeadAnimator;
    31.     }
    32.  
    33.  
    34.     public void DetectGaze(out Vector3 gazeDirectionLeft, out Vector3 gazeDirectionRight, out float leftBlink01, out float rightBlink01)
    35.     {
    36.         Vector3 gazeOriginCombinedLocal = Vector3.zero;
    37.         Vector3 gazeOriginLeftLocal = Vector3.zero;
    38.         Vector3 gazeOriginRightLocal = Vector3.zero;
    39.      
    40.         Vector3 gazeDirectionCombinedLocal = Vector3.zero;
    41.         Vector3 gazeDirectionLeftLocal = Vector3.zero;
    42.         Vector3 gazeDirectionRightLocal = Vector3.zero;
    43.      
    44.         EyeData eyeData = new EyeData();
    45.         if ( ViveSR.Error.WORK == SRanipal_Eye_API.GetEyeData(ref eyeData) )
    46.         {
    47.             bool isLeftEyeActive = false;
    48.             bool isRightEyeAcitve = false;
    49.             if (SRanipal_Eye_Framework.Status == SRanipal_Eye_Framework.FrameworkStatus.WORKING)
    50.             {
    51.                 isLeftEyeActive = eyeData.verbose_data.left.GetValidity(SingleEyeDataValidity.SINGLE_EYE_DATA_GAZE_ORIGIN_VALIDITY);
    52.                 isRightEyeAcitve = eyeData.verbose_data.right.GetValidity(SingleEyeDataValidity.SINGLE_EYE_DATA_GAZE_ORIGIN_VALIDITY);
    53.             }
    54.  
    55.             if (isLeftEyeActive || isRightEyeAcitve)
    56.             {
    57.                 if ( SRanipal_Eye.GetEyeWeightings(out Dictionary<EyeShape, float> eyeWeightings) )
    58.                 {
    59.                     if ( eyeWeightings.TryGetValue(EyeShape.Eye_Left_Blink, out float leftBlink) )
    60.                         lastLeftBlink01 = leftBlink;
    61.                     if ( eyeWeightings.TryGetValue(EyeShape.Eye_Right_Blink, out float rightBlink) )
    62.                         lastRightBlink01 = rightBlink;
    63.                 }
    64.             }
    65.         }
    66.  
    67.         if ( false == SRanipal_Eye.GetGazeRay(GazeIndex.COMBINE, out gazeOriginCombinedLocal, out gazeDirectionCombinedLocal) )
    68.         {
    69.             gazeOriginCombinedLocal = lastCombinedGazeOriginLocal;
    70.             gazeDirectionCombinedLocal = lastCombinedGazeDirectionLocal;
    71.         }
    72.         if ( false == SRanipal_Eye.GetGazeRay(GazeIndex.LEFT, out gazeOriginLeftLocal, out gazeDirectionLeftLocal) )
    73.         {
    74.             gazeOriginLeftLocal = lastLeftEyeOriginLocal;
    75.             gazeDirectionLeftLocal = lastLeftEyeDirectionLocal;
    76.         }
    77.         if ( false == SRanipal_Eye.GetGazeRay(GazeIndex.RIGHT, out gazeOriginRightLocal, out gazeDirectionRightLocal) )
    78.         {
    79.             gazeOriginRightLocal = lastRightEyeOriginLocal;
    80.             gazeDirectionRightLocal = lastRightEyeDirectionLocal;
    81.         }
    82.  
    83.         lastCombinedGazeOriginLocal = gazeOriginCombinedLocal;
    84.         lastLeftEyeOriginLocal = gazeOriginLeftLocal;
    85.         lastRightEyeOriginLocal = gazeOriginRightLocal;
    86.      
    87.         lastCombinedGazeDirectionLocal = gazeDirectionCombinedLocal;
    88.         lastLeftEyeDirectionLocal = gazeDirectionLeftLocal;
    89.         lastRightEyeDirectionLocal = gazeDirectionRightLocal;
    90.      
    91.         Vector3 gazeDirectionCombined = cameraXform.TransformDirection(gazeDirectionCombinedLocal);
    92.         gazeDirectionLeft = cameraXform.TransformDirection(gazeDirectionLeftLocal);
    93.         gazeDirectionRight = cameraXform.TransformDirection(gazeDirectionRightLocal);
    94.      
    95.         leftBlink01 = lastLeftBlink01;
    96.         rightBlink01 = lastRightBlink01;
    97.     }
    98.  
    99.  
    100.     public void StartRecording()
    101.     {
    102.         lastCombinedGazeDirectionLocal = Vector3.forward;
    103.         lastLeftEyeDirectionLocal = Vector3.forward;
    104.         lastRightEyeDirectionLocal = Vector3.forward;
    105.         lastLeftBlink01 = lastRightBlink01 = 0;
    106.     }
    107.  
    108. }
    109.  
    To playback, on the playing back character, call something like this:

    Code (CSharp):
    1.     void PlaybackEyes(Vector3 gazeDirectionLeft, Vector3 gazeDirectionRight, float leftBlink01, float rightBlink01)
    2.     {
    3.         Vector3 cameraPos = cameraXform.position;
    4.        
    5.         Quaternion leftEyeRotation =  Quaternion.LookRotation(gazeDirectionLeft, transform.up);
    6.         Quaternion rightEyeRotation = Quaternion.LookRotation(gazeDirectionRight, transform.up);
    7.        
    8.         Quaternion eyeRootQ = eyeAndHeadAnimator.GetOwnEyeCenterXform().rotation;
    9.         Quaternion eyeRootInvQ = Quaternion.Inverse(eyeRootQ);
    10.         Vector3 leftEyeLocalEuler = (eyeRootInvQ * leftEyeRotation).eulerAngles;
    11.         Vector3 rightEyeLocalEuler = (eyeRootInvQ * rightEyeRotation).eulerAngles;
    12.         leftEyeLocalEuler = new Vector3(eyeAndHeadAnimator.controlData.ClampLeftVertEyeAngle(leftEyeLocalEuler.x),
    13.                                         eyeAndHeadAnimator.ClampLeftHorizEyeAngle(leftEyeLocalEuler.y),
    14.                                         leftEyeLocalEuler.z);
    15.         rightEyeLocalEuler = new Vector3(eyeAndHeadAnimator.controlData.ClampRightVertEyeAngle(rightEyeLocalEuler.x),
    16.                                         eyeAndHeadAnimator.ClampRightHorizEyeAngle(rightEyeLocalEuler.y),
    17.                                         rightEyeLocalEuler.z);
    18.                
    19.         leftEyeXform.rotation = eyeRootQ * Quaternion.Euler(leftEyeLocalEuler) * leftEyeRootFromAnchorQ;
    20.         rightEyeXform.rotation = eyeRootQ * Quaternion.Euler(rightEyeLocalEuler) * rightEyeRootFromAnchorQ;
    21.    
    22.         float averageBlink01 = Mathf.Lerp(leftBlink01, rightBlink01, 0.5f);
    23.         eyeAndHeadAnimator.controlData.UpdateEyelids( MiscUtils.NormalizedDegAngle(leftEyeLocalEuler.x),
    24.                                                                             MiscUtils.NormalizedDegAngle(rightEyeLocalEuler.x),
    25.                                                                             averageBlink01,
    26.                                                                             true,
    27.                                                                             1);
    28.     }
    29.  
     
    Alvare32 and ContactVR like this.
  33. ContactVR

    ContactVR

    Joined:
    Feb 19, 2021
    Posts:
    12
    Thank you so much Faikus. I will try it on and will let you know how it goes. All the best.
     
  34. Faikus

    Faikus

    Joined:
    Jan 3, 2011
    Posts:
    239
    For this specific use case you should call this at start somewhere:
    Code (CSharp):
    1. eyeAndHeadAnimator.updateType = EyeAndHeadAnimator.UpdateType.External;
    2. eyeAndHeadAnimator.enabled = false;
     
  35. ContactVR

    ContactVR

    Joined:
    Feb 19, 2021
    Posts:
    12
    Yes, that's probably what I was missing. Thank you a lot again!
     
  36. Slowbud

    Slowbud

    Joined:
    Jul 19, 2015
    Posts:
    81
    Hey @Faikus, after years of succesful using, I suddenly get this Error when re-setting up the eyes. Can't find what is Null Referencing. Eye Control is "Selected Objects", Eyelid Control is "Blendshapes". As soon as I click "Eyes open, looking straight - SAVE" error comes up:
    Using latest release: 2.1.3


    NullReferenceException: Object reference not set to an instance of an object
    RealisticEyeMovements.ControlData.CreateNewBlendshapeConfigs (UnityEngine.Transform startXform) (at Assets/RealisticEyeMovements/Scripts/Internal/ControlData.cs:353)
    RealisticEyeMovements.ControlData.SaveDefault (UnityEngine.Object rootObject) (at Assets/RealisticEyeMovements/Scripts/Internal/ControlData.cs:956)
    RealisticEyeMovements.EyeAndHeadAnimatorEditor.DrawSetupConfiguration () (at Assets/RealisticEyeMovements/Scripts/Editor/EyeAndHeadAnimatorEditor.cs:431)
    RealisticEyeMovements.EyeAndHeadAnimatorEditor.OnInspectorGUI () (at Assets/RealisticEyeMovements/Scripts/Editor/EyeAndHeadAnimatorEditor.cs:616)
    UnityEditor.UIElements.InspectorElement+<>c__DisplayClass59_0.<CreateIMGUIInspectorFromEditor>b__0 () (at <31768fe99cfe4466aa4a401169fb2ce5>:0)
    UnityEngine.GUIUtility:processEvent(Int32, IntPtr, Boolean&)
     
  37. Faikus

    Faikus

    Joined:
    Jan 3, 2011
    Posts:
    239
    Hi Slowbud, can you send me a test scene (all objects other than the character deleted)?
     
  38. Slowbud

    Slowbud

    Joined:
    Jul 19, 2015
    Posts:
    81
    @Faikus Tore, hier meine Email, xxxx. Can we solve this in an other way. My experience is, I send Gigabyte big files, need hours to create them, and, ... maybe I found a bug ... or not. All happened. Danke :)
     
    Last edited: Aug 20, 2021
  39. Faikus

    Faikus

    Joined:
    Jan 3, 2011
    Posts:
    239
    Sure! Mail sent.
     
    Last edited: Aug 20, 2021
  40. wrussell

    wrussell

    Joined:
    Feb 26, 2013
    Posts:
    15
    Hi, I am trying to follow along with your video tutorial for my character - my character is based on DAZ, and all the bones are named as expected, but the DAZ preset file gives really bad results, so I am trying to set up manually. The character starts with eyes open looking straight, so just click Save. Then I rotate the eyelids for closed eyes and click Save against "Eyes closed, looking straight". Great so far. But now, when I click "Load" next to the "Eyes open, looking straight" item to reset, nothing happens. I have tried putting things back by hand and then saving the next two positions; when I do that, clicking "Load" against any one of the four eye positions just changes nothing. There are no errors in the console.

    When I run the thing in play mode, I see eye movement but no blinking or other eyelid movement, and the following error is logged every frame:

    NullReferenceException: Object reference not set to an instance of an object
    RealisticEyeMovements.EyeAndHeadAnimator.Update2 (System.Single deltaTime) (at Assets/RealisticEyeMovements/Scripts/EyeAndHeadAnimator.cs:1433)
    RealisticEyeMovements.EyeAndHeadAnimator.Update1 (System.Single deltaTime) (at Assets/RealisticEyeMovements/Scripts/EyeAndHeadAnimator.cs:1399)
    RealisticEyeMovements.EyeAndHeadAnimator.LateUpdate () (at Assets/RealisticEyeMovements/Scripts/EyeAndHeadAnimator.cs:989)

    Thanks!
     
  41. Faikus

    Faikus

    Joined:
    Jan 3, 2011
    Posts:
    239
    Can you show me a screenshot of the Setup section with all collapsible components expanded?
     
  42. Hazneliel

    Hazneliel

    Joined:
    Nov 14, 2013
    Posts:
    305
    Hello
    Im having some issues with LookTargetController

    When I call
    Code (CSharp):
    1. LookAtPoiDirectly(testTarget);
    or
    Code (CSharp):
    1. LookAtPoiDirectly(testTarget, -1);
    The Script will still change state and start looking at the player. I cannot figure out how to make the script to look at a transform indeterminately. I have also tried setting the Min and Max Look time to high values.

    Another issue is that when used with Final IK, the script will not work if FBBIK us disabled at frame zero, once I enable it and disable it then LookTargetController will start working.

    Another issue is when the script detects a main camera, it will hold to it even if that camera is disabled and another camera enabled. I recently updated and this started happening, on a version before the script would detect the new camera as soon as you disabled one.

    I hope you can help me with this.

    Regards

    Some notes.
    I have been trying to pin point why the script will still look at the player even after I explicitly called LookAtPointDirectly.
    There could be many reasons but one of them could be this line:
    Code (CSharp):
    1. bool isPlayerApproaching = lastDistanceToPlayer > distanceToPlayer;
    I debugged this and it will check true even with a difference of 0.0000001 which will basically be true since the head is always slightly moving.
     
    Last edited: Nov 11, 2021
  43. Hazneliel

    Hazneliel

    Joined:
    Nov 14, 2013
    Posts:
    305
    Hello, I got an additional issue.
    Cross Eye correction doesn't seem to be working when the target is above the character.
    Take a look at the screenshot:
    upload_2021-11-11_10-30-18.png
     
  44. Faikus

    Faikus

    Joined:
    Jan 3, 2011
    Posts:
    239
    Hi,

    Thanks for the detailed description.

    About the looking-at-player thing, the main issue is that "look at player if they step into my notice zone" overrides the previous "keep looking at thing" command. For now that is actually intended, because if you want your character to keep looking at the thing no matter what you can set the notice-player-distance to 0. I agree there should be an easier way to set and understand which commands have priority. I'll come up with a cleaner interface for this, but it might not be in the next update already.

    The other issues will be fixed in the next update though. If you PM me your email I can send you the updated files already (some issues I've fixed already, the others I send you as soon as I get to do them).
     
    Hazneliel likes this.
  45. Hazneliel

    Hazneliel

    Joined:
    Nov 14, 2013
    Posts:
    305
    Thanks, I will be sending you an email soon.
    I found a nice fix for the player cameras changing, I reintroduced a method you had before but made it more efficient:
    Code (CSharp):
    1.         void UpdateCameraTransformIfNecessary()
    2.         {
    3.             if (playerEyeCenterXform.gameObject.activeSelf) return;
    4.          
    5.             if ( false == useVR )
    6.                 playerEyeCenterXform = (thirdPersonPlayerEyeCenter != null) ? thirdPersonPlayerEyeCenter : Camera.main.transform;
    7.         }
     
  46. hanneshogni

    hanneshogni

    Joined:
    Jun 15, 2015
    Posts:
    8
    I love REM and the care that has gone into its research and development. I have been doing academic research on nonverbal behavior for virtual humans since 1995, currently at Reykjavik University's Socially Expressive Computing Group.

    My question is: Has anyone gotten REM working with the "o3n UMA Races Stunner Jane & John" asset? These are some very good character models for the UMA 2 system, that feel a bit less "creepy" than the default UMA models. You can check out their web demo to see these models in action. We are planning to use these models for psychological experiments in VR.

    The problem is that the UMA preset (including the updated one from Sep. 2020) does something weird to their eyelids (see the right face in the image below). I have tried to adjust the position of the bones to open/close the lids properly, but there is something more going on, as the eyelashes seem to have vanished (as if they got twisted to face inwards). The eyes themselves work fine though.

    UMA-o3n.PNG

    Any feedback appreciated! Thank you!
     
  47. Faikus

    Faikus

    Joined:
    Jan 3, 2011
    Posts:
    239
    Try this preset: UMA_o3n.json
     
    hanneshogni likes this.
  48. hanneshogni

    hanneshogni

    Joined:
    Jun 15, 2015
    Posts:
    8
    That worked! You are a life saver! Thank you so much! :-D
     
  49. halo_of_the_sun

    halo_of_the_sun

    Joined:
    Sep 17, 2017
    Posts:
    64
    Hello, I'm having some issues with my Character Creator 3 models, I'm getting this error when starting the scene:

    Eye_01.JPG

    These are my Eye Controller settings:
    Eye_02.JPG

    Can you help me at all?
    All the best,
     

    Attached Files:

  50. Faikus

    Faikus

    Joined:
    Jan 3, 2011
    Posts:
    239
    You are using an old version, so I cannot locate the source of the error based on the line numbers. Can you update to the current one and run again?