Search Unity

  1. We are migrating the Unity Forums to Unity Discussions. On July 12, the Unity Forums will become read-only.

    Please, do not make any changes to your username or email addresses at id.unity.com during this transition time.

    It's still possible to reply to existing private message conversations during the migration, but any new replies you post will be missing after the main migration is complete. We'll do our best to migrate these messages in a follow-up step.

    On July 15, Unity Discussions will become read-only until July 18, when the new design and the migrated forum contents will go live.


    Read our full announcement for more information and let us know if you have any questions.

[RELEASED] MagicaCloth2 - Hybrid Cloth Simulation

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

  1. QbAnYtO

    QbAnYtO

    Joined:
    Dec 18, 2016
    Posts:
    223
    what does this mean for magica cloth 1? will support stop there? also does magica cloth 2 work on console builds? nintendo switch, playatation, ios and xbox?

    Also can you I both magica cloth 1 and 2 in the same project?
     
    Last edited: Feb 18, 2023
  2. QbAnYtO

    QbAnYtO

    Joined:
    Dec 18, 2016
    Posts:
    223

    This doesn't fix the issue for me. i updated to the new magicaCloth 2 update and problem still persist.
     
  3. hoshos

    hoshos

    Joined:
    Mar 7, 2015
    Posts:
    980
    Hello.
    Thank you for moving the post.
    Please point out if the answer is wrong because I am using translation.

    I think the first question is about meshcloth vertex painting.
    If it is difficult to paint vertices, it is also possible to specify by paint texture.
    Consider this method.
    https://magicasoft.jp/en/mc2_vertexpaint/#Vertex_painting_with_textures

    It is correct operation to separate the components with the front hair and the back hair.
    Importantly, one Transform or mesh vertex cannot be manipulated by multiple MagicaCloth components.
    With this setting, only one will be enabled and the other will not work.
    Just keep this in mind.
    As long as this rule is followed, it is possible to apply multiple MeshCloths to one render mesh.

    Unfortunately the wind feature is not yet in V2.
    However, it has been added to the roadmap as a high priority item.
    So it will be implemented soon!
    https://magicasoft.jp/en/mc2_roadmap/
     
  4. hoshos

    hoshos

    Joined:
    Mar 7, 2015
    Posts:
    980
    Hello.
    Don't worry, V1 will still be supported for a while.
    This is because there are still many users of V1 and there is still demand.
    However, no new features will be added to V1 anymore.
    Support for bug fixes only.

    It is possible to use both V1 and V2 in the same project.
    This has been tested.
    However, the performance is very bad because two similar systems are working at the same time.
    Therefore it is not recommended to use it in a real game build.
     
  5. hoshos

    hoshos

    Joined:
    Mar 7, 2015
    Posts:
    980
    Hello.
    Please tell me more about this matter.

    * What symptoms are you experiencing?
    * Also, what are your Enter Play Mode Options set to?
    * Does stopping Enter Play Mode Options return to normal?
     
  6. QbAnYtO

    QbAnYtO

    Joined:
    Dec 18, 2016
    Posts:
    223
    I prrefer how v1 works with my meshes. where as v2 doesnt work as good.


    I'm experiencing black meshes like the other users in this forum. despite updating to the latest v2.

    My "enter play mode" on or off produces the same issue.
     
  7. Hummy91

    Hummy91

    Joined:
    Jun 7, 2017
    Posts:
    67
    I responded most of that info in the previous message, think you missed it but:

    * Is the shader Standard or a special shader? HDRP/Lit shader

    * Can you tell if the shader is using tangents? I'm not sure

    * Are all the meshes that utilize MagicaCloth2 the same, or is it just this skirt? This is happening to any skinned mesh in my project (many different clothing meshes etc). All the skinned meshes in my projects are exported from blender to .fbx by me. And the import settings for these fbx are: http://puu.sh/JzDrd/f98b79df4f.png (Note that under no circumstance can I change the import settings, this results in Unity breaking my meshes normals/blendshape normals ><, dam unity)

    * Which BuildinRP/URP/HDRP are you using? HDRP 12.1.10
     
  8. hoshos

    hoshos

    Joined:
    Mar 7, 2015
    Posts:
    980
    V1 has matured after two years since its release, but V2 is still in its infancy.
    V2 will have various additions and improvements from now on, so please take a long look.

    I see, this black mesh problem is the same as @Hummy91 's symptom.
    This black mesh issue does not appear to be related to "Enter Play Mode Options".
    This happens regardless of whether you use "Enter Play Mode" or not.
    We are currently investigating this issue.
     
  9. hoshos

    hoshos

    Joined:
    Mar 7, 2015
    Posts:
    980
    Sorry, I missed what was written in the quoted part of the message.

    Thank you for the information.
    I would like to test it here in a similar situation.
     
  10. akent99

    akent99

    Joined:
    Jan 14, 2018
    Posts:
    588
    Hi. I am having trouble getting the mesh mode of cloth to work as I want. I have been trying lots of different approaches, then noticed the scene window (left) vs the game window (right) below. The scene view I think is showing the dress mesh correctly following the character's legs. However, the game view has the dress in its default position as if the character was standing. (The character is jumping up and down.) The dress in the game window is not following what is shown in the scene window.

    upload_2023-2-18_23-58-19.png

    Another similar shot where the character is sitting. The scene view is pretty good, showing the mesh above the legs. The game view on the right does not show the dress mesh following the legs.

    upload_2023-2-19_0-2-19.png

    Note: This character is a VRoid Studio character and the dress has given me a lot of problems using their bone system as well, so it is possible there are other problems with how the character is set up. For example, here is the character in the same sitting position. The skirt is not the most respectable way for a lady to sit! (The view from the front is rather revealing!) I was hoping Magica Cloth would get the dress to settle down on the legs better.

    upload_2023-2-19_0-7-20.png

    Note: UnityCHanKAGURA_MC2 on the same animation clip appears to work pretty well (skirt sits nicely over the legs).

    Oh, in case relevant, I noticed an exception in the console.

    IndexOutOfRangeException: NewLength 256 is out of range of '255' Capacity.
    Unity.Collections.FixedList.CheckResize[BUFFER,T] (System.Int32 newLength) (at Library/PackageCache/com.unity.collections@1.4.0/Unity.Collections/FixedList.gen.cs:419)
    Unity.Collections.FixedList512Bytes`1[T].set_Length (System.Int32 value) (at Library/PackageCache/com.unity.collections@1.4.0/Unity.Collections/FixedList.gen.cs:3790)
    Unity.Collections.FixedList512Bytes`1[T].Add (T& item) (at Library/PackageCache/com.unity.collections@1.4.0/Unity.Collections/FixedList.gen.cs:3899)
    MagicaCloth2.VirtualMesh+Mapping_CalcDirectWeightJob.Execute (System.Int32 vindex) (at Assets/MagicaCloth2/Scripts/Core/VirtualMesh/Function/VirtualMeshMapping.cs:305)
    Unity.Jobs.IJobParallelForExtensions+ParallelForJobStruct`1[T].Execute (T& jobData, System.IntPtr additionalPtr, System.IntPtr bufferRangePatchData, Unity.Jobs.LowLevel.Unsafe.JobRanges& ranges, System.Int32 jobIndex) (at <bdd20210bb844b2e88e1149ea99da5ef>:0)
    Unity.Jobs.LowLevel.Unsafe.JobsUtility:ScheduleParallelFor_Injected(JobScheduleParameters&, Int32, Int32, JobHandle&)
    Unity.Jobs.LowLevel.Unsafe.JobsUtility:ScheduleParallelFor(JobScheduleParameters&, Int32, Int32)
    Unity.Jobs.IJobParallelForExtensions:Run(Mapping_CalcDirectWeightJob, Int32)
    MagicaCloth2.VirtualMesh:Mapping(VirtualMesh) (at Assets/MagicaCloth2/Scripts/Core/VirtualMesh/Function/VirtualMeshMapping.cs:90)
    MagicaCloth2.<>c__DisplayClass9_1:<BuildAsync>b__0() (at Assets/MagicaCloth2/Scripts/Core/Cloth/ClothProcess.cs:611)
    System.Threading._ThreadPoolWaitCallback:performWaitCallback()

    Note: I am not in a hurry - I was just trying Magica Cloth 2 out on my character. I will study the demo characters some more and try to follow what they do more closely.
     
  11. hoshos

    hoshos

    Joined:
    Mar 7, 2015
    Posts:
    980
    I have tested various HDRP template scenes and could not reproduce the problem.

    Unity2021.3.19
    HDRP template scene
    HDRP 12.1.10
    Using HDRP Lit shader
    MagicaCloth 2.0.1

    So I have a request, can you give me a project where the problem occurs?
    If the project seems difficult, just a character with MagicaCloth set up would be fine.
    If possible, you can start a private conversation by selecting "Start a Conversation" from my account on this forum.
    There, you don't have to worry about anyone else seeing your download URL, etc.
    The data will help me to solve the problem.
     
  12. hoshos

    hoshos

    Joined:
    Mar 7, 2015
    Posts:
    980
    Hello.
    This seems to indicate that something is wrong.
    If it works correctly, the skirt should not have this strange deformation.
    First, there is an error.
    This is a fatal error: the skirt is not correctly mapped to the proxy mesh.
    It is stopped in the middle of the process.
    This error is probably the cause.
    This situation seems to be caused by the shape of the skirt mesh.

    So I have a request.
    Can you give us a project where this problem occurs?
    If a project is too difficult, just a character with MagicaCloth set up would be fine.
    If you can, you can start a private conversation by selecting "Start a Conversation" from my account on this forum.
    There, you don't have to worry about anyone else seeing your download URL, etc.
    The data will help me to solve the problem.
     
    akent99 likes this.
  13. ArawnDev

    ArawnDev

    Joined:
    Oct 26, 2016
    Posts:
    8
    How many colliders did you add to Magica Cloth V2? There is a limit of 16 colliders in the code (but you can change that value in the code), so if you hit the limit then the rest of the colliders get ignored.
     
    akent99 likes this.
  14. akent99

    akent99

    Joined:
    Jan 14, 2018
    Posts:
    588
    There might be. The VRoid character uses lots of sphere colliders along arms etc and I have a script to convert them to Magic’s cloth 2 colliders. I will try increasing the limit as a quick test. I will also create a test project and send you a direct message with a link. Thanks for the fast response! It might take me a few days to get the pruned down project complete.
     
  15. Paul-Swanson

    Paul-Swanson

    Joined:
    Jan 22, 2014
    Posts:
    323
    In ColliderComponent.cs
    Can you please change
    internal Vector3 size;
    to this instead:
    public Vector3 size;

    I altered mine so as to automatically make is match the collider to the characters already existing Capsule collider.

    Code (CSharp):
    1. using UnityEngine;
    2. using MagicaCloth2;
    3.  
    4. [RequireComponent(typeof(CapsuleCollider))]
    5. [RequireComponent(typeof(MagicaCapsuleCollider))]
    6.  
    7. public class PGS_Magica2_Setup : MonoBehaviour
    8. {
    9.     CapsuleCollider capsule;
    10.     MagicaCloth2.MagicaCapsuleCollider manipulator;
    11.  
    12.     // Start is called before the first frame update
    13.     void Start()
    14.     {
    15.         GetColliders(); setMagicaValues();
    16.     }
    17.  
    18.     void GetColliders()
    19.     {
    20.         capsule = GetComponent<CapsuleCollider>();
    21.         manipulator = GetComponent<MagicaCapsuleCollider>();
    22.     }
    23.  
    24.     void setMagicaValues()
    25.     {
    26.         //Collider Center
    27.         manipulator.center = capsule.center;
    28.         //Collider Radius and Height
    29.         //// (start radius, end radius, height)
    30.         manipulator.size = new Vector3(capsule.radius, capsule.radius, capsule.height);
    31.  
    32.         //ColliderDirection
    33.         switch (capsule.direction)
    34.         {
    35.             case 0:
    36.                 manipulator.direction = MagicaCapsuleCollider.Direction.X;
    37.                 return;
    38.             case 1:
    39.                 manipulator.direction = MagicaCapsuleCollider.Direction.Y;
    40.                 return;
    41.             case 2:
    42.                 manipulator.direction = MagicaCapsuleCollider.Direction.Z;
    43.                 return;
    44.             default:
    45.                 break;
    46.         }
    47.        
    48.     }
    49.  
    50. }
    51.  
    Unless you know of a better way to do this.
     
  16. hoshos

    hoshos

    Joined:
    Mar 7, 2015
    Posts:
    980
    The size of the collider is private due to circumstances.
    There is SetSize().
    https://magicasoft.jp/en/mc2_api_magicacapsulecollider/
     
  17. hoshos

    hoshos

    Joined:
    Mar 7, 2015
    Posts:
    980
    @ArawnDev
    @akent99

    We found that the maximum number of colliders, 16, is a little low, so we will change it to 32 in the next version.
     
  18. DigitalAdam

    DigitalAdam

    Joined:
    Jul 18, 2007
    Posts:
    1,216
  19. AetherMFP

    AetherMFP

    Joined:
    Feb 11, 2022
    Posts:
    40
    Any updates on re-adding a feature similar to reset teleportation?
    currently testing out magica cloth 2 on some animal tails and they teleport around, unlike in v1 where there was a setting to reset teleports or keep them. that keep feature made it where I can make it not teleport and have smooth fluid physics.
     
  20. hoshos

    hoshos

    Joined:
    Mar 7, 2015
    Posts:
    980
    Hello.
    Don't worry, I remember.
    And it has not been implemented yet.
    The grab function has been requested by many users so far.
    However, this feature is more difficult than we imagined and requires a lot of development time to implement.
    Therefore, it will be a while before it is implemented.
    However, it has been added to the roadmap so that we don't forget about it, so please wait a while longer.

    https://magicasoft.jp/en/mc2_roadmap/
     
  21. hoshos

    hoshos

    Joined:
    Mar 7, 2015
    Posts:
    980
    Hello.
    V2 does not yet have a controlled mode of teleportation.
    What you need is the ability to keep the state after teleportation and resume smoothly as is?
    This feature will be implemented at a later date, so please wait a while longer.
     
  22. AetherMFP

    AetherMFP

    Joined:
    Feb 11, 2022
    Posts:
    40
    Yes, I need the ability to keep the state after teleportation to keep it moving smoothly, v1 had that feature and it was a life saver to use
     
  23. hoshos

    hoshos

    Joined:
    Mar 7, 2015
    Posts:
    980
    Okay, we will definitely add it, so please wait a little longer.
     
    AetherMFP likes this.
  24. Andy888888

    Andy888888

    Joined:
    Apr 27, 2018
    Posts:
    4
    The current version uses a lot of CPU . I hope we can upgrade to the GPU version faster. Thank you so much!

    In MagicaCloth, simulations are computed on the CPU by DOTS.
    It extends this to run on the GPU.
    In most cases, the GPU can compute faster than the CPU, resulting in an overall performance improvement.
     
  25. hoshos

    hoshos

    Joined:
    Mar 7, 2015
    Posts:
    980
    Hello.
    Creating a GPU version will still take time as it requires considerable experimentation and modification.
    Therefore, it will be done last, after most of the features are in V2.
     
  26. hoshos

    hoshos

    Joined:
    Mar 7, 2015
    Posts:
    980
    Update: 2.0.2

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

    Release Note:
    Added: Added a sample scene for dressing up.
    Fix: Fixed a problem in which mapping a render mesh to a proxy mesh would fail with an error if one vertex has many other vertices connected to it.
    Fix: Fixed a bug in bone swapping API for dressing.
    Improvement: The maximum number of colliders that can be set for a single cloth has been extended from 16 to 32.

    https://magicasoft.jp/en/mc2_releasenote/
     
  27. spelafort

    spelafort

    Joined:
    May 8, 2017
    Posts:
    37
    I'm getting an issue where my cloth looks fine in the scene view (when the game is running), but in the game view it's completely jittery and broken. I'm guessing this has to do with the camera's update loop vs FixedUpdate? (Any timeline on that addition?)
     
  28. hoshos

    hoshos

    Joined:
    Mar 7, 2015
    Posts:
    980
    Hello.
    If you are using FixedUpdate() to move or animate the character, that is the cause.
    Sorry, MagicaCloth2 does not yet support FixedUpdate().
    This will be done in February.
     
    spelafort likes this.
  29. Creiz

    Creiz

    Joined:
    Jun 6, 2017
    Posts:
    131
    Hello! I'm trying to change collider parameters during runtime.

    Sometimes the skeleton of my character needs to be rebuilt.

    So I need to re-add colliders to all the bones that needs them.

    However, the colliders have different parameters such as Length, Start Radius, End Radius and Center.

    I tried copying the components from a list of gameobjects with Reflection:
    Code (CSharp):
    1. System.Reflection.FieldInfo[] fields = type.GetFields ();
    2.                             foreach (System.Reflection.FieldInfo field in fields) {
    3.                                 field.SetValue (copy, field.GetValue (component));
    However? That didn't work.

    And I can't seem to find the methods in the collider types such as MagicaCapsuleCollider.SetLength, etc. to change them "manually".

    How can I change the colliders parameters at runtime?

    EDIT: Disregard. I found a solution.

    I make a copy of the whole skeleton with the correct colliders installed. Then, when the new skeleton is rebuilt? I iterate through each bone and if they have the same name, I copy the collider component to it. The component will be reset, so I reference the old component temporarily and then copy the values.

    Here's my example, if anyone needs it:

    Code (CSharp):
    1. using System.Collections;
    2. using System.Collections.Generic;
    3. using MagicaCloth2;
    4. using UnityEngine;
    5.  
    6. public class ComponentCopier : MonoBehaviour {
    7.  
    8. /// When you set up your colliders, just duplicate all those bones and put it in another gameobject that you know won't be deleted.
    9. /// Then add all those bones to this list here in the inspector.
    10.     public List<Transform> _oldBones;
    11.  
    12.  
    13. /// We need this little snippet in order to get ALL children of a gameobject recursively. VERY handy.
    14. List<Transform> GetAllChildren (Transform parent) {
    15.         List<Transform> children = new List<Transform> ();
    16.  
    17.         foreach (Transform child in parent) {
    18.             children.Add (child);
    19.             children.AddRange (GetAllChildren (child));
    20.         }
    21.  
    22.         return children;
    23.     }
    24.     /// Let's create a temporary list here to hold the new bones that got their colliders newly added.
    25.     public List<ColliderComponent> _colTransform;
    26.  
    27.     /// This is the parent gameobject for the character skeleton.
    28.     public Transform _root;
    29.  
    30.     /// This is the MagicaCloth2 component we're configuring. Set it in the Inspector.
    31.     public MagicaCloth mg;
    32.  
    33.     /// This is the new root bone we're gonna put in later.
    34.     private Transform _newRoot;
    35.  
    36. public void SetBones () {
    37.         Debug.Log ("Started Set Bones");
    38.         /// So let's get the MagicaCloth2 parameters, here.
    39.         var sdata = mg.SerializeData;
    40.  
    41.         /// Here I clear the old references since they don't exist anymore.
    42.         sdata.rootBones.Clear ();
    43.         sdata.colliderCollisionConstraint.colliderList.Clear ();
    44.  
    45.         /// Find the Character with the rebuilt skeleton. Since I know the Character object, I set it as a parent.
    46.         GameObject papa = GameObject.FindWithTag ("CharacterWithNewSkeleton");
    47.         _root = papa.transform.Find ("Root");
    48.  
    49.         /// The work starts here. If we found the new skeleton, let's go!
    50.         if (_root != null) {
    51.  
    52.             /// Remember the handy method?
    53.             List<Transform> _newBones = GetAllChildren (_root);
    54.  
    55.             /// So for each bone in _newBones, see if there's a matching name in _oldBones.
    56.             foreach (Transform ti in _newBones) {
    57.                 Debug.Log ("Current Object in _root: " + ti);
    58.                 if (ti.name == "_jiggleRoot") {
    59.                     _newRoot = ti.transform;
    60.                 }
    61.  
    62.                 /// Remember here: ti is the bone in _newBone and t is the bone in the _oldBones list.
    63.                 foreach (Transform t in _oldBones) {
    64.                     if (ti.name == t.name) {
    65.                         /// We found a match!
    66.  
    67.                         /// Reset the size variable just in case.
    68.                         Vector3 size = new Vector3 (0, 0, 0);
    69.                         /// Copy every single component. Go nuclear. Eff it.
    70.                         Component[] components = t.GetComponents<Component> ();
    71.                         foreach (Component component in components) {
    72.                             /// Skip copying Transform component since it is already handled. Not so nuclear, though.
    73.                             if (component is Transform)
    74.                                 continue;
    75.  
    76.                             /// Copy the component to the newBone.
    77.                             System.Type type = component.GetType ();
    78.                             Component copy = ti.gameObject.AddComponent (type);
    79.  
    80.                             /// Let's initialize a bool here, just so we can check which kind of collider we're getting.
    81.                             bool _isCapsule = false;
    82.  
    83.                             /// Let's try to find out which collider was just copied to the _newBone bone.
    84.                             ti.TryGetComponent<MagicaCapsuleCollider> (out MagicaCapsuleCollider _mcc);
    85.                             ti.TryGetComponent<MagicaSphereCollider> (out MagicaSphereCollider _msc);
    86.  
    87.                             /// So if we found a Capsule Collider, _isCapsule is indeed true. If not? Then it's the Sphere Collider.
    88.                             if (_mcc != null) { _isCapsule = true; }
    89.                             if (_msc != null) { _isCapsule = false; }
    90.  
    91.                             /// If we didn't find any, like both are null? Then move along, bruv.
    92.                             if (_mcc == null && _msc == null) { continue; }
    93.  
    94.                             /// OK We have the capsule collider! Sweet! Copy the values from the _oldBones bone to the _newBones bone.
    95.                             if (_isCapsule) {
    96.                                 MagicaCapsuleCollider mccTarget = t.GetComponent<MagicaCapsuleCollider> ();
    97.                                 size = mccTarget.GetSize ();
    98.                                 _mcc.radiusSeparation = true;
    99.                                 _mcc.center = mccTarget.center;
    100.                                 _mcc.SetSize (size);
    101.                             }
    102.  
    103.                             /// It wasn't a capsule collider. No matter, it's the Sphere one. Still get to work.
    104.                             if (!_isCapsule) {
    105.                                 MagicaSphereCollider mccTarget = t.GetComponent<MagicaSphereCollider> ();
    106.                                 size = mccTarget.GetSize ();
    107.                                 _msc.center = mccTarget.center;
    108.                                 _msc.SetSize (size);
    109.                             }
    110.  
    111.                             /// Not necessary but I'm paranoiac so I'd rather null these *just in case*.
    112.                             _mcc = null;
    113.                             _msc = null;
    114.                         }
    115.  
    116.                         /// finally get the whole bone and get the collider component, whichever it is and add it to the Collider temporary List.
    117.                         ColliderComponent cc = ti.GetComponent<ColliderComponent> ();
    118.                         _colTransform.Add (cc);
    119.  
    120.                     }
    121.                 }
    122.             }
    123.  
    124.             /// Now that we went through ALL the bones, this list is complete. Copy everything here to the MagicaCloth2 component.
    125.             foreach (ColliderComponent cp in _colTransform) {
    126.                 sdata.colliderCollisionConstraint.colliderList.Add (cp);
    127.             }
    128.             /// When it's done? Clear the list. Just in case.
    129.             _colTransform.Clear();
    130.  
    131.         }
    132.         /// Add the new root bone of the jiggle bonanza we want.
    133.         sdata.rootBones.Add (_newRoot);
    134.  
    135.         /// And finally? Tell MagicaCloth2 its parameters have changed, so have at it.
    136.         mg.SetParameterChange();
    137.     }
     
    Last edited: Feb 22, 2023
  30. hoshos

    hoshos

    Joined:
    Mar 7, 2015
    Posts:
    980
    Hello.
    Your code is correct.
    The capsule collider has a SetSize().
    The API is also summarized in the documentation, which you can find here.
    https://magicasoft.jp/en/mc2_api-2/
     
    Creiz likes this.
  31. hoshos

    hoshos

    Joined:
    Mar 7, 2015
    Posts:
    980
    Announcement

    MagicaCloth2 documentation is now complete.
    It includes information on how to build the runtime, how to change parameters, and how to implement the dress-up process.
    We have also included performance topics.

    https://magicasoft.jp/en/magica-cloth-2-2/
     
    Creiz likes this.
  32. punk

    punk

    Joined:
    Jun 28, 2013
    Posts:
    408
    @hoshos Any idea what this means

    upload_2023-2-24_20-55-24.png

    it shows up when I add a skinned mesh renderer
     
  33. hoshos

    hoshos

    Joined:
    Mar 7, 2015
    Posts:
    980
    Hello.
    This error is output when the size of the render mesh is almost zero.
    How many vertices and what shape is this ACTORS mesh?
     
  34. MrNani

    MrNani

    Joined:
    Jun 20, 2020
    Posts:
    6
    Hello,
    I can‘t find MagicaAreaWind component in unitypackage.
    Is it published?
     
  35. hoshos

    hoshos

    Joined:
    Mar 7, 2015
    Posts:
    980
    Hello.
    V2 does not yet have wind capabilities.
    However, it has been added to the roadmap as a priority.
    https://magicasoft.jp/en/mc2_roadmap/

    If all goes well, it will probably be implemented around April.
    Until then, please wait a little longer.
     
  36. punk

    punk

    Joined:
    Jun 28, 2013
    Posts:
    408
    upload_2023-2-24_23-7-37.png

    Not sure if it helps, but it works with the built in unity cloth

    also scale is correct
     
    Last edited: Feb 24, 2023
  37. punk

    punk

    Joined:
    Jun 28, 2013
    Posts:
    408
  38. hoshos

    hoshos

    Joined:
    Mar 7, 2015
    Posts:
    980
    Thank you for the picture.
    It looks normal.
    Can I borrow the FBX file of this character to investigate the cause?
    No materials or textures are needed.

    If possible, you can start a private conversation by selecting "Start a Conversation" from my account on this forum.
    There, you don't have to worry about anyone else seeing your download URL, etc.
     
  39. Nirvan

    Nirvan

    Joined:
    Nov 16, 2013
    Posts:
    134
    Wow, I am surprised how great performance the plugin has.
    You can't feel the FPS are touched even a bit (using bone cloths).
    Is it because of something like managing all target animated data into few great arrays instead of dozens smaller ones? (like optimizing 'NativeArray<JobHandle> updateHandles' to few handles instead of tones of them?)
    Just curious since I starting with DOTS and searching for best performance tips.
     
    Last edited: Feb 24, 2023
  40. QbAnYtO

    QbAnYtO

    Joined:
    Dec 18, 2016
    Posts:
    223

    I will stick to V1 as it works beautifully :)

    Maybe i'll come back to V2 later.
     
  41. hoshos

    hoshos

    Joined:
    Mar 7, 2015
    Posts:
    980
    Hello.
    The most effective way to do this is to calculate a job at a time with fewer jobs instead of dividing it into smaller jobs.
    MagicaCloth combines and manages each cloth component in one large array.
    This means that a large number of cloth components can be calculated with a small number of jobs.
    The number of jobs should be reduced anyway.
     
    Nirvan likes this.
  42. kaniballo

    kaniballo

    Joined:
    Sep 2, 2013
    Posts:
    8
    Hi i just try Magica Cloth 2 - ,... and have 2 questions...
    1. from performance point - in Magica Cloth 1, there was Physical manager we can enable/disable - to control cloth simulation on/off - in Magica Cloth 2 i don't see such a thing - after disable MC 2 Game Object, in Profiler, there is Magica Manager process who continue to work at eat precious resource - i my case 0.8-1.0 ms. on sample scene.

    2. Give back - Paint Vertex - precious FILL button - it very convenient to fill object with all "green/moving" vertex and mark only red/don't move - ya i read about texture feature but is more complicated and no so practical :) - also size on paint vertex look good if we paint Game Object 1-2 m. caliber - if object is 5-10m (curtain) - painting vertex don't see(can be fix in script).

    After fast simple Profiling difference between MC1 an MC2 (build), same test scene - 1 Mesh Cloth object (200 vertexes) - MC 2 give worse performance with 0.4-0.6 ms - may be i'm wrong i was not deep try Profiling (many type object, multiple count cloth etc...).
    ,... MC2 look more better structured then MC1 - but for me MC1 is more practical - on these stage ...
     
  43. hoshos

    hoshos

    Joined:
    Mar 7, 2015
    Posts:
    980
    Hello.
    Thank you for your input.
    I will answer your questions.

    (1)
    It is not good that the process occurs even if all cloth components are disabled.
    This is an item that needs to be improved.
    I will add it to the work.

    (2)
    The [Fill] button is easy to implement, but I did not want to add more buttons, so I dropped it.
    However, I will consider whether to reimplement it while listening to other users' opinions.

    Finally, about performance.
    V2 is slightly slower than V1.
    This is true.
    However, please understand that this is a measure to make the algorithm more robust.
    Also, there is a slight problem with performance measurement in the Unity editor.
    It is because it is slower than at build time due to the extra monitoring.
    If you are interested in this topic, please refer to the following documentation
    https://magicasoft.jp/en/mc2_performance/
     
  44. Spikebor

    Spikebor

    Joined:
    May 30, 2019
    Posts:
    289
    Hi, can I have an example code to add/remove colliders at runtime?
    Use case would be to interact with spawn enemies. When they go in a trigger we'll add them to collider list, when they exit we remove. So the add/remove colliders happen constantly in a busy battle.

    I notice the Colliders in ColliderCollision is ColliderComponent not Unity's Collider.
     
  45. hoshos

    hoshos

    Joined:
    Mar 7, 2015
    Posts:
    980
    Hello.
    The runtime collider addition/removal is summarized in the following document
    https://magicasoft.jp/en/mc2_runtimechanges/

    The documentation also describes how to create and dress MagicaCloth components at runtime, if you are interested.
    https://magicasoft.jp/en/mc2_runtime_build/
    https://magicasoft.jp/en/mc2_dressup/

    Also, the first page of this forum shows how other users have done it.
    Please also see this page.
    https://forum.unity.com/threads/released-magicacloth2-hybrid-cloth-simulation.1395865/#post-8805985
     
  46. Faisal_Azizi_

    Faisal_Azizi_

    Joined:
    Feb 5, 2021
    Posts:
    25
    Hi! I am trying to find a way to use magica cloth 2 for a character that has multiple lods. the problem i am facing is that with my current system the lods are generated automatically and i am trying to make the adding of magica cloth automated as well. i was wondering is it possible to use the same (fixed)(moving)(neutral) points of one mesh cloth to all of the lods beneath it. AKA is it possible to use the same vertex points for multiple meshes of the same character.
     
  47. Fearinhell

    Fearinhell

    Joined:
    Oct 2, 2021
    Posts:
    17
    Hello all, I was using Magicacloth 1 and just happened to see a version 2 was out so I purchased it. I didnt uninstall magicacloth 1 and have tried just installing version 2 and Im getting 35 errors right after install. Can they both be installed at once? I am using the the latest burst and collections and magicacloth 1 was working great. Oh also the latest 2021.3 version of unity. Here is one of the errors
    Assets\MagicaCloth2\Scripts\Core\Cloth\Constraints\MotionConstraint.cs(172,38): error CS0246: The type or namespace name 'IJobParallelForDefer' could not be found (are you missing a using directive or an assembly reference?)

    Thanks
     
  48. hoshos

    hoshos

    Joined:
    Mar 7, 2015
    Posts:
    980
    Hello.
    Forgive me if this is the wrong answer due to translation.
    Unfortunately, MagicaCloth does not support LOD.
    Therefore, it is not possible to tie one MeshCloth to multiple LOD meshes.
    Currently you have to configure MagicaCloth for all LODs and switch manually.
     
  49. hoshos

    hoshos

    Joined:
    Mar 7, 2015
    Posts:
    980
    Hello.
    V1 and V2 can be mixed in one project.
    This error is probably due to some outdated Burst or Collections packages.
    Please try updating the packages to the latest version by following the instructions below.
    Note that we assume that you are using the latest versions of both V1 and V2.

    (1) Back up your project
    Be sure to back up your project before you begin work!

    (2) Uninstall the package
    Remove all of the following 4 packages from InProject in PackageManager.
    * Burst
    * Collections
    * Jobs
    * Mathematics

    (3) Install the packages
    Then reinstall the two packages as follows
    * Burst
    * Collections
    https://magicasoft.jp/en/mc2_install/#What_to_do_when_an_error_occurs

    (4) Restart the editor

    However, if V1 and V2 are co-located, you will have two similar systems running at the same time.
    This will result in very poor performance.
    Please be careful about this.
     
  50. hoshos

    hoshos

    Joined:
    Mar 7, 2015
    Posts:
    980
    Update: 2.0.3

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

    Release Note:
    Added: Added UpdateMode to MagicaCloth component. This allows you to change the way simulation times are updated.
    https://magicasoft.jp/en/mc2_magicacloth_updatemode/
    update2-0-3-1.jpg
    Added: Added UnityPhysics to UpdateMode. Use this if the character is updated at the timing of FixedUpdate().
    Added: Added Unscaled to UpdateMode. A time update mode that is not affected by Unity's timescale.
    Added: It is now possible to register OnPreSimulation/OnPostSimulation callback functions in MagicaManager.
    https://magicasoft.jp/en/mc2_api_magicamanager/
    Added: It is now possible to register the OnBuildComplete callback function in the MagicaCloth component.
    https://magicasoft.jp/en/mc2_api_magicacloth/
    Fix: Fixed an issue where deleting one of the syncing cloth components would cause an error.
    Fix: Fixed a rare issue where synced cloth execution timings were out of sync.
    Fix: Fixed an issue where the [Movement Speed Limit], [Rotation Speed Limit], and [Particle Speed Limit] inertia parameters were unchecked when multi-selecting cloth components.


    https://magicasoft.jp/en/mc2_releasenote/