Basic ear morph
This commit is contained in:
@@ -158,7 +158,21 @@ namespace Gallop
|
||||
{
|
||||
foreach(DynamicBone dynamic in DynamicBones)
|
||||
{
|
||||
dynamic.enabled = isOn;
|
||||
if (!dynamic.m_Root.name.Contains("Ear"))
|
||||
{
|
||||
dynamic.enabled = isOn;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void EnableEarPhysics(bool isOn)
|
||||
{
|
||||
foreach (DynamicBone dynamic in DynamicBones)
|
||||
{
|
||||
if (dynamic.m_Root.name.Contains("Ear"))
|
||||
{
|
||||
dynamic.enabled = isOn;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -5,10 +5,10 @@ using UnityEngine;
|
||||
namespace Gallop
|
||||
{
|
||||
|
||||
public class DrivenKeyTarget : MonoBehaviour
|
||||
public class DrivenKeyTarget : ScriptableObject
|
||||
{
|
||||
|
||||
public List<TargetInfomation> _targetFaces { get; set; }
|
||||
public List<TargetInfomation> _targetFaces;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -10,13 +10,16 @@ namespace Gallop
|
||||
public List<EyeTarget> _eyeTarget;
|
||||
public List<EyebrowTarget> _eyebrowTarget;
|
||||
public List<MouthTarget> _mouthTarget;
|
||||
public List<TargetInfomation> _earTarget;
|
||||
|
||||
public List<Transform> Objs;
|
||||
private FacialMorph BaseLEarMorph, BaseREarMorph;
|
||||
private FacialMorph BaseLEyeBrowMorph, BaseREyeBrowMorph;
|
||||
private FacialMorph BaseLEyeMorph, BaseREyeMorph;
|
||||
private FacialMorph BaseMouthMorph;
|
||||
public FacialMorph LeftEyeXrange, LeftEyeYrange, RightEyeXrange, RightEyeYrange;
|
||||
|
||||
public List<FacialMorph> EarMorphs = new List<FacialMorph>();
|
||||
public List<FacialMorph> EyeBrowMorphs = new List<FacialMorph>();
|
||||
public List<FacialMorph> EyeMorphs = new List<FacialMorph>();
|
||||
public List<FacialMorph> MouthMorphs = new List<FacialMorph>();
|
||||
@@ -31,6 +34,32 @@ namespace Gallop
|
||||
{
|
||||
Objs = objs;
|
||||
|
||||
for (int i = 0; i < _earTarget.Count; i++)
|
||||
{
|
||||
for (int j = 0; j < _earTarget[i]._faceGroupInfo.Count; j++)
|
||||
{
|
||||
FacialMorph morph = new FacialMorph();
|
||||
morph.target = this;
|
||||
morph.direction = j > 0;
|
||||
morph.name = "Ear_" + i + "_" + (morph.direction ? "L" : "R");
|
||||
morph.tag = Enum.GetName(typeof(EarType), i);
|
||||
morph.trsArray = _earTarget[i]._faceGroupInfo[j]._trsArray;
|
||||
foreach (TrsArray trs in morph.trsArray)
|
||||
{
|
||||
trs.transform = Objs.Find(ani => ani.name.Equals(trs._path));
|
||||
}
|
||||
if (i == 0)
|
||||
{
|
||||
if (morph.direction) BaseLEarMorph = morph;
|
||||
else BaseREarMorph = morph;
|
||||
}
|
||||
else
|
||||
{
|
||||
EarMorphs.Add(morph);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
for (int i = 0; i < _eyebrowTarget.Count; i++)
|
||||
{
|
||||
for (int j = 0; j < _eyebrowTarget[i]._faceGroupInfo.Count; j++)
|
||||
@@ -159,6 +188,11 @@ namespace Gallop
|
||||
{
|
||||
FacialResetAll();
|
||||
|
||||
foreach (FacialMorph morph in EarMorphs)
|
||||
{
|
||||
ProcessMorph(morph);
|
||||
}
|
||||
|
||||
foreach (FacialMorph morph in EyeBrowMorphs)
|
||||
{
|
||||
ProcessMorph(morph);
|
||||
@@ -179,6 +213,12 @@ namespace Gallop
|
||||
|
||||
public void ClearMorph()
|
||||
{
|
||||
|
||||
foreach (FacialMorph morph in EarMorphs)
|
||||
{
|
||||
morph.weight = 0;
|
||||
}
|
||||
|
||||
foreach (FacialMorph morph in EyeBrowMorphs)
|
||||
{
|
||||
morph.weight = 0;
|
||||
@@ -210,6 +250,8 @@ namespace Gallop
|
||||
|
||||
public void FacialResetAll()
|
||||
{
|
||||
FacialReset(BaseLEarMorph.trsArray);
|
||||
FacialReset(BaseREarMorph.trsArray);
|
||||
FacialReset(BaseLEyeBrowMorph.trsArray);
|
||||
FacialReset(BaseREyeBrowMorph.trsArray);
|
||||
FacialReset(BaseLEyeMorph.trsArray);
|
||||
|
||||
Reference in New Issue
Block a user