Skip to content
1        10        20        30        40        50        60        70        80        90        100       110       1201"""Build Aislinn the Dreamweaver as a game-ready GLB.23She is the pale dreamweaver of Lake Bala: a thin mist-blue slip dress, bare feet4in the lake mist, long moonlit hair, water tendrils curling around her, and orbs5of mist gathered between her palms. The whole model is procedural so it can be6rebuilt, tweaked, and re-exported from a terminal.78    blender -b --factory-startup -P tools/blender/aislinn.py -- \9      --out assets/models/aislinn.glb1011The character is about 1.75 Blender units tall and faces -Y in Blender, which12becomes +Z (towards the game camera) after the glTF Y-up conversion.13"""1415import argparse16import math17import sys18from pathlib import Path1920import bpy2122sys.path.insert(0, str(Path(__file__).resolve().parent))23from export_glb import export_scene  # noqa: E402  (needs Blender's sys.path)24from rig import rig_character  # noqa: E402  (needs Blender's sys.path)25from hero_parts import (  # noqa: E402  (needs Blender's sys.path)26    cylinder,27    limb,28    material,29    revolve,30    sphere,31    torus,32    tube,33)3435SKIN = (0.94, 0.84, 0.79)36ROBE = (0.86, 0.92, 0.97)37ROBE_SHADE = (0.70, 0.83, 0.93)38ROBE_DEEP = (0.30, 0.50, 0.68)39HAIR = (0.90, 0.87, 0.76)40HAIR_SHADE = (0.60, 0.70, 0.80)41EYE = (0.04, 0.08, 0.14)42DREAM = (0.55, 0.90, 1.0)43WATER = (0.24, 0.58, 0.76)444546def water_skirt(mat, thickness=0.015):47    """A thin, wind-blown slip dress with a rippling mid-calf hem."""48    profile = [49        (0.285, 0.255),50        (0.40, 0.238),51        (0.52, 0.222),52        (0.64, 0.211),53        (0.76, 0.206),54        (0.86, 0.216),55        (0.93, 0.222),56        (0.98, 0.195),57    ]58    return revolve(59        "Aislinn Slip Dress",60        profile,61        mat,62        y_scale=0.94,63        ripple=0.028,64        wave=0.028,65        thickness=thickness,66    )676869def torso(mat):70    profile = [71        (0.90, 0.190),72        (0.96, 0.165),73        (1.02, 0.147),74        (1.08, 0.150),75        (1.13, 0.170),76        (1.17, 0.190),77        (1.21, 0.195),78        (1.25, 0.180),79        (1.28, 0.155),80        (1.30, 0.130),81    ]82    return revolve("Aislinn Bodice", profile, mat, y_scale=0.74, thickness=0.012)838485def water_tendril(name, mat, *, start, turns, height, radius, phase=0.0):86    points = []87    radii = []88    steps = 2889    for step in range(steps + 1):90        t = step / steps91        angle = start + t * turns * 2 * math.pi92        reach = radius * (1 - 0.20 * t) + 0.025 * math.sin(t * 8 + phase)93        points.append(94            (95                math.cos(angle) * reach,96                math.sin(angle) * reach * 0.85,97                0.06 + t * height,98            )99        )100        radii.append(0.017 * (1 - 0.35 * t))101    return tube(name, points, radii, mat)102103104def mist_orb(name, center, radius, core, shell, *, puffs=2):105    """A bright core wrapped in a soft, translucent shell of mist."""106    return [107        sphere(f"{name} Core", center, radius * 0.52, core, segments=18, rings=12),108        sphere(f"{name} Shell", center, radius, shell, segments=28, rings=18),109        *[110            sphere(111                f"{name} Wisp {index + 1}",112                (113                    center[0] + math.cos(index * 2.4) * radius * 0.78,114                    center[1] + math.sin(index * 2.4) * radius * 0.5,115                    center[2] + math.sin(index * 3.1) * radius * 0.62,116                ),117                radius * 0.34,118                shell,119                segments=18,120                rings=12,121            )122            for index in range(puffs)123        ],124    ]125126127def build():128    bpy.ops.wm.read_factory_settings(use_empty=True)129130    skin = material("Aislinn Skin", SKIN, roughness=0.62)131    robe = material("Aislinn Robe", ROBE, roughness=0.48)132    robe_shade = material("Aislinn Robe Shade", ROBE_SHADE, roughness=0.55)133    robe_deep = material("Aislinn Robe Deep", ROBE_DEEP, roughness=0.6)134    hair = material("Aislinn Hair", HAIR, roughness=0.38)135    hair_shade = material("Aislinn Hair Shade", HAIR_SHADE, roughness=0.42)136    eye = material("Aislinn Eyes", EYE, roughness=0.3)137    sclera = material("Aislinn Sclera", (0.93, 0.95, 0.96), roughness=0.32)138    iris = material(139        "Aislinn Iris",140        (0.06, 0.32, 0.40),141        roughness=0.25,142        emission=(0.03, 0.16, 0.20),143        emission_strength=0.5,144    )145    lips = material("Aislinn Lips", (0.54, 0.35, 0.37), roughness=0.58)146    dream = material(147        "Aislinn Dream Light",148        DREAM,149        roughness=0.2,150        emission=DREAM,151        emission_strength=6.0,152    )153    halo = material(154        "Aislinn Water",155        WATER,156        metallic=0.15,157        roughness=0.12,158        emission=(0.12, 0.40, 0.56),159        emission_strength=0.45,160    )161    mist = material(162        "Aislinn Mist Orb",163        (0.55, 0.84, 1.0),164        roughness=0.2,165        emission=(0.38, 0.78, 1.0),166        emission_strength=1.4,167        alpha=0.34,168    )169    fog = material(170        "Aislinn Fog",171        (0.66, 0.86, 1.0),172        roughness=0.5,173        emission=(0.30, 0.58, 0.72),174        emission_strength=0.35,175        alpha=0.16,176    )177178    parts = []179180    # Thin slip dress and fitted bodice, shaped to read as a woman at a glance.181    parts.append(water_skirt(robe, thickness=0.015))182    parts.append(torso(robe_shade))183184    # Bare legs and feet, as in the origin: she walked out of the lake.185    for side, label in ((-1, "L"), (1, "R")):186        hip = (side * 0.072, -0.005, 0.88)187        knee = (side * 0.076, -0.016, 0.46)188        ankle = (side * 0.076, -0.03, 0.10)189        parts.append(limb(f"Aislinn Thigh {label}", hip, knee, 0.058, 0.043, skin, vertices=10))190        parts.append(limb(f"Aislinn Calf {label}", knee, ankle, 0.043, 0.032, skin, vertices=10))191        parts.append(192            sphere(193                f"Aislinn Foot {label}",194                (side * 0.076, -0.068, 0.045),195                0.058,196                skin,197                scale=(0.68, 1.45, 0.5),198                segments=14,199                rings=10,200            )201        )202        for toe in range(3):203            parts.append(204                sphere(205                    f"Aislinn Toe {label} {toe + 1}",206                    (side * (0.05 + toe * 0.022), -0.142, 0.032),207                    0.018,208                    skin,209                    scale=(0.8, 1.0, 0.55),210                    segments=8,211                    rings=6,212                )213            )214215    # Low mist gathering around her ankles.216    for index, (x, y, z, radius) in enumerate(217        [218            (-0.16, -0.10, 0.07, 0.20),219            (0.14, -0.06, 0.06, 0.18),220            (-0.04, 0.14, 0.08, 0.22),221            (0.20, 0.10, 0.05, 0.16),222            (-0.22, 0.04, 0.05, 0.17),223            (0.02, -0.18, 0.09, 0.19),224        ]225    ):226        parts.append(227            sphere(228                f"Aislinn Ground Fog {index + 1}",229                (x, y, z),230                radius,231                fog,232                scale=(1.35, 1.1, 0.3),233                segments=18,234                rings=12,235            )236        )237    for side in (-1, 1):238        parts.append(239            sphere(240                f"Aislinn Bust {'L' if side < 0 else 'R'}",241                (side * 0.067, -0.062, 1.175),242                0.086,243                robe_shade,244                scale=(1.0, 0.95, 0.82),245                segments=18,246                rings=12,247            )248        )249    parts.append(250        torus("Aislinn Sash", (0, 0, 0.985), 0.16, 0.022, robe_deep, major_segments=32)251    )252    parts.append(253        limb("Aislinn Sash Tail", (0, -0.145, 0.98), (0.02, -0.30, 0.55), 0.032, 0.012, robe_deep, vertices=6)254    )255    parts.append(256        tube(257            "Aislinn Neckline",258            [259                (0.125, -0.075, 1.275),260                (0.08, -0.115, 1.245),261                (0.0, -0.145, 1.19),262                (-0.08, -0.115, 1.245),263                (-0.125, -0.075, 1.275),264            ],265            [0.006] * 5,266            halo,267            sides=6,268        )269    )270    parts.append(sphere("Aislinn Neckline Gem", (0, -0.148, 1.185), 0.016, dream, segments=12, rings=8))271272    # Bare shoulders and neck above the thin dress.273274    # Neck and a clearly feminine face: cheekbones, jaw, eyes, nose and lips.275    parts.append(cylinder("Aislinn Neck", (0, 0, 1.34), 0.042, 0.115, skin, vertices=20))276    parts.append(sphere("Aislinn Head", (0, -0.005, 1.49), 0.112, skin, scale=(1.0, 0.98, 1.18)))277    parts.append(sphere("Aislinn Jaw", (0, -0.018, 1.418), 0.09, skin, scale=(0.92, 0.95, 0.78), segments=20, rings=14))278    parts.append(sphere("Aislinn Chin", (0, -0.085, 1.392), 0.03, skin, scale=(1.05, 0.85, 0.95), segments=14, rings=10))279    for side in (-1, 1):280        parts.append(281            sphere(282                f"Aislinn Ear {'L' if side < 0 else 'R'}",283                (side * 0.113, -0.002, 1.468),284                0.03,285                skin,286                scale=(0.4, 0.8, 1.1),287                segments=12,288                rings=8,289            )290        )291292    # Eyes: sclera, teal iris, pupil, catchlight and a soft dark lash line.293    for side in (-1, 1):294        label = "L" if side < 0 else "R"295        parts.append(296            sphere(297                f"Aislinn Sclera {label}",298                (side * 0.046, -0.112, 1.487),299                0.024,300                sclera,301                scale=(1.25, 0.5, 0.85),302                segments=16,303                rings=10,304            )305        )306        parts.append(307            sphere(308                f"Aislinn Iris {label}",309                (side * 0.046, -0.125, 1.487),310                0.014,311                iris,312                scale=(1.0, 0.35, 1.0),313                segments=14,314                rings=10,315            )316        )317        parts.append(318            sphere(319                f"Aislinn Pupil {label}",320                (side * 0.046, -0.130, 1.487),321                0.0066,322                eye,323                scale=(1.0, 0.35, 1.0),324                segments=10,325                rings=8,326            )327        )328        parts.append(329            sphere(330                f"Aislinn Catchlight {label}",331                (side * 0.051, -0.133, 1.492),332                0.0032,333                dream,334                segments=8,335                rings=6,336            )337        )338        parts.append(339            sphere(340                f"Aislinn Lash {label}",341                (side * 0.046, -0.121, 1.503),342                0.019,343                eye,344                scale=(1.35, 0.25, 0.16),345                segments=14,346                rings=8,347            )348        )349        parts.append(350            tube(351                f"Aislinn Lash Flick {label}",352                [(side * 0.064, -0.118, 1.498), (side * 0.085, -0.112, 1.508)],353                [0.0035, 0.0015],354                eye,355                sides=5,356            )357        )358        parts.append(359            tube(360                f"Aislinn Brow {label}",361                [362                    (side * 0.020, -0.118, 1.523),363                    (side * 0.050, -0.122, 1.528),364                    (side * 0.078, -0.113, 1.518),365                ],366                [0.0045, 0.004, 0.0018],367                hair_shade,368                sides=5,369            )370        )371372    # Nose bridge, tip and soft lips.373    parts.append(374        tube(375            "Aislinn Nose Bridge",376            [(0, -0.106, 1.508), (0, -0.122, 1.478), (0, -0.129, 1.462)],377            [0.011, 0.009, 0.007],378            skin,379            sides=7,380        )381    )382    parts.append(sphere("Aislinn Nose Tip", (0, -0.131, 1.458), 0.014, skin, scale=(1.2, 0.9, 0.8), segments=12, rings=8))383    for side in (-1, 1):384        parts.append(385            sphere(386                f"Aislinn Upper Lip {'L' if side < 0 else 'R'}",387                (side * 0.009, -0.120, 1.424),388                0.009,389                lips,390                scale=(1.0, 0.32, 0.36),391                segments=12,392                rings=8,393            )394        )395    parts.append(396        sphere(397            "Aislinn Lower Lip",398            (0, -0.122, 1.416),399            0.013,400            lips,401            scale=(1.25, 0.38, 0.4),402            segments=14,403            rings=10,404        )405    )406407    # Hair: a crown, a long fall down the back, bangs, and floating strands.408    parts.append(sphere("Aislinn Hair Crown", (0, 0.02, 1.545), 0.138, hair, scale=(1.04, 1.04, 1.02)))409    parts.append(410        tube(411            "Aislinn Hair Part",412            [(0, -0.112, 1.575), (0, -0.045, 1.635), (0, 0.045, 1.662), (0, 0.125, 1.638)],413            [0.004, 0.004, 0.003, 0.002],414            hair_shade,415            sides=5,416        )417    )418    for side, label in ((-1, "L"), (1, "R")):419        parts.append(420            tube(421                f"Aislinn Bangs {label}",422                [423                    (side * 0.006, -0.086, 1.604),424                    (side * 0.052, -0.108, 1.566),425                    (side * 0.092, -0.104, 1.510),426                    (side * 0.120, -0.080, 1.446),427                ],428                [0.021, 0.019, 0.012, 0.0025],429                hair,430                sides=6,431            )432        )433    hair_paths = [434        [(-0.095, 0.015, 1.53), (-0.16, -0.02, 1.39), (-0.215, 0.01, 1.19), (-0.275, 0.08, 1.02), (-0.31, 0.15, 0.88)],435        [(-0.055, 0.035, 1.55), (-0.10, 0.09, 1.40), (-0.13, 0.17, 1.19), (-0.155, 0.24, 0.99), (-0.18, 0.31, 0.84)],436        [(-0.13, 0.03, 1.50), (-0.195, 0.07, 1.35), (-0.25, 0.13, 1.14), (-0.30, 0.19, 0.96)],437        [(0.0, 0.06, 1.56), (0.01, 0.14, 1.42), (0.02, 0.23, 1.24), (0.03, 0.30, 1.08), (0.04, 0.36, 0.94)],438        [(0.095, 0.015, 1.53), (0.16, -0.02, 1.39), (0.215, 0.01, 1.19), (0.275, 0.08, 1.02), (0.31, 0.15, 0.88)],439        [(0.055, 0.035, 1.55), (0.10, 0.09, 1.40), (0.13, 0.17, 1.19), (0.155, 0.24, 0.99), (0.18, 0.31, 0.84)],440        [(0.13, 0.03, 1.50), (0.195, 0.07, 1.35), (0.25, 0.13, 1.14), (0.30, 0.19, 0.96)],441    ]442    for index, path in enumerate(hair_paths):443        radius = 0.045 if len(path) == 5 else 0.034444        radii = [445            radius * (1 - 0.92 * (step / (len(path) - 1)) ** 0.85)446            for step in range(len(path))447        ]448        parts.append(449            tube(450                f"Aislinn Hair Strand {index + 1}",451                path,452                radii,453                hair_shade if index % 3 == 1 else hair,454                sides=7,455            )456        )457458    # Thick locks down the back give the long hair real volume.459    back_paths = [460        [(-0.120, 0.070, 1.58), (-0.150, 0.160, 1.34), (-0.170, 0.250, 1.08), (-0.180, 0.300, 0.86)],461        [(-0.070, 0.085, 1.60), (-0.090, 0.180, 1.38), (-0.100, 0.270, 1.10), (-0.110, 0.320, 0.82)],462        [(-0.024, 0.095, 1.61), (-0.030, 0.200, 1.40), (-0.034, 0.290, 1.12), (-0.038, 0.350, 0.79)],463        [(0.024, 0.095, 1.61), (0.030, 0.200, 1.40), (0.034, 0.290, 1.12), (0.038, 0.350, 0.79)],464        [(0.070, 0.085, 1.60), (0.090, 0.180, 1.38), (0.100, 0.270, 1.10), (0.110, 0.320, 0.82)],465        [(0.120, 0.070, 1.58), (0.150, 0.160, 1.34), (0.170, 0.250, 1.08), (0.180, 0.300, 0.86)],466    ]467    for index, path in enumerate(back_paths):468        radius = 0.050 if index % 2 else 0.044469        radii = [470            radius * (1 - 0.85 * (step / (len(path) - 1)) ** 0.9)471            for step in range(len(path))472        ]473        parts.append(474            tube(475                f"Aislinn Back Lock {index + 1}",476                path,477                radii,478                hair_shade if index % 2 else hair,479                sides=8,480            )481        )482483    # Long hair falls freely; no hood or cloak, as in the origin.484485    # Both hands rise to gather the mist between them.486    for side, label in ((-1, "L"), (1, "R")):487        shoulder = (side * 0.195, 0.0, 1.245)488        elbow = (side * 0.29, -0.08, 1.055)489        hand = (side * 0.07, -0.30, 1.15)490        parts.append(491            limb(f"Aislinn Sleeve {label}", shoulder, elbow, 0.088, 0.052, robe_shade)492        )493        parts.append(494            tube(495                f"Aislinn Sleeve Drape {label}",496                [497                    (side * 0.29, -0.08, 1.055),498                    (side * 0.325, -0.05, 0.88),499                    (side * 0.30, 0.0, 0.71),500                ],501                [0.07, 0.052, 0.017],502                robe_deep,503            )504        )505        parts.append(506            limb(f"Aislinn Arm {label}", elbow, hand, 0.035, 0.029, skin, vertices=8)507        )508        parts.append(509            sphere(510                f"Aislinn Hand {label}",511                hand,512                0.05,513                skin,514                scale=(1.2, 1.35, 0.65),515                segments=14,516                rings=10,517            )518        )519520    # Water coils around her, carrying the mist.521    parts.append(water_tendril("Aislinn Water Coil A", halo, start=2.30, turns=1.15, height=1.15, radius=0.40, phase=0.7))522    parts.append(water_tendril("Aislinn Water Coil B", halo, start=5.55, turns=1.05, height=0.98, radius=0.38, phase=2.1))523    parts.append(water_tendril("Aislinn Water Coil C", halo, start=0.95, turns=0.85, height=0.72, radius=0.43, phase=4.4))524525    # Orbs of mist: a bright one gathered between her palms, smaller ones adrift.526    parts.extend(mist_orb("Aislinn Mist Light", (0, -0.33, 1.21), 0.105, dream, mist, puffs=3))527    for index, (center, radius) in enumerate(528        [529            ((-0.36, -0.12, 1.42), 0.062),530            ((0.38, -0.10, 1.30), 0.052),531            ((-0.30, -0.22, 0.94), 0.045),532            ((0.32, -0.24, 0.78), 0.038),533        ]534    ):535        parts.extend(mist_orb(f"Aislinn Mist Orb {index + 1}", center, radius, dream, mist, puffs=1))536    for index, (x, y, z, size) in enumerate(537        [538            (-0.09, -0.33, 1.33, 0.014),539            (0.11, -0.31, 1.31, 0.011),540            (0.02, -0.36, 1.13, 0.009),541            (-0.42, -0.12, 0.35, 0.012),542            (0.40, -0.22, 0.62, 0.015),543            (0.31, 0.33, 0.92, 0.013),544            (-0.34, 0.28, 1.12, 0.011),545            (0.10, -0.41, 0.82, 0.010),546            (-0.14, -0.41, 1.33, 0.012),547        ]548    ):549        parts.append(sphere(f"Aislinn Mote {index + 1}", (x, y, z), size, dream, segments=10, rings=8))550551    # Group everything under one root so the renderer can clone and scale it.552    root = bpy.data.objects.new("Aislinn", None)553    bpy.context.collection.objects.link(root)554    for part in parts:555        part.parent = root556557    return root558559560def main(argv):561    parser = argparse.ArgumentParser()562    parser.add_argument("--out", required=True)563    args = parser.parse_args(argv)564    root = build()565    rig_character(root, "Aislinn")566    export_scene(args.out, animations=True)567568569if __name__ == "__main__":570    main(sys.argv[sys.argv.index("--") + 1 :] if "--" in sys.argv else [])