Skip to content

Commit

Permalink
Fix for displaying error from the creation of a node.
Browse files Browse the repository at this point in the history
  • Loading branch information
iTris666 committed Oct 8, 2020
1 parent c72287d commit 4bfb1e7
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -602,6 +602,8 @@ public void RefreshContext()
blockUI = InstantiateBlock(blockController);
m_BlockContainer.Add(blockUI);
m_BlockContainer.Insert(prevBlock == null ? 0 : m_BlockContainer.IndexOf(prevBlock) + 1, blockUI);
//Refresh error can only be called after the block has been instanciated
blockController.model.RefreshErrors(controller.viewController.graph);
}
prevBlock = blockUI;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@ public VFXNodeController controller
OnNewController();
if (m_Controller != null)
{
controller.model.RefreshErrors(controller.viewController.graph);
m_Controller.RegisterHandler(this);
}
}
Expand Down
3 changes: 3 additions & 0 deletions com.unity.visualeffectgraph/Editor/GraphView/Views/VFXView.cs
Original file line number Diff line number Diff line change
Expand Up @@ -600,6 +600,8 @@ private void RegisterError(VFXModel model, VFXErrorOrigin errorOrigin,string err
if (nodeController == null)
return;
target = GetNodeByController(nodeController);
if (target == null)
return;
targetParent = target.parent;
target = (target as VFXNodeUI).titleContainer;
alignement = SpriteAlignment.LeftCenter;
Expand Down Expand Up @@ -1079,6 +1081,7 @@ void SyncNodes()
needOneListenToGeometry = false;
newElement.RegisterCallback<GeometryChangedEvent>(OnOneNodeGeometryChanged);
}
newElement.controller.model.RefreshErrors(controller.graph);
}
Profiler.EndSample();

Expand Down

0 comments on commit 4bfb1e7

Please sign in to comment.