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:
    438
    Hello.
    Unfortunately, it is currently not possible to change the collider parameters at runtime.
    We have not implemented this as an API because there have been no requests for it.
    However, we will add the API in the next version as we believe this feature is absolutely necessary.

    If you are in a hurry, you can temporarily change the source code as follows.
    If you change the Radius, Length, etc. of a collider, you need to call the contents of the OnValidate() function of each collider.
    This can be found in MagicaSphereCollider.cs / MagicaCapsulCollider.cs / MagicaPlaneCollider.cs.
    As an example, in MagicaSphereCollider.cs, this is the part shown in the image.

    collider-refresh-1.jpg

    However, OnValidate() cannot be called as-is, so you need to prepare a public function that copies its contents and call it.
    We apologize for the inconvenience, but please try this method for a while.
     
  2. OldBard

    OldBard

    Joined:
    Nov 24, 2010
    Posts:
    3
    Hi, I have a question.

    I've been using the DressUp system in my current project and it is working amazingly well, but I've been getting lots of warnings when I attach the parts.
    What I did was to have the Avatar with only the structure used in animation and the Parts with that same structure and the specific meshes used there. Is that wrong? Should I remove other parts of the structure which are not related to the mesh?

    Or can I just ignore this warning?

    Here is a warning example:


    Warning (20001) : AddOverlappingTransform [Elbow_L]
    UnityEngine.Debug:LogWarning (object)
    MagicaCloth.MagicaAvatarRuntime:AddBone (UnityEngine.Transform,UnityEngine.Transform,UnityEngine.Transform) (at Assets/Plugins/MagicaCloth/Scripts/Core/Avatar/MagicaAvatarRuntime.cs:329


    Thanks,
    OldBard
     
  3. WILEz1975

    WILEz1975

    Joined:
    Mar 23, 2013
    Posts:
    356
    Is there a method from script to clear all fixed points at runtime?

    Like
    MagicaMeshCloth.SetAllToMovePoints();

    In my case, I have a bridle in the hands of a character. The fixed points are in the hand. When the character leaves the bridle, I wish the bridle falls to the ground.
     
    Last edited: Apr 30, 2021
  4. hoshos

    hoshos

    Joined:
    Mar 7, 2015
    Posts:
    438
    Hello.
    Your idea is correct.
    This warning is displayed when there are multiple GameObjects with the same name in Avatar or Avatar Parts.
    In this case, it seems that there are multiple GameObjects named [Elbow_L].
    In the dress-up system, the Transform to be attached is determined from the name, so if there are multiple objects with the same name, it is not possible to determine which one to attach to.
    Therefore, this warning is displayed.
    Is the following warning message displayed on Avatar or AvatarParts?

    avatar-6.jpg

    In that case, it is better to rename the object with the same name in the prefab.
    However, this is a warning, so if the game seems to be working well, you can safely ignore it.
    See below for all guides.
    https://magicasoft.jp/en/dress-up-start-2/
     
  5. hoshos

    hoshos

    Joined:
    Mar 7, 2015
    Posts:
    438
    Hello.
    Unfortunately, there is no way to change the fixation/movement of the particles while running.
    MagicaCloth essentially builds all the data at design time, so changes at runtime are not really expected.
     
  6. hoshos

    hoshos

    Joined:
    Mar 7, 2015
    Posts:
    438
    Update: 1.9.5

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

    An issue that caused subassets in the prefab to multiply has been fixed.
    If the subassets have already proliferated, pressing the [Create] button again will delete the unwanted subassets.

    Release Note:
    Added: API for changing collider parameters.
    Improvement: Changed the maximum radius of particles from 0.1 to 0.3.
    Improvement: Cleaned up useless internal processing. Slightly improved processing speed.
    Fix: Fixed an issue where subassets in the prefab would multiply depending on the situation.

    https://magicasoft.jp/en/release-note-2/
     
  7. bthanse

    bthanse

    Joined:
    Jun 24, 2019
    Posts:
    88
    Have some problems with colliders I think ? 3 of them in this scene. Hair does not what is natural. When model is upside down, how to get the hair to go down ?
     
  8. hoshos

    hoshos

    Joined:
    Mar 7, 2015
    Posts:
    438
    Hello.
    It's still not clear from this video why the hair is so disorganized.
    First of all, make sure that the collider and particle sizes are appropriate.
    You can do this by checking the "Particle Positon" and "Particle Radius" in the Cloth-Monitor and selecting a component.
    The gizmo will appear as follows.

    cloth-monitor-1.jpg

    If the collider or particle is unintentionally too large, the result of collision detection will be unintended.
     
  9. bthanse

    bthanse

    Joined:
    Jun 24, 2019
    Posts:
    88
    I had used wrong preset, working good now.
     
  10. hoshos

    hoshos

    Joined:
    Mar 7, 2015
    Posts:
    438
    Thank God!
    I was relieved because I did not know the cause.
     
  11. hoshos

    hoshos

    Joined:
    Mar 7, 2015
    Posts:
    438
    Update: 1.10.0

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

    The camera culling feature has been added.
    As you can see in the image, only the character in the camera will be simulated, which will greatly improve performance, especially in first-person FPS and VR.
    culling-1.jpg culling-2.jpg

    Note that culling is enabled by default for MeshCloth/MeshSpring, but BoneCloth/BoneSpring requires a little bit of configuration, so please refer to the following guide.
    https://magicasoft.jp/en/cullingsystem/

    Release Note:
    Added: Camera culling system added. It improves performance by stopping the simulation of characters that are not on screen.
    https://magicasoft.jp/en/release-note-2/
     
  12. sudhishkumark6

    sudhishkumark6

    Joined:
    Dec 25, 2020
    Posts:
    5
    \

    I am new this one .. how can i do this? Do i want to create a function to make the input and call the radius in the OnValidate() function to change the radius of the collider in runtime? please can you show me an example?
     
  13. sudhishkumark6

    sudhishkumark6

    Joined:
    Dec 25, 2020
    Posts:
    5
    And one more thing is it possible to the cloth not to stretch while increasing the collider size in runtime? The actual need of mine is to make a Real Time clothing app for android , which increase the body parts size of 3d model in runtime as the user need and then simulate the fixed sized cloth to check whether the cloth suits the person or not and also i need tension map of how much tight or loose it is to user, is it is possible to make with magica cloth? pls help me , I am just a three month user to unity and i am working as a unity developer in a company ..by frankly saying I really don't know what to do or how to this one .if you have any idea or suggestion pls pls help me .if you can suggest any other tool or idea that is also ok.
     
  14. hoshos

    hoshos

    Joined:
    Mar 7, 2015
    Posts:
    438
    Hello.
    In response to previous requests, the latest version, v1.10.0, adds an API that allows you to change the collider parameters at runtime.
    You can now do so by manipulating the parameters in the following document.
    Please try to use it.
    https://magicasoft.jp/en/magicaspherecollider/
    https://magicasoft.jp/en/magicacapsulecollider/
    https://magicasoft.jp/en/collidercomponent/
     
  15. hoshos

    hoshos

    Joined:
    Mar 7, 2015
    Posts:
    438
    Unfortunately, this issue cannot be resolved at this time.
    MagicaCloth's simulation data is pre-generated before the game is run.
    At this time, the distance between the particles and the stretching parameters are determined.
    Therefore, it is not possible to reconfigure the cloth at runtime.
    The only thing that is currently possible at runtime is the scaling of the entire character.
    https://magicasoft.jp/en/runtimescaling-2/

    The solution to this problem is to add the ability to rebuild data at runtime.
    This feature is not yet in the works as it would require a major overhaul.
    However, it has been added to the roadmap.

    Thank you.
     
  16. SecretGardener

    SecretGardener

    Joined:
    Feb 23, 2021
    Posts:
    21
    Hello, is it possible to transform magica cloth components to a same model but in different scene/project?

    What I have is a model done with setting up meshcloth (with Magica Mesh Cloth, Magica Renderer Deformer, Magica Virtual Deformer all set), now I may have to work with another Unity project with the same model but without setting up meshcloth. Is it possible to transform the data of magica cloth component? (Especially Point Selection since it takes a lot of time setting it up)

    Looking forward to your reply.
     
  17. hoshos

    hoshos

    Joined:
    Mar 7, 2015
    Posts:
    438
    Hello.
    Unfortunately, it is not possible to export only the cloth data to a separate project.
    The best way in this case is to combine the model + configuration prefab into one and export it as a UnityPackage.
    For example, let's say the model is A.
    Let's say the model is A and the prefab with MagicaCloth is B.
    In the original project, export these A and B as a single UnityPackage.
    Import them in the new project.
     
  18. SecretGardener

    SecretGardener

    Joined:
    Feb 23, 2021
    Posts:
    21
    Hi! Thanks for the quick reply. I did a simple test and seams like it works!
    Although it takes time to do some copy and paste and reassign, at least I don't have to redo the point selecting part.

    Gratefully appreciated.
     
    hoshos likes this.
  19. Sunstrace

    Sunstrace

    Joined:
    Dec 15, 2019
    Posts:
    15
    HI! can magica cloth run in pure ecs? not use any gameobject.
     
  20. hoshos

    hoshos

    Joined:
    Mar 7, 2015
    Posts:
    438
    Hello.
    No, Magica Cloth is not designed for ECS.
    It is a method of attaching a component to a conventional GameObject.
     
  21. sS_Naomichi

    sS_Naomichi

    Joined:
    Oct 28, 2020
    Posts:
    3
    Hi!
    BoneCloth was stopped when enabled to both camera culling and distance disable in a scene had multiple cameras (including scene view camera).
    If I put only one camera in a scene or disabled to either camera culling or distance disable, the simulation was worked well.
    Is this behavior a bug?

    Unity version:2020.1.17 with URP
     
  22. hoshos

    hoshos

    Joined:
    Mar 7, 2015
    Posts:
    438
    Hello.
    This is probably due to the "distance disable" feature.
    "Distance disable" turns on/off the cloth component depending on the distance from a single camera.
    This camera is the one set in the following "Reference Object".
    (If none, the main camera will be selected.)
    https://magicasoft.jp/en/distance-disable-2/

    In other words, regardless of the camera culling, if the distance from the "Reference Object" is more than a certain distance, the component will be disabled.
    Please check this point.
     
  23. chkev2001

    chkev2001

    Joined:
    May 11, 2016
    Posts:
    1
    Hi, I am using MeshSpring for my character, it works fine! ...However, I don't find any option to add a collider to collider list....
    There is no collider list for MeshSpring like MeshCloth do?!
    How do I implement the "touch breast" effect with MeshSpring? :)
     
  24. hoshos

    hoshos

    Joined:
    Mar 7, 2015
    Posts:
    438
    Hello.
    This is the same answer as the support email, but unfortunately MeshSpring cannot be configured with colliders.
    We have plans to implement this in the future, but we would like to implement a soft body instead of a simple spherical collider.
    The implementation of soft bodies and collision detection is a bit more complicated, so it will take some more time.
    Please wait a little longer until then.
     
  25. SecretGardener

    SecretGardener

    Joined:
    Feb 23, 2021
    Posts:
    21
    Hi! We are currently facing a penetration problem.

    We have a dress model contained with 2 meshes, which are basically the exact same mesh but with flipped normal, making one the inner side and the other the outer side. The two meshes are on the same position as well.

    We have set up collider penetration on the dress, and it prevents body parts (legs, etc.) from getting through but the inner side of the dress still gets through the outer side, especially with intense movement such as running.

    There is a similar problem mentioned on post #724, the reply said that such problem cannot be prevented at the moment since there is no self-collision feature.
    [RELEASED] Magica Cloth

    Could it be that our problem cannot be solved at the moment as well?
     
    Last edited: May 24, 2021
  26. sS_Naomichi

    sS_Naomichi

    Joined:
    Oct 28, 2020
    Posts:
    3
    Thank you for the reply!
    Sorry, I didn't explain it enough and wrote a bit of wrong information.

    If "Camera culling" is enabled and objects are rendered with any cameras in the scene(including the scene view camera), BoneCloth is stopped when "Distance disable" is activated once.
    BoneCloth starts working again when I move out objects from the camera frustum and render again.

     
  27. hoshos

    hoshos

    Joined:
    Mar 7, 2015
    Posts:
    438
    Hello.
    You are probably using MeshCloth.
    If you have a part with a close front and back, you may be able to improve it in the following way.

    (1) Merge the vertices in VirtualDeformer.
    Try creating a virtual mesh by slightly increasing the "Merge Vertex Distance" setting in the VirtualDeformer.
    The vertices in this range will be merged into a single vertex, so no more vertices will be popping out.

    (2) VirtualDeformer skinning weight count
    Try setting the VirtualDeformer's "Max Weight Count" to 4.
    You may find that skinning is more accurate and stable at 4.

    https://magicasoft.jp/en/magica-cloth-virtual-deformer-2/

    Don't forget to rebuild the VirtualDeformer after changing the parameters.
     
  28. hoshos

    hoshos

    Joined:
    Mar 7, 2015
    Posts:
    438
    Thank you for the detailed video.
    Oh, this may be a glitch.
    I'll check it out here, so please wait a bit.
     
  29. hoshos

    hoshos

    Joined:
    Mar 7, 2015
    Posts:
    438
    Hello.
    We investigated the problem and found it to be a glitch.
    The problem has already been fixed and will be updated within a week at the earliest.
    Thanks for reporting the glitch!
     
  30. hoshos

    hoshos

    Joined:
    Mar 7, 2015
    Posts:
    438
    Update: 1.10.1

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

    This is an urgent bug fix.
    When using the culling function together with distance deactivation, the simulation that was turned off was not activated again.

    Release Note:
    Improvement: Cloth gizmos are now only shown when Calculation is ON
    Fix: When using the culling system together with DistanceDisable, the component was not enabled again.

    https://magicasoft.jp/en/release-note-2/
     
  31. wechat_os_Qy0w20wunCdTJmQwzzxgRRZbc

    wechat_os_Qy0w20wunCdTJmQwzzxgRRZbc

    Joined:
    May 19, 2020
    Posts:
    5
    really need gizmo drawings under URP....
     
  32. hoshos

    hoshos

    Joined:
    Mar 7, 2015
    Posts:
    438
    Hello.
    I certainly find it inconvenient myself.
    I really don't understand why URP/HDRP hides the gizmo in Wireframe mode.
    We are currently developing a self-collision system and don't have much time to spare.
    So please wait a little longer.
     
  33. sS_Naomichi

    sS_Naomichi

    Joined:
    Oct 28, 2020
    Posts:
    3
    I confirmed that problem has been fixed!
    Thank you for your quick response!
     
    hoshos likes this.
  34. mchung123

    mchung123

    Joined:
    Jul 4, 2017
    Posts:
    28
    Hey, quick question! If I create the hair object dynamically using the prefab, and I have a character with a bunch of colliders is there a way programmatically to add colliders to the that hair object? My hair object uses Magica Bone cloth.
    I am adding these colliders for the character at design time, whats the API am I looking to use to add the colliders on the character to the hair? Thanks!
     
  35. hoshos

    hoshos

    Joined:
    Mar 7, 2015
    Posts:
    438
    Hello.
    The Cloth component has APIs for AddColllider()/RemoveCollider().
    https://magicasoft.jp/en/basecloth-2/

    Please try to use this.
     
    mchung123 likes this.
  36. Adunato

    Adunato

    Joined:
    Nov 3, 2018
    Posts:
    6
    Hello! Just finished my first complete piece of clothing and I'm really impressed with both results and workflow. I even ended up using the avatar system which from what I can see is the only solution in the asset store for realtime cloth swapping. A couple of suggestions / report:
    - The Z test in the point selection mode, works OK for visualisation of the points but when editing them it seems to ignore it. i.e. it will also edit points on the other side of the mesh. Looks like a bug to me.
    - Again on the point editing, the solution is OK when a small set of points are involved (which is probably best practice anyway), but when dealing with a higher number of points the whole drag / point selection becomes a bit frustrating. I think it would be great to have either a "brush size" setting to influence more points at once, or a selection mode for dragging a rectangle over a multiple set of points at once.
     
  37. hoshos

    hoshos

    Joined:
    Mar 7, 2015
    Posts:
    438
    Hello.
    Thank you for your feedback!
    I have heard many people say that vertex painting is difficult to do.
    I also think that this problem should be improved.
    We are currently working on self-collision and other enhancements, so it will take some more time.
    However, I will definitely take the time to improve this problem at a later date.
     
    Adunato likes this.
  38. mchung123

    mchung123

    Joined:
    Jul 4, 2017
    Posts:
    28
    Do we know when in the roadmap we are going to be able to pull on the bone springs?
     
  39. hoshos

    hoshos

    Joined:
    Mar 7, 2015
    Posts:
    438
    Hello.
    It's okay, I haven't forgotten.
    However, I am currently concentrating on the implementation of self-collision, so I haven't started working on it yet.
    It may take some time, but please wait a little longer.
     
    mchung123 likes this.
  40. netpost

    netpost

    Joined:
    May 6, 2018
    Posts:
    316
    @hoshos I am having problem with the latest version of Magica cloth. I can't see my capsule colliders so I can't ajust them. Please see attached picture for more infos. Thanks for your help!
    NoColliderView.JPG
     
  41. hoshos

    hoshos

    Joined:
    Mar 7, 2015
    Posts:
    438
    Hello.
    This is probably because the GameObject is inactive.
    If the GameObject is currently inactive, the gizmo will not be displayed.
    Try activating the GameObject and checking it.
    Also, there is an error message on the screen, does this have anything to do with MagicaCloth?
     
  42. netpost

    netpost

    Joined:
    May 6, 2018
    Posts:
    316
    @hoshos Thank you very much for the quick reply. The game object was active but I had the collider inserted on the leg bones which did not have a mesh renderer. Newbie mistake.... So I remove the bone legs colliders and inserted a new collider on the lower body mesh renderer and now I can see and modify the collider. My other problem now is even if I have a rigibody on my lower boby mesh , the collider does not work, meaning the cloth go thru it. My collider is properly registered in my MagicMeshCloth collider list. Any idea? Thanks again for your help!

    The error in the consol log is related to the skybox, I will fix that thanks!
     
  43. bthanse

    bthanse

    Joined:
    Jun 24, 2019
    Posts:
    88
    I do not know if I have doing something wrong or if something need some adjustment on the hair. When girl bend down the hair looks like it do what expected, but suddenly it go back to the backside of girl. Have tried different speed and bend angles.
     
  44. hoshos

    hoshos

    Joined:
    Mar 7, 2015
    Posts:
    438
    Hello.
    First, make sure that the "Collider Collision" panel is checked.
    If it is not checked, the collider will not work.
    https://magicasoft.jp/en/paramater-collider-collision-2/

    Also, if you add a collider, you will need to rebuild the data by clicking the "Create" button.
    Please check these two things.
     
  45. hoshos

    hoshos

    Joined:
    Mar 7, 2015
    Posts:
    438
    Hello.
    I can't tell the details from this video, but I think it's probably the effect of "Restore Rotation" or "Penetration".
    In "Restore Rotation", the angle of the hair tries to return to its original position.
    This is why it works against the force of gravity.
    https://magicasoft.jp/en/paramater-restore-rotation-2/

    In "Penetration" there are two modes, "Surface" and "Collider", both of which try to keep the hair in its initial position, in this case on the back.
    https://magicasoft.jp/en/paramater-penetration-2/

    If you turn off these two modes, the hair may fall naturally.
    However, the above two functions may be necessary to keep your hair in its natural position.
    Therefore, turning off these two may cause other harmful effects.

    MagicaCloth is not a perfect cloth simulation, but rather a simulation that "lies" to some extent for the game.
    This is because the game looks better that way.
    (For example, Dynamic Bone).
    Please understand this point.
     
  46. Davood_Kharmanzar

    Davood_Kharmanzar

    Joined:
    Sep 20, 2017
    Posts:
    411
    @hoshos
    can we use it as softbody simulator?
    and how can we use that to simulate hose?
     
  47. hoshos

    hoshos

    Joined:
    Mar 7, 2015
    Posts:
    438
    Hello.
    Unfortunately, MagicaCloth does not implement Simulation for soft bodies.
     
  48. hoshos

    hoshos

    Joined:
    Mar 7, 2015
    Posts:
    438
    Update: 1.10.2

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

    Fixed a fatal issue that could cause bones to collapse their positions when the component was turned on or off in certain situations.
    This would occur when using DistanceDisable, etc.
    Also, a right-click menu has been added to remove subassets that have been left in the prefab due to some issue.
    cleanup-1.jpg

    Release Note:
    Added: Added a menu to remove unwanted sub-assets left in the prefab by right-clicking in ProjectView and selecting "Magica Cloth/Clean up sub-assets".
    Fix: Fixed an issue where turning the cloth component on and off using DistanceDisable would break the position of the bones in some situations.
    Fix: Fixed the problem that Blend rate is always 0 when FadeDistance of DistanceDisable is 0.
    Fix: Fixed an issue where the manager component would disappear if the manager was accessed before the PhysicsManager's Awake() was called.
    Improvement: Adjusted the skirt of the UnityChan sample.
    Improvement: Adjusted the initial value of VelocityInfluence of ClampDistance to about 0.2.

    https://magicasoft.jp/en/release-note-2/
     
  49. Davood_Kharmanzar

    Davood_Kharmanzar

    Joined:
    Sep 20, 2017
    Posts:
    411
    @hoshos
    hi,
    how can i collide cloth with other a lot of surfaces?
     
  50. hoshos

    hoshos

    Joined:
    Mar 7, 2015
    Posts:
    438
    Hello.
    Currently, it needs to be implemented with a combination of sphere/capsule/plane collider.
    And we are currently working on the implementation of layered collision.
    Once this is completed, it should work without overlapping garments of multiple structures.
    It may take a few more months of development.
     
unityunity