public void NewChild() { BfresBone bn = new BfresBone(skeletonParent); if (BoneU != null) { BoneU = new ResU.Bone(); BoneU.Name = CheckDuplicateBoneNames("NewBone"); BfresWiiU.ReadBone(bn, BoneU, false); Nodes.Add(bn); skeletonParent.bones.Add(bn); BoneU.ParentIndex = (short)bn.parentIndex; ((FSKL)skeletonParent).AddBone(BoneU); } else { Bone = new Bone(); Bone.Name = CheckDuplicateBoneNames("NewBone"); BfresSwitch.ReadBone(bn, Bone, false); Nodes.Add(bn); skeletonParent.bones.Add(bn); Bone.ParentIndex = (short)bn.parentIndex; ((FSKL)skeletonParent).AddBone(Bone); } }
public void ImportChild() { OpenFileDialog ofd = new OpenFileDialog(); ofd.Filter = FileFilters.BONE; ofd.FileName = Text; if (ofd.ShowDialog() == DialogResult.OK) { BfresBone bn = new BfresBone(skeletonParent); if (BoneU != null) { BoneU = new ResU.Bone(); BoneU.Import(ofd.FileName, GetResFileU()); BoneU.Name = CheckDuplicateBoneNames(BoneU.Name); BfresWiiU.ReadBone(bn, BoneU, false); Nodes.Add(bn); skeletonParent.bones.Add(bn); ((FSKL)skeletonParent).AddBone(BoneU); } else { Bone = new Bone(); Bone.Import(ofd.FileName); Bone.Name = CheckDuplicateBoneNames(Bone.Name); BfresSwitch.ReadBone(bn, Bone, false); Nodes.Add(bn); skeletonParent.bones.Add(bn); ((FSKL)skeletonParent).AddBone(Bone); } } }
public override void Import(string[] FileNames) { foreach (var FileName in FileNames) { string extension = System.IO.Path.GetExtension(FileName); if (extension == ".bfbon") { BfresBone bn = new BfresBone(); if (SkeletonU != null) { ResU.Bone bone = new ResU.Bone(); bone.Import(FileName, GetResFileU()); BfresWiiU.ReadBone(bn, bone, false); } else { Bone bone = new Bone(); bone.Import(FileName); BfresSwitch.ReadBone(bn, bone, false); } } } }
public void CopyData(ResU.Bone newBone) { BoneU.BillboardIndex = newBone.BillboardIndex; BoneU.Flags = newBone.Flags; BoneU.FlagsBillboard = newBone.FlagsBillboard; BoneU.FlagsRotation = newBone.FlagsRotation; BoneU.FlagsTransform = newBone.FlagsTransform; BoneU.FlagsTransformCumulative = newBone.FlagsTransformCumulative; BoneU.InverseMatrix = newBone.InverseMatrix; BoneU.ParentIndex = newBone.ParentIndex; BoneU.RigidMatrixIndex = newBone.RigidMatrixIndex; BoneU.SmoothMatrixIndex = newBone.SmoothMatrixIndex; BoneU.Position = newBone.Position; BoneU.Rotation = newBone.Rotation; BoneU.Scale = newBone.Scale; BoneU.UserData = newBone.UserData; }
public void ReplaceMatchingFolder() { FolderSelectDialog ofd = new FolderSelectDialog(); if (ofd.ShowDialog() == DialogResult.OK) { foreach (var file in System.IO.Directory.GetFiles(ofd.SelectedPath)) { string extension = System.IO.Path.GetExtension(file); if (extension == ".bfbon") { if (SkeletonU != null) { ResU.Bone BoneTemp = new ResU.Bone(); BoneTemp.Import(file, GetResFileU()); foreach (BfresBone bone in fskl.bones) { if (BoneTemp.Name == bone.Text) { bone.CopyData(BoneTemp); } } BfresWiiU.ReadSkeleton(this, SkeletonU, fskl); } else { Bone BoneTemp = new Bone(); BoneTemp.Import(file); foreach (BfresBone bone in fskl.bones) { if (BoneTemp.Name == bone.Text) { bone.CopyData(BoneTemp); } } BfresSwitch.ReadSkeleton(this, Skeleton, fskl); } } } } }
public override void Import(string[] FileNames) { foreach (var FileName in FileNames) { string extension = System.IO.Path.GetExtension(FileName); if (extension == ".bfbon") { BfresBone bn = new BfresBone(fskl); List <string> boneKeys = fskl.bones.Select(i => i.Text).ToList(); if (SkeletonU != null) { ResU.Bone bone = new ResU.Bone(); bone.Import(FileName, GetResFileU()); bone.ParentIndex = -1; bone.Name = Utils.RenameDuplicateString(boneKeys, bone.Name); BfresWiiU.ReadBone(bn, bone, false); Nodes.Add(bn); fskl.bones.Add(bn); bn.BoneU.ParentIndex = (short)bn.parentIndex; fskl.AddBone(bn.BoneU); } else { Bone bone = new Bone(); bone.Import(FileName); bone.ParentIndex = -1; bone.Name = Utils.RenameDuplicateString(boneKeys, bone.Name); BfresSwitch.ReadBone(bn, bone, false); Nodes.Add(bn); fskl.bones.Add(bn); bn.Bone.ParentIndex = (short)bn.parentIndex; fskl.AddBone(bn.Bone); } } } }
public override void Import(string[] FileNames) { foreach (var FileName in FileNames) { string extension = System.IO.Path.GetExtension(FileName); if (extension == ".bfbon") { BfresBone bn = new BfresBone(fskl); if (SkeletonU != null) { ResU.Bone bone = new ResU.Bone(); bone.Import(FileName, GetResFileU()); bone.ParentIndex = -1; BfresWiiU.ReadBone(bn, bone, false); Nodes.Add(bn); fskl.bones.Add(bn); bn.BoneU.ParentIndex = (short)bn.parentIndex; fskl.AddBone(bn.Bone); } else { Bone bone = new Bone(); bone.Import(FileName); bone.ParentIndex = -1; BfresSwitch.ReadBone(bn, bone, false); Nodes.Add(bn); fskl.bones.Add(bn); bn.Bone.ParentIndex = (short)bn.parentIndex; fskl.AddBone(bn.Bone); } } } }
public void AddBone(ResU.Bone bone) { node.SkeletonU.Bones.Add(bone.Name, bone); }