Search Unity

  1. Click here to receive a gift with your purchase of Unity Pro or Unity Enterprise.
    Dismiss Notice
  2. Good news ✨ We have more Unite Now videos available for you to watch on-demand! Come check them out and ask our experts any questions!
    Dismiss Notice

[RELEASED] Magica Cloth

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

  1. ChrisCoool

    ChrisCoool

    Joined:
    Jul 3, 2017
    Posts:
    10
    Hi, I have a problem when I use MagicMeshCloth to simulate hair. Everytime when I finish point selection and reopen it, the points change. Many points turn into red ones! Is there anything wrong?

    Thanks a lot!
     
  2. hoshos

    hoshos

    Joined:
    Mar 7, 2015
    Posts:
    246
    Hello.
    First, can you check if you are using the latest version of MagicaCloth?
    The latest version is v1.7.2.
    In the previous version, there was a similar bug when two or more inspector windows were placed.
     
  3. ChrisCoool

    ChrisCoool

    Joined:
    Jul 3, 2017
    Posts:
    10
    Thanks for the reply.

    Well, I am using the latest version of MagicaCloth. Let me elaborate my problem.

    I am not sure if there is something to do with the mesh complexity. My hair mesh contains more than 40,000 vertices. I set the "Merge Vertex Distance" to 0.05, which reduces the number of vertices to 421(I leave other options to be default).

    Then I create the "Magica Mesh Cloth" component to do point selection. I set all points above the head to red(fixed) ones and set others to green ones. Then I click "End Point Selection", then "Create". It seems everything is going well.

    However when I click "Start Point Selection" again, it turns out that many green points become red ones. It's very strange. So the hair looks very stiff when avatar is walking.

    Is there any suggestions? Thanks.
     
  4. hoshos

    hoshos

    Joined:
    Mar 7, 2015
    Posts:
    246
    Hello.
    This is likely a bug.
    Can you answer the next question, because you want more information?

    (1) Virtual Deformer settings
    Does the same problem occur even if [Merge Vertex Distance] is set to other than 0.05 such as 0.04?

    (2) Other mesh
    Does the same problem occur with models other than the hair model where the problem occurs?

    (3) Unity version
    What is your Unity version?
     
  5. ChrisCoool

    ChrisCoool

    Joined:
    Jul 3, 2017
    Posts:
    10
    Sure.
    1. I have tried serveral value of [Merge Vertex Distance] but the problem still exsits. I find a pattern that the smaller the value is, the fewer the green points turn to red ones.

    2. This problem only occurs with hair model. Other models are fine.

    3. My version is 2019.3.6f1.

    Hope these will help.
     
  6. hoshos

    hoshos

    Joined:
    Mar 7, 2015
    Posts:
    246
    Thank you for the information.
    After all, there is a high possibility of problems due to the structure of the mesh.
    Is it possible to rent a model with problematic hair?
    Of course we will delete it after the experiment.
     
  7. ChrisCoool

    ChrisCoool

    Joined:
    Jul 3, 2017
    Posts:
    10
    Hi, thanks for your patience. I'm afraid that I cannot give model to you guys. Sorry about that. I will ask our artist to check it out. Thank you again.
     
  8. hoshos

    hoshos

    Joined:
    Mar 7, 2015
    Posts:
    246
    I am sorry that I cannot solve the problem.
    I will experiment with some high mesh models here as well.
    If you have any hints, I would appreciate it if you could contact me.
    (For example, only the problem mesh has different import settings..)
     
  9. adventurefan

    adventurefan

    Joined:
    Jan 17, 2014
    Posts:
    201
    I experienced the same thing today. Nothing fixed it until I tried a few other slightly different merge vertex difference. It was confusing.

    Also I wanted to bring up that having my own test character with cloth in the same scene with unitychan character for testing... it breaks both their physics simulation/stretches things if they are enabled at the same time. Nothing was copied from the demo character so this is strange. They both work fine if only one is enabled in the scene.

    It has this error:

    System.IndexOutOfRangeException: Index {0} is out of range of '{1}' Length.
    Thrown from job: MagicaCloth.RestoreDistanceConstraint.DistanceJob
    This Exception was thrown from a job compiled with Burst, which has limited exception support. Turn off burst (Jobs -> Burst -> Enable Compilation) to inspect full exceptions & stacktraces.

    Are multiple cloth characters supported in one scene?

    EDIT: Resolved. I'll leave this here in case anyone does the same thing at some point. The issue was their scale was too different. Putting my object the same as the demo character's scale fixed it.
     
    Last edited: Jun 25, 2020
  10. hoshos

    hoshos

    Joined:
    Mar 7, 2015
    Posts:
    246
    Hello.
    I was worried because I did not understand the cause, but I was relieved that the problem was solved.
    Scaling at runtime is supported from v1.7.2.
    You'll need to create the data in v1.7.2 to enable this, but the scaling issue is gone.
    Thank you.
     
  11. khos

    khos

    Joined:
    May 10, 2016
    Posts:
    1,063
    So I was using your rated version very nicely, today I purchased Magica Cloth as it works well for my game, I installed the paid version of Magica Cloth (1.7.2) via Unity package manager, now the hair works different, see below:

    Before (ok):
    before.PNG
    After:
    Update-Issue.PNG
    Looks like gravity just got turned upside down, or thee is some wind from the bottom upwards? Why is that happening..
    I am hesitant to install the paid version now as I have a working setup.., I have purchased the asset via the store and will keep that of course, but can I just keep using the rated version you initially gave me as that is all setup to how I need it?

    Thanks.
     
  12. hoshos

    hoshos

    Joined:
    Mar 7, 2015
    Posts:
    246
    Hello.
    Thank you for your report.
    I can use the previous version, but I want to manage this problem somehow, so can you answer the following question?
    Can you tell which version of MagicaCloth was used before?
    Is it a pretty old version?
     
    Last edited: Jun 28, 2020
  13. hoshos

    hoshos

    Joined:
    Mar 7, 2015
    Posts:
    246
    Announcement

    We found a rare cause of mesh collapse when swapping characters with multiple MagicaCloths.
    It will be fixed in the next update.
    We apologize for the inconvenience.
     
  14. JossesMan

    JossesMan

    Joined:
    Aug 22, 2019
    Posts:
    2
    Hello! Hello! You can use the custom designs (sweatpants for boys) kiosk if you have unlocked the Able Sisters Shop and are Nintendo Switch Online. You can look at the entire collection via Model ID if you are looking for a similar outfit or via Maker ID!
     
    Last edited: Jul 15, 2020
  15. khos

    khos

    Joined:
    May 10, 2016
    Posts:
    1,063
    Hi, you sent me magicacloth170.unitypackage
     
  16. hoshos

    hoshos

    Joined:
    Mar 7, 2015
    Posts:
    246
    Thank you.
    Since v1.7.0 is recent, old bugs are unlikely to be relevant.
    Sorry for your inconvenience, but can you do the next experiment?
    (Please make a backup before doing this)

    (1) Turn off collision
    Turn off Collider Collision on the panel and turn off the collision detection.
    Does this fix the problem of growing up like the image?

    (2) Recreating the data
    Just in case, can you recreate the data for the corresponding RenderDeformer/VirtualDeformer/XXCloth?
    Does this fix the problem of growing up like the image?
     
  17. khos

    khos

    Joined:
    May 10, 2016
    Posts:
    1,063
    Thanks for your reply, I will try your tests soon, I am close to a game release so may be delayed in getting back to you, as I put the version 170 files back and it works perfect, for now I am happy :)
    Maybe I need to click the create buttons again to update data?
     
  18. hoshos

    hoshos

    Joined:
    Mar 7, 2015
    Posts:
    246
    Okay, wait for your test.
    The create button should not be necessary if you use v1.7.0 as it is.
    If you create data with v1.7.2 once and then return to v1.7.0, it is safer to press the create button again.
    However, if the game is already working properly, it's better not to do anything.
     
  19. hoshos

    hoshos

    Joined:
    Mar 7, 2015
    Posts:
    246
    Hello, ChrisCoool.
    Probably the cause was found.
    Currently, the maximum number of vertices that can be handled by one Render Deformer is 65535 or less.
    This is a limitation of MagicaCloth.
    Exceeding this value will cause problems with vertex painting.
    Can you check if the mesh in question has more than 65536 vertices?
     
  20. nekoneko777

    nekoneko777

    Joined:
    Sep 11, 2013
    Posts:
    33
    Hi Hoshos,

    I appreciate your constant updates on this plugin and I am trying to update from 1.6.0 to 1.7.2, but getting this compile error.
    Assets\MagicaCloth\Core\Physics\Manager\PhysicsManagerBoneData.cs(568,48): error CS1061: 'TransformAccess' does not contain a definition for 'localToWorldMatrix' and no accessible extension method 'localToWorldMatrix' accepting a first argument of type 'TransformAccess' could be found (are you missing a using directive or an assembly reference?)


    Could you help?
    My environment is,
    • Unity 2019.2.8f1
    • Magica Cloth v1.7.2
    • Jobs - version 0.1.1 preview
    • Burst 1.2.3
    • Unchecked "Allow 'unsafe' Code in the Player Settings.
    Thanks
     
  21. hoshos

    hoshos

    Joined:
    Mar 7, 2015
    Posts:
    246
    Hello.
    It turned out that localToWorldMatrix of TransformAccess class was added from Unity2019.2.14.
    This is my design mistake, sorry.
    In Unity2018, we are taking measures because we knew this fact.
    The solution is to update your Unity version to 2019.2.14 or above.
    Is it possible to upgrade?
     
  22. hoshos

    hoshos

    Joined:
    Mar 7, 2015
    Posts:
    246
    Update: 1.7.3

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

    Added option to merge Avatar colliders when attaching AvatarParts to Avatar.
    The offset coordinates of the collider can now be set.
    Fixed a fatal issue where vertices collapse.

    mergecollider-1.jpg

    sphere-collider-2.jpg

    Release Note:
    Added: You can now add colliders to the cloth component at runtime.
    Added: Added option to take over Avatar collider when connecting Avatar Parts to Avatar.
    Added: You can now set the offset position on the Collider component.
    Added: Added OnAttachParts and OnDetachParts events to Magica Avatar.
    Improvement: Animation control of BlendWeight is now possible.
    Improvement: [Adjust Rotation] of Spring component is always enabled and changed to the method to set the behavior according to the mode.
    Improvement: Fixed the problem that gizmo of MeshSpring and Collider was displayed even in unnecessary situations.
    Improvement: The control of PlayerLoop is exposed as an external function.
    Fix: Fixed an issue where mesh vertices would occasionally collapse when swapping multiple cloth components.
    Fix: Fixed the problem that a GUI error occurs when loading a preset in Unity 2019.4.
    Fix: Fixed the problem that an error occurs when a mesh with vertex weights is put into MeshRenderer and MeshCloth is set.
     
    Hobodi likes this.
  23. Acissathar

    Acissathar

    Joined:
    Jun 24, 2011
    Posts:
    581
    What is the use case for this, does it increase performance or something and/or modify the accuracy? For example, I have colliders on the hips, thighs, feet and head for mesh cloth collisions, would merging them do anything to affect that?
     
  24. nekoneko777

    nekoneko777

    Joined:
    Sep 11, 2013
    Posts:
    33
    hmm, at this moment, it's not possible to upgrade to Unity 2019.2.14 yet.
    In the meanwhile, I could use the older version.
    What's the best latest version I can use with 2019.2.8?
    (though I don't know how I can get the earlier version of the release)
     
  25. hoshos

    hoshos

    Joined:
    Mar 7, 2015
    Posts:
    246
    It has nothing to do with accuracy or performance.
    When attaching AvatarParts, there was a request to combine Avatar colliders, so I implemented it.
    Therefore, this is an option and can be turned off.
     
    Acissathar likes this.
  26. hoshos

    hoshos

    Joined:
    Mar 7, 2015
    Posts:
    246
    We apologize for the inconvenience.
    This issue will be resolved soon.
    However, in the meantime, I will put the download link for MagicaCloth 1.6.0 in your [InBox].
    (Is the version 1.6.0 good?)
    I think it's a problem that UnityAssetStore can't download older versions.
    Once the fix is complete, we will announce it on this forum.
     
  27. nekoneko777

    nekoneko777

    Joined:
    Sep 11, 2013
    Posts:
    33
    Understood. Thanks for the fix!!
    I am using 1.6.0 currently so I will hold off of upgrading until the fix is in!
     
  28. godrasetu

    godrasetu

    Joined:
    Sep 1, 2017
    Posts:
    3
    Hello,everybody
    I have a question about the animation of magica cloth. plz see the screenshot. that when the character play the sit animation, the cloth `s bone is not stay on the leg`s collider (It`s slide down of it ). So I want to know how to fix this problem. Thank `s very much.
     

    Attached Files:

  29. hoshos

    hoshos

    Joined:
    Mar 7, 2015
    Posts:
    246
    Hello.
    You're probably using BoneCloth.
    Long skirts are especially difficult, but try adjusting according to the following guides.

    (1) BoneCloth skirt
    https://magicasoft.jp/en/boneclothskirtguide-2/
    The important point here is to connect the sides of the bone with [Near Point] of [Restore Distance].
    This enhances collision detection.

    (2) Preventing penetration
    https://magicasoft.jp/en/prevent-penetration-2/
    This setting is especially important for skirts.
    This limits particles from moving in unintended directions.
     
  30. cherisechiao

    cherisechiao

    Joined:
    Jul 3, 2020
    Posts:
    1
    Thanks for your reply. The assets in our project are complex, considering the costs we can’t use Mesh Cloth mode. Bone Cloth is the only we can use in this Magica Cloth simulation system.

    We tried surface penetration and collider penetration, but it’s not working with Bone Cloth, the penetration problem still exists, as shown in pic below.

    图片1.png

    Also, we tried to increase the Friction but still didn’t work.

    图片2.png

    We hope to find a way to solve this problem base on the Bone Cloth simulation mode.

    Thanks.
     
  31. hoshos

    hoshos

    Joined:
    Mar 7, 2015
    Posts:
    246
    I've understood the situation.
    In this case, it seems best to use [Collider Penetratoin] with BoneCloth.
    Regarding [Collider Penetration], can you check if the particles are properly connected to each collider as shown in the image?
    This can be displayed by checking [Penetration] on the Cloth monitor.
    If this line is not connected properly, it will not work.
    pene-9.jpg
     
  32. batman2211

    batman2211

    Joined:
    Sep 16, 2017
    Posts:
    10
    Hi
    How can I change the parameters in code? Or can I replace parameter presets in code? Thanks. Awesome assets
     
  33. hoshos

    hoshos

    Joined:
    Mar 7, 2015
    Posts:
    246
    Hello.
    Some parameters can be changed programmatically by API.
    [Radius][Mass][Drag][Gravity] will be added in the next version.

    https://magicasoft.jp/en/basecloth-2/

    Loading presets at runtime is not yet supported.
    MagicaCloth is basically designed to create data in advance.
    Note that you can only make some adjustments to that parameter in Runtime.
     
  34. batman2211

    batman2211

    Joined:
    Sep 16, 2017
    Posts:
    10
    Hi, my character can move at a speed of 300m/s and 16m/s so it is vital for me to be able to change the "world influence" parameters, because if the character moves very fast then the cloth will be stuttering (I will have to decrease world influence to near 0). But at the moment I cant change that parameter in code? Looks like I'm in trouble :(
     
  35. hoshos

    hoshos

    Joined:
    Mar 7, 2015
    Posts:
    246
    Hello.
    Actually, the [World Influence] parameter has already been added to the API.
    I'm sorry, I didn't write it in the documentation yet.
    See BaseClothAPI.cs.
    This is the [World Influence Parameter access] part of this source code.
    As you say, it is best to lower [Movement Influence] of [World Influence] when moving at high speed.
     
    batman2211 likes this.
  36. godrasetu

    godrasetu

    Joined:
    Sep 1, 2017
    Posts:
    3
    Hello,Thank for you reply. We try to change the setting but it can not fix the issue, it has the same problem.(the skirt always penetrate the leg collider) .could you give us an Email address, so that we could sent the file to you , and you can find the solution for us .an other question about that ,we want to know if it can be set the bone penetrate line by myself,like the cyan line in the screenshot.
     

    Attached Files:

  37. hoshos

    hoshos

    Joined:
    Mar 7, 2015
    Posts:
    246
    We apologize for not being able to resolve the issue.
    Long skirts are difficult because they easily penetrate.

    Thank you for your suggestions.
    If possible, could you give me the offending model in the next support email?

    support@magicasoft.jp

    I want to solve this problem somehow for the future.

    [Addendum]
    Thank you for the sample model!
    I use this model to improve the problem of long skirts.
     
    Last edited: Jul 7, 2020
  38. hoshos

    hoshos

    Joined:
    Mar 7, 2015
    Posts:
    246
    Update: 1.7.4

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

    This time it is almost a bug fix.

    Release Note:
    Added: Added [Radius][Drag][Gravity][Mass] parameter API.
    Improvement: An error is displayed when the number of vertices of the mesh exceeds 65535. This is an existing limitation.
    Fix: Fixed the problem that an error occurs in Unity2019.1-2019.2.13 due to scaling processing.
     
  39. corjn

    corjn

    Joined:
    Feb 6, 2014
    Posts:
    149
    Hey @hoshos,

    It seems that magica cloth 1.7.4 in Unity 2019.3.15 is broken when used with physx.

    Repro : attach a rigidbody and sphere collider on Unity Chan root. Let it fall. It will not behave as it should : the mesh will flicker, then freeze back in the default skinned mesh position.

    In my project, I'm using a puppetmaster ragdoll going at high speed + magica cloth, that's why I noticed the issue. I tried a lot of different configuration but did not find anything to make it work.
    In my game, the issue is a bit different, as soon as the ragdoll moves, the cloth swollen up. I'm not having the issue when I only have the animator setup on my character, without the ragdoll. It makes me think the problem comes from an issue when using magica cloth + physx.

    Thanks in advance for your time.

    Edit : Hard to know where the problem comes from actually. I'm going to make 2 repros :

    -Make a puppetmaster ragdoll with Unity Chan
    -Make a standard ragdoll with Unity Chan.

    This should help debug, I'll let you know my results :)


    Edit 2 : I'm getting the issue with a standard ragdoll on Unity Chan. I only get the issue when either Penetration or Collider Collision is ticked (made a quick test with the hair tail, everything is working fine until I tick them)

    I'll make you a proper repro debug project tomorrow with a Unity chan ragdoll. So you can download it and see what's wrong.
     
    Last edited: Jul 7, 2020
  40. corjn

    corjn

    Joined:
    Feb 6, 2014
    Posts:
    149
    Hey @hoshos

    I just sent you a debug project on your support email "support@magicasoft.jp" via we transfer.

    Unzip the project, open it with Unity 2019.3.15. Open the scene "UnityChanClothSample" and hit play.
    You'll see that both the skirt and the hair tail are glitching with the ragdoll. (note that all the rigidbodies are setup in "interpolate", otherwise it's just worse)
    If you activate the animator on Unity Chan (cancelling the ragdoll), it will behave correctly.

    Edit : "If you activate the animator on Unity Chan and setup the "update mode" in "normal" (cancelling the ragdoll), it will behave correctly. "

    So there must be something wrong somewhere with physx + Magica Cloth.
     
    Last edited: Jul 8, 2020
  41. hoshos

    hoshos

    Joined:
    Mar 7, 2015
    Posts:
    246
    Hello.
    Thanks for the detailed report.
    I received the project in question from the support email and was able to reproduce the issue here as well.
    This is definitely a Magica Cloth + Physics issue.

    I would like to work on solving this problem from now on.
    However, we are currently working on some defects, so the actual investigation will be a little later.
    I'm sorry, please give me some time.

    We will notify you via email and forum when the results change.
     
    corjn likes this.
  42. corjn

    corjn

    Joined:
    Feb 6, 2014
    Posts:
    149
    Thanks for the support, and no worries there's no rush, I'm just starting the prototyping phase for a long term project, fancy clothes on my character can wait :)
     
    hoshos likes this.
  43. hoshos

    hoshos

    Joined:
    Mar 7, 2015
    Posts:
    246
    Announcement

    I think some people are worried about the progress of their work, so I summarized the problems and issues that I am currently experiencing.
    (This is different from the roadmap)
    https://magicasoft.jp/en/release-note-2/

    Calculate some constraint data at runtime instead of pre-calculated data.
    The problem that the next particle of Root grows unnecessarily when moving at high speed.
    The problem that long skirts with BoneCloth easily penetrate colliders.
    Problems that cannot be used with Ragdoll (problems with Physics).
    Ability to skip until the simulation settles.
    Vertex paint improvements.
    Angle restrictions for XYZ axes separately.
    Using Unity Collider.
    Separate settings for Collision and Penetration colliders.
    Ability to control [Create] process from script.
    In case of URP/HDRP, gizmo is not displayed in Scene wireframe drawing.


    The progress is slow, but I would like to solve each one.
     
  44. godrasetu

    godrasetu

    Joined:
    Sep 1, 2017
    Posts:
    3

    got,Look forward to the update arrival ~
     
  45. Davood_Kharmanzar

    Davood_Kharmanzar

    Joined:
    Sep 20, 2017
    Posts:
    388
    does exists video tutorial to howto setup existing skinned mesh character with their clothes??

    and seems that i can't save magica components inside prefab character after creating these??? [unity 2020.1]
    after dragging that prefab into the scene everything are gone!! :\
     
    Last edited: Jul 10, 2020
  46. hoshos

    hoshos

    Joined:
    Mar 7, 2015
    Posts:
    246
    Hello.
    There is no video tutorial, but the documentation has a setup guide.
    (Please select each guide from the menu)

    https://magicasoft.jp/en/setup-guide-2/

    Unity2020 is still in beta, but basically it should work.
    Can you tell me what you did to solve the problem?

    Example:
    (1) Import FBX
    (2) Drop the model into the scene
    (3) Added BoneCloth
    (4) Set up BoneCloth
    (5) Save the scene model as a prefab in Project
    ...Such.
     
  47. Davood_Kharmanzar

    Davood_Kharmanzar

    Joined:
    Sep 20, 2017
    Posts:
    388
    thanks for your reply ...
    ok ... done :]

    seems that this problem was happened due to the prefab serialization or data hash ??!!


    and i got these build errors with Magica Cloth: [unity 2020.1.0b15 + Burst 1.2.3]
    Capture.JPG
     
    Last edited: Jul 11, 2020
  48. Creiz

    Creiz

    Joined:
    Jun 6, 2017
    Posts:
    62
    @hoshos I'm interested in this. Many friends are recommending it to me, it looks like it's an amazing asset.

    Except I have one special use: I'm also using UMA as my avatar manager, which means my character is created procedurally at runtime.

    Do you support changing bones and resetting physics via code? Let's say I need to swap hairstyles, skirts, dresses, etc. and they all have their own bones which is separate from the main armature (UMA magically adds them when needed).
     
  49. hoshos

    hoshos

    Joined:
    Mar 7, 2015
    Posts:
    246
    Hello.
    I installed Unity2020.1.0b15 and tested the prefab save, but it didn't cause any issues.
    I'm still not sure why.
    Sorry to trouble you, but could you test the following?

    (1) Package version
    Please try the latest version of Package.
    Currently it looks like this:
    Jobs 0.2.10 preview-12
    Burst 1.3.3

    (2) Another model
    Can I test on a different model than the one that causes the problem?
    For example, what about the Unity Chan model included in the sample?

    (3) Other assets
    Does the project have other assets besides MagicaCloth?
    If so, what if you created a new project and imported only MagicaCloth?

    Thank you.
     
    Last edited: Jul 12, 2020
  50. hoshos

    hoshos

    Joined:
    Mar 7, 2015
    Posts:
    246
    Hello.
    Please understand that I haven't dealt with UMA, so I can't answer accurately.
    Probably it is difficult to use it with UMA.

    MagicaCloth does not support creating data at runtime.
    All data must be pre-created before execution.
    However, there is a [dress-up] mechanism to change clothes.

    https://magicasoft.jp/en/dress-up-start-2/

    By using this, it is possible to replace the clothes created in advance.
    Only this is currently possible.

    MagicaCloth has an evaluation version for testing.
    If you would like to test, please contact this forum, my [InBox] or one of the following support emails.

    support@magicasoft.jp

    Thank you.
     
    Last edited: Jul 12, 2020
unityunity