private void SynchronizeUndoRedoState()
        {
            if (m_graphUndoStack == null)
            {
                return;
            }

            if (m_graphUndoStack.IsDirtyState())
            {
                try
                {
                    m_graphUndoStack.RestoreCurrentGraphState();
                    m_reentrant          = true;
                    ExpressionGraphDirty = true;
                    model.GetOrCreateGraph().UpdateSubAssets();
                    EditorUtility.SetDirty(graph);
                    NotifyUpdate();
                    m_reentrant = false;
                    m_graphUndoStack.CleanDirtyState();
                }
                catch (Exception e)
                {
                    Debug.LogError(e);
                    Undo.ClearAll();
                    m_graphUndoStack = new VFXGraphUndoStack(graph);
                }
            }
            else
            {
                //The graph didn't change by this undo, only, potentially the slot values.
                // Any undo could be a slot value undo: update input slot expressions and expression graph values
                ExpressionGraphDirty          = true;
                ExpressionGraphDirtyParamOnly = true;

                if (model != null && graph != null)
                {
                    foreach (var element in AllSlotContainerControllers)
                    {
                        foreach (var slot in (element.model as IVFXSlotContainer).inputSlots)
                        {
                            slot.UpdateDefaultExpressionValue();
                        }
                    }

                    foreach (var parameter in m_ParameterControllers.Keys)
                    {
                        parameter.UpdateDefaultExpressionValue();
                    }
                    graph.SetExpressionValueDirty();
                }
            }
        }
Beispiel #2
0
 private void ReleaseUndoStack()
 {
     m_graphUndoStack = null;
 }
Beispiel #3
0
 private void InitializeUndoStack()
 {
     m_graphUndoStack = new VFXGraphUndoStack(graph);
 }