ALINE: Endless exceptions on duplicate

Hi Aron,

big fan of your packages. Unfortunately we stumble into some problems:

Our level designer wanted to duplicate some objects in the scene and Unity falls apart immediately with endless exceptions and broken views:

Exception: You cannot dispose an invalid command builder. Are you trying to dipose it twice?
Drawing.CommandBuilder.DisposeInternal () (at Assets/Plugins/ALINE/CommandBuilder.cs:155)
Drawing.DrawingManager.Submit ([UnityEngine.Camera](http://unityengine.camera/) camera, UnityEngine.Rendering.CommandBuffer cmd, System.Boolean usingRenderPipeline, System.Boolean allowCameraDefault) (at Assets/Plugins/ALINE/DrawingManager.cs:547)
Drawing.DrawingManager.SubmitFrame ([UnityEngine.Camera](http://unityengine.camera/) camera, UnityEngine.Rendering.CommandBuffer cmd, System.Boolean usingRenderPipeline) (at Assets/Plugins/ALINE/DrawingManager.cs:411)
Drawing.AlineHDRPCustomPass.Execute (UnityEngine.Rendering.ScriptableRenderContext context, UnityEngine.Rendering.CommandBuffer cmd, UnityEngine.Rendering.HighDefinition.HDCamera camera, UnityEngine.Rendering.CullingResults cullingResult) (at Assets/Plugins/ALINE/AlineHDRPCustomPass.cs:15)
UnityEngine.Rendering.HighDefinition.CustomPass.ExecuteInternal (UnityEngine.Rendering.ScriptableRenderContext renderContext, UnityEngine.Rendering.CommandBuffer cmd, UnityEngine.Rendering.HighDefinition.HDCamera hdCamera, UnityEngine.Rendering.CullingResults cullingResult, UnityEngine.Rendering.HighDefinition.SharedRTManager rtManager, UnityEngine.Rendering.HighDefinition.CustomPass+RenderTargets targets, UnityEngine.Rendering.HighDefinition.CustomPassVolume owner) (at Library/PackageCache/com.unity.render-pipelines.high-definition@8.2.0/Runtime/RenderPipeline/RenderPass/CustomPass/CustomPass.cs:180)
UnityEngine.Rendering.HighDefinition.CustomPassVolume.Execute (UnityEngine.Rendering.ScriptableRenderContext renderContext, UnityEngine.Rendering.CommandBuffer cmd, UnityEngine.Rendering.HighDefinition.HDCamera hdCamera, UnityEngine.Rendering.CullingResults cullingResult, UnityEngine.Rendering.HighDefinition.SharedRTManager rtManager, UnityEngine.Rendering.HighDefinition.CustomPass+RenderTargets targets) (at Library/PackageCache/com.unity.render-pipelines.high-definition@8.2.0/Runtime/RenderPipeline/RenderPass/CustomPass/CustomPassVolume.cs:98)
UnityEngine.Rendering.HighDefinition.HDRenderPipeline.RenderCustomPass (UnityEngine.Rendering.ScriptableRenderContext context, UnityEngine.Rendering.CommandBuffer cmd, UnityEngine.Rendering.HighDefinition.HDCamera hdCamera, UnityEngine.Rendering.CullingResults cullingResults, UnityEngine.Rendering.HighDefinition.CustomPassInjectionPoint injectionPoint) (at Library/PackageCache/com.unity.render-pipelines.high-definition@8.2.0/Runtime/RenderPipeline/HDRenderPipeline.cs:3736)
UnityEngine.Rendering.HighDefinition.HDRenderPipeline.ExecuteRenderRequest (UnityEngine.Rendering.HighDefinition.HDRenderPipeline+RenderRequest renderRequest, UnityEngine.Rendering.ScriptableRenderContext renderContext, UnityEngine.Rendering.CommandBuffer cmd, UnityEngine.Rendering.HighDefinition.AOVRequestData aovRequest) (at Library/PackageCache/com.unity.render-pipelines.high-definition@8.2.0/Runtime/RenderPipeline/HDRenderPipeline.cs:2492)
UnityEngine.Rendering.HighDefinition.HDRenderPipeline.Render (UnityEngine.Rendering.ScriptableRenderContext renderContext, [UnityEngine.Camera](http://unityengine.camera/)[] cameras) (at Library/PackageCache/com.unity.render-pipelines.high-definition@8.2.0/Runtime/RenderPipeline/HDRenderPipeline.cs:1891)
UnityEngine.Rendering.RenderPipeline.InternalRender (UnityEngine.Rendering.ScriptableRenderContext context, [UnityEngine.Camera](http://unityengine.camera/)[] cameras) (at <04258d1cdc1044248c2a17a6a31a3cf7>:0)
UnityEngine.Rendering.RenderPipelineManager.DoRenderLoop_Internal (UnityEngine.Rendering.RenderPipelineAsset pipe, System.IntPtr loopPtr, Unity.Collections.LowLevel.Unsafe.AtomicSafetyHandle safety) (at <04258d1cdc1044248c2a17a6a31a3cf7>:0)
[UnityEngine.GUIUtility:ProcessEvent](unityengine.guiutility:ProcessEvent)(Int32, IntPtr, Boolean&)

I later found out that he actually selected objects around Vector3.zero. After some digging, I found your hidden DrawingManager. Duplicating this manager creates all the errors. Even you put the hide flags, the object (or its gizmo) is still visible and selectable in the scene view, so it also gets selected when selecting multiple objects.

Hope you can get that fixed in the future. Keep up the great work.

Cheers,
Fiete

Btw, the supposed unique and hidden RetainedGizmos game object ist often very visible (but greyed out) in the scene hierarchy multiple times!

1 Like

Hi

Are you using some kind of editor extension for the hierarchy? With those HideFlags it shouldn’t even be possible to select and duplicate that object, I think?

In any case, I think duplicate managers should be handled automatically and the duplicate will be deleted, at least in the latest version. Which version of the package are you using?

We are using ALINE version 1.3.0 and Unity version 2020.1.8f1.

With those HideFlags it shouldn’t even be possible to select and duplicate that object, I think?

With Unity, everything is possible :upside_down_face:

I just started Unity, this is how my test scene hierarchy looks like:
https://gofile.io/d/GWQ2vz

At least, when I double click the file, the inspector is empty and I get “Unable to rename a GameObject with HideFlags.NotEditable.” So it’s working a bit…

Just realized: the two RetainedGizmos GameObjects always show up after compiling, even in an empty scene.

Are you using the A* Pathfinding Project as well, or only ALINE?

Both, astar and aline

Okay. Then it at least makes sense that you get two RetainedGizmos objects. The A* Pathfinding Project uses a trimmed down version of ALINE internally.