Search Unity

[RELEASED] Magica Cloth

Discussion in 'Assets and Asset Store' started by hoshos, Jan 22, 2020.

  1. mchung123

    mchung123

    Joined:
    Jul 4, 2017
    Posts:
    38
    do we have an expected date, I might update to the new unity for this then!
     
    hoshos likes this.
  2. uxiaoyao

    uxiaoyao

    Joined:
    Jan 25, 2018
    Posts:
    1
    Hi, i got a similar problem, could you send the fixed code to me too ^0^
     
  3. hoshos

    hoshos

    Joined:
    Mar 7, 2015
    Posts:
    922
    Hello.
    This quote is about a bug in AddCollider() on 2/26/2021.
    And the fix at that time has already been incorporated into the latest v1.12.11.
    (To be exact, it was incorporated into v1.9.3.)
    So please update to the latest version.
     
  4. hoshos

    hoshos

    Joined:
    Mar 7, 2015
    Posts:
    922
    Update: 1.12.12

    v1.12.12 has been released on the Asset Store!
    http://u3d.as/1Hzx

    Release Note:
    Fixed: Fixed an issue that caused an error with Collections 2.1.x and above packages. If you use Collections2.x, please install the 2.1 or higher package.


    https://magicasoft.jp/en/release-note-2/
     
  5. Kst001

    Kst001

    Joined:
    Sep 14, 2021
    Posts:
    16
    Hello. How to integrate Magica Cloth 2 with Unity Multipurpose Avatar (UMA)?
     
  6. hoshos

    hoshos

    Joined:
    Mar 7, 2015
    Posts:
    922
    Hi.
    I'm not familiar with UMA so I can't give you an accurate answer.
    However, since it is presumed that the mesh will probably be generated at runtime, I think MagicaCloth should also be created at runtime.
    The following documents may help you with this:
    https://magicasoft.jp/en/mc2_runtime_build/

    However, please note that I will not know if it actually works until I test it.
    Also, there is the following dedicated forum for questions about MagicaCloth Ver2.x.
    https://forum.unity.com/threads/released-magicacloth2-hybrid-cloth-simulation.1395865/

    Since this is a forum for Ver1.x, please post Ver2.x to the above forum from next time.
     
  7. alchemist_wurzelpurzel

    alchemist_wurzelpurzel

    Joined:
    Sep 4, 2018
    Posts:
    43
    Hi,
    I am using Unity 2021.3.9f1 and Magica 1.12.12 and I have noticed that RenderMeshDeformer leaks its cloneMesh when the MagicaRenderDeformer GameObject is disabled and its Scene gets unloaded.

    I realize OnDestroy is not called on disabled GameObjects and that's why this happens, otherwise MagicaRenderDeformer would dispose its RenderMeshDeformer.

    Can you think of a way to elegantly handle this or would I have to look for a custom solution to this?

    Thanks!
     
  8. hoshos

    hoshos

    Joined:
    Mar 7, 2015
    Posts:
    922
    Hello.
    My understanding is that calling OnDestroy() is tied to Awake() independently of GameObject deactivation.
    In other words, if Awake() is called, OnDestroy() will be called correctly even if the GameObject is disabled afterwards.
    MagicaRenderDeformer initializes in Start() and creates CloehMesh, so it will be properly destroyed in any state.
    The above behavior can be confirmed by a simple experiment.

    However, there may be some oversight.
    Any easy steps to reproduce this CloehMesh leak?
    I tried various things but could not reproduce.
     
  9. alchemist_wurzelpurzel

    alchemist_wurzelpurzel

    Joined:
    Sep 4, 2018
    Posts:
    43
    You're probably right with the Awake - OnDestroy relationship. I think in our case we had a disabled Character in the game that somehow initialized its Magica components and then never got enabled which led to the cloneMesh leak.

    I fixed it for us by manually disposing the Magica components when their scene gets unloaded.
     
  10. hoshos

    hoshos

    Joined:
    Mar 7, 2015
    Posts:
    922
    Okay, I understand.
    I may have overlooked something in the process.
    I would like to investigate this issue.
     
  11. TigerHix

    TigerHix

    Joined:
    Oct 20, 2015
    Posts:
    69
    Hello,

    Magica Cloth 2 is lovely and we would love to upgrade to it. However, is it possible for Magica Cloth 1 and Magica Cloth 2 to co-exist in the project at the same time? Would there be conflicts between the two? We're creating a VTuber software and do not want to force users to update their models that used Magica Cloth 1 to use Magica Cloth 2, but would like to support Magica Cloth 2-configured models as well.
     
  12. hoshos

    hoshos

    Joined:
    Mar 7, 2015
    Posts:
    922
    Hello.
    Coexistence is possible.
    However, there is a negative performance impact as there are two similar systems running.
    A powerful desktop PC will do just fine, but be mindful of the load.
     
    TigerHix likes this.
  13. TigerHix

    TigerHix

    Joined:
    Oct 20, 2015
    Posts:
    69
    Thanks for your quick response! If Magica Cloth 1 components are not present in the runtime scene, is there still negative performance impact? Or there is negative performance impact only if Magica Cloth 1 & 2 components are used in the same scene?
     
  14. hoshos

    hoshos

    Joined:
    Mar 7, 2015
    Posts:
    922
    As long as you only use one, it's fine.
    The load increases when using Ver1 and 2 at the same time.
    This is because there are two different physics engines running.
     
  15. Kst001

    Kst001

    Joined:
    Sep 14, 2021
    Posts:
    16
    Hello. Is it possible to generate colliders automatically, so I wouldn't need to adjust them by hand?
     
  16. hoshos

    hoshos

    Joined:
    Mar 7, 2015
    Posts:
    922
    Is this to automatically generate colliders for the human body shape?
    If so, unfortunately it doesn't have that feature.
     
  17. unity_0386982845E97A39047D

    unity_0386982845E97A39047D

    Joined:
    Aug 2, 2023
    Posts:
    1
    Hello,
    I'm having some issues with runtime clothes in my project. I'm using a mesh cloth that I instantiate on runtime the same way it's done in the construction example (https://magicasoft.jp/en/mc2_runtime_build/) with the only difference that I am adding the bones (here just one) in the skinning bones list:
    upload_2023-9-15_16-15-54.png

    The main issue is that the cape is simulated correctly but does not follow my character's animations (this character is using some IK, I don't know if this can have an impact).
    upload_2023-9-15_16-20-0.png

    I even tried adding the subsequent bones of my character in the sknning bones list but it only gets worse and the mesh is stretched to the world origin (0,0,0).
    upload_2023-9-15_16-21-30.png

    Have you got any idea of where I messed things up?

    Thanks !
     
  18. hoshos

    hoshos

    Joined:
    Mar 7, 2015
    Posts:
    922
    Hello.
    We apologize for the inconvenience, but this is a support forum for MagicaCloth Ver1.x.
    The support forum for Ver2.x is at the following link, so please post here next time.

    https://forum.unity.com/threads/released-magicacloth2-hybrid-cloth-simulation.1395865/

    The problem is probably bones not being replaced correctly.
    This is difficult because many factors come into play.
    Therefore, the cause cannot be determined from this image alone.

    Can you provide a project where I can reproduce the problem if possible?
    If possible, please select "Start a Conversation" from my account and send me a DM.
     
  19. Framehacker

    Framehacker

    Joined:
    Jan 30, 2020
    Posts:
    14
    Hello

    I tried to add Collider to a MagicaBoneCloth component at runtime using the AddCollider function, but i cant make it work.
    After Looking in the code it seems like the AddCollider function just added the collider to the "addColliderList" instead of the "ColliderList" and this list seems to be only ever used to dispose collider. Did i miss something or is it just not possible to add collider at runtime?
     
  20. hoshos

    hoshos

    Joined:
    Mar 7, 2015
    Posts:
    922
    Hello.
    Colliders added with AddCollider() are managed separately from the list displayed in the inspector.
    Therefore, it is not displayed in the inspector.
    But it works correctly.
    Is the collider not responding?
     
  21. Framehacker

    Framehacker

    Joined:
    Jan 30, 2020
    Posts:
    14
    ah yes, had some clipping issue and noticed the inspector didnt list the collider i added with my script, so i thought something went wrong. I tested it again and the collider seams to work. Thanks for the clarification.
     
    hoshos likes this.
  22. Jakub_Machowski

    Jakub_Machowski

    Joined:
    Mar 19, 2013
    Posts:
    647
    Hello is Magica already working with unity LOD group?
     
  23. bitinn

    bitinn

    Joined:
    Aug 20, 2016
    Posts:
    961
    Hi @hoshos , a quick question,

    I am trying to add Magica Cloth v1 to a 2019.4 project, and saw our engine level is slightly lower than the 2019.4.31 requirement.

    Due to the complex infrastructure, upgrading core engine is not a possibility right now. But I am wondering if I can modify Magica Cloth or the old Collections package to workaround these incompatibilities.

    I see the main difference here is the lack of Count() on NativeMultiHashMap / NativeHashMap struct, if I patch these things in, would you still expect a big performance difference compared to supported engines?

    Thx!
     
  24. bitinn

    bitinn

    Joined:
    Aug 20, 2016
    Posts:
    961
    From the release note it looks like I might need to get v1.11.2 for 2019.4.x support, if my engine is below 2019.4.31?

    How could I get this version? My earliest package is unfortunately at v1.12.10, unsure how to download an earlier package :confused:
     
  25. hoshos

    hoshos

    Joined:
    Mar 7, 2015
    Posts:
    922
    Hello.
    Sorry for the late reply.
    I overlooked it.
    Unfortunately, MagicaCloth1 has no plans to support LOD.
    However, in Ver2 it has been added to the roadmap.

    https://assetstore.unity.com/packages/tools/physics/magica-cloth-2-242307

    However, it is still undecided whether it will actually be implemented or not as it will be experimented with in the future.
     
  26. hoshos

    hoshos

    Joined:
    Mar 7, 2015
    Posts:
    922
    Hello.
    MagicaCloth was tested on 2019.4.31, but should work with any version of Unity 2019.4.x.
    However, it does not work with Unity 2018 or lower.

    I don't think there will be much of a difference in performance with the patch.
    However, we are sorry to inform you that if such modifications are made, we will not support them.
    If you modify it, please do so at your own risk.
    Please understand this point.
     
  27. hoshos

    hoshos

    Joined:
    Mar 7, 2015
    Posts:
    922
    Are you using Unity 2018?
    In that case, unfortunately the current MagicaCloth will not work.

    As you pointed out, I think it worked until Unity 2018 v1.11.2.
    It was a long time ago, so there isn't much evidence.
    If you need v1.11.2, please send a DM to my support email (support@magicasoft.jp) or my account in this forum.
    Please also let me know the invoice number starting with IN, which is written on the receipt PDF at the time of purchase.
    Invoice number is required to confirm actual purchase.

    However, older versions have fewer features and still have some bugs.
    Therefore, we cannot support issues encountered with older versions.
    Please understand this point.
     
  28. bitinn

    bitinn

    Joined:
    Aug 20, 2016
    Posts:
    961
    Hi, thanks, we are using 2019.4, I think we just have a very old Collections package (preview 0.9 perhaps, I am not in office today), and its API were likely incompatible with Magica Cloth v1, we will try to upgrade that first.

    If you happen to know the minimum version of Collections / Jobs package required for Magica Cloth v1, please let me know, thx!
     
  29. hoshos

    hoshos

    Joined:
    Mar 7, 2015
    Posts:
    922
    I've understood the situation.
    MagicaCloth1.x works with Collections0.9.0-preview.6 or higher.
    Jobs package works with v0.2.10-preview.13 and above
    Please install this version if possible.
     
    bitinn likes this.
  30. utceylan

    utceylan

    Joined:
    Jan 14, 2018
    Posts:
    5
    Hello, we have recently upgraded from version 2.1.2 to the current one. However this has broken most of the objects that use bone cloth. They used to be bouncy but they are now extra stretchy and bend at weird angles when moved which we are unable to revert with changing our settings. What may cause the issue because we really want to use the settings tool that was added.
     
  31. hoshos

    hoshos

    Joined:
    Mar 7, 2015
    Posts:
    922
    Hello.
    Various additional modifications were made from v2.1.2 to the latest v2.4.2, which may have had some impact.
    One possibility is that the calculations related to inertia have been modified significantly.
    Therefore, it is difficult to restore the simulation algorithm even if the cause is found.
    We are very sorry for the inconvenience, but we ask that you recalibrate with the current latest version.
     
  32. seoyeon222222

    seoyeon222222

    Joined:
    Nov 18, 2020
    Posts:
    187
    upload_2024-1-20_3-2-14.png

    This error occurs infinitely
    2022.3.13f1 MagicaCloth 1.12.12
     
  33. hoshos

    hoshos

    Joined:
    Mar 7, 2015
    Posts:
    922
    Hello.
    This message seems to be displayed recently depending on the environment.
    It's not strictly an error, but I'll upload a fixed version soon.
    I have already sent you the corrected version as a DM.
    Use this version if you are in a hurry.
     
  34. seoyeon222222

    seoyeon222222

    Joined:
    Nov 18, 2020
    Posts:
    187
    Thank you for your quick response :)
     
    hoshos likes this.
  35. hoshos

    hoshos

    Joined:
    Mar 7, 2015
    Posts:
    922
    Update: 1.12.13

    v1.12.13 has been released on the Asset Store!
    http://u3d.as/1Hzx

    Release Note:
    Fixed: The high-speed mesh writing function using GPU ComputeBuffer has been discontinued.
    This is because it is not very effective and may cause errors depending on the environment.
     
  36. sacb0y

    sacb0y

    Joined:
    May 9, 2016
    Posts:
    874
    How does penetration work exactly?

    I have an issue where an outside collider is pushing the cloth inside another collider. Like say you have a shirt an when the arms come down it pushes the cloth into the body. Can I prevent that?

    I could solve this with a better collider setup but I'm using a dress up avatar configuration and colliders don't seem to automatically apply to the base rig?
     
  37. hoshos

    hoshos

    Joined:
    Mar 7, 2015
    Posts:
    922
    Hello.
    The penetration function basically restricts particles from moving deeper than a certain point.
    Please see the following documentation for details:
    If you haven't set it up yet, please test it.
    https://magicasoft.jp/en/prevent-penetration-2/

    However, this limit is not absolute.
    There are various constraints in cloth simulation, and they affect each other.
    Therefore, even if there is a limit to penetration, it will not prevent particles from being pushed in by another collider.
    In this case, the only option is to control the animation so that the arm does not sink into the body.
     
  38. sacb0y

    sacb0y

    Joined:
    May 9, 2016
    Posts:
    874
    Is there a way for colliders setup on a clothing item to apply to the "body" in a dress up?
     
  39. hoshos

    hoshos

    Joined:
    Mar 7, 2015
    Posts:
    922
    Please tell me more about this.
    For example, suppose you want to change A's clothes to B's body.
    Does this mean that you want to port the collider originally in A to B?
    Or do you mean the function of osmosis?
     
  40. sacb0y

    sacb0y

    Joined:
    May 9, 2016
    Posts:
    874
    osmosis I think.

    I have a character who's appearance can be changed in many ways. At the moment I just have a bunch of global colliders covering their body, but ideally, I could make a shirt, setup the colliders on the shirt. And when the shirt is attached to the avatar those colliders carry with it.
     
  41. hoshos

    hoshos

    Joined:
    Mar 7, 2015
    Posts:
    922
    If you want to change clothes, you will also need to port the collider.
    Additional script code is required to do this.
    There is sample code for these methods.

    https://forum.unity.com/threads/released-magica-cloth.813954/page-21#post-8291339

    Please check the before and after of the above post.
    I am discussing dress up with other end users.
     
  42. fishwind

    fishwind

    Joined:
    Jul 21, 2013
    Posts:
    11
    Hello! My game sometimes randomly crashes when loading a scene or when quitting application.

    Unity version: v2019.4.40f1
    Magica Cloth version: v1.8 (also tried upgrading to v1.12.13)
    Burst version: v1.6.6
    Collections version: 0.9.0-preview.6

    For my PlayerSetting, I have these:
    Scripting Backend: Mono
    Api Compatibility: .NET standard 2.0
    Allow 'unsafe Code' OFF

    As for Player.log (crash logs), I often see 2 types crash logs. One is when MagicaCloth is initiating. The other is when it is OnDestroy:

    Code (CSharp):
    1. 0x00007FF9355FAE59 (UnityPlayer) UnityMain
    2. 0x00007FF935CD3C34 (UnityPlayer) UnityMain
    3. 0x00007FF9355E0B2B (UnityPlayer) UnityMain
    4. 0x00007FF9355DD12E (UnityPlayer) UnityMain
    5. 0x00007FF9355EDF7A (UnityPlayer) UnityMain
    6. 0x00007FF93614D425 (UnityPlayer) UnityMain
    7. 0x000002518DC9A500 (Mono JIT Code) (wrapper managed-to-native) Unity.Collections.LowLevel.Unsafe.UnsafeUtility:Free (void*,Unity.Collections.Allocator)
    8. 0x000002518FA9F303 (Mono JIT Code) Unity.Collections.NativeArray`1<Unity.Mathematics.float3>:Deallocate ()
    9. 0x000002518FA9F29B (Mono JIT Code) Unity.Collections.NativeArray`1<Unity.Mathematics.float3>:Dispose ()
    10. 0x000002518FAAB893 (Mono JIT Code) [C:\CYF\Unity\BehaviourTreeAI\bhtree\Assets\Tools\MagicaCloth\Scripts\Core\Utility\NativeCollection\FixedNativeList.cs:96] MagicaCloth.FixedNativeList`1<Unity.Mathematics.float3>:Add (Unity.Mathematics.float3)
    11. 0x000002518FAAA6C3 (Mono JIT Code) [C:\CYF\Unity\BehaviourTreeAI\bhtree\Assets\Tools\MagicaCloth\Scripts\Core\Physics\Manager\PhysicsManagerBoneData.cs:302] MagicaCloth.PhysicsManagerBoneData:AddBone (UnityEngine.Transform,int,bool)
    12. 0x000002518FAA741B (Mono JIT Code) [C:\CYF\Unity\BehaviourTreeAI\bhtree\Assets\Tools\MagicaCloth\Scripts\Core\Physics\Manager\PhysicsManagerMeshData.cs:811] MagicaCloth.PhysicsManagerMeshData:AddVirtualMesh (int,int,int,int,int,int,UnityEngine.Transform)
    13. 0x000002518FA9ACB3 (Mono JIT Code) [C:\CYF\Unity\BehaviourTreeAI\bhtree\Assets\Tools\MagicaCloth\Scripts\Core\Deformer\VirtualMeshDeformer.cs:154] MagicaCloth.VirtualMeshDeformer:OnInit ()
    14. 0x000002518FA9A6DE (Mono JIT Code) [C:\CYF\Unity\BehaviourTreeAI\bhtree\Assets\Tools\MagicaCloth\Scripts\Core\Deformer\BaseMeshDeformer.cs:143] MagicaCloth.BaseMeshDeformer:Init ()
    15. 0x000002518FA9A0EF (Mono JIT Code) [C:\CYF\Unity\BehaviourTreeAI\bhtree\Assets\Tools\MagicaCloth\Scripts\Core\Deformer\MagicaVirtualDeformer.cs:80] MagicaCloth.MagicaVirtualDeformer:OnInit ()
    16. 0x000002518FA7E4A8 (Mono JIT Code) [C:\CYF\Unity\BehaviourTreeAI\bhtree\Assets\Tools\MagicaCloth\Scripts\Core\Physics\CoreComponent\CoreComponent.cs:178] MagicaCloth.CoreComponent:Init ()
    17. 0x000002518FA7E1AB (Mono JIT Code) [C:\CYF\Unity\BehaviourTreeAI\bhtree\Assets\Tools\MagicaCloth\Scripts\Core\Physics\CoreComponent\CoreComponent.cs:92] MagicaCloth.CoreComponent:Start ()
    18. 0x00000251CD30C330 (Mono JIT Code) (wrapper runtime-invoke) object:runtime_invoke_void__this__ (object,intptr,intptr,intptr)
    19. 0x00007FF97477E290 (mono-2.0-bdwgc) mono_get_runtime_build_info
    20. 0x00007FF974702AC2 (mono-2.0-bdwgc) mono_perfcounters_init
    21. 0x00007FF97470BB1F (mono-2.0-bdwgc) mono_runtime_invoke
    22. 0x00007FF93601758D (UnityPlayer) UnityMain
    23. 0x00007FF9360141CD (UnityPlayer) UnityMain
    24. 0x00007FF935FF899C (UnityPlayer) UnityMain
    25. 0x00007FF935FF8A2E (UnityPlayer) UnityMain
    26. 0x00007FF935FF6292 (UnityPlayer) UnityMain
    27. 0x00007FF9359CD9DD (UnityPlayer) UnityMain
    28. 0x00007FF935CA4294 (UnityPlayer) UnityMain
    29. 0x00007FF935C93257 (UnityPlayer) UnityMain
    30. 0x00007FF935C9331F (UnityPlayer) UnityMain
    31. 0x00007FF935C97049 (UnityPlayer) UnityMain
    32.   ERROR: SymGetSymFromAddr64, GetLastError: 'Attempt to access invalid address.' (Address: 00007FF93557095B)
    33. 0x00007FF93557095B (UnityPlayer) (function-name not available)
    34.   ERROR: SymGetSymFromAddr64, GetLastError: 'Attempt to access invalid address.' (Address: 00007FF93556F2AA)
    35. 0x00007FF93556F2AA (UnityPlayer) (function-name not available)
    36.   ERROR: SymGetSymFromAddr64, GetLastError: 'Attempt to access invalid address.' (Address: 00007FF935573AC6)
    37. 0x00007FF935573AC6 (UnityPlayer) (function-name not available)
    38. 0x00007FF9355777FB (UnityPlayer) UnityMain
    39.   ERROR: SymGetSymFromAddr64, GetLastError: 'Attempt to access invalid address.' (Address: 00007FF7C8D611F2)
    40. 0x00007FF7C8D611F2 (PlushieFromTheSky) (function-name not available)
    41. 0x00007FF9AD857344 (KERNEL32) BaseThreadInitThunk
    42. 0x00007FF9AE3E26B1 (ntdll) RtlUserThreadStart
    The other crash log is this:

    Code (CSharp):
    1. 0x00007FF9355FAE59 (UnityPlayer) UnityMain
    2. 0x00007FF935CD3C34 (UnityPlayer) UnityMain
    3. 0x00007FF9355E0B2B (UnityPlayer) UnityMain
    4. 0x00007FF9355DD12E (UnityPlayer) UnityMain
    5. 0x00007FF9355EDF7A (UnityPlayer) UnityMain
    6. 0x00007FF93614D425 (UnityPlayer) UnityMain
    7. 0x0000024DED8A3EB0 (Mono JIT Code) (wrapper managed-to-native) Unity.Collections.LowLevel.Unsafe.UnsafeUtility:Free (void*,Unity.Collections.Allocator)
    8. 0x0000024DF198E413 (Mono JIT Code) Unity.Collections.NativeArray`1<Unity.Mathematics.float3>:Deallocate ()
    9. 0x0000024DF198E3AB (Mono JIT Code) Unity.Collections.NativeArray`1<Unity.Mathematics.float3>:Dispose ()
    10. 0x0000024DEE17C243 (Mono JIT Code) [C:\CYF\Unity\BehaviourTreeAI\bhtree\Assets\Tools\MagicaCloth\Scripts\Core\Utility\NativeCollection\FixedNativeList.cs:56] MagicaCloth.FixedNativeList`1<Unity.Mathematics.float3>:Dispose ()
    11. 0x0000024DF9E30763 (Mono JIT Code) [C:\CYF\Unity\BehaviourTreeAI\bhtree\Assets\Tools\MagicaCloth\Scripts\Core\Physics\Manager\PhysicsManagerBoneData.cs:193] MagicaCloth.PhysicsManagerBoneData:Dispose ()
    12. 0x0000024DF9E1F7EC (Mono JIT Code) [C:\CYF\Unity\BehaviourTreeAI\bhtree\Assets\Tools\MagicaCloth\Scripts\Core\Physics\Manager\MagicaPhysicsManager.cs:266] MagicaCloth.MagicaPhysicsManager:OnDestroy ()
    13. 0x0000024E2E43C120 (Mono JIT Code) (wrapper runtime-invoke) object:runtime_invoke_void__this__ (object,intptr,intptr,intptr)
    14. 0x00007FF97477E290 (mono-2.0-bdwgc) mono_get_runtime_build_info
    15. 0x00007FF974702AC2 (mono-2.0-bdwgc) mono_perfcounters_init
    16. 0x00007FF97470BB1F (mono-2.0-bdwgc) mono_runtime_invoke
    17. 0x00007FF93601758D (UnityPlayer) UnityMain
    18. 0x00007FF9360141CD (UnityPlayer) UnityMain
    19. 0x00007FF93601429E (UnityPlayer) UnityMain
    20. 0x00007FF936040965 (UnityPlayer) UnityMain
    21. 0x00007FF935FFC65C (UnityPlayer) UnityMain
    22. 0x00007FF93563D60D (UnityPlayer) UnityMain
    23. 0x00007FF935C834C2 (UnityPlayer) UnityMain
    24. 0x00007FF935C81C1A (UnityPlayer) UnityMain
    25. 0x00007FF935C81A46 (UnityPlayer) UnityMain
    26. 0x00007FF935C8D02B (UnityPlayer) UnityMain
    27. 0x00007FF935C8D97A (UnityPlayer) UnityMain
    28. 0x00007FF935CA7CA5 (UnityPlayer) UnityMain
    29.   ERROR: SymGetSymFromAddr64, GetLastError: 'Attempt to access invalid address.' (Address: 00007FF9355707A1)
    30. 0x00007FF9355707A1 (UnityPlayer) (function-name not available)
    31.   ERROR: SymGetSymFromAddr64, GetLastError: 'Attempt to access invalid address.' (Address: 00007FF93556F2AA)
    32. 0x00007FF93556F2AA (UnityPlayer) (function-name not available)
    33.   ERROR: SymGetSymFromAddr64, GetLastError: 'Attempt to access invalid address.' (Address: 00007FF935573AC6)
    34. 0x00007FF935573AC6 (UnityPlayer) (function-name not available)
    35. 0x00007FF9355777FB (UnityPlayer) UnityMain
    36.   ERROR: SymGetSymFromAddr64, GetLastError: 'Attempt to access invalid address.' (Address: 00007FF7C8D611F2)
    37. 0x00007FF7C8D611F2 (PlushieFromTheSky) (function-name not available)
    38. 0x00007FF9AD857344 (KERNEL32) BaseThreadInitThunk
    39. 0x00007FF9AE3E26B1 (ntdll) RtlUserThreadStart
    I saw from this document here that we are recommended to turn on 'use unsafe Code' and use .NET 4.x? It is actually safe to use unsafe code? I also saw the Magica release note saying v1.7.0 doesn't need this anymore. But my tested versions are all newer than that. I haven't tested with IL2CPP, but is it worth a try?

    Any advice is appreciated~ Thank you!
     
  43. hoshos

    hoshos

    Joined:
    Mar 7, 2015
    Posts:
    922
    Hello.
    I looked at the crash log.
    Both seem to occur on NativeArray's Dispose().
    I just don't know the cause.
    NativeArray is a feature of the Burst package, not MagicaCloth.
    Normally, it should not crash at this point because the survival check is performed before Dispose().
    Additionally, there have been no inquiries regarding similar crashes to date.

    Setting UnsafeCode is no longer required. There is no problem if you leave it OFF.
    NativeArray is implemented in native code, so .NET settings shouldn't matter.

    I have a few questions.

    (1)MagicaCloth version
    Please use the latest MagicaCloth version as much as possible, v1.12.13.
    v1.8 is old and has many bugs.

    (2) Execution environment
    Is the execution environment where the crash occurs in the Unity editor?
    Or is it the built environment?
    If you are building, please tell us the platform.

    (3) Build settings
    What do you set for [C++ Compiler Configuration] in the build settings?
    Currently, it has been confirmed that building with this item set to "Master" causes a crash.
    This seems to be a bug in the Microsoft compiler and cannot be avoided.
    See the end of the following document for details.
    https://magicasoft.jp/en/magica-cloth-install-2/
     
  44. fishwind

    fishwind

    Joined:
    Jul 21, 2013
    Posts:
    11
    Noted! I will use the lastest MagicaCloth.

    Execution environment is built environment. I'm building and running on PC (window 10). It also crashes in "Development build". The crash has never occur in Unity editor. There is no error logs from editor when running the game in editor.

    upload_2024-2-19_20-49-49.png
    As for C++ complier configuration, it can't be selected, maybe because I'm using Mono? But it is set to "Release".
     
  45. hoshos

    hoshos

    Joined:
    Mar 7, 2015
    Posts:
    922
    Thank you for your reply.
    Master build doesn't seem to be involved.
    The cause is unknown as there are currently no similar crash reports.

    Does this crash happen often?
    Also, can you provide a project that reproduces this crash?
    A reproduction project would be helpful in determining the cause.

    Please send me a DM if possible.
    You can send a DM by clicking on my account and selecting "Start a Conversation".
     
  46. fishwind

    fishwind

    Joined:
    Jul 21, 2013
    Posts:
    11
    I think the crash happen around 40% of the time when quitting the game, and 5~10% when loading a different scene.

    It is inconvenience at the moment to provide a project as the file size is very big. I'll let you know again in future if I can provide it.

    Thank you for your willingness trying to help!

    Do you happen to have other advice how to reduce the crash chance? For example, does using less mesh deformer or sphere collision could help?
     
  47. hoshos

    hoshos

    Joined:
    Mar 7, 2015
    Posts:
    922
    No similar crashes have been reported so far, so it may be caused by a specific MagicaCloth component in your project.
    If we can identify that component, we may be able to determine the cause.
    Please let us know if you find out.

    Next, try switching your build to IL2CPP instead of Mono.
    Please use "Release" build for IL2CPP.
    This may change the compilation situation and make some changes.

    Finally, please consider adopting Version 2 of MagicaCloth.
    All processing has been restructured in Ver2, and workflow and memory management have been significantly improved.
    Therefore, there is a high possibility that this problem can also be avoided.
    https://assetstore.unity.com/packages/tools/physics/magica-cloth-2-242307

    Also, since development of Ver1.x has already ended, it will probably be discontinued in 2024.
    If you have Ver1, you can purchase it at 80% off.
    Please consider.
     
  48. fishwind

    fishwind

    Joined:
    Jul 21, 2013
    Posts:
    11
    Thanks again for the advice! I will try those out and surely get MagicaCloth v2 sooner or later!

    As this project was built in Unity 2019.4 and qutie close to release date, it is risky to upgrade it to 2021.3 that is required by MagicaCloth v2.

    I will let you know if I ever find some clue to the crash. Thank you!
     
    hoshos likes this.
  49. anagumak

    anagumak

    Joined:
    May 15, 2023
    Posts:
    3
    Hello all! I'm doing what, on the surface, seems to be a simple cloth simulation on a sleeve. I just can't get it to work right. I've attached images of the mesh and my settings in Magica. I just can't get rid of that nasty clipping and self intersection. The mesh is one dimensional and backface culling is turned off in my shader. So the darker blue inside sleeve is the backface with a solid color applied. I just used the Skirt preset. I've tried a bunch of different settings, and I can get it a bit smoother, but I can't totally get rid of the clipping and self intersection shown in the video. Do I need a different topology? Does the mesh have to have a thickness?

    Also, is there any hope of getting the tassel on the sleeve to work correctly?

    Any help would be greatly appreciated!








     
  50. hoshos

    hoshos

    Joined:
    Mar 7, 2015
    Posts:
    922
    Hello.
    Since Ver1 does not have self-collision, it is difficult to completely prevent clipping with this sleeve structure.
    Try testing the following to resolve the issue:

    (1) Reduction
    Looking at the image, it seems that the virtual mesh is a little too fine.
    Simulations may look better with a rougher virtual mesh.
    Try increasing the "Merge Vertex Distance" of the VirtualDeformer component to make the virtual mesh a little simpler.

    (2) Connecting nearby vertices
    Connect close vertices of the sleeve to make it more resistant to shape changes.
    Please enable "Near Point" in the [Restore Distance] panel, set "Near Point Length" to a larger value, and try connecting.
    https://magicasoft.jp/en/paramater-restore-distance-2/
    This may prevent clipping.

    (3)Use of BoneCloth
    If that doesn't work, it may be better to use BoneCloth instead of MeshCloth.
    However, to use BoneCloth, you need to add some control bones to the sleeve part.
    This is the same idea as the bones for skirts.
    If you use BoneCloth, the movement will be a little stiffer, but the clipping problem will be solved.