A 3D model pipeline, pushed by GPT-6-Astra

agent

+34:48

The coat now passes the weight checks, and the new hair is confirmed to be the only hair geometry in the export. I’m finishing the small construction details and doing the last camera checks.

The handoff will include the GLB, its painted-material metadata, the perspective Flattice shot, and the preserved before/after page. The GLB will carry the character and skeleton; the painted outlines and Flattice remain renderer effects, clearly documented.

  • exec_commandrg -n -i 'licen|cc0|1443|redistrib' docs/vroid.md docs/handbook.md; NODE_PATH=~/context/sortie-node_modules node review/astra-finish/shoot.cjs '[{"file":"armour-check.png","background":true,"stage":false,"w":1400,"h":1200,"y":1.62,"x":0,"span":0.72,"lens":50,"flat":0.85,"yaw":-15},{"file":"rear-check.png","background":true,"stage":false,"w":1200,"h":1200,"yaw":150,"span":2.5},{"file":"look-check.png","background":true,"stage":false,"w":1000,"h":1000,"y":1.64,"x":0,"span":0.65,"yaw":25,"pose":"look","time":1.8,"lens":35,"flat":0.85}]' (+1 more)

    command

    rg -n -i 'licen|cc0|1443|redistrib' docs/vroid.md docs/handbook.md; NODE_PATH=~/context/sortie-node_modules node review/astra-finish/shoot.cjs '[{"file":"armour-check.png","background":true,"stage":false,"w":1400,"h":1200,"y":1.62,"x":0,"span":0.72,"lens":50,"flat":0.85,"yaw":-15},{"file":"rear-check.png","background":true,"stage":false,"w":1200,"h":1200,"yaw":150,"span":2.5},{"file":"look-check.png","background":true,"stage":false,"w":1000,"h":1000,"y":1.64,"x":0,"span":0.65,"yaw":25,"pose":"look","time":1.8,"lens":35,"flat":0.85}]'
    
    ~/.local/opt/blender-5.2.3-linux-x64/blender -b --factory-startup --python review/astra-finish/check_blender.py > review/out/astra-finish/blender-import.log 2>&1

    result, 4 lines

    Script completed
    Wall time 2.4 seconds
    Output:
    {"chunk_id":"849ef5","wall_time_seconds":1.000770417,"session_id":36988,"original_token_count":1516,"output":"docs/handbook.md:204:- **Yin and Yang rigs:** personal-use licence. Study only, never ship.\ndocs/handbook.md:208:- **VRoid licence:** read by hand on 11-09, in `docs/vroid.md` (\"Licence, read 2026-11-09\", #1443). Baked characters in a\ndocs/handbook.md:209:  sold game, public pages and renders are allowed, no credit needed. A player-facing creator needs pixiv's licence. Our\ndocs/handbook.md:210:  exports' `Redistribution_Prohibited` fields were set at our export and don't bind us. Open: unedited A to Z textures in\ndocs/vroid.md:3:**Status (2026-11-09):** current. The files carry 57 expression shapes (2.14 exports) or 56 (older), not the 54 below. Licence terms were read by hand on 11-09: see \"Licence, read 2026-11-09\" below, which replaces the licence notes further down (led #1443).\ndocs/vroid.md:5:## Licence, read 2026-11-09\ndocs/vroid.md:19:- **[H]** VRoid Hub terms <https://policies.pixiv.net/en.html#vroidhub>, and the official VRoid Project account's model licences\ndocs/vroid.md:26:| `avatarsample_d` to `_g` (OpenGameArt) | Not the 2.14 D to G. They are β Ver AvatarSample_1 to 4: Sendagaya Shibu, Vivi, Vita, Victoria Rubin (file titles match the Japanese β pages) | CC0 [β1 to β4]. The official Hub copy of β1 also allows everything, credit unnecessary [H] |\ndocs/vroid.md:27:| `sakurada_fumiriya`, `sendagaya_shino` | VRoid's mascots | CC0 [SF] [SS]. Official Hub copies allow everything, credit unnecessary [H] |\ndocs/vroid.md:28:| `hairsample_male`, `hairsample_female` | alpha-era hair samples | CC0 [SC] |\ndocs/vroid.md:29:| `base_male`, `base_female` (OpenGameArt) | alpha-era bases, Studio 0.14 exports | **Unclear.** [SC] lists \"Base models\" under CC0, as a picture of the 2021 bases. [G] says \"All content provided by pixiv, including the base models when creating a new avatar, is not CC0.\" Either way [T] Art. 13 licenses them for any purpose |\ndocs/vroid.md:30:| `samples_2_14/avatarsample_a` to `_z` | VRoidPreset A to Z, from Studio 2.14 | [AZ]: not CC0, any use, no credit, a list of prohibited acts (below) |\ndocs/vroid.md:31:| `lowmarch_bodies/base_masc`, `base_fem` | Studio 2.14 new-model bases | Provided Content under [T] Art. 13: any purpose, not CC0 [G] |\ndocs/vroid.md:41:  tools belong to you, the creator.\" The body and clothing meshes and presets are pixiv's, licensed \"so that you can use\ndocs/vroid.md:43:- Licence: pixiv grants \"a non-exclusive, perpetual, worldwide, non-transferable, non-sublicensable license to use,\ndocs/vroid.md:45:  different license conditions are specified and displayed for individual items\" [T] Art. 13.\ndocs/vroid.md:51:- Limits: items with their own clause keep it (\"When using items that display special licensing terms, please observe\ndocs/vroid.md:59:  license* for this model is CC0. This model can be edited and used freely.\" [β1] [SF] [SS]\ndocs/vroid.md:64:  - \"Distributing a sample model or its VRM file to a third party by setting the 'Redistribution and alteration'\ndocs/vroid.md:65:    conditions of use to 'Copyright Disclaimer (CC0)'.\"\ndocs/vroid.md:68:  - \"Redistributing the .vroid or VRM file of the sample model (or other data such as image data within the model) in\ndocs/vroid.md:73:  highlight, brow and eyeline drawings as they are) counts as redistributing \"image data within the model\" for a fee.\ndocs/vroid.md:75:- **Metadata against the page:** for our use, pixiv's page wins. The licence fields in our 2.14 exports\ndocs/vroid.md:76:  (`Redistribution_Prohibited`, `OnlyAuthor`, commercial `Disallow`) were set at our export, not by pixiv: \"Users will\ndocs/vroid.md:77:  be licensed to set licenses freely for VRM data constituting Output Items, as long as they do not breach the license\ndocs/vroid.md:79:  items apply to us: \"Where the Company has specified and displayed license conditions for individual items of Provided\ndocs/vroid.md:82:  Hub licence allowing everything, or CC0), which agrees with the pages.\ndocs/vroid.md:83:- If we ever hand out VRM files built on A to Z, their licence field must not be CC0 [AZ].\ndocs/vroid.md:87:Confirmed: it needs a separate licence from pixiv, and pixiv may refuse.\ndocs/vroid.md:88:- \"Users are not licensed to use Provided Content, or 3D models or Output Items containing Provided Content, to create\ndocs/vroid.md:91:  receive a separate license from the Company; provided, however, that this does not apply when the User is creating\ndocs/vroid.md:93:- \"Please contact us if you'd like an application creation license. It's possible that we may decline granting you a\ndocs/vroid.md:94:  license.\" [G] [F]\ndocs/vroid.md:95:- [AZ] prohibits a creator built on A to Z data outright and names no licence route.\ndocs/vroid.md:97:  on anything from Studio 2.x or A to Z, needs pixiv's licence.\ndocs/vroid.md:98:- **Unclear:** whether CC0 parts alone (β 1 to 4, the mascots, the hair samples) would escape this. CC0 waives\ndocs/vroid.md:106:- CC0 models: \"Copyright is waived, and there is no particular limit when using them.\" [β1]\ndocs/vroid.md:113:The licence notes further down (the table's \"Licence in the file\", the yomox9 D to Z note, \"That page is behind a\ndocs/vroid.md:124:each and stay out of the repo. Source: <https://opengameart.org/content/vroid-studio-cc0-models>.\ndocs/vroid.md:126:| Model | Licence in the file |\ndocs/vroid.md:128:| Base_Male, Base_Female, HairSample_Male, HairSample_Female | CC0 |\ndocs/vroid.md:129:| AvatarSample D–G, Sakurada Fumiriya, Sendagaya Shino | VRoid Hub licence: everyone, commercial use allowed, modification allowed, redistribution allowed, credit unnecessary |\ndocs/vroid.md:132:are built from the CC0 bodies.\ndocs/vroid.md:144:sample avatars. The VRoid Project account on VRoid Hub publishes A–C with VRoid Hub's licence:\ndocs/vroid.md:147:- modification and redistribution are allowed;\ndocs/vroid.md:152:`allowModificationRedistribution`, credit unnecessary), pointing at pixiv's \"AvatarSample A-Z\" help page.\ndocs/vroid.md:164:  without a separate licence from pixiv. Tools meant only for your own use are exempt.\ndocs/vroid.md:167:  pixiv's licence.\n"}{"chunk_id":"ee5bfd","wall_time_seconds":1.00098768,"session_id":87282,"original_token_count":0,"output":""}
  • exec_command, write_stdinpython3 - <<'PY' (+3 more)

    input

    text(await tools.exec_command({cmd:"python3 - <<'PY'\nfrom pathlib import Path\np=Path('review/astra-finish/package_model.py');s=p.read_text().replace(\"'CC0 VRoid body and AvatarSample U face; original costume and hair'\",\"'VRoid-derived cage body and AvatarSample U face under their existing pixiv terms; original costume and hair'\")\nkey=\"    doc['asset']['generator']+=\"\npos=s.index(key)\ns=s[:pos]+'''    # Share identical PBR materials across the authored parts.\n    unique=[];keys={};remap={}\n    for i,mat in enumerate(doc['materials']):\n        key=json.dumps(mat,sort_keys=True)\n        if key not in keys:keys[key]=len(unique);unique.append(mat)\n        remap[i]=keys[key]\n    for mesh in doc['meshes']:\n        for prim in mesh['primitives']:prim['material']=remap[prim['material']]\n    doc['materials']=unique\n''' +s[pos:];p.write_text(s)\nPY","max_output_tokens":1000}));
    text(await tools.write_stdin({session_id:36988,chars:"","yield_time_ms":1000,"max_output_tokens":1000}));
    text(await tools.write_stdin({session_id:87282,chars:"","yield_time_ms":1000,"max_output_tokens":1000}));
    text(await tools.exec_command({cmd:"tail -8 review/out/astra-finish/blender-import.log; cat review/out/astra-finish/blender-check.json","max_output_tokens":1300}));
    

    result, 4 lines

    Script completed
    Wall time 0.2 seconds
    Output:
    {"chunk_id":"459d83","wall_time_seconds":0.00000404,"exit_code":0,"original_token_count":0,"output":""}{"chunk_id":"88546c","wall_time_seconds":0.000003351,"exit_code":0,"original_token_count":190,"output":"{\n  render_seconds: 11.077,\n  total_seconds: 13.181,\n  errors: [],\n  options: {\n    background: true,\n    stage: false,\n    w: 1400,\n    h: 1200,\n    y: 1.62,\n    x: 0,\n    span: 0.72,\n    lens: 50,\n    flat: 0.85,\n    yaw: -15\n  },\n  file: 'armour-check.png'\n}\n{\n  render_seconds: 4.621,\n  total_seconds: 17.807,\n  errors: [],\n  options: {\n    background: true,\n    stage: false,\n    w: 1200,\n    h: 1200,\n    yaw: 150,\n    span: 2.5\n  },\n  file: 'rear-check.png'\n}\n{\n  render_seconds: 7.265,\n  total_seconds: 25.079,\n  errors: [],\n  options: {\n    background: true,\n    stage: false,\n    w: 1000,\n    h: 1000,\n    y: 1.64,\n    x: 0,\n    span: 0.65,\n    yaw: 25,\n    pose: 'look',\n    time: 1.8,\n    lens: 35,\n    flat: 0.85\n  },\n  file: 'look-check.png'\n}\n"}{"chunk_id":"b0f539","wall_time_seconds":0.00000142,"exit_code":0,"original_token_count":0,"output":""}{"chunk_id":"0c3ffd","wall_time_seconds":0.000004141,"exit_code":1,"original_token_count":152,"output":"Traceback (most recent call last):\n  File \"~/work/lowmarch/review/astra-finish/check_blender.py\", line 9, in <module>\n    assert arm and meshes and not result['unbound_meshes'],result\n           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\nAssertionError: {'import_seconds': 1.571, 'armatures': 1, 'bones': 59, 'meshes': 131, 'materials': 132, 'actions': ['idle', 'look', 'watch'], 'unbound_meshes': ['Icosphere'], 'engine': '5.2.3 LTS'}\nBlender 5.2.3 LTS (hash e13b728c6880 built 2026-10-22 01:35:05)\n\nBlender quit\ncat: review/out/astra-finish/blender-check.json: No such file or directory\n"}
  • view_image~/work/lowmarch/review/out/astra-finish/armour-check.png (+2 more)

    input

    image((await tools.view_image({path:"~/work/lowmarch/review/out/astra-finish/armour-check.png"})).image_url);
    image((await tools.view_image({path:"~/work/lowmarch/review/out/astra-finish/rear-check.png"})).image_url);
    image((await tools.view_image({path:"~/work/lowmarch/review/out/astra-finish/look-check.png"})).image_url);
    

    result, 4 lines

    Script completed
    Wall time 0.1 seconds
    Output:
    
    armour-check.png
    armour-check.png
    rear-check_3.png
    rear-check_3.png
    look-check.png
    look-check.png
  • exec_commandcat > review/astra-finish/mesh_finish.py <<'PY'

    command

    cat > review/astra-finish/mesh_finish.py <<'PY'
    """Local garment masks and a clean hidden neck boundary, preserving the rig."""
    import numpy as np
    
    def clip_above(pc,y):
        # Clip crossing triangles exactly; deleting whole triangles makes a ragged neck edge.
        pos=list(pc['pos']);nrm=list(pc['nrm']);uv=list(pc['uv']);J=list(pc['J']);W=list(pc['W']);cache={};tri=[]
        def cut(a,b):
            key=tuple(sorted((a,b)))
            if key in cache:return cache[key]
            t=(y-pos[a][1])/(pos[b][1]-pos[a][1]);i=len(pos);cache[key]=i
            pos.append((1-t)*pos[a]+t*pos[b]);nrm.append((1-t)*nrm[a]+t*nrm[b]);uv.append((1-t)*uv[a]+t*uv[b])
            acc={}
            for ids,weights,factor in [(J[a],W[a],1-t),(J[b],W[b],t)]:
                for j,w in zip(ids,weights):acc[int(j)]=acc.get(int(j),0)+float(w)*factor
            pairs=sorted(acc.items(),key=lambda z:-z[1])[:4];ids=np.zeros(4,dtype=int);weights=np.zeros(4)
            for k,(j,w) in enumerate(pairs):ids[k]=j;weights[k]=w
            weights/=weights.sum();J.append(ids);W.append(weights);return i
        for face in pc['tri']:
            poly=[]
            for a,b in zip(face,np.roll(face,-1)):
                ina=pos[a][1]>=y;inb=pos[b][1]>=y
                if ina:poly.append(int(a))
                if ina!=inb:poly.append(cut(int(a),int(b)))
            for k in range(1,len(poly)-1):tri.append([poly[0],poly[k],poly[k+1]])
        pc.update(pos=np.array(pos),nrm=np.array(nrm),uv=np.array(uv),J=np.array(J),W=np.array(W),tri=np.array(tri,dtype=int).reshape(-1,3))
    PY
    python3 - <<'PY'
    from pathlib import Path
    p=Path('review/astra-finish/build.py');s=p.read_text().replace("    for pc,role in zip(portrait.prims,portrait.roles):\n        if role=='body': pc['tri']=pc['tri'][pc['pos'][pc['tri'],1].min(1)>=neck_y+.006]","    from mesh_finish import clip_above\n    for pc,role in zip(portrait.prims,portrait.roles):\n        if role=='body': clip_above(pc,neck_y-.012)");p.write_text(s)
    p=Path('review/astra-finish/design.py');s=p.read_text();key="    # A diagonal leather baldric"
    pos=s.index(key)
    s=s[:pos]+'''    # The sleeve cap under the metal is masked so it cannot poke through the crown.
        for pc in out:
            if pc['material']=='OUTFIT_reed_sleeve_L':
                rel=pc['pos']-a;along=rel@axis;u=np.arctan2(rel@depth,rel@outward)
                hidden=(along<.070)&(along>-.16)&(np.abs(u)<2.10)
                pc['tri']=pc['tri'][~hidden[pc['tri']].all(1)]
    ''' +s[pos:];p.write_text(s)
    p=Path('review/astra-finish/check_blender.py');s=p.read_text();s=s.replace("arm=[o for o in bpy.data.objects if o.type=='ARMATURE'];meshes=[o for o in bpy.context.scene.objects if o.type=='MESH']","arm=[o for o in bpy.data.objects if o.type=='ARMATURE']\nhelpers={b.custom_shape for a in arm for b in a.pose.bones if b.custom_shape}\nmeshes=[o for o in bpy.context.scene.objects if o.type=='MESH' and o not in helpers]")
    p.write_text(s)
    PY
    OPENBLAS_NUM_THREADS=1 python3 review/astra-finish/build.py

    result, 4 lines

    Script completed
    Wall time 1.2 seconds
    Output:
    {"chunk_id":"867a03","wall_time_seconds":1.001128924,"session_id":75884,"original_token_count":0,"output":""}
  • write_stdin, exec_commandpoll session 75884 (+1 more)

    input

    text(await tools.write_stdin({session_id:75884,chars:"","yield_time_ms":1000,"max_output_tokens":1000}));
    text(await tools.exec_command({cmd:"python3 review/astra-finish/check.py","max_output_tokens":2000}));
    

    result, 4 lines

    Script completed
    Wall time 0.4 seconds
    Output:
    {"chunk_id":"479a01","wall_time_seconds":0.00000298,"exit_code":0,"original_token_count":43,"output":"{\"build_seconds\": 16.354, \"body\": \"~/.local/share/lowmarch/vroid/lowmarch_bodies/cage/arm_f_strong_4ad9ea3b57cd9a77.vrm\", \"glb_bytes\": 4919912, \"pieces\": 533}\n"}{"chunk_id":"da587a","wall_time_seconds":0.214294809,"exit_code":0,"original_token_count":152,"output":"{\n  \"bytes\": 4919912,\n  \"mesh_primitives\": 130,\n  \"vertices\": 63634,\n  \"triangles\": 109254,\n  \"degenerate_triangles\": 0,\n  \"materials\": 38,\n  \"embedded_images\": 9,\n  \"skins\": 1,\n  \"bones\": 59,\n  \"weighted_bones\": 52,\n  \"clips\": [\n    {\n      \"name\": \"idle\",\n      \"seconds\": 3.6,\n      \"changing_channels\": 2\n    },\n    {\n      \"name\": \"watch\",\n      \"seconds\": 1.0,\n      \"changing_channels\": 0\n    },\n    {\n      \"name\": \"look\",\n      \"seconds\": 3.6,\n      \"changing_channels\": 1\n    }\n  ],\n  \"finite_geometry\": true,\n  \"valid_indices\": true,\n  \"normalised_weights\": true,\n  \"sample_hair_absent\": true\n}\n"}
  • exec_commandNODE_PATH=~/context/sortie-node_modules node review/astra-finish/shoot.cjs '[{"file":"warden-finished.png","background":true},{"file":"warden-perspective.png","background":true,"stage":false,"w":1600,"h":1200,"y":1.62,"x":0,"span":0.72,"lens":50,"flat":0.85,"yaw":-15},{"file":"final-side.png","background":true,"stage":false,"w":1000,"h":1000,"yaw":75,"span":2.6},{"file":"final-idle.png","background":true,"stage":false,"w":1000,"h":1000,"yaw":-35,"span":2.6,"pose":"idle","time":1.8}]' (+1 more)

    command

    NODE_PATH=~/context/sortie-node_modules node review/astra-finish/shoot.cjs '[{"file":"warden-finished.png","background":true},{"file":"warden-perspective.png","background":true,"stage":false,"w":1600,"h":1200,"y":1.62,"x":0,"span":0.72,"lens":50,"flat":0.85,"yaw":-15},{"file":"final-side.png","background":true,"stage":false,"w":1000,"h":1000,"yaw":75,"span":2.6},{"file":"final-idle.png","background":true,"stage":false,"w":1000,"h":1000,"yaw":-35,"span":2.6,"pose":"idle","time":1.8}]'
    
    ~/.local/opt/blender-5.2.3-linux-x64/blender -b --factory-startup --python-exit-code 1 --python review/astra-finish/check_blender.py > review/out/astra-finish/blender-import.log 2>&1

    result, 4 lines

    Script completed
    Wall time 2.4 seconds
    Output:
    {"chunk_id":"b5bf0f","wall_time_seconds":1.000494415,"session_id":73067,"original_token_count":0,"output":""}{"chunk_id":"6459ed","wall_time_seconds":1.001125492,"session_id":56489,"original_token_count":0,"output":""}
  • write_stdin, exec_commandpoll session 56489 (+2 more)

    input

    text(await tools.write_stdin({session_id:56489,chars:"","yield_time_ms":1000,"max_output_tokens":500}));
    text(await tools.exec_command({cmd:"tail -5 review/out/astra-finish/blender-import.log; cat review/out/astra-finish/blender-check.json","max_output_tokens":1300}));
    text(await tools.write_stdin({session_id:73067,chars:"","yield_time_ms":1000,"max_output_tokens":2200}));
    

    result, 4 lines

    Script completed
    Wall time 0.1 seconds
    Output:
    {"chunk_id":"43da9f","wall_time_seconds":0.00000226,"exit_code":0,"original_token_count":0,"output":""}{"chunk_id":"58e07d","wall_time_seconds":0.00000393,"exit_code":0,"original_token_count":122,"output":"{\"import_seconds\": 1.393, \"armatures\": 1, \"bones\": 59, \"meshes\": 130, \"materials\": 40, \"actions\": [\"idle\", \"look\", \"watch\"], \"unbound_meshes\": [], \"engine\": \"5.2.3 LTS\"}\nInfo: Saved as \"import-check.blend\"\nBlender 5.2.3 LTS (hash e13b728c6880 built 2026-10-22 01:35:05)\n\nBlender quit\n{\n  \"import_seconds\": 1.393,\n  \"armatures\": 1,\n  \"bones\": 59,\n  \"meshes\": 130,\n  \"materials\": 40,\n  \"actions\": [\n    \"idle\",\n    \"look\",\n    \"watch\"\n  ],\n  \"unbound_meshes\": [],\n  \"engine\": \"5.2.3 LTS\"\n}"}{"chunk_id":"eb5db0","wall_time_seconds":0.00000301,"exit_code":0,"original_token_count":211,"output":"{\n  render_seconds: 10.358,\n  total_seconds: 12.081,\n  errors: [],\n  options: { background: true },\n  file: 'warden-finished.png'\n}\n{\n  render_seconds: 10.11,\n  total_seconds: 22.193,\n  errors: [],\n  options: {\n    background: true,\n    stage: false,\n    w: 1600,\n    h: 1200,\n    y: 1.62,\n    x: 0,\n    span: 0.72,\n    lens: 50,\n    flat: 0.85,\n    yaw: -15\n  },\n  file: 'warden-perspective.png'\n}\n{\n  render_seconds: 3.081,\n  total_seconds: 25.276,\n  errors: [],\n  options: {\n    background: true,\n    stage: false,\n    w: 1000,\n    h: 1000,\n    yaw: 75,\n    span: 2.6\n  },\n  file: 'final-side.png'\n}\n{\n  render_seconds: 3.489,\n  total_seconds: 28.769,\n  errors: [],\n  options: {\n    background: true,\n    stage: false,\n    w: 1000,\n    h: 1000,\n    yaw: -35,\n    span: 2.6,\n    pose: 'idle',\n    time: 1.8\n  },\n  file: 'final-idle.png'\n}\n"}
  • view_image~/work/lowmarch/review/out/astra-finish/warden-perspective.png (+2 more)

    input

    image((await tools.view_image({path:"~/work/lowmarch/review/out/astra-finish/warden-perspective.png"})).image_url);
    image((await tools.view_image({path:"~/work/lowmarch/review/out/astra-finish/final-side.png"})).image_url);
    image((await tools.view_image({path:"~/work/lowmarch/review/out/astra-finish/final-idle.png"})).image_url);
    

    result, 4 lines

    Script completed
    Wall time 0.1 seconds
    Output:
    
    warden-perspective.png
    warden-perspective.png
    final-side.png
    final-side.png
    final-idle.png
    final-idle.png
  • exec_commandrg -n '^def shadow_cards|neck_shadow|shadow' tools/vroid_portrait.py | head -25; python3 - <<'PY'

    command

    rg -n '^def shadow_cards|neck_shadow|shadow' tools/vroid_portrait.py | head -25; python3 - <<'PY'
    import sys,pickle,numpy as np
    sys.path[:0]=['tools'];p=pickle.load(open('review/out/astra-finish/site/portrait.pkl','rb'))
    for pc,r in zip(p.prims,p.roles):
     if r in ['body','shadow']:
      q=pc['pos'][np.unique(pc['tri'])];print(pc['material'],r,len(pc['tri']),q.min(0),q.max(0))
    PY

    result, 4 lines

    Script completed
    Wall time 0.2 seconds
    Output:
    {"chunk_id":"714672","wall_time_seconds":0.02919852,"exit_code":0,"original_token_count":481,"output":"6:-> hair shadow on the forehead.\n167:               face_normals=1.0, hair_normals=0.0, shadow_cards=1.0, fangs=1.0, rest={})\n374:    \"\"\"VRoid's faces are painted with blush on the cheeks and an orange shadow round the eyes: young.\n396:    halfway toward the line's middle, so cheeks, nose and jaw take clean shadow shapes that hold at every angle\n588:def _shadow_card(name, src, P):\n597:    pc = dict(mesh=\"shadow\", material=f\"SHADOW_{name}\", mi=-1, role=\"shadow\", pos=pos, nrm=src[\"nrm\"][near].copy(),\n604:CHIN_CARD = False      # the chin's shadow is cast in the painted renderer (screen-space, from the jaw); the card stays here\n607:def shadow_cards(prims, roles, lm, amount, neck=None):\n608:    \"\"\"The shadows anime faces draw, made as small pieces of geometry with designed outlines (the Yin and Yang rigs'\n609:    shadow cards) rather than by tilting the skin, which left ragged, scar-like edges along the mesh's triangles: a\n610:    crescent on the neck under the jaw (the chin's shadow), deepest under the chin and wrapping round toward the\n611:    ears, and a small one under the nose tip. Each lies just off the skin and takes the role \"shadow\": skin, always\n621:    if CHIN_CARD and body is not None and face is not None and neck is not None:      # the chin's shadow on the neck\n654:            out.append((_shadow_card(\"chin\", body, np.array(cols)), \"shadow\"))\n673:            out.append((_shadow_card(\"nose\", face, np.array(cols)), \"shadow\"))\n1028:        for pc, rl in shadow_cards(self.prims, self.roles, lm_now, sh[\"shadow_cards\"], neck):\n1193:            elif r == \"shadow\":                    # shadow cards: skin, always in shade\n1282:        # hair casts a short shadow down onto skin\nN00_000_00_Body_00_SKIN (Instance) body 1204 [-0.08819033  1.60570237 -0.0888634 ] [0.08819033 1.87801037 0.0601704 ]\nSHADOW_nose shadow 78 [-0.005311    1.69842893 -0.15422831] [ 0.0051244   1.70317229 -0.1467305 ]\n"}
  • exec_commandpython3 - <<'PY' (+1 more)

    command

    python3 - <<'PY'
    from pathlib import Path
    p=Path('review/astra-finish/build.py');s=p.read_text().replace("if role=='body': clip_above(pc,neck_y-.012)","""if role=='body':
                clip_above(pc,neck_y+.006)
                # Recut the lower neck to sit inside the standing collar; fade into the source head.
                q=pc['pos'];z0=rig.pos(P.BUST,'J_Bip_C_Neck')[2]
                radius=np.sqrt((q[:,0]/.066)**2+((q[:,2]-z0)/.061)**2)
                factor=np.maximum(radius,1)
                target=q.copy();target[:,0]/=factor;target[:,2]=z0+(q[:,2]-z0)/factor
                fade=np.clip((neck_y+.037-q[:,1])/.020,0,1)
                pc['pos']=q+(target-q)*fade[:,None]
                nn=vertex_normals(pc['pos'],pc['tri']);pc['nrm'][fade>0]=nn[fade>0]""")
    p.write_text(s)
    PY
    OPENBLAS_NUM_THREADS=1 python3 review/astra-finish/build.py
    
    python3 - <<'PY'
    import json,datetime
    p='review/astra-finish/timing.json';d=json.load(open(p));now=datetime.datetime.now(datetime.timezone.utc).isoformat();d['steps'].append({'label':'Garment construction, clean skinning, material export and multi-angle checks','start':d['steps'][-1]['end'],'end':now});open(p,'w').write(json.dumps(d,indent=2))
    PY

    result, 4 lines

    Script completed
    Wall time 1.2 seconds
    Output:
    {"chunk_id":"b50c91","wall_time_seconds":1.00143838,"session_id":5944,"original_token_count":0,"output":""}{"chunk_id":"97b4ff","wall_time_seconds":0.0000044,"exit_code":0,"original_token_count":0,"output":""}