Skip to content

Commit

Permalink
[ShaderGraph] Update main preview continuously
Browse files Browse the repository at this point in the history
https://jira.unity3d.com/browse/UUM-47201 addressing some of the issues detailed here
  • Loading branch information
elizabeth-legros authored and Evergreen committed Oct 13, 2023
1 parent d9b3105 commit 51c8502
Showing 1 changed file with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -703,7 +703,7 @@ void OnNodeChanged(AbstractMaterialNode inNode, ModificationScope scope)

HashSet<IShaderNodeView> m_NodeViewHashSet = new HashSet<IShaderNodeView>();
HashSet<ShaderGroup> m_GroupHashSet = new HashSet<ShaderGroup>();

float lastUpdate = 0f;
public void HandleGraphChanges(bool wasUndoRedoPerformed)
{
UnregisterGraphViewCallbacks();
Expand All @@ -717,6 +717,11 @@ public void HandleGraphChanges(bool wasUndoRedoPerformed)
});

previewManager.HandleGraphChanges();
if(Time.realtimeSinceStartup - lastUpdate >= 0.03f && EditorWindow.focusedWindow == m_EditorWindow && m_UserViewSettings.isPreviewVisible)
{
lastUpdate = Time.realtimeSinceStartup;
previewManager.UpdateMasterPreview(ModificationScope.Node);
}
m_InspectorView.HandleGraphChanges();

if (m_Graph.addedEdges.Any() || m_Graph.removedEdges.Any())
Expand Down

0 comments on commit 51c8502

Please sign in to comment.