"""Surfaces for the Manta, the Remora's method (models/tender-remora/build/surfaces_remora.py, itself the docking arm's), run on Tender_Manta.blend after build_manta.py: blender -b Tender_Manta.blend --python build/surfaces_manta.py (generated by build/make_surfaces.py from surfaces_head.py + the Remora's helper functions + surfaces_tail.py) * hard surfaces take tiling sets from the user's own Season 2 packs (already in the Unreal project), read in place from models/vessel-interior/textures: ScratchedMetal under the paints, StainedSteel for bare metal, the dimpled FloorPanel_A on the cabin deck, Glass_DirtRough as a smudge mask, T_Scratch_Norm for fine scratches. The seat takes the CC0 leather scan the captain's quarters already brought in (models/vessel-interior/source_textures/leather_white). Nothing is downloaded. * two maps baked from the model in Cycles per atlas: Masks (R occlusion, G edges, B crevices) and BevelNormal (hard edges rounded 12 mm). Exterior atlas 4096 px, cabin atlas 2048 px. * glow is an accent: the lamps, the cabin's amber strips and screens (the reference's lit cabin). The look is the reference picture's: pale blue-grey paint under a clear coat, dark glass slots, graphite machinery, a yellow tag; a clean, kept machine (fine scratches and smudges in the sheen, a few chips on exposed edges, no rust). Two UV layers on every mesh (the order matters for Unreal, which builds its tangents from the first): UVMap (UV0) a unique unwrap in the part's square of its atlas (the baked maps); the screens map onto T_Manta_Screens. UV_Tile (UV1) metres: the hull skin unrolled (arc round, length), turned parts unrolled, the rest box-projected. """ import bpy, bmesh, math, os, time, json import numpy as np OUT = os.path.dirname(bpy.data.filepath) HERE = os.path.join(OUT, "build") TEX = os.path.join(OUT, "textures") os.makedirs(TEX, exist_ok=True) VI = os.path.normpath(os.path.join(OUT, "..", "vessel-interior")) PACK = os.path.join(VI, "textures", "ModSci_Engineer", "Textures") SCR = ("Base/ScratchedMetal/T_ScratchedMetal_Diff.png", "Base/ScratchedMetal/T_ScratchedMetal_Rough.png", "Base/ScratchedMetal/T_ScratchedMetal_Normal.png") STN = ("Base/StainedSteel/T_StainSteeled_Diff.png", "Base/StainedSteel/T_StainSteeled_Rough.png", None) FLOOR = ("FloorPanel_A/T_FloorPanel_A_diff.png", "FloorPanel_A/T_FloorPanel_A_Rough.png", "FloorPanel_A/T_FloorPanel_A_normals.png") LEATHER = tuple(os.path.join(VI, "source_textures", "leather_white", f) for f in ("leather_white_diff_2k.jpg", "leather_white_rough_2k.jpg", "leather_white_nor_gl_2k.jpg")) DIRT = "Base/Glass/T_Glass_DirtRough.png" SCRATCH_N = "Base/Glass/T_Scratch_Norm.png" REPORT = {} t0 = time.time() ATLASES = { "Exterior": dict(size=4096, rects={"SM_Manta_Hull": (0.0, 0.0, 0.86), "SM_Manta_Glass": (0.86, 0.0, 0.14), "SM_Manta_ToolBoom": (0.86, 0.14, 0.14), "SM_Manta_Rotor": (0.86, 0.28, 0.07), "SM_Manta_ToolBit": (0.93, 0.28, 0.07)}), "Cabin": dict(size=2048, rects={"SM_Manta_Cabin": (0.0, 0.0, 1.0)}), } BEVEL_R, EDGE_R = 0.012, 0.020 SEAM_W0, SEAM_W1, SEAM_DEPTH = 0.0045, 0.0018, 0.0018 # (the Manta's seams are geometry; the seam fields read 0) # what each material is made of (keys as the docking arm's SURF); coat = clear coat over the paint SURF = { "MANTA | Hull paint": dict(set=SCR, tint=(0.40, 0.445, 0.49), metal=0.0, tile=1.20, shade=(0.96, 1.03), rough=(0.32, 0.26), normal=0.04, dirt=0.02, dirt_tile=2.4, grime=0.22, wear=0.16, wear_col=(0.16, 0.165, 0.17), wear_rough=0.45, coat=1.0, coat_rough=0.04, coat_dirt=0.03), "MANTA | Panel seam": dict(set=(None, SCR[1], None), tint=(0.035, 0.038, 0.042), metal=0.0, tile=0.6, shade=(1.0, 1.0), rough=(0.55, 0.45), normal=0.0, dirt=0.04, dirt_tile=1.2, grime=0.0, wear=0.0), "MANTA | Graphite": dict(set=(STN[0], SCR[1], SCR[2]), tint=(0.030, 0.032, 0.036), metal=0.0, tile=0.70, shade=(0.92, 1.08), rough=(0.55, 0.42), normal=0.15, dirt=0.06, dirt_tile=1.9, grime=0.15, wear=0.40, wear_col=(0.30, 0.31, 0.32), wear_rough=0.36), "MANTA | Chrome": dict(set=STN, tint=(0.88, 0.89, 0.91), metal=1.0, tile=0.40, shade=(0.96, 1.03), rough=(0.05, 0.10), normal=0.10, normal_map=SCRATCH_N, dirt=0.04, dirt_tile=0.8, grime=0.18, wear=0.0), "MANTA | Steel": dict(set=STN, tint=(0.60, 0.61, 0.63), metal=1.0, tile=0.90, shade=(0.93, 1.05), rough=(0.24, 0.32), normal=0.50, normal_map=SCRATCH_N, dirt=0.05, dirt_tile=0.9, grime=0.20, wear=0.0), "MANTA | Impeller alloy": dict(set=STN, tint=(0.58, 0.59, 0.62), metal=1.0, tile=0.35, shade=(0.85, 1.10), rough=(0.26, 0.42), normal=0.35, normal_map=SCRATCH_N, dirt=0.05, dirt_tile=0.7, grime=0.20, wear=0.0), "MANTA | Rubber": dict(set=(None, SCR[1], None), tint=(0.017, 0.017, 0.018), metal=0.0, tile=0.40, shade=(1.0, 1.0), rough=(0.86, 0.62), normal=0.0, dirt=0.08, dirt_tile=1.2, grime=0.10, wear=0.0, dust=0.03), "MANTA | Yellow marking": dict(set=SCR, tint=(0.80, 0.50, 0.025), metal=0.0, tile=0.60, shade=(0.94, 1.04), rough=(0.40, 0.32), normal=0.06, dirt=0.06, dirt_tile=1.4, grime=0.22, wear=0.50, wear_col=(0.50, 0.51, 0.52), wear_rough=0.36, coat=0.6, coat_rough=0.06, coat_dirt=0.1), "MANTA | Cabin panel": dict(set=SCR, tint=(0.40, 0.35, 0.29), metal=0.0, tile=0.90, shade=(0.90, 1.05), rough=(0.62, 0.42), normal=0.30, dirt=0.04, dirt_tile=2.0, grime=0.25, wear=0.20, wear_col=(0.45, 0.46, 0.47), wear_rough=0.40), "MANTA | Cabin floor": dict(set=FLOOR, tint=(0.20, 0.20, 0.21), metal=0.6, tile=1.00, shade=(0.80, 1.10), rough=(0.55, 0.35), normal=0.80, dirt=0.07, dirt_tile=1.5, grime=0.30, wear=0.0), "MANTA | Seat": dict(set=LEATHER, tint=(0.060, 0.042, 0.032), metal=0.0, tile=0.55, shade=(0.80, 1.15), rough=(0.62, 0.40), normal=0.6, dirt=0.04, dirt_tile=1.2, grime=0.25, wear=0.0, abs_paths=True), "MANTA | Sensor glass": dict(set=(None, SCR[1], None), tint=(0.006, 0.007, 0.009), metal=0.0, tile=0.30, shade=(1.0, 1.0), rough=(0.10, 0.04), normal=0.0, dirt=0.05, dirt_tile=0.5, grime=0.0, wear=0.0, coat=1.0, coat_rough=0.02, coat_dirt=0.05), } GLOW = {"MANTA | Lamp light": ((1.0, 0.87, 0.68), 30.0), "MANTA | Cabin light": ((1.0, 0.55, 0.14), 30.0)} GLASSES = {"MANTA | Glass": (0.96, 0.98, 1.0), "MANTA | Lamp lens": (0.98, 0.99, 1.0)} SCREEN_INK = (1.0, 0.62, 0.16) # amber instruments (the reference's cabin light), red-orange for alerts SCREEN_ALERT = (1.0, 0.25, 0.06)