Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

[RELEASED] Magica Cloth

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

  1. jssys523

    jssys523

    Joined:
    Feb 11, 2018
    Posts:
    3
    Hi.I create the Bone cloth and Sphere Collider,It works. The Sphere Collider show the sphere wire in the scene. But when I select the bone cloth gameobject can not see the bone cloth sphere wire in the scene. I try to change the bone cloth radius.It does exist and make a difference. But cannot see the sphere wire.
     

    Attached Files:

  2. nathanjams

    nathanjams

    Joined:
    Jul 27, 2016
    Posts:
    304
    Hey,

    If I want to have a rug on the ground that bends with the terrain, would Magica Cloth be a good way to do this, or would it be overkill?

    If it is, you mind explaining how I would go about it?

    Thank you,
    Nathan
     
  3. hoshos

    hoshos

    Joined:
    Mar 7, 2015
    Posts:
    903
    Hello.
    You need to open the Cloth Monitor if you want to view the various gizmos of your MagicaCloth.
    Please test according to the following documents:

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

    hoshos

    Joined:
    Mar 7, 2015
    Posts:
    903
    Hello.
    Unfortunately MagicaCloth's collision detection only supports local space within your character.
    Therefore, it cannot interact with the world's ground or the walls of buildings.
    This is the same implementation as Dynamic Bone.
     
    nathanjams likes this.
  5. jssys523

    jssys523

    Joined:
    Feb 11, 2018
    Posts:
    3
    Thank you. The bone cloth sphere wire showed.
     
    hoshos likes this.
  6. davidgbarnes_inertialframes

    davidgbarnes_inertialframes

    Joined:
    Sep 15, 2017
    Posts:
    8
    Hi there folks. Looking for any ideas on a "dress up" system I'm building. Basically, I have a G8F figure exported from DAZ3d which is rigged and animating fine. I have managed now to export e.g. a G8F dress, with the same rig, and I can copy (reference) the bones from the G8F figure gameobject, to have the dress animate (very stiffly!) with the character. That referencing is done with a script just like the one here:

    https://answers.unity.com/questions/1435587/is-it-possible-to-update-a-skinned-mesh-renderers.html

    which is a tidied version of the script here:

    https://answers.unity.com/questions/44355/shared-skeleton-and-animation-state.html

    This works nicely as I can export other clothes to use interchangeably on my character.

    BUT as soon as I set up Magica Mesh Cloth, my rig reference copy is lost, and the animated character goes dancing off as expected but the dress stays in place, with the bodice not moving (as expected since I marked those vertices as "invalid", and the length of the dress dangling and swaying side to side like on a hanger.

    I must be so close, but perhaps my bone referencing is incompatible with the way Magica is working.

    I would love some suggestions, or assistance. Thank y'all and stay safe!

    David.
     
  7. hoshos

    hoshos

    Joined:
    Mar 7, 2015
    Posts:
    903
    Hello.
    MagicaCloth already has a dress-up system.

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

    MagicaCloth's dressing system will automatically replace the SkinnedMeshRenderer's bones with the body's bones.
    Have you tried testing this feature?
     
  8. nekoneko777

    nekoneko777

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

    I am encountering one issue.
    I have a costume FBX exported from 3dsmax, imported into Unity.
    In the FBX importer setting, I set the "Tangent" to "Import", because I did not want Unity to modify the vertex count.
    But with this setting, Magica Virtual Deformer returns error,
    This mesh data is Invalid! Please recreate the mesh data. Error (100) : InvalidDataHash.
    So I changed the "Tangent" to something else, then this error goes away.

    This is problem for us because we are planning to copy UV from one to the other, I need vertex count to be identical between those costumes, and setting "Tangent" to "Import" is the only way I can do.
    I would appreciate any suggestion/solution.

    Thanks
     
  9. hoshos

    hoshos

    Joined:
    Mar 7, 2015
    Posts:
    903
    Hello.
    Please wait a moment as we will investigate.
     
  10. nekoneko777

    nekoneko777

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

    I think I found out why.
    In the FBX exporter in 3dsmax, "Tangents and Binormal" flag is off by default.
    Therefore when I import it in Unity, if I set the "Tangents" to "import", there is no tangents information to import, therefore the tangents array was detected as 0 length and cloth creation failed internally. (I did not check the console but it was saying the array length don’t match)

    I think It works this way. thanks for looking into.
     
  11. Jaimi

    Jaimi

    Joined:
    Jan 10, 2009
    Posts:
    6,203
    Does this behave correctly when bones are non-uniformly scaled? (Unity cloth does not).
     
  12. hoshos

    hoshos

    Joined:
    Mar 7, 2015
    Posts:
    903
    Hello.
    It's probably okay because it is calculated.
    We will send the evaluation version to your [InBox] so that you can test it before purchasing.
    Please experiment if you like.
     
  13. davidgbarnes_inertialframes

    davidgbarnes_inertialframes

    Joined:
    Sep 15, 2017
    Posts:
    8
    Yes thank you very much for the suggestion. I have actually got my method working. But I will also try the MagicaCloth version for dress up. Thank you.
     
  14. davidgbarnes_inertialframes

    davidgbarnes_inertialframes

    Joined:
    Sep 15, 2017
    Posts:
    8
    I have the situation that in the space of one animation frame (let's say motion captured at 60fps), my character's leg moves far enough (it's a ballet kick) that it immediately intersects part of the dress and looks like it is going through a hole in the fabric which does not exist. Then of course moving slower it drags the dress around with it because normal cloth physics can't "undo" this.

    If I could interpolate the mocap within the unity animation system to run at e.g. 600fps, and have the cloth simulation running at that rate too, then the leg would move much less in each computed simulation frame, and I would avoid this penetration problem. The computation should be no problem as I don't do much else in this particular scene. I still only need to draw at 30/60 fps.

    Is there a way to do this with MagicaCloth?

    Thank you :)

    ps. I have my dress-up system working, there was a reason I needed to do my own rather than rely on MagicaCloth's inbuilt capability.
     
  15. hoshos

    hoshos

    Joined:
    Mar 7, 2015
    Posts:
    903
    Hello.
    Thank you for the detailed report.
    I was able to confirm the problem here as well.
    I'll try the repair work from now on.
    We will let you know in the forum once the results are known.
     
    Last edited: Jul 19, 2020
  16. hoshos

    hoshos

    Joined:
    Mar 7, 2015
    Posts:
    903
    Hello.
    I tried to fix this problem.
    I have sent the modified version (1.7.5.a4) to your [InBox].
    I would be happy if you could test it.
     
  17. hoshos

    hoshos

    Joined:
    Mar 7, 2015
    Posts:
    903
    Hello.
    MagicaCloth updates like other physics systems at different times than the frame rate.
    This can be changed by [Update Per Second] of Physica Manager.
    (Default is 90)

    https://magicasoft.jp/en/magica-cloth-physics-manager-2/

    MagicaCloth can also be operated at a maximum of 180 (update / s).
    However, CPU power is required.

    If you want to replace the bones yourself, the following API will help.

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

    public void ReplaceComponentBone(Dictionary<Transform, Transform> boneReplaceDict);


    This allows you to manually swap the bones that your MagicaCloth references.
     
  18. nekoneko777

    nekoneko777

    Joined:
    Sep 11, 2013
    Posts:
    45
    Hi
    Thanks for the quick support. I would love y too try out, however, my unity version is 2019.2.8 so I was holding off on updating the Magica cloth from 1.6.0 to the latest. Does the attached version 1.7.5a4 already covers the localToWorldMatrix compile error for my version of Unity?
     
  19. hoshos

    hoshos

    Joined:
    Mar 7, 2015
    Posts:
    903
    Hello.
    No problem, localToWorldMatrix has been fixed.
    Just remember to back up your project just in case before updating.
     
  20. Acissathar

    Acissathar

    Joined:
    Jun 24, 2011
    Posts:
    677
    What is the best way to handle cloth when timescale = 0? This is what I currently see:


    Changing the physics manager to Once Per Frame "fixes" it, but that's marked as soon to be deprecated and also seems like overkill when it's just an idle animation.
     
  21. hoshos

    hoshos

    Joined:
    Mar 7, 2015
    Posts:
    903
    Unfortunately, this is currently a feature.
    Since the [Unscaled Time] update is calculated from Time.deltaTime, setting timeScale to 0 will also set deltaTime to 0 and the simulation will stop.
    This is just like any other Unity component (Animator or ParticleSystem).
    In the video, the animation works even when the timeScale is 0. Is this because the animation update is set to [AnimatePhysics]?
     
    Acissathar likes this.
  22. Acissathar

    Acissathar

    Joined:
    Jun 24, 2011
    Posts:
    677
    Yes, during this section it does switch to Animate Physics, but then goes back to normal. Would hooking into the Magica Physics Manager to change to Once Per Frame during this time (and then switch back) work out okay, or is there an issue with switching back and forth constantly during runtime? The only issue I can think of is once it gets deprecated, but I can stay on an older version if necessary.
     
  23. hoshos

    hoshos

    Joined:
    Mar 7, 2015
    Posts:
    903
    It is safe to switch between [Unscaled Time] and [Once Per Frame] during execution.
    [Once Per Frame] is deprecated because it causes vibration if the frame rate is not stable.
    If the frame rate is stable, I don't think the behavior is a concern.
    Please be assured that it will not be deleted for a while.
     
    Acissathar likes this.
  24. Acissathar

    Acissathar

    Joined:
    Jun 24, 2011
    Posts:
    677
    It's working perfectly now, thank you!
     
    hoshos likes this.
  25. MoYing

    MoYing

    Joined:
    Dec 24, 2013
    Posts:
    8
    upload_2020-7-23_16-17-41.png
    Hello, I have recently encountered this kind of double-layer or multi-layer model fabric when making physical fabrics for clothing. In the start point selection mode, selecting red, gray, and green points can easily lead to a mistake in selecting points or selecting points to the skin. This caused me a lot of confusion. And using the mouse to select points one by one feels a bit inefficient. Does the official have other operations that can improve efficiency
     
  26. hoshos

    hoshos

    Joined:
    Mar 7, 2015
    Posts:
    903
    Hello.
    Unfortunately there is currently no other way.
    We apologize for the difficulty of using vertex paint.
    This issue has been received by many users.
    In the future we plan to implement at least the same paint system as Unity Cloth.
     
  27. hoshos

    hoshos

    Joined:
    Mar 7, 2015
    Posts:
    903
    Update: 1.7.5

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

    It has a function to stabilize the simulation by limiting the maximum moving speed when moving at high speed.
    This limit is for internal calculations only.
    maxspeed-1.jpg

    Also, a parameter has been added to mitigate the problem of particles bouncing on reset.
    stabilization-1.jpg

    stabilization-1.gif

    Release Note:
    Added: Added maximum speed setting to [World Influence]. The simulation is stable when moving at high speed.
    Added: Added a parameter [Stabilization Time After Reset] that improves the problem of particles bouncing on reset.
    Improvement: Reduced particle vibration due to collision detection.
    Improvement: The accuracy of collision detection has been slightly improved.
    Fix: Fixed issue where global colliders would bounce away particles when moved/rotated at high speed.
    Fix: Fixed the problem that a bone grows when moving at high speed.
    Fix: It was fixed because there was a mistake in the interpolation processing of fixed particles.
    Fix: Fixed that the bar did not turn yellow even if some parameters of spring setting were changed.
    Fix: Fixed the issue that an error occurs in RenderDeformer when there is no tangent data in the mesh.
    Fix: Fixed the problem that it doesn't work when used together with Cubism SDK (Live2D). (However, Unity 2019.3 and above)
    Fix: Fixed the problem that an error occurs in Jobs 0.4.0 package (Unity2020.1).

    https://magicasoft.jp/en/release-note-2/
     
    Hobodi likes this.
  28. MikeMnD

    MikeMnD

    Joined:
    Jan 17, 2014
    Posts:
    13
  29. hoshos

    hoshos

    Joined:
    Mar 7, 2015
    Posts:
    903
    Hello.
    I saw a movie.
    Probably possible, but honestly not suitable for this kind of use.
    MagicaCloth is designed to shake the character's hair and clothing.
    This is the same series as [Dynamic Bone].

    Performance is slightly slower than Unity Cloth.
    The main reason for this is that UnityCloth is written natively, while MagicaCloth runs in C# (Burst).

    If you need an evaluation version of MagicaCloth, please contact us at the following email address:

    support@magicasoft.jp
     
  30. MikeMnD

    MikeMnD

    Joined:
    Jan 17, 2014
    Posts:
    13
    Ok tnx, I found another asset that says it was made exactly for nets and should support it.
    So thank you for the quick reply.
     
    hoshos likes this.
  31. batman2211

    batman2211

    Joined:
    Sep 16, 2017
    Posts:
    10
    Hello my game build with ill2cpp the cloth is not working. It works fine with mono though. Is ill2cpp not supported or I am missing something? thanks
     
  32. batman2211

    batman2211

    Joined:
    Sep 16, 2017
    Posts:
    10
    Can you tell me what the asset is, I'm also want to make a football game in the future and I will need the net
     
    MikeMnD likes this.
  33. hoshos

    hoshos

    Joined:
    Mar 7, 2015
    Posts:
    903
    Hello.
    IL2CPP also works without problems.
    At least tested on Windows/Android/iOS.
    There are two possible causes that do not work.
    (This is for programmers)

    (1) Uses ECS
    (2) PlayerLoop is customized

    Which one are you using?
     
  34. DigitalAdam

    DigitalAdam

    Joined:
    Jul 18, 2007
    Posts:
    1,202
    @hoshos Hi, any update on the cloth grabbing system we spoke about before?
     
    ObiOneStenobi likes this.
  35. TheRaccoon94

    TheRaccoon94

    Joined:
    Apr 21, 2015
    Posts:
    1
    Hi, I've bought the asset and I can't even use it, because when imported it gives me 2 errors regarding the 2 NativeMultiHashMap scripts. Any ideas on how to fix this?
     

    Attached Files:

  36. hoshos

    hoshos

    Joined:
    Mar 7, 2015
    Posts:
    903
    Hello.
    I'm sorry, the gripping system seems to take a little longer.
    Currently, priority is given to fixing the reported defects rather than new features.
    Currently, we are fixing the problem of Z minus scale in 2D system.
    After that I will see issues with Penetration and collisions.
    The grab system is likely to come next.
    I'm sorry it took time.
    However, we will definitely implement it.
     
    ObiOneStenobi likes this.
  37. hoshos

    hoshos

    Joined:
    Mar 7, 2015
    Posts:
    903
    Hello.
    Thank you for contacting me.
    Perhaps the [Jobs] and [Burst] packages are outdated.
    Try installing the latest versions of [Jobs] and [Burst] from Package Manager.
     
  38. DigitalAdam

    DigitalAdam

    Joined:
    Jul 18, 2007
    Posts:
    1,202
    No problem. Thanks for the update.
     
    hoshos likes this.
  39. luffystrong

    luffystrong

    Joined:
    Jul 31, 2020
    Posts:
    2
    when I create urp project, the magica cloth gizmo's color turn to black in wireframe mode,why?
     
  40. hoshos

    hoshos

    Joined:
    Mar 7, 2015
    Posts:
    903
    Hello.
    We apologize for the inconvenience.
    We are aware of this as a known issue.
    I thought for a while that the gizmo wasn't displayed in URP/HDRP wireframe mode was a Unity bug.
    However, it seems to be a specification because it will not be cured forever.
    You need to rewrite all gizmo drawings to solve it.
    I'm putting it off because I can't afford it now, but I'd like to do that somewhere in the future.
     
  41. Hobodi

    Hobodi

    Joined:
    Dec 30, 2017
    Posts:
    101
    Hi, hoshos! I want to ask you don't throw off [Once per frame] mode, because it's faster mode right now, also a little fix with point size selector will be good, to have point more than 0.1 size.

    Btw. Still hope that it will be work with standard colliders, standard wind and particle system force field to create amazing things.

    Thank you. :)
     
  42. hoshos

    hoshos

    Joined:
    Mar 7, 2015
    Posts:
    903
    Hello.
    I received the same request from other users, so I decided to keep [Once per Frame] mode forever.
    rest assured.
     
    Hobodi likes this.
  43. Jerreldulay

    Jerreldulay

    Joined:
    Jul 17, 2013
    Posts:
    3
    Hello! Thanks for this amazing tool. I'm having an issue using Magica Cloth on Nintendo Switch. It works perfectly fine only on the very first scene that uses Magica Cloth. When I change to another scene, all cloths are stretched and distorted to a huge amount. Each time I change the scene again, the distortions get worse. I've tried changing and adjusting all kinds of settings with no change in behavior. Can you please advise? Is Magica Cloth just not compatible with Nintendo Switch? I can record and email video if it helps. I'm submitting my next game to Nintendo soon and had to disable all the cloths in the game, but I'd very much like to be able to fix the issue and enable those magic cloth objects in the game. Thank you very much.
    Jerrel
     
  44. hoshos

    hoshos

    Joined:
    Mar 7, 2015
    Posts:
    903
    Hello.
    MagicaCloth should also work on Nintendo Switch.
    Some users are already working on it.
    However, since I do not have a Nintendo Switch, I cannot confirm the operation under the present circumstances.
    (I requested development equipment, but it was rejected)
    I want to fix this problem seriously.
    Would you please give me a video if possible?
    For future support, I would appreciate it at the following email address.

    support@magicasoft.jp
     
  45. local306

    local306

    Joined:
    Feb 28, 2016
    Posts:
    155
    @hoshos I picked up the asset this evening and I am quite enjoying it. Easy to use and the results are great!

    I do have a question though where there is any way to create our own proxy meshes or whether that is something planned for future updates? I feel like I would have much better control creating my own proxy versus leaving it up to an algorithm (which does a good job, but I'd prefer to configure it by hand if possible)
     
  46. hoshos

    hoshos

    Joined:
    Mar 7, 2015
    Posts:
    903
    Hello.
    I think this is possible.
    However, it is not currently included in the roadmap.
    For reference, what kind of problem is occurring in the current Virtual Deformer (Proxy Mesh)?
     
  47. witchthewicked222

    witchthewicked222

    Joined:
    Jun 14, 2020
    Posts:
    3
    When i add a gameobject by directly instantiating it during runtime, the magica bone cloth component does not scan for magica colliders on the gameobject that its held on,

    I was expecting it to scan upwards the tree for example

    root-->hip-->spine-->...-->neck-->head (magica hair attached here on runtime)

    it would then go up the heirarchy and grab the magicacapsulecollider i placed on the neck/spine/back etc.

    What actually happens is, nothing. it doesnt detect the colliders.

    I saw you have a method called AddCollider in the baseclass of MagicaBoneCloth, i was tempted to just call that after i instantiated it, perhaps this is a possible workaround.'

    EDIT: What i really want is, I click on the ALL SELECT on the magica bone cloth hair and it works with the new colliders it finds during runtime

    EDIT2: Great job on the max velocity parameter. This fixed the twitching hair, on my fast moving character. Thank you alot!!!!!
     
    Last edited: Aug 9, 2020
  48. local306

    local306

    Joined:
    Feb 28, 2016
    Posts:
    155
    There isn't a problem per se, but the resultant mesh can sometimes collapse in areas as it thins out topology. For example, my main character meshes are ~16K polygons. Trying to reduce this through the automated process to something reasonable usually collapses the arms and legs into single verts at points.

    Or another example is with hair models with lots of hair cards can create messy proxy meshes, where I could probably create a very lightweight proxy by hand that matches the overall silhouette more accurately.

    I do also have another question as well since last posting: In regards to performance / efficiency, is it best to have a single Virtual Deformer for all mesh objects of a character i.e.) skin, hair, clothes, etc., or is it alright to use a Virtual Deformer per object? Currently experimenting at the moment and I have a Virtual Deformer for the body which then uses several Mesh Spring components for various parts, and then another Virtual Deformer for the hair and clothes that use multiple Mesh Cloth components.
     
    Quang_Phan likes this.
  49. DGordon

    DGordon

    Joined:
    Dec 8, 2013
    Posts:
    648
    A few questions:

    Does this work in HDRP?

    How big of a performance hit is this? For an isometric style strategy game (imagine X-Com view) which has multiple units on screen, could I get away with using this for any casters wearing robes, or will this degrade performance horribly with only a couple of people on screen?

    I'm trying to find a way to have the bottom hem of casters robes actually react properly, instead of looking like stretched out fake stuff :).
     
  50. hoshos

    hoshos

    Joined:
    Mar 7, 2015
    Posts:
    903
    Hello.
    Currently, the only colliders applied to the Cloth component are those in the ColliderList at design time.
    This is because, on the contrary, if you add a collider automatically, some users will be in trouble.
    Therefore, you need to use AddCollider() API to add a collider at runtime.
    This example is a bit tedious, but I would like you to use AddCollider().
    I added the maximum speed because it is suitable for the game.
    Thank you for using it.