light: raise the sun so the character leaves building shadow (needs approval)
The skin was never grey. A red test colour reached the render and the slot was confirmed holding M_Character_Skin, so the material and the assignment were both fine - the body was simply standing in building shadow and lit almost entirely by the blue skylight (intensity 2.6). Warm skin under blue fill reads blue-grey. Raising the sun from pitch -62 to -74, same camera: face (99, 98, 100) -> (131, 121, 117) arms (67, 74, 81) -> (71, 78, 85) This touches every approved shot, so it sits on the branch for the owner's approval rather than being folded in. Also records that the Unreal commandlet silently drops unknown switches, which is why a --unlit-test flag never took effect.
This commit is contained in:
1 parent
7c57bf318b
commit
bea6aa3e05
39 files changed
+64
-53
No files matched your search
@@ -322,7 +322,7 @@ def build():
|
||||
# 3. Ambience. A height fog gives the street depth and hides the terrain
|
||||
# edge that otherwise reads as a black band at the horizon.
|
||||
sun = spawn(unreal.DirectionalLight, unreal.Vector(0, 0, 2000), "Demo_Sun",
|
||||
unreal.Rotator(pitch=-62.0, yaw=120.0, roll=0.0))
|
||||
unreal.Rotator(pitch=-74.0, yaw=120.0, roll=0.0))
|
||||
if sun:
|
||||
comp = sun.get_component_by_class(unreal.DirectionalLightComponent)
|
||||
if comp:
|
||||
@@ -341,7 +341,7 @@ def build():
|
||||
comp.set_mobility(unreal.ComponentMobility.MOVABLE)
|
||||
except Exception as exc: # noqa: BLE001
|
||||
log(f"sun mobility not set: {exc!r}")
|
||||
log("staged: Demo_Sun (pitch -62, yaw 120, intensity 4, warm; higher sun so both frontages read)")
|
||||
log("staged: Demo_Sun (pitch -74, yaw 120, intensity 4, warm; higher sun lifts the north sidewalk out of building shadow)")
|
||||
|
||||
sky = spawn(unreal.SkyLight, unreal.Vector(0, 0, 2000), "Demo_SkyLight")
|
||||
if sky:
|
||||
|
||||
@@ -71,7 +71,7 @@ def new_material(name):
|
||||
return material
|
||||
|
||||
|
||||
def skin_material(diffuse, detail):
|
||||
def skin_material(diffuse, detail, unlit_test=False):
|
||||
material = new_material("M_Character_Skin")
|
||||
lib = unreal.MaterialEditingLibrary
|
||||
|
||||
@@ -84,13 +84,20 @@ def skin_material(diffuse, detail):
|
||||
# was always working - the skin simply reads dark under the demo's key light. This
|
||||
# tone is lifted to sit in shadow the way the blueprint's skin does.
|
||||
base.set_editor_property("constant", unreal.LinearColor(0.78, 0.55, 0.44, 1.0))
|
||||
lib.connect_material_property(base, "", unreal.MaterialProperty.MP_BASE_COLOR)
|
||||
if unlit_test:
|
||||
# Diagnostic: unlit renders the constant exactly, so the render tells us whether
|
||||
# a wrong skin tone comes from lighting/shading or from the material itself.
|
||||
material.set_editor_property("shading_model", unreal.MaterialShadingModel.MSM_UNLIT)
|
||||
lib.connect_material_property(base, "", unreal.MaterialProperty.MP_EMISSIVE_COLOR)
|
||||
else:
|
||||
lib.connect_material_property(base, "", unreal.MaterialProperty.MP_BASE_COLOR)
|
||||
|
||||
rough = lib.create_material_expression(material, unreal.MaterialExpressionConstant, -200, -200)
|
||||
rough.set_editor_property("r", 0.58)
|
||||
lib.connect_material_property(rough, "", unreal.MaterialProperty.MP_ROUGHNESS)
|
||||
lib.recompile_material(material)
|
||||
log("M_Character_Skin: constant skin tone, roughness 0.58 "
|
||||
log(("M_Character_Skin: UNLIT TEST, emissive " if unlit_test else
|
||||
"M_Character_Skin: constant skin tone, roughness 0.58 ")
|
||||
"(baked diffuse not used - it samples black on this mesh)")
|
||||
return material
|
||||
|
||||
@@ -118,14 +125,14 @@ def hair_material(strands):
|
||||
return material
|
||||
|
||||
|
||||
def main():
|
||||
def main(unlit_test=False):
|
||||
diffuse = unreal.EditorAssetLibrary.load_asset(f"{DEST}/T_Character_Diffuse")
|
||||
log(f"diffuse: {'ok' if diffuse else 'MISSING'}")
|
||||
detail = import_texture("T_Character_SkinDetail.png")
|
||||
strands = import_texture("T_Character_Hair.png")
|
||||
|
||||
if diffuse and detail:
|
||||
skin_material(diffuse, detail)
|
||||
skin_material(diffuse, detail, unlit_test=unlit_test)
|
||||
|
||||
if strands:
|
||||
hair = hair_material(strands)
|
||||
@@ -144,7 +151,9 @@ def main():
|
||||
|
||||
|
||||
try:
|
||||
main()
|
||||
# Environment, not a command-line flag: the commandlet drops unknown switches, so
|
||||
# the flag never reached Python. An env var is inherited.
|
||||
main(unlit_test=os.environ.get("GIGLINE_UNLIT_TEST") == "1")
|
||||
except Exception as exc: # noqa: BLE001
|
||||
import traceback
|
||||
log(f"FAILED: {type(exc).__name__}: {exc}")
|
||||
|
||||
Reference in new issue
Block a user