protected override void InitializeViewCore() { foreach (var texture in Data.Materials) { AddChildNode(DataViewNodeFactory.Create(texture.Name, texture)); } }
protected override void InitializeViewCore() { foreach (var entryName in Data) { var node = DataViewNodeFactory.Create(entryName, Data.OpenFile(entryName)); AddChildNode(node); } }
protected override void InitializeViewCore() { foreach (var texture in Data.Textures) { var node = DataViewNodeFactory.Create(texture.Name, texture); AddChildNode(node); } }
protected override void InitializeViewCore() { for (int i = 0; i < Data.Count; i++) { string itemName = mItemNameProvider != null?mItemNameProvider(Data[i], i) : mItemNames[i]; Nodes.Add(DataViewNodeFactory.Create(itemName, Data[i])); } }
protected override void InitializeViewCore() { if (Data[0] != null) { DiffuseMap = ( TextureMapViewNode )DataViewNodeFactory.Create("Diffuse Map", Data[0]); AddChildNode(DiffuseMap); } if (Data[1] != null) { NormalMap = ( TextureMapViewNode )DataViewNodeFactory.Create("Normal Map", Data[1]); AddChildNode(NormalMap); } if (Data[2] != null) { SpecularMap = ( TextureMapViewNode )DataViewNodeFactory.Create("Specular Map", Data[2]); AddChildNode(SpecularMap); } if (Data[3] != null) { ReflectionMap = ( TextureMapViewNode )DataViewNodeFactory.Create("Reflection Map", Data[3]); AddChildNode(ReflectionMap); } if (Data[4] != null) { HighlightMap = ( TextureMapViewNode )DataViewNodeFactory.Create("Highlight Map", Data[4]); AddChildNode(HighlightMap); } if (Data[5] != null) { GlowMap = ( TextureMapViewNode )DataViewNodeFactory.Create("Glow Map", Data[5]); AddChildNode(GlowMap); } if (Data[6] != null) { NightMap = ( TextureMapViewNode )DataViewNodeFactory.Create("Night Map", Data[6]); AddChildNode(NightMap); } if (Data[7] != null) { DetailMap = ( TextureMapViewNode )DataViewNodeFactory.Create("Detail Map", Data[7]); AddChildNode(DetailMap); } if (Data[8] != null) { ShadowMap = ( TextureMapViewNode )DataViewNodeFactory.Create("Shadow Map", Data[8]); AddChildNode(ShadowMap); } }
protected override void InitializeCore() { RegisterExportHandler <Archive>((path) => Data.Save(path)); RegisterReplaceHandler <Archive>((path) => new Archive(path)); RegisterAddHandler <Stream>((path) => Nodes.Add(DataViewNodeFactory.Create(path))); RegisterModelUpdateHandler(() => { var builder = new ArchiveBuilder(); foreach (DataViewNode node in Nodes) { builder.AddFile(node.Text, ModuleExportUtilities.CreateStream(node.Data)); } return(builder.Build()); }); }
private void CreateTextureMapViewModel(TextureMap textureMap, int index) { switch (index) { case 0: DiffuseMap = ( TextureMapViewNode )DataViewNodeFactory.Create("Diffuse Map", textureMap); return; case 1: NormalMap = ( TextureMapViewNode )DataViewNodeFactory.Create("Normal Map", textureMap); return; case 2: SpecularMap = ( TextureMapViewNode )DataViewNodeFactory.Create("Specular Map", textureMap); return; case 3: ReflectionMap = ( TextureMapViewNode )DataViewNodeFactory.Create("Reflection Map", textureMap); return; case 4: HighlightMap = ( TextureMapViewNode )DataViewNodeFactory.Create("Hightlight Map", textureMap); return; case 5: GlowMap = ( TextureMapViewNode )DataViewNodeFactory.Create("Glow Map", textureMap); return; case 6: NightMap = ( TextureMapViewNode )DataViewNodeFactory.Create("Night Map", textureMap); return; case 7: DetailMap = ( TextureMapViewNode )DataViewNodeFactory.Create("Detail Map", textureMap); return; case 8: ShadowMap = ( TextureMapViewNode )DataViewNodeFactory.Create("Shadow Map", textureMap); return; } }
protected override void InitializeCore() { RegisterExportHandler <Archive>((path) => Data.Save(path)); RegisterReplaceHandler <Archive>((path) => new Archive(path)); RegisterAddHandler <Stream>((path) => AddChildNode(DataViewNodeFactory.Create(path))); RegisterModelUpdateHandler(() => { var builder = new ArchiveBuilder(); foreach (DataViewNode node in Nodes) { builder.AddFile(node.Text, ModuleExportUtilities.CreateStream(node.Data)); } return(builder.Build()); }); RegisterCustomHandler("Export", "All", () => { var dialog = new VistaFolderBrowserDialog(); { if (dialog.ShowDialog() != true) { return; } foreach (DataViewNode node in Nodes) { // Hack for field texture archives: prefer DDS output format Type type = null; if (node.DataType == typeof(FieldTexturePS3) || node.DataType == typeof(GNFTexture)) { type = typeof(DDSStream); } node.Export(Path.Combine(dialog.SelectedPath, node.Text), type); } } }); }
protected override void InitializeViewCore() { if (Data.Textures != null) { Textures = ( TextureDictionaryViewNode )DataViewNodeFactory.Create("Textures", Data.Textures); AddChildNode(Textures); } if (Data.Materials != null) { Materials = ( MaterialDictionaryViewNode )DataViewNodeFactory.Create("Materials", Data.Materials); AddChildNode(Materials); } if (Data.Model != null) { Model = ( ModelViewNode )DataViewNodeFactory.Create("Model", Data.Model); AddChildNode(Model); } if (Data.ChunkType000100F9 != null) { ChunkType000100F9 = ( ChunkType000100F9ViewNode )DataViewNodeFactory.Create("Chunk Type 000100F9", Data.ChunkType000100F9); AddChildNode(ChunkType000100F9); } if (Data.ChunkType000100F8 != null) { ChunkType000100F8 = ( ChunkType000100F8ViewNode )DataViewNodeFactory.Create("Chunk Type 000100F8", Data.ChunkType000100F8); AddChildNode(ChunkType000100F8); } if (Data.AnimationPack != null) { Animations = ( AnimationPackViewNode )DataViewNodeFactory.Create("Animations", Data.AnimationPack); AddChildNode(Animations); } }
protected override void InitializeViewCore() { if (Data.Textures != null) { Textures = ( TextureDictionaryViewNode )DataViewNodeFactory.Create("Textures", Data.Textures); Nodes.Add(Textures); } if (Data.Materials != null) { Materials = ( MaterialDictionaryViewNode )DataViewNodeFactory.Create("Materials", Data.Materials); Nodes.Add(Materials); } if (Data.Scene != null) { Scene = ( SceneViewNode )DataViewNodeFactory.Create("Scene", Data.Scene); Nodes.Add(Scene); } if (Data.ChunkType000100F9 != null) { ChunkType000100F9 = ( ChunkType000100F9ViewNode )DataViewNodeFactory.Create("Chunk Type 000100F9", Data.ChunkType000100F9); Nodes.Add(ChunkType000100F9); } if (Data.ChunkType000100F8 != null) { ChunkType000100F8 = ( ChunkType000100F8ViewNode )DataViewNodeFactory.Create("Chunk Type 000100F8", Data.ChunkType000100F8); Nodes.Add(ChunkType000100F8); } if (Data.AnimationPack != null) { AnimationPack = ( AnimationPackViewNode )DataViewNodeFactory.Create("Animations", Data.AnimationPack); Nodes.Add(AnimationPack); } }