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
    Hello.
    Unfortunately there is currently no way to solve this cleanly.
    To solve this problem, you need a self-collision function as you pointed out.
    And the current MagicaCloth does not have a self-collision function.

    But there is also good news.
    I am currently developing MagicaCloth Ver2.0.
    In Ver2.0, the self-collision function will be available as standard.
    And it has already been implemented and tested.
    We may be able to release it as early as 2022, so please wait a little longer.
     
  2. hoshos

    hoshos

    Joined:
    Mar 7, 2015
    Posts:
    903
    athert likes this.
  3. Squiver

    Squiver

    Joined:
    Jan 22, 2022
    Posts:
    2
    Thank you so much for the quick and honest answer! It is alright, I will find a bone-based solution to the fabric for now, and look forward to maybe being able to go back and use magica cloth in the future when 2.0 is released!
     
    hoshos likes this.
  4. ccjay

    ccjay

    Joined:
    Mar 24, 2014
    Posts:
    20
    Can I suggest a better way of importing rigs / point selecting?

    It can be really annoying trying to get multiple bones into the Root List and for setting those bones as FixedPoints.
    Especially when doing this for many many different rigs.

    Otherwise, this tool is absolutely amazing. :eek:

    EDIT:

    NVM, You can click and drag entire lists of bones into the Array Component..

    If I find away to set all those imported bones as FixedPoints - This post can be ignored..
     
    Last edited: Sep 6, 2022
  5. hoshos

    hoshos

    Joined:
    Mar 7, 2015
    Posts:
    903
    Hello.
    If you want to fix or move all the points, you can press the [Fill] button.
    https://magicasoft.jp/en/magica-cloth-selection/
    does this help you?

    The vertex painting issue has been requested by many users.
    Therefore, we plan to greatly improve this problem in v2.0, which is currently being created.
    Check out the following Twitter post if you're interested.
    In v2.0 you will be able to paint with a brush like this.
    https://twitter.com/MagicaSoft/status/1563037663925796864
     
  6. ccjay

    ccjay

    Joined:
    Mar 24, 2014
    Posts:
    20
    Does the Fill apply to all points or only the ones that have been pulled into the array?

    I'll test when I get back from work.. and let you know. If Fill is only the points in the array then doing a FixedPoint fill would solve my issue.. but it looked like it was filling ALL bones, not just the ones I dragged over..

    I was surprised that the bones I drag over to the array don't all default to FixedPoint.. only the first one.. maybe a bug?

    --

    A Paint tool would be great.. although with bones close together it can cause issues too..

    What would be amazing is if I could select the bones by name on the object / in the array - then use "Fill Selected Bones".. or something.. or let me drag them into some kind of "Fill Array"...? Lol..
     
  7. hoshos

    hoshos

    Joined:
    Mar 7, 2015
    Posts:
    903
    BoneCloth takes in the Transform specified in the array and all Transforms below it as points.
    Then, only the top layer Transform specified in the array becomes a fixed point, and all others are marked as moving points.
    This is the current spec.
     
  8. ccjay

    ccjay

    Joined:
    Mar 24, 2014
    Posts:
    20
    This is not the behavior I am seeing.

    I am pulling in ~12 bones into the array. All of them then have child bones that hang off them.
    What's happening though is only one of the top points is becoming a fixedPoint, the rest are by default just Movepoints.. which means when I try to simulate, several bone chains have no FixedPoint and fall through the floor.

    I have to manually set all the imported bones as FixedPoints for their chains.

    What your describing is what I would expect to happen.

    I did eventually get everything working.. it was just very painful to have to set every FixedPoint manually. :eek:
     
    Last edited: Sep 7, 2022
  9. hoshos

    hoshos

    Joined:
    Mar 7, 2015
    Posts:
    903
    I just retested with the latest version, but no particular problems were found.
    The test simply sets 4 different Transforms to the array.
    In this case, the top layer of each Transform is automatically set as a fixed point as shown in the image.

    bonecloth_paint-1.jpg

    So the Transform hierarchy where the problem occurs may be some peculiar situation.
    If possible, could you provide an image showing the specified Transform hierarchy?
    (something like the image I attached this time)
     
  10. ccjay

    ccjay

    Joined:
    Mar 24, 2014
    Posts:
    20
    My layout is really not so different from what you posted..
    The only difference is that chains are of different size.

    Some Bones have 2 children or three.. One bone has zero children (In which case it should probably default to invalid.. but it's defaulting to MovePoint)

    I can try to take a picture.. but really.. it's not special.. just a bunch of 2 / 3 / 4 bone chains.. and I am only dragging the top bone(s) of each "chain" into the array.. same as your image.

    I should note, the child bones aren't always below their parent along the z axis, in the use case of a ponytail, the root bone was lower than it's immediate child.. Could that be an issue as well?

    I'm not sure how your FixedPoint logic works.. does it just set to the bones you drag into the array or is there more stuff going on?
     
  11. hoshos

    hoshos

    Joined:
    Mar 7, 2015
    Posts:
    903
    Fixed points are only marked for the transforms specified in the array.
    There are no particularly difficult algorithms.
    The child bone's position, scale, etc. are not affected on any axis.
    There are three possibilities.

    (1) Two Transforms completely overlap
    If two Transforms overlap at exactly the same position, points may render incorrectly.

    (2) Transform is registered in duplicate
    Transforms are marked by picking them up in order from the array.
    Therefore, if the same Transform is registered twice in the array, the initial setting may be incorrect.
    This means that after it was first marked as fixed, it can then be overwritten by a move.

    (3) When reusing BoneCloth once set
    After registering the Transform hierarchy once in the array and performing vertex painting, if you clear the array and register another Transform hierarchy, the point attributes will shift.
    This is because we are recording the point attributes we registered the first time, so they no longer fit into the new Transform hierarchy.

    Is there a possibility of (3)?
    I can't reproduce it here, so can you provide an image that shows the Transform hierarchy?
    Alternatively, it can be a character prefab with MagicaCloth set.
    In the case of a character, if you send it to my [InBox] etc., other people will not be able to see it.
     
  12. hoshos

    hoshos

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

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

    Release Note:
    Fixed: Fixed an issue in RestoreRotation in Algorithm 2 that caused an error when two particles overlapped at exactly the same coordinates.
    Fixed: Fixed an issue where external forces such as wind would become weaker at lower framerates.

    https://magicasoft.jp/en/release-note-2/
     
  13. hehedang

    hehedang

    Joined:
    Jun 16, 2017
    Posts:
    8
    Hello,author

    Nice package!But why it's too lag?Usually i can run 18 skirt using original unity cloth with 60 fps,but now after using this 4 will reduce my fps into 10,6 skirt just shutdown my unity.Any suggestions from you?

    Thank you!
     
  14. hoshos

    hoshos

    Joined:
    Mar 7, 2015
    Posts:
    903
    Hello.
    First, MagicaCloth is slower than UnityCloth.
    MagicaCloth is written in Burst, which is much faster than C#, but when using MeshCloth, it is slower because of the vertex skinning and the work required to reverse skin the simulation results and write them back to the mesh.
    Unfortunately, this problem has not been solved to date.
    There are three ideas to alleviate this problem.

    (1) Reduce the number of vertices
    The simulation load is proportional to the number of VirtualDeformer vertices.
    Therefore, when creating VirtualDeformer, the vertex reduction can be increased to make it lighter.
    This is a trade-off for quality, but the load is also reduced if the number of vertices is reduced.

    (2) Delayed Execution Option
    MagicaCloth has an option to run the simulation while it is being rendered.
    https://magicasoft.jp/en/magica-cloth-physics-manager-2/
    Enabling this option reduces the load considerably.
    However, delayed execution delays the result by one frame and may cause unexpected artifacts in some cases.

    (3) Use with UnityCloth
    MagicaCloth and UnityCloth can be used together.
    Therefore, if load is an issue, consider using UnityCloth.
     
  15. hoshos

    hoshos

    Joined:
    Mar 7, 2015
    Posts:
    903
  16. QbAnYtO

    QbAnYtO

    Joined:
    Dec 18, 2016
    Posts:
    222
    I have a question. i like my current setting. but I just want it to BOUNCE more (the hair is kind of of stiff) which is the parameter to adjust in order to make this change? I've tried for about 2 hours and NOTHING changes.
     
  17. hoshos

    hoshos

    Joined:
    Mar 7, 2015
    Posts:
    903
    Hello.
    Try lowering the [Drag] and [Restore Rotation] parameters.
    Lowering [Drag] lowers movement resistance and makes it harder for particles to stop.
    [Restore Rotation] is the force to restore to the original position, but if it is too high, the movement will be stiff.
    See the following manuals for details on each.
    https://magicasoft.jp/en/paramater-drag-2/
    https://magicasoft.jp/en/paramater-restore-rotation-2/

    There is also a method to adjust after setting easily using presets.
    https://magicasoft.jp/en/magica-cloth-preset-2/
     
  18. QbAnYtO

    QbAnYtO

    Joined:
    Dec 18, 2016
    Posts:
    222

    hmm..i see no differences. and if i use the presets, nothing either. am i supposed to restart unity after every change?
    I click "create after the changes but am i supposed to click "create" on the deformer as well?
     
  19. hoshos

    hoshos

    Joined:
    Mar 7, 2015
    Posts:
    903
    No, you don't need to rebuild VirtualDeformer.
    If you change presets, you should rebuild the cloth component.
     
  20. TheRebirth2393390183

    TheRebirth2393390183

    Joined:
    Jun 5, 2017
    Posts:
    8
    Hi! Do you ever plan on implementing MagicaBoxCollider, or an option for MagicaPlaneCollider to make it a finite plane?
    I'd like my characters to interact with environment with their MagicaColliders. I tried to place a few walls with MagicaPlaneColliders but unfortunately, it seems like MagicaCloth doesn't really like having 2 plane colliders in a scene, my cloths would just twitch like crazy.
     
  21. huanghonghong

    huanghonghong

    Joined:
    Jul 8, 2021
    Posts:
    6
    Hi! Whether to support scaling a certain axis, uniform scaling is fine, it is a bit strange to only scale a certain axis
    upload_2022-10-10_18-59-11.png upload_2022-10-10_19-2-4.png
     
  22. hoshos

    hoshos

    Joined:
    Mar 7, 2015
    Posts:
    903
    Hello.
    There are plans to add BoxCollider in the next version 2.0.
    However, we do not plan to interact with complex structures in the stage background.
    The MagicaCloth collider is designed for the human body.
     
  23. hoshos

    hoshos

    Joined:
    Mar 7, 2015
    Posts:
    903
    Hello.
    Unfortunately, MagicaCloth does not support unequal scales.
    The only exception is the XYZ uniaxial minus scale.
    For example (-1, 1, 1)
    This causes problems with such unequal scales.
     
  24. ejoflo

    ejoflo

    Joined:
    Sep 15, 2021
    Posts:
    39
    Can someone explain how the AddCollider() method works? I am unsure how to add MagicaSphereCollider to the MagicaMeshCloth Colliders List at runtime.
     
  25. ylche

    ylche

    Joined:
    Aug 30, 2022
    Posts:
    7
    I've got a prefab character with multiple hair options as separate meshes that I can set active/inactive. Each hair mesh has its own physics bones. What is the recommended setup, or is there no difference either way?

    Option A:
    Prefab Character
    -- Character Mesh
    -- Hair Mesh 1
    -- -- Magica Bone Cloth (Hair Mesh 1)
    -- Hair Mesh 2
    -- -- Magica Bone Cloth (Hair Mesh 2)

    Option B:
    Prefab Character
    -- Character Mesh
    -- Hair Mesh 1
    -- Hair Mesh 2
    -- Magica Bone Cloth (all hair meshes)
     
  26. hoshos

    hoshos

    Joined:
    Mar 7, 2015
    Posts:
    903
    Hello.
    You must use the API to add a collider at runtime.
    Adding it to the inspector list in the Unity editor has no effect.
    This API is the following AddCollider() / RemoveCollider().
    https://magicasoft.jp/en/basecloth-2/
     
  27. hoshos

    hoshos

    Joined:
    Mar 7, 2015
    Posts:
    903
    Hello.
    OptionA is recommended.
    Running two at the same time in one BoneCloth can be problematic later, especially since hair requires fine-tuning.
    It is best to use OptionA to switch between Hair1 and Hari2 active.
     
  28. ylche

    ylche

    Joined:
    Aug 30, 2022
    Posts:
    7
    Thanks!

    Also I've noticed just now that trying to set X/Y/Z offsets on a collider causes a NullReferenceException (I'm using v1.12.10). Not sure why.

    One other thing, you mentioned a few posts above that uniaxial scaling does not work properly, does rotation / translation work?
     
  29. hoshos

    hoshos

    Joined:
    Mar 7, 2015
    Posts:
    903
    NullReferenceException is the problem.
    I just tested it and there was no error here.
    If possible, could you paste the full text of the error here?

    No problem with rotation/translation.
     
  30. Rin-Dev

    Rin-Dev

    Joined:
    Jun 24, 2014
    Posts:
    574
    I was following the tutorial in the documentation to make my cape move. For some reason my cape will fall off my character. I don't know why this is happening.

    *Edit*
    I forgot to set fixed points in my cloth :oops: silly on my part.
     

    Attached Files:

    Last edited: Oct 18, 2022
    hoshos likes this.
  31. trueh

    trueh

    Joined:
    Nov 14, 2013
    Posts:
    74
    Hi there:

    I have an issue with MagicaCloth. It is working great in Unity's Editor (2021.3 LTS), but when I build the game it stops working. It behaves like if I had removed all colliders.

    See the bottom of the shirt in this video:


    Do you have any clue about what could be happening?

    Thank you.
     
  32. hoshos

    hoshos

    Joined:
    Mar 7, 2015
    Posts:
    903
    Hello.
    Sorry, I am not sure what the problem is just from watching the video.
    Is this a problem where the simulation stopped completely?
    Or did only the collision determination stop?
    If the simulation has stopped completely, please look into the following

    <Possible loss of PhyscisManager>
    A common problem is that the MagicaPhysicsManager component may have been lost during a scene transition.
    The manager is basically set to not disappear after a scene transition, but this setting only works if the component is at the top level of the scene.
    For example, if the manager is placed under another GameObject, it will disappear when the scene is moved.
    If the scene transition is different from the one in the editor when executing a build, you should be suspicious of this.
     
  33. GrassWhooper

    GrassWhooper

    Joined:
    Mar 25, 2016
    Posts:
    108
    hello there
    any idea how to prevent this clipping? i tried almost everything
    from increasing collider sizes to trying almost all presets and i keep getting similar results
    any ideas ?

    in the attachements you can see how i set up the character
     

    Attached Files:

    Last edited: Oct 21, 2022
  34. trueh

    trueh

    Joined:
    Nov 14, 2013
    Posts:
    74
    Thank you. You pointed me to the cause of the issue. PhysicsManager is under an empty object in the hierarchy. I am not doing scene transitions actually, but I am using multiple scenes because my development will have to use streaming. If I move PhysicsManager to the scene root it works.

    Now the question is how I am going to stream the level with this limitation, but that is a different issue...

    Thanks again.
     
  35. hoshos

    hoshos

    Joined:
    Mar 7, 2015
    Posts:
    903
    Hello.
    Try testing the anti-penetration feature.
    https://magicasoft.jp/en/prevent-penetration-2/
     
  36. hoshos

    hoshos

    Joined:
    Mar 7, 2015
    Posts:
    903
    I was relieved that the problem was resolved.
    We have received this PhysicsManager disappearing issue from many users.
    Therefore, PhysicsManager will disappear in Ver2.0 currently under development.
    So problems like this will not happen.
     
  37. ylche

    ylche

    Joined:
    Aug 30, 2022
    Posts:
    7
    My X/Y/Z offsets options look like this, instead of a scroll bar. Everything else seems to work fine.

    upload_2022-10-24_13-32-2.png

    When I click on any of the X/Y/Z options to try and set an offset, I get this error:

    upload_2022-10-24_13-33-13.png

    Doesn't seem to affect anything else. Rest of it works fine.
     
  38. hoshos

    hoshos

    Joined:
    Mar 7, 2015
    Posts:
    903
    This is not the usual inspector display.
    Why does it look like this?
    Do you have any special editor extension assets installed?
     
  39. ylche

    ylche

    Joined:
    Aug 30, 2022
    Posts:
    7
    Oh. I tried out Better UI a while ago, but never noticed it making any difference so I just assumed it didn't work. Then again, I'm only just starting out using Unity so maybe it changed it without me realising.
     
  40. hoshos

    hoshos

    Joined:
    Mar 7, 2015
    Posts:
    903
    This problem may be the compatibility between Better UI and MagicaCloth.
    A healthy inspector looks like the image.
    capsule-collider-2.jpg
    However, Better UI is a paid asset, so you can't easily check it here.
    If you don't need Better UI, try removing Better UI completely and displaying the inspector like the image.
    Another option is to start over with a new project.
     
  41. akent99

    akent99

    Joined:
    Jan 14, 2018
    Posts:
    588
    I bought v1 a long time back, but have not used it much (blush). I am using VRoid Studio characters imported via UniVRM https://github.com/vrm-c/UniVRM. Each time I change the character, I have to reimport and reapply all my customizations. I wrote a script for most of it, but got scared working out how to automatically convert the VRM spring bones and colliders etc to MagicaCloth. Has anyone written a VRM spring bone (for hair and cloth) to MagicaSoft converter script already?

    I am creating a simple cartoon on YouTube - nicer hair movements, especially for the characters with longer hair and dresses/skits, would be a bonus.
     
  42. unity_-hq4UQhLy-3SDA

    unity_-hq4UQhLy-3SDA

    Joined:
    Feb 6, 2021
    Posts:
    2
    Is it possible for me to get Magica working with entities in a DOTS 0.51 project? I saw that we could use the
    MAGICACLOTH_ECS define for something, but I'm not sure for what. I'm guessing that getting a magica bone cloth to work with an entity is not as simple as adding a magica bone cloth to a game object?
     
  43. hoshos

    hoshos

    Joined:
    Mar 7, 2015
    Posts:
    903
    Hello.
    Unfortunately, it is difficult to use MagicaCloth with VRM at present.
    This is because the VRM structure is incompatible with MagicaCloth data creation.
    Also, as far as I know, no automatic conversion tool from VRMSpringBone has been confirmed.
    However, this problem will be improved in the next Ver2.0.
    In Ver2.0, pre-data creation with the Create button is abolished, and everything is built at runtime.
    This makes it possible to apply MagicaCloth from scripts at runtime.
    Similarly, you should be able to script the conversion from VRMSpringBone to MagicaCloth collider.
     
    akent99 likes this.
  44. hoshos

    hoshos

    Joined:
    Mar 7, 2015
    Posts:
    903
    Hello.
    MAGICACLOTH_ECS is required when using Entity Component System in Unity2019.4.
    Therefore, it is not necessary to set in Unity2020 or later.
    Also, unfortunately there is no Entities version of MagicaCloth.
    It only works by attaching MagicaCloth components to GameObjects.
     
  45. the_unity_saga

    the_unity_saga

    Joined:
    Sep 17, 2016
    Posts:
    265
    hey, great work on this asset,

    but how do we instantiate new bone simulated cube example objects at runtime?

    when I do it, only the original in the sample animated using the scripts.


    is there guide for instantiate, and add or remove magica cloth physics to mesh at runtime?
     
  46. Wolvman92

    Wolvman92

    Joined:
    Oct 31, 2021
    Posts:
    12
    Hi,

    Can anyone tell me how to have the cloth of something loose like a cape flap up and down as long as the character it's attached to is moving forward quickly enough? I've been messing with drag and gravity and quite of few other things. So far I've got the cape to whip upwards at the beginning of a change in direction but then it quickly settles down and stops reacting to the continued movement. I'd like for it to subtly shake up and down until the character stops moving.
     
  47. hoshos

    hoshos

    Joined:
    Mar 7, 2015
    Posts:
    903
    Hello.
    A GameObject or Prefab that has MagicaCloth set up can be instantiated with Instantiate().
    If it doesn't work, it might be a bug.

    Unfortunately it is currently not possible to generate cloth components at runtime.
    However, I am currently creating Ver2.0.
    Ver2.0 can generate cloth components at runtime.
    Please wait a little longer until the release of Ver2.0.
     
    the_unity_saga likes this.
  48. hoshos

    hoshos

    Joined:
    Mar 7, 2015
    Posts:
    903
    Hello.
    Is the Influence Target of [World Influence] set to None?
    If it is None, try changing this to a Transform such as the waist.
    https://magicasoft.jp/en/paramater-world-influence-2/
     
  49. Kichang-Kim

    Kichang-Kim

    Joined:
    Oct 19, 2010
    Posts:
    1,008
    @hoshos Hi. It seems that Magica Cloth 1.12.10 does not work with Collections 2.1.0-pre.2. Do you have any plan to support Collections 2.1.x?
     
  50. hoshos

    hoshos

    Joined:
    Mar 7, 2015
    Posts:
    903
    Hello.
    I learned for the first time that an error occurs in ver2.x.
    Looking at the changelog, it looks like a lot has changed.
    Please be patient as this issue will be addressed in the near future.
     
    Kichang-Kim likes this.