Fix stale packed textures in summit marker export

This commit is contained in:
2026-10-31 11:04:53 +09:00
parent 1b8698565a
commit 18dfb63350
4 changed files with 27 additions and 1 deletions
+10
View File
@@ -15,6 +15,16 @@ for obj in [marker,*marker.children_recursive]:obj.select_set(True)
bpy.context.view_layer.objects.active=marker
location=marker.location.copy();marker.location=(0,0,0)
photo_body=bpy.data.objects.get('Photo matched summit boulder')
# Repacking an already-packed image after baking can retain its old PNG bytes.
# Refresh from the saved bake before glTF copies those bytes into the GLB.
if photo_body and photo_body.get('paintedInscription'):
images={n.image for mat in photo_body.data.materials for n in mat.node_tree.nodes
if n.type=='TEX_IMAGE' and n.image and n.image.filepath}
for image in images:
path=Path(bpy.path.abspath(image.filepath))
data=path.read_bytes()
image.pack(data=data,data_len=len(data))
image.reload()
restore=None
if photo_body and not photo_body.get('paintedInscription'):
mat=photo_body.data.materials[0]