{
  "Name": "Material",
  "_id": "72c0d6f1-ef64-4df6-b535-000b4b085b1e",
  "Namespace": "lib.3d.material",
  "Description": "",
  "Inputs": [
    {
      "Name": "Scene",
      "MetaInstanceID": "c457fb2d-fbdb-474c-b9fb-7d27d489da1f",
      "DefaultValue": {
        "Type": "Scene",
        "Value": "Framefield.Core.Scene"
      },
      "MetaID": "79122951-7bc4-4c68-b085-866eab828248",
      "IsMultiInput": "False",
      "Relevance": "Required",
      "Description": "",
      "Min": "-100000",
      "Max": "100000",
      "Scale": "1",
      "ScaleType": "Linear",
      "EnumValues": []
    },
    {
      "Name": "Ambient.R",
      "MetaInstanceID": "442c3d17-5435-4f30-96cc-d560c862ada8",
      "DefaultValue": {
        "Type": "Float",
        "Value": "0.2"
      },
      "MetaID": "3f76dee3-3897-44ac-82d6-25ce9f53a506",
      "IsMultiInput": "False",
      "Relevance": "Optional",
      "Description": "",
      "Min": "0",
      "Max": "1",
      "Scale": "0.01",
      "ScaleType": "Linear",
      "EnumValues": []
    },
    {
      "Name": "Ambient.G",
      "MetaInstanceID": "12ef5425-1a91-45da-85dd-b537d8b10370",
      "DefaultValue": {
        "Type": "Float",
        "Value": "0.2"
      },
      "MetaID": "3f76dee3-3897-44ac-82d6-25ce9f53a506",
      "IsMultiInput": "False",
      "Relevance": "Optional",
      "Description": "",
      "Min": "0",
      "Max": "1",
      "Scale": "0.01",
      "ScaleType": "Linear",
      "EnumValues": []
    },
    {
      "Name": "Ambient.B",
      "MetaInstanceID": "19e70bc8-7aab-4fb4-8c82-1e49f6c1173f",
      "DefaultValue": {
        "Type": "Float",
        "Value": "0.2"
      },
      "MetaID": "3f76dee3-3897-44ac-82d6-25ce9f53a506",
      "IsMultiInput": "False",
      "Relevance": "Optional",
      "Description": "",
      "Min": "0",
      "Max": "1",
      "Scale": "0.01",
      "ScaleType": "Linear",
      "EnumValues": []
    },
    {
      "Name": "Ambient.A",
      "MetaInstanceID": "3744cc9d-77dc-4d8a-825f-a14f06af19dc",
      "DefaultValue": {
        "Type": "Float",
        "Value": "1"
      },
      "MetaID": "3f76dee3-3897-44ac-82d6-25ce9f53a506",
      "IsMultiInput": "False",
      "Relevance": "Optional",
      "Description": "",
      "Min": "0",
      "Max": "1",
      "Scale": "0.01",
      "ScaleType": "Linear",
      "EnumValues": []
    },
    {
      "Name": "Diffuse.R",
      "MetaInstanceID": "8984d8b1-fb8d-487c-986f-c66067bd6a52",
      "DefaultValue": {
        "Type": "Float",
        "Value": "0.8"
      },
      "MetaID": "3f76dee3-3897-44ac-82d6-25ce9f53a506",
      "IsMultiInput": "False",
      "Relevance": "Optional",
      "Description": "",
      "Min": "0",
      "Max": "1",
      "Scale": "0.01",
      "ScaleType": "Linear",
      "EnumValues": []
    },
    {
      "Name": "Diffuse.G",
      "MetaInstanceID": "a02b6178-6462-4e9c-95ae-58e0a9bb5a5d",
      "DefaultValue": {
        "Type": "Float",
        "Value": "0.8"
      },
      "MetaID": "3f76dee3-3897-44ac-82d6-25ce9f53a506",
      "IsMultiInput": "False",
      "Relevance": "Optional",
      "Description": "",
      "Min": "0",
      "Max": "1",
      "Scale": "0.01",
      "ScaleType": "Linear",
      "EnumValues": []
    },
    {
      "Name": "Diffuse.B",
      "MetaInstanceID": "d3b98614-2914-4d57-be00-119f89749907",
      "DefaultValue": {
        "Type": "Float",
        "Value": "0.8"
      },
      "MetaID": "3f76dee3-3897-44ac-82d6-25ce9f53a506",
      "IsMultiInput": "False",
      "Relevance": "Optional",
      "Description": "",
      "Min": "0",
      "Max": "1",
      "Scale": "0.01",
      "ScaleType": "Linear",
      "EnumValues": []
    },
    {
      "Name": "Diffuse.A",
      "MetaInstanceID": "d4d74f46-44b5-426a-80ba-a5d077f336e8",
      "DefaultValue": {
        "Type": "Float",
        "Value": "1"
      },
      "MetaID": "3f76dee3-3897-44ac-82d6-25ce9f53a506",
      "IsMultiInput": "False",
      "Relevance": "Optional",
      "Description": "",
      "Min": "0",
      "Max": "1",
      "Scale": "0.01",
      "ScaleType": "Linear",
      "EnumValues": []
    },
    {
      "Name": "Specular.R",
      "MetaInstanceID": "e06646a5-fecd-46a2-a674-d46ff9cc8d1d",
      "DefaultValue": {
        "Type": "Float",
        "Value": "1"
      },
      "MetaID": "3f76dee3-3897-44ac-82d6-25ce9f53a506",
      "IsMultiInput": "False",
      "Relevance": "Optional",
      "Description": "",
      "Min": "0",
      "Max": "1",
      "Scale": "0.01",
      "ScaleType": "Linear",
      "EnumValues": []
    },
    {
      "Name": "Specular.G",
      "MetaInstanceID": "aa195667-13c4-4094-8dd2-0f72f88bbf0e",
      "DefaultValue": {
        "Type": "Float",
        "Value": "1"
      },
      "MetaID": "3f76dee3-3897-44ac-82d6-25ce9f53a506",
      "IsMultiInput": "False",
      "Relevance": "Optional",
      "Description": "",
      "Min": "0",
      "Max": "1",
      "Scale": "0.01",
      "ScaleType": "Linear",
      "EnumValues": []
    },
    {
      "Name": "Specular.B",
      "MetaInstanceID": "640cdf25-80c6-4eb8-bb8f-78bf4e59ee85",
      "DefaultValue": {
        "Type": "Float",
        "Value": "1"
      },
      "MetaID": "3f76dee3-3897-44ac-82d6-25ce9f53a506",
      "IsMultiInput": "False",
      "Relevance": "Optional",
      "Description": "",
      "Min": "0",
      "Max": "1",
      "Scale": "0.01",
      "ScaleType": "Linear",
      "EnumValues": []
    },
    {
      "Name": "Specular.A",
      "MetaInstanceID": "ba905ce6-95dd-42f0-aacd-d9bab552b95f",
      "DefaultValue": {
        "Type": "Float",
        "Value": "1"
      },
      "MetaID": "3f76dee3-3897-44ac-82d6-25ce9f53a506",
      "IsMultiInput": "False",
      "Relevance": "Optional",
      "Description": "",
      "Min": "0",
      "Max": "1",
      "Scale": "0.01",
      "ScaleType": "Linear",
      "EnumValues": []
    },
    {
      "Name": "Emission.R",
      "MetaInstanceID": "f8846016-992a-4d5f-9fc4-4b0c1e27e00e",
      "DefaultValue": {
        "Type": "Float",
        "Value": "0"
      },
      "MetaID": "3f76dee3-3897-44ac-82d6-25ce9f53a506",
      "IsMultiInput": "False",
      "Relevance": "Optional",
      "Description": "",
      "Min": "0",
      "Max": "1",
      "Scale": "0.01",
      "ScaleType": "Linear",
      "EnumValues": []
    },
    {
      "Name": "Emission.G",
      "MetaInstanceID": "e779ff9a-7ead-45b7-8f24-57063120765a",
      "DefaultValue": {
        "Type": "Float",
        "Value": "0"
      },
      "MetaID": "3f76dee3-3897-44ac-82d6-25ce9f53a506",
      "IsMultiInput": "False",
      "Relevance": "Optional",
      "Description": "",
      "Min": "0",
      "Max": "1",
      "Scale": "0.01",
      "ScaleType": "Linear",
      "EnumValues": []
    },
    {
      "Name": "Emission.B",
      "MetaInstanceID": "6e6ea108-245b-498d-ae57-9f51e7b47205",
      "DefaultValue": {
        "Type": "Float",
        "Value": "0"
      },
      "MetaID": "3f76dee3-3897-44ac-82d6-25ce9f53a506",
      "IsMultiInput": "False",
      "Relevance": "Optional",
      "Description": "",
      "Min": "0",
      "Max": "1",
      "Scale": "0.01",
      "ScaleType": "Linear",
      "EnumValues": []
    },
    {
      "Name": "Emission.A",
      "MetaInstanceID": "5b8b8efa-a66e-4930-b2de-32b5000e281e",
      "DefaultValue": {
        "Type": "Float",
        "Value": "1"
      },
      "MetaID": "3f76dee3-3897-44ac-82d6-25ce9f53a506",
      "IsMultiInput": "False",
      "Relevance": "Optional",
      "Description": "",
      "Min": "0",
      "Max": "1",
      "Scale": "0.01",
      "ScaleType": "Linear",
      "EnumValues": []
    },
    {
      "Name": "Shininess",
      "MetaInstanceID": "2ddca77b-ffee-4ef6-8fda-fa82ddd861ca",
      "DefaultValue": {
        "Type": "Float",
        "Value": "10"
      },
      "MetaID": "3f76dee3-3897-44ac-82d6-25ce9f53a506",
      "IsMultiInput": "False",
      "Relevance": "Optional",
      "Description": "",
      "Min": "-100000",
      "Max": "100000",
      "Scale": "0.1",
      "ScaleType": "Linear",
      "EnumValues": []
    }
  ],
  "Outputs": [
    {
      "Name": "Scene",
      "MetaInstanceID": "fbbef027-0800-42d8-8b30-ffceff6fad4d",
      "MetaID": "79122951-7bc4-4c68-b085-866eab828248"
    }
  ],
  "OperatorParts": [
    {
      "MetaInstanceID": "19da0124-9dff-4772-98e1-01553d2491e6",
      "MetaID": "80ce7b88-ab93-4fc9-b8b9-95336e641d6c",
      "Name": "MaterialFunc",
      "Version": "eccbf7d8-34a2-4809-8381-377f5f4da65c",
      "Type": "Float",
      "IsMultiInput": "True",
      "Script": [
        "//>>> _using",
        "using System;",
        "using System.Collections.Generic;",
        "using System.Linq;",
        "using System.Text;",
        "using SharpDX;",
        "using SharpDX.Direct3D11;",
        "using SharpDX.Windows;",
        "//<<< _using",
        "",
        "namespace Framefield.Core.ID80ce7b88_ab93_4fc9_b8b9_95336e641d6c",
        "{",
        "    public class Class_Material : OperatorPart.Function, IMaterial",
        "    {",
        "        //>>> _inputids",
        "        private enum InputId",
        "        {",
        "            Scene = 0,",
        "            AmbientR = 1,",
        "            AmbientG = 2,",
        "            AmbientB = 3,",
        "            AmbientA = 4,",
        "            DiffuseR = 5,",
        "            DiffuseG = 6,",
        "            DiffuseB = 7,",
        "            DiffuseA = 8,",
        "            SpecularR = 9,",
        "            SpecularG = 10,",
        "            SpecularB = 11,",
        "            SpecularA = 12,",
        "            EmissionR = 13,",
        "            EmissionG = 14,",
        "            EmissionB = 15,",
        "            EmissionA = 16,",
        "            Shininess = 17",
        "        }",
        "        //<<< _inputids",
        "    ",
        "        public override OperatorPartContext Eval(OperatorPartContext context, List<OperatorPart> inputs, int outputIdx) {",
        "            //>>> _params",
        "            var Scene = inputs[(int)InputId.Scene];",
        "            var AmbientR = inputs[(int)InputId.AmbientR].Eval(context).Value;",
        "            var AmbientG = inputs[(int)InputId.AmbientG].Eval(context).Value;",
        "            var AmbientB = inputs[(int)InputId.AmbientB].Eval(context).Value;",
        "            var AmbientA = inputs[(int)InputId.AmbientA].Eval(context).Value;",
        "            var Ambient = new Color4(AmbientR, AmbientG, AmbientB, AmbientA);",
        "            var DiffuseR = inputs[(int)InputId.DiffuseR].Eval(context).Value;",
        "            var DiffuseG = inputs[(int)InputId.DiffuseG].Eval(context).Value;",
        "            var DiffuseB = inputs[(int)InputId.DiffuseB].Eval(context).Value;",
        "            var DiffuseA = inputs[(int)InputId.DiffuseA].Eval(context).Value;",
        "            var Diffuse = new Color4(DiffuseR, DiffuseG, DiffuseB, DiffuseA);",
        "            var SpecularR = inputs[(int)InputId.SpecularR].Eval(context).Value;",
        "            var SpecularG = inputs[(int)InputId.SpecularG].Eval(context).Value;",
        "            var SpecularB = inputs[(int)InputId.SpecularB].Eval(context).Value;",
        "            var SpecularA = inputs[(int)InputId.SpecularA].Eval(context).Value;",
        "            var Specular = new Color4(SpecularR, SpecularG, SpecularB, SpecularA);",
        "            var EmissionR = inputs[(int)InputId.EmissionR].Eval(context).Value;",
        "            var EmissionG = inputs[(int)InputId.EmissionG].Eval(context).Value;",
        "            var EmissionB = inputs[(int)InputId.EmissionB].Eval(context).Value;",
        "            var EmissionA = inputs[(int)InputId.EmissionA].Eval(context).Value;",
        "            var Emission = new Color4(EmissionR, EmissionG, EmissionB, EmissionA);",
        "            var Shininess = inputs[(int)InputId.Shininess].Eval(context).Value;",
        "            //<<< _params",
        "",
        "            // store values for later use of IMaterial",
        "            this.Ambient = Ambient;",
        "            this.Diffuse = Diffuse;",
        "            this.Specular = Specular;",
        "            this.Emission = Emission;",
        "            this.Shininess = Shininess;",
        "",
        "            var prevMaterial = (IMaterial) context.Objects[OperatorPartContext.MATERIAL_ID];",
        "            context.Objects[OperatorPartContext.MATERIAL_ID] = this;",
        "",
        "            Scene.Eval(context);",
        "",
        "            context.Objects[OperatorPartContext.MATERIAL_ID] = prevMaterial;",
        "",
        "            return context;",
        "        }",
        "",
        "        public Color4 Ambient { get; private set; }",
        "        public Color4 Diffuse { get; private set; }",
        "        public Color4 Specular { get; private set; }",
        "        public Color4 Emission { get; private set; }",
        "        public float Shininess { get; private set; }",
        "    }",
        "}",
        "",
        ""
      ],
      "AdditionalAssemblies": []
    }
  ],
  "Operators": [],
  "Connections": [
    {
      "SourceOp": "00000000-0000-0000-0000-000000000000",
      "SourceOpPart": "19da0124-9dff-4772-98e1-01553d2491e6",
      "TargetOp": "00000000-0000-0000-0000-000000000000",
      "TargetOpPart": "fbbef027-0800-42d8-8b30-ffceff6fad4d"
    },
    {
      "SourceOp": "00000000-0000-0000-0000-000000000000",
      "SourceOpPart": "c457fb2d-fbdb-474c-b9fb-7d27d489da1f",
      "TargetOp": "00000000-0000-0000-0000-000000000000",
      "TargetOpPart": "19da0124-9dff-4772-98e1-01553d2491e6"
    },
    {
      "SourceOp": "00000000-0000-0000-0000-000000000000",
      "SourceOpPart": "442c3d17-5435-4f30-96cc-d560c862ada8",
      "TargetOp": "00000000-0000-0000-0000-000000000000",
      "TargetOpPart": "19da0124-9dff-4772-98e1-01553d2491e6"
    },
    {
      "SourceOp": "00000000-0000-0000-0000-000000000000",
      "SourceOpPart": "12ef5425-1a91-45da-85dd-b537d8b10370",
      "TargetOp": "00000000-0000-0000-0000-000000000000",
      "TargetOpPart": "19da0124-9dff-4772-98e1-01553d2491e6"
    },
    {
      "SourceOp": "00000000-0000-0000-0000-000000000000",
      "SourceOpPart": "19e70bc8-7aab-4fb4-8c82-1e49f6c1173f",
      "TargetOp": "00000000-0000-0000-0000-000000000000",
      "TargetOpPart": "19da0124-9dff-4772-98e1-01553d2491e6"
    },
    {
      "SourceOp": "00000000-0000-0000-0000-000000000000",
      "SourceOpPart": "3744cc9d-77dc-4d8a-825f-a14f06af19dc",
      "TargetOp": "00000000-0000-0000-0000-000000000000",
      "TargetOpPart": "19da0124-9dff-4772-98e1-01553d2491e6"
    },
    {
      "SourceOp": "00000000-0000-0000-0000-000000000000",
      "SourceOpPart": "8984d8b1-fb8d-487c-986f-c66067bd6a52",
      "TargetOp": "00000000-0000-0000-0000-000000000000",
      "TargetOpPart": "19da0124-9dff-4772-98e1-01553d2491e6"
    },
    {
      "SourceOp": "00000000-0000-0000-0000-000000000000",
      "SourceOpPart": "a02b6178-6462-4e9c-95ae-58e0a9bb5a5d",
      "TargetOp": "00000000-0000-0000-0000-000000000000",
      "TargetOpPart": "19da0124-9dff-4772-98e1-01553d2491e6"
    },
    {
      "SourceOp": "00000000-0000-0000-0000-000000000000",
      "SourceOpPart": "d3b98614-2914-4d57-be00-119f89749907",
      "TargetOp": "00000000-0000-0000-0000-000000000000",
      "TargetOpPart": "19da0124-9dff-4772-98e1-01553d2491e6"
    },
    {
      "SourceOp": "00000000-0000-0000-0000-000000000000",
      "SourceOpPart": "d4d74f46-44b5-426a-80ba-a5d077f336e8",
      "TargetOp": "00000000-0000-0000-0000-000000000000",
      "TargetOpPart": "19da0124-9dff-4772-98e1-01553d2491e6"
    },
    {
      "SourceOp": "00000000-0000-0000-0000-000000000000",
      "SourceOpPart": "e06646a5-fecd-46a2-a674-d46ff9cc8d1d",
      "TargetOp": "00000000-0000-0000-0000-000000000000",
      "TargetOpPart": "19da0124-9dff-4772-98e1-01553d2491e6"
    },
    {
      "SourceOp": "00000000-0000-0000-0000-000000000000",
      "SourceOpPart": "aa195667-13c4-4094-8dd2-0f72f88bbf0e",
      "TargetOp": "00000000-0000-0000-0000-000000000000",
      "TargetOpPart": "19da0124-9dff-4772-98e1-01553d2491e6"
    },
    {
      "SourceOp": "00000000-0000-0000-0000-000000000000",
      "SourceOpPart": "640cdf25-80c6-4eb8-bb8f-78bf4e59ee85",
      "TargetOp": "00000000-0000-0000-0000-000000000000",
      "TargetOpPart": "19da0124-9dff-4772-98e1-01553d2491e6"
    },
    {
      "SourceOp": "00000000-0000-0000-0000-000000000000",
      "SourceOpPart": "ba905ce6-95dd-42f0-aacd-d9bab552b95f",
      "TargetOp": "00000000-0000-0000-0000-000000000000",
      "TargetOpPart": "19da0124-9dff-4772-98e1-01553d2491e6"
    },
    {
      "SourceOp": "00000000-0000-0000-0000-000000000000",
      "SourceOpPart": "f8846016-992a-4d5f-9fc4-4b0c1e27e00e",
      "TargetOp": "00000000-0000-0000-0000-000000000000",
      "TargetOpPart": "19da0124-9dff-4772-98e1-01553d2491e6"
    },
    {
      "SourceOp": "00000000-0000-0000-0000-000000000000",
      "SourceOpPart": "e779ff9a-7ead-45b7-8f24-57063120765a",
      "TargetOp": "00000000-0000-0000-0000-000000000000",
      "TargetOpPart": "19da0124-9dff-4772-98e1-01553d2491e6"
    },
    {
      "SourceOp": "00000000-0000-0000-0000-000000000000",
      "SourceOpPart": "6e6ea108-245b-498d-ae57-9f51e7b47205",
      "TargetOp": "00000000-0000-0000-0000-000000000000",
      "TargetOpPart": "19da0124-9dff-4772-98e1-01553d2491e6"
    },
    {
      "SourceOp": "00000000-0000-0000-0000-000000000000",
      "SourceOpPart": "5b8b8efa-a66e-4930-b2de-32b5000e281e",
      "TargetOp": "00000000-0000-0000-0000-000000000000",
      "TargetOpPart": "19da0124-9dff-4772-98e1-01553d2491e6"
    },
    {
      "SourceOp": "00000000-0000-0000-0000-000000000000",
      "SourceOpPart": "2ddca77b-ffee-4ef6-8fda-fa82ddd861ca",
      "TargetOp": "00000000-0000-0000-0000-000000000000",
      "TargetOpPart": "19da0124-9dff-4772-98e1-01553d2491e6"
    }
  ]
}