import bpy,json,hashlib,struct,re
from pathlib import Path
ROOT=Path(__file__).resolve().parents[1]
def signature():
    h=hashlib.sha256()
    for o in sorted(bpy.data.objects,key=lambda x:x.name):
        h.update(o.name.encode())
        if o.type=='MESH':
            for v in o.data.vertices:h.update(struct.pack('<3f',*v.co))
            for f in o.data.polygons:h.update(struct.pack('<I',len(f.vertices))+struct.pack('<'+'I'*len(f.vertices),*f.vertices))
        elif o.type=='CURVE':
            for sp in o.data.splines:
                for p in sp.points:h.update(struct.pack('<4f',*p.co))
    for frame in [1,60,90,120]:
        bpy.context.scene.frame_set(frame)
        for o in sorted(bpy.data.objects,key=lambda x:x.name):
            for row in o.matrix_world:h.update(struct.pack('<4f',*row))
    return h.hexdigest()
before=signature()
NOTES='EN LIGHT - REV B - ENGLISH EDITION\nDesign revision: 2026-11-02. English issue: 2026-11-03.\n\nUser-confirmed arrangement: both U-shaped leg frames flip upwards and meet as the carrying grip. There is no separate carry bail or fixed lid-top handle.\nLid rise changes from 32 to 85 mm. The bowl and lid have the same white enamel on both sides. Nominal central headroom is 89.3 mm. A D280 x H50 food-cylinder example has about 10.3 mm minimum vertical clearance, excluding enamel, deformation and tolerances.\n\nTimeline presets:\nFrame 1: legs deployed, lid closed.\nFrame 60: exploded structure.\nFrame 90: compact stowage, frames rotated about 11.3 degrees.\nFrame 120: frames raised about 122.2 degrees for suspended carrying. This is not a resting configuration.\nLinear keyframe interpolation illustrates poses; it is not an operating sequence or a complete collision check.\n\nThe short side pivots are coaxial along X. Front and rear frames are offset axially by 8 mm. Each central grip/foot sleeve is L80 x OD14; their raised centre spacing is 20 mm. The sleeve underside is about 46.2 mm above the lid crown.\nRigid deployed stops, independent anti-fold locks for both frames, three-position retention and a coupling between the grips remain to be engineered. Small lock blocks only indicate required locations.\nAfter complete cooling, empty the ash, latch the lid and support the cold body while moving the frames. Validate one-person operation on a sample. Restore and lock both support frames before resting the grill on a table.\nA separate purchased rim-clamp lid lifter is required for hot-lid removal and must be tested. Do not use the vent as a handle.\n\nLocal geometric checks do not constitute thermal, strength, stability or tooling approval. Existing mould dimensions have not been obtained, so mould reuse is unconfirmed.\nScene units are metres; displayed lengths are millimetres. This editable mesh/curve visualization is not parametric mechanical CAD or STEP.\n'
bpy.data.texts['READ_ME_EN_LIGHT'].clear()
bpy.data.texts['READ_ME_EN_LIGHT'].write(NOTES)
bpy.context.scene.frame_set(1)
bpy.context.scene.render.filepath='//01_Blender_Closed_Deployed.png'
bpy.context.scene['language']='English'
bpy.context.scene['english_issue_date']='2026-11-03'
assert signature()==before
bpy.context.scene.frame_set(1)
for text in bpy.data.texts:assert not re.search(r'[\u3400-\u9fff]',text.as_string())
bpy.ops.wm.save_as_mainfile(filepath=str(ROOT/'EN_Light_RevB_3D_Model.blend'),compress=True)
report={'geometry_and_four_pose_sha256_before':before,'geometry_and_four_pose_sha256_after':signature(),'geometry_and_poses_unchanged':True,'text_language':'English','english_issue_date':'2026-11-03'}
(ROOT/'support'/'localization_verification.json').write_text(json.dumps(report,indent=2),encoding='utf-8')
print('LOCALIZED_MODEL',json.dumps(report),flush=True)
