forked from bartvdbraak/blender
Cleanup: pep8
This commit is contained in:
parent
f0f398dcf3
commit
0e0e528ea4
@ -75,7 +75,7 @@ print(scene.test_float)
|
|||||||
scene.test_array = (True, False)
|
scene.test_array = (True, False)
|
||||||
print([x for x in scene.test_array])
|
print([x for x in scene.test_array])
|
||||||
|
|
||||||
#scene.test_date = "blah" # this would fail, property is read-only
|
# scene.test_date = "blah" # this would fail, property is read-only
|
||||||
print(scene.test_date)
|
print(scene.test_date)
|
||||||
|
|
||||||
scene.test_enum = 'BLUE'
|
scene.test_enum = 'BLUE'
|
||||||
|
@ -8,4 +8,3 @@ collection.foreach_get(attr, some_seq)
|
|||||||
# Python equivalent
|
# Python equivalent
|
||||||
for i in range(len(seq)):
|
for i in range(len(seq)):
|
||||||
some_seq[i] = getattr(collection[i], attr)
|
some_seq[i] = getattr(collection[i], attr)
|
||||||
|
|
||||||
|
@ -1,22 +1,22 @@
|
|||||||
# ***** BEGIN GPL LICENSE BLOCK *****
|
# ##### BEGIN GPL LICENSE BLOCK #####
|
||||||
#
|
#
|
||||||
# This program is free software; you can redistribute it and/or
|
# This program is free software; you can redistribute it and/or
|
||||||
# modify it under the terms of the GNU General Public License
|
# modify it under the terms of the GNU General Public License
|
||||||
# as published by the Free Software Foundation; either version 2
|
# as published by the Free Software Foundation; either version 2
|
||||||
# of the License, or (at your option) any later version.
|
# of the License, or (at your option) any later version.
|
||||||
#
|
#
|
||||||
# This program is distributed in the hope that it will be useful,
|
# This program is distributed in the hope that it will be useful,
|
||||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
# GNU General Public License for more details.
|
# GNU General Public License for more details.
|
||||||
#
|
#
|
||||||
# You should have received a copy of the GNU General Public License
|
# You should have received a copy of the GNU General Public License
|
||||||
# along with this program; if not, write to the Free Software Foundation,
|
# along with this program; if not, write to the Free Software Foundation,
|
||||||
# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||||
#
|
#
|
||||||
# Contributor(s): Campbell Barton, Luca Bonavita
|
# Contributor(s): Campbell Barton
|
||||||
#
|
#
|
||||||
# #**** END GPL LICENSE BLOCK #****
|
# ##### END GPL LICENSE BLOCK #####
|
||||||
|
|
||||||
# <pep8 compliant>
|
# <pep8 compliant>
|
||||||
|
|
||||||
|
@ -1,22 +1,22 @@
|
|||||||
# ***** BEGIN GPL LICENSE BLOCK *****
|
# ##### BEGIN GPL LICENSE BLOCK #####
|
||||||
#
|
#
|
||||||
# This program is free software; you can redistribute it and/or
|
# This program is free software; you can redistribute it and/or
|
||||||
# modify it under the terms of the GNU General Public License
|
# modify it under the terms of the GNU General Public License
|
||||||
# as published by the Free Software Foundation; either version 2
|
# as published by the Free Software Foundation; either version 2
|
||||||
# of the License, or (at your option) any later version.
|
# of the License, or (at your option) any later version.
|
||||||
#
|
#
|
||||||
# This program is distributed in the hope that it will be useful,
|
# This program is distributed in the hope that it will be useful,
|
||||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
# GNU General Public License for more details.
|
# GNU General Public License for more details.
|
||||||
#
|
#
|
||||||
# You should have received a copy of the GNU General Public License
|
# You should have received a copy of the GNU General Public License
|
||||||
# along with this program; if not, write to the Free Software Foundation,
|
# along with this program; if not, write to the Free Software Foundation,
|
||||||
# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||||
#
|
#
|
||||||
# Contributor(s): Campbell Barton
|
# Contributor(s): Campbell Barton
|
||||||
#
|
#
|
||||||
# #**** END GPL LICENSE BLOCK #****
|
# ##### END GPL LICENSE BLOCK #####
|
||||||
|
|
||||||
# <pep8 compliant>
|
# <pep8 compliant>
|
||||||
|
|
||||||
|
@ -33,6 +33,7 @@ import bpy
|
|||||||
from . import engine
|
from . import engine
|
||||||
from . import version_update
|
from . import version_update
|
||||||
|
|
||||||
|
|
||||||
class CyclesRender(bpy.types.RenderEngine):
|
class CyclesRender(bpy.types.RenderEngine):
|
||||||
bl_idname = 'CYCLES'
|
bl_idname = 'CYCLES'
|
||||||
bl_label = "Cycles Render"
|
bl_label = "Cycles Render"
|
||||||
|
@ -567,7 +567,7 @@ class CyclesObject_PT_motion_blur(CyclesButtonsPanel, Panel):
|
|||||||
layout = self.layout
|
layout = self.layout
|
||||||
|
|
||||||
rd = context.scene.render
|
rd = context.scene.render
|
||||||
scene = context.scene
|
# scene = context.scene
|
||||||
|
|
||||||
layout.active = rd.use_motion_blur
|
layout.active = rd.use_motion_blur
|
||||||
|
|
||||||
@ -580,7 +580,7 @@ class CyclesObject_PT_motion_blur(CyclesButtonsPanel, Panel):
|
|||||||
layout = self.layout
|
layout = self.layout
|
||||||
|
|
||||||
rd = context.scene.render
|
rd = context.scene.render
|
||||||
scene = context.scene
|
# scene = context.scene
|
||||||
|
|
||||||
ob = context.object
|
ob = context.object
|
||||||
cob = ob.cycles
|
cob = ob.cycles
|
||||||
@ -982,7 +982,7 @@ class CyclesMaterial_PT_volume(CyclesButtonsPanel, Panel):
|
|||||||
layout = self.layout
|
layout = self.layout
|
||||||
|
|
||||||
mat = context.material
|
mat = context.material
|
||||||
cmat = mat.cycles
|
# cmat = mat.cycles
|
||||||
|
|
||||||
panel_node_draw(layout, mat, 'OUTPUT_MATERIAL', 'Volume')
|
panel_node_draw(layout, mat, 'OUTPUT_MATERIAL', 'Volume')
|
||||||
|
|
||||||
@ -1209,7 +1209,6 @@ class CyclesRender_PT_CurveRendering(CyclesButtonsPanel, Panel):
|
|||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
def poll(cls, context):
|
def poll(cls, context):
|
||||||
scene = context.scene
|
|
||||||
psys = context.particle_system
|
psys = context.particle_system
|
||||||
return CyclesButtonsPanel.poll(context) and psys and psys.settings.type == 'HAIR'
|
return CyclesButtonsPanel.poll(context) and psys and psys.settings.type == 'HAIR'
|
||||||
|
|
||||||
@ -1284,7 +1283,7 @@ class CyclesRender_PT_bake(CyclesButtonsPanel, Panel):
|
|||||||
box.prop(cbk, "normal_space", text="Space")
|
box.prop(cbk, "normal_space", text="Space")
|
||||||
|
|
||||||
row = box.row(align=True)
|
row = box.row(align=True)
|
||||||
row.label(text = "Swizzle:")
|
row.label(text="Swizzle:")
|
||||||
row.prop(cbk, "normal_r", text="")
|
row.prop(cbk, "normal_r", text="")
|
||||||
row.prop(cbk, "normal_g", text="")
|
row.prop(cbk, "normal_g", text="")
|
||||||
row.prop(cbk, "normal_b", text="")
|
row.prop(cbk, "normal_b", text="")
|
||||||
|
@ -694,7 +694,7 @@ class _GenericUI:
|
|||||||
draw_funcs = cls._dyn_ui_initialize()
|
draw_funcs = cls._dyn_ui_initialize()
|
||||||
try:
|
try:
|
||||||
draw_funcs.remove(draw_func)
|
draw_funcs.remove(draw_func)
|
||||||
except:
|
except ValueError:
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
|
||||||
|
@ -92,7 +92,6 @@ def rna2xml(fw=print_ln,
|
|||||||
bpy.types.Sequence,
|
bpy.types.Sequence,
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
def number_to_str(val, val_type):
|
def number_to_str(val, val_type):
|
||||||
if val_type == int:
|
if val_type == int:
|
||||||
return "%d" % val
|
return "%d" % val
|
||||||
@ -245,13 +244,13 @@ def xml2rna(root_xml,
|
|||||||
):
|
):
|
||||||
|
|
||||||
def rna2xml_node(xml_node, value):
|
def rna2xml_node(xml_node, value):
|
||||||
# print("evaluating:", xml_node.nodeName)
|
# print("evaluating:", xml_node.nodeName)
|
||||||
|
|
||||||
# ---------------------------------------------------------------------
|
# ---------------------------------------------------------------------
|
||||||
# Simple attributes
|
# Simple attributes
|
||||||
|
|
||||||
for attr in xml_node.attributes.keys():
|
for attr in xml_node.attributes.keys():
|
||||||
# print(" ", attr)
|
# print(" ", attr)
|
||||||
subvalue = getattr(value, attr, Ellipsis)
|
subvalue = getattr(value, attr, Ellipsis)
|
||||||
|
|
||||||
if subvalue is Ellipsis:
|
if subvalue is Ellipsis:
|
||||||
|
@ -9,7 +9,7 @@
|
|||||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
# GNU General Public License for more details.
|
# GNU General Public License for more details.
|
||||||
#,
|
#
|
||||||
# You should have received a copy of the GNU General Public License
|
# You should have received a copy of the GNU General Public License
|
||||||
# along with this program; if not, write to the Free Software Foundation,
|
# along with this program; if not, write to the Free Software Foundation,
|
||||||
# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||||
|
@ -306,7 +306,8 @@ class UpdateAnimatedTransformConstraint(Operator):
|
|||||||
paths = from_paths | to_paths
|
paths = from_paths | to_paths
|
||||||
|
|
||||||
def update_cb(base, class_name, old_path, fcurve, options):
|
def update_cb(base, class_name, old_path, fcurve, options):
|
||||||
print(options)
|
# print(options)
|
||||||
|
|
||||||
def handle_deg2rad(fcurve):
|
def handle_deg2rad(fcurve):
|
||||||
if fcurve is not None:
|
if fcurve is not None:
|
||||||
if hasattr(fcurve, "keyframes"):
|
if hasattr(fcurve, "keyframes"):
|
||||||
|
@ -1934,7 +1934,6 @@ class WM_OT_addon_install(Operator):
|
|||||||
try:
|
try:
|
||||||
os.makedirs(path_addons, exist_ok=True)
|
os.makedirs(path_addons, exist_ok=True)
|
||||||
except:
|
except:
|
||||||
import traceback
|
|
||||||
traceback.print_exc()
|
traceback.print_exc()
|
||||||
|
|
||||||
# Check if we are installing from a target path,
|
# Check if we are installing from a target path,
|
||||||
|
@ -47,4 +47,3 @@ class GreasePencilPanel():
|
|||||||
|
|
||||||
col.label(text="Measure:")
|
col.label(text="Measure:")
|
||||||
col.operator("view3d.ruler")
|
col.operator("view3d.ruler")
|
||||||
|
|
||||||
|
@ -151,6 +151,7 @@ class OBJECT_PT_relations(ObjectButtonsPanel, Panel):
|
|||||||
sub.prop_search(ob, "parent_bone", parent.data, "bones", text="")
|
sub.prop_search(ob, "parent_bone", parent.data, "bones", text="")
|
||||||
sub.active = (parent is not None)
|
sub.active = (parent is not None)
|
||||||
|
|
||||||
|
|
||||||
class GROUP_MT_specials(Menu):
|
class GROUP_MT_specials(Menu):
|
||||||
bl_label = "Group Specials"
|
bl_label = "Group Specials"
|
||||||
|
|
||||||
|
@ -183,14 +183,10 @@ def brush_texpaint_common(panel, context, layout, brush, settings, projpaint=Fal
|
|||||||
col.template_ID(settings, "clone_image")
|
col.template_ID(settings, "clone_image")
|
||||||
col.label("UV Map")
|
col.label("UV Map")
|
||||||
col.menu("VIEW3D_MT_tools_projectpaint_clone", text=clone_text, translate=False)
|
col.menu("VIEW3D_MT_tools_projectpaint_clone", text=clone_text, translate=False)
|
||||||
|
|
||||||
|
|
||||||
else:
|
else:
|
||||||
col.prop(brush, "clone_image", text="Image")
|
col.prop(brush, "clone_image", text="Image")
|
||||||
col.prop(brush, "clone_alpha", text="Alpha")
|
col.prop(brush, "clone_alpha", text="Alpha")
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
col.separator()
|
col.separator()
|
||||||
|
|
||||||
if capabilities.has_radius:
|
if capabilities.has_radius:
|
||||||
|
@ -260,7 +260,7 @@ class CLIP_PT_tools_marker(CLIP_PT_tracking_panel, Panel):
|
|||||||
def draw(self, context):
|
def draw(self, context):
|
||||||
layout = self.layout
|
layout = self.layout
|
||||||
|
|
||||||
sc = context.space_data
|
# sc = context.space_data
|
||||||
# clip = sc.clip
|
# clip = sc.clip
|
||||||
|
|
||||||
col = layout.column(align=True)
|
col = layout.column(align=True)
|
||||||
|
@ -259,6 +259,7 @@ class SEQUENCER_MT_frame(Menu):
|
|||||||
layout.operator("anim.previewrange_clear")
|
layout.operator("anim.previewrange_clear")
|
||||||
layout.operator("anim.previewrange_set")
|
layout.operator("anim.previewrange_set")
|
||||||
|
|
||||||
|
|
||||||
class SEQUENCER_MT_add(Menu):
|
class SEQUENCER_MT_add(Menu):
|
||||||
bl_label = "Add"
|
bl_label = "Add"
|
||||||
|
|
||||||
@ -607,7 +608,7 @@ class SEQUENCER_PT_effect(SequencerButtonsPanel, Panel):
|
|||||||
col = layout.column(align=True)
|
col = layout.column(align=True)
|
||||||
if strip.type == 'SPEED':
|
if strip.type == 'SPEED':
|
||||||
col.prop(strip, "multiply_speed")
|
col.prop(strip, "multiply_speed")
|
||||||
elif strip.type in {'CROSS', 'GAMMA_CROSS', 'WIPE', 'ALPHA_OVER','ALPHA_UNDER','OVER_DROP'}:
|
elif strip.type in {'CROSS', 'GAMMA_CROSS', 'WIPE', 'ALPHA_OVER', 'ALPHA_UNDER', 'OVER_DROP'}:
|
||||||
col.prop(strip, "use_default_fade", "Default fade")
|
col.prop(strip, "use_default_fade", "Default fade")
|
||||||
if not strip.use_default_fade:
|
if not strip.use_default_fade:
|
||||||
col.prop(strip, "effect_fader", text="Effect fader")
|
col.prop(strip, "effect_fader", text="Effect fader")
|
||||||
|
@ -424,7 +424,6 @@ class USERPREF_PT_system(Panel):
|
|||||||
col.prop(system, "use_gpu_mipmap")
|
col.prop(system, "use_gpu_mipmap")
|
||||||
col.prop(system, "use_16bit_textures")
|
col.prop(system, "use_16bit_textures")
|
||||||
|
|
||||||
|
|
||||||
if system.is_occlusion_query_supported():
|
if system.is_occlusion_query_supported():
|
||||||
col.separator()
|
col.separator()
|
||||||
col.label(text="Selection")
|
col.label(text="Selection")
|
||||||
|
@ -2198,7 +2198,6 @@ class VIEW3D_MT_edit_mesh_edges(Menu):
|
|||||||
layout = self.layout
|
layout = self.layout
|
||||||
|
|
||||||
with_freestyle = bpy.app.build_options.freestyle
|
with_freestyle = bpy.app.build_options.freestyle
|
||||||
scene = context.scene
|
|
||||||
|
|
||||||
layout.operator_context = 'INVOKE_REGION_WIN'
|
layout.operator_context = 'INVOKE_REGION_WIN'
|
||||||
|
|
||||||
@ -2254,7 +2253,6 @@ class VIEW3D_MT_edit_mesh_faces(Menu):
|
|||||||
layout = self.layout
|
layout = self.layout
|
||||||
|
|
||||||
with_freestyle = bpy.app.build_options.freestyle
|
with_freestyle = bpy.app.build_options.freestyle
|
||||||
scene = context.scene
|
|
||||||
|
|
||||||
layout.operator_context = 'INVOKE_REGION_WIN'
|
layout.operator_context = 'INVOKE_REGION_WIN'
|
||||||
|
|
||||||
@ -2951,7 +2949,7 @@ class VIEW3D_PT_view3d_meshdisplay(Panel):
|
|||||||
|
|
||||||
sub = row.row(align=True)
|
sub = row.row(align=True)
|
||||||
sub.active = mesh.show_normal_vertex or mesh.show_normal_face or mesh.show_normal_loop
|
sub.active = mesh.show_normal_vertex or mesh.show_normal_face or mesh.show_normal_loop
|
||||||
sub.prop(context.scene.tool_settings, "normal_size", text="Size")
|
sub.prop(scene.tool_settings, "normal_size", text="Size")
|
||||||
|
|
||||||
col.separator()
|
col.separator()
|
||||||
split = layout.split()
|
split = layout.split()
|
||||||
|
@ -1027,7 +1027,7 @@ class VIEW3D_PT_slots_projectpaint(View3DPanel, Panel):
|
|||||||
col = layout.column()
|
col = layout.column()
|
||||||
|
|
||||||
col.label("Painting Mode")
|
col.label("Painting Mode")
|
||||||
col.prop(settings, "mode", text = "")
|
col.prop(settings, "mode", text="")
|
||||||
col.separator()
|
col.separator()
|
||||||
|
|
||||||
if settings.mode == 'MATERIAL':
|
if settings.mode == 'MATERIAL':
|
||||||
@ -1064,7 +1064,6 @@ class VIEW3D_PT_slots_projectpaint(View3DPanel, Panel):
|
|||||||
col.operator("image.save_dirty", text="Save All Images")
|
col.operator("image.save_dirty", text="Save All Images")
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
class VIEW3D_PT_stencil_projectpaint(View3DPanel, Panel):
|
class VIEW3D_PT_stencil_projectpaint(View3DPanel, Panel):
|
||||||
bl_context = "imagepaint"
|
bl_context = "imagepaint"
|
||||||
bl_label = "Stencil"
|
bl_label = "Stencil"
|
||||||
|
@ -1,5 +1,4 @@
|
|||||||
import bpy
|
import bpy
|
||||||
from mathutils import Vector
|
|
||||||
from bpy_extras import view3d_utils
|
from bpy_extras import view3d_utils
|
||||||
|
|
||||||
|
|
||||||
@ -106,4 +105,3 @@ def unregister():
|
|||||||
|
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
register()
|
register()
|
||||||
|
|
||||||
|
@ -11,4 +11,3 @@ filepath = os.path.join(os.path.dirname(bpy.data.filepath), filename)
|
|||||||
global_namespace = {"__file__": filepath, "__name__": "__main__"}
|
global_namespace = {"__file__": filepath, "__name__": "__main__"}
|
||||||
with open(filepath, 'rb') as file:
|
with open(filepath, 'rb') as file:
|
||||||
exec(compile(file.read(), filepath, 'exec'), global_namespace)
|
exec(compile(file.read(), filepath, 'exec'), global_namespace)
|
||||||
|
|
||||||
|
@ -29,4 +29,3 @@ if __name__ == "__main__":
|
|||||||
register()
|
register()
|
||||||
|
|
||||||
bpy.ops.wm.call_menu_pie(name="VIEW3D_PIE_template")
|
bpy.ops.wm.call_menu_pie(name="VIEW3D_PIE_template")
|
||||||
|
|
||||||
|
@ -1,22 +1,22 @@
|
|||||||
# ***** BEGIN GPL LICENSE BLOCK *****
|
# ##### BEGIN GPL LICENSE BLOCK #####
|
||||||
#
|
#
|
||||||
# This program is free software; you can redistribute it and/or
|
# This program is free software; you can redistribute it and/or
|
||||||
# modify it under the terms of the GNU General Public License
|
# modify it under the terms of the GNU General Public License
|
||||||
# as published by the Free Software Foundation; either version 2
|
# as published by the Free Software Foundation; either version 2
|
||||||
# of the License, or (at your option) any later version.
|
# of the License, or (at your option) any later version.
|
||||||
#
|
#
|
||||||
# This program is distributed in the hope that it will be useful,
|
# This program is distributed in the hope that it will be useful,
|
||||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
# GNU General Public License for more details.
|
# GNU General Public License for more details.
|
||||||
#
|
#
|
||||||
# You should have received a copy of the GNU General Public License
|
# You should have received a copy of the GNU General Public License
|
||||||
# along with this program; if not, write to the Free Software Foundation,
|
# along with this program; if not, write to the Free Software Foundation,
|
||||||
# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||||
#
|
#
|
||||||
# Contributor(s): Campbell Barton
|
# Contributor(s): Campbell Barton
|
||||||
#
|
#
|
||||||
# #**** END GPL LICENSE BLOCK #****
|
# ##### END GPL LICENSE BLOCK #####
|
||||||
|
|
||||||
# <pep8 compliant>
|
# <pep8 compliant>
|
||||||
|
|
||||||
|
@ -851,7 +851,7 @@ if __name__ == "__main__":
|
|||||||
import traceback
|
import traceback
|
||||||
traceback.print_exc()
|
traceback.print_exc()
|
||||||
|
|
||||||
import sys
|
# import sys
|
||||||
# sys.exit(1) # comment to debug
|
# sys.exit(1) # comment to debug
|
||||||
|
|
||||||
else:
|
else:
|
||||||
|
Loading…
Reference in New Issue
Block a user