Garment Support: How does it work?
What is Garment Support and how does it work?
Credit goes to psiberx (discord post with initial explanation of the algorithm) and IslandDancer for providing screenshots and know-how
The engine morphs garments to avoid clipping — for example, if you equip a pair of boots and V's jeans no longer cover the shoes, but get tucked under.

This process is accomplished via 'parameters' on the mesh:

Component prefixes
Garment support will be applied based on garmentScore. For this, the prefix of the component name will be considered (components are named in your .app or .ent file's component array).
A high garment score means that the item is "on top", squishing anything worn "below". (See The algorithm for details.)
The prefixes are as follows:
h0_
t0_
s0_
l0_ ...
Any component with a 0 in its prefix will be treated like a body mesh (no deform/squishing)
h1_
Head inner (mask, sunglasses)
h2_
Head outer (helmet, bandana)
t1_
Torso inner (shirts)
t2_
Torso outer (jackets, coats...)
s1_
Shoes
l1_
legs (pants that aren't leggins)
How it looks if it's broken

The algorithm
The game calculates the garment score by checking the prefix of component names, where the one with the lowest prefix is the innermost:
s0 = 0 // no prefix will also be 0
l0 = 10
a0 = 20
t0 = 30
h0 = 40
s1 = 50
l1 = 60
t1 = 70
i1 = 80
hh = 90
h1 = 100
h2 = 110
t2 = 120
After considering the component name, the game will consider the tags in the .ent's visualTagSchema
:
PlayerBodyPart = -2000
Tight = -1000
Normal = 0
Large = +1000
XLarge = +2000
An example for t0_000_pma_base__full
(the default body component, torso+legs):
+30 prefix: t0_
-2000 visualTag: PlayerBodyPart
—————————————————————————
-1970
Last updated