optimize performance
This commit is contained in:
@@ -154,7 +154,6 @@ namespace Gallop
|
|||||||
{
|
{
|
||||||
morph._weight = 0;
|
morph._weight = 0;
|
||||||
}
|
}
|
||||||
ChangeMorph();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void ProcessMorph(FacialMorph morph)
|
private void ProcessMorph(FacialMorph morph)
|
||||||
@@ -206,15 +205,7 @@ namespace Gallop
|
|||||||
morph.Weight = val;
|
morph.Weight = val;
|
||||||
ChangeMorph();
|
ChangeMorph();
|
||||||
}
|
}
|
||||||
|
|
||||||
public void ChangeMorphWeights(Dictionary<FacialMorph, float> morphs)
|
|
||||||
{
|
|
||||||
foreach(var item in morphs)
|
|
||||||
{
|
|
||||||
item.Key.Weight = item.Value;
|
|
||||||
}
|
|
||||||
ChangeMorph();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -71,25 +71,20 @@ public class FaceEmotionKeyTarget : ScriptableObject
|
|||||||
{
|
{
|
||||||
if (FaceDrivenKeyTarget == null) return;
|
if (FaceDrivenKeyTarget == null) return;
|
||||||
FaceDrivenKeyTarget.ClearMorph();
|
FaceDrivenKeyTarget.ClearMorph();
|
||||||
Dictionary<FacialMorph, float> morphs = new Dictionary<FacialMorph, float>();
|
|
||||||
foreach (var emotion in FaceEmotionKey)
|
foreach (var emotion in FaceEmotionKey)
|
||||||
{
|
{
|
||||||
if (emotion.emotionKeys != null)
|
if (emotion.emotionKeys != null)
|
||||||
{
|
{
|
||||||
foreach (var key in emotion.emotionKeys)
|
foreach (var key in emotion.emotionKeys)
|
||||||
{
|
{
|
||||||
if (morphs.ContainsKey(key.morph))
|
key.morph.Weight += key.weight / 100 * emotion.Weight;
|
||||||
{
|
|
||||||
morphs[key.morph] = key.morph.Weight + key.weight / 100 * emotion.Weight;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
morphs.Add(key.morph, key.morph.Weight + key.weight / 100 * emotion.Weight);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
FaceDrivenKeyTarget.ChangeMorphWeights(morphs);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
FaceDrivenKeyTarget.ChangeMorph();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user