Search Unity

[RELEASED] Realistic Eye Movements

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

  1. wetcircuit

    wetcircuit

    Joined:
    Jul 17, 2012
    Posts:
    1,409
    I got a notice it had been updated this morning, so maybe an issue slipped in with the update that triggered something…?
     
  2. Faikus

    Faikus

    Joined:
    Jan 3, 2011
    Posts:
    241
    That's right; update 1.9.9 had a problem which I only found out after submitting it. I submitted the fix 2.0.0 yesterday, hopefully it will be out in the next hours.

     
    wetcircuit likes this.
  3. nomax5

    nomax5

    Joined:
    Jan 27, 2011
    Posts:
    365
    I just went to buy the asset and it says
    "Unfortunately, Realistic Eye Movements is no longer available.
    This package has been deprecated from the Asset Store"

    Tell me it hasn't?

    i've read the documentation and was litterally about to buy it.
     
  4. Faikus

    Faikus

    Joined:
    Jan 3, 2011
    Posts:
    241
    The asset is down only temporarily. I hope to get it back up on the store as soon as possible.

     
  5. nomax5

    nomax5

    Joined:
    Jan 27, 2011
    Posts:
    365
    Great I'll keep an eye out for it OUCH ;-)
     
    hopeful likes this.
  6. nomax5

    nomax5

    Joined:
    Jan 27, 2011
    Posts:
    365
    Wow its been over a week
     
  7. Faikus

    Faikus

    Joined:
    Jan 3, 2011
    Posts:
    241
    Yes, Unity says they still haven't reviewed it...


     
  8. Hivemind9000

    Hivemind9000

    Joined:
    Mar 2, 2014
    Posts:
    11
    Now more than two weeks... :-(
     
  9. Faikus

    Faikus

    Joined:
    Jan 3, 2011
    Posts:
    241
    It seems Unity handles the reapproval of a deprecated asset like the approval of a new asset, not like an update. New assets can take as much as a month to be approved, updates usually take just a few days.
     
  10. Faikus

    Faikus

    Joined:
    Jan 3, 2011
    Posts:
    241
    Realistic Eye Movements is back on the asset store!
     
    AcidArrow and wetcircuit like this.
  11. kinodax

    kinodax

    Joined:
    Dec 3, 2014
    Posts:
    22
    Welcome back to the land of the purchasable! :)
     
  12. Hivemind9000

    Hivemind9000

    Joined:
    Mar 2, 2014
    Posts:
    11
    Great! I'm off to purchase it now... :)
     
  13. nomax5

    nomax5

    Joined:
    Jan 27, 2011
    Posts:
    365
    Thanks Faikus,
    I purchased the asset but now I'm wondering if it is going to work for me:

    I'm importing Manuel Bastioni characters into Unity and when I look at the model in wireframe there are eyeballs in the model, I'm pretty sure there are. but there are no separate eyes on the Armature just a Neck then Head.
    Also I can change the blendshapes to move the eyes left right up down, but they move both eyes with one blendshape:

    for example:
    eye_Vert_Max moves both eyeballs from looking forward to looking up
    eye_Vert_Min moves both eyeballs from looking forward to looking down

    I'm still trying to get a nice workflow going and therefore open to suggestions..

    I'm doing a 1st person close up face to face social game
    I have some working head IK but have done nothing with eyes yet, (that’s what I hoped to do with your asset)
    I will be prioritizing / changing lookAt targets on the fly as the character moves around the scene.

    it would be really nice if the character changed targets in a realistic way (like your asset does)

    any help greatly appreciated
    Roy.


    PS I think the blend files are stored in a Json file..
     
  14. Faikus

    Faikus

    Joined:
    Jan 3, 2011
    Posts:
    241
    REM needs the eyes to be either tied to the eye bones or be separate objects. What I often do when a model doesn't have either is to delete the mesh parts which it uses for eyes and replace them with high quality eyes from the asset store. This is usually quite easy to do and looks and works great.

     
  15. nomax5

    nomax5

    Joined:
    Jan 27, 2011
    Posts:
    365
    Ahh I see thankyou ...
     
  16. wetcircuit

    wetcircuit

    Joined:
    Jul 17, 2012
    Posts:
    1,409
    After updating to the latest version I get an error at scene start that disables the LookTargetController.

    Code (CSharp):
    1. NullReferenceException: Object reference not set to an instance of an object
    2. RealisticEyeMovements.LookTargetController.Awake () (at Assets/RealisticEyeMovements/Scripts/LookTargetController.cs:117)
    I can toggle it on, and it works as expected. I see no other errors or conflicts.
    I'm using Unity 2018.2.5f1
     
  17. Faikus

    Faikus

    Joined:
    Jan 3, 2011
    Posts:
    241
    Ah, there's no camera that is tagged as main camera. I'll handle that case in the next update, for now please replace the line 117 in LookTargetController, this one:

    if ( Camera.main.transform != null )

    with this:

    if ( Camera.main != null && Camera.main.transform != null )

    Or tag your main camera as MainCamera as quickfix.


     
    wetcircuit likes this.
  18. HenryChinaski

    HenryChinaski

    Joined:
    Jul 9, 2013
    Posts:
    108
    Neither my Mixamo Fuse nor my Fuse CC characters (rigged via Mixamo) have Eye-Bones.
    The "mixamorig:Head" transform only shows one child, called "mixamorig:HeadTop_End".

    So I assume this asset doesn't work with the Mixamo models anymore?
     
  19. wetcircuit

    wetcircuit

    Joined:
    Jul 17, 2012
    Posts:
    1,409
    No, there is something wrong with your Fuse models. Check your workflow.
     

    Attached Files:

  20. HenryChinaski

    HenryChinaski

    Joined:
    Jul 9, 2013
    Posts:
    108
    I open Fuse. Click together head, torso, arms and leg. I export as .Obj and upload it to the Mixamo servers. I let every setting on standard and auto rig. Then I import the rigged character into unity and it misses the eye bones.

    Sounds pretty straight forward to me...
     
  21. wetcircuit

    wetcircuit

    Joined:
    Jul 17, 2012
    Posts:
    1,409
    That workflow won't get you eyebones, or facial and teeth blendshapes.

    In Fuse CC use the Send to Mixamo button:

    Screen Shot 2018-10-17 at 5.54.36 AM.png
     
    Last edited: Oct 17, 2018
    Faikus likes this.
  22. HenryChinaski

    HenryChinaski

    Joined:
    Jul 9, 2013
    Posts:
    108
    Oh, didn't know about that!
    Much easier than I thought it would be!
    Thanks a lot for your help.
     
    wetcircuit likes this.
  23. Nevercallmebyname

    Nevercallmebyname

    Joined:
    Nov 18, 2013
    Posts:
    120
    it bothers me personally that these examples are all human. Could I see how this would look on a cow? Or a dragon? Or an alien?
     
  24. wetcircuit

    wetcircuit

    Joined:
    Jul 17, 2012
    Posts:
    1,409
    Can you supply the model?

    I've used R.E.M. on cats and other animals. The model needs a head (and probably a neck for IK), eye bones or separate eyeball objects, and for blinking either blendshape eyelids or eyelid bones.

    The models that don't really work are ones where the eyes are painted or modeled as part of the head (if there is no in-built way to rotate the eyes, they can be hidden/removed and 3D eyeballs used instead)..., and I had one model where the eyelids were separate objects that rotated to close the eyes which R.E.M didn't have a way to control.
     
    Faikus likes this.
  25. Faikus

    Faikus

    Joined:
    Jan 3, 2011
    Posts:
    241
    I added a video that shows REM applied to some stylized animals:
     
    Last edited: Nov 20, 2018
  26. Nevercallmebyname

    Nevercallmebyname

    Joined:
    Nov 18, 2013
    Posts:
    120
    That is a pretty good result thanks. I think this can work for my purposes
     
  27. SureSight

    SureSight

    Joined:
    Aug 2, 2013
    Posts:
    65
    Do you provide support for 2D eyes? i.e. Manipulating texture offset on a material on a SkinnedMeshRenderer .

    If not, would you be interested in working with me to develop "saccades" simulation for 2D eyes?
     

    Attached Files:

  28. Faikus

    Faikus

    Joined:
    Jan 3, 2011
    Posts:
    241
    Hi,

    REM doesn't have support for UV controlled eyes; if you want to write your own system, I wrote a blog post containing some of the research findings REM is based on which you can use as a starting point.

     
    SureSight likes this.
  29. ikazrima

    ikazrima

    Joined:
    Feb 11, 2014
    Posts:
    320
    I just noticed that my character still turns (sloooowly) to look at the camera / player when I set time scale to 0.
    Does the update loop ignores time scale?
     
  30. Mark_01

    Mark_01

    Joined:
    Mar 31, 2016
    Posts:
    632
    I have sent a PM to the dev, but I am wondering if any one here happens to know if
    REM will work with Reallusion Character Creator 3 Standalone ?
    Thanks
     
  31. Faikus

    Faikus

    Joined:
    Jan 3, 2011
    Posts:
    241
    Good catch! It doesn't ignore timescale, but for very low timeScale there's a bug.
    Here's the fix. In EyeAndHeadAnimator.cs, replace the two lines 1672 and 1797 with this:

    Code (csharp):
    1.  
    2. float deltaTime = Time.deltaTime;
    3.  

    And line 1828 with this:

    Code (csharp):
    1.  
    2. headEulerSpeed = deltaTime > 0f ? (headTargetPivotXform.localEulerAngles - lastHeadEuler)/deltaTime : Vector3.zero;
    3.  
     
    Mark_01 and ikazrima like this.
  32. Faikus

    Faikus

    Joined:
    Jan 3, 2011
    Posts:
    241
    Yes, I also have Character Creator 3 and REM works perfectly with it. Here's a preset file that allows you to set up REM for your CC3 character with just two or three clicks.
     
    Mark_01 likes this.
  33. Mark_01

    Mark_01

    Joined:
    Mar 31, 2016
    Posts:
    632
    Wonderful !!! Thank you so much and thank you for the link for the preset file :)
    I will get this today!!

    I was so impressed with coffee with out words.. truly great work.
     
  34. ikazrima

    ikazrima

    Joined:
    Feb 11, 2014
    Posts:
    320
    Thanks! Now my character can stop creepily and menacingly turns to me when I'm taking screenshots :D
     
  35. ikazrima

    ikazrima

    Joined:
    Feb 11, 2014
    Posts:
    320
    Sorry, new problem arise! I'm getting rotation NaN errors after I set timescale to 0.

    upload_2019-1-11_12-59-10.png
     
  36. Faikus

    Faikus

    Joined:
    Jan 3, 2011
    Posts:
    241
    Please insert this in line 1025:

     
    Mark_01 likes this.
  37. pojoih

    pojoih

    Joined:
    Mar 30, 2013
    Posts:
    226
    Sorry to bother, I got a really old (1.9.5) and heavy customized implementation of your script to make a little robot look in a multiplayer enviroment
    .
    I bumped into a problem and was wondering if this is fixed in one of the newer Versions or if I did a mistake when changing something:
    As long as HeadAndEyeAnimator.cs is used on a root Object everything works as expected but as soon as it is a child of something which is rotated different than (0,0,0) the movement of the head and eyes is offsetted be the degree of rotation of the parent. Maybe you can help out here?
    My scenes were static, until we now have a new scenario where players and the robot are in a moving helicopter.
     
    wetcircuit likes this.
  38. f1chris

    f1chris

    Joined:
    Sep 21, 2013
    Posts:
    335
    @pojoih

    Can help you much but that’s the coolest implementation of this asset I’ve seen ;-)
     
    hopeful likes this.
  39. Faikus

    Faikus

    Joined:
    Jan 3, 2011
    Posts:
    241
    Awesome video! :)

    I haven't changed anything with regards to the angles when being parented. I've tried to reproduce your problem by parenting my character to a root object that has a rotation of 20 degree in x and it still works fine. Can you reproduce the problem with a scene that you could send me (either with the original or the modified script)?

     
  40. unity_26yUBAwGNSCwYg

    unity_26yUBAwGNSCwYg

    Joined:
    Feb 25, 2019
    Posts:
    1
    I want to run an animation which includes head rotation. How to run it along with the head animation in Realistic EyeMovement package.
     
  41. Faikus

    Faikus

    Joined:
    Jan 3, 2011
    Posts:
    241
    You can set the parameter head weight in the EyeAndHeadAnimator component to 0 when you want to the animation to control the head.
     
    Mark_01 likes this.
  42. Slowbud

    Slowbud

    Joined:
    Jul 19, 2015
    Posts:
    81
    @Faikus Hi Faikus, using your tool know for years and happy with it.
    I searched in docu and here but couldn't find anything about the "Use Head Jitter" check box. What does it do exactly? Found it in the code, but didn't really understand.
    Anyway, I have a goal, I want that the NPC lowers the head a little from time to time or continuos while keeping eye contact with the (VR) player so NPC looks more threatining. I thought changing code in the head jitter part could be an easy way to to get this happen. What do you think?
     
  43. Faikus

    Faikus

    Joined:
    Jan 3, 2011
    Posts:
    241
    Head jitter is used to make the character seem less static robotic when they look at something. You can see the effect more pronounced if you set the variable kHeadJitterAmount to something larger than 1 in line 70.

    You are right in that you can do something similar for your purposes: in UpdateHeadMovement(), just as the head jitter code adds something to the targetLocalAngles to the head, you could add/subtract something to targetLocalAngles' x component to make the head look further down or up.

     
    Alvarezmd90 and Mark_01 like this.
  44. Slowbud

    Slowbud

    Joined:
    Jul 19, 2015
    Posts:
    81
    Thanks a lot. I'll give it a try.
     
  45. Slowbud

    Slowbud

    Joined:
    Jul 19, 2015
    Posts:
    81
    This works very well. Just a questions, what exactly influences the headjitter movement speed?
     
  46. Faikus

    Faikus

    Joined:
    Jan 3, 2011
    Posts:
    241
    You can tweak kHeadJitterFrequency on line 69 to change the jitter speed.
     
  47. nomax5

    nomax5

    Joined:
    Jan 27, 2011
    Posts:
    365
    Hi, I've come back to this now I've seperated the eyes from the rest of the model in blender and the blendshapes are on the eyes themselves. I don't know how to associate the blendshapes for looking Right and Left with your software, I have saved looking up and down.



    I can rotate the eyes by altering the blendshapes but I can't rotate them with the transform tool in the editor for some reason

    So I've also purchased some high quality eyes from the asset store as you reccomended. I got he human shader pack

    I can delete the current eyes in blender I am not sure how I insert the new eyes into the mesh of the head. If I put the new eyes in the bone heirachy the dont move with the head correctly.

    I really really like how your eyes move I have it working with Salsa random eyes but I like how your eyes move much better.
     
    Last edited: May 2, 2019
  48. Faikus

    Faikus

    Joined:
    Jan 3, 2011
    Posts:
    241
    Just position the eyes you purchased in the right position each, parent them to the eye bones (if your character has any; if not, then the head bone). If you parented them to eye bones and these eye bones are assigned in Mecanim's humanoid rig, you can set the setting for "Eye control" in EyeAndHeadAnimator to "Mecanim eye bones", otherwise set it to "Eye gameobjects" and assign the inserted eyes into the "Left eye" and "right eye" slots. The rest of the setup stays the same (you can choose to move the eyelids either by blendshapes or bones): you configure the open, closed, looking up and looking down positions by rotating the eyes and changing the eyelid bones or eyelid blendshapes.

    Let me know if you stumble upon any problems.

     
  49. nomax5

    nomax5

    Joined:
    Jan 27, 2011
    Posts:
    365
    Thank you Faikus for your responce it's greatly appreciated, it's working.

    When I seperated the oringinal eyes and parentated them to the head bone they didn't follow the head they were popping out of their sockets, I don't think they were "objects" but mesh renderers or something
    I got all confused and went off at a tangent: I was in blender making importing eyes UV unwrapping - eye controllers you name it I was screwing around in blender with it.

    All sorted for now..
     
  50. Sam512

    Sam512

    Joined:
    Jan 13, 2019
    Posts:
    178
    My character doesn't blink and eyeball move very slightly? Did I do sth wrong?