• Hi Guest!

    We are extremely excited to announce the release of our first Beta1.1 and the first release of our Public AddonKit!
    To participate in the Beta, a subscription to the Entertainer or Creator Tier is required. For access to the Public AddonKit you must be a Creator tier member. Once subscribed, download instructions can be found here.

    Click here for information and guides regarding the VaM2 beta. Join our Discord server for more announcements and community discussion about VaM2.
  • Hi Guest!

    VaM2 Resource Categories have now been added to the Hub! For information on posting VaM2 resources and details about VaM2 related changes to our Community Forums, please see our official announcement here.
ReCloth Tutorial

Guides ReCloth Tutorial

Please note:
To avoid letting this tutorial become too bloated, it is assumed the reader is decently familiar with VaM's native clothing system, Blender, and general 3D modeling concepts (weights, bones, UVs etc.)


This is a quick start guide on how to import clothing item to support the use of ReCloth plugin:


1. Create clothing item (Depending on your work flow, you may want to do this step only *AFTER* step 3.c , in case you need to change your clothing mesh during weight transfer/paint)
a. port your mesh as a clothing item using VaM clothing creator​
b. wrap result doesn't matter. it will be bypassed once ReCloth is enabled​
c. setup materials like you normally would​
d. If you need to sim the clothing, generate sim data. If not, you can skip it.​
e. if you plan to use simulation but without guide mesh, set the sim texture in the creator.​
i. Currently for single layer simulation (non-guide mesh), you cannot set new sim texture from the plugin, so you will need to set the one when during creation. I will fix this in next update
f. save the clothing item.​
g. modify vaj file to enable ClothingPluginManager​
i. check below guide on how to set up clothing plugin manager​
ii. I recommend using this utility to save you some sanity:​


2. Weight Transfer
a. Open DAZ, load a scene with a G2 person in it.​
b. (optional) if you want to use a morphed person shape as the baseline, apply those morphs now.​
c. import the clothing mesh into the scene​
1770923891921.png
d. right click on the 'scene' pane (usually on upper right), choose Asset -> Transfer Utility​
1770923979010.png
e. in diag, select the person as source, the clothing as target. If the person is morphed, set 'Item Shape' of the source to "Current"​
f. Click on "Show Options".​
i. Under 'General Options', untoggle everything except "Weight Maps".​
ii. Under 'Post Transfer Options', untoggle everything except for 'Remove Original Target'​
iii. Click Accept​
1770924065651.png
g. Export the clothing mesh as fbx​

3. Export bone weights
a. Open Blender, install all three python scripts as addons​
i. download the blender scripts here:​
ii. no need to unzip, install from local disk and pick the zip file directly​
1770924384795.png
iii. after install, make sure all these addons are enabled​
1770924435652.png
b. load the fbx exported in 2.g.​
c. (optional) repaint/adjust weights as you see fit​
d. Select the clothing mesh (not the armature) in object mode, go to File -> Export -> Bone Weights (BIN)​
1770924508986.png
e. save the file into to the clothing item's directory (where the vaj file is). The file name should be the same as the clothing item name. The script will append the file extension automatically​
1770924565121.png
f. the file name will be <clothing_item_name>.recloth.boneweights​
1770924930883.png

4. Export morphnodes
a. still in Blender, load a G2 model (or the morphed version, if you used one in step 2)​
b. in object mode, left click on the person, then shift-left click the clothing mesh.​
1770924670439.png
c. Go to File -> Export -> Morph Node Graph (BIN)​
1770924736447.png
d. in diag, check the driver mesh and driven mesh are set correctly. In this case, driver mesh should be the G2 person, the driven mesh should be the clothing mesh​
e. Make sure the "File Extension" chooser is set to "Skin->Cloth"​
1770924775460.png
f. save the file into to the clothing item's directory (where the vaj file is). The file name should be the same as the clothing item name. The script will append the file extension automatically​
1770924829240.png
g. the file name will be <clothing_item_name>.recloth.morphnodes​
1770924892412.png

5. Test in VaM
a. Open VaM. Put on the clothing item​
b. load ReCloth.cslist as a clothing plugin​
1770925380393.png
c. Toggle "Enable"​
1770925369473.png
d. pose the person to see if looks fine. If weights needed repaint, go back to Blender, repaint and re-export weight file. Then reload the plugin.​
i. if parts of the mesh clips into skin too much, adjust 'Push Out' slider under skinning tab​
1770925606209.png
ii. you can also disable push out if you need clothing to sit under the skin.​
iii. You can exclude bone influences quickly by adding individual bones to the bone mask. But it won't always works in your favor, since some times certain vertices will only have weights from a single bone.​
1770945628715.png
e. Adjust smoothing parameters under smoothing tab​
1770925712233.png
i. to skip smoothing altogether, set iteration to 0​
ii. toggle off "Bilateral Smooth" will revert to VaM's native smoothing​
iii. Add submesh (parts of the mesh that were using different material) to smoothing mask to disable smoothing only for that submesh​
e. If you need to sim, toggle on "Sim enabled" (requires sim data generated during clothing creation)​
1770925452687.png
f. Adjust sim parameters under simulation tab​
1770925506397.png
g. Once done, save the clothing plugin preset via ClothingPluginManager.​


6. (optional) Setup Guide mesh for multi-layer simulation
a. in Blender, model a guide mesh that follows along the clothing mesh part where you need to simulate​
i. if you have used Stopper's sim proxy, same principles apply here when creating the guide mesh.​
1770945868727.png
1770945884575.png
b. You'll need to export 3 additional files for guide mesh simulation:​
i. sim data for guide mesh: ( <clothing_item_name>.recloth.gm.simdata )​
1. set up a UV fo the guide mesh. It doesn't need to be very good, usually use minimum stretch should be enough. You can cut seams if you want, but not required.​
2. Paint a sim texture for the guide mesh using the UV​
a. you can follow this guide on how to paint a sim texture:​
1770946165575.png
3. Select the guide mesh in object mode. Go to File -> Export -> Cloth Geometry Data (BIN)​
1770946200198.png
4. In the export diag, pick the sim texture image you just painted as the Blend/Strenth sampling source​
1770946230974.png
5. Save the file into to the clothing item's directory (where the vaj file is). The file name should be the same as the clothing item name. The script will append the file extension automatically​
1770946282472.png
1770946353623.png
ii. morph node file from skin to guide mesh ( <clothing_item_name>.recloth.gm.skin.morphnodes )​
1. similar to step 4. generate a morph node file where driver mesh is the person, driven mesh is the guide mesh. **Set "File Extension" chooser to be "Skin->Guide Mesh"**
1770946455160.png
1770946492102.png
2. Save the file.​
1770946540509.png
iii. morph node file from guide mesh to clothing mesh ( <clothing_item_name>.recloth.gm.cloth.morphnodes )​
1. similar to step 4. generate a morph node file where driver mesh is the guide mesh, driven mesh is the clothing mesh. **Set "File Extension" chooser to be "Guide Mesh -> Cloth"**
1770946578749.png
1770946622263.png
2. Save the file.​
1770946681020.png
c. Check all three files are present. Then in plugin, enable sim, then toggle on "Sim Enabled" and "Use Guide Mesh"​
1770946785214.png
1770946736626.png
(Advanced) Generate morphnodes with vertex group filtering
1. To use this feature. it is important to understand what exactly morph nodes do. Morph nodes is a data structure that link a vertex being driven, to a group of driver vertices (morph nodes). As driver mesh deforms, the morphnodes are used to 'refit' the clothing mesh onto the morphed body, before the bone driven skinning takes place. When morph nodes are generated, it finds the closest vertices and its neighbors. Therefore, sometimes you want to specify the candidate group of the driver mesh, instead of using all of its vertices as candidates, to avoid the morph nodes to be naively generated from closet. This is conceptually similar to when we specify a collection of triangles to wrap to when we are doing clothing rewraps with VaM native cloth wraps.
2. To do this when exporting morphnodes from Blender, we need to create vertex groups in driver/driven meshes with matching names, so that the morph nodes will be generated only from the candidates that are in the matching vertex groups.
3. Another reason for using this is to setup partial guide mesh simulation. See example.2 below
Example 1:
Armor piece, the mesh should only 'attach' the forearm but the mesh protrudes over the elbow and upper arm.
1770963119644.png
a. First, assign the vertices to a vertex group named "_mn_0", where "_mn_" is the default group prefix, you can change it to whichever you choose.
1770963392588.png
b. Then, assign the candidate vertices you'd like the morph nodes to be generated from to a group with the same name.
1770963559297.png
c. Then generate morphnodes the same way in earlier steps. If you used a different group prefix, change it to match what you used in the export diag
1770963698609.png
d. you can have as many groups as you want, just make sure the names on both meshes match. If for a vertex, a matching group cannot be found, the morph nodes will be generated using all vertices as if no groups is specified for that vertex.
e. Below is the difference between using a morphnode with group filtering vs without:
i. Without filtering:
ii. With filtering​
Example 2: Partial Guide mesh simulation
1. Sometimes when setting up guide mesh simulation, you would want to only simulate part of the clothing mesh.
2. However, if you only create guide mesh for part of the clothing, the rest of the clothing mesh will still try to attach to that partial guide mesh, causing major deforms.
3. This is where a special vertex group comes in: the "none" group.
For this mesh, I need to have the loin cloths to use guide mesh sim, but rest of the belt to be non-simmed. I only created the guide mesh for the loin cloths, but not the belt.
1770965768230.png
1770965791136.png
a. Assign all the vertex that should *NOT* follow the guide mesh to a vertex group "_mn_none"
1770965512643.png
b. Then you can generate the Guide Mesh -> Cloth morph nodes with a partial guide mesh. No need to set up none group on the guide mesh.
c. As a result, for vertices in "none" group, it will passthru the guide mesh simulation and use the bone weight skinning result.
Tips/Important things to keep in mind:

As you can probably tell, this is not a simple process. There are many points during flow that can, (and most likely WILL, for your first a few attempts) go wrong. Below are a couple of things that may help you locate the issue faster.
  • *ALWAYS* pay attention to vertex count when exporting/importing fbx/obj across difference software. If vertex count doesn't match across the board, everything will break
  • Similarly, if any clothing mesh modification needs to be done, do it before creating the clothing item in VaM. Once the item is created, all further generation should stick with the clothing mesh you imported into VaM.
    • Re-assigning vertex groups don't count as mesh modification. But any geometry changes do.
  • After the weight transferred fbx is loaded into Blender, pose the bones to make sure everything looks OK. This is where you would check/fix any weight issues.
  • *ALWAYS* double check the morph nodes export diag settings, since there are basically 3 versions of morph nodes files that can be generated.
    • As a quick reference, these are the files you need to prepare for the plugin:
      • Always required:
        • <clothing_item_name>.recloth.boneweights // This contains the bone weights for clothing mesh
        • <clothing_item_name>.recloth.morphnodes // This is Skin->Cloth, where drive mesh is your G2 person skin, driven mesh is clothing mesh
      • Only required for guide mesh sim:
        • <clothing_item_name>.recloth.gm.skin.morphnodes // This is Skin->Guide Mesh, where drive mesh is your G2 person skin, driven mesh is the guide mesh
        • <clothing_item_name>.recloth.gm.cloth.morphnodes // This is Guide Mesh->Cloth, where drive mesh is your guide mesh, driven mesh is the clothing mesh
        • <clothing_item_name>.recloth.gm.simdata // This is the simulation data (joints, particle data) of the guide mesh
  • For non-guide mesh sim (single layer), the sim data being used is the one you generated in clothing creator, that means it will have wrap deforms baked into it. If you need to get a rid of the wrap deform, use Clothing Editor plugin to generate a no-deform sim data and save it.
  • If guide mesh is modified, the two morph nodes files it participates need to be re-exported, (Skin->Guide Mesh, Guide Mesh->Cloth), as well as the simdata file.
  • If you see some mysterious local deforms on non-simmed part of the clothing, and you think the weights and morphnodes are correct, export Skin->Cloth morph nodes with "Generate Rotation Base" *unchecked*, and then try again.

You can also always post your questions here in the thread or DM me. I will try to answer them the best I can.
Images and attachments
  • 1770924043795.png
    1770924043795.png
    44 KB · Views: 0
  • 1770924637876.png
    1770924637876.png
    216.7 KB · Views: 0
  • 1770945608201.png
    1770945608201.png
    10.1 KB · Views: 0
  • 1770946336109.png
    1770946336109.png
    3.2 KB · Views: 0
  • 1770946428461.png
    1770946428461.png
    249.2 KB · Views: 0
React to this content...

Share this resource

More resources from regguise

Latest reviews

Positive
PVP
TY for sharing the knowledge.
Upvote 0
Back
Top Bottom