Esempio n. 1
0
        /// <parameter>key</parameter>
        public void SetCustomValue(String key, float value)
        {
            var expressionKey = ExpressionKey.CreateCustom(key);

            if (this.expressionKeyWeights.ContainsKey(expressionKey))
            {
                this.expressionKeyWeights[expressionKey] = value;
            }
        }
Esempio n. 2
0
        /// <summary>
        /// for SubAssetName
        /// </summary>
        /// <returns></returns>
        public static string ExtractKey(this Expression expression)
        {
            ExpressionKey key =
                (expression.Preset == ExpressionPreset.custom)
            ? ExpressionKey.CreateCustom(expression.Name)
            : ExpressionKey.CreateFromPreset(expression.Preset)
            ;

            return(key.ExtractKey);
        }
Esempio n. 3
0
 static ExpressionKey CreateKey(UniGLTF.Extensions.VRMC_vrm.Expression expression)
 {
     if (expression.Preset == UniGLTF.Extensions.VRMC_vrm.ExpressionPreset.custom)
     {
         return(ExpressionKey.CreateCustom(expression.Name));
     }
     else
     {
         return(ExpressionKey.CreateFromPreset(expression.Preset));
     }
 }
Esempio n. 4
0
        public float GetCustomValue(String key)
        {
            var expressionKey = ExpressionKey.CreateCustom(key);

            if (this.expressionKeyWeights.ContainsKey(expressionKey))
            {
                return(this.expressionKeyWeights[expressionKey]);
            }
            else
            {
                return(0.0f);
            }
        }
Esempio n. 5
0
 IEnumerable <SubAssetKey> EnumerateExpressinKeys(UniGLTF.Extensions.VRMC_vrm.Expressions expressions)
 {
     if (expressions?.Preset?.Happy != null)
     {
         yield return(ExpressionKey.Happy.SubAssetKey);
     }
     if (expressions?.Preset?.Angry != null)
     {
         yield return(ExpressionKey.Angry.SubAssetKey);
     }
     if (expressions?.Preset?.Sad != null)
     {
         yield return(ExpressionKey.Sad.SubAssetKey);
     }
     if (expressions?.Preset?.Relaxed != null)
     {
         yield return(ExpressionKey.Relaxed.SubAssetKey);
     }
     if (expressions?.Preset?.Surprised != null)
     {
         yield return(ExpressionKey.Surprised.SubAssetKey);
     }
     if (expressions?.Preset?.Aa != null)
     {
         yield return(ExpressionKey.Aa.SubAssetKey);
     }
     if (expressions?.Preset?.Ih != null)
     {
         yield return(ExpressionKey.Ih.SubAssetKey);
     }
     if (expressions?.Preset?.Ou != null)
     {
         yield return(ExpressionKey.Ou.SubAssetKey);
     }
     if (expressions?.Preset?.Ee != null)
     {
         yield return(ExpressionKey.Ee.SubAssetKey);
     }
     if (expressions?.Preset?.Oh != null)
     {
         yield return(ExpressionKey.Oh.SubAssetKey);
     }
     if (expressions?.Preset?.Blink != null)
     {
         yield return(ExpressionKey.Blink.SubAssetKey);
     }
     if (expressions?.Preset?.BlinkLeft != null)
     {
         yield return(ExpressionKey.BlinkLeft.SubAssetKey);
     }
     if (expressions?.Preset?.BlinkRight != null)
     {
         yield return(ExpressionKey.BlinkRight.SubAssetKey);
     }
     if (expressions?.Preset?.LookUp != null)
     {
         yield return(ExpressionKey.LookUp.SubAssetKey);
     }
     if (expressions?.Preset?.LookDown != null)
     {
         yield return(ExpressionKey.LookDown.SubAssetKey);
     }
     if (expressions?.Preset?.LookLeft != null)
     {
         yield return(ExpressionKey.LookLeft.SubAssetKey);
     }
     if (expressions?.Preset?.LookRight != null)
     {
         yield return(ExpressionKey.LookRight.SubAssetKey);
     }
     foreach (var kv in expressions.Custom)
     {
         yield return(ExpressionKey.CreateCustom(kv.Key).SubAssetKey);
     }
 }
Esempio n. 6
0
        public static void SetCustomValue(this IExpressionAccumulator self, string key, float value)
        {
            var expressionKey = ExpressionKey.CreateCustom(key);

            self.SetValue(expressionKey, value);
        }
Esempio n. 7
0
        public static float GetCustomValue(this IExpressionAccumulator self, string key)
        {
            var expressionKey = ExpressionKey.CreateCustom(key);

            return(self.GetValue(expressionKey));
        }