Release Notes

Added: Negative scale is now supported. Negative scale can be set for only one axis, XYZ.
Improvement: Some presets were readjusted.
Improvement: The push direction of the plain collider is now displayed.
Fixed: Fixed a problem that the collider works even if it is disabled from the beginning.

Added: Added inertia smoothing function. It is possible to reduce the disturbance of the cloth due to sudden movement. It can be adjusted with the “World Inertia Smoothing” parameter in the inertia panel.

Added: Added AnimatorLinkage to UpdateMode. Automatically sets the appropriate update mode in conjunction with the character’s Animator.

Fixed: Fixed an issue where assert logs were displayed when a component was destroyed during runtime build initialization. Note that this assertion has no effect on operation.
Improvement: Adjusted the inertial smoothing parameters of UnityChanKAGURA.
Improvement: Adjusted inertial smoothing parameters for each preset.
Improvement: Changed UpdateMode of sample UnityChanKAGURA to AnimatorLinkage.

Fixed: When using the culling function with Animator’s CullMode set to “Cull Update Transforms”, we fixed an issue where the simulation would not restart once it was removed from the camera.

Added: Added anchor function. This nullifies the inertia of certain objects. Can be used for moving floors and vehicles. You can also adjust the strength of the anchor.

Fixed: Fixed an issue where the simulation would go wild when lag occurred due to load.
Fixed: Fixed an issue where the effect of moving wind was weakened during slow playback.
Fixed: Fixed an issue where the simulation would be distorted when the character moved during slow playback.
Improvement: Changed the initialization timing of MagicaCloth from Awake() to Start(). This makes it easier to process the data before initialization. This setting can also be changed back to Awake() using MagicaSettings and API.
Improvement: Increased the execution order of MagicaCloth component (+5). MagicaCloth components run after regular MonoBehaviour components.
Improvement: Changed the execution order of MagicaSettings component to (-50). MagicaSettings components are executed before regular MonoBehaviour components.

Fixed: Fixed an issue where BoneWeights were written to the mesh every frame when using MeshCloth. This is an enbug in v2.5.1.
Please update as soon as possible as this issue will significantly impact performance.
Fixed: Fixed an issue where the BoneWeights of the mesh would not return correctly if two or more MeshCloths were used in one renderer and one was stopped.

Added: Some parameters such as gravity can now be controlled from animation.

Fixed: Fixed an issue where drawing would become incorrect when using two or more MeshCloths in one renderer. This is an enbug in v2.5.0.
Fixed: Fixed an issue where the inspector might not refresh when the contents of SourceRenderers and RootBones changed.
Fixed: Fixed an issue where the mesh would be broken due to precision issues with floating point arithmetic when calculating TriangleBend.
Fixed: The format of PreBuild has been changed. Previous PreBuild data will no longer be available.

Added: Added pre-build feature. By constructing cloth data at the time of editing and turning it into an asset, it is possible to immediately start simulation at runtime.

See Using Prebuilds for more information.
Fixed: Fixed an issue where the OnComplete event was not called correctly after completing cloth data construction.
Fixed: Fixed an issue where the reduction algorithm would cause an error in MeshCloth when there were a large number of vertices in a very narrow area of the mesh.

Added: Added SetSkipWriting() API to stop writing simulation results to Transform and Mesh. By using this function, it is possible to implement stop motion. For more information, see Using stop motion.

Added: You can now select whether to update the simulation before or after LateUpdate.

This is required when using Unity2DAnimation.
For details, please refer to Use in 2DAnimation.
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.
For more information, see Attribute settings in BoneCloth.
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.

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.

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.

Added: MAGICACLOTH2 define definition is now automatically added to the project settings.

Improvement: Added AlwaysLinkAssembly attribute to the package. The code stripping feature will no longer exclude the MagicaCloth2 package when building.
Fix: Fixed an issue where adding a collider at runtime would cause an error in some situations.
Fix: Fixed an issue where vertex paint attributes were not reflected when manually calling BuildAndRun() on BoneCloth at runtime.

Added: Added camera culling mode. When it disappears from the camera, the simulation stops and performance improves. It can be set from the “Culling” panel.

Improvement: The number of colliders that can be used in one MagicaCloth component has been expanded from 32 to unlimited.
Improvement: Improved main thread handling. Improves performance.
Improvement: The profiler now shows the processing of the main thread.

Added: Added a mode to change the rotation center of the capsule collider to the starting point Transform.

Added: Added teleport behavior settings to the [Inertia] panel. You can choose to automatically detect teleports and reset the simulation or keep it as is.

Added: Added mode to keep simulation to ResetCloth() API. This is useful for teleporting while maintaining posture.
Improvement: Inertia settings separated into two parts: world inertia and local inertia. World inertia corresponds to the movement of the entire character, while local inertia corresponds to the movement of the cloth inside the character. This also makes it possible to completely eliminate the effects of character movement.

Improvement: Inertia parameter “Movement Inertia” changed to “World Inertia”.
Improvement: The inertia parameter “Rotation Inertia” has been removed.
Improvement: “Movement Speed Limit” in inertia parameter changed to “World Movement Speed Limit”.
Improvement: “Rotation Speed Limit” in inertia parameter changed to “World Rotation Speed Limit”.
Improvement: Fixed the problem that the accuracy of the internal time drops when running for a long time.
Improvement: Readjusted UnityChanKAGURA due to inertia specification change.
Fix: Fixed a rare issue where triangles would point in the wrong direction when reflecting from a proxy mesh to a render mesh.
Fix: Fixed an issue where moving wind did not include scale effects.

Added: Added AddForce() API to apply external force.
Improvement: Improved BoneCloth’s mesh connection algorithm.
Fix: Fixed an issue where an error would occur if two vertices were at exactly the same position.
Fix: Fixed an issue where the SkinnedMeshRenderer’s bone list contained (null) not working. This is a bug in the verification algorithm enhanced in v2.1.8.
Fix: Fixed position not resetting correctly when disabling/enabling colliders.

Important Note: A warning message is now displayed when the vertex weight of the skinning mesh used in MeshCloth uses 5 or more bones. Up to 4 weights are allowed per vertex and more are ignored. This is the specification from the beginning of the release.
Fix: Fixed an issue that caused an error in Unity 2023.1.5 and higher versions.
Fix: Worked around an issue where conflicts such as window IDs would cause errors when other external assets draw GUIs in the scene view.
Fix: Fixed a rare error that occurred when a character was deleted while creating cloth data.
Improvement: Supported help button in MagicaSettings component. I can open the document.

Fix: Fixed an issue where proxy mesh normal calculation was wrong. This solves the problem of distorted irregularities and shadows on the display mesh.
Fix: Fixed a rare issue where a division by 0 error occurred when calculating tangents for proxy meshes.
Fix: Fixed a rare divide-by-zero error in TriangleBending constraints.
Fix: Fixed an internal error that occurred when the capsule collider had a length of 0.
Fix: Fixed a rare issue where a division by 0 error occurred when vertices collided with multiple colliders during collider collision detection.

Added: Added MagicaSettings component. This component allows you to change system settings without writing code.

Added: You can now change the simulation frequency and maximum number of frame updates. Lowering this value can reduce the simulation load. However, if you lower the frequency, the accuracy of the simulation will also decrease, so be careful.
Added: Supported the help button in the inspector. Documents can be opened quickly.
Improvement: The log of the menu Tools/MagicaCloth2/ManagerInformation is now output as a text file. The file will be saved as MagicaCloth2_SysInfo_x in the project folder. This function is for collecting information when a problem occurs, so it is not usually used.
Fix: Fixed a rare case where a division by 0 error occurred when calculating normals and tangents of proxy meshes, causing the meshes to disappear.
Fix: Fixed an error that occurred when the Transform number was 1 in BoneCloth.
Fix: Fixed an issue where meshes using only blendshapes without skinning would cause an error.

Added: Added [Manager Information] to the editor menu. This is for internal information gathering in the event of a problem and does not affect normal usage.
Fix: Fixed a memory leak and crash that occurred when all vertices of a render mesh registered due to invalid attributes were eliminated in MeshCloth.
Fix: Fixed a memory leak and crash that occurred when the number of vertices of the render mesh registered by reduction became 0 in MeshCloth.
Fix: Fixed a memory leak with disposing of cloth components.
Fix: Fixed an issue where simulation would malfunction and crash if more than 1024 cloth components were running at the same time. The number of cloth components that can be used at the same time will be 4096, and any more will stop working.
Fix: In MeshCloth, the reduction distance is calculated from the bounding box of the entire mesh, but the second and subsequent meshes in the list were excluded from the calculation.
Fix: Fixed an issue where user-defined vertex attribute data was being ignored when generating BoneCloth at runtime.

Fix: Fixed an issue where some gizmos were not displayed when cloth-editing due to the fix made in v2.1.3.

Fix: Fixed an issue where Transform specified as an invalid attribute in BoneCloth was not completely invalidated and some functions were working.
Fix: Fixed the problem that the calculation becomes NaN and the display mesh is broken when the normal and tangent of MeshCloth’s original render mesh are completely in the same direction or in the opposite direction.
Fix: Fixed an issue that caused an error when calculating MeshCloth’s vertex weights.
Fix: Fixed an issue where changing the character scale at runtime would break the display mesh.

Improvement: Changed MagicaPhysicsManager.OnPreSimulation event call location to correct location.
Improvement: Changed to automatically execute speed stabilization process after simulation reset.
Improvement: Fixed an issue where some system jobs were still working even with all cloth components disabled.
Improvement: Changed to reset the simulation when enabling disabled cloth components.
Fix: Fixed a rare app crash when a component was destroyed during cloth data construction.
Fix: Fixed a rare memory leak when a component was destroyed during cloth data construction.
Fix: Fixed an issue where disabling a cloth component, changing its position, and enabling it would cause the simulation to distort.
Fix: Fixed a rare error in the Collider Manager when ending play in the editor.
Fix: Fixed rare assert issue with VirtualMeshManager.CalcTriangleNormalTangentJob.
Fix: Fixed an issue where GetHashCode() would cause an error when using external assets such as Odin.

Fix: Fixed an issue where the sway period was disturbed when the wind force fluctuated.

Added: Added wind system. You can specify the area affected by the wind and control how each component is affected by the wind.
Added: Added wind system sample scene.
Improvement: Retuned UnityChanKAGURA for wind system.
Improvement: Extended SimpleDistance and ShapeDistance distances in reduction settings
Improvement: Changed to inherit the name of the parent object when adding a collider.
Fix: Addressed a rare collider manager error when stopping execution in the Unity editor.
Fix: Fixed an issue where resizing with SetSize() on Capsule Colliders would misbehave.

Added: Added Fill button to vertex paint. It is possible to fill all points at once.
Added: Added Through function to vertex paint. This feature allows you to fill points in the cursor range regardless of depth.
Added: Added an API (GetCenterPosition) to get the center position of the cloth. This is the position of the purple gizmosphere, which is the center of inertia coordinate.
Added: Added a property (blendWeight) to the ClothSerializeData class that sets the blend ratio of the cloth’s original posture and simulation posture.
This property is an internal variable only and should be accessed from the script.
Improvement: The issue of vertices being pushed violently at the start of the simulation when cloth and colliders overlap during initialization and reset has been greatly improved.
This is adjustable from the inspector as the StablizationTime property.
Improvement: Supported the latest version of Collections2.x package. Please install 2.1.0-pre.11 or higher when using Collections2.x.

Fix: Fixed an issue where disabling a MagicaCloth component would not stop writing to the associated Transform.
Fix: Fixed the problem that the coordinates of the paint map were shifted when using the paint map with MeshCloth and the Transform pose of the target renderer was not the unit pose.

Fix: Initialization fails when vertices have only invalid attributes.
Fix: Information in inspector was not updated correctly when RendererList or PaintMapList was changed.
Fix: PaintMap allocation fails when UV value of mesh is not (0.0~1.0).

Fix: When a mesh does not exist in the Renderer specified in MeshCloth, an internal error occurs and the operation becomes unstable.
Fix: Internal error occurs and drawing becomes black when tangent line does not exist on the mesh specified by MeshCloth.
Fix: The algorithm for mapping a render mesh to a proxy mesh in MeshCloth is incorrect, causing artifacts such as shading in drawings.

Added: Added UpdateMode to MagicaCloth component. This allows you to change the way simulation times are updated.

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.
Added: It is now possible to register the OnBuildComplete callback function in the MagicaCloth component.
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.

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.

Fix: Fixed an issue where using the Enter Play Mode Options would cause strange behavior on subsequent runs.
Fix: Fixed vertex paint cursor disk misorientation.
Improvement: Added version notation to MagicaCloth component.

First release.