Example #1
0
 private void LoadLodMapping(string mappingName)
 {
     try
     {
         mapping = (VertexMapping)LoadObject(mappingName, typeof(VertexMapping));
         SetupViewers();
     }
     catch (FileNotFoundException)
     {
         CreateMapping();
     }
 }
        public void SetMapData(VertexMapping mapping, bool inverse)
        {
            if (mapping == null)
            {
                return;
            }
            this.mapping   = mapping;
            inverseMapping = inverse;

            if (!inverse)
            {
                // Threshold array creation..
                thresholdArray = (VertexPositionColor[])vertexArray.Clone();
                for (int i = 0; i < mapping.Thresholds.Length; i++)
                {
                    float t = (mapping.Thresholds[i] - mapping.MinThreshold) / mapping.MaxThreshold;
                    Color c = new Color(t, t, t);
                    SetVertexColor(thresholdArray, i, c);
                }
            }

            RefreshMapData();
        }
Example #3
0
        void CreateMapping()
        {
            mapping = new VertexMapping(me2Save.PlayerRecord.Appearance.MorphHead.LOD0Vertices, me3Save.Player.Appearance.MorphHead.Lod0Vertices);

            // Save newly created map and repopulate list
            string filename = DefaultName;

            if (File.Exists(DefaultName + ".xml"))
            {
                int i = 1;
                for (; File.Exists(DefaultName + "_" + i + ".xml"); i++)
                {
                    ;
                }
                filename += "_" + i;
            }
            SaveLodMapping(filename);
            PopulateLodMappingsXmlList();
            listBoxLodMappings.SelectedIndex = listBoxLodMappings.Items.IndexOf(filename);

            lodViewerME2.SetMapData(mapping, false);
            lodViewerME3.SetMapData(mapping, true);
        }
Example #4
0
        public void SetMapData(VertexMapping mapping, bool inverse)
        {
            if (mapping == null) return;
            this.mapping = mapping;
            inverseMapping = inverse;

            if (!inverse)
            {
                // Threshold array creation..
                thresholdArray = (VertexPositionColor[])vertexArray.Clone();
                for (int i = 0; i < mapping.Thresholds.Length; i++)
                {
                    float t = (mapping.Thresholds[i] - mapping.MinThreshold) / mapping.MaxThreshold;
                    Color c = new Color(t, t, t);
                    SetVertexColor(thresholdArray, i, c);
                }
            }

            RefreshMapData();
        }
Example #5
0
 private void LoadLodMapping(string mappingName)
 {
     try
     {
         mapping = (VertexMapping)LoadObject(mappingName, typeof(VertexMapping));
         SetupViewers();
     }
     catch (FileNotFoundException)
     {
         CreateMapping();
     }
 }
Example #6
0
        void CreateMapping()
        {
            mapping = new VertexMapping(me2Save.PlayerRecord.Appearance.MorphHead.LOD0Vertices, me3Save.Player.Appearance.MorphHead.Lod0Vertices);

            // Save newly created map and repopulate list
            string filename = DefaultName;
            if (File.Exists(DefaultName + ".xml"))
            {
                int i = 1;
                for (; File.Exists(DefaultName + "_" + i + ".xml"); i++) ;
                filename += "_" + i;
            }
            SaveLodMapping(filename);
            PopulateLodMappingsXmlList();
            listBoxLodMappings.SelectedIndex = listBoxLodMappings.Items.IndexOf(filename);

            lodViewerME2.SetMapData(mapping, false);
            lodViewerME3.SetMapData(mapping, true);
        }