Example #1
0
 public void LoadStaticMeshComponents()
 {
     for (int i = 0; i < UStatComp.Count; i++)
     {
         int entry = UPR.FindObjectProperty("StaticMesh", UStatComp[i].props);
         if (entry >= 0 && entry < pcc.Header.ExportCount)
         {
             if (pcc.getClassName(pcc.Export[entry].Class) == "StaticMesh")
             {
                 UStaticMesh t = new UStaticMesh(pcc.EntryToBuff(entry), pcc.names);
                 t.ReadProperties(4);
                 t.index  = entry;
                 t.index2 = UStatComp[i].index;
                 t.index3 = i;
                 entry    = UPR.FindProperty("Scale3D", UStatComp[i].props);
                 LevelProperties LP = UStatComp[i].LP;
                 GlobalTransform g  = UStatComp[i].LP.GT;
                 if (entry != -1)
                 {
                     Vector3 v = PropToVector3(UStatComp[i].props[entry + 1].raw);
                     g.scl.X *= v.X;
                     g.scl.Y *= v.Y;
                     g.scl.Z *= v.Z;
                 }
                 g.scl *= g.scl2;
                 LP.GT  = g;
                 t.LP   = LP;
                 UStat.Add(t);
             }
         }
     }
 }
Example #2
0
        public UnrealObject(byte[] mem, string Uclass, string[] Names)
        {
            objectclass = Uclass;
            names       = Names;
            switch (objectclass)
            {
            case "DecalActor":
                UDecA = new UDecalActor(mem, names);
                break;

            case "DecalComponent":
                UDecC = new UDecalComponent(mem, names);
                break;

            case "InterpActor":
                UIntA = new UInterpActor(mem, names);
                break;

            case "StaticMesh":
                UStat = new UStaticMesh(mem, names);
                break;

            case "StaticMeshActor":
                UStatA = new  UStaticMeshActor(mem, names);
                break;

            case "StaticMeshComponent":
                UStatC = new UStaticMeshComponent(mem, names);
                break;

            case "SkeletalMesh":
                USkel = new USkelMesh(mem, names);
                break;

            case "Texture2D":
                UTex2D = new UTexture2D(mem, names);
                break;

            case "Material":
                UMat = new UMaterial(mem, names);
                break;

            case "WwiseStream":
                UWws = new UWwiseStream(mem, names);
                break;

            default:
                UUkn = new UnknownObject(mem, objectclass, names);
                break;
            }
        }
Example #3
0
 public void LoadStaticMeshComponents()
 {
     for (int i = 0; i < UStatComp.Count; i++)
     {
         int entry = UPR.FindObjectProperty("StaticMesh", UStatComp[i].props);
         if (entry >= 0 && entry < pcc.Header.ExportCount)
             if (pcc.getClassName(pcc.Export[entry].Class) == "StaticMesh")
             {
                 UStaticMesh t = new UStaticMesh(pcc.EntryToBuff(entry), pcc.names);
                 t.ReadProperties(4);
                 t.index = entry;
                 t.index2 = UStatComp[i].index;
                 t.index3 = i;
                 entry = UPR.FindProperty("Scale3D", UStatComp[i].props);
                 LevelProperties LP = UStatComp[i].LP;
                 GlobalTransform g = UStatComp[i].LP.GT;
                 if (entry != -1)
                 {
                     Vector3 v = PropToVector3(UStatComp[i].props[entry + 1].raw);
                     g.scl.X *= v.X;
                     g.scl.Y *= v.Y;
                     g.scl.Z *= v.Z;
                 }
                 g.scl *= g.scl2;
                 LP.GT = g;
                 t.LP = LP;
                 UStat.Add(t);
             }
     }
 }
Example #4
0
        private void cloneToolStripMenuItem_Click(object sender, EventArgs e)
        {
            int Sel = -1;
            TreeNode t = treeView1.SelectedNode;
            if (t != null && t.Parent != null)
            {
                TreeNode t2 = t.Parent;
                if (t2.Text == "Static Meshes")
                    Sel = t.Index;
            }
            if (Sel == -1)
                return;
            if (Level.UStat[Sel].LP.source == 1)//Collection
            {
                int index = Level.UStat[Sel].LP.sourceentry;
                int index2 = Level.UStat[Sel].index2;
                for(int i=0;i<Level.UStatColl.Count;i++)
                    if (Level.UStatColl[i].LP.sourceentry == index)
                        for (int j = 0; j < Level.UStatColl[i].Entries.Count; j++)
                            if (Level.UStatColl[i].Entries[j] == index2)
                            {
                                Level.UStatColl[i].CloneObject(j);                                                              
                                UStaticMesh u = Level.UStat[Sel];
                                UStaticMesh u2 = new UStaticMesh();
                                u2.LP = u.LP;
                                u2.DirectX = u.DirectX;
                                u2.bound = u.bound;
                                u2.index = u.index;
                                u2.index2 = u.index2;
                                Level.UStat.Add(u2);
                                GenerateTree();
                                TreeNode t2 = treeView1.Nodes[0];
                                t2.Expand();
                                treeView1.SelectedNode = t2.Nodes[Sel];
                                MessageBox.Show("Done.");
                                return;
                            }

            }
        }