public SceneAnimFolder(BFRES bfres, ResFile resFile, ResDict <SceneAnim> resDict)
        {
            foreach (SceneAnim anim in resDict.Values)
            {
                var node = new BfresNodeBase(anim.Name);
                AddChild(node);

                foreach (CameraAnim camAnim in anim.CameraAnims.Values)
                {
                    var camnode = new BfresNodeBase(camAnim.Name);
                    camnode.Tag = new BfresCameraAnim(camAnim);
                    node.AddChild(camnode);
                }
                foreach (LightAnim lightAnim in anim.LightAnims.Values)
                {
                    var camnode = new BfresNodeBase(lightAnim.Name);
                    node.AddChild(camnode);
                }
                foreach (FogAnim fogAnim in anim.FogAnims.Values)
                {
                    var camnode = new BfresNodeBase(fogAnim.Name);
                    node.AddChild(camnode);
                }
            }
        }
Beispiel #2
0
        public TextureFolder(BFRES bfres, ResFile resFile, ResDict <TextureShared> resDict, ExternalFile externalTextureFile)
        {
            if (externalTextureFile != null)
            {
                var bntxFile = externalTextureFile.LoadedFileData as BntxFile;
                Tag = new BntxWrapper(bntxFile);
            }

            List <TextureAsset> assetList = new List <TextureAsset>();

            foreach (TextureShared tex in resDict.Values)
            {
                var node = new BfresNodeBase(tex.Name);
                node.Icon = "/Images/Texture.png";
                AddChild(node);

                if (tex is BfresLibrary.WiiU.Texture)
                {
                    FtexTexture ftex = new FtexTexture(resFile, (BfresLibrary.WiiU.Texture)tex);
                    bfres.Textures.Add(ftex);
                    node.Tag = ftex;
                    assetList.Add(ftex.TextureAsset);
                }
                else
                {
                    var         texture     = (BfresLibrary.Switch.SwitchTexture)tex;
                    BntxTexture bntxTexture = new BntxTexture(texture.BntxFile, texture.Texture);
                    bfres.Textures.Add(bntxTexture);
                    node.Tag = bntxTexture;
                }
            }
        }
 public EmbeddedFolder(BFRES bfres, ResFile resFile, ResDict <ExternalFile> resDict)
 {
     foreach (var file in resDict)
     {
         var node = new BfresNodeBase(file.Key);
         node.Tag = new BfresExternalFile(file.Value, file.Key);
         AddChild(node);
     }
 }
Beispiel #4
0
        public ShaderParamAnimFolder(BFRES bfres, ResFile resFile, ResDict <MaterialAnim> resDict)
        {
            foreach (MaterialAnim anim in resDict.Values)
            {
                var node = new BfresNodeBase(anim.Name);
                AddChild(node);

                var fmaa = new BfresMaterialAnim(anim, resFile.Name);
                node.Tag = fmaa;
                bfres.MaterialAnimations.Add(fmaa);
            }
        }
        public BoneVisibilityAnimFolder(BFRES bfres, ResFile resFile, ResDict <VisibilityAnim> resDict)
        {
            foreach (VisibilityAnim anim in resDict.Values)
            {
                var node = new BfresNodeBase(anim.Name);
                AddChild(node);

                var fsha = new BfresVisibilityAnim(anim, resFile.Name);
                node.Tag = fsha;
                bfres.VisibilityAnimations.Add(fsha);
            }
        }
        public ShapeAnimFolder(BFRES bfres, ResFile resFile, ResDict <ShapeAnim> resDict)
        {
            foreach (ShapeAnim anim in resDict.Values)
            {
                var node = new BfresNodeBase(anim.Name);
                AddChild(node);

                var fsha = new BfresShapeAnim(anim, resFile.Name);
                node.Tag = fsha;
                bfres.ShapeAnimations.Add(fsha);
            }
        }
Beispiel #7
0
        public TexturePatternAnimFolder(BFRES bfres, ResFile resFile, ResDict <MaterialAnim> resDict)
        {
            foreach (MaterialAnim anim in resDict.Values)
            {
                var node = new BfresNodeBase(anim.Name);
                AddChild(node);

                var fsha = new BfresMaterialAnim(anim, resFile.Name);
                node.Tag = fsha;
                bfres.MaterialAnimations.Add(fsha);
            }
        }
Beispiel #8
0
        public SkeletalAnimFolder(BFRES bfres, ResFile resFile, ResDict <SkeletalAnim> resDict)
        {
            foreach (SkeletalAnim anim in resDict.Values)
            {
                var node = new BfresNodeBase(anim.Name);
                node.Icon = "/Images/SkeletonAnimation.png";
                AddChild(node);

                var fska = new BfresSkeletalAnim(resFile, anim, resFile.Name);
                node.Tag = fska;
                bfres.SkeletalAnimations.Add(fska);
            }
        }
        public ModelFolder(BFRES bfres, ResFile resFile, ResDict <Model> resDict)
        {
            foreach (Model model in resDict.Values)
            {
                var node = new BfresNodeBase(model.Name);
                node.Icon = "/Images/Model.png";
                AddChild(node);

                var fmdl = new FMDL(node, bfres, model);
                node.Tag = fmdl;
                bfres.Models.Add(fmdl);

                node.AddChild(new BfresNodeBase("Meshes"));
                node.AddChild(new MaterialFolder("Materials"));
                node.AddChild(new BfresNodeBase("Skeleton"));

                foreach (FSHP mesh in fmdl.Meshes)
                {
                    var meshNode = new BfresNodeBase(mesh.Name)
                    {
                        Tag  = mesh,
                        Icon = "/Images/Mesh.png"
                    };
                    mesh.ParentNode   = meshNode;
                    mesh.MeshSelected = (o, s) => {
                        meshNode.IsSelected = (bool)o;
                    };
                    node.Children[0].AddChild(meshNode);
                }

                foreach (FMAT mat in fmdl.Materials)
                {
                    var matNode = new BfresNodeBase(mat.Name)
                    {
                        Tag  = mat,
                        Icon = ((FMAT)mat).Icon,
                    };
                    mat.ParentNode = matNode;
                    node.Children[1].AddChild(matNode);
                }
                foreach (var bone in ((FSKL)fmdl.Skeleton).CreateBoneHierarchy())
                {
                    node.Children[2].AddChild(bone);
                }
            }
        }