fix(clothing): close the coverage holes, and bind materials without crashing
Solidify thickness went from 1 cm to 2 cm and the shell is fattened 8 mm along its own normals afterwards. That closed the shoulders, hips and knees where the body was showing through the cloth. Evaluation against the blueprint, same shot and box before and after: mean deltaE 31.9 -> 21.8 palette deltaE 25.4 -> 19.7 aspect delta 1.24 -> 1.22 Also fixes a crash I introduced: binding the materials in Tick used ConstructorHelpers::FObjectFinder, which is fatal outside a constructor - the game died with 'FObjectFinders can't be used outside of constructors' and the render run failed with signal 11. The binding now lives in BeginPlay and uses LoadObject. Not fixed, and recorded: the arms and face still render neutral grey, so M_Character_Skin itself is suspect rather than the assignment.
This commit is contained in:
1 parent
86e9c5b693
commit
878d5a1f4e
43 files changed
+95
-58
No files matched your search
@@ -38,9 +38,9 @@ GARMENTS = (
|
||||
"upperarm01.L", "upperarm01.R", "breast.L", "breast.R",
|
||||
"neck01", "neck02", "pelvis.L", "pelvis.R"],
|
||||
"z_min": 0.90, "z_max": 1.44,
|
||||
"x_max": 0.235, # trims the bare arms out of the tee
|
||||
"x_max": 0.255, # trims the bare arms out of the tee
|
||||
"use_bones": False,
|
||||
"thickness": 0.009,
|
||||
"thickness": 0.020,
|
||||
"colour": (0.020, 0.032, 0.075, 1.0), # navy cotton
|
||||
"roughness": 0.78,
|
||||
},
|
||||
@@ -51,9 +51,9 @@ GARMENTS = (
|
||||
"upperleg02.L", "upperleg02.R", "lowerleg01.L", "lowerleg01.R",
|
||||
"lowerleg02.L", "lowerleg02.R", "spine01"],
|
||||
"z_min": 0.06, "z_max": 1.06,
|
||||
"x_max": 0.30,
|
||||
"x_max": 0.32,
|
||||
"use_bones": False,
|
||||
"thickness": 0.010,
|
||||
"thickness": 0.020,
|
||||
"colour": (0.032, 0.055, 0.105, 1.0), # dark denim
|
||||
"roughness": 0.62,
|
||||
},
|
||||
@@ -154,6 +154,19 @@ def build_garment(body, arm, spec, out_dir):
|
||||
solidify.offset = 1.0
|
||||
bpy.ops.object.modifier_apply(modifier=solidify.name)
|
||||
|
||||
# Push the shell out along its own normals. Solidify alone left the body visible
|
||||
# through the garment at every convex patch - shoulders, hips, knees.
|
||||
import bmesh
|
||||
bm = bmesh.new()
|
||||
bm.from_mesh(mesh)
|
||||
bm.normal_update()
|
||||
for vertex in bm.verts:
|
||||
vertex.co += vertex.normal * spec.get("fatten", 0.008)
|
||||
bm.to_mesh(mesh)
|
||||
bm.free()
|
||||
mesh.update()
|
||||
log(f"{spec['asset']}: fattened by {spec.get('fatten', 0.008):.3f} m")
|
||||
|
||||
material = bpy.data.materials.get(f"M_Char_{spec['name']}") \
|
||||
or bpy.data.materials.new(f"M_Char_{spec['name']}")
|
||||
material.use_nodes = True
|
||||
|
||||
Reference in new issue
Block a user