Search Unity

  1. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

[RELEASED] MagicaCloth2 - Hybrid Cloth Simulation

Discussion in 'Assets and Asset Store' started by hoshos, Feb 5, 2023.

  1. ikazrima

    ikazrima

    Joined:
    Feb 11, 2014
    Posts:
    320
    Hello, is box collision on the road map?
     
  2. hoshos

    hoshos

    Joined:
    Mar 7, 2015
    Posts:
    877
    Yes, it's already added to the roadmap.
    https://magicasoft.jp/en/mc2_roadmap/

    However, the implementation date has not yet been determined.
    There are two work schedules for this year, so it will probably be after that.

    1.BoneSpring components
    2. Implementation of bake mode
     
    ikazrima likes this.
  3. SOL3BREAKER

    SOL3BREAKER

    Joined:
    Oct 11, 2021
    Posts:
    39
    Does the amount of mesh cloth affect performance? Currently my character's body and cloth are from the same mesh, and I don't know if I could split them to save more performance.
    And if I don't split them, when using simple distance, my character's ass will be merged with skirt, but if I use shape distance, my character's skirt would go through her long coat, which may force me to use self collision, they all may cause problem.
     
  4. hoshos

    hoshos

    Joined:
    Mar 7, 2015
    Posts:
    877
    Performance is proportional to the number of mesh vertices.
    Therefore, the smaller the number of vertices, the better the performance.
    It is better to have separate meshes for the character's body and clothing.
    Otherwise, the configuration will be difficult and an unnecessary load will be generated.
     
  5. Claudia_Schulz

    Claudia_Schulz

    Joined:
    May 12, 2020
    Posts:
    8
    Hello!

    We're currently on version 2.3.0 and have encountered a bug in the editor and I'm not quite sure if I can fix it on my end. In our project, we're instantiating character prefabs + their clothing prefabs and attach clothing to the character (stopping automatic magica build on Start() and initiating a build manually after the character is put together properly). When a character is disposed off, they go back into an object pool for better reusability and performance. When I instantiate a character, dispose of them, and instantiate it again in quick succession, I will get the following error:

    Code (CSharp):
    1. A Native Collection has not been disposed, resulting in a memory leak. Allocated from:
    2. Unity.Collections.NativeArray`1:.ctor(Int32, Allocator, NativeArrayOptions)
    3. MagicaCloth2.RenderSetupData:ReadTransformInformation(Boolean)
    originally entering the magicaCloth codebase via
    Code (CSharp):
    1. MagicaCloth2.MagicaCloth:Initialize()
    Is there a method I need to call when cleaning up/disposing my characters/prefabs that have a magica build running?
     
  6. hoshos

    hoshos

    Joined:
    Mar 7, 2015
    Posts:
    877
    Hello.
    There are some rules when using MagicaCloth in an object pool.

    (1) Please perform Initialize() and BuildAndRun() only when instantiating for the first time.
    (2) Only use SetActive() or enable/disable components to put in and take out objects from the object pool.
    (3) When taking it out from the object pool, it is a good idea to reset the simulation with ResetCloth()

    First, please make sure that you follow these rules.
    Basically, calling Initialize() or BuildAndRun() more than once may result in an error in some cases.
    If you want to return MagicaCloth to the object pool, simply disable the component.
    After retrieving from the object pool, the simulation is reinitialized by ResetCloth().
    https://magicasoft.jp/en/mc2_api_magicacloth/#ResetCloth
     
    hopeful likes this.
  7. Claudia_Schulz

    Claudia_Schulz

    Joined:
    May 12, 2020
    Posts:
    8
    Hi again! Thanks for the quick reply and the very valuable info on object pooling with Magica! :)
    I did some more testing today and realised that I was only half right about what I wrote in the earlier post. While we are object pooling the characters, we are not actually pooling the objects that use Magica components. So the error occurred when I destroyed such an object right after instantiating/initiating it, so the magica cloth build was still in progress when the object was deleted.
    I think I fixed it by calling Process.Dispose() before destroying the magica component carrying objects.
    Do you think that makes sense? Is there anything else that needs to be disposed of/cleaned up in a case where the cloth build is in progress but the object is supposed to be destroyed?
     
  8. hoshos

    hoshos

    Joined:
    Mar 7, 2015
    Posts:
    877
    There is no problem with destroying objects during the build.
    We have designed it that way and tested it for quite a long time.
    So there is no need to perform any processing when destroying it.

    However, there may still be an unknown defect.
    Is this easily reproducible?
    If so, can I get a project that can reproduce it?
     
  9. Claudia_Schulz

    Claudia_Schulz

    Joined:
    May 12, 2020
    Posts:
    8
    Hello :)
    I've managed to recreate the error in the RuntimeDressUp demo by making some slight changes to it. Will send you the details :)
     
  10. SolarianZ

    SolarianZ

    Joined:
    Jun 13, 2017
    Posts:
    220
    Hi, does that mean there's a Blend Weight feature now?

     
  11. hoshos

    hoshos

    Joined:
    Mar 7, 2015
    Posts:
    877
    Yes, BlendWeight functionality has already been implemented.
    This is an internal property that is not visible in the inspector.
    By manipulating this blendWeight, it is possible to blend the simulation results and the original shape.
    https://magicasoft.jp/en/mc2_api_clothserializedata/#blendWeight
     
    SolarianZ likes this.
  12. hoshos

    hoshos

    Joined:
    Mar 7, 2015
    Posts:
    877
    Update:2.3.2

    v2.3.2 has been released on the Asset Store!
    https://u3d.as/2Zc3

    Some bugs have been fixed.

    Release Note:
    Fix: Fixed an issue where a memory leak would occur if a MagicaCloth component was added with GameObject disabled, initialized manually, and then discarded while it was disabled.
    Fix: Fixed it so that more than 16 renderers could not be set in MeshCloth. The maximum number of renderers that can be set is 15.
    Fix: Fixed an issue where a compilation warning occurred in Unity2023.

    How to Update
    Please follow the following steps to update the software as much as possible.
    (1)Backup your project
    (2)Delete the MagicaCloth2 folder from the Unity editor
    (3)Import the latest MagicaCloth2 from PackageManager
     
    Claudia_Schulz likes this.
  13. arimintzu

    arimintzu

    Joined:
    Jan 7, 2019
    Posts:
    7
    Hi, awesome work as ever. I’ve been using magica cloth for some time. There’s a feature i need to know if its do-able or not (present or maybe future).

    i know there’s spring component in the roadmap, and it also said add collision on it.
    Does it mean it will support the collision of the bone spring to the global collider?
    Example i have bone spring on busts, if it collides with box collider in the world it will be springing?

    and when it will be launched if i may know?
    Thanks in advance
     
  14. hoshos

    hoshos

    Joined:
    Mar 7, 2015
    Posts:
    877
    Hello.
    We are currently experimenting with plans to add collision detection to the new BoneSpring.
    BoneSpring will be available soon.

    However, Ver2.x does not have the global collider function.
    It was included in Ver1.x, but since it was implemented using a fairly aggressive method last time, it was discontinued in Ver2.x.
    However, in Ver2.x, you can easily add and remove collider to the cloth component.
    You will be able to take advantage of this feature.
    https://magicasoft.jp/en/mc2_runtimechanges/

    Also, box collider has not been implemented yet.
    It's on the roadmap and I'd like to experiment with it in the near future.
     
  15. arimintzu

    arimintzu

    Joined:
    Jan 7, 2019
    Posts:
    7
    i see. But can i use magica cloth for busts?
     
  16. hoshos

    hoshos

    Joined:
    Mar 7, 2015
    Posts:
    877
    of course!
    BoneSpring will be added soon, so please try using it.
    I think BoneSpring is mostly used for shaking the chest.
     
  17. RabberDakk

    RabberDakk

    Joined:
    Feb 23, 2019
    Posts:
    11
    can't wait magica spring bone :)
    I often use it to chest and hair
     
    hoshos likes this.
  18. alexgg101

    alexgg101

    Joined:
    May 3, 2022
    Posts:
    12
    hi. i updated recently and have suddenly got a kind of cracking effect on a cloth mesh , it never used to have a problem . kind of a skirt it is lightly pleated and crack appears to be on pleat, the cloth appears to split, have light or a shadow in split ??
     
  19. hoshos

    hoshos

    Joined:
    Mar 7, 2015
    Posts:
    877
    Hello.
    Do you remember which version you updated from?
    Also, do you have any images that can confirm the problem?
     
  20. alexgg101

    alexgg101

    Joined:
    May 3, 2022
    Posts:
    12
    not sure , i'm on latest version now, occasionally , possibly not even on update, my cloth mesh seems to lose the vertex painting, so i repaint .
    this is first time i have noticed there is a kind of crack if i shake around a cloth skit , seems to tear a bit in certain light.
    this appears to be on a pleat in mesh ??
     
  21. hoshos

    hoshos

    Joined:
    Mar 7, 2015
    Posts:
    877
    Vertex paint is recorded in vertex coordinates.
    Therefore, if you change the pose of the character you are editing, the vertex paint will not match.
    Please note this.

    The cause of the cracks cannot be determined from this information alone.
    First of all, is the mesh reduction performed properly?
    https://magicasoft.jp/en/mc2_meshclothstartguide/#Reduction

    If no reduction is being performed at all, try increasing the value and changing to a slightly simpler proxy mesh.
     
  22. alexgg101

    alexgg101

    Joined:
    May 3, 2022
    Posts:
    12
    cloth_red.png cloth.png
    hi, thanks for reply,

    no reduction actually looks maybe better than with some reduction.

    i would need to really reduce to avoid this i think,
    the vertex points on paint are centred around a pleat.
    there is an odd pattern of points around this pleat on centre of the cloth , kind of twice as many points.

    it seems to occasionally catch the light in an odd way ,
    looks like some wierd transparent shadow crack when shaking around sometimes.

    in screenshots actually non-reduced mesh looks better in game mode, i think maybe to do with pleat in shader normal ? never used to be a problem with same mesh + shader
     
    Last edited: Nov 7, 2023
  23. artonator

    artonator

    Joined:
    Sep 12, 2009
    Posts:
    69
    It looks pretty impressive, Is it possible to simulate cloth on a different transform space? For example, when a character is positioned on a moving object, it would be useful to have a weight multiplier that adjusts the calculations between the world and the moving transform space.
     
  24. hoshos

    hoshos

    Joined:
    Mar 7, 2015
    Posts:
    877
    Thank you for the image.
    I'm just speculating, but the shape of this mesh may be the cause of the problem.
    However, I can't tell the reason from this image alone.

    Does this problem occur no matter how I set the SimpleDistance parameter?
    For example, try changing the value slightly, such as 0.02, 0.03, 0.04.
     
  25. hoshos

    hoshos

    Joined:
    Mar 7, 2015
    Posts:
    877
    Hello.
    Yes, MagicaCloth can control world and local inertia separately.
    World inertia is related to the character's world movement, while local inertia is related to the animation movement inside the character.
    By controlling these, it is also possible to eliminate the influence of moving objects.
    Please refer to the following documents for more information:
    https://magicasoft.jp/en/mc2_magicacloth_inertia/
     
  26. alexgg101

    alexgg101

    Joined:
    May 3, 2022
    Posts:
    12
    hi

    yes it did seem to occur throughout the range.
     
  27. DigitalAdam

    DigitalAdam

    Joined:
    Jul 18, 2007
    Posts:
    1,200
    @hoshos Hey, I'm a bit confused as to how to set up cloth for a shirt.

    I have a shirt that's skinned to the character's skeleton, so the shirt also moves with the animation like the character.

    I added a MagicaCloth to my scene, and assigned the mesh as the Source. The cloth type is "Mesh Cloth", and I have the front of the shirt painted with the Move attribute, and have two capsule colliders for the chest.

    What I'd like to happen is for the front part of the shirt to move realistically, and having the colliders prevent the cloth from clipping into the character. The problem I have is when I play the scene, gravity stretches the cloth. I've tried setting the gravity to .01 , which fixes the problem with the cloth stretching past the ground. But then the cloth just "ripples" in place when I play a walk cycle. I've also tried the various presets, but none of those help.

    I've been playing with all the parameters for a while now and I can't get anything decent. I rather not use Movement Limit if possible. What do you recommend for the settings?

    Thanks.

    Shirt.jpg gravity.jpg
     
    Last edited: Nov 9, 2023
  28. hoshos

    hoshos

    Joined:
    Mar 7, 2015
    Posts:
    877
    Thank you for your reply.
    Unfortunately, I still don't know the cause.
    Can you provide a project where I can check this issue?
    Looking at the data may reveal the cause of the problem.
    If possible, you can send a DM using [Start Conversation] from my account.
    Or please contact us at the following email address.
    support@magicasoft.jp
     
  29. hoshos

    hoshos

    Joined:
    Mar 7, 2015
    Posts:
    877
    Hello.
    Please try the following two tests:

    (1) Reduction of mesh
    Looking at the image, it seems that the mesh used for simulation is too fine.
    Normally, the vertices of the displayed mesh are reduced to create a simpler proxy mesh and the simulation is performed.
    Please try reducing the proxy mesh a little more according to the following document.
    This will provide more stable performance and operation.
    https://magicasoft.jp/en/mc2_meshclothstartguide/#Reduction

    (2) Fixed attributes are required
    Looking at the image, it consists only of green moving attributes and gray invalid attributes.
    MagicaCloth always requires vertices with fixed attributes to connect moving vertices.
    Without fixed attributes, the simulation will not function properly.
    Fixed attributes are indicated by red points.
    For information on attribute painting, please refer to the following documentation:
    https://magicasoft.jp/en/mc2_vertexpaint/

    Finally, how to use BoneCloth/MeshCloth is summarized in the document.
    If you haven't read it yet, please check it out.
    https://magicasoft.jp/en/mc2_setup/
     
    DigitalAdam likes this.
  30. DigitalAdam

    DigitalAdam

    Joined:
    Jul 18, 2007
    Posts:
    1,200
    Thanks for your suggestions. I was able to get the results I was looking for by using Fixed. Appreciated it!
     
    hoshos likes this.
  31. hoshos

    hoshos

    Joined:
    Mar 7, 2015
    Posts:
    877
    Update:2.4.0

    v2.4.0 has been released on the Asset Store!
    https://u3d.as/2Zc3

    A new BoneSpring feature has been added this time.
    Adds a spring-induced shaking effect to Transform.
    This is mainly suitable for things like chest shaking.
    For more information, see How to use BoneSpring below.
    https://magicasoft.jp/en/mc2_bonespring_startguide/


    Also added LocalMovementSpeedLimit and LocalRotationSpeedLimit to local inertia.
    You can further fine-tune the effects of local inertia.
    https://magicasoft.jp/en/mc2_magicacloth_inertia/
    mc2_7_spring_22.jpg

    Release Note:
    Added: Added BoneSpring. You can add a spring effect to your Transform. Please refer to the BoneSpring documentation for feature details.
    Added: Added three presets for BoneSpring: SoftSpring/MiddleSpring/HardSpring.
    Added: Added speed limit and rotation limit to local inertia parameters. The influence of local inertia can be set in detail.
    Added: Added chest shaking using BoneSpring to the UnityChanKAGURA demo.
    Improvement: Exclude invalid attribute vertices from gizmo display at runtime.
    Improvement: You can now change whether the center of inertia gizmo is visible.
    Improvement: Rebuilt the FBX model and prefab of UnityChanKAGURA demo with the addition of BoneSpring.
    Fix: Fixed an issue where an error occurred when the number of edges in the proxy mesh was 0.

    How to Update
    Please follow the following steps to update the software as much as possible.
    (1)Backup your project
    (2)Delete the MagicaCloth2 folder from the Unity editor
    (3)Import the latest MagicaCloth2 from PackageManager
     
  32. Game-Dragon

    Game-Dragon

    Joined:
    Nov 16, 2012
    Posts:
    26
    I've been waiting for Bone Spring for awhile now. Thank you for this wonderful addition!
     
    hoshos likes this.
  33. JackmanGomel

    JackmanGomel

    Joined:
    Jun 3, 2015
    Posts:
    26
    Hi. I need to add a ColliderComponent to a Cloth at runtime after some time of start a game. Also my charcter with colliderComponent is destroing and recreating in a scene, after it I add a ColliderComponent to a Cloth by a script but a Cloth doesn`t collide with a new ColliderComponent. I did enabled and disabled, resetCloth, initialization but nothing work
     
  34. hoshos

    hoshos

    Joined:
    Mar 7, 2015
    Posts:
    877
    Hello.
    To add a collider during runtime you need to call SetParameterChange() after adding it to the list.
    Please see the following documentation for details:
    https://magicasoft.jp/en/mc2_runtimechanges/

    Also, if you are changing costumes during execution, you will also need to replace the bones inside MagicaCloth as well as SkinnedMeshRenderer.
    Please see the following document for dress-up information.
    https://magicasoft.jp/en/mc2_dressup/
     
  35. yukosan

    yukosan

    Joined:
    Mar 12, 2020
    Posts:
    2
    Is there any progress on the mesh collider?
     
  36. hoshos

    hoshos

    Joined:
    Mar 7, 2015
    Posts:
    877
    The development of the mesh collider is still undecided.
    This is technically difficult and requires a lot of verification, so I'm sorry, but it's not a high priority.
     
    yukosan likes this.
  37. hoshos

    hoshos

    Joined:
    Mar 7, 2015
    Posts:
    877
    Update:2.4.1

    v2.4.1 has been released on the Asset Store!
    https://u3d.as/2Zc3

    Now available on Unity2DAnimation
    However, there are some settings and restrictions.
    https://magicasoft.jp/en/mc2_2danimation_setup/

    Attributes can now be set per Transform when constructing a BoneCloth at runtime
    https://magicasoft.jp/en/mc2_runtime_build/#Example_of_attribute_settings_in_BoneCloth


    Release Note:
    Added: You can now select whether to update the simulation before or after LateUpdate. This is required when using Unity2DAnimation
    Added: When creating a BoneCloth/BoneSpring at runtime, you can now specify Transform and vertex attribute pairs as a dictionary instead of vertex paint data
    Improvement: Expanded the maximum number of renderers that can be set for MeshCloth from 15 to 31
    Fix: Fixed an issue where setting the wind zone's air volume to 0 would cause it to stop working. If the air volume is set to 0, there will be no wind in that zone.

    How to Update
    Please follow the following steps to update the software as much as possible.
    (1)Backup your project
    (2)Delete the MagicaCloth2 folder from the Unity editor
    (3)Import the latest MagicaCloth2 from PackageManager
     
    DrMeatball likes this.
  38. TsFreddie

    TsFreddie

    Joined:
    Aug 15, 2014
    Posts:
    4
    Hi. Is it possible for Animation Rigging (the unity package) to read transform that is controlled by BoneCloth?

    Our current setup is like this, where we have a Blend Constraint blending between Source A and Source B.
    Source A is controlled via a MagicaCloth component using the BoneCloth setup.

    upload_2023-12-1_16-59-41.png

    Currently when Animation Rigging reads transform during the animation jobs, the transform seems to be unchanged even though transforms controlled by MagicaCloth2 seems to be moving around.
     
  39. hoshos

    hoshos

    Joined:
    Mar 7, 2015
    Posts:
    877
    Hello.
    I haven't tested it in conjunction with Animation Rigging, so I'll look into it.
    Please give me some time.
     
  40. hoshos

    hoshos

    Joined:
    Mar 7, 2015
    Posts:
    877
    I have researched this issue.
    Unfortunately, BlendConstraint and MagicaCloth cannot be used together.
    It seems that the BlendConstraint and MagicaCloth Transform operations are conflicting.
    I've done a lot of research, but there's currently no workaround.

    However, you may be able to solve this by creating your own BlendConstraint.
    In this case, use LateUpdate() to blend the poses of the two Transforms.
    And you need to change the update location of MagicaCloth before LateUpdate().
    https://magicasoft.jp/mc2_settings_component/

    upload_2023-12-2_18-45-54.png

    Below is a simple sample code.
    Code (CSharp):
    1. using UnityEngine;
    2.  
    3. public class BlendTransform : MonoBehaviour
    4. {
    5.     public Transform target;
    6.  
    7.     public Transform source1;
    8.     public Transform source2;
    9.  
    10.     [Range(0.0f, 1.0f)]
    11.     public float weight = 0.5f;
    12.  
    13.     // Start is called before the first frame update
    14.     void Start()
    15.     {
    16.  
    17.     }
    18.  
    19.     // Update is called once per frame
    20.     void Update()
    21.     {
    22.  
    23.     }
    24.  
    25.     private void LateUpdate()
    26.     {
    27.         if (target == null || source1 == null || source2 == null)
    28.             return;
    29.  
    30.         var pos1 = source1.position;
    31.         var pos2 = source2.position;
    32.         var pos = Vector3.Lerp(pos1, pos2, weight);
    33.         target.position = pos;
    34.  
    35.         var rot1 = source1.rotation;
    36.         var rot2 = source2.rotation;
    37.         var rot = Quaternion.Slerp(rot1, rot2, weight);
    38.         target.rotation = rot;
    39.     }
    40. }
     
    hopeful likes this.
  41. hoshos

    hoshos

    Joined:
    Mar 7, 2015
    Posts:
    877
    Update:2.4.2

    v2.4.2 has been released on the Asset Store!
    https://u3d.as/2Zc3

    Supports stop motion
    By intentionally moving the animation frame by frame, you can create a puppet show-like effect.



    See documentation for details
    https://magicasoft.jp/en/mc2_stopmotion_setup/


    Release Note:
    Added: Added SetSkipWriting() API to stop writing simulation results to Transform and Mesh. By using this function, it is possible to implement stop motion. Please refer to the stop motion implementation documentation for details.

    How to Update
    Please follow the following steps to update the software as much as possible.
    (1)Backup your project
    (2)Delete the MagicaCloth2 folder from the Unity editor
    (3)Import the latest MagicaCloth2 from PackageManager
     
  42. RabberDakk

    RabberDakk

    Joined:
    Feb 23, 2019
    Posts:
    11
    Hello, I have requests.

    1. pls show explanations of each parameter on a single page in the web doc. I have to go back and forth between pages frequently, which is very difficult.

    2. pls show an indication of whether the parameter is enabled for BoneSpring, BoneCloth, or MeshCloth for each parameter in the web doc.

    3. pls show the default values for each parameter. At the very least, it would be nice to have it in the web doc, but ideally, we would like the ability to make items that have been changed from their default values in the Unity Editor UI a different color or bold font, and the feature to return to the default values for each parameter (Not reset all).

    4. pls Show Reverse Lookup (FAQ) in the web doc. For example, To harden the movement, To soften the movement, To prevent penetration, etc. Many cases can be considered, but I think these 3 cases are in high demand. List the parameters that have a high impact on the objective.

    MagicaCloth2 is a great asset, but I feel that the documentation is a weak point. The documentation improvements would be a good way to reduce the difficulty of using the asset at a low cost.
     
    Last edited: Dec 16, 2023
  43. RabberDakk

    RabberDakk

    Joined:
    Feb 23, 2019
    Posts:
    11
    I'm applying BoneSpring to a short hair, I think it penetrates more into the collider than BoneCloth. So far, MagicaBoneSpring penetrates more than Unity SpringBone or VRMSpringBone, so I could not use it in my project.

    Switch from BoneCloth to BoneSpring with the same settings, updating only CollisiontBones. Then, when the neck is rotated quickly, the sidehair will not be penetrates in the face with BoneCloth, but with BoneSpring, they will be penetrates in the face. By updating Inertia, BoneSpring will also not be penetrates, but its movement will be weakened in overall.

    Is there something in BoneSpring that causes the collision detection to be weaker?
     
    Last edited: Dec 16, 2023
  44. hoshos

    hoshos

    Joined:
    Mar 7, 2015
    Posts:
    877
    Hello.
    Thank you for your feedback.
    I understand that web documentation is weak.
    I'm not very good at creating documents.
    Also, MagicaCloth is all developed, operated, and documented by one person.
    Unfortunately, we don't have the time to make major improvements.
    However, I will use this opinion as a reference for the future.
     
  45. hoshos

    hoshos

    Joined:
    Mar 7, 2015
    Posts:
    877
    BoneSpring's collision detection becomes weaker depending on the distance from the origin.
    See [Collision detection] in the following documentation:
    https://magicasoft.jp/en/mc2_bonespring_startguide/

    This is because BoneSpring is mostly used for shaking the chest, so it is designed like this.
    This range can be adjusted using "Limit Distance".
     
  46. RabberDakk

    RabberDakk

    Joined:
    Feb 23, 2019
    Posts:
    11
    Wow. MagicaCloth is used in a variety of projects. I can't believe there's one developer and maintainer :eyes:
    Documentation is low priority!!! Roadmap is more important fr can't wait grab-system and softbody

    I apologize for taking up your time. Can I ask you a few more questions?

    1. I understand that Limit Distance in Spring limits the range of motion. A larger value will increase the range of motion, and a smaller value will decrease the range of motion. Question: How does the Limit Distance in Collision differ from the Limit Distance in Spring? What are the effects of increasing and decreasing the value of Collision's Limit Distance?

    2. Is there a way to get an event after stabilization (?) is complete?

    Character GameObject
    - animation is set to bend the leg greatly at frame 0
    - skirt bone has no animation but
    - constraint of about 0.5 is set between the leg and skirt bones
    - a collider is also set

    if above GameObject is instantiated and animation is played immediately with PlayOnAwake: true, the leg will penetrate the skirt. However, if PlayOnAwake is false and the animation is played after waiting for 30-60 frames (a), the leg will not penetrate the skirt (Is this due to stabilization?)

    Is there any way to get this timing (a) with an event or something? I tried OnBuildComplete, but it's penetrated.
     
    Last edited: Dec 17, 2023
  47. hoshos

    hoshos

    Joined:
    Mar 7, 2015
    Posts:
    877
    (1)
    This has almost the same meaning, but I made it different because I wanted to reduce only the extrusion range of the collider.

    (2)
    The OnBuildComplete event helps with this.
    https://magicasoft.jp/en/mc2_api_magicacloth/#OnBuildComplete

    The important thing is to wait for the animation to play until OnBuildComplete is called.
    In MagicaCloth2, all simulation data is created on the fly at runtime.
    Creating this data requires several frames of time.
    Therefore, if the character's posture changes significantly before the data is created, it is likely to be disrupted at the start of the simulation.
     
    RabberDakk likes this.
  48. KizunerU

    KizunerU

    Joined:
    Feb 22, 2022
    Posts:
    1
    Thank you for developing this great plugin. I would like to ask if it’s possible to pre-calculate cloth simulations, and then at runtime, read a fixed cloth motion trajectory for specific animations. This way, there’s no need for real-time calculations, which could save a lot of performance. For example, each time a running animation is executed, the swing of the skirt follows a fixed trajectory, and when a jumping animation is executed, the skirt moves in another set of corresponding fixed trajectories. Is this achievable? Thank you for your answer, this text comes from a translation software, please understand.
     
  49. hoshos

    hoshos

    Joined:
    Mar 7, 2015
    Posts:
    877
    Hello.
    Thank you for the great idea!
    In fact, we are considering a similar function that allows animation simulation results to be saved as snapshots.
    You can reset the simulation based on this saved snapshot.
    This can be useful in action games where the character instantly performs attack motions, etc.
    This feature is still in the concept stage and has not been added to the roadmap, but we are exploring some sort of preservation feature in the future.
     
    the_unity_saga likes this.
  50. aitaiwanmei

    aitaiwanmei

    Joined:
    Jul 23, 2014
    Posts:
    2
    In my setup, the appearance consists of a skeleton and several skins. I intend for the skin (Magica Cloth) to be reusable after binding it to one skeleton, allowing it to be unbound and then bound to another (specific) skeleton. However, after testing, once BuildAndRun is invoked, the Magica Cloth can't be bound to another skeleton. How can this be resolved?