pedantic pep8 warnings, mostly white space.
This commit is contained in:
parent
4926667018
commit
d9f86e3c73
@ -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)
|
||||
|
||||
# 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))
|
||||
blendfile.read(sizeof_bhead_left)
|
||||
|
||||
scene_name = file.read(24)
|
||||
# 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', blendfile.read(8))
|
||||
|
||||
scene_name = blendfile.read(24)
|
||||
|
||||
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_label = ""
|
||||
|
||||
filepath = StringProperty(name="File Path", maxlen= 1024)
|
||||
filepath = StringProperty(name="File Path", maxlen=1024)
|
||||
|
||||
def execute(self, context):
|
||||
import sys
|
||||
@ -444,13 +444,13 @@ class WM_OT_path_open(bpy.types.Operator):
|
||||
|
||||
filepath = bpy.utils.expandpath(self.properties.filepath)
|
||||
filepath = os.path.normpath(filepath)
|
||||
|
||||
|
||||
if not os.path.exists(filepath):
|
||||
self.report({'ERROR'}, "File '%s' not found" % filepath)
|
||||
return {'CANCELLED'}
|
||||
|
||||
|
||||
if sys.platform == 'win32':
|
||||
subprocess.Popen(['start', filepath], shell= True)
|
||||
subprocess.Popen(['start', filepath], shell=True)
|
||||
elif sys.platform == 'darwin':
|
||||
subprocess.Popen(['open', filepath])
|
||||
else:
|
||||
@ -463,7 +463,6 @@ class WM_OT_path_open(bpy.types.Operator):
|
||||
return {'FINISHED'}
|
||||
|
||||
|
||||
|
||||
class WM_OT_doc_view(bpy.types.Operator):
|
||||
'''Load online reference docs'''
|
||||
bl_idname = "wm.doc_view"
|
||||
|
@ -367,21 +367,21 @@ class DATA_PT_textboxes(DataButtonsPanel):
|
||||
|
||||
text = context.curve
|
||||
wide_ui = context.region.width > narrowui
|
||||
|
||||
|
||||
split = layout.split()
|
||||
col = split.column()
|
||||
col.operator("font.textbox_add", icon='ZOOMIN')
|
||||
if wide_ui:
|
||||
col = split.column()
|
||||
|
||||
|
||||
for i, box in enumerate(text.textboxes):
|
||||
|
||||
|
||||
boxy = layout.box()
|
||||
|
||||
|
||||
row = boxy.row()
|
||||
|
||||
|
||||
split = row.split()
|
||||
|
||||
|
||||
col = split.column(align=True)
|
||||
|
||||
col.label(text="Dimensions:")
|
||||
@ -390,13 +390,13 @@ class DATA_PT_textboxes(DataButtonsPanel):
|
||||
|
||||
if wide_ui:
|
||||
col = split.column(align=True)
|
||||
|
||||
|
||||
col.label(text="Offset:")
|
||||
col.prop(box, "x", text="X")
|
||||
col.prop(box, "y", text="Y")
|
||||
|
||||
row.operator("font.textbox_remove", text='', icon='X', emboss=False).index = i
|
||||
|
||||
|
||||
row.operator("font.textbox_remove", text='', icon='X', emboss=False).index = i
|
||||
|
||||
|
||||
classes = [
|
||||
DATA_PT_context_curve,
|
||||
|
@ -33,7 +33,7 @@ class ConstraintButtonsPanel(bpy.types.Panel):
|
||||
|
||||
wide_ui = context.region.width > narrowui
|
||||
compact_con = context.region.width < narrowcon
|
||||
box = layout.template_constraint(con, compact = compact_con)
|
||||
box = layout.template_constraint(con, compact=compact_con)
|
||||
|
||||
if box:
|
||||
# match enum type to our functions, avoids a lookup table.
|
||||
|
@ -189,10 +189,10 @@ class PHYSICS_PT_softbody_edge(PhysicButtonsPanel):
|
||||
col.label(text="Aerodynamics:")
|
||||
col.row().prop(softbody, "aerodynamics_type", expand=True)
|
||||
col.prop(softbody, "aero", text="Factor")
|
||||
|
||||
|
||||
#sub = col.column()
|
||||
#sub.enabled = softbody.aero > 0
|
||||
|
||||
|
||||
|
||||
col.label(text="Collision:")
|
||||
col.prop(softbody, "edge_collision", text="Edge")
|
||||
|
@ -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_path_add", icon='CURVE_PATH', text="Path")
|
||||
|
||||
|
||||
class INFO_MT_surface_add(bpy.types.Menu):
|
||||
bl_idname = "INFO_MT_surface_add"
|
||||
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_donut_add", icon='SURFACE_NDONUT', text="NURBS Torus")
|
||||
|
||||
|
||||
class INFO_MT_armature_add(bpy.types.Menu):
|
||||
bl_idname = "INFO_MT_armature_add"
|
||||
bl_label = "Armature"
|
||||
|
@ -38,7 +38,7 @@ class LOGIC_PT_properties(bpy.types.Panel):
|
||||
layout.operator("object.game_property_new", text="Add Game Property", icon='ZOOMIN')
|
||||
|
||||
for i, prop in enumerate(game.properties):
|
||||
|
||||
|
||||
box = layout.box()
|
||||
row = box.row()
|
||||
row.prop(prop, "name", text="")
|
||||
|
@ -99,13 +99,14 @@ class TIME_MT_view(bpy.types.Menu):
|
||||
layout.prop(st, "only_selected")
|
||||
|
||||
layout.separator()
|
||||
|
||||
|
||||
layout.menu("TIME_MT_cache")
|
||||
|
||||
|
||||
layout.separator()
|
||||
|
||||
layout.operator("marker.camera_bind")
|
||||
|
||||
|
||||
|
||||
class TIME_MT_cache(bpy.types.Menu):
|
||||
bl_label = "Cache"
|
||||
|
||||
@ -125,6 +126,7 @@ class TIME_MT_cache(bpy.types.Menu):
|
||||
col.prop(st, "cache_cloth")
|
||||
col.prop(st, "cache_smoke")
|
||||
|
||||
|
||||
class TIME_MT_frame(bpy.types.Menu):
|
||||
bl_label = "Frame"
|
||||
|
||||
|
@ -25,11 +25,11 @@ import shutil
|
||||
def ui_items_general(col, context):
|
||||
""" General UI Theme Settings (User Interface)
|
||||
"""
|
||||
|
||||
|
||||
row = col.row()
|
||||
|
||||
subsplit = row.split(percentage=0.95)
|
||||
|
||||
subsplit = row.split(percentage=0.95)
|
||||
|
||||
padding = subsplit.split(percentage=0.15)
|
||||
colsub = padding.column()
|
||||
colsub = padding.column()
|
||||
@ -37,9 +37,9 @@ def ui_items_general(col, context):
|
||||
colsub.row().prop(context, "item", slider=True)
|
||||
colsub.row().prop(context, "inner", slider=True)
|
||||
colsub.row().prop(context, "inner_sel", slider=True)
|
||||
|
||||
subsplit = row.split(percentage=0.85)
|
||||
|
||||
|
||||
subsplit = row.split(percentage=0.85)
|
||||
|
||||
padding = subsplit.split(percentage=0.15)
|
||||
colsub = padding.column()
|
||||
colsub = padding.column()
|
||||
@ -53,6 +53,7 @@ def ui_items_general(col, context):
|
||||
|
||||
col.separator()
|
||||
|
||||
|
||||
def opengl_lamp_buttons(column, lamp):
|
||||
split = column.split(percentage=0.1)
|
||||
|
||||
@ -500,7 +501,7 @@ class USERPREF_PT_theme(bpy.types.Panel):
|
||||
padding1 = subsplit.split(percentage=0.15)
|
||||
padding1.column()
|
||||
|
||||
subsplit = row.split(percentage=0.85)
|
||||
subsplit = row.split(percentage=0.85)
|
||||
|
||||
padding2 = subsplit.split(percentage=0.15)
|
||||
padding2.column()
|
||||
@ -531,13 +532,13 @@ class USERPREF_PT_theme(bpy.types.Panel):
|
||||
|
||||
split_themes = layout.split(percentage=0.2)
|
||||
split_themes.prop(theme, "theme_area", expand=True)
|
||||
|
||||
|
||||
split = layout.split(percentage=0.4)
|
||||
|
||||
|
||||
|
||||
|
||||
layout.separator()
|
||||
layout.separator()
|
||||
|
||||
|
||||
split = split_themes.split()
|
||||
|
||||
if theme.theme_area == 'USER_INTERFACE':
|
||||
@ -609,11 +610,11 @@ class USERPREF_PT_theme(bpy.types.Panel):
|
||||
|
||||
ui = theme.user_interface.wcol_state
|
||||
col.label(text="State:")
|
||||
|
||||
|
||||
row = col.row()
|
||||
|
||||
subsplit = row.split(percentage=0.95)
|
||||
|
||||
subsplit = row.split(percentage=0.95)
|
||||
|
||||
padding = subsplit.split(percentage=0.15)
|
||||
colsub = padding.column()
|
||||
colsub = padding.column()
|
||||
@ -621,9 +622,9 @@ class USERPREF_PT_theme(bpy.types.Panel):
|
||||
colsub.row().prop(ui, "inner_anim_sel")
|
||||
colsub.row().prop(ui, "inner_driven")
|
||||
colsub.row().prop(ui, "inner_driven_sel")
|
||||
|
||||
subsplit = row.split(percentage=0.85)
|
||||
|
||||
|
||||
subsplit = row.split(percentage=0.85)
|
||||
|
||||
padding = subsplit.split(percentage=0.15)
|
||||
colsub = padding.column()
|
||||
colsub = padding.column()
|
||||
@ -635,8 +636,8 @@ class USERPREF_PT_theme(bpy.types.Panel):
|
||||
ui = theme.user_interface
|
||||
col.separator()
|
||||
col.separator()
|
||||
|
||||
split= col.split(percentage=0.93)
|
||||
|
||||
split = col.split(percentage=0.93)
|
||||
split.prop(ui, "icon_file")
|
||||
|
||||
layout.separator()
|
||||
@ -917,7 +918,7 @@ class USERPREF_PT_addons(bpy.types.Panel):
|
||||
if info["warning"]:
|
||||
split = colsub.row().split(percentage=0.15)
|
||||
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"]:
|
||||
split = colsub.row().split(percentage=0.15)
|
||||
split.label(text="Internet:")
|
||||
|
@ -732,7 +732,7 @@ class VIEW3D_MT_object_specials(bpy.types.Menu):
|
||||
props.data_path_item = "data.dof_distance"
|
||||
props.input_scale = 0.02
|
||||
|
||||
if obj.type in ['CURVE','TEXT']:
|
||||
if obj.type in ('CURVE','TEXT'):
|
||||
layout.operator_context = 'INVOKE_REGION_WIN'
|
||||
|
||||
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_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.data_path_iter = "selected_editable_objects"
|
||||
props.data_path_item = "data.distance"
|
||||
|
@ -43,7 +43,7 @@ class VIEW3D_PT_tools_objectmode(View3DPanel):
|
||||
|
||||
col = layout.column(align=True)
|
||||
col.operator("object.origin_set", text="Origin")
|
||||
|
||||
|
||||
col = layout.column(align=True)
|
||||
col.label(text="Object:")
|
||||
col.operator("object.duplicate_move")
|
||||
|
Loading…
x
Reference in New Issue
Block a user