CUA Clothing

Plugins CUA Clothing

Stopper

Invaluable member
Featured Contributor
Messages
359
Reactions
4,541
Points
123
Stopper submitted a new resource:

CUA Clothing - Putting on clothing creates a CUA and attaches to cloth or body

This plugin allows CUAs to be loaded along when clothing is put on. The CUA can be attached to bones, skin, or the loaded clothing item, similar to https://hub.virtamate.com/resources/attach-to-vertex.45482/

Usage
If you haven't worked with clothing plugins before, please look over the overall guide here:

  1. Add to item as clothing...

Read more about this resource...
 
Stopper updated CUA Clothing with a new update entry:

Hair Plugin Functionality

  • Can now be used as a hair plugin
  • Hair attachment has two particle nodes: Physics and Render
    • Physics particles don't account for curve / strand density but also stay positioned correctly when those are altered.
    • Render particles will follow hair more closely, but will break when changing curve density

View attachment 355510

Read the rest of this update entry...
 
This is awesome! Possibilities are pretty much endless.
I think a scale slider and collision checkbox would be really useful for this plugin as well.
 
Is there any chance to save cua plugins information? For example, I load clothing with CUA, this CUA has bones, I add CUA Controllers plugin but when I reload clothing it loses plugin on CUA.
I mean is there any way to save information that CUA have in plugin tab?
 
Is there any chance to save cua plugins information? For example, I load clothing with CUA, this CUA has bones, I add CUA Controllers plugin but when I reload clothing it loses plugin on CUA.
I mean is there any way to save information that CUA have in plugin tab?
I think an "easy" way to implement this would be to provide the ability to choose a CUA preset instead of assetbundle + asset.

EDIT: Hm a CUA preset doesn't store physics properties, it seems.
 
Last edited:
The offset increments are too big. I can't position the CUA precisely. Even when I try to enter the number manually, it just gets rounded:



Also, there's no slider for scale, and a coloring UI similar to ColorScale plugin would also be nice, since we can't add plugins to these CUAs.

And after the clothing is removed/disabled, the CUA isn;t cleared, and entry stays in the Atom list as a hidden item, which pollutes the scene. This is also really annoying since I can't edit/replace the assetbundle on disk without going to atom list and removing every leftover CUA manually.

Another issue: if I re-enable clothing, it seems it's rotation is not applied correctly. You can see it here based on hinge joint limits being different:

 
Last edited:
I wonder if attaching a subscene instead of a CUA could solve most of this:
  • VAM is already capable of saving and restoring the full state of a subscene and all the atoms it contains.
  • The subscene doesn't need additional translation. Instead modify the local translation of child atoms via VAM's default UI with the precision that provides.
  • Add as many atoms (CUAs, lights, whatever) to the subscene as we like at basically no extra cost, only the subscene gets attached to a vertex.
  • Add as many plugins to those atoms as we like (ColorScale, UnityAssetVamifier, BlendShapes, Glowtime, CUA Animations Controller etc.).
  • Subscene content can be switched out via script (via Timeline for example).
The only downside is that a simple CUA would require at least two atoms, the subscene and the CUA itself. Maybe an option to auto-hide child atoms would be useful?
 
I already don't like the atom list pollution this solution causes, and this would double it :(

The other downside is that it's already incredibly frustrating to setup this kind of clothing items. If I also have to create a subscene for each of the ~50 piercings in my blend file I'll shoot myself.

And from the user's perspective, it's pretty bad for them to hunt down the correct subscene and its child to customize scale or color of something, as opposed to it just being a slider in clothing item's Plugins section. And could they even customize subscene CUAs in a way that would be savable in presets/scenes? Haven't used subscenes much yet, not 100% sure how they behave.
 
Hm, ? thinking cap on...

I already don't like the atom list pollution
Doesn't CUA Clothing hide the atoms it creates by default?
The other downside is that it's already incredibly frustrating to setup this kind of clothing items.
You could speed up your process if you just set up a single item and then copy its .json files and simply switch out references into your .assetbundle and modify the attachment vertex index and CUA atom name. That works right now for clothing .vaj files and the corresponding .default.clothingplugins, too.
And from the user's perspective, it's pretty bad for them to hunt down the correct subscene
CUA Clothing names the attached atom after the clothing, doesn't it? Anything in a subscene gets its name as a prefix.
opposed to it just being a slider in clothing item's Plugins section.
Every new slider is extra programming effort and maintenance. I'd rather reuse all the CUA plugins that already exist.
And could they even customize subscene CUAs in a way that would be savable in presets/scenes?
The CUA clothing plugin could save the current subscene reference when it gets stored in a preset or saved in a scene.
But yeah, it's a little hard to explain to save modifications to a new subscene and then save the clothing to a new preset so it references the new subscene.
 
Last edited:
So I've decided to stop crying about how much I miss Stopper, and took a stab at implementing most of what I needed for my Piercings package myself.

New features

- Added automatic asset material vamification so CUAs receive shadows and reflect current VaM environment map.
- Added colorizing of materials' diffuse & specular colors.
- Added a Scale slider with custom handling for CUAs with joints in them.
- Added a "Select CUA" button.
- Added a "Point & Ctrl to attach" toggle button (hover over target point with cursor and press Ctrl to attach to it, don't forget to confirm).

Fixes

- Fixed CUA position de-sync when parenting to a bone.
- Fixed CUA position offsets & scale ignoring person atom scale.
- Changed x/y/zOffset precisions to 0.001 so that we have usable offset values.
- Changed "Vertex Index" slider format to integer so that we have usable increment buttons.
- Disabling clothing item removes CUA from scene to not pollute people's scenes with hundreds of atoms when they're trying out clothes.
- And some other small UI tweaks and fixes.

There are more issues with plugin storables not being applied when loading scenes/presets, but that is a Clothing Plugins Manager issue, so I've detailed it in its discussion thread.

The modified plugin file is in attachments. I'm licensing my changes under WTFPL, so merge it, take credit, or throw it away, I don't mind, I just want this to exist :)

What I couldn't fix due to my lack of experience is the performance issue of having multiple attached CUAs. It really adds up and tanks FPS, so the majority of my piercings are attached to bones, but that is a pretty bad experience since that ignores morphs.

Is there really nothing that can be done about this? I'd expect unity to retrieve and cache vertex positions once per frame, so that the performance cost doesn't scale past one. Can't it be implemented this way?
 

Attachments

  • CUAClothing.cs
    44.4 KB · Views: 0
Back
Top Bottom