Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Basic Player Facial Animations #59

Open
Cheeseness opened this issue Feb 18, 2014 · 2 comments

Comments

Projects
None yet
2 participants
@Cheeseness
Copy link
Contributor

commented Feb 18, 2014

People are moving ahead with facial animation, so it's better to push this out into its own issue rather than cluttering up #3.

To start with, we're looking for:

  • Happy reaction face
  • Angry reaction face
  • Neutral face

@Cheeseness Cheeseness added the asset label Feb 18, 2014

This was referenced Feb 18, 2014

@ChrAfonso

This comment has been minimized.

Copy link
Contributor

commented Feb 18, 2014

Good idea, thanks for creating the issue! As there are different possibilities to implement these, I'd like to do a quick brain dump of my thoughts on these so far (mostly theoretical as for now - Some of this I already wrote in the other related issues, I hope it's not too redundant :))

  • Blend shapes: using a neutral starting face and blend shapes "Happy" and "Angry", we can dynamically blend between them via script or animations, or in the simplest case just set them to 0 or 100 for instant switching. The Brad head (bradgolf7) currently in the Assets folder already has the "Happy" face available, which can be manipulated via the Inspector GUI or by adding a script using GetComponent(SkinnedMeshRenderer).SetBlendShapeWeight(0, value);
    Video of this in action: http://www.youtube.com/watch?v=jXUVdGHgh2U
  • Textures: Alternatively, we could use three textures and swap them out according to the current player state. These would be easier to create and modify, but I don't know how transitions/animations between face could be done (animated textures?).

In both cases, a standardized naming scheme should be in place to make this independent of the current character/head model used - "Neutral", "Happy", and "Angry" seem to be the obvious labels ;).

Some specific caveats I encountered with blend shapes created in Blender:

  • Before creating shapes, all mesh modifiers (mirror etc.) have to be applied, or the shapes will not be exported. And Blender won't apply modifiers when there already are shapes present - so all shapes created before applying the modifiers can't be used and have to be redone.
  • The "inactive"--"fully active" range in Blender is [0..1], but after importing in Unity, it's mapped to [0..100], despite the Unity docs stating: "At weight 0 BlendShape has no influence, at weight 1 BlendShape is fully active"
@ChrAfonso

This comment has been minimized.

Copy link
Contributor

commented Feb 28, 2014

Regarding the current state in the repo: The script "FaceState.cs" in Assets/scripts/animation can be dragged onto the "Head" gameobject (currently a subobject of the "BradHead" prefab in Assets/characters) and then blendshapes set from any script attached to the player gameobject via GameObject.Find("Head").SetFaceExpression("Happy"); etc.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.