Skip to content

Commit 4bfb1e7

Browse files
committed
Fix for displaying error from the creation of a node.
1 parent c72287d commit 4bfb1e7

File tree

3 files changed

+5
-1
lines changed

3 files changed

+5
-1
lines changed

com.unity.visualeffectgraph/Editor/GraphView/Elements/VFXContextUI.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -602,6 +602,8 @@ public void RefreshContext()
602602
blockUI = InstantiateBlock(blockController);
603603
m_BlockContainer.Add(blockUI);
604604
m_BlockContainer.Insert(prevBlock == null ? 0 : m_BlockContainer.IndexOf(prevBlock) + 1, blockUI);
605+
//Refresh error can only be called after the block has been instanciated
606+
blockController.model.RefreshErrors(controller.viewController.graph);
605607
}
606608
prevBlock = blockUI;
607609
}

com.unity.visualeffectgraph/Editor/GraphView/Elements/VFXNodeUI.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,6 @@ public VFXNodeController controller
3636
OnNewController();
3737
if (m_Controller != null)
3838
{
39-
controller.model.RefreshErrors(controller.viewController.graph);
4039
m_Controller.RegisterHandler(this);
4140
}
4241
}

com.unity.visualeffectgraph/Editor/GraphView/Views/VFXView.cs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -600,6 +600,8 @@ private void RegisterError(VFXModel model, VFXErrorOrigin errorOrigin,string err
600600
if (nodeController == null)
601601
return;
602602
target = GetNodeByController(nodeController);
603+
if (target == null)
604+
return;
603605
targetParent = target.parent;
604606
target = (target as VFXNodeUI).titleContainer;
605607
alignement = SpriteAlignment.LeftCenter;
@@ -1079,6 +1081,7 @@ void SyncNodes()
10791081
needOneListenToGeometry = false;
10801082
newElement.RegisterCallback<GeometryChangedEvent>(OnOneNodeGeometryChanged);
10811083
}
1084+
newElement.controller.model.RefreshErrors(controller.graph);
10821085
}
10831086
Profiler.EndSample();
10841087

0 commit comments

Comments
 (0)