Description
Accidentally closed previous issue. More information for this issue shows it as a GUI issue with the transfer function window.
Repro:
- Unity 6 (6000.0.35f1)
- Tried both UnityVolumeRendering-2020.3+ and UnityVolumeRendering-2019 (R2024.4)
- Import DICOM files using your documentation
- Select model in scene
- Open Inspector
- Note: I have to manually add the component Volume Rendered Object for each model.
- Select any Render Mode
- Select any Transfer Function Type
- Click "Edit transfer function"
- TransferFunctionEditorWindow appears completely empty for any combination of render mode and TF type.
- Then the following two error messages appear 6 times each every second in Console, starting with the following:
ERROR 1:
NullReferenceException: Object reference not set to an instance of an object
UnityVolumeRendering.TransferFunctionEditor.DrawOnGUI (UnityEngine.Rect rect) (at Assets/UnityVolumeRendering/Assets/Scripts/GUI/IMGUI/TransferFunctionEditor.cs:64)
UnityVolumeRendering.TransferFunctionEditorWindow.OnGUI () (at Assets/UnityVolumeRendering/Assets/Editor/TransferFunctionEditorWindow.cs:66)
UnityEditor.HostView.InvokeOnGUI (UnityEngine.Rect onGUIPosition) (at <2f9d421960d84dffaa88793de0f4b5f3>:0)
UnityEditor.DockArea.DrawView (UnityEngine.Rect dockAreaRect) (at <2f9d421960d84dffaa88793de0f4b5f3>:0)
UnityEditor.DockArea.OldOnGUI () (at <2f9d421960d84dffaa88793de0f4b5f3>: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 :0)
UnityEngine.GUIUtility:ProcessEvent(Int32, IntPtr, Boolean&)
ERROR 2:
NullReferenceException: Object reference not set to an instance of an object
UnityVolumeRendering.TransferFunctionEditor.DrawOnGUI (UnityEngine.Rect rect) (at Assets/UnityVolumeRendering/Assets/Scripts/GUI/IMGUI/TransferFunctionEditor.cs:64)
UnityVolumeRendering.TransferFunctionEditorWindow.OnGUI () (at Assets/UnityVolumeRendering/Assets/Editor/TransferFunctionEditorWindow.cs:66)
UnityEditor.HostView.InvokeOnGUI (UnityEngine.Rect onGUIPosition) (at <2f9d421960d84dffaa88793de0f4b5f3>:0)
UnityEditor.DockArea.DrawView (UnityEngine.Rect dockAreaRect) (at <2f9d421960d84dffaa88793de0f4b5f3>:0)
UnityEditor.DockArea.OldOnGUI () (at <2f9d421960d84dffaa88793de0f4b5f3>: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 :0)
UnityEngine.UIElements.IMGUIContainer.HandleIMGUIEvent (UnityEngine.Event e, UnityEngine.Matrix4x4 worldTransform, UnityEngine.Rect clippingRect, System.Action onGUIHandler, System.Boolean canAffectFocus) (at :0)
UnityEngine.UIElements.IMGUIContainer.DoIMGUIRepaint () (at :0)
UnityEngine.UIElements.UIR.RenderChainCommand.ExecuteNonDrawMesh (UnityEngine.UIElements.UIR.DrawParams drawParams, System.Single pixelsPerPoint, System.Exception& immediateException) (at :0)
Rethrow as ImmediateModeException
UnityEngine.UIElements.UIR.RenderChain.Render () (at :0)
UnityEngine.UIElements.UIRRepaintUpdater.Render () (at :0)
UnityEngine.UIElements.BaseVisualElementPanel.Render () (at :0)
UnityEngine.UIElements.Panel.Render () (at :0)
UnityEditor.UIElements.EditorPanel.Render () (at <440ef95092dc402283338101458784af>:0)
UnityEngine.UIElements.UIElementsUtility.DoDispatch (UnityEngine.UIElements.BaseVisualElementPanel panel) (at :0)
UnityEngine.UIElements.UIElementsUtility.UnityEngine.UIElements.IUIElementsUtility.ProcessEvent (System.Int32 instanceID, System.IntPtr nativeEventPtr, System.Boolean& eventHandled) (at :0)
UnityEngine.UIElements.UIEventRegistration.ProcessEvent (System.Int32 instanceID, System.IntPtr nativeEventPtr) (at :0)
UnityEngine.UIElements.UIEventRegistration+<>c.<.cctor>b__1_2 (System.Int32 i, System.IntPtr ptr) (at :0)
UnityEngine.GUIUtility.ProcessEvent (System.Int32 instanceID, System.IntPtr nativeEventPtr, System.Boolean& result) (at <597a8f11f7f6488b9a0d0f6e0dc59248>:0)