Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Bug 1230949: Saving a ShaderGraph shader in 2019.3 results in ProBuilder error spam

Discussion in 'World Building' started by dgoyette, Mar 26, 2020.

  1. dgoyette

    dgoyette

    Joined:
    Jul 1, 2016
    Posts:
    4,193
    I've reported this as bug #1230949. Basically, if the ProBuilder window is open when saving ShaderGraph, the follow error starts spamming the console log until Unity is closed:

    MissingReferenceException: The object of type 'Material' has been destroyed but you are still trying to access it.
    Your script should either check if it is null or you should not destroy the object.
    UnityEngine.Material.SetFloat (System.String name, System.Single value) (at <d815b7efac424eeb8e053965cccb1f98>:0)
    UnityEditor.ProBuilder.EditorMeshHandles.SetMaterialsScaleAttribute () (at Library/PackageCache/com.unity.probuilder@4.2.3/Editor/EditorCore/EditorMeshHandles.cs:455)
    UnityEditor.ProBuilder.EditorMeshHandles.DrawSceneHandlesInternal (UnityEngine.ProBuilder.SelectMode mode) (at Library/PackageCache/com.unity.probuilder@4.2.3/Editor/EditorCore/EditorMeshHandles.cs:302)
    UnityEditor.ProBuilder.EditorMeshHandles.DrawSceneHandles (UnityEngine.ProBuilder.SelectMode mode) (at Library/PackageCache/com.unity.probuilder@4.2.3/Editor/EditorCore/EditorMeshHandles.cs:293)
    UnityEditor.ProBuilder.ProBuilderEditor.OnSceneGUI (UnityEditor.SceneView sceneView) (at Library/PackageCache/com.unity.probuilder@4.2.3/Editor/EditorCore/ProBuilderEditor.cs:581)
    UnityEditor.SceneView.CallOnSceneGUI () (at <78f1ad0f25c84e3ca853e639f50d95f5>:0)
    UnityEditor.SceneView.HandleSelectionAndOnSceneGUI () (at <78f1ad0f25c84e3ca853e639f50d95f5>:0)
    UnityEditor.SceneView.OnGUI () (at <78f1ad0f25c84e3ca853e639f50d95f5>:0)
    System.Reflection.MonoMethod.Invoke (System.Object obj, System.Reflection.BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) (at <437ba245d8404784b9fbab9b439ac908>:0)
    Rethrow as TargetInvocationException: Exception has been thrown by the target of an invocation.
    System.Reflection.MonoMethod.Invoke (System.Object obj, System.Reflection.BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) (at <437ba245d8404784b9fbab9b439ac908>:0)
    System.Reflection.MethodBase.Invoke (System.Object obj, System.Object[] parameters) (at <437ba245d8404784b9fbab9b439ac908>:0)
    UnityEditor.HostView.Invoke (System.String methodName, System.Object obj) (at <78f1ad0f25c84e3ca853e639f50d95f5>:0)
    UnityEditor.HostView.Invoke (System.String methodName) (at <78f1ad0f25c84e3ca853e639f50d95f5>:0)
    UnityEditor.HostView.InvokeOnGUI (UnityEngine.Rect onGUIPosition, UnityEngine.Rect viewRect) (at <78f1ad0f25c84e3ca853e639f50d95f5>:0)
    UnityEditor.DockArea.DrawView (UnityEngine.Rect viewRect, UnityEngine.Rect dockAreaRect) (at <78f1ad0f25c84e3ca853e639f50d95f5>:0)
    UnityEditor.DockArea.OldOnGUI () (at <78f1ad0f25c84e3ca853e639f50d95f5>:0)
    UnityEngine.UIElements.IMGUIContainer.DoOnGUI (UnityEngine.Event evt, UnityEngine.Matrix4x4 parentTransform, UnityEngine.Rect clippingRect, System.Boolean isComputingLayout, UnityEngine.Rect layoutSize, System.Action onGUIHandler, System.Boolean canAffectFocus) (at <3736d7cfd1f845a5922f99478cb469e7>:0)
    UnityEngine.UIElements.IMGUIContainer.HandleIMGUIEvent (UnityEngine.Event e, UnityEngine.Matrix4x4 worldTransform, UnityEngine.Rect clippingRect, System.Action onGUIHandler, System.Boolean canAffectFocus) (at <3736d7cfd1f845a5922f99478cb469e7>:0)
    UnityEngine.UIElements.IMGUIContainer.DoIMGUIRepaint () (at <3736d7cfd1f845a5922f99478cb469e7>:0)
    UnityEngine.UIElements.UIR.RenderChainCommand.ExecuteNonDrawMesh (UnityEngine.UIElements.UIR.DrawParams drawParams, System.Boolean straightY, System.Single pixelsPerPoint, System.Exception& immediateException) (at <3736d7cfd1f845a5922f99478cb469e7>:0)
    Rethrow as ImmediateModeException
    UnityEngine.UIElements.UIR.RenderChain.Render (UnityEngine.Rect viewport, UnityEngine.Matrix4x4 projection, UnityEngine.UIElements.PanelClearFlags clearFlags) (at <3736d7cfd1f845a5922f99478cb469e7>:0)
    UnityEngine.UIElements.UIRRepaintUpdater.DrawChain (UnityEngine.Rect viewport, UnityEngine.Matrix4x4 projection) (at <3736d7cfd1f845a5922f99478cb469e7>:0)
    UnityEngine.UIElements.UIRRepaintUpdater.Update () (at <3736d7cfd1f845a5922f99478cb469e7>:0)
    UnityEngine.UIElements.VisualTreeUpdater.UpdateVisualTreePhase (UnityEngine.UIElements.VisualTreeUpdatePhase phase) (at <3736d7cfd1f845a5922f99478cb469e7>:0)
    UnityEngine.UIElements.Panel.UpdateForRepaint () (at <3736d7cfd1f845a5922f99478cb469e7>:0)
    UnityEngine.UIElements.Panel.Repaint (UnityEngine.Event e) (at <3736d7cfd1f845a5922f99478cb469e7>:0)
    UnityEngine.UIElements.UIElementsUtility.DoDispatch (UnityEngine.UIElements.BaseVisualElementPanel panel) (at <3736d7cfd1f845a5922f99478cb469e7>:0)
    UnityEngine.UIElements.UIElementsUtility.ProcessEvent (System.Int32 instanceID, System.IntPtr nativeEventPtr) (at <3736d7cfd1f845a5922f99478cb469e7>:0)
    UnityEngine.GUIUtility.ProcessEvent (System.Int32 instanceID, System.IntPtr nativeEventPtr) (at <817eebdd70f8402280b9cb11fff8b976>:0)

    Note that it doesn't matter whether there are any PB objects in the scene. Just having the PB window open causes this to occur.

    ProBuilder 4.2.3, and ShaderGraph 7.3.1.
     
  2. dgoyette

    dgoyette

    Joined:
    Jul 1, 2016
    Posts:
    4,193
  3. dgoyette

    dgoyette

    Joined:
    Jul 1, 2016
    Posts:
    4,193
    Could tell me whether I should be looking for the fix to this issue in a patch release for the engine, or in a ProBuilder package release? And if you know, approximately when this might be addressed? I think this is the one open issue keeping me from being able to migrate my project to 2019.3. Thanks.
     
  4. kaarrrllll

    kaarrrllll

    Unity Technologies

    Joined:
    Aug 24, 2017
    Posts:
    552
    dgoyette likes this.
  5. dgoyette

    dgoyette

    Joined:
    Jul 1, 2016
    Posts:
    4,193
    Thanks. That definitely fixed the issue I was running into.

    Maybe worth noting that occasionally, when entering play mode now, I do get this, which looks fairly similar, but is probably some other issue?

    MissingReferenceException: The variable m_WireMaterial of EditorMeshHandles doesn't exist anymore.
    You probably need to reassign the m_WireMaterial variable of the 'EditorMeshHandles' script in the inspector.
    UnityEngine.Material.SetColorImpl (System.Int32 name, UnityEngine.Color value) (at <480508088aee40cab70818ff164a29d5>:0)
    UnityEngine.Material.SetColor (System.String name, UnityEngine.Color value) (at <480508088aee40cab70818ff164a29d5>:0)
    UnityEditor.ProBuilder.EditorMeshHandles.ReloadPreferences () (at Library/PackageCache/com.unity.probuilder@4.3.0-preview.9/Editor/EditorCore/EditorMeshHandles.cs:189)
    UnityEditor.ProBuilder.EditorMeshHandles.ResetPreferences () (at Library/PackageCache/com.unity.probuilder@4.3.0-preview.9/Editor/EditorCore/EditorMeshHandles.cs:153)
    UnityEditor.ProBuilder.ProBuilderEditor.LoadSettings () (at Library/PackageCache/com.unity.probuilder@4.3.0-preview.9/Editor/EditorCore/ProBuilderEditor.cs:392)
    UnityEditor.ProBuilder.ProBuilderEditor.OnEnable () (at Library/PackageCache/com.unity.probuilder@4.3.0-preview.9/Editor/EditorCore/ProBuilderEditor.cs:328)