Problems with your blend:
- the garment exported as unweld;
- chosen reference was too short, the bottom of the garment did not receive correct data and may clip into the lower body it covers;
- the body and the garment are decimated. This ruins the topology, do not do this for LOD0;
- uvs in uv_0 are stretched. UVs made in square uv space stretch when rectangular textures are applied, you must bring them back to the original size;
- areas of the body covered by clothing are not deleted;
- mesh is not vertex painted.
S4S supports blender 3.6, make sure you have the beta version that is set up correctly:
- delete s4s wishes and any version of blender 2.7x;
- install s4s beta and blender 3.6 as explained
here, make sure to change blender path in s4s settings;
Edit your garment in Marvelous designer:
- go back to Marvelous designer, open the file with your top,
select all patterns, change topology to Quads, increase particle distance to 20 or so. Your item has no fine details that need to be preserved ( folds, wrinkles ), there is no need for its topology to be dense. So long the border of the top look smooth, it's okay;
- export the garment as thin and weld, with Y axis as Up
Adapt your garment exactly like this, no extra steps:
- in s4s click on Create CAS standalone, paste yfTop_Tank in the search bar, click Next, name it, save it somewhere;
- press Shift Ctrl C, paste studio.exportall . S4S will create a folder with all resources from the package in the same location where the file is;
- open LOD0, rename s4studio_mesh_1 to Reference;
- import your garment;
- transfer weights, uv_1, vertex paint as shown below, then Limit total. Rename a uv map to uv_0;
How to make an item move and morph by transferring weights, uv_1 and vertex paint
Transfer weights, uv_1 and vertex paint with Data transfer. The result may not always be perfect, but it is best to solve problems as they come:
- Unhide the reference. It must be visible* ( eye icon ) and selectable* ( cursor icon );
- Select your garment;
- In Modifiers tab add Data transfer modifier;
- Choose Reference as Source object;
- Enable Vertex data and expand it;
- Enable Vertex groups*;
- In Mapping choose Nearest face interpolated;
- Enable and expand Face corner data;
- Enable Colors*;
- Shift*-click to enable UVs as well;
- In Mapping choose Nearest face interpolated;
- Expand UVs, choose uv_1 in Layer selection ( don't forget, otherwise uv_0 will be overwritten as well);
- Click on Generate data layers*;
- Apply the modifier;
- In Data tab expand UV maps. Double-click on UVmap, rename it to uv_0;
- If uv_1 appeared, it most likely transferred successfully;
- Expand Color attributes. If you see color0, it transferred;
- Expand Vertex groups. If you see names of vertex groups, they most likely transferred successfully. However, there is one ( or two ) more thing(s) you need to do;
- If you're using Blender 2.76 - 2.79, 3.6.1, switch to Edit mode, select everything with A, Mesh - Weights - Clean with Subset set to All groups to fix the result of a bug that exists in these versions;
- Regardless of your version of Blender, in Edit mode, with everything still selected, do Mesh - Weights - Limit total.
* Data will not transfer if you will forget to do these steps!!! | |
- select Reference, in Edit mode select everything with A, Mesh - Merge - By distance;
- enable X ray, press C, select all areas of the body covered by clothing, press Esc to exit this selection mode. Disable X ray and Shift-click on any face that is not covered by the garment. You can fine tune the result in UV editor as well, so long Sync is enabled;
- in 3d view press Delete - Faces;
- select the garment. In UV editor select everything, assign
this template as a background, press S Y 0.5 to bring uvs back to their original size;
- Ctrl-select the body, put uvs of the garment in the space meant for tops, prioritizing their intentional placement ( front pattern where the front of the torso is, back where the back is, etc ). Do not scale uvs individually, do not rotate them freely;
- once done, select all uvs of the garment, UV - Export uv layout, set Opacity to 1. This will be your temporary diffuse;
- once done, join the garment with the reference;
- assign cut 0000, save, import back into yfTop_Tank;
- import your UV layout into Diffuse, remove other textures with Make blank;
- test in-game how the garment moves and morphs
Once everything is fine, save LOD0 as temporary.blend ( you will not be importing it in s4s ) and bake maps:
- expand the rig, disable rendering next to Top;
- in object mode Add - Mesh - Plane, press S and make it bigger. The ground will create more shadows on the garment;
- select the garment, change Timeline to Shader editor;
- in Edit mode select everything, remove existing material with X button, create a a new one;
- Add - Texture - Image texture, in drop down choose Diffuse, select this node;
- in Render tab change render engine to Cycles, Samples to at least 500, Light paths to 1;
- Expand Bake, choose Ambient occlusion, set Margins to at least 7, Bake;
- Image - Save as, choose PNG;
- open Photopea or photoshop, open UV layout of the garment you exported previously;
- Ctrl-click on the layer thumbnail, Select - Modify - Expand, choose 3 px;
- Edit - Fill, foreground color ( does not matter which one);
- File - Open and place, choose saved Ambient occlusion;
- RMB-click on it and choose Clipping mask;
- File - Export as - PNG. This is your diffuse;
- this is where the top casts shadows on the body. Select this area in UV editor, export Uv layout. Edit ambient occlusion you baked as explained in the last section
here;
- make
specular( sample the color from the original specular of the garment) and
normal maps using your diffuse;
-
make lods