diff options
author | Campbell Barton <ideasman42@gmail.com> | 2010-07-06 02:22:22 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2010-07-06 02:22:22 +0400 |
commit | d9f86e3c7393621589aaf5813d0766b16c23a08c (patch) | |
tree | 284272ca2c02e1c23bb78c96618638d2ab119659 /release/scripts/modules/blend_render_info.py | |
parent | 4926667018caeb52cd8b59d85c3d00c35775d24d (diff) |
pedantic pep8 warnings, mostly white space.
Diffstat (limited to 'release/scripts/modules/blend_render_info.py')
-rwxr-xr-x | release/scripts/modules/blend_render_info.py | 37 |
1 files changed, 19 insertions, 18 deletions
diff --git a/release/scripts/modules/blend_render_info.py b/release/scripts/modules/blend_render_info.py index b7018ad6b64..dcd1f9cbee3 100755 --- a/release/scripts/modules/blend_render_info.py +++ b/release/scripts/modules/blend_render_info.py @@ -31,50 +31,51 @@ # int SDNAnr, nr; # } BHead; + def read_blend_rend_chunk(path): import struct - file = open(path, 'rb') - - head = file.read(7) + blendfile = open(path, 'rb') + + head = blendfile.read(7) if head[0:2] == b'\x1f\x8b': # gzip magic import gzip - file.close() - file = gzip.open(path, 'rb') - head = file.read(7) + blendfile.close() + blendfile = gzip.open(path, 'rb') + head = blendfile.read(7) if head != b'BLENDER': print("not a blend file:", path) - file.close() + blendfile.close() return [] - is_64_bit = (file.read(1) == b'-') + is_64_bit = (blendfile.read(1) == b'-') # true for PPC, false for X86 - is_big_endian = (file.read(1) == b'V') + is_big_endian = (blendfile.read(1) == b'V') # Now read the bhead chunk!!! - file.read(3) # skip the version + blendfile.read(3) # skip the version scenes = [] - + sizeof_bhead = 24 if is_64_bit else 20 - while file.read(4) == b'REND': + while blendfile.read(4) == b'REND': sizeof_bhead_left = sizeof_bhead - 4 - - rend_length = struct.unpack('>i' if is_big_endian else '<i', file.read(4))[0] + + struct.unpack('>i' if is_big_endian else '<i', blendfile.read(4))[0] sizeof_bhead_left -= 4 # We dont care about the rest of the bhead struct - file.read(sizeof_bhead_left) - + blendfile.read(sizeof_bhead_left) + # Now we want the scene name, start and end frame. this is 32bites long - start_frame, end_frame = struct.unpack('>2i' if is_big_endian else '<2i', file.read(8)) + start_frame, end_frame = struct.unpack('>2i' if is_big_endian else '<2i', blendfile.read(8)) - scene_name = file.read(24) + scene_name = blendfile.read(24) scene_name = scene_name[:scene_name.index(b'\0')] |