"""Surfaces for the Spearfish, the Manta's method (models/tender-manta/build/surfaces_manta.py, itself the Remora's and the docking arm's), run on Tender_Spearfish.blend after build_spearfish.py: blender -b Tender_Spearfish.blend --python build/surfaces_spearfish.py (generated by build/make_surfaces.py from this head + the Manta's helper functions and run) * 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 seats take 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. * the blueprint is a line drawing, so the colours are mine: a pale blue-white paint under a clear coat (the sheet's pale hull), dark blue-tinted glass (its shaded panes), graphite fittings, bare steel on the ribbed actuators and the whips, small yellow marks on the docking clips; cool white cabin light and blue-white screens. A clean, kept machine. 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_Spearfish_Screens. UV_Tile (UV1) metres, box-projected (the tiling sets). """ 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_Spearfish_Hull": (0.0, 0.0, 0.86), "SM_Spearfish_Glass": (0.86, 0.0, 0.14), "SM_Spearfish_Hatch": (0.86, 0.14, 0.14), "SM_Spearfish_Mast_L": (0.86, 0.28, 0.07), "SM_Spearfish_Mast_R": (0.93, 0.28, 0.07)}), "Cabin": dict(size=2048, rects={"SM_Spearfish_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 seams are geometry strips; the seam fields read 0) SURF = { "SPEARFISH | Hull paint": dict(set=SCR, tint=(0.56, 0.60, 0.645), 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.20, wear=0.14, wear_col=(0.16, 0.165, 0.17), wear_rough=0.45, coat=1.0, coat_rough=0.04, coat_dirt=0.03), "SPEARFISH | 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), "SPEARFISH | Graphite": dict(set=(STN[0], SCR[1], SCR[2]), tint=(0.030, 0.033, 0.038), 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), "SPEARFISH | 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), "SPEARFISH | 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), "SPEARFISH | 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), "SPEARFISH | 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), "SPEARFISH | Cabin panel": dict(set=SCR, tint=(0.20, 0.21, 0.225), 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.15, wear_col=(0.45, 0.46, 0.47), wear_rough=0.40), "SPEARFISH | Cabin floor": dict(set=FLOOR, tint=(0.18, 0.18, 0.19), 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), "SPEARFISH | Seat": dict(set=LEATHER, tint=(0.045, 0.048, 0.055), 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), "SPEARFISH | Sensor glass": dict(set=(None, SCR[1], None), tint=(0.006, 0.008, 0.011), 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 = {"SPEARFISH | Lamp light": ((1.0, 0.92, 0.80), 30.0), "SPEARFISH | Cabin light": ((0.72, 0.86, 1.0), 18.0)} GLASSES = {"SPEARFISH | Glass": (0.14, 0.19, 0.24), "SPEARFISH | Lamp lens": (0.98, 0.99, 1.0)} SCREEN_INK = (0.35, 0.80, 1.0) # blue-white instruments, amber for alerts SCREEN_ALERT = (1.0, 0.55, 0.10)