Ejemplo n.º 1
0
 private void Meshplorer_Load(object sender, EventArgs e)
 {
     if (Preview3D.InitializeGraphics(pb1))
     {
         Preview3D.DXCube c = Preview3D.NewCubeByOrigSize(new Vector3(-0.5f, -0.5f, -0.5f), new Vector3(1, 1, 1), 0);
         Preview3D.Cubes = new List <Preview3D.DXCube>();
         Preview3D.Cubes.Add(c);
         timer1.Enabled = true;
     }
 }
Ejemplo n.º 2
0
        public void LoadStaticMesh(int index)
        {
            stm = new StaticMesh(pcc as ME3Package, index);
            List <MaterialInstanceConstant> matInsts = stm.Mesh.Mat.MatInst;
            bool foundTex = false;

            try
            {
                for (int i = 0; i < matInsts.Count; i++)
                {
                    for (int j = 0; j < matInsts[i].Textures.Count; j++)
                    {
                        if (matInsts[i].Textures[j].Desc.Contains("Diffuse"))
                        {
                            Preview3D.setTex(matInsts[i].Textures[j].Texture);
                            foundTex = true;
                            break;
                        }
                    }
                }
            }
            catch
            {
            }
            if (!foundTex)
            {
                Preview3D.setTex();
            }
            Preview3D.StatMesh = stm;
            //Preview3D.SkelMesh = null;
            Preview3D.CamOffset = new Vector3(0, 0, 0);
            treeView1.BeginUpdate();
            treeView1.Nodes.Clear();
            treeView1.Nodes.Add(stm.ToTree());
            treeView1.Nodes[0].Expand();
            treeView1.EndUpdate();
        }
Ejemplo n.º 3
0
 private void timer1_Tick(object sender, EventArgs e)
 {
     Preview3D.Refresh();
 }
Ejemplo n.º 4
0
 public void LoadSkeletalMesh(int index)
 {
     try
     {
         DisableLODs();
         UnCheckLODs();
         skm              = new SkeletalMesh(pcc as ME3Package, index);
         skmold           = new SkeletalMeshOld(pcc as ME3Package, index);
         hb1.ByteProvider = new DynamicByteProvider(pcc.Exports[index].Data);
         bool foundTex = false;
         try
         {
             for (int i = 0; i < skm.MatInsts.Count; i++)
             {
                 for (int j = 0; j < skm.MatInsts[i].Textures.Count; j++)
                 {
                     if (skm.MatInsts[i].Textures[j].Desc.Contains("Diffuse"))
                     {
                         Preview3D.setTex(skm.MatInsts[i].Textures[j].Texture);
                         foundTex = true;
                         break;
                     }
                 }
             }
         }
         catch
         {
         }
         if (!foundTex)
         {
             Preview3D.setTex();
         }
         Preview3D.StatMesh    = null;
         Preview3D.SkelMesh    = skm;
         Preview3D.CamDistance = skm.Bounding.r * 2.0f;
         Preview3D.CamOffset   = skm.Bounding.origin;
         treeView1.BeginUpdate();
         treeView1.Nodes.Clear();
         treeView1.Nodes.Add(skm.ToTree());
         treeView1.Nodes[0].Expand();
         treeView1.EndUpdate();
         lODToolStripMenuItem.Visible  = true;
         lOD0ToolStripMenuItem.Enabled = true;
         lOD0ToolStripMenuItem.Checked = true;
         if (skm.LODModels.Count > 1)
         {
             lOD1ToolStripMenuItem.Enabled = true;
         }
         if (skm.LODModels.Count > 2)
         {
             lOD2ToolStripMenuItem.Enabled = true;
         }
         if (skm.LODModels.Count > 3)
         {
             lOD3ToolStripMenuItem.Enabled = true;
         }
     }
     catch
     {
         return;
     }
 }