Example #1
0
        public AddGroupTypeDialog(BxlanPaiEntry animGroup)
        {
            InitializeComponent();
            CanResize   = false;
            ActiveGroup = animGroup;

            if (animGroup.Target == AnimationTarget.Pane)
            {
                stComboBox1.Items.Add("PaneSRT");
                stComboBox1.Items.Add("Visibility");
                stComboBox1.Items.Add("TextureSRT");
                stComboBox1.Items.Add("VertexColor");
            }
            else
            {
                stComboBox1.Items.Add("MaterialColor");
                stComboBox1.Items.Add("TexturePattern");
                stComboBox1.Items.Add("IndTextureSRT");
                stComboBox1.Items.Add("AlphaTest");
                stComboBox1.Items.Add("FontShadow");
                stComboBox1.Items.Add("PerCharacterTransformCurve");
            }

            stComboBox1.SelectedIndex = 0;
        }
Example #2
0
        private void LoadAnimationEntry(BxlanPaiEntry entry, TreeNode root)
        {
            var nodeEntry = new GroupAnimWrapper(entry.Name)
            {
                Tag = entry
            };

            if (root != null)
            {
                root.Nodes.Add(nodeEntry);
            }
            else
            {
                treeView1.Nodes.Add(nodeEntry);
            }

            for (int i = 0; i < entry.Tags.Count; i++)
            {
                var nodeTag = new GroupWrapper(entry.Tags[i].Type)
                {
                    Tag = entry.Tags[i]
                };
                nodeEntry.Nodes.Add(nodeTag);
                for (int j = 0; j < entry.Tags[i].Entries.Count; j++)
                {
                    LoadTagEntry(entry.Tags[i].Entries[j], nodeTag, j);
                }
            }
        }
Example #3
0
        public LytAnimGroup(BxlanPaiEntry entry)
        {
            animEntry = entry;
            Name      = entry.Name;
            if (entry.Target == AnimationTarget.Material)
            {
                Category = "Materials";
            }
            else if (entry.Target == AnimationTarget.Pane)
            {
                Category = "Panes";
            }
            else
            {
                Category = "User Data";
            }

            //Generate sub groups which contain the track data
            for (int i = 0; i < entry.Tags?.Count; i++)
            {
                STAnimGroup group = new STAnimGroup();
                string      tag   = entry.Tags[i].Tag.Remove(0, 1);
                switch (tag)
                {
                case "LPA":
                    group = new LytPaneSRTGroup(entry.Tags[i]);
                    break;

                case "LVI":
                    group = new LytVisibiltyGroup(entry.Tags[i]);
                    break;

                case "LTS":
                    group = new LytTextureSRTGroup(entry.Tags[i]);
                    break;

                case "LVC":
                    group = new LytVertexColorGroup(entry.Tags[i]);
                    break;

                case "LMC":
                    group = new LytMaterialColorGroup(entry.Tags[i]);
                    break;

                case "LIM":
                    group = new LytIndirectSRTGroup(entry.Tags[i]);
                    break;

                case "LTP":
                    group = new LytTexturePatternGroup(entry.Tags[i]);
                    break;

                case "LAC":
                    group = new LytAlphaTestGroup(entry.Tags[i]);
                    break;

                case "LCT":
                    group = new LytFontShadowGroup(entry.Tags[i]);
                    break;

                case "LCC":
                    group = new LytPerCharacterTransformCurveGroup(entry.Tags[i]);
                    break;
                }

                foreach (var keyGroup in entry.Tags[i].Entries)
                {
                    if (!(group is IAnimationTarget))
                    {
                        continue;
                    }

                    var targetGroup = ((IAnimationTarget)group).GetTrack(keyGroup.AnimationTarget);
                    if (targetGroup != null)
                    {
                        targetGroup.LoadKeyFrames(keyGroup.KeyFrames);
                        targetGroup.Name = keyGroup.TargetName;

                        if (keyGroup.CurveType == CurveType.Constant)
                        {
                            targetGroup.InterpolationType = STInterpoaltionType.Constant;
                        }
                        else if (keyGroup.CurveType == CurveType.Hermite)
                        {
                            targetGroup.InterpolationType = STInterpoaltionType.Hermite;
                        }
                        else if (keyGroup.CurveType == CurveType.Step)
                        {
                            targetGroup.InterpolationType = STInterpoaltionType.Step;
                        }
                    }
                    else
                    {
                        Console.WriteLine($"Unsupported track type for tag {keyGroup.TargetName} {keyGroup.AnimationTarget}");
                    }
                }

                group.Name = entry.Tags[i].Type;
                SubAnimGroups.Add(group);
            }
        }
Example #4
0
 public void LoadAnimationEntry(BxlanHeader bxlan, BxlanPaiEntry entry)
 {
     ActiveAnim = bxlan;
     LoadAnimationEntry(entry, null);
 }
Example #5
0
 public void LoadAnimationEntry(BxlanHeader bxlan, BxlanPaiEntry entry)
 {
     ActiveAnim = bxlan;
     LayoutAnimTreeLoader.LoadAnimationEntry(entry, null, treeView1);
 }
 private void PopulateTreeview(BxlanHeader anim, BxlanPaiEntry entry)
 {
     treeView1.Nodes.Clear();
     LayoutAnimTreeLoader.LoadAnimationEntry(entry, null, treeView1);
     treeView1.ExpandAll();
 }