Beispiel #1
0
        private void numPosX_TextChanged(object sender, EventArgs e)
        {
            if (_updating)
            {
                return;
            }

            if (_targetVertices != null)
            {
                _mainWindow.VertexChange(_targetVertices);
                if (_targetVertices.Count == 1)
                {
                    TargetVertex._weightedPosition._x = numPosX.Value;
                    TargetVertex.Unweight();
                }
                else
                {
                    foreach (Vertex3 v in _targetVertices)
                    {
                        v._weightedPosition._x += numPosX.Value - numPosX._previousValue;
                        v.Unweight();
                    }
                }
                _mainWindow.VertexChange(_targetVertices);
                _mainWindow.UpdateModel();
            }
        }
Beispiel #2
0
 void interpolationViewer_SignalChange(object sender, EventArgs e)
 {
     ((ResourceNode)_targetNode).SignalPropertyChange();
     if (_mainWindow != null)
     {
         _mainWindow.UpdatePropDisplay();
         _mainWindow.UpdateModel();
     }
 }
Beispiel #3
0
        private void UpdateBindState(params Vertex3[] vertices)
        {
            List <MDL0ObjectNode> changed = new List <MDL0ObjectNode>();

            foreach (Vertex3 v in vertices)
            {
                if (!changed.Contains(v.Parent as MDL0ObjectNode))
                {
                    changed.Add(v.Parent as MDL0ObjectNode);
                }
            }
            foreach (MDL0ObjectNode obj in changed)
            {
                //See if the object can be made into a single bind
                obj.TryConvertMatrixToObject();

                if (_anyConverted.Contains(obj))
                {
                    obj.SetEditedAssets(false, true, true);
                }

                //Force full object rebuild and signal a change to the object
                obj._forceRebuild = true;
                obj.SignalPropertyChange();
            }

            //Update vertices with edited influences
            _mainWindow.UpdateModel();

            _anyConverted = null;
        }
Beispiel #4
0
        internal unsafe void PercentChanged(object sender, EventArgs e)
        {
            if (SelectedSource == null || SelectedDestination == null || updating)
            {
                return;
            }

            if ((SelectedAnimation != null) && (CurrentFrame >= 1))
            {
                SHP0EntryNode     entry = SelectedAnimation.FindChild(SelectedSource, false) as SHP0EntryNode;
                SHP0VertexSetNode v;

                if (entry == null)
                {
                    (v = (entry = SelectedAnimation.FindOrCreateEntry(SelectedSource)).Children[0] as SHP0VertexSetNode).Name = SelectedDestination;
                }
                else if ((v = entry.FindChild(SelectedDestination, false) as SHP0VertexSetNode) == null)
                {
                    if (!float.IsNaN(textBox1.Value))
                    {
                        v = entry.FindOrCreateEntry(SelectedDestination);
                        v.SetKeyframe(CurrentFrame - 1, textBox1.Value / 100.0f);
                    }
                }
                else
                if (float.IsNaN(textBox1.Value))
                {
                    v.RemoveKeyframe(CurrentFrame - 1);
                }
                else
                {
                    v.SetKeyframe(CurrentFrame - 1, textBox1.Value / 100.0f);
                }

                if (_mainWindow.InterpolationEditor != null && _mainWindow.InterpolationEditor._targetNode != VertexSetDest)
                {
                    _mainWindow.InterpolationEditor.SetTarget(VertexSetDest);
                }
            }
            ResetBox();
            _mainWindow.KeyframePanel.UpdateKeyframe(CurrentFrame - 1);
            _mainWindow.UpdateModel();
        }
 private void clrControl_CurrentColorChanged(object sender, EventArgs e)
 {
     _mainWindow.UpdateModel();
 }