Search Unity

[RELEASED] Magica Cloth

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

  1. hoshos

    hoshos

    Joined:
    Mar 7, 2015
    Posts:
    922
    There is no problem if FBX is separated.
    If the structure of the main body and the clothes are the same, replacement is possible.
    In the video example, the structure of the main body is an image (avatar-1).
    The body has only a skeleton.
    And the hair structure becomes an image (avatar-parts)
    When you add hair to the body, a blue block GameObject is transplanted along the body structure.
    These are all resolved by GameObject names, so the names of the basic structure of the body and parts must match.

    (avatar-1)


    (avatar-parts)
     
  2. DigitalAdam

    DigitalAdam

    Joined:
    Jul 18, 2007
    Posts:
    1,209
    Thanks for posting the screenshots. So my character mesh is fully skinned using a similar bone structure. So if I use the same rig as my character mesh for hair and clothes, I should be able to export each piece (hair, shirt, pants, etc.) out of Maya into an FBX, and your system will automatically assign those skinned meshes (hair, shirt, pants, etc.) to the correct bones at run-time. Does that sound right?

    From your screenshots it looks like "BodyAvatar" is only the rig, and "Avatar-Parts" is an example hair. Is your actual character mesh part of "BodyAvatar", or is that separate like your hair mesh and that's added to the rig at run-time as well?

    Thanks!
     
  3. Ukounu

    Ukounu

    Joined:
    Nov 2, 2019
    Posts:
    208
    Is there some easy fix to give colliders the highest priority (override all other settings)?

    I have been trying to make a realistic skirt animation, and I have to use "restore rotation" (around 0.2-0.3) in Magica Cloth to make skirt more "stiff" (otherwise it sways way too much during movement). But "restore rotation" interferes with leg colliders. When character sits or crouches, skirt goes through legs. If "restore rotation" is disabled (or set under 0.1) then leg collisions are handled correctly, but skirt sways and wobbles too much.

    Is it possible to set collisions to have higher priority than "restore rotation" (and everything else)?
     
  4. hoshos

    hoshos

    Joined:
    Mar 7, 2015
    Posts:
    922
    The first question is correct.
    The system merges skin meshes and GameObjects as needed.
    The second question is both possible.
    It is also possible to separate the body skin mesh into parts by using only the body as a skeleton.
    You can also separate only the hair into parts with the skin mesh of the body in the body.
    This system will probably be released within a few days.
    The documentation is already complete, so please refer to it if you like.

    https://magicasoft.jp/en/dress-up-start-2/
     
    DigitalAdam likes this.
  5. hoshos

    hoshos

    Joined:
    Mar 7, 2015
    Posts:
    922
    At the moment, collision detection has a higher priority than other constraints.
    Collision detection is a difficult problem and does not work perfectly.
    First, the value of [Restore Rotation] is between 0.2 and 0.3, but this is certainly too strong.
    Usually 0.01 or less is enough.

    It is said that it will shake greatly when moving, but the following method may be able to alleviate it.

    [World Influence]
    https://magicasoft.jp/en/paramater-world-influence-2/

    Lowering the Movement Influence value will make the particles hardly affect the movement of the Influence Target.
    Try this if you don't want your movement to be affected much.

    Is the skirt controlled by animation?
    In other words, does the animation change the skirt when sitting in a chair?
    If so, the "Keep Shape" flag in the "Collision" panel may be helpful.

    [Collision]
    https://magicasoft.jp/en/paramater-collider-collision-2/

    This flag assumes that the skirt is controlled by an animation.
    In this case, the penetration of particles can be greatly reduced.

    Remember to press the [Create] button to reflect the settings.
     
  6. Ukounu

    Ukounu

    Joined:
    Nov 2, 2019
    Posts:
    208
    Doesn't work, unfortunately. I have world influence disabled completely, and skirt is not controlled by animation.
    As long as character just walks and doesn't do any strong movements all collisions are handled correctly. But in some more difficult cases (like crouching) collisions fail and skirt penetrates into leg colliders.
    Checking "keep shape" flag has the same effect as increasing "restore rotation". It helps to decrease swaying/wobbling, but it also causes skirt to ignore leg colliders in some cases.
    The only way I found to avoid the leg/skirt clipping issue is to uncheck "keep shape" and reduce "restore rotation" below 0.1. But then skirt wobbles and sways like jello during movements (e.g., character turning around Y-axis) - completely unrealistic.

    I had the same problem in the past when experimenting with default Unity cloth, Obi cloth (and some other cloth simulation asset). They work fine for some limited cases, like hair tails, flags, etc. But if you want to make a realistic skirt that will never clip with legs, all of them fail. :(
     
    DragonSix likes this.
  7. hoshos

    hoshos

    Joined:
    Mar 7, 2015
    Posts:
    922
    There is one more item you want to test.
    Why don't you lower [Restore Rotation] and raise [Drag]?
    [Drag] is the air resistance. Increasing this value makes the movement softer.

    https://magicasoft.jp/en/paramater-drag-2/
     
  8. Ukounu

    Ukounu

    Joined:
    Nov 2, 2019
    Posts:
    208
    Yes, I experimented with drag (and all other available options), but it doesn't help. It decreases and slows down frequency of wobbling/swaying, but it doesn't decrease amplitude of swaying. Unless I increase "restore rotation", the skirt behaves like it's made of very thin paper that begins to sway from any slight movement.
    The only option that helps to achieve more stiff and realistic skirt is "restore rotation". That's why I asked if it's possible to give collisions the highest priority. The way it works now, "restore rotation" has higher priority and overrides collisions.
     
  9. hoshos

    hoshos

    Joined:
    Mar 7, 2015
    Posts:
    922
    I understand the problem.
    I think it is difficult to solve now.
    The problem is deeply rooted and a new collision system may need to be introduced to resolve it.
    I have some ideas, so I'd like to test it later.
    However, the implementation may probably take several months.
    I want some time.
     
  10. corjn

    corjn

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

    I just bought MagicaCloth, using unity 2019.3.4 everything works except the scenes with Unity Chan. If I read previous post here, you made a quick fix, could you send me the link please ?

    Thanks :)
     
  11. hoshos

    hoshos

    Joined:
    Mar 7, 2015
    Posts:
    922
    Hello, corjin.

    Could you please give me details about what is happening?
    Also, v1.4.0 has just been released.
    Does the bug occur even with the latest version?
     
  12. hoshos

    hoshos

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

    v1.4.0 has been released on the Asset Store!
    http://u3d.as/1Hzx
    Added Dress up system!



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

    Release Note:

    Feature: Added dress-up system (Avatar, AvatarParts).
    Feature: Teleport is turned off by default.
    Improvement: Reduced vibration caused by movement.
    Improvement: When creating a cloth component object, it is set to inherit the parent name.
    Fix: Fixed issue where MeshOptimizeMissmatch error would occur when loading from asset bundle.
    Fix: Fixed an issue where the scene view was not redrawn when painting vertices.
    Fix: Fixed an issue where writing transforms was not correct when adding / removing cloth components repeatedly.
    Fix: Fixed collider to correctly reflect transform scale.
    Fix: Fixed an issue where an error would occur if the main camera did not exist.
    Fix: Fixed an issue where data was not created when attaching a RenderDeformer with multiple renderers selected.
     
    Acissathar likes this.
  13. SenseDevil

    SenseDevil

    Joined:
    May 25, 2019
    Posts:
    5
    Thank you for your response!

    I have another question.

    What is the advantage of MagicaMeshCloth compared to Unity's build-in cloth?
    Does MagicaMeshCloth run faster than Unity's build-in cloth?
     
  14. hoshos

    hoshos

    Joined:
    Mar 7, 2015
    Posts:
    922
    Hello, SenseDevil.

    Because Unity Cloth is native code, performance is probably better with Unity Cloth.
    However, MagicaCloth has the following advantages:

    (1) Transform Cloth
    Magica Cloth has cloth simulation that works on Transforms such as Bone Cloth / Bone Spring.
    This is like a Dynamic Bone asset.

    (2) Merge and reduce mesh
    Cloth simulation can be performed by combining multiple meshes into one and further reducing vertices.
    This allows simulations to be performed without breaking the shape when the back and front of the skirt have separate meshes, or when the skirt has fine irregularities.

    (3) Fine parameters
    You can control much more detailed parameters than Unity Cloth.
    It is also possible to set different values for the parameters at the start and end points of the cloth.

    (4) Full source code
    Comes with all source code.
     
  15. SenseDevil

    SenseDevil

    Joined:
    May 25, 2019
    Posts:
    5
    I see. Thank you for your response.
     
  16. shangqm

    shangqm

    Joined:
    Feb 22, 2019
    Posts:
    4
    Hi,
    Sorry to bother you again.I have some new questions...
    1.Can I set parameters for each particle individually? Like MaxDistance in Unity Cloth.I think the Blend Weight in Magica Cloth correspond to the MaxDistance.Can I think so?
    2.My robe has big sleeves as following picture shows.They are always clipping when character walking.How to fix it?
    3.How to adjust the Stiffness? If I want a armor...
     

    Attached Files:

  17. hoshos

    hoshos

    Joined:
    Mar 7, 2015
    Posts:
    922
    Hello, shangqm.

    (1)
    The MaxDistance of Unity Cloth corresponds to the ClampPosition parameter of MagicaCloth.
    By setting this parameter, you can limit the distance that particles can move.
    https://magicasoft.jp/en/paramater-clamp-position-2/

    (2)
    If you want to keep the shape of complicated clothes, please turn on [Near Point] of RestoreDistance and create data.
    This helps to keep the shape of the garment.
    https://magicasoft.jp/en/paramater-restore-distance-2/

    If you are using MeshCloth, consider increasing the [Merge Vertex Distance] and [Merge Triangle Distance] of VirtualDeformer to lower the shape to a low polygon.
    The shape is stabilized by making VirtualDeformer a low polygon.

    (3)
    If you don't want the particles to move too much, try adjusting the following parameters:
    [Drag] .. Larger makes it harder to move
    [Max Velocity] ... Limits the maximum speed
    [Velocity Influcen] ... It is a sub parameter of each parameter. Lowering the value will reduce the effect of the parameter on speed.
     
  18. shangqm

    shangqm

    Joined:
    Feb 22, 2019
    Posts:
    4
    Thank you for your response! I will try and make a magical cloth with your asset!
     
  19. hoshos

    hoshos

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

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

    Release Note:
    Improvement: When creating a collider, it has been changed to adjust the collider scale from the parent scale.
    Fix: Fixed a problem where mesh was broken when SkinnedMeshRenderer and MeshRenderer were mixed using Unity2018.
    Fix: Fixed Capsule Collider gizmo not displaying correctly.
    Fix: Fixed an issue where cloth simulation was not running on frames with cloth components attached.
     
    one_one likes this.
  20. nekoneko777

    nekoneko777

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

    Thanks for the AvatarParts feature that was added to 1.4.0. it's working very well!

    This is not related to the Avatar but I am having an issue when adjusting the cloth parameter.
    The cloth is saved properly when I create the prefab first time and I do not see any error. It behaves well in game no problem.
    But when I open the prefab (prefab editing mode), adjusted the point selection, press "create" on the MagicaMeshCloth, Save changes to the prefab, I see errors when I go into the prefab editing mode again.
    Once this happens, I can no longer fix this prefab so I need to start over from re-creating a new prefab.
    Is there anything I am doing wrong?

    The error on the Magica Virtual Deformer
    This mesh data is Invalid!
    Please recreate the mesh data.
    Error (200) : MeshDataNull

    The error on the Magica Mesh Cloth
    This mesh cloth is in a state error!
    Please recreate the cloth data.
    Error (300) : ClothDataNull

    My unity version is 2019.2.8f1
    I can attach my cloth character if that helps.
    Thanks!
     
  21. Goatogrammetry

    Goatogrammetry

    Joined:
    Apr 27, 2017
    Posts:
    197
    magica_errors.png

    I followed the installation video's instructions, and even restarted Unity. What now?
     
  22. hoshos

    hoshos

    Joined:
    Mar 7, 2015
    Posts:
    922
    Thank you for your bug report.
    Let's investigate the cause.
    Thank you.
     
  23. hoshos

    hoshos

    Joined:
    Mar 7, 2015
    Posts:
    922
  24. Goatogrammetry

    Goatogrammetry

    Joined:
    Apr 27, 2017
    Posts:
    197
    magica_jobs.png

    As far as I know its installed and up to date. I'm not a coder so here's a shot.

    I'm going to try installing it in a fresh project and see what happens.
     
    Last edited: Mar 24, 2020
  25. hoshos

    hoshos

    Joined:
    Mar 7, 2015
    Posts:
    922
    Apparently there is a problem with [jobs-0.2.7].
    Change the [Jobs] package back to 0.2.5 or 0.2.6 and test.
    You can remove the [Jobs] package and install a previous version like the image.


     
  26. Goatogrammetry

    Goatogrammetry

    Joined:
    Apr 27, 2017
    Posts:
    197
    That worked. Thanks! So fast to help-- Thats impressive indeed. But Booooo to Unity.
     
    hoshos likes this.
  27. nekoneko777

    nekoneko777

    Joined:
    Sep 11, 2013
    Posts:
    45
    Hi Hosho,
    I posted my prefab package to your inbox. it would be great if you could take a look.
    Thanks!
     
  28. hoshos

    hoshos

    Joined:
    Mar 7, 2015
    Posts:
    922
    Thanks for the sample project!
    Please give me some time to investigate the problem.
    Thank you.
     
  29. vorokoi

    vorokoi

    Joined:
    Oct 18, 2019
    Posts:
    39
    Been using Magica Soft a lot and enjoying it, great stuff! I do have one issue I run into sometimes, where mesh cloth point selection stops working. Filling all points works, the simulation works, everything is fine without errors, except I cannot pick individual points. Sometimes this happens, sometimes it doesn't. I've tried various versions of Jobs/Burst and Unity, but can't seem to figure out why this point selection error happens. Any ideas?
     
  30. hoshos

    hoshos

    Joined:
    Mar 7, 2015
    Posts:
    922
    Hi, vorokoi.
    Thank you for reporting the bug.
    Is vertex selection performed in prefab mode?
    Currently, other users have reported that an error occurs when selecting vertices in prefab mode.
    This error is currently under investigation.
    You may be able to avoid this case by not using prefab mode.
    If not, do you know what steps would cause the error?
     
  31. vorokoi

    vorokoi

    Joined:
    Oct 18, 2019
    Posts:
    39
    Found it! It was not related to any particular versions of dependencies. I was not editing in prefab mode either. The bug happens when there are multiple Inspector windows open at the same time. Closing all Inspector windows and opening a new one restored point selection function.
     
  32. hoshos

    hoshos

    Joined:
    Mar 7, 2015
    Posts:
    922
    Thank you for the detailed steps.
    I was able to confirm the problem here!
    It will be included in the fix task for the next version.
    thank you very much.
     
    vorokoi likes this.
  33. Hazneliel

    Hazneliel

    Joined:
    Nov 14, 2013
    Posts:
    305
    Actually for me the problems was that Unity 2019 already had Collections prev 2 installed, I had to install prev 9 as is shown on your manual. That is working with Jobs 0.2.7
     
    hoshos likes this.
  34. nekoneko777

    nekoneko777

    Joined:
    Sep 11, 2013
    Posts:
    45
    Hi, hoshos, did you have chance to take a look at the attached package?
    For me, everytime when I modify the cloth setting in edit prefab mode, it breaks the prefab.
     
  35. Hazneliel

    Hazneliel

    Joined:
    Nov 14, 2013
    Posts:
    305
    I started playing with Magica, the simulation is good but is using much CPU, any idea to optimize this?

    I already optimized the MagicaVirtualDeformer and the reduced mesh only has 195 Vertex and 461 Triangles. Im not using any collider for now.


    [EDIT] I also tried to reduce the mesh to only have 47 vertex and 25 triangles but the improvement is minimum, I cannot get it to run under 1ms per frame it stays around 2

    I would appreciate any help on getting this to run efficiently.
    Thanks
     

    Attached Files:

    Last edited: Mar 30, 2020
  36. hoshos

    hoshos

    Joined:
    Mar 7, 2015
    Posts:
    922
    I'm sorry.
    We haven't seen any bugs because we're making major performance changes.
    We will respond with priority from now on.
    Please give me some time.
     
  37. hoshos

    hoshos

    Joined:
    Mar 7, 2015
    Posts:
    922
    The first thing to check is whether [Burst] compilation is enabled.
    Please make sure the Unity menu [Jobs]-> [Burst]-> [Enable Compilation] is checked.
     
  38. Hazneliel

    Hazneliel

    Joined:
    Nov 14, 2013
    Posts:
    305
    thanks, yes it is enabled.


    Any other guess?
     

    Attached Files:

  39. hoshos

    hoshos

    Joined:
    Mar 7, 2015
    Posts:
    922
    Thank you for confirmation.
    It certainly looks worse than expected.
    Can you answer the following questions because I want some information?

    (1) Execution environment
    PC / Mac or Android / iPhone?

    (2) Execution environment specifications
    Could you tell me the specifications of the execution environment?
    Windows10 / Mac Os ... etc
    Macbook Pro / Macbook Air / Gallaxy S10 / iPhoneX ... etc

    (3) CPU
    If you can check.
     
  40. Hazneliel

    Hazneliel

    Joined:
    Nov 14, 2013
    Posts:
    305

    NVIDIA Quadro P5000
    Unity 2019.3.6f1
    Jobs 0.2.7-preview.11
    Burst 1.2.3
    collections 0.0.9-preview.12

    note: Profiling on a standalone build is not that bad, still is taking ~1ms
     

    Attached Files:

    Last edited: Mar 31, 2020
  41. hoshos

    hoshos

    Joined:
    Mar 7, 2015
    Posts:
    922
    Thank you for your reply.
    Specifications are no problem at all.
    Let's sort out the situation.
    Unfortunately, I need to leave my seat, and I will reply again in 6,7 hours.
     
  42. hoshos

    hoshos

    Joined:
    Mar 7, 2015
    Posts:
    922
    Sorry I made you wait.
    At present, this number is correct for performance.
    There are three reasons.
    (1) MeshCloth deforms the virtual mesh, reverse skinning it to each mesh and writes it back, which is heavy processing
    (2) not yet fully tuned
    (3) Performance decreases when executed in editor

    Note that (3).
    JobSystem does not perform very well when running in the editor.
    This is about twice as fast when built.
    For (1) and (2), we want to tune in stages.

    Already next v1.5.0 will increase performance by 20-30%.
    Also, if performance is paramount, there will be a delay execution system at 1.5.0.
    This is an option to perform the cross simulation during rendering, which will speed up the performance to the current x1.5 to x2.0.
    However, keep in mind that the calculation is delayed by one frame.
    v1.5.0 will probably be released in about two weeks.

    Please contact me if you want to test v1.5.0 right away.
    We will send you a download link for the evaluation version.
     
  43. Hazneliel

    Hazneliel

    Joined:
    Nov 14, 2013
    Posts:
    305
    Thanks, if this numbers are correct and I'm only using 1 mesh for this profiling, I don't think this will scale well when having a scene with multiple meshes even on a standalone build.
    Performance should be top priority here specially since the description says "high-speed cloth simulation operated by Unity Job" which makes us understand this is faster than Unity Cloth.

    I will contact you for the evaluation version of 1.5.0
    Thank you for looking into this.
     
    Last edited: Mar 31, 2020
  44. hoshos

    hoshos

    Joined:
    Mar 7, 2015
    Posts:
    922
    Thank you for your feedback.
    We still have room for improvement in performance, so we ’ll be adjusting it in stages.
    I wanted to send you an evaluation version of 1.5.0, but for some reason [Start a Conversation] could not be selected.
    Please contact support@magicasoft.jp if necessary.
     
  45. DigitalAdam

    DigitalAdam

    Joined:
    Jul 18, 2007
    Posts:
    1,209
    Just checking in on this. Thanks!
     
    hoshos likes this.
  46. hoshos

    hoshos

    Joined:
    Mar 7, 2015
    Posts:
    922
    Hi, adamz!
    We are currently working on improving performance, and after that we will make a few modifications to the collision detection.
    The next function is to grab the cloth.
    It will probably take another month.
    When ready, announce in the forum.
    Please wait for a while.
     
  47. Quang_Phan

    Quang_Phan

    Joined:
    Dec 28, 2016
    Posts:
    17
    Hi,
    I try Magica Cloth with Unity version 2019, and try with Direction wind but in console get 999+ errors:
    "
    NullReferenceException: Object reference not set to an instance of an object
    MagicaCloth.MagicaDirectionalWindGizmoDrawer.DrawGizmo (MagicaCloth.MagicaDirectionalWind scr, System.Boolean selected) (at Assets/MagicaCloth/Core/Physics/WindComponent/Editor/MagicaDirectionalWindGizmoDrawer.cs:27)
    MagicaCloth.MagicaDirectionalWindGizmoDrawer.DrawGizmo (MagicaCloth.MagicaDirectionalWind scr, UnityEditor.GizmoType gizmoType) (at Assets/MagicaCloth/Core/Physics/WindComponent/Editor/MagicaDirectionalWindGizmoDrawer.cs:22)
    UnityEngine.GUIUtility:processEvent(Int32, IntPtr)"

    I installed :
    Burst 1.1.2
    Collextions 0.0.9
    Jobs 0.1.1
    Desktop Screenshot 2020.04.01 - 20.10.22.60.png
    I'm not a coder, could you help me solve this issue?
     
  48. hoshos

    hoshos

    Joined:
    Mar 7, 2015
    Posts:
    922
    Hello.
    Thank you for your report.
    Investigation revealed a problem with the gizmo display.
    This will be fixed in the next version as soon as possible.
    In a hurry, the error disappears by displaying the cloth monitor as follows.

    https://magicasoft.jp/en/magica-cloth-cloth-monitor-2/

    Until the bug is fixed, please work while displaying the cloth monitor.
     
  49. Quang_Phan

    Quang_Phan

    Joined:
    Dec 28, 2016
    Posts:
    17
    Thank you for information!
     
  50. Quang_Phan

    Quang_Phan

    Joined:
    Dec 28, 2016
    Posts:
    17
    Btw, how can I hide sprites on character, I can't see my character to edit textures and materials Desktop Screenshot 2020.04.01 - 20.10.22.60.png