示例#1
0
        private bool CloseExternal()
        {
            if (_externalAnimationsNode != null)
            {
                if (_externalAnimationsNode.IsDirty)
                {
                    DialogResult res = MessageBox.Show(this, "You have made changes to an external file. Would you like to save those changes?", "Closing external file.", MessageBoxButtons.YesNoCancel);
                    if (((res == DialogResult.Yes) && (!SaveExternal(false))) || (res == DialogResult.Cancel))
                    {
                        return(false);
                    }
                }

                ModelPanel.RemoveReference(_externalAnimationsNode);
                leftPanel._closing = true;
                leftPanel.listAnims.Items.Clear();
                leftPanel._closing = false;
                _externalAnimationsNode.Dispose();
                _externalAnimationsNode = null;

                if (SelectedBone != null)
                {
                    SelectedBone._boneColor = SelectedBone._nodeColor = Color.Transparent;
                }

                leftPanel.UpdateAnimations(TargetAnimType);
                SetAnimation(TargetAnimType, null);
                GetFiles(AnimType.None);
                UpdatePropDisplay();
                UpdateModel();
            }
            return(true);
        }
示例#2
0
        private void GetBaseInfluence()
        {
            if (_node != null)
            {
                modelPanel1.RemoveReference(_node);
            }

            MDL0BoneNode[] boneCache = _externalModel._linker.BoneCache;
            if ((_node = (MDL0ObjectNode)comboBox1.SelectedItem).Weighted)
            {
                int least = int.MaxValue;
                foreach (IMatrixNode inf in _node.Influences)
                {
                    if (inf is MDL0BoneNode && ((MDL0BoneNode)inf).BoneIndex < least)
                    {
                        least = ((MDL0BoneNode)inf).BoneIndex;
                    }
                }

                if (least != int.MaxValue)
                {
                    MDL0BoneNode temp = boneCache[least];
                    _baseInf = (IMatrixNode)temp.Parent;
                }
            }
            else
            {
                _baseInf = _node.MatrixNode;
            }

            if (_baseInf is Influence)
            {
                label2.Hide();
                comboBox2.Hide();
            }
            else if (_baseInf is MDL0BoneNode)
            {
                label2.Show();
                comboBox2.Show();
            }

            baseBone.Text = _baseInf.ToString();

            if (comboBox3.SelectedIndex == 0 && _baseInf is MDL0BoneNode)
            {
                int i = 0;
                foreach (MDL0BoneNode s in comboBox2.Items)
                {
                    if (s.Name == baseBone.Text)
                    {
                        comboBox2.SelectedIndex = i;
                        break;
                    }

                    i++;
                }
            }

            _node.IsRendering = true;
            modelPanel1.ClearTargets();
            modelPanel1.AddTarget(_node, false);
            modelPanel1.SetCamWithBox(_node.GetBox());
        }
 private void pnlAnim_ReferenceClosed(ResourceNode node)
 {
     modelPanel1.RemoveReference(node);
 }