示例#1
0
        protected virtual void modelPanel1_MouseUp(object sender, MouseEventArgs e)
        {
            if (_createdNewBone && SelectedBone != null)
            {
                SelectedBone.BindState = SelectedBone.FrameState;
                SelectedBone.RecalcBindState(false, false, false);
            }

            _createdNewBone = false;

            bool temp = TargetModel != null && TargetModel is MDL0Node;

            if (temp)
            {
                MDL0Node m = TargetModel as MDL0Node;
                m._dontUpdateMesh = false;
            }

            if (e.Button == MouseButtons.Left)
            {
                ModelPanel panel = sender as ModelPanel;

                panel.CurrentViewport.AllowSelection = true;

                if (_vertexSelection.IsMoving() && VertexLoc.HasValue)
                {
                    VertexChange(_selectedVertices);
                }

                if (_boneSelection.IsMoving() && SelectedBone != null)
                {
                    if (temp &&
                        CHR0Editor.chkUpdateBindPose.Checked &&
                        TargetAnimType == NW4RAnimType.CHR &&
                        CurrentFrame == 0 &&
                        SelectedBone != null)
                    {
                        SelectedBone.RecalcBindState(true, !CHR0Editor.chkMoveBoneOnly.Checked);
                        UpdateModel(TargetModel, CurrentFrame);
                    }

                    BoneChange(SelectedBone);
                }

                _boneSelection.ResetAll();
                _vertexSelection.ResetAll();
            }
        }
示例#2
0
        protected virtual void modelPanel1_MouseUp(object sender, MouseEventArgs e)
        {
            _createdNewBone = false;

            bool temp = TargetModel != null && TargetModel is MDL0Node;

            if (temp)
            {
                MDL0Node m = TargetModel as MDL0Node;
                m._dontUpdateMesh = false;
            }

            if (e.Button == Forms.MouseButtons.Left)
            {
                ModelPanel panel = sender as ModelPanel;

                panel.CurrentViewport.AllowSelection = true;

                if (_rotating || _translating || _scaling)
                {
                    if (!VertexLoc.HasValue)
                    {
                        if (temp &&
                            CHR0Editor.chkUpdateBindPose.Checked &&
                            TargetAnimType == NW4RAnimType.CHR &&
                            CurrentFrame == 0 &&
                            SelectedBone != null)
                        {
                            SelectedBone.RecalcBindState(true, !CHR0Editor.chkMoveBoneOnly.Checked);
                            UpdateModel(TargetModel, CurrentFrame);
                        }

                        BoneChange(SelectedBone);
                    }
                    else
                    {
                        VertexChange(_selectedVertices);
                    }
                }

                _snapX    = _snapY = _snapZ = _snapCirc = false;
                _rotating = _translating = _scaling = false;
            }
        }