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')]
|
||||||
|
|
||||||
|
@ -435,7 +435,7 @@ class WM_OT_path_open(bpy.types.Operator):
|
|||||||
bl_idname = "wm.path_open"
|
bl_idname = "wm.path_open"
|
||||||
bl_label = ""
|
bl_label = ""
|
||||||
|
|
||||||
filepath = StringProperty(name="File Path", maxlen= 1024)
|
filepath = StringProperty(name="File Path", maxlen=1024)
|
||||||
|
|
||||||
def execute(self, context):
|
def execute(self, context):
|
||||||
import sys
|
import sys
|
||||||
@ -450,7 +450,7 @@ class WM_OT_path_open(bpy.types.Operator):
|
|||||||
return {'CANCELLED'}
|
return {'CANCELLED'}
|
||||||
|
|
||||||
if sys.platform == 'win32':
|
if sys.platform == 'win32':
|
||||||
subprocess.Popen(['start', filepath], shell= True)
|
subprocess.Popen(['start', filepath], shell=True)
|
||||||
elif sys.platform == 'darwin':
|
elif sys.platform == 'darwin':
|
||||||
subprocess.Popen(['open', filepath])
|
subprocess.Popen(['open', filepath])
|
||||||
else:
|
else:
|
||||||
@ -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"
|
||||||
|
@ -33,7 +33,7 @@ class ConstraintButtonsPanel(bpy.types.Panel):
|
|||||||
|
|
||||||
wide_ui = context.region.width > narrowui
|
wide_ui = context.region.width > narrowui
|
||||||
compact_con = context.region.width < narrowcon
|
compact_con = context.region.width < narrowcon
|
||||||
box = layout.template_constraint(con, compact = compact_con)
|
box = layout.template_constraint(con, compact=compact_con)
|
||||||
|
|
||||||
if box:
|
if box:
|
||||||
# match enum type to our functions, avoids a lookup table.
|
# match enum type to our functions, avoids a lookup table.
|
||||||
|
@ -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)
|
||||||
|
|
||||||
@ -636,7 +637,7 @@ class USERPREF_PT_theme(bpy.types.Panel):
|
|||||||
col.separator()
|
col.separator()
|
||||||
col.separator()
|
col.separator()
|
||||||
|
|
||||||
split= col.split(percentage=0.93)
|
split = col.split(percentage=0.93)
|
||||||
split.prop(ui, "icon_file")
|
split.prop(ui, "icon_file")
|
||||||
|
|
||||||
layout.separator()
|
layout.separator()
|
||||||
@ -917,7 +918,7 @@ class USERPREF_PT_addons(bpy.types.Panel):
|
|||||||
if info["warning"]:
|
if info["warning"]:
|
||||||
split = colsub.row().split(percentage=0.15)
|
split = colsub.row().split(percentage=0.15)
|
||||||
split.label(text="Warning:")
|
split.label(text="Warning:")
|
||||||
split.label(text=' ' + info["warning"], icon = 'ERROR')
|
split.label(text=' ' + info["warning"], icon='ERROR')
|
||||||
if info["wiki_url"] or info["tracker_url"]:
|
if info["wiki_url"] or info["tracker_url"]:
|
||||||
split = colsub.row().split(percentage=0.15)
|
split = colsub.row().split(percentage=0.15)
|
||||||
split.label(text="Internet:")
|
split.label(text="Internet:")
|
||||||
|
@ -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