Changeset View
Changeset View
Standalone View
Standalone View
release/scripts/modules/blend_render_info.py
| Show All 36 Lines | def read_blend_rend_chunk(path): | ||||
| import struct | import struct | ||||
| blendfile = open(path, "rb") | blendfile = open(path, "rb") | ||||
| head = blendfile.read(7) | head = blendfile.read(7) | ||||
| if head[0:2] == b'\x1f\x8b': # gzip magic | if head[0:2] == b'\x1f\x8b': # gzip magic | ||||
| import gzip | import gzip | ||||
| blendfile.close() | blendfile.seek(0) | ||||
| blendfile = gzip.open(path, "rb") | blendfile = gzip.open(blendfile, "rb") | ||||
| head = blendfile.read(7) | head = blendfile.read(7) | ||||
| if head != b'BLENDER': | if head != b'BLENDER': | ||||
| print("not a blend file:", path) | print("not a blend file:", path) | ||||
| blendfile.close() | blendfile.close() | ||||
| return [] | return [] | ||||
| is_64_bit = (blendfile.read(1) == b'-') | is_64_bit = (blendfile.read(1) == b'-') | ||||
| ▲ Show 20 Lines • Show All 48 Lines • Show Last 20 Lines | |||||