Exemplo n.º 1
0
        private static void LoadDff()
        {
            using (new Timing("Loading DFFs into scene"))
                using (new MemoryCounter()) {
                    var itemDefinitions   = new DefinitionCollection();
                    var modelCollection   = new ModelCollection();
                    var textureCollection = new TextureCollection(true);

                    foreach (var obj in Selection.objects)
                    {
                        var objPath = AssetDatabase.GetAssetPath(obj);

                        if (objPath.EndsWith(".dff", StringComparison.OrdinalIgnoreCase))
                        {
                            var dff = new DffFile(objPath);

                            modelCollection.Add(dff);
                            itemDefinitions.Add(new ItemDefinition(dff.FileNameWithoutExtension));
                        }
                        else if (objPath.EndsWith(".txd", StringComparison.OrdinalIgnoreCase))
                        {
                            textureCollection.Add(new TxdFile(objPath));
                        }
                    }

                    using (new Loader(itemDefinitions, modelCollection, textureCollection))
                        foreach (var definition in itemDefinitions)
                        {
                            definition.GetObject(true);
                        }
                }
        }
Exemplo n.º 2
0
        public void ViewDffFile(string filepath, byte[] data)
        {
            var dff = new DffFile(filepath);

            dff.Load(data);

            //MessageBox.Show(dff.Clump.DumpTree(10));

            Form         f = new Form();
            PropertyGrid p = new PropertyGrid();

            p.Dock           = DockStyle.Fill;
            p.SelectedObject = dff;
            f.Controls.Add(p);
            f.Show();
        }