Posts: 3
Threads: 1
Joined: Apr 2021
Reputation:
0
Please excuse my English!
I need to stop the fluid from moving (I don't want it to flow any more).
I stop the movement of the fluid by doing the following
Code: for (int i = 0; i < emitter.solverIndices.Length; ++i){
int solverIndex = emitter.solverIndices[i];
float invMass = emitter.solver.invMasses[solverIndex];
emitter.solver.invMasses[solverIndex] = 0;
}
However, when I run this code, the fluid display disappears and a crash occurs.
The error is as follows
What are the possible causes?
Code: Converting invalid MinMaxAABB
UnityEngine.Mesh:SetVertices (System.Collections.Generic.List`1<UnityEngine.Vector3>)
Obi.ParticleImpostorRendering:Apply (UnityEngine.Mesh) (at Assets/Obi/Scripts/Common/Rendering/ParticleImpostorRendering.cs:39)
Obi.ParticleImpostorRendering:UpdateMeshes (Obi.IObiParticleCollection) (at Assets/Obi/Scripts/Common/Rendering/ParticleImpostorRendering.cs:150)
Obi.ObiParticleRenderer:DrawParticles (Obi.ObiActor) (at Assets/Obi/Scripts/Common/Rendering/ObiParticleRenderer.cs:80)
Obi.ObiActor:Interpolate () (at Assets/Obi/Scripts/Common/Actors/ObiActor.cs:1189)
Obi.ObiSolver:Interpolate (single,single) (at Assets/Obi/Scripts/Common/Solver/ObiSolver.cs:1622)
Obi.ObiUpdater:Interpolate (single,single) (at Assets/Obi/Scripts/Common/Updaters/ObiUpdater.cs:110)
Obi.ObiFixedUpdater:Update () (at Assets/Obi/Scripts/Common/Updaters/ObiFixedUpdater.cs:62)
Mesh 'Particle impostors': abnormal mesh bounds - most likely it has some invalid vertices (+/-inifinity or NANs) due to errors exporting.
Mesh bounds min=(nan, nan, nan), max=(nan, nan, nan). Please make sure the mesh is exported without any errors.
UnityEngine.GUIUtility:ProcessEvent (int,intptr,bool&)
And I saw in another thread that you also need the following code to stop the fluid.
It seems that solver does not have UpdateParameters in the current version.
Code: emitter.solver.distanceConstraintParameters.enabled = false;
emitter.solver.UpdateParameters();
Posts: 6,321
Threads: 24
Joined: Jun 2017
Reputation:
400
Obi Owner:
23-04-2021, 11:03 AM
(This post was last modified: 23-04-2021, 11:03 AM by josemendez.)
(23-04-2021, 10:55 AM)momns Wrote: Please excuse my English!
I need to stop the fluid from moving (I don't want it to flow any more).
I stop the movement of the fluid by doing the following
Code: for (int i = 0; i < emitter.solverIndices.Length; ++i){
int solverIndex = emitter.solverIndices[i];
float invMass = emitter.solver.invMasses[solverIndex];
emitter.solver.invMasses[solverIndex] = 0;
}
However, when I run this code, the fluid display disappears and a crash occurs.
The error is as follows
What are the possible causes?
Code: Converting invalid MinMaxAABB
UnityEngine.Mesh:SetVertices (System.Collections.Generic.List`1<UnityEngine.Vector3>)
Obi.ParticleImpostorRendering:Apply (UnityEngine.Mesh) (at Assets/Obi/Scripts/Common/Rendering/ParticleImpostorRendering.cs:39)
Obi.ParticleImpostorRendering:UpdateMeshes (Obi.IObiParticleCollection) (at Assets/Obi/Scripts/Common/Rendering/ParticleImpostorRendering.cs:150)
Obi.ObiParticleRenderer:DrawParticles (Obi.ObiActor) (at Assets/Obi/Scripts/Common/Rendering/ObiParticleRenderer.cs:80)
Obi.ObiActor:Interpolate () (at Assets/Obi/Scripts/Common/Actors/ObiActor.cs:1189)
Obi.ObiSolver:Interpolate (single,single) (at Assets/Obi/Scripts/Common/Solver/ObiSolver.cs:1622)
Obi.ObiUpdater:Interpolate (single,single) (at Assets/Obi/Scripts/Common/Updaters/ObiUpdater.cs:110)
Obi.ObiFixedUpdater:Update () (at Assets/Obi/Scripts/Common/Updaters/ObiFixedUpdater.cs:62)
Mesh 'Particle impostors': abnormal mesh bounds - most likely it has some invalid vertices (+/-inifinity or NANs) due to errors exporting.
Mesh bounds min=(nan, nan, nan), max=(nan, nan, nan). Please make sure the mesh is exported without any errors.
UnityEngine.GUIUtility:ProcessEvent (int,intptr,bool&)
And I saw in another thread that you also need the following code to stop the fluid.
It seems that solver does not have UpdateParameters in the current version.
Code: emitter.solver.distanceConstraintParameters.enabled = false;
emitter.solver.UpdateParameters();
Hi there,
Setting the inverse mass to zero (that is, infinite mass) on a fluid would causes infinite pressure to be applied. Obi check for this and freezes the particle in place, it shouldn't crash though. Can you share the editor crash log?
The proper way to do this is to convert the particle to a granular before giving it infinite mass. See:
http://obi.virtualmethodstudio.com/forum...-2849.html
Posts: 3
Threads: 1
Joined: Apr 2021
Reputation:
0
24-04-2021, 11:13 AM
(This post was last modified: 24-04-2021, 11:15 AM by momns.)
(23-04-2021, 11:03 AM)josemendez Wrote: Hi there,
Setting the inverse mass to zero (that is, infinite mass) on a fluid would causes infinite pressure to be applied. Obi check for this and freezes the particle in place, it shouldn't crash though. Can you share the editor crash log?
The proper way to do this is to convert the particle to a granular before giving it infinite mass. See:
http://obi.virtualmethodstudio.com/forum...-2849.html
Thank you for your very quick reply, I appreciate it.
I'll share the Editor.log with you, it contains excerpts from just before and after the crash.
Quote:Converting invalid MinMaxAABB
UnityEngine.StackTraceUtility:ExtractStackTrace () (at /Users/bokken/buildslave/unity/build/Runtime/Export/Scripting/StackTrace.cs:37)
UnityEngine.Mesh:SetSizedArrayForChannel (UnityEngine.Rendering.VertexAttribute,UnityEngine.Rendering.VertexAttributeFormat,int,System.Array,int,int,int,UnityEngine.Rendering.MeshUpdateFlags) (at /Users/bokken/buildslave/unity/build/Runtime/Export/Graphics/Mesh.cs:71)
UnityEngine.Mesh:SetListForChannel<UnityEngine.Vector3> (UnityEngine.Rendering.VertexAttribute,System.Collections.Generic.List`1<UnityEngine.Vector3>,int,int,UnityEngine.Rendering.MeshUpdateFlags) (at /Users/bokken/buildslave/unity/build/Runtime/Export/Graphics/Mesh.cs:114)
UnityEngine.Mesh:SetVertices (System.Collections.Generic.List`1<UnityEngine.Vector3>,int,int,UnityEngine.Rendering.MeshUpdateFlags) (at /Users/bokken/buildslave/unity/build/Runtime/Export/Graphics/Mesh.cs:225)
UnityEngine.Mesh:SetVertices (System.Collections.Generic.List`1<UnityEngine.Vector3>,int,int) (at /Users/bokken/buildslave/unity/build/Runtime/Export/Graphics/Mesh.cs:220)
UnityEngine.Mesh:SetVertices (System.Collections.Generic.List`1<UnityEngine.Vector3>) (at /Users/bokken/buildslave/unity/build/Runtime/Export/Graphics/Mesh.cs:215)
Obi.ParticleImpostorRendering:Apply (UnityEngine.Mesh) (at Assets/Obi/Scripts/Common/Rendering/ParticleImpostorRendering.cs:39)
Obi.ParticleImpostorRendering:UpdateMeshes (Obi.IObiParticleCollection) (at Assets/Obi/Scripts/Common/Rendering/ParticleImpostorRendering.cs:150)
Obi.ObiParticleRendererrawParticles (Obi.ObiActor) (at Assets/Obi/Scripts/Common/Rendering/ObiParticleRenderer.cs:80)
Obi.ObiActor:Interpolate () (at Assets/Obi/Scripts/Common/Actors/ObiActor.cs:1189)
Obi.ObiSolver:Interpolate (single,single) (at Assets/Obi/Scripts/Common/Solver/ObiSolver.cs:1622)
Obi.ObiUpdater:Interpolate (single,single) (at Assets/Obi/Scripts/Common/Updaters/ObiUpdater.cs:110)
Obi.ObiFixedUpdater:Update () (at Assets/Obi/Scripts/Common/Updaters/ObiFixedUpdater.cs:62)
[Assets/Obi/Scripts/Common/Rendering/ParticleImpostorRendering.cs line 39]
Converting invalid MinMaxAABB
UnityEngine.StackTraceUtility:ExtractStackTrace () (at /Users/bokken/buildslave/unity/build/Runtime/Export/Scripting/StackTrace.cs:37)
UnityEngine.Mesh:SetTrianglesImpl (int,UnityEngine.Rendering.IndexFormat,System.Array,int,int,int,bool,int) (at /Users/bokken/buildslave/unity/build/Runtime/Export/Graphics/Mesh.cs:942)
UnityEngine.Mesh:SetTriangles (System.Collections.Generic.List`1<int>,int,int,int,bool,int) (at /Users/bokken/buildslave/unity/build/Runtime/Export/Graphics/Mesh.cs:1003)
UnityEngine.Mesh:SetTriangles (System.Collections.Generic.List`1<int>,int,bool,int) (at /Users/bokken/buildslave/unity/build/Runtime/Export/Graphics/Mesh.cs:997)
UnityEngine.Mesh:SetTriangles (System.Collections.Generic.List`1<int>,int,bool) (at /Users/bokken/buildslave/unity/build/Runtime/Export/Graphics/Mesh.cs:992)
Obi.ParticleImpostorRendering:Apply (UnityEngine.Mesh) (at Assets/Obi/Scripts/Common/Rendering/ParticleImpostorRendering.cs:45)
Obi.ParticleImpostorRendering:UpdateMeshes (Obi.IObiParticleCollection) (at Assets/Obi/Scripts/Common/Rendering/ParticleImpostorRendering.cs:150)
Obi.ObiParticleRendererrawParticles (Obi.ObiActor) (at Assets/Obi/Scripts/Common/Rendering/ObiParticleRenderer.cs:80)
Obi.ObiActor:Interpolate () (at Assets/Obi/Scripts/Common/Actors/ObiActor.cs:1189)
Obi.ObiSolver:Interpolate (single,single) (at Assets/Obi/Scripts/Common/Solver/ObiSolver.cs:1622)
Obi.ObiUpdater:Interpolate (single,single) (at Assets/Obi/Scripts/Common/Updaters/ObiUpdater.cs:110)
Obi.ObiFixedUpdater:Update () (at Assets/Obi/Scripts/Common/Updaters/ObiFixedUpdater.cs:62)
[Assets/Obi/Scripts/Common/Rendering/ParticleImpostorRendering.cs line 45]
Mesh 'Particle impostors': abnormal mesh bounds - most likely it has some invalid vertices (+/-inifinity or NANs) due to errors exporting.
Mesh bounds min=(nan, nan, nan), max=(nan, nan, nan). Please make sure the mesh is exported without any errors.
UnityEngine.StackTraceUtility:ExtractStackTrace () (at /Users/bokken/buildslave/unity/build/Runtime/Export/Scripting/StackTrace.cs:37)
UnityEditor.EditorGUIUtility:RenderPlayModeViewCamerasInternal (UnityEngine.RenderTexture,int,UnityEngine.Vector2,bool,bool)
UnityEditor.PlayModeView:RenderView (UnityEngine.Vector2,bool) (at /Users/bokken/buildslave/unity/build/Editor/Mono/PlayModeView/PlayModeView.cs:176)
UnityEditor.GameView:OnGUI () (at /Users/bokken/buildslave/unity/build/Editor/Mono/GameView/GameView.cs:859)
UnityEditor.HostView:InvokeOnGUI (UnityEngine.Rect,UnityEngine.Rect) (at /Users/bokken/buildslave/unity/build/Editor/Mono/HostView.cs:403)
UnityEditor.DockArearawView (UnityEngine.Rect,UnityEngine.Rect) (at /Users/bokken/buildslave/unity/build/Editor/Mono/GUI/DockArea.cs:382)
UnityEditor.DockArea:OldOnGUI () (at /Users/bokken/buildslave/unity/build/Editor/Mono/GUI/DockArea.cs:372)
UnityEngine.UIElements.IMGUIContaineroOnGUI (UnityEngine.Event,UnityEngine.Matrix4x4,UnityEngine.Rect,bool,UnityEngine.Rect,System.Action,bool) (at /Users/bokken/buildslave/unity/build/External/MirroredPackageSources/com.unity.ui/Core/IMGUIContainer.cs:333)
UnityEngine.UIElements.IMGUIContainer:HandleIMGUIEvent (UnityEngine.Event,UnityEngine.Matrix4x4,UnityEngine.Rect,System.Action,bool) (at /Users/bokken/buildslave/unity/build/External/MirroredPackageSources/com.unity.ui/Core/IMGUIContainer.cs:663)
UnityEngine.UIElements.IMGUIContaineroIMGUIRepaint () (at /Users/bokken/buildslave/unity/build/External/MirroredPackageSources/com.unity.ui/Core/IMGUIContainer.cs:530)
UnityEngine.UIElements.UIR.RenderChainCommand:ExecuteNonDrawMesh (UnityEngine.UIElements.UIR.DrawParams,single,System.Exception&) (at /Users/bokken/buildslave/unity/build/External/MirroredPackageSources/com.unity.ui/Core/Renderer/UIRenderer/UIRenderers.cs:114)
UnityEngine.UIElements.UIR.UIRenderDevice:EvaluateChain (UnityEngine.UIElements.UIR.RenderChainCommand,UnityEngine.Material,UnityEngine.Material,UnityEngine.Texture,UnityEngine.Texture,UnityEngine.Texture,single,Unity.Collections.NativeSlice`1<UnityEngine.UIElements.UIR.Transform3x4>,Unity.Collections.NativeSlice`1<UnityEngine.Vector4>,UnityEngine.MaterialPropertyBlock,bool,System.Exception&) (at /Users/bokken/buildslave/unity/build/External/MirroredPackageSources/com.unity.ui/Core/Renderer/UIRenderer/UIRenderDevice.cs:816)
UnityEngine.UIElements.UIR.RenderChain:Render () (at /Users/bokken/buildslave/unity/build/External/MirroredPackageSources/com.unity.ui/Core/Renderer/UIRChainBuilder.cs:490)
UnityEngine.UIElements.UIRRepaintUpdater:Update () (at /Users/bokken/buildslave/unity/build/External/MirroredPackageSources/com.unity.ui/Core/Renderer/UIRRepaintUpdater.cs:62)
UnityEngine.UIElements.VisualTreeUpdater:UpdateVisualTreePhase (UnityEngine.UIElements.VisualTreeUpdatePhase) (at /Users/bokken/buildslave/unity/build/External/MirroredPackageSources/com.unity.ui/Core/VisualTreeUpdater.cs:83)
UnityEngine.UIElements.Panel:UpdateForRepaint () (at /Users/bokken/buildslave/unity/build/External/MirroredPackageSources/com.unity.ui/Core/Panel.cs:829)
UnityEngine.UIElements.Panel:Repaint (UnityEngine.Event) (at /Users/bokken/buildslave/unity/build/External/MirroredPackageSources/com.unity.ui/Core/Panel.cs:865)
UnityEngine.UIElements.UIElementsUtilityoDispatch (UnityEngine.UIElements.BaseVisualElementPanel) (at /Users/bokken/buildslave/unity/build/External/MirroredPackageSources/com.unity.ui/Core/UIElementsUtility.cs:441)
UnityEngine.UIElements.UIElementsUtility:UnityEngine.UIElements.IUIElementsUtility.ProcessEvent (int,intptr,bool&) (at /Users/bokken/buildslave/unity/build/External/MirroredPackageSources/com.unity.ui/Core/UIElementsUtility.cs:209)
UnityEngine.UIElements.UIEventRegistrationrocessEvent (int,intptr) (at /Users/bokken/buildslave/unity/build/External/MirroredPackageSources/com.unity.ui/Core/UIElementsUtility.cs:74)
UnityEngine.UIElements.UIEventRegistration/<>c:<.cctor>b__1_2 (int,intptr) (at /Users/bokken/buildslave/unity/build/External/MirroredPackageSources/com.unity.ui/Core/UIElementsUtility.cs:28)
UnityEngine.GUIUtilityrocessEvent (int,intptr,bool&) (at /Users/bokken/buildslave/unity/build/Modules/IMGUI/GUIUtility.cs:189)
[/Users/bokken/buildslave/unity/build/Runtime/Export/Scripting/StackTrace.cs line 37]
I also tried converting the particles to granular, but the crash still occurred.
Code: for (int i = 0; i < emitter.solverIndices.Length; ++i){
int solverIndex = emitter.solverIndices[i];
emitter.solver.phases[solverIndex] &= (int)(~Oni.ParticleFlags.Fluid);
emitter.solver.invMasses[solverIndex] = 0;
}
Posts: 6,321
Threads: 24
Joined: Jun 2017
Reputation:
400
Obi Owner:
(24-04-2021, 11:13 AM)momns Wrote: Thank you for your very quick reply, I appreciate it.
I'll share the Editor.log with you, it contains excerpts from just before and after the crash.
I also tried converting the particles to granular, but the crash still occurred.
Code: for (int i = 0; i < emitter.solverIndices.Length; ++i){
int solverIndex = emitter.solverIndices[i];
emitter.solver.phases[solverIndex] &= (int)(~Oni.ParticleFlags.Fluid);
emitter.solver.invMasses[solverIndex] = 0;
}
Hi there,
Just tried the same code, but I'm unable to reproduce the bug. This works correctly for me.
Would it be possible for you to share the scene that causes this issue? You can send it to support(at)virtualmethodstudio.com.
Posts: 3
Threads: 1
Joined: Apr 2021
Reputation:
0
(27-04-2021, 07:14 AM)josemendez Wrote: Hi there,
Just tried the same code, but I'm unable to reproduce the bug. This works correctly for me.
Would it be possible for you to share the scene that causes this issue? You can send it to support(at)virtualmethodstudio.com.
Thanks for trying the same code!!! Thank you very much!!!
I'll try to share something that can reproduce the crash. Please wait for a while.
|