When adding a block via spacebar or mouse right click on macOS Unity 2020.1.10f, VFX Graph 9.0.0-preview.54 I get the following error which appears to stem from the fact that the UI Toolkit 1.0.0-preview.9 and my version of the VFX Graph appear to not work together without issue:
NullReferenceException
NullReferenceException: Object reference not set to an instance of an object
UnityEngine.UIElements.TextUtilities.MeasureVisualElementTextSize (UnityEngine.UIElements.VisualElement ve, System.String textToMeasure, System.Single width, UnityEngine.UIElements.VisualElement+MeasureMode widthMode, System.Single height, UnityEngine.UIElements.VisualElement+MeasureMode heightMode, UnityEngine.UIElements.ITextHandle textHandle) (at Library/PackageCache/com.unity.ui@1.0.0-preview.9/Core/Text/TextHandle.cs:358)
UnityEngine.UIElements.TextElement.MeasureTextSize (System.String textToMeasure, System.Single width, UnityEngine.UIElements.VisualElement+MeasureMode widthMode, System.Single height, UnityEngine.UIElements.VisualElement+MeasureMode heightMode) (at Library/PackageCache/com.unity.ui@1.0.0-preview.9/Core/TextElement.cs:283)
UnityEngine.UIElements.TextElement.DoMeasure (System.Single desiredWidth, UnityEngine.UIElements.VisualElement+MeasureMode widthMode, System.Single desiredHeight, UnityEngine.UIElements.VisualElement+MeasureMode heightMode) (at Library/PackageCache/com.unity.ui@1.0.0-preview.9/Core/TextElement.cs:298)
UnityEngine.UIElements.VisualElement.Measure (UnityEngine.Yoga.YogaNode node, System.Single width, UnityEngine.Yoga.YogaMeasureMode widthMode, System.Single height, UnityEngine.Yoga.YogaMeasureMode heightMode) (at Library/PackageCache/com.unity.ui@1.0.0-preview.9/Core/VisualElement.cs:1486)
UnityEngine.UIElements.VisualElement.<AssignMeasureFunction>b__321_0 (UnityEngine.Yoga.YogaNode node, System.Single f, UnityEngine.Yoga.YogaMeasureMode mode, System.Single f1, UnityEngine.Yoga.YogaMeasureMode heightMode) (at Library/PackageCache/com.unity.ui@1.0.0-preview.9/Core/VisualElement.cs:1470)
UnityEngine.Yoga.YogaNode.MeasureInternal (UnityEngine.Yoga.YogaNode node, System.Single width, UnityEngine.Yoga.YogaMeasureMode widthMode, System.Single height, UnityEngine.Yoga.YogaMeasureMode heightMode) (at /Users/bokken/buildslave/unity/build/External/Yoga/csharp/Facebook.Yoga/YogaNode.cs:689)
UnityEngine.Yoga.Native.YGNodeMeasureInvoke (UnityEngine.Yoga.YogaNode node, System.Single width, UnityEngine.Yoga.YogaMeasureMode widthMode, System.Single height, UnityEngine.Yoga.YogaMeasureMode heightMode, System.IntPtr returnValueAddress) (at /Users/bokken/buildslave/unity/build/External/Yoga/csharp/Facebook.Yoga/YogaNative.bindings.cs:146)
UnityEngine.GUIUtility:ProcessEvent(Int32, IntPtr, Boolean&) (at /Users/bokken/buildslave/unity/build/Modules/IMGUI/GUIUtility.cs:189)
Adding via mouse:
Adding via spacebar:
Note that the position is not under the mouse in the spacebar case and the initial state of the block is somewhat broken (probably due to the NullReferenceException). Sometimes, the error stops the block selection modal to be closed and it stays open.
I’ll also try to file a bug – will post the Case number under this post as soon as I have one.
P.S: I’ll cross reference this post also in the UI Toolkit forum.