![]() |
Bug / Crash After update I get "ArgumentNullException: Value cannot be null" - Printable Version +- Obi Official Forum (https://obi.virtualmethodstudio.com/forum) +-- Forum: Obi Users Category (https://obi.virtualmethodstudio.com/forum/forum-1.html) +--- Forum: Obi Fluid (https://obi.virtualmethodstudio.com/forum/forum-3.html) +--- Thread: Bug / Crash After update I get "ArgumentNullException: Value cannot be null" (/thread-2620.html) |
After update I get "ArgumentNullException: Value cannot be null" - emz06 - 07-12-2020 Hey, I just updated to the latest version, and I was using an older version from April. Now I get this error for every solver in the scene on every frame. Any idea what is wrong? I tried to delete the whole Obi folder and reimported but it didn't help. ArgumentNullException: Value cannot be null. Parameter name: key System.Collections.Generic.Dictionary`2[TKey,TValue].FindEntry (TKey key) (at <fb001e01371b4adca20013e0ac763896>:0) System.Collections.Generic.Dictionary`2[TKey,TValue].TryGetValue (TKey key, TValue& value) (at <fb001e01371b4adca20013e0ac763896>:0) Obi.ObiTriangleMeshContainer.GetOrCreateTriangleMesh (UnityEngine.Mesh source) (at Assets/Obi/Scripts/Common/Collisions/ObiTriangleMeshContainer.cs:78) Obi.ObiColliderWorld.GetOrCreateTriangleMesh (UnityEngine.Mesh mesh) (at Assets/Obi/Scripts/Common/Collisions/ObiColliderWorld.cs:229) Obi.ObiMeshShapeTracker.UpdateIfNeeded () (at Assets/Obi/Scripts/Common/Collisions/ColliderTrackers/Trackers3D/ObiMeshShapeTracker.cs:38) Obi.ObiColliderBase.UpdateIfNeeded () (at Assets/Obi/Scripts/Common/Collisions/ObiColliderBase.cs:189) Obi.ObiColliderWorld.UpdateWorld () (at Assets/Obi/Scripts/Common/Collisions/ObiColliderWorld.cs:362) Obi.ObiUpdater.BeginStep (System.Single stepDeltaTime) (at Assets/Obi/Scripts/Common/Updaters/ObiUpdater.cs:40) Obi.ObiFixedUpdater.FixedUpdate () (at Assets/Obi/Scripts/Common/Updaters/ObiFixedUpdater.cs:54) Also, when I try to Build my project I get this. Any idea why this is happening? Shader error in 'Obi/URP/Particles': failed to open source file: 'Packages/com.unity.render-pipelines.universal/ShaderLibrary/Core.hlsl' at Assets/Obi/Resources/ObiMaterials/URP/ObiLightingURP.cginc(5) (on metal) Compiling Vertex program Platform defines: UNITY_NO_DXT5nm UNITY_NO_RGBM UNITY_ENABLE_REFLECTION_BUFFERS UNITY_FRAMEBUFFER_FETCH_AVAILABLE UNITY_NO_SCREENSPACE_SHADOWS UNITY_PBS_USE_BRDF3 SHADER_API_MOBILE UNITY_HARDWARE_TIER1 UNITY_COLORSPACE_GAMMA UNITY_LIGHTMAP_DLDR_ENCODING RE: After update I get "ArgumentNullException: Value cannot be null" - josemendez - 08-12-2020 Hi there, Can't reproduce the first error, either in a blank project or updating from 5.3 to 5.6.2. Make sure you don't have configurable enter play mode options enabled, as these aren't supported. Regarding the shader error: if you're not using URP, you can just get rid of the Assets/Obi/Resources/ObiMaterials/URP folder. These materials are meant for URP support. RE: After update I get "ArgumentNullException: Value cannot be null" - emz06 - 08-12-2020 (08-12-2020, 09:40 AM)josemendez Wrote: Hi there, The null argument error only happens in my current scene. But it does not happen if I open the demo scenes, or if I create a new scene, and place my prefab'ed solver from the problematic scene. Does that give a clue of what is wrong? RE: After update I get "ArgumentNullException: Value cannot be null" - josemendez - 08-12-2020 (08-12-2020, 03:26 PM)emz06 Wrote: The null argument error only happens in my current scene. But it does not happen if I open the demo scenes, or if I create a new scene, and place my prefab'ed solver from the problematic scene. Do you have references to null meshes in your scene? For instance, a MeshCollider taking no mesh as input? I think this might be a bug in Obi, caused by null meshes being passed to the collider system. Edit: this is a bug in Obi indeed. Having a MeshCollider with no mesh input in the scene triggers it. To fix it, modify the GetOrCreateTriangleMesh() method in ObiTriangleMeshContainer.cs so that it starts like this: Quote:ObiTriangleMeshHandle handle = new ObiTriangleMeshHandle(null); Edit2: seems like this fix isn't working properly in some cases. Will spend a bit more time investigating and get back with a more robust fix. Thanks for reporting this! RE: After update I get "ArgumentNullException: Value cannot be null" - emz06 - 08-12-2020 (08-12-2020, 03:29 PM)josemendez Wrote: Do you have references to null meshes in your scene? For instance, a MeshCollider taking no mesh as input? I think this might be a bug in Obi, caused by null meshes being passed to the collider system. Thanks for that. I did check all my mesh colliders, and I didn't find one which was null. Even with your modification, I am getting a NullReferenceException *at the same moment* that I press the Play button (that is: BEFORE the scene is played): (then I get this exception once per frame) NullReferenceException: Object reference not set to an instance of an object Obi.ObiParticleRenderer.get_ParticleMeshes () (at Assets/Obi/Scripts/Common/Rendering/ObiParticleRenderer.cs:27) Obi.FluidRenderingUtils.VolumeReconstruction (UnityEngine.Rendering.CommandBuffer cmd, Obi.FluidRenderingUtils+FluidRenderTargets renderTargets, UnityEngine.Material thickness_Material, UnityEngine.Material colorMaterial, Obi.ObiParticleRenderer[] renderers) (at Assets/Obi/Scripts/Fluid/Rendering/FluidRenderingUtils.cs:137) Obi.ObiFluidRenderer.UpdateFluidRenderingCommandBuffer () (at Assets/Obi/Scripts/Fluid/Rendering/ObiFluidRenderer.cs:118) Obi.ObiBaseFluidRenderer.OnPreRender () (at Assets/Obi/Scripts/Fluid/Rendering/ObiBaseFluidRenderer.cs:80) UnityEngine.GUIUtility: ProcessEvent(Int32, IntPtr) (at /Users/bokken/buildslave/unity/build/Modules/IMGUI/GUIUtility.cs:197) EDIT: I think it has to do with the script ObiKinematicVelocities.cs, which seems to have been removed in the new version. I was using this on one of the objects, because I had a fast moving platform, moving sideways, and I wanted to translate the particles on that platform. Is there an alternative to ObiKinematicVelocities.cs? RE: After update I get "ArgumentNullException: Value cannot be null" - josemendez - 08-12-2020 (08-12-2020, 04:52 PM)emz06 Wrote: Thanks for that. Hi, ObiKinematicVelocities is now part of the core engine. You should just remove it. See the changelog for 5.6.1: Quote:## [5.6.1] RE: After update I get "ArgumentNullException: Value cannot be null" - emz06 - 08-12-2020 Thanks for the clarification. The problem seems to have disappeared. I'm not sure what solved it, but I went to my camera, set the size of Particle Renderers to 0, then I added every emitter in the scene, one at a time, and played the scene every time. For some reason, they started working again. Thanks for your help! |