keijiro / TimelineParticleControl

An example of controlling particle system from timeline.
549 stars 51 forks source link

Don't set random seed while system is playing! #2

Closed Peaj closed 4 years ago

Peaj commented 5 years ago

Using Unity 2018.3.6f1 the ParticleSystemControlMixer throws multiple errors:

Don't set random seed while system is playing! Don't set duration while system is playing!

It seems like using particleSystem.useAutoRandomSeed, particleSystem.randomSeed or main.duration during playmode is not allowed.

Despite the error the code seems to work as intended in play mode (not sure about build). If I change the code to only set the random seed and duration if in edit mode the particles instantly disappear after emission.

I know this has been build and tested for Unity 2018.2 but it would be great if it would work in the current version two.

Thanks for this great tool btw!

keijiro commented 5 years ago

It doesn't reproduce on Unity 2018.3.10f1 nor 2019.1.0b9. Could you try upgrading Unity version?

keijiro commented 5 years ago

I'm closing this issue. Please feel free to reopen for further problems.

gackt2 commented 4 years ago

It seems to be crashing my unity 2019.3.14 now.

Don't set duration while system is playing! Don't set duration while system is playing! ... Don't set duration while system is playing! Don't set duration while system is playing! StackOverflowException: The requested operation caused a stack overflow. (Filename: <23a7799da2e941b88c6db790c607d655> Line: 0)

Allocation of 512 bytes at 0000019C00000010 TLS Allocator ALLOC_TEMP_THREAD, underlying allocator ALLOC_TEMP_THREAD has unfreed allocations, size 512 Internal: Stack allocator ALLOC_TEMP_THREAD has unfreed allocations, size 512 (Filename: C:\buildslave\unity\build\Runtime/Allocator/StackAllocator.cpp Line: 190)

To Debug, enable the define: DEBUG_STACK_LEAK in StackAllocator.h. This will output the callstacks of the leaked allocations (Filename: C:\buildslave\unity\build\Runtime/Allocator/StackAllocator.cpp Line: 192)

Allocation of 512 bytes at 0000019C00000010 Assertion failed on expression: 'o != NULL' Stacktrace:

at <0xffffffff> at (wrapper managed-to-native) UnityEditor.Handles.Internal_DrawCameraWithGrid (UnityEngine.Camera,UnityEditor.DrawCameraMode,UnityEditor.DrawGridParameters&,bool) [0x0000a] in :0 at UnityEditor.Handles.DrawCameraImpl (UnityEngine.Rect,UnityEngine.Camera,UnityEditor.DrawCameraMode,bool,UnityEditor.DrawGridParameters,bool,bool) [0x000cb] in :0 at UnityEditor.Handles.DrawCameraStep1 (UnityEngine.Rect,UnityEngine.Camera,UnityEditor.DrawCameraMode,UnityEditor.DrawGridParameters,bool) [0x00009] in :0 at UnityEditor.SceneView.DoDrawCamera (UnityEngine.Rect,UnityEngine.Rect,bool&) [0x00171] in :0 at UnityEditor.SceneView.OnGUI () [0x001aa] in :0 at (wrapper runtime-invoke) object.runtime_invoke_voidthis (object,intptr,intptr,intptr) [0x0004f] in <437ba245d8404784b9fbab9b439ac908>:0 at <0xffffffff> at (wrapper managed-to-native) System.Reflection.MonoMethod.InternalInvoke (System.Reflection.MonoMethod,object,object[],System.Exception&) [0x00016] in <437ba245d8404784b9fbab9b439ac908>:0 at System.Reflection.MonoMethod.Invoke (object,System.Reflection.BindingFlags,System.Reflection.Binder,object[],System.Globalization.CultureInfo) [0x00038] in <437ba245d8404784b9fbab9b439ac908>:0 at System.Reflection.MethodBase.Invoke (object,object[]) [0x00006] in <437ba245d8404784b9fbab9b439ac908>:0 at UnityEditor.HostView.Invoke (string,object) [0x00012] in :0 at UnityEditor.HostView.Invoke (string) [0x00009] in :0 at UnityEditor.HostView.InvokeOnGUI (UnityEngine.Rect,UnityEngine.Rect) [0x0004d] in :0 at UnityEditor.DockArea.DrawView (UnityEngine.Rect,UnityEngine.Rect) [0x00004] in :0 at UnityEditor.DockArea.OldOnGUI () [0x001b0] in :0 at UnityEngine.UIElements.IMGUIContainer.DoOnGUI (UnityEngine.Event,UnityEngine.Matrix4x4,UnityEngine.Rect,bool,UnityEngine.Rect,System.Action,bool) [0x0019e] in <95b42489e2e04430a87c3760aa29fca2>:0 at UnityEngine.UIElements.IMGUIContainer.HandleIMGUIEvent (UnityEngine.Event,UnityEngine.Matrix4x4,UnityEngine.Rect,System.Action,bool) [0x00076] in <95b42489e2e04430a87c3760aa29fca2>:0 at UnityEngine.UIElements.IMGUIContainer.DoIMGUIRepaint () [0x0005a] in <95b42489e2e04430a87c3760aa29fca2>:0 at UnityEngine.UIElements.UIR.RenderChainCommand.ExecuteNonDrawMesh (UnityEngine.UIElements.UIR.DrawParams,bool,single,System.Exception&) [0x00083] in <95b42489e2e04430a87c3760aa29fca2>:0 at UnityEngine.UIElements.UIR.UIRenderDevice.EvaluateChain (UnityEngine.UIElements.UIR.RenderChainCommand,UnityEngine.Rect,UnityEngine.Matrix4x4,UnityEngine.UIElements.PanelClearFlags,UnityEngine.Texture,UnityEngine.Texture,UnityEngine.Texture,single,Unity.Collections.NativeArray1<UnityEngine.UIElements.UIR.Transform3x4>,Unity.Collections.NativeArray1,System.Exception&) [0x00500] in <95b42489e2e04430a87c3760aa29fca2>:0 at UnityEngine.UIElements.UIR.UIRenderDevice.DrawChain (UnityEngine.UIElements.UIR.RenderChainCommand,UnityEngine.Rect,UnityEngine.Matrix4x4,UnityEngine.UIElements.PanelClearFlags,UnityEngine.Texture,UnityEngine.Texture,UnityEngine.Texture,single,Unity.Collections.NativeArray1<UnityEngine.UIElements.UIR.Transform3x4>,Unity.Collections.NativeArray1,System.Exception&) [0x0002c] in <95b42489e2e04430a87c3760aa29fca2>:0 at UnityEngine.UIElements.UIR.RenderChain.Render (UnityEngine.Rect,UnityEngine.Matrix4x4,UnityEngine.UIElements.PanelClearFlags) [0x0066e] in <95b42489e2e04430a87c3760aa29fca2>:0 at UnityEngine.UIElements.UIRRepaintUpdater.DrawChain (UnityEngine.Rect,UnityEngine.Matrix4x4) [0x00020] in <95b42489e2e04430a87c3760aa29fca2>:0 at UnityEngine.UIElements.UIRRepaintUpdater.Update () [0x00033] in <95b42489e2e04430a87c3760aa29fca2>:0 at UnityEngine.UIElements.VisualTreeUpdater.UpdateVisualTreePhase (UnityEngine.UIElements.VisualTreeUpdatePhase) [0x0001f] in <95b42489e2e04430a87c3760aa29fca2>:0 at UnityEngine.UIElements.Panel.UpdateForRepaint () [0x0003c] in <95b42489e2e04430a87c3760aa29fca2>:0 at UnityEngine.UIElements.Panel.Repaint (UnityEngine.Event) [0x00061] in <95b42489e2e04430a87c3760aa29fca2>:0 at UnityEngine.UIElements.UIElementsUtility.DoDispatch (UnityEngine.UIElements.BaseVisualElementPanel) [0x00029] in <95b42489e2e04430a87c3760aa29fca2>:0 at UnityEngine.UIElements.UIElementsUtility.ProcessEvent (int,intptr) [0x0003e] in <95b42489e2e04430a87c3760aa29fca2>:0 at UnityEngine.GUIUtility.ProcessEvent (int,intptr) [0x00014] in <35bab3c7b0dc4999845bcfccc7758d96>:0 at (wrapper runtime-invoke) .runtime_invoke_bool_int_intptr (object,intptr,intptr,intptr) [0x00028] in <35bab3c7b0dc4999845bcfccc7758d96>:0

keijiro commented 4 years ago

@gackt2 I can understand your frustration, but please don't try spamming here.

keijiro commented 4 years ago

I edited the comment to remove non-essential information.

gackt2 commented 4 years ago

Oops sorry. It wasn't meant to be spam. That's actually how many messages it spat out into the crash log.

Is there a way to attach a .txt or .log to these GIT messages?

keijiro commented 4 years ago

@gackt2 The issue doesn't reproduce on my side. Please make sure that you're using the latest version.