コード例 #1
0
        private void AnimationForm_Load(object sender, EventArgs e)
        {
            animationGroups.LoadFromData();

            animationListBinding.DataSource = animationGroups;
            AnimationListBox.DataSource     = animationListBinding;
            AnimationListBox.ClearSelected();

            animationGroupControl.SetAnimationGroupInfo(null);
            animationGroupControl.InfoChanged    += animationGroupControl_InfoChanged;
            animationGroupControl.ConfirmPressed += animationGroupControl_ConfirmPressed;
        }
コード例 #2
0
        private void AnimationForm_Load(object sender, EventArgs e)
        {
            animationGroups.LoadFromData();

            animationListBinding.DataSource = animationGroups;
            AnimationListBox.DataSource     = animationListBinding;
            AnimationListBox.ClearSelected();

            animationGroupControl.SetAnimationGroupInfo(null);
            animationGroupControl.InfoChanged    += animationGroupControl_InfoChanged;
            animationGroupControl.ConfirmPressed += animationGroupControl_ConfirmPressed;

            Tools.PrepareCheckBox(exportNonAnimatedNodesCheckBox, Loader.Core.RootNode, "babylonjs_animgroup_exportnonanimated");
        }
コード例 #3
0
        public void HighlightAnimationGroupOfSelection()
        {
            AnimationListBox.ClearSelected();
            IINode node = Loader.Core.GetSelNode(0);

            if (node != null)
            {
                for (int i = 0; i < animationGroups.Count; i++)
                {
                    if (animationGroups[i].NodeGuids.Contains(node.GetGuid()))
                    {
                        AnimationListBox.SelectedItem = animationGroups[i];
                    }
                }
            }
        }
コード例 #4
0
        private void createAnimationButton_Click(object sender, EventArgs e)
        {
            AnimationGroup info = new AnimationGroup();

            // get a unique name and guid
            string baseName    = info.Name;
            int    i           = 0;
            bool   hasConflict = true;

            while (hasConflict)
            {
                hasConflict = false;
                foreach (AnimationGroup animationGroup in animationGroups)
                {
                    if (info.Name.Equals(animationGroup.Name))
                    {
                        info.Name = baseName + i.ToString();
                        ++i;
                        hasConflict = true;
                        break;
                    }
                    if (info.SerializedId.Equals(animationGroup.SerializedId))
                    {
                        info.SerializedId = Guid.NewGuid();
                        hasConflict       = true;
                        break;
                    }
                }
            }

            // save info and animation list entry
            animationGroups.Add(info);
            animationGroups.SaveToData();
            animationListBinding.ResetBindings(false);
            Loader.Global.SetSaveRequiredFlag(true, false);

            AnimationListBox.ClearSelected();
            AnimationListBox.SelectedItem = info;
        }