pedantic pep8 warnings, mostly white space.
This commit is contained in:
parent
4926667018
commit
d9f86e3c73
@ -31,50 +31,51 @@
|
|||||||
# int SDNAnr, nr;
|
# int SDNAnr, nr;
|
||||||
# } BHead;
|
# } BHead;
|
||||||
|
|
||||||
|
|
||||||
def read_blend_rend_chunk(path):
|
def read_blend_rend_chunk(path):
|
||||||
|
|
||||||
import struct
|
import struct
|
||||||
|
|
||||||
file = open(path, 'rb')
|
blendfile = open(path, 'rb')
|
||||||
|
|
||||||
head = file.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
|
||||||
file.close()
|
blendfile.close()
|
||||||
file = gzip.open(path, 'rb')
|
blendfile = gzip.open(path, 'rb')
|
||||||
head = file.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)
|
||||||
file.close()
|
blendfile.close()
|
||||||
return []
|
return []
|
||||||
|
|
||||||
is_64_bit = (file.read(1) == b'-')
|
is_64_bit = (blendfile.read(1) == b'-')
|
||||||
|
|
||||||
# true for PPC, false for X86
|
# 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!!!
|
# Now read the bhead chunk!!!
|
||||||
file.read(3) # skip the version
|
blendfile.read(3) # skip the version
|
||||||
|
|
||||||
scenes = []
|
scenes = []
|
||||||
|
|
||||||
sizeof_bhead = 24 if is_64_bit else 20
|
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
|
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
|
sizeof_bhead_left -= 4
|
||||||
|
|
||||||
# We dont care about the rest of the bhead struct
|
# 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
|
# 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')]
|
scene_name = scene_name[:scene_name.index(b'\0')]
|
||||||
|
|
||||||
|
@ -463,7 +463,6 @@ class WM_OT_path_open(bpy.types.Operator):
|
|||||||
return {'FINISHED'}
|
return {'FINISHED'}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
class WM_OT_doc_view(bpy.types.Operator):
|
class WM_OT_doc_view(bpy.types.Operator):
|
||||||
'''Load online reference docs'''
|
'''Load online reference docs'''
|
||||||
bl_idname = "wm.doc_view"
|
bl_idname = "wm.doc_view"
|
||||||
|
@ -191,6 +191,7 @@ class INFO_MT_curve_add(bpy.types.Menu):
|
|||||||
layout.operator("curve.primitive_nurbs_circle_add", icon='CURVE_NCIRCLE', text="Nurbs Circle")
|
layout.operator("curve.primitive_nurbs_circle_add", icon='CURVE_NCIRCLE', text="Nurbs Circle")
|
||||||
layout.operator("curve.primitive_nurbs_path_add", icon='CURVE_PATH', text="Path")
|
layout.operator("curve.primitive_nurbs_path_add", icon='CURVE_PATH', text="Path")
|
||||||
|
|
||||||
|
|
||||||
class INFO_MT_surface_add(bpy.types.Menu):
|
class INFO_MT_surface_add(bpy.types.Menu):
|
||||||
bl_idname = "INFO_MT_surface_add"
|
bl_idname = "INFO_MT_surface_add"
|
||||||
bl_label = "Surface"
|
bl_label = "Surface"
|
||||||
@ -205,6 +206,7 @@ class INFO_MT_surface_add(bpy.types.Menu):
|
|||||||
layout.operator("surface.primitive_nurbs_surface_sphere_add", icon='SURFACE_NSPHERE', text="NURBS Sphere")
|
layout.operator("surface.primitive_nurbs_surface_sphere_add", icon='SURFACE_NSPHERE', text="NURBS Sphere")
|
||||||
layout.operator("surface.primitive_nurbs_surface_donut_add", icon='SURFACE_NDONUT', text="NURBS Torus")
|
layout.operator("surface.primitive_nurbs_surface_donut_add", icon='SURFACE_NDONUT', text="NURBS Torus")
|
||||||
|
|
||||||
|
|
||||||
class INFO_MT_armature_add(bpy.types.Menu):
|
class INFO_MT_armature_add(bpy.types.Menu):
|
||||||
bl_idname = "INFO_MT_armature_add"
|
bl_idname = "INFO_MT_armature_add"
|
||||||
bl_label = "Armature"
|
bl_label = "Armature"
|
||||||
|
@ -106,6 +106,7 @@ class TIME_MT_view(bpy.types.Menu):
|
|||||||
|
|
||||||
layout.operator("marker.camera_bind")
|
layout.operator("marker.camera_bind")
|
||||||
|
|
||||||
|
|
||||||
class TIME_MT_cache(bpy.types.Menu):
|
class TIME_MT_cache(bpy.types.Menu):
|
||||||
bl_label = "Cache"
|
bl_label = "Cache"
|
||||||
|
|
||||||
@ -125,6 +126,7 @@ class TIME_MT_cache(bpy.types.Menu):
|
|||||||
col.prop(st, "cache_cloth")
|
col.prop(st, "cache_cloth")
|
||||||
col.prop(st, "cache_smoke")
|
col.prop(st, "cache_smoke")
|
||||||
|
|
||||||
|
|
||||||
class TIME_MT_frame(bpy.types.Menu):
|
class TIME_MT_frame(bpy.types.Menu):
|
||||||
bl_label = "Frame"
|
bl_label = "Frame"
|
||||||
|
|
||||||
|
@ -53,6 +53,7 @@ def ui_items_general(col, context):
|
|||||||
|
|
||||||
col.separator()
|
col.separator()
|
||||||
|
|
||||||
|
|
||||||
def opengl_lamp_buttons(column, lamp):
|
def opengl_lamp_buttons(column, lamp):
|
||||||
split = column.split(percentage=0.1)
|
split = column.split(percentage=0.1)
|
||||||
|
|
||||||
|
@ -732,7 +732,7 @@ class VIEW3D_MT_object_specials(bpy.types.Menu):
|
|||||||
props.data_path_item = "data.dof_distance"
|
props.data_path_item = "data.dof_distance"
|
||||||
props.input_scale = 0.02
|
props.input_scale = 0.02
|
||||||
|
|
||||||
if obj.type in ['CURVE','TEXT']:
|
if obj.type in ('CURVE','TEXT'):
|
||||||
layout.operator_context = 'INVOKE_REGION_WIN'
|
layout.operator_context = 'INVOKE_REGION_WIN'
|
||||||
|
|
||||||
props = layout.operator("wm.context_modal_mouse", text="Extrude Size")
|
props = layout.operator("wm.context_modal_mouse", text="Extrude Size")
|
||||||
@ -760,7 +760,7 @@ class VIEW3D_MT_object_specials(bpy.types.Menu):
|
|||||||
props.data_path_iter = "selected_editable_objects"
|
props.data_path_iter = "selected_editable_objects"
|
||||||
props.data_path_item = "data.energy"
|
props.data_path_item = "data.energy"
|
||||||
|
|
||||||
if obj.data.type in ['SPOT','AREA','POINT']:
|
if obj.data.type in ('SPOT', 'AREA', 'POINT'):
|
||||||
props = layout.operator("wm.context_modal_mouse", text="Falloff Distance")
|
props = layout.operator("wm.context_modal_mouse", text="Falloff Distance")
|
||||||
props.data_path_iter = "selected_editable_objects"
|
props.data_path_iter = "selected_editable_objects"
|
||||||
props.data_path_item = "data.distance"
|
props.data_path_item = "data.distance"
|
||||||
|
Loading…
x
Reference in New Issue
Block a user