Hi there! You are currently browsing as a guest. Why not create an account? Then you get less ads, can thank creators, post feedback, keep a list of your favourites, and more!
Instructor
Original Poster
#1 Old 30th Jul 2016 at 3:54 AM Last edited by Butterbot : 22nd Oct 2016 at 9:08 PM. Reason: Category
Default [Case Study] TS4-to-TS3 Pants Conversion
This is not intended to be a hand-holding tutorial for beginners--hence the title "Case Study". It's a loose overview of the process (keeping in mind that this is only one of many viable approaches), a highlight of potential pitfalls, and some observations for troubleshooting. I figured it might be useful for others to have some information from multiple sources gathered in one place, so below are some written notes I took for myself (no images). This workflow can probably be streamlined and improved, and is only offered here as an example of a working process.

I. Introduction
The following describes the conversion of TS4 Spa Day cropped pants for males to TS3, using TS3 Town Life short sweatpants as reference. The final result is here.

II. Prerequisites
Working knowledge of:
  • CAS Texture Unitool
  • Mesh Toolkit
  • Milkshape and the following plugins:
    • Align Normals
    • Normal Data Merge
    • QMeshPlugins (GEOM plugins)
    • Vertex Data Merge
  • Photoshop (or equivalent image editor), channels, and basic texturing of CAS items
  • S3OC
  • S3PE
  • S4CASTools
  • S4PE

III. Overview of Approach
Clone S3 CAS item that is closest to S4 item to serve as final "container" .package and reference. Remove S4 body parts from S4 CAS part mesh (e.g. remove exposed legs from pants) and substitute them with S3 body parts from S3 nude meshes. Match vertices + normals at seams where the item mesh joins the rest of the body, using S3 nude or reference S3 CAS item as guide. UV-map, assign bones, and construct morphs using S3 CAS item as reference. Make lower LODs. Make textures using S3 CAS item as reference. Insert converted S4 mesh, morphs, and textures into S3 reference .package.

IV. Resource Gathering
  1. Clone S3 pants. This will become the final .package containing the converted pants.
  2. Extract S3 pants mesh (all LODs + morphs) & textures from this cloned package. CTU is useful for figuring out relevant _IMG resources.
  3. Extract S3 amBottomNude mesh (all LODs + morph meshes). Locate UV map as image for later reference.
  4. Extract S4 mesh (ymBottom_GP02PantsFoldover). Convert to S3 GEOM using S4CASTools. This results in multiple .simgeom per LOD. Extract S4 textures with S4PE by exporting RLE2 resources as .dds files.
  5. Locate S3 CAS UV template for later reference.

V. LOD1
  1. Import the converted S4 .simgeom from LOD0 into Milkshape (autosmooth off). In this conversion, they consist of the pants, pant cuffs, and legs.
  2. Regroup all 3 parts of the converted S4 mesh into a single group.
  3. Import the LOD1 mesh of S3 pants and amBottomNude into Milkshape.
  4. Copy-paste the mesh comments from the S3 pants mesh to the S4 mesh.
  5. Create materials in Milkshape using extracted textures for S3 and S4 meshes. Assign materials to respective meshes for better visualization.
  6. Use vertex/normal data merge to match the S4 mesh waist to amBottomNude (make sure amBottomNude is above the S4 mesh in the "Groups" tab, as data is copied from the upper group to the lower).
  7. Import S4 mesh again as waistband reference. Use vertex/normal data merge to match the second vertex row of the S4 mesh being modified to the first row of the just imported waistband reference mesh. Hide the waistband reference mesh and unhide the S3 pants mesh. Move the second row of the S4 mesh over the Y axis until it roughly matches the second row on the S3 mesh (at the height of S3 waistbands on bottom garments). Hide the S3 mesh and unhide the S4 waistband reference mesh. Scale and move the second row of the S4 pants mesh over XZ until it roughly matches the circumference of the waistband reference mesh at that level. This is because the first row of the S4 mesh is the top of the waistband in S4, but will now become the junction between lower body and torso since S3 bottoms tend to include a band of abdomen at the top. The 2nd row of vertices will now form the the top of the pants' waistband.
  8. Delete S3 pants mesh and the waistband reference mesh.
  9. Delete the legs of the S4 mesh up to one vertex row below the pant cuffs. Scale down (on XZ) this last row and move it upward some distance inside the cuffs. This will be used to form the seam between the pants and the legs.
  10. Delete upper part of amBottomNude, keeping only the lower legs (cut at 1 row above the lower edge of the pant cuffs). Doing this instead of using vertex/normal data merge at the ankles because the S4 legs have more vertices in the last row than their S3 counterparts, and it seemed unwise to remove/add vertices/faces in that touchy area. The legs from the S3 mesh are too short to use in this case since the S3 pants are longer, covering more of the legs.
  11. Adjust the cuffs to fit over the top of the legs.
  12. Use vertex/normal data merge on the top row of the legs inside the cuffs and the last row of the cuffs that was moved upwards into the pants previously. (Make sure amBottomNude is above the S4 mesh in the "Groups" tab, so that the leg vertices are not moved.) This forms a seam between the legs and the cuffs that is hidden inside the pant cuffs.
  13. Export the legless pants mesh and the truncated amBottomNude legs mesh separately.
  14. Use Auto-Create Morph Mesh in MeshToolkit to create morph meshes for the legless S4 pants (use the S3 pants as reference mesh).
  15. Use Auto-Create Morph Mesh in MeshToolkit to create morph meshes for the truncated amBottomNude legs using intact amBottomNude as reference. (amBottomNude seems to have an empty special morph BGEO... will use fit BGEO as substitute for reference.)
  16. Run FrankenMesh using the s4 pant mesh and the truncated leg mesh exported above, plus all the morph meshes generated. This creates a new combined mesh and morph meshes for this combined mesh (in this conversion, the morph meshes will be regenerated later, due to changes to the UV map). Note that the entire mesh will take on the shader settings + mesh texture links (e.g. normal map) of the first mesh that is inputted into FrankenMesh. (Can use Combine mesh instead?)
  17. Import combined mesh base into Milkshape. Create new materials using S3 CAS UV map + template and S4 pants texture re-positioned according to S3 CAS template (do not resize S4 texture).
  18. Correct any potential problems in mesh topology at this point, before morph meshes are generated.
  19. Adjust UV mapping using these materials. Export the mesh. (If unable to export due to message re: "vertices need to be split", go to Tools --> Model Cleaner; choose "No" at subsequent pop-ups.)
  20. Use Auto-Create Morph Mesh in MeshToolkit to create morph meshes for the newly mapped combined mesh base (use the S3 pants as reference mesh).
  21. Import the combined mesh and the new morph meshes into Milkshape. In this case, a pregnant morph is not needed (the S3 pants have a special morph BGEO, but it looks the same as the pants' base mesh), so import the combined mesh base again, copy-paste the special morph mesh's comments to the newly imported combined mesh base, then delete the special morph mesh. The second combined mesh base is now a replacement for the special morph mesh.
  22. Adjust morph meshes as needed to eliminate any clipping.
  23. Import LOD1 of amBottomNude and its morph meshes. For each morph mesh, check that vertices match at waist + ankles (can do representative sampling.) Use vertex/normal data merge at both locations across all morph meshes if mismatch is detected anywhere (as the other meshes/location are likely affected too.) Do not alter the base mesh.
  24. Export combined mesh base and its morph meshes.
  25. Use MeshToolkit to auto-assign bones to the combined mesh using S3 pants as reference.
  26. Run Fix Tangents.
  27. Run Match Bones at Seams on the combined mesh using S3 pants as reference.

VI. LOD2+3
Repeat steps as per LOD1 or use Direct X Tool as follows (might have issues with arms on tops.)
  1. Import combined mesh base (LOD1) into Milkshape.
  2. Note the mesh polycount.
  3. Select entire mesh. Choose Vertex --> Weld Together. This will prevent Direct X Tool from dividing the mesh, creating gaps at seams.
  4. Check the polycount after welding--it should remain unchanged from step 2; otherwise, faces have welded together. If the polycount has changed after welding, scaling up first is needed to prevent nearby vertices from snapping together in the next step, so:
    1. Press Ctrl-Z to undo Weld Together.
    2. Select entire mesh and scale by 10000 on XYZ axes, from Origin.
    3. Choose Vertex --> Weld Together again.
  5. Choose Tools --> DirectX Mesh Tools.
  6. Reduce number of faces with slider (see LOD2 of S3 pants for target number; for this conversion: S3 pants LOD1 = 675 vertices, 880 polys, LOD2 = 389/324, LOD3 = 218/159). Save changes and exit tool.
  7. Choose Tools --> Model Cleaner. Click "No" when prompted about vertices. This splits seam vertices using UV map as reference, since welding the entire mesh welded the seam vertices as well, which interferes with UV mapping.
  8. If the mesh was scaled up in step 4, select entire mesh via "Groups" tab and scale by 0.0001 on XYZ axes, from Origin. Otherwise, go to next step.
  9. Export mesh as .obj.
  10. Start a new file in Milkshape. Import the combined mesh base (LOD1) again, and the LOD2 .obj mesh.
  11. Copy-paste the mesh comments from the LOD1 mesh to the LOD2 mesh.
  12. Select both meshes and note the polycounts.
  13. Choose Vertex --> Weld Together. Weld is used here to copy bone assignments from the LOD1 mesh to the new LOD2 mesh, since the Direct X Tool removes bone assignments.
  14. Check that the polycounts have remained the same. If not, undo Weld Togther and scale both meshes by 10000 on XYZ axes (from Origin), then repeat Weld Together.
  15. Delete LOD1 mesh.
  16. Choose Tools --> Model Cleaner. Click "No" when prompted about vertices.
  17. If the mesh was scaled up before Weld Together, elect entire mesh via "Groups" tab and scale by 0.0001 on XYZ axes, from Origin. Otherwise, go to next step.
  18. Check that all bone assignments have been copied by selecting "Draw vertices with bone colors" and/or clicking "SelUnAssigned" in the "Joints" tab. If there are vertices still missing bone assignments, repeat Welding + associated steps with a smaller scaling factor (if scaling was necessary.)
  19. If the whole mesh is black, select the entire mesh and choose Vertex --> Align Normals. If this results in unsightly shadows, select subsets of faces by hand and use Align Normal on each subset. Regrouping does not appear to be necessary.
  20. Check for clipping and adjust as necessary. Check UV mapping by creating a new material using a texture from the S4 pants and assigning it to the new LOD2 mesh. Adjust UV mapping as needed.
  21. Import the S3 amBottomNude LOD2 mesh. [Skip this step for LOD3.]
  22. Use vertex/normal data merge to match the combined mesh's waist and ankles to the S3 mesh. (Best effort: number of vertices is likely to be different between the two meshes.) [Skip this step for LOD3.]
  23. Import the S3 pants' LOD2 mesh and copy-paste its comments to the combined mesh LOD2.
  24. Export the combined mesh LOD2.
  25. Repeat with LOD2 as starting mesh to generate LOD3.

VII. Morphs
LOD1 morphs are already created by this point.
  1. Create LOD2+3 morphs.
    1. Use Auto-Create Morph Meshes on LOD2 of combined mesh to generate its morph meshes. Use LOD2 of S3 pants as reference mesh.
    2. Import combined mesh LOD2 and the newly generated morph meshes into Milkshape, and adjust as necessary for clipping.
    3. Import LOD2 of amBottomNude + its morph meshes. Check that vertices on combined mesh LOD2 morph meshes match those of amBottomNude's morph meshes at waist + ankles (can do representative sampling.) Use vertex/normal data merge in both locations across all meshes if mismatch is detected anywhere (as the other meshes/location are likely affected too.) Do not alter the base mesh. [Skip this step for LOD3.]
    4. Export combined mesh LOD2 morph meshes.
    5. Repeat for LOD3 morph meshes.
  2. Create morphs for final .package of converted pants (BGEO resources): use Make Clothing/Hair BGEO to make fat/fit/thin/special BGEOs using morph meshes across all 3 LODs. If Mesh Toolkit returns index bound error, run all meshes through [Re]Number Meshes first.

VIII. Textures + Packaging
  1. Copy S4 pants texture to S3 pants multiplier. Align with placement of S3 texture; do not resize. Adjust alpha channel to match footprint of new texture.
    • Remember to include strips of cast shadow in alpha channel (see alpha channel of S3 multiplier) above and below the pants texture.
    • If multiplier exhibits significant compression artifacts in-game, examine its RGB channels and copy-paste the least noisy one into RGB space. Then run "Add Noise" in Photoshop (uniform distribution, monochrome, 0.75%) to prevent the in-game compression algorithm from generating large blocky areas in the texture.
  2. Make new normal map by aligning RGBA channels of S4 normal map to the placement of S3 texture. Copy green channel into the red and blue channels. Note that the light source for RGB seems to come from above, while it appears to come from the right side in the alpha channel.
  3. Make remaining textures for combined mesh.
    • If small details are difficult to select cleanly for CASt masking, consider selecting the surrounding area, then reversing the selection.
  4. Replace corresponding texture + mesh resources in cloned .package.
  5. Make presets and set categories in CTU.

IX. Troubleshooting
  1. Major mesh gaps: incorrect bone assignments -> use Mesh Toolkit to auto-assign bones
  2. Mesh distortions/gaps along seams: mismatched bones at seams due to Milkshape rounding off bone assignments -> use Mesh Toolkit's "Match Bones at Seams"
  3. Visible waist/neck/ankle seams: mismatched bones or normals at seams -> use Mesh Toolkit's "Match Bones at Seams" or Milkshape's "Normal and Vertex Data Merge"

X. Sources
- Conversion pointers
- CAS texture reference
- FrankenMesh tutorial
- DirectX tool for generating LODs
- DirectX tool and normals
- Model Cleaner for seam splitting
- Seams due to bones in Milkshape exports
- Seams due to bad morphs
- Unneeded pregnant morph
- Compression artifacts
Advertisement
Virtual gardener
staff: administrator
#2 Old 30th Jul 2016 at 10:50 AM
Amazing tutorial! I've done a lot of different conversions throughout the years but I never knew ts4 had a different light source.

So I guess that has something to do with ts4's way of either rendering or just in-game lighting so it looks better.
Mad Poster
#3 Old 21st Oct 2016 at 12:25 AM
Jesus, that's a long process. But I guess it's worth it.

insert signature here
( Join my dumb Discord server if you're into the whole procrastination thing. But like, maybe tomorrow. )
Virtual gardener
staff: administrator
#4 Old 21st Oct 2016 at 10:48 AM
Quote: Originally posted by GrijzePilion
Jesus, that's a long process. But I guess it's worth it.


There are more ways to do it, this is just one of them. ^-^ Though I guess I would have done the same steps as explained in the tutorial.
Back to top