Beispiel #1
0
 public static string[] LinkClasses(this EffectVariable var)
 {
     string[] result = new string[0];
     if (var.GetAnnotationByName("linkclass") != null)
     {
         if (var.GetAnnotationByName("linkclass").AsString() != null)
         {
             result = var.GetAnnotationByName("linkclass").AsString().GetString().Split(",".ToCharArray());
         }
     }
     return(result);
 }
Beispiel #2
0
 public static bool Reference(this EffectVariable var, string variableName)
 {
     if (var.GetAnnotationByName("ref") != null)
     {
         if (var.GetAnnotationByName("ref").AsString() != null)
         {
             string name = var.GetAnnotationByName("ref").AsString().GetString();
             return(name == variableName);
         }
     }
     return(false);
 }
Beispiel #3
0
        public static double UiMax(this EffectVariable var)
        {
            double res = double.MaxValue;

            if (var.GetAnnotationByName("uimax") != null)
            {
                if (var.GetAnnotationByName("uimax").AsScalar() != null)
                {
                    res = var.GetAnnotationByName("uimax").AsScalar().GetFloat();
                }
            }
            return(res);
        }
Beispiel #4
0
        public static bool Visible(this EffectVariable var)
        {
            bool res = true;

            if (var.GetAnnotationByName("visible") != null)
            {
                if (var.GetAnnotationByName("visible").AsScalar() != null)
                {
                    res = var.GetAnnotationByName("visible").AsScalar().GetFloat() > 0.5f;
                }
            }
            return(res);
        }
Beispiel #5
0
        public static string LinkClassesStr(this EffectVariable var)
        {
            string result = String.Empty;

            if (var.GetAnnotationByName("linkclass") != null)
            {
                if (var.GetAnnotationByName("linkclass").AsString() != null)
                {
                    result = var.GetAnnotationByName("linkclass").AsString().GetString();
                }
            }
            return(result);
        }
Beispiel #6
0
        public static bool IsTextureMatrix(this EffectVariable var)
        {
            bool res = false;

            if (var.GetAnnotationByName("uvspace") != null)
            {
                if (var.GetAnnotationByName("uvspace").AsScalar() != null)
                {
                    res = var.GetAnnotationByName("uvspace").AsScalar().GetFloat() > 0.5f;
                }
            }
            return(res);
        }
Beispiel #7
0
        public static bool InvY(this EffectVariable var)
        {
            bool res = false;

            if (var.GetAnnotationByName("invy") != null)
            {
                if (var.GetAnnotationByName("invy").AsScalar() != null)
                {
                    res = var.GetAnnotationByName("invy").AsScalar().GetFloat() > 0.5f;
                }
            }
            return(res);
        }
Beispiel #8
0
        public static string UiName(this EffectVariable var)
        {
            string name = var.Description.Name;

            if (var.GetAnnotationByName("uiname") != null)
            {
                if (var.GetAnnotationByName("uiname").AsString() != null)
                {
                    name = var.GetAnnotationByName("uiname").AsString().GetString();
                }
            }
            return(name);
        }
Beispiel #9
0
        public static double UiStep(this EffectVariable var)
        {
            double res = -1;

            if (var.GetAnnotationByName("uistep") != null)
            {
                if (var.GetAnnotationByName("uistep").AsScalar() != null)
                {
                    res = var.GetAnnotationByName("uistep").AsScalar().GetFloat();
                }
            }
            return(res);
        }
Beispiel #10
0
        public override SubscriberBase GetSubscriberInstance(EffectVariable variable, RenderContext context, MMEEffectManager effectManager, int semanticIndex)
        {
            EffectVariable annotation = variable.GetAnnotationByName("SyncInEditMode");
            bool           syncMode   = false;

            if (annotation != null)
            {
                syncMode = annotation.AsScalar().GetInt() == 1;
            }
            return(GetSubscriberInstance(syncMode));
        }
Beispiel #11
0
        public static AspectRatioMode AspectMode(this EffectVariable var)
        {
            if (var.GetAnnotationByName("aspectmode") != null)
            {
                if (var.GetAnnotationByName("aspectmode").AsString() != null)
                {
                    string mode = var.GetAnnotationByName("aspectmode").AsString().GetString();

                    AspectRatioMode aspectMode;
                    if (Enum.TryParse <AspectRatioMode>(mode, out aspectMode))
                    {
                        return(aspectMode);
                    }
                    else
                    {
                        return(AspectRatioMode.FitIn);
                    }
                }
            }
            return(AspectRatioMode.FitIn);
        }
Beispiel #12
0
        public override 数管理  数登録インスタンスを生成して返す(EffectVariable variable, エフェクト effect, int semanticIndex)
        {
            EffectVariable annotation = variable.GetAnnotationByName("SyncInEditMode");

            bool syncMode = false;

            if (annotation != null)
            {
                syncMode = (annotation.AsScalar().GetInt() == 1);
            }

            return(時間変数登録インスタンスを生成して返す(syncMode));
        }
        public DX11CustomRenderVariable(EffectVariable var)
        {
            this.Name = var.Description.Name;
            this.TypeName = var.GetVariableType().Description.TypeName;
            this.Semantic = var.Description.Semantic;
            var ha = var.GetAnnotationByName("help");

            if (ha != null)
            {
                this.Help = ha.AsString().GetString();
            }
            else
            {
                this.Help = "";
            }
        }
        public DX11CustomRenderVariable(EffectVariable var)
        {
            this.Name     = var.Description.Name;
            this.TypeName = var.GetVariableType().Description.TypeName;
            this.Semantic = var.Description.Semantic;
            var ha = var.GetAnnotationByName("help");

            if (ha != null)
            {
                this.Help = ha.AsString().GetString();
            }
            else
            {
                this.Help = "";
            }
        }