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. hoshos

    hoshos

    Joined:
    Mar 7, 2015
    Posts:
    903
    Hi, Acissathar!
    Probably not a problem.
    MagicaCloth works in a way that mixes with the bone animation.
    If you are worried, there is an evaluation version, so please test it.
    I will send you an evaluation download link to your Inbox.
    Of course, you don't have to download it if you don't need it.
     
    Acissathar likes this.
  2. Acissathar

    Acissathar

    Joined:
    Jun 24, 2011
    Posts:
    677
    Thank you for the evaluation!

    I was able to set this up in about 5 minutes (minus a quick error ;) ) and I love it. So much easier, and only needing a single component to handle all of the bones instead of a single component per bone as in Dynamic Bone makes this a slam dunk for me. Definitely picking up the release version tonight!

     
    hoshos likes this.
  3. songjiekun

    songjiekun

    Joined:
    Jan 21, 2017
    Posts:
    29
    @hoshos
    i am checking your document.
    1.i noticed that this system only has sphere collider component and capsule collider component. why there is no box collider component? what if i want to make hair collide with wall or floor which have flat surface. and obviously plane collider has no size is infinite so can not be used for wall.
    any solution for this?

    2.how is the performance for collision?

    3. can i get collision event for collision between "magic cloth" with "magic collider component"?

    4.can i get collision event for collision between "magic cloth" with "magic cloth"?
     
  4. hoshos

    hoshos

    Joined:
    Mar 7, 2015
    Posts:
    903
    Hello, songjiekun!

    1. There is currently no collider linked to the object of the world
    Magica Cloth colliders are designed to be used on the hands and feet of the target character.
    Therefore, it is not intended for use on world terrain or walls.
    This is the same design as Dynamic Bone.
    Box colliders will be added in the future.

    2. Good if less than 10 per component
    MagicaCloth colliders can be set separately for each cloth component, not for the entire world.
    For this reason, collision detection is also processed for each cloth component.
    This increases in load in proportion to the number of colliders and the number of particles, but good performance is achieved with less than 10 colliders per component.

    3. Currently not supported

    4. Currently not supported
     
  5. thegooglyman5

    thegooglyman5

    Joined:
    Jan 14, 2020
    Posts:
    1
    @hoshos

    Is there a way to save Cloth settings to a prefab and add via script? I have characters that have different pieces of clothing that I attach via script. For example changing a shirt and skirt for a dress. Can Magica interact with items which are not currently loaded into the scene?
     
  6. hoshos

    hoshos

    Joined:
    Mar 7, 2015
    Posts:
    903
    Hi, thegooglyman5.
    Unfortunately, it is not currently supported.
    Currently possible implementation is to set multiple clothes in advance on the character (prefab) and switch it on / off.
    However, I believe that fulfilling this request is absolutely necessary.
    We promise to add some kind of dress-up system in future version upgrades.
     
  7. Hazneliel

    Hazneliel

    Joined:
    Nov 14, 2013
    Posts:
    305
    Hello, this asset looks interesting. Is it possible to use it to implement soft body physics on breast?
     
  8. hoshos

    hoshos

    Joined:
    Mar 7, 2015
    Posts:
    903
    Hello, Hazneliel!
    The true soft body is not yet implemented.
    However, there is a request and I am interested in implementing the soft body because I am interested.
    It is called Volume Constraint and expresses realistic shaking by expanding and contracting volume.
    It may be a bit ahead, but I will try this implementation.
     
    songjiekun and Hazneliel like this.
  9. XCO

    XCO

    Joined:
    Nov 17, 2012
    Posts:
    379
    Hello, any news on when this might be avil on 2018.4 or higher HDRP ? :)
     
  10. hoshos

    hoshos

    Joined:
    Mar 7, 2015
    Posts:
    903
    Hi, XCO!
    MagicaCloth already works with Unity2018.4.0 (LTS) or higher.
    Supported in v1.1.0.
    Also works well with URP(LWRP) and HDRP.
     
    XCO likes this.
  11. hoshos

    hoshos

    Joined:
    Mar 7, 2015
    Posts:
    903
    UPDATE: v1.2.0

    v1.2.0 has been released on the Asset Store!
    http://u3d.as/1Hzx
    Added Distance Disable!:)
    Simulation can be disabled according to distance.


    Document:
    https://magicasoft.jp/en/distance-disable-2/

    Release Note:
    Feature: Added blending function with original posture (Blend Weight).
    Feature: Added the function to disable simulation by distance (Distance Disable).
    Feature: Added a sample scene for distance disable function (DistanceDisableSample).
    Improvement: Added scrollbar to cloth monitor.
    Improvement: Data can be created even if the mesh has no UV value.
    Improvement: Enhanced error handling.
    Fix: Fixed slow playback bug. Time.timeScale works correctly.
    Fix: Fixed an issue where an error occurred when duplicating a prefab with [Ctrl+D].
    Fix: Fixed an issue where trying to create data without vertex painting would result in an error.
     
    XCO and vorokoi like this.
  12. hoshos

    hoshos

    Joined:
    Mar 7, 2015
    Posts:
    903
    YouTube.
     
    one_one, XCO and vorokoi like this.
  13. DigitalAdam

    DigitalAdam

    Joined:
    Jul 18, 2007
    Posts:
    1,202
    @hoshos
    This looks interesting. Will this be possible to work on the Oculus Quest? If so, would it be possible to add hand collides and interact with a tablecloth, being able to lift the cloth and see what's under the table for example?
     
  14. EricVenn

    EricVenn

    Joined:
    Nov 10, 2016
    Posts:
    23
    Hello ! I am very interested by your asset. I'm using Ubi cloth, but it does not fit my needs. For a character generator system, I need a way to adapt cloth mesh objects on different skinned mesh characters shapes ( I think that there are already other people asking for that). In brief, at runtime the cloth must fall naturally on a character (if you know Marvelous Designer you can understand what I mean). You said you were interested by this feature. When do you think you can implement it ? My project is on progress and I have to know if it will be available in 2 weeks... or one year. I would be very pleased if If you can send me a link to download an evaluation version. And good luck for your asset that seems promising !
     
  15. hoshos

    hoshos

    Joined:
    Mar 7, 2015
    Posts:
    903
    Hi, adamz!
    Yes. Works well with Oculus Quest.
    A global collider is available for hand-to-cloth contact.
    There is no cloth gripping function yet, but it is currently under development.
    It will be implemented in v1.5.0.
    I have sent a download link to the evaluation version to your inbox.
    Please test if you like.
     
  16. hoshos

    hoshos

    Joined:
    Mar 7, 2015
    Posts:
    903
    HI, EricVenn!
    I'm not familiar with Marvelous Designer and I don't know if it fits your needs.
    Therefore, we will provide you with an evaluation version.
    Send the download link to your inbox.
    Please try to evaluate if you use it.
     
  17. EricVenn

    EricVenn

    Joined:
    Nov 10, 2016
    Posts:
    23
    T
    Thank you for your answer, but I have talk about Marvelous as an example, because it's the reference for cloth design and real time cloth display. You should watch a video in YouTube to see how a cloth adapt itself on a virtual manikin, with realistic wrinkles.
    But you did not answer to my question."We need a solution to fit different clothes (mesh or skinned mesh) on different skinned mesh characters, at RUNTIME." Is it possible with your technology ? If yes, will you develop that feature, and how much time will you need ?.
     
  18. hoshos

    hoshos

    Joined:
    Mar 7, 2015
    Posts:
    903
    I have two answers because English is not my native language and it may not be possible to fully understand your question.

    (1) Advanced cloth simulation
    I studied a bit about Mavelous Designer.
    If you want each vertex of the cloth to hit each and every one of your character's polygons, there is currently no implementation that does that.
    This requires implementing a dedicated mesh collider.
    Even if implemented, the current schedule requires about six months.
    MagicaCloth is designed for casual models such as games, rather than for advanced cloth simulation applications.

    (2) About changing clothes
    We are currently developing a system for changing the costumes created separately for characters.
    This implementation will be completed as soon as two weeks later.
     
    EricVenn likes this.
  19. hoshos

    hoshos

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

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



    Document:
    https://magicasoft.jp/en/wind-start-2/

    Release Note:
    [Feature] Added wind function (Wind).
    [Feature] Added wind sample scene (WindSample).
    [Improvement] Changed cloth team preprocessing from C # to JobSystem.
     
  20. EricVenn

    EricVenn

    Joined:
    Nov 10, 2016
    Posts:
    23
    Thanks ! We'll consider buying the next version with the changing clothes feature.
     
  21. DigitalAdam

    DigitalAdam

    Joined:
    Jul 18, 2007
    Posts:
    1,202
    I look forward to this! Any idea on the release date?
     
  22. hoshos

    hoshos

    Joined:
    Mar 7, 2015
    Posts:
    903
    The situation has changed slightly, and we are proceeding with the next roadmap based on the number of requests.
    [v1.4.0] Dress up system (Mid-March)
    [v1.5.0] Performance tuning (End of March)
    [v1.6.0] Cloth grabbing system (April)

    Therefore, it will be implemented at the beginning of April.
    Of course, it will be implemented sooner depending on the work progress.
     
    robertirribarren likes this.
  23. DigitalAdam

    DigitalAdam

    Joined:
    Jul 18, 2007
    Posts:
    1,202
    Sounds good, thanks.
     
  24. DigitalAdam

    DigitalAdam

    Joined:
    Jul 18, 2007
    Posts:
    1,202
    @hoshos

    Just picked this up and installed in using Unity 2019.3.3f1, and I'm getting all these errors:
     

    Attached Files:

  25. hoshos

    hoshos

    Joined:
    Mar 7, 2015
    Posts:
    903
    Probably the [JobSystem] [Burst Compiler] package does not seem to be installed.
    The installation procedure is described in the following document.
    Check out this procedure.
    https://magicasoft.jp/en/magica-cloth-install-2/

    Do you still get an error?
     
  26. DigitalAdam

    DigitalAdam

    Joined:
    Jul 18, 2007
    Posts:
    1,202
    Thanks for your help. Everything is working now.
     
    kobayashiryuki1002 and hoshos like this.
  27. nekoneko777

    nekoneko777

    Joined:
    Sep 11, 2013
    Posts:
    45
    Hi, I purchased this plugin and enjoy using it now.
    I set up a character prefab and it works very nicely when I load the prefab from the project, but it returns error when I load the prefab from an asset bundle.
    The error says,

    "This mesh data is Invalid!"
    "Execution stopped!"
    Error (1500) : MeshOptimizeMismatch

    Is there any tips that I should be aware of when using with asset bundle?
    Thanks!
     
  28. hoshos

    hoshos

    Joined:
    Mar 7, 2015
    Posts:
    903
    Hello, nekoneko777!
    Thank you for contacting us.
    It may be an asset bundle specific issue.
    I was not testing asset bundles.
    Give me some time, I'll investigate.
     
  29. hoshos

    hoshos

    Joined:
    Mar 7, 2015
    Posts:
    903
    I have two questions.

    (1) Unity version
    What is your Unity version?

    (2) Adressables package
    Does the asset bundle use the Adressables package?

    Thank you.
     
  30. hoshos

    hoshos

    Joined:
    Mar 7, 2015
    Posts:
    903
    I found the problem.
    It was referencing the mesh's [Optimize Mesh] flag while running in the editor.
    This flag is an error because it is lost in the asset bundle.
    This issue will be fixed in the next release, but in the meantime we have created v1.3.1 interim.
    Send download link to your inbox.
    Could you test with this version?
    We apologize for any inconvenience.

    <To everyone>
    If you have the same problem, please contact me.
    We will send you the download link for v1.3.1.
     
  31. nekoneko777

    nekoneko777

    Joined:
    Sep 11, 2013
    Posts:
    45
    Thanks so much for the quick reply and quick solution!
    I will try out the interim package and let you know!
     
  32. nekoneko777

    nekoneko777

    Joined:
    Sep 11, 2013
    Posts:
    45
    I tested the v1.3.1 and it works with asset bundle in editor.
    It works on devices (iOS, Android) too.
    btw, I was not answering your questions.
    - I am NOT using addressable.
    - Unity 2019.2.8f1.

    Thank you very much, hoshos!
     
  33. hoshos

    hoshos

    Joined:
    Mar 7, 2015
    Posts:
    903
    Thank you for the test!
    This fix will be included in the next v1.4.0.
    I have tested on the addressables system, so using addressables should work fine.
    Thank you for your cooperation.
     
  34. Ukounu

    Ukounu

    Joined:
    Nov 2, 2019
    Posts:
    208


    Hello, I bought your asset today, but encountered a problem. I added a capsule collider, rigidbody, and a simple movement script implementing Rigidbody.AddForce in Fixed Update to move UnityChan. There is big shaking/jitter with all Magica Cloth components. Please check the video (recorded with VSync off, approximately 400 FPS).

    I also experimented with setting transform.position directly in Update to move character (without Rigidbody), and there is still the same problem.

    Additional observations: If I activate V-Sync to limit the game to 60 FPS, there is no continuous shaking, but instead approximately once per second there is one big "shake".
    If I change update mode in "MagicaPhysicsManager" from "unscaled" to "once per frame", the shaking is reduced slightly, but still is clearly visible.

    How this issue can be solved?
    Unity version 2018.4.18f1
     
    Last edited: Mar 4, 2020
  35. hoshos

    hoshos

    Joined:
    Mar 7, 2015
    Posts:
    903
    Hello, Ukounu.
    I checked the video.
    And it turned out that there was a problem with movement with Rigidbody + AddForce ().
    I apologize for the bug.
    I want to work on solving this problem.
    Can't I get the project shown in the video?
    I want you to attach it to [Inbox] with a Zip or download link.

    However, moving with Update () without using Rigidbody did not cause any problems.
    The code in Update () I tested looks like this:


    using UnityEngine;

    public class KeyMove : MonoBehaviour
    {
    void Start()
    {
    }

    void Update()
    {
    // foward, back
    float speed = 3.0f * Time.deltaTime;
    Vector3 dir = Vector3.zero;
    if (Input.GetKey(KeyCode.UpArrow))
    dir = Vector3.forward;
    if (Input.GetKey(KeyCode.DownArrow))
    dir = Vector3.back;
    transform.Translate(dir * speed, Space.Self);

    // left, right rotation
    float rotspeed = 360.0f * Time.deltaTime;
    if (Input.GetKey(KeyCode.LeftArrow))
    transform.Rotate(new Vector3(0.0f, -rotspeed, 0.0f), Space.Self);
    if (Input.GetKey(KeyCode.RightArrow))
    transform.Rotate(new Vector3(0.0f, rotspeed, 0.0f), Space.Self);
    }
    }


    Thank you.
     
  36. Ukounu

    Ukounu

    Joined:
    Nov 2, 2019
    Posts:
    208


    No. I created a new blank project, imported your asset and required packages, then attached KeyMove.cs with your code to unitychan (animation component is disabled). The result is on the video. There is clearly visible and strong shaking during movement.

    EDIT: I sent you a download link for test project in PM, even though it's not really necessary. It's just a blank project with your asset and KeyMove.cs script added.
     
    Last edited: Mar 4, 2020
  37. hoshos

    hoshos

    Joined:
    Mar 7, 2015
    Posts:
    903
    Thanks for the test project data.
    We're working on a fix from today, but there seems to be a problem with the system timesteps.
    This is likely to take some time to fix.
    Sorry, please give me a little time.
    We will report on the forum when the correction is completed.
     
  38. hoshos

    hoshos

    Joined:
    Mar 7, 2015
    Posts:
    903
    Correction is completed.
    First, apologize for my lack of testing.
    This was due to a difference in position due to the difference between the number of screen updates (fps) and the number of updates of the MagicaCloth physics engine.
    To avoid this problem, we have incorporated a new time schedule system for future prediction.
    This version is v1.3.2.
    We will send a download link to your [inbox].
    Can you test with this version?

    However, there are some caveats.

    (1) UnscaledTime mode
    Everything works fine, but there is a slight vibration.

    (2) OncePerFrame mode
    This mode assumes that the FPS of the game is fixed.
    Therefore, it is assumed that time control such as movement uses a fixed time without using Time.deltaTime.
    (60fps = 0.016666f etc.).
    This works fine in this case.

    (3) FixedUpdate is not supported
    Currently, only movement with Update () is supported for movement.
    Moving with FixedUpdate () works, but can cause unintended behavior.
     
    Last edited: Mar 6, 2020
  39. nekoneko777

    nekoneko777

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

    Do you mind sending me 1.3.2 as well?
    I think I’m seeing the similar issue when running in the timeline + cinemachine.
    I would let you know if the jitter is gone for my case with 1.3.2 or not.

    Thanks!
     
  40. hoshos

    hoshos

    Joined:
    Mar 7, 2015
    Posts:
    903
    Hello, nekoneko777!
    thank you for contacting me.
    Posted the download link of MagicaCloth v1.3.2 to your [inbox].
    Thank you.
     
  41. Ukounu

    Ukounu

    Joined:
    Nov 2, 2019
    Posts:
    208
    Definitely better than before, but still there are issues of various severity in all combinations of VSync on/off and unscaled/once per frame modes. Which means there is no way to use it without some visible bugs and issues.

    Unscaled mode, VSync OFF: jitter of breasts


    Unscaled mode, VSync ON: jitter of breasts


    Once per frame, VSync OFF: jitter of all Magica Cloth components


    Once per frame, VSync ON: jitter of all Magica Cloth components. At first it looks like the movement is smooth, but this is only because the jitter happens once per 6 seconds. The sudden jitter bumps are clearly visible at 00:06, 00:12, 00:19. So enforcing FPS limit doesn't solve the problem.


    I hope you can fix these issues.
     
  42. hoshos

    hoshos

    Joined:
    Mar 7, 2015
    Posts:
    903
    Thank you for the detailed video.

    Unfortunately, it is difficult to suppress any further vibration in [UnscaledTime] mode.
    This is due to the difference between the screen FPS and the update frame rate of MagicaCloth.
    By setting [Movement Influence] in the [World Influence] panel to 0.0 as an option, it is possible to ignore the effect of movement.

    In [OncePerFrame] mode, using a fixed frame rate and deltaTime for movement is quite stable.
    The video example uses 0.016666f for the deltaTime of the move at 60FPS.
    (Time.deltaTime is not used)



    We apologize for not completely resolving this issue.
    I will continue to study and improve cloth simulation.
     
  43. Ukounu

    Ukounu

    Joined:
    Nov 2, 2019
    Posts:
    208
    Not true. Fixed framerate+OncePerFrame doesn't resolve the issue in any way, it just makes the problem less obvious by increasing periods of time between each jitter. I have demonstrated the result already in my video #4. The jitter does happen, but due to FPS limit it happens with fixed intervals of several seconds, instead of all the time. Depending on hardware, these intervals can be shorter or longer. On my PC they happen with intervals of 6-7 seconds (max 400-450 FPS / VSync 60 = 6-7 seconds). On a more powerful PC these intervals would be longer. The only reason why it's not shown in your video is you (intentionally, perhaps?) limiting it to 10 seconds. If the video was longer, these jitter "bumps" at fixed intervals of time would start to appear, too.

    But you know all of that already, don't you? If something is working in Unity with fixed framerate, it ALWAYS can work exactly the same with any other framerate - either by using Time.deltaTime, or by calculating frame intervals manually and applying them on top of code that works already with fixed framerate. Since you didn't apply that easy fix, that means you know already that fixed framerate doesn't solve anything, and the only thing it does is stretching intervals between each jitter.

    That's an interesting idea, and this certainly eliminates all jitter altogether. The only downside of this solution is that clothes and hair don't animate at all during movement. After some additional experiments I found out yet another equally ingenious solution: by deleting all Magica Cloth components, it's possible to resolve all jitter issues completely. ;)

    I have an idea for a practical solution, though: in real life, most of cloth/hair animation during movement is caused by air resistance. Since you have a solution for wind already, and it doesn't have jitter issues (at least I didn't notice any thus far), maybe it's better not to apply movement directly, but instead simulate movement animation by applying wind opposite to movement direction. You can calculate movement on X/Y/Z axis and then apply wind on corresponding axis, with wind force depending on movement speed.
     
    Last edited: Mar 6, 2020
  44. hoshos

    hoshos

    Joined:
    Mar 7, 2015
    Posts:
    903
    Thank you for your comment.

    I understand the vibration of [OncePerFrame].
    It may just not have been noticed on my PC.
    Certainly [OncePerFrame] is not very suitable for games.
    [OncePerFrame] may be removed in the future.

    There is only one explanation for [World Influence].
    This feature limits the amount of component movement that can be applied to particles and does not affect local animation.
    Therefore, even if it is set to 0.0f, the cloth / hair will shake due to animation.

    The idea of [Wind] is original.
    I feel that the movement becomes better by giving the wind accompanying the movement from the front.
    Thank you for the idea!
     
  45. SenseDevil

    SenseDevil

    Joined:
    May 25, 2019
    Posts:
    5
    Hi,

    I want to integrate MagicaBoneCloth with UMA. So I need to create a MagicaBoneCloth at runtime (not in the editor mode). Is it possible to do that? If it is possible, how to do that?
     
  46. hoshos

    hoshos

    Joined:
    Mar 7, 2015
    Posts:
    903
    Hello, SenseDevil!

    Unfortunately, there is currently no way to build MagicaCloth at runtime.
    There are no plans for a future roadmap at this time.
    However, we are developing a function to add pre-made parts (clothing / hair, etc.) at runtime.
    Leave a link to the video for this system.



    This system allows you to add clothing at runtime.
    This feature will be coming in the next v1.4.0 and will probably be released next week.
     
  47. shangqm

    shangqm

    Joined:
    Feb 22, 2019
    Posts:
    4
    This asset is really great,ths for your work!
    But I still have a question.Can I use this asset to solve the collision between clothes? Now,I don't seem to have noticed this function in MagicaCloth.
    My character is wearing a skirt and a robe.Their collision works terrible in Unity Cloth.
    So,I hope for MagicaCloth can solve this problem.Will you add this function in future versions?
    Thank you very much!
     
  48. hoshos

    hoshos

    Joined:
    Mar 7, 2015
    Posts:
    903
    Hello, shangqm!

    As you point out, the conflict between clothing has not yet been implemented.
    We recognize that this issue is important.
    Therefore, we want to implement it in a future version.
    However, it takes a little time for difficult processing.
    Perhaps it could be about six months ahead.
    At that time we will announce in the forum.
     
  49. nekoneko777

    nekoneko777

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

    Thanks for the link to 1.3.2.
    The cloth jitters issue is definitely improved for when it's played within timeline + cinemachine, or manually updated camera. I understand the limitations and I can easily work around.

    Also, I am interested in the "cloth attach" feature that's coming in with v1.4.0.
    I will definitely try out the new attach feature. thanks
     
    hoshos likes this.
  50. DigitalAdam

    DigitalAdam

    Joined:
    Jul 18, 2007
    Posts:
    1,202
    This is awesome! Just wondering on how you're adding pre-made parts (hair and clothing) to the scene. Are you exporting all you hair/clothing meshes as well as the character model into one FBX, or is everything separate?