Update v3: Detects and tracks clothes properly, now compatible with shared scenes. You can now invert or turn off each range and ignore specific clothes. Note the new naming convention of the asset.
Hello Darlings!
It's been a while.
TLDR: This plugin lets you control the rigidity of clothing within X, Y, and Z bounds. You can animate it in Timeline, but be wary of cpu usage as it iterates all cloth vertices when a change is made (but you can clamp the updates per second).
---------
As some of you know, I've been working on a precision clothing sim tool, updating in the plugins section of the forums for some time. I've been robbed of time as of late, and so rather than keep you waiting even longer I decided to give this early sample of the plugin and how it works. The core is simple in case you wanted to explore simulation altering yourself -- in fact the most complicated part of this plugin has been loading, tracking, and detecting clothing changes, accounting for easily 70% of the code.
v2 alpha video above, the premise is the same but the UI and features have improved.
How To Use It
Add the plugin to a character.
Customize or animate your cutoff bounds by altering the min / max sliders for the axes you want to affect the clothes. You can tell it to ignore specific clothing items, and you can constrain the plugin to a specific bounding box in what we will call Character Space.
Character space is a coordinate system relative to the original T-pose. This means X values will always go from fingertips to elbow, to shoulder, and it doesn't matter what pose or rotation the character is in, it will follow the fingertips to the elbows then to the shoulder. The same goes with Y values going foot-to-head. As a result, whatever cutoff settings you set up in one pose will be exactly the same in every other pose, and the plugin won't have to do any work unless it changes.
Max Sim Value Affected:
When it first loads clothes, the plugin pays attention to the default rigidity of each point. You can use this slider to only affect vertices that are under a certain initial rigidity value. To affect everything, keep it at 1. For example, moving the slider to 0.5 will cause the plugin to ignore vertices that are more initially rigid than 0.5.
Clothing Filters
This button loads a page where you can turn off the plugin for specific clothing items. It will remember up to 20 clothing items that are no longer worn, in case you want to add them later but keep your filter. Toggles for clothing not currently worn are grey, and won't be saved/loaded with the scene (or shouldn't be <,<)
Constant Multiplier:
Multiplies the base rigidity by this amount. Low values will loosen the clothing as a whole, while higher values will tighten it.
Cutoff Min / Max
These are the "main" sliders. They determine where the rigidity finally becomes zero. They multiply with each other, so if a vertex is outside of any of the cutoff ranges (or inside for inverted modes), it will be loose.
These thresholds represent meters along a direction in the T-pose of the clothing, in character space as defined above.
In case you aren't familiar with spatial axes: X is side to side, Y is up and down, and Z is back and forward.
Note: these directions relate to the original T-pose, not the current pose. That means no matter where the character is or what pose they're in, the X cutoff will travel from hand to shoulder, and the Y cutoff will travel from foot to head.
Cutoff Modes:
These dropdowns let you modify how the cutoff ranges behave.
These give you further control over the area of effect. Any vertices outside of these bounds will not be modified by the plugin. This lets you do vertical cutoffs for just the center of mass, for example, to prevent sleeves from being affected. It also makes it a little cheaper to calculate. Currently, the edge of the bounds has no falloff, so it's a hard limit where things will suddenly become ignored. Something I'd like to improve.
Falloff:
This is an exponential multiplier for the gradient between the vertex and the cutoff point. A low value will result in a sharper cutoff point, and a high value will have a gradual effect as the cutoff approaches.
Update Rate:
A limit to how many times per second changes can be applied, for performance. High values mean a higher number of changes per second. Note that anything under 1 is treated as uncapped / as fast as possible. By default it's set to update as often as 20 times per second. If no changes are made, it doesn't do anything. If it detects a change in a value more than 0.01, it will update the next chance it gets.
Reload Clothing:
Essentially similar to the old "Reset Sim Cache" button, except you won't have to use it so much anymore. Mainly it's useful if your clothing library has changed while you were in the scene, so the plugin can listen for the new clothes. This button is like reloading the plugin but it keeps your settings and filters. Internally it clears all the vertex caches and all knowledge of clothing it had except for whether or not the current clothing was ignored. It then reloads the whole clothing library to refresh subscriptions and detect what's active.
Known Issues
Special thanks again to @everlaster for script input, and @Acid Bubbles as always for Timeline.
Ciao, lovelies
Hello Darlings!
It's been a while.
TLDR: This plugin lets you control the rigidity of clothing within X, Y, and Z bounds. You can animate it in Timeline, but be wary of cpu usage as it iterates all cloth vertices when a change is made (but you can clamp the updates per second).
---------
As some of you know, I've been working on a precision clothing sim tool, updating in the plugins section of the forums for some time. I've been robbed of time as of late, and so rather than keep you waiting even longer I decided to give this early sample of the plugin and how it works. The core is simple in case you wanted to explore simulation altering yourself -- in fact the most complicated part of this plugin has been loading, tracking, and detecting clothing changes, accounting for easily 70% of the code.
v2 alpha video above, the premise is the same but the UI and features have improved.
How To Use It
Add the plugin to a character.
Customize or animate your cutoff bounds by altering the min / max sliders for the axes you want to affect the clothes. You can tell it to ignore specific clothing items, and you can constrain the plugin to a specific bounding box in what we will call Character Space.
Character space is a coordinate system relative to the original T-pose. This means X values will always go from fingertips to elbow, to shoulder, and it doesn't matter what pose or rotation the character is in, it will follow the fingertips to the elbows then to the shoulder. The same goes with Y values going foot-to-head. As a result, whatever cutoff settings you set up in one pose will be exactly the same in every other pose, and the plugin won't have to do any work unless it changes.
Max Sim Value Affected:
When it first loads clothes, the plugin pays attention to the default rigidity of each point. You can use this slider to only affect vertices that are under a certain initial rigidity value. To affect everything, keep it at 1. For example, moving the slider to 0.5 will cause the plugin to ignore vertices that are more initially rigid than 0.5.
Clothing Filters
This button loads a page where you can turn off the plugin for specific clothing items. It will remember up to 20 clothing items that are no longer worn, in case you want to add them later but keep your filter. Toggles for clothing not currently worn are grey, and won't be saved/loaded with the scene (or shouldn't be <,<)
Constant Multiplier:
Multiplies the base rigidity by this amount. Low values will loosen the clothing as a whole, while higher values will tighten it.
Cutoff Min / Max
These are the "main" sliders. They determine where the rigidity finally becomes zero. They multiply with each other, so if a vertex is outside of any of the cutoff ranges (or inside for inverted modes), it will be loose.
These thresholds represent meters along a direction in the T-pose of the clothing, in character space as defined above.
In case you aren't familiar with spatial axes: X is side to side, Y is up and down, and Z is back and forward.
Note: these directions relate to the original T-pose, not the current pose. That means no matter where the character is or what pose they're in, the X cutoff will travel from hand to shoulder, and the Y cutoff will travel from foot to head.
Cutoff Modes:
These dropdowns let you modify how the cutoff ranges behave.
- OFF: this cutoff range is not used. Improves performance a little.
- Normal: vertices outside this range are loose
- Inverted: vertices inside this range are loose
These give you further control over the area of effect. Any vertices outside of these bounds will not be modified by the plugin. This lets you do vertical cutoffs for just the center of mass, for example, to prevent sleeves from being affected. It also makes it a little cheaper to calculate. Currently, the edge of the bounds has no falloff, so it's a hard limit where things will suddenly become ignored. Something I'd like to improve.
Falloff:
This is an exponential multiplier for the gradient between the vertex and the cutoff point. A low value will result in a sharper cutoff point, and a high value will have a gradual effect as the cutoff approaches.
Update Rate:
A limit to how many times per second changes can be applied, for performance. High values mean a higher number of changes per second. Note that anything under 1 is treated as uncapped / as fast as possible. By default it's set to update as often as 20 times per second. If no changes are made, it doesn't do anything. If it detects a change in a value more than 0.01, it will update the next chance it gets.
Reload Clothing:
Essentially similar to the old "Reset Sim Cache" button, except you won't have to use it so much anymore. Mainly it's useful if your clothing library has changed while you were in the scene, so the plugin can listen for the new clothes. This button is like reloading the plugin but it keeps your settings and filters. Internally it clears all the vertex caches and all knowledge of clothing it had except for whether or not the current clothing was ignored. It then reloads the whole clothing library to refresh subscriptions and detect what's active.
Known Issues
- Not the fastest gun in the west
The more advanced performance enhancements like threading, deferred updates, or staggered sim iteration are not in place. When a change is detected, it brute-force iterates all vertices of the sim clothing on the character, at a rate per second you define. It only does this for one frame for any change, but if you are actively changing sliders or animating them, you may detect performance issues (let me know when you do!). I think since the work is being done in the plugin script that it's CPU-bound (as opposed to GPU bound), so it may not be competing with many other expensive operations.
- No effect on vertices that are "Undressed"
Undress currently overrides the rigidity set by this plugin by breaking the simulated joints. I may examine this.
Special thanks again to @everlaster for script input, and @Acid Bubbles as always for Timeline.
Ciao, lovelies