cleanup: pep8

also remove empty class parenthesis
This commit is contained in:
Campbell Barton 2015-01-29 15:35:06 +11:00
parent d434815ff7
commit 7095f47665
67 changed files with 141 additions and 119 deletions

View File

@ -4,10 +4,10 @@
# <pep8 compliant>
# List of the branches being built automatically overnight
NIGHT_SCHEDULE_BRANCHES=[None, "gooseberry"]
NIGHT_SCHEDULE_BRANCHES = [None, "gooseberry"]
# List of the branches available for force build
FORCE_SCHEDULE_BRANCHES=["master", "gooseberry", "experimental-build"]
FORCE_SCHEDULE_BRANCHES = ["master", "gooseberry", "experimental-build"]
"""
Stock Twisted directory lister doesn't provide any information about last file
@ -17,6 +17,7 @@ modification time, we hack the class a bit in order to have such functionaliity
from buildbot.status.web.base import DirectoryLister
def get_files_and_directories(self, directory):
from twisted.web.static import (getTypeAndEncoding,
formatFileSize)
@ -97,6 +98,7 @@ all_repositories = {
r'https://svn.blender.org/svnroot/bf-blender/': 'lib svn',
}
def codebaseGenerator(chdict):
return all_repositories[chdict['repository']]
@ -112,6 +114,7 @@ from buildbot.schedulers import timed, forcesched
c['schedulers'] = []
def schedule_force_build(name):
c['schedulers'].append(forcesched.ForceScheduler(name='force ' + name,
builderNames=[name],

View File

@ -37,6 +37,7 @@ def strip_extension(filename):
return filename
# extract platform from package name
def get_platform(filename):
# name is blender-version-platform.extension. we want to get the
@ -64,10 +65,11 @@ def get_platform(filename):
return '-'.join(platform_tokens)
def get_branch(filename):
tokens = filename.split("-")
branch = ""
for token in tokens:
if token == "blender":
return branch

View File

@ -47,9 +47,9 @@ if 'cmake' in builder:
cmake_options.append('-DCMAKE_OSX_ARCHITECTURES:STRING=ppc')
if 'win64' in builder:
cmake_options.append(['-G','"Visual Studio 12 2013 Win64"'])
cmake_options.append(['-G', '"Visual Studio 12 2013 Win64"'])
elif 'win32' in builder:
cmake_options.append(['-G','"Visual Studio 12 2013"'])
cmake_options.append(['-G', '"Visual Studio 12 2013"'])
cmake_options.append("-C../blender.git/build_files/cmake/config/blender_full.cmake")
cmake_options.append("-DWITH_CYCLES_CUDA_BINARIES=1")

View File

@ -116,12 +116,12 @@ if builder.find('scons') != -1:
retcode = subprocess.call([python_bin, 'scons/scons.py'] + scons_options)
sys.exit(retcode)
else:
#cmake
# CMake
if 'win' in builder:
files = [f for f in os.listdir('.') if os.path.isfile(f) and f.endswith('.zip')]
for f in files:
os.remove(f)
retcode = subprocess.call(['cpack', '-G','ZIP'])
retcode = subprocess.call(['cpack', '-G', 'ZIP'])
result_file = [f for f in os.listdir('.') if os.path.isfile(f) and f.endswith('.zip')][0]
os.rename(result_file, "{}.zip".format(builder))
# create zip file

View File

@ -7,7 +7,7 @@ A mix-in parent class can be used to share common properties and
import bpy
class View3DPanel():
class View3DPanel:
bl_space_type = 'VIEW_3D'
bl_region_type = 'TOOLS'

View File

@ -316,7 +316,7 @@ def main():
try:
import argparse
except:
except ImportError:
print("Old Blender, just dumping")
api_dump()
return

View File

@ -101,6 +101,7 @@ def with_network():
import _cycles
return _cycles.with_network
def system_info():
import _cycles
return _cycles.system_info()

View File

@ -481,7 +481,7 @@ class CyclesRenderSettings(bpy.types.PropertyGroup):
name="Bake Type",
default='COMBINED',
description="Type of pass to bake",
items = (
items=(
('COMBINED', "Combined", ""),
('AO', "Ambient Occlusion", ""),
('SHADOW', "Shadow", ""),

View File

@ -37,7 +37,7 @@ class CYCLES_MT_integrator_presets(Menu):
draw = Menu.draw_preset
class CyclesButtonsPanel():
class CyclesButtonsPanel:
bl_space_type = "PROPERTIES"
bl_region_type = "WINDOW"
bl_context = "render"

View File

@ -62,6 +62,7 @@ def _gen_check_ctxt(settings):
"spell_errors": {},
}
def _diff_check_ctxt(check_ctxt, minus_check_ctxt):
"""Returns check_ctxt - minus_check_ctxt"""
for key in check_ctxt:
@ -74,6 +75,7 @@ def _diff_check_ctxt(check_ctxt, minus_check_ctxt):
if warning in check_ctxt[key]:
del check_ctxt[key][warning]
def _gen_reports(check_ctxt):
return {
"check_ctxt": check_ctxt,
@ -473,7 +475,6 @@ def dump_py_messages_from_files(msgs, reports, files, settings):
return [_extract_string_merge(estr_ls, nds_ls) for estr_ls, nds_ls in bag]
i18n_ctxt_ids = {v for v in bpy.app.translations.contexts_C_to_py.values()}
def _ctxt_to_ctxt(node):
# We must try, to some extend, to get contexts from vars instead of only literal strings...

View File

@ -473,6 +473,7 @@ for p in set(INTERN_PY_SYS_PATHS.split(";")):
def _do_get(ref, path):
return os.path.normpath(os.path.join(ref, path))
def _do_set(ref, path):
path = os.path.normpath(path)
# If given path is absolute, make it relative to current ref one (else we consider it is already the case!)
@ -484,6 +485,7 @@ def _do_set(ref, path):
pass
return path
def _gen_get_set_path(ref, name):
def _get(self):
return _do_get(getattr(self, ref), getattr(self, name))
@ -491,6 +493,7 @@ def _gen_get_set_path(ref, name):
setattr(self, name, _do_set(getattr(self, ref), value))
return _get, _set
def _gen_get_set_paths(ref, name):
def _get(self):
return [_do_get(getattr(self, ref), p) for p in getattr(self, name)]
@ -498,6 +501,7 @@ def _gen_get_set_paths(ref, name):
setattr(self, name, [_do_set(getattr(self, ref), p) for p in value])
return _get, _set
class I18nSettings:
"""
Class allowing persistence of our settings!

View File

@ -24,7 +24,7 @@ import pickle
import re
class SpellChecker():
class SpellChecker:
"""
A basic spell checker.
"""

View File

@ -245,7 +245,7 @@ def keyconfig_export(wm, kc, filepath):
# the default blender keyconfig, recreating the current setup from a fresh blender
# without needing to export keymaps which haven't been edited.
class FakeKeyConfig():
class FakeKeyConfig:
keymaps = []
edited_kc = FakeKeyConfig()
for km in wm.keyconfigs.user.keymaps:

View File

@ -29,7 +29,7 @@ __all__ = (
import bpy as _bpy
class _RestrictContext():
class _RestrictContext:
__slots__ = ()
_real_data = _bpy.data
# safe, the pointer never changes
@ -44,7 +44,7 @@ class _RestrictContext():
return self._real_pref
class _RestrictData():
class _RestrictData:
__slots__ = ()
@ -52,7 +52,7 @@ _context_restrict = _RestrictContext()
_data_restrict = _RestrictData()
class RestrictBlend():
class RestrictBlend:
__slots__ = ("context", "data")
def __enter__(self):

View File

@ -84,7 +84,7 @@ def _call_recursive(context, base, py_node):
_call_recursive(context, base_new, py_node_child)
class BPyML_BaseUI():
class BPyML_BaseUI:
"""
This is a mix-in class that defines a draw function
which checks for draw_data

View File

@ -20,7 +20,7 @@
import bpy
class NodeCategory():
class NodeCategory:
@classmethod
def poll(cls, context):
return True
@ -42,7 +42,7 @@ class NodeCategory():
self.items = items_gen
class NodeItem():
class NodeItem:
def __init__(self, nodetype, label=None, settings={}, poll=None):
self.nodetype = nodetype
self._label = label
@ -73,7 +73,7 @@ class NodeItem():
ops.value = setting[1]
class NodeItemCustom():
class NodeItemCustom:
def __init__(self, poll=None, draw=None):
self.poll = poll
self.draw = draw

View File

@ -168,7 +168,7 @@ def draw(layout, context, context_member, property_type, use_edit=True):
assign_props(props, val_draw, key)
class PropertyPanel():
class PropertyPanel:
"""
The subclass should have its own poll function
and the variable '_context_path' MUST be set.

View File

@ -331,7 +331,7 @@ def xml2rna(root_xml,
rna2xml_node(child_xml_real, subsubvalue)
else:
# print(elems)
# print(elems)
if len(elems) == 1:
# sub node named by its type

View File

@ -153,7 +153,7 @@ def write_sysinfo(op):
else:
output.write("\nOpenGL\n")
output.write(lilies)
version = bgl.glGetString(bgl.GL_RENDERER);
version = bgl.glGetString(bgl.GL_RENDERER)
output.write("renderer:\t%r\n" % version)
output.write("vendor:\t\t%r\n" % (bgl.glGetString(bgl.GL_VENDOR)))
output.write("version:\t%r\n" % (bgl.glGetString(bgl.GL_VERSION)))

View File

@ -42,7 +42,7 @@ class NodeSetting(PropertyGroup):
# Base class for node 'Add' operators
class NodeAddOperator():
class NodeAddOperator:
type = StringProperty(
name="Node Type",

View File

@ -252,7 +252,7 @@ class SubdivisionSet(Operator):
if not relative:
if level > mod.total_levels:
sub = level - mod.total_levels
for i in range (0, sub):
for i in range(sub):
bpy.ops.object.multires_subdivide(modifier="Multires")
if obj.mode == 'SCULPT':

View File

@ -23,7 +23,7 @@ from bpy.types import Menu, Operator
from bpy.props import StringProperty, BoolProperty
class AddPresetBase():
class AddPresetBase:
"""Base preset class, only for subclassing
subclasses must define
- preset_values

View File

@ -176,8 +176,6 @@ class VertexPaintDirt(Operator):
return (obj and obj.type == 'MESH')
def execute(self, context):
import time
obj = context.object
mesh = obj.data

View File

@ -1988,7 +1988,6 @@ class WM_OT_addon_install(Operator):
# if not compressed file just copy into the addon path
try:
shutil.copyfile(pyfile, path_dest)
except:
traceback.print_exc()
return {'CANCELLED'}

View File

@ -25,7 +25,7 @@
# don't register these classes since they are only helpers.
class MotionPathButtonsPanel():
class MotionPathButtonsPanel:
bl_space_type = 'PROPERTIES'
bl_region_type = 'WINDOW'
bl_label = "Motion Paths"
@ -97,7 +97,7 @@ class MotionPathButtonsPanel():
# FIXME: this panel still needs to be ported so that it will work correctly with animviz
class OnionSkinButtonsPanel():
class OnionSkinButtonsPanel:
bl_space_type = 'PROPERTIES'
bl_region_type = 'WINDOW'
bl_label = "Onion Skinning"

View File

@ -21,7 +21,7 @@ import bpy
from bpy.types import Panel
class ConstraintButtonsPanel():
class ConstraintButtonsPanel:
bl_space_type = 'PROPERTIES'
bl_region_type = 'WINDOW'
bl_context = "constraint"

View File

@ -22,7 +22,7 @@ from bpy.types import Panel, Menu
from rna_prop_ui import PropertyPanel
class ArmatureButtonsPanel():
class ArmatureButtonsPanel:
bl_space_type = 'PROPERTIES'
bl_region_type = 'WINDOW'
bl_context = "data"
@ -144,7 +144,7 @@ class DATA_PT_bone_groups(ArmatureButtonsPanel, Panel):
if group.color_set:
col = split.column()
sub = col.row(align=True)
sub.enabled = group.is_custom_color_set # only custom colors are editable
sub.enabled = group.is_custom_color_set # only custom colors are editable
sub.prop(group.colors, "normal", text="")
sub.prop(group.colors, "select", text="")
sub.prop(group.colors, "active", text="")

View File

@ -23,7 +23,7 @@ from bpy.types import Panel
from rna_prop_ui import PropertyPanel
class BoneButtonsPanel():
class BoneButtonsPanel:
bl_space_type = 'PROPERTIES'
bl_region_type = 'WINDOW'
bl_context = "bone"

View File

@ -22,7 +22,7 @@ from bpy.types import Panel, Menu
from rna_prop_ui import PropertyPanel
class CameraButtonsPanel():
class CameraButtonsPanel:
bl_space_type = 'PROPERTIES'
bl_region_type = 'WINDOW'
bl_context = "data"
@ -109,11 +109,11 @@ class DATA_PT_lens(CameraButtonsPanel, Panel):
elif ccam.panorama_type == 'EQUIRECTANGULAR':
row = layout.row()
sub = row.column(align=True)
sub.prop(ccam, "latitude_min");
sub.prop(ccam, "latitude_max");
sub.prop(ccam, "latitude_min")
sub.prop(ccam, "latitude_max")
sub = row.column(align=True)
sub.prop(ccam, "longitude_min");
sub.prop(ccam, "longitude_max");
sub.prop(ccam, "longitude_min")
sub.prop(ccam, "longitude_max")
elif engine == 'BLENDER_RENDER':
row = col.row()
if cam.lens_unit == 'MILLIMETERS':

View File

@ -24,7 +24,7 @@ from rna_prop_ui import PropertyPanel
from bpy.types import Curve, SurfaceCurve, TextCurve
class CurveButtonsPanel():
class CurveButtonsPanel:
bl_space_type = 'PROPERTIES'
bl_region_type = 'WINDOW'
bl_context = "data"

View File

@ -21,7 +21,7 @@ import bpy
from bpy.types import Panel
class DataButtonsPanel():
class DataButtonsPanel:
bl_space_type = 'PROPERTIES'
bl_region_type = 'WINDOW'
bl_context = "data"

View File

@ -30,7 +30,7 @@ class LAMP_MT_sunsky_presets(Menu):
draw = Menu.draw_preset
class DataButtonsPanel():
class DataButtonsPanel:
bl_space_type = 'PROPERTIES'
bl_region_type = 'WINDOW'
bl_context = "data"

View File

@ -22,7 +22,7 @@ from bpy.types import Panel
from rna_prop_ui import PropertyPanel
class DataButtonsPanel():
class DataButtonsPanel:
bl_space_type = 'PROPERTIES'
bl_region_type = 'WINDOW'
bl_context = "data"

View File

@ -111,7 +111,7 @@ class MESH_UL_uvmaps_vcols(UIList):
layout.label(text="", icon_value=icon)
class MeshButtonsPanel():
class MeshButtonsPanel:
bl_space_type = 'PROPERTIES'
bl_region_type = 'WINDOW'
bl_context = "data"

View File

@ -22,7 +22,7 @@ from bpy.types import Panel
from rna_prop_ui import PropertyPanel
class DataButtonsPanel():
class DataButtonsPanel:
bl_space_type = 'PROPERTIES'
bl_region_type = 'WINDOW'
bl_context = "data"

View File

@ -22,7 +22,7 @@ from bpy.types import Panel
from bpy.app.translations import pgettext_iface as iface_
class ModifierButtonsPanel():
class ModifierButtonsPanel:
bl_space_type = 'PROPERTIES'
bl_region_type = 'WINDOW'
bl_context = "modifier"

View File

@ -22,7 +22,7 @@ from bpy.types import Panel
from rna_prop_ui import PropertyPanel
class DataButtonsPanel():
class DataButtonsPanel:
bl_space_type = 'PROPERTIES'
bl_region_type = 'WINDOW'
bl_context = "data"

View File

@ -23,7 +23,7 @@ from bpy.types import Menu, Panel, UIList
# Render properties
class RenderFreestyleButtonsPanel():
class RenderFreestyleButtonsPanel:
bl_space_type = 'PROPERTIES'
bl_region_type = 'WINDOW'
bl_context = "render"
@ -62,7 +62,7 @@ class RENDER_PT_freestyle(RenderFreestyleButtonsPanel, Panel):
# Render layer properties
class RenderLayerFreestyleButtonsPanel():
class RenderLayerFreestyleButtonsPanel:
bl_space_type = 'PROPERTIES'
bl_region_type = 'WINDOW'
bl_context = "render_layer"
@ -701,7 +701,7 @@ class RENDERLAYER_PT_freestyle_linestyle(RenderLayerFreestyleEditorButtonsPanel,
# Material properties
class MaterialFreestyleButtonsPanel():
class MaterialFreestyleButtonsPanel:
bl_space_type = 'PROPERTIES'
bl_region_type = 'WINDOW'
bl_context = "material"

View File

@ -21,7 +21,7 @@ import bpy
from bpy.types import Panel, Menu
class PhysicsButtonsPanel():
class PhysicsButtonsPanel:
bl_space_type = 'PROPERTIES'
bl_region_type = 'WINDOW'
bl_context = "physics"
@ -256,7 +256,7 @@ class PHYSICS_PT_game_obstacles(PhysicsButtonsPanel, Panel):
row.label()
class RenderButtonsPanel():
class RenderButtonsPanel:
bl_space_type = 'PROPERTIES'
bl_region_type = 'WINDOW'
bl_context = "render"
@ -455,7 +455,7 @@ class RENDER_PT_game_display(RenderButtonsPanel, Panel):
col.prop(gs, "frame_color", text="")
class SceneButtonsPanel():
class SceneButtonsPanel:
bl_space_type = 'PROPERTIES'
bl_region_type = 'WINDOW'
bl_context = "scene"
@ -535,7 +535,7 @@ class RENDER_PT_game_sound(RenderButtonsPanel, Panel):
col.prop(scene, "audio_doppler_factor")
class WorldButtonsPanel():
class WorldButtonsPanel:
bl_space_type = 'PROPERTIES'
bl_region_type = 'WINDOW'
bl_context = "world"
@ -691,7 +691,7 @@ class WORLD_PT_game_physics_obstacles(WorldButtonsPanel, Panel):
layout.prop(gs, "show_obstacle_simulation")
class DataButtonsPanel():
class DataButtonsPanel:
bl_space_type = 'PROPERTIES'
bl_region_type = 'WINDOW'
bl_context = "data"
@ -749,7 +749,7 @@ class DATA_PT_shadow_game(DataButtonsPanel, Panel):
row.prop(lamp, "shadow_frustum_size", text="Frustum Size")
class ObjectButtonsPanel():
class ObjectButtonsPanel:
bl_space_type = 'PROPERTIES'
bl_region_type = 'WINDOW'
bl_context = "object"

View File

@ -41,7 +41,7 @@ def gpencil_stroke_placement_settings(context, layout, gpd):
row.prop(gpd, "use_stroke_endpoints")
class GreasePencilDrawingToolsPanel():
class GreasePencilDrawingToolsPanel:
# subclass must set
# bl_space_type = 'IMAGE_EDITOR'
bl_label = "Grease Pencil"
@ -89,7 +89,7 @@ class GreasePencilDrawingToolsPanel():
col.operator("view3d.ruler")
class GreasePencilStrokeEditPanel():
class GreasePencilStrokeEditPanel:
# subclass must set
# bl_space_type = 'IMAGE_EDITOR'
bl_label = "Edit Strokes"
@ -196,8 +196,8 @@ class GPENCIL_PIE_tool_palette(Menu):
col = pie.column()
row = col.row(align=True)
row.operator("transform.translate", icon='MAN_TRANS').gpencil_strokes = True
row.operator("transform.rotate", icon='MAN_ROT').gpencil_strokes = True
row.operator("transform.resize", text="Scale", icon='MAN_SCALE').gpencil_strokes = True
row.operator("transform.rotate", icon='MAN_ROT').gpencil_strokes = True
row.operator("transform.resize", text="Scale", icon='MAN_SCALE').gpencil_strokes = True
row = col.row(align=True)
row.label("Proportional Edit:")
row.prop(context.tool_settings, "proportional_edit", text="", icon_only=True)
@ -314,9 +314,9 @@ class GPENCIL_UL_layer(UIList):
split = layout.split(percentage=0.25)
row = split.row(align=True)
row.prop(gpl, "color", text="", emboss = gpl.is_stroke_visible)
row.prop(gpl, "fill_color", text="", emboss = gpl.is_fill_visible)
split.prop(gpl, "info", text="", emboss=False)
row.prop(gpl, "color", text="", emboss=gpl.is_stroke_visible)
row.prop(gpl, "fill_color", text="", emboss=gpl.is_fill_visible)
split.prop(gpl, "info", text="", emboss=False)
row = layout.row(align=True)
row.prop(gpl, "lock", text="", emboss=False)
@ -326,7 +326,7 @@ class GPENCIL_UL_layer(UIList):
layout.label(text="", icon_value=icon)
class GreasePencilDataPanel():
class GreasePencilDataPanel:
# subclass must set
# bl_space_type = 'IMAGE_EDITOR'
bl_label = "Grease Pencil"
@ -371,7 +371,7 @@ class GreasePencilDataPanel():
gpl = context.active_gpencil_layer
if gpl:
sub.operator("gpencil.layer_duplicate", icon='COPY_ID', text="") # XXX: needs a dedicated icon
sub.operator("gpencil.layer_duplicate", icon='COPY_ID', text="") # XXX: needs a dedicated icon
col.separator()
@ -455,7 +455,7 @@ class GreasePencilDataPanel():
sub.prop(gpl, "ghost_after_range", text="After")
class GreasePencilToolsPanel():
class GreasePencilToolsPanel:
# subclass must set
# bl_space_type = 'IMAGE_EDITOR'
# bl_options = {'DEFAULT_CLOSED'}

View File

@ -112,7 +112,7 @@ class MASK_PT_layers:
row.prop(active_layer, "use_fill_holes", text="Holes")
class MASK_PT_spline():
class MASK_PT_spline:
# subclasses must define...
#~ bl_space_type = 'CLIP_EDITOR'
#~ bl_region_type = 'UI'
@ -146,7 +146,7 @@ class MASK_PT_spline():
col.prop(spline, "use_self_intersection_check")
class MASK_PT_point():
class MASK_PT_point:
# subclasses must define...
#~ bl_space_type = 'CLIP_EDITOR'
#~ bl_region_type = 'UI'
@ -201,7 +201,7 @@ class MASK_PT_point():
tracks_list, icon='ANIM_DATA', text="Track:")
class MASK_PT_display():
class MASK_PT_display:
# subclasses must define...
#~ bl_space_type = 'CLIP_EDITOR'
#~ bl_region_type = 'UI'
@ -227,7 +227,7 @@ class MASK_PT_display():
sub.prop(space_data, "mask_overlay_mode", text="")
class MASK_PT_transforms():
class MASK_PT_transforms:
# subclasses must define...
#~ bl_space_type = 'CLIP_EDITOR'
#~ bl_region_type = 'TOOLS'
@ -251,7 +251,7 @@ class MASK_PT_transforms():
col.operator("transform.transform", text="Scale Feather").mode = 'MASK_SHRINKFATTEN'
class MASK_PT_tools():
class MASK_PT_tools:
# subclasses must define...
#~ bl_space_type = 'CLIP_EDITOR'
#~ bl_region_type = 'TOOLS'
@ -289,7 +289,7 @@ class MASK_PT_tools():
col.operator("mask.shape_key_rekey", text="Re-Key Shape Points")
class MASK_PT_add():
class MASK_PT_add:
# subclasses must define...
#~ bl_space_type = 'CLIP_EDITOR'
#~ bl_region_type = 'TOOLS'

View File

@ -92,7 +92,7 @@ class MATERIAL_UL_matslots(UIList):
layout.label(text="", icon_value=icon)
class MaterialButtonsPanel():
class MaterialButtonsPanel:
bl_space_type = 'PROPERTIES'
bl_region_type = 'WINDOW'
bl_context = "material"
@ -875,7 +875,7 @@ class MATERIAL_PT_transp_game(MaterialButtonsPanel, Panel):
layout.prop(mat, "alpha")
class VolumeButtonsPanel():
class VolumeButtonsPanel:
bl_space_type = 'PROPERTIES'
bl_region_type = 'WINDOW'
bl_context = "material"

View File

@ -22,7 +22,7 @@ from bpy.types import Panel, Menu
from rna_prop_ui import PropertyPanel
class ObjectButtonsPanel():
class ObjectButtonsPanel:
bl_space_type = 'PROPERTIES'
bl_region_type = 'WINDOW'
bl_context = "object"

View File

@ -20,7 +20,7 @@
from bpy.types import Menu
class UnifiedPaintPanel():
class UnifiedPaintPanel:
# subclass must set
# bl_space_type = 'IMAGE_EDITOR'
# bl_region_type = 'UI'
@ -249,7 +249,7 @@ def brush_texture_settings(layout, brush, sculpt):
col.prop(tex_slot, "angle", text="")
if tex_slot.has_texture_angle_source:
col.prop(tex_slot, "use_rake", text="Rake")
if brush.brush_capabilities.has_random_texture_angle and tex_slot.has_random_texture_angle:
if sculpt:
if brush.sculpt_capabilities.has_random_texture_angle:
@ -296,7 +296,7 @@ def brush_mask_texture_settings(layout, brush):
col.prop(mask_tex_slot, "angle", text="")
if mask_tex_slot.has_texture_angle_source:
col.prop(mask_tex_slot, "use_rake", text="Rake")
if brush.brush_capabilities.has_random_texture_angle and mask_tex_slot.has_random_texture_angle:
col.prop(mask_tex_slot, "use_random", text="Random")
if mask_tex_slot.use_random:

View File

@ -88,7 +88,7 @@ class PARTICLE_MT_hair_dynamics_presets(Menu):
draw = Menu.draw_preset
class ParticleButtonsPanel():
class ParticleButtonsPanel:
bl_space_type = 'PROPERTIES'
bl_region_type = 'WINDOW'
bl_context = "particle"
@ -104,6 +104,7 @@ def find_modifier(ob, psys):
if md.particle_system == psys:
return md
class PARTICLE_UL_particle_systems(bpy.types.UIList):
def draw_item(self, context, layout, data, item, icon, active_data, active_propname, index, flt_flag):
ob = data

View File

@ -37,7 +37,7 @@ class CLOTH_MT_presets(Menu):
draw = Menu.draw_preset
class PhysicButtonsPanel():
class PhysicButtonsPanel:
bl_space_type = 'PROPERTIES'
bl_region_type = 'WINDOW'
bl_context = "physics"

View File

@ -23,7 +23,7 @@ from bpy.types import Panel
from bpy.app.translations import contexts as i18n_contexts
class PhysicButtonsPanel():
class PhysicButtonsPanel:
bl_space_type = 'PROPERTIES'
bl_region_type = 'WINDOW'
bl_context = "physics"

View File

@ -47,7 +47,7 @@ class PHYSICS_UL_dynapaint_surfaces(UIList):
row.label(text="", icon_value=sticon)
class PhysicButtonsPanel():
class PhysicButtonsPanel:
bl_space_type = 'PROPERTIES'
bl_region_type = 'WINDOW'
bl_context = "physics"

View File

@ -26,7 +26,7 @@ from bl_ui.properties_physics_common import (
)
class PhysicButtonsPanel():
class PhysicButtonsPanel:
bl_space_type = 'PROPERTIES'
bl_region_type = 'WINDOW'
bl_context = "physics"

View File

@ -29,7 +29,7 @@ class FLUID_MT_presets(Menu):
draw = Menu.draw_preset
class PhysicButtonsPanel():
class PhysicButtonsPanel:
bl_space_type = 'PROPERTIES'
bl_region_type = 'WINDOW'
bl_context = "physics"

View File

@ -21,7 +21,7 @@ import bpy
from bpy.types import Panel
class PHYSICS_PT_rigidbody_panel():
class PHYSICS_PT_rigidbody_panel:
bl_space_type = 'PROPERTIES'
bl_region_type = 'WINDOW'
bl_context = "physics"

View File

@ -21,7 +21,7 @@ import bpy
from bpy.types import Panel
class PHYSICS_PT_rigidbody_constraint_panel():
class PHYSICS_PT_rigidbody_constraint_panel:
bl_space_type = 'PROPERTIES'
bl_region_type = 'WINDOW'
bl_context = "physics"

View File

@ -26,7 +26,7 @@ from bl_ui.properties_physics_common import (
)
class PhysicButtonsPanel():
class PhysicButtonsPanel:
bl_space_type = 'PROPERTIES'
bl_region_type = 'WINDOW'
bl_context = "physics"

View File

@ -30,7 +30,7 @@ def softbody_panel_enabled(md):
return (md.point_cache.is_baked is False)
class PhysicButtonsPanel():
class PhysicButtonsPanel:
bl_space_type = 'PROPERTIES'
bl_region_type = 'WINDOW'
bl_context = "physics"

View File

@ -43,7 +43,7 @@ class RENDER_MT_framerate_presets(Menu):
draw = Menu.draw_preset
class RenderButtonsPanel():
class RenderButtonsPanel:
bl_space_type = 'PROPERTIES'
bl_region_type = 'WINDOW'
bl_context = "render"

View File

@ -21,7 +21,7 @@ import bpy
from bpy.types import Panel, UIList
class RenderLayerButtonsPanel():
class RenderLayerButtonsPanel:
bl_space_type = 'PROPERTIES'
bl_region_type = 'WINDOW'
bl_context = "render_layer"

View File

@ -40,7 +40,7 @@ class SCENE_UL_keying_set_paths(UIList):
layout.label(text="", icon_value=icon)
class SceneButtonsPanel():
class SceneButtonsPanel:
bl_space_type = 'PROPERTIES'
bl_region_type = 'WINDOW'
bl_context = "scene"
@ -85,7 +85,7 @@ class SCENE_PT_unit(SceneButtonsPanel, Panel):
row.prop(unit, "use_separate")
class SceneKeyingSetsPanel():
class SceneKeyingSetsPanel:
def draw_keyframing_settings(self, context, layout, ks, ksp):
self.draw_keyframing_setting(context, layout, ks, ksp, "Needed",
"use_insertkey_override_needed", "use_insertkey_needed",
@ -121,7 +121,7 @@ class SceneKeyingSetsPanel():
propname = prop
row = layout.row(align=True)
row.prop(item, toggle_prop, text="", icon='STYLUS_PRESSURE', toggle=True) # XXX: needs dedicated icon
row.prop(item, toggle_prop, text="", icon='STYLUS_PRESSURE', toggle=True) # XXX: needs dedicated icon
subrow = row.row()
subrow.active = getattr(item, toggle_prop)

View File

@ -116,7 +116,7 @@ def id_tex_datablock(bid):
return bid
class TextureButtonsPanel():
class TextureButtonsPanel:
bl_space_type = 'PROPERTIES'
bl_region_type = 'WINDOW'
bl_context = "texture"
@ -135,8 +135,8 @@ class TEXTURE_PT_context_texture(TextureButtonsPanel, Panel):
@classmethod
def poll(cls, context):
engine = context.scene.render.engine
#if not (hasattr(context, "texture_slot") or hasattr(context, "texture_node")):
#return False
# if not (hasattr(context, "texture_slot") or hasattr(context, "texture_node")):
# return False
return ((context.material or
context.world or
context.lamp or

View File

@ -22,7 +22,7 @@ from bpy.types import Panel
from rna_prop_ui import PropertyPanel
class WorldButtonsPanel():
class WorldButtonsPanel:
bl_space_type = 'PROPERTIES'
bl_region_type = 'WINDOW'
bl_context = "world"
@ -49,7 +49,6 @@ class WORLD_PT_context_world(WorldButtonsPanel, Panel):
scene = context.scene
world = context.world
space = context.space_data
rd = context.scene.render
texture_count = world and len(world.texture_slots.keys())

View File

@ -134,7 +134,6 @@ class DOPESHEET_HT_header(Header):
row.operator("action.paste", text="", icon='PASTEFLIPDOWN').flipped = True
class DOPESHEET_MT_editor_menus(Menu):
bl_idname = "DOPESHEET_MT_editor_menus"
bl_label = ""

View File

@ -1043,7 +1043,8 @@ class IMAGE_PT_tools_mask(MASK_PT_tools, Panel):
# --- end mask ---
class ImageScopesPanel():
class ImageScopesPanel:
@classmethod
def poll(cls, context):
sima = context.space_data
@ -1057,6 +1058,7 @@ class ImageScopesPanel():
return False
return True
class IMAGE_PT_view_histogram(ImageScopesPanel, Panel):
bl_space_type = 'IMAGE_EDITOR'
bl_region_type = 'TOOLS'
@ -1150,6 +1152,7 @@ class IMAGE_PT_grease_pencil(GreasePencilDataPanel, Panel):
# NOTE: this is just a wrapper around the generic GP Panel
# Grease Pencil drawing tools
class IMAGE_PT_tools_grease_pencil_draw(GreasePencilDrawingToolsPanel, Panel):
bl_space_type = 'IMAGE_EDITOR'

View File

@ -464,8 +464,8 @@ class NODE_PT_grease_pencil_tools(GreasePencilToolsPanel, Panel):
bl_options = {'DEFAULT_CLOSED'}
# NOTE: this is just a wrapper around the generic GP tools panel
# It contains access to some essential tools usually found only in
# toolbar, but which may not necessarily be open
# It contains access to some essential tools usually found only in
# toolbar, but which may not necessarily be open
# Tool Shelf ------------------
@ -484,6 +484,7 @@ class NODE_PT_tools_grease_pencil_edit(GreasePencilStrokeEditPanel, Panel):
# -----------------------------
def node_draw_tree_view(layout, context):
pass

View File

@ -113,7 +113,7 @@ class SEQUENCER_HT_header(Header):
row.prop(toolsettings, "proportional_edit", icon_only=True)
if toolsettings.proportional_edit != 'DISABLED':
row.prop(toolsettings, "proportional_edit_falloff", icon_only=True)
row = layout.row(align=True)
row.operator("render.opengl", text="", icon='RENDER_STILL').sequencer = True
props = row.operator("render.opengl", text="", icon='RENDER_ANIMATION')
@ -427,7 +427,7 @@ class SEQUENCER_MT_strip(Menu):
layout.menu("SEQUENCER_MT_change")
class SequencerButtonsPanel():
class SequencerButtonsPanel:
bl_space_type = 'SEQUENCE_EDITOR'
bl_region_type = 'UI'
@ -440,7 +440,7 @@ class SequencerButtonsPanel():
return cls.has_sequencer(context) and (act_strip(context) is not None)
class SequencerButtonsPanel_Output():
class SequencerButtonsPanel_Output:
bl_space_type = 'SEQUENCE_EDITOR'
bl_region_type = 'UI'
@ -929,7 +929,7 @@ class SEQUENCER_PT_proxy(SequencerButtonsPanel, Panel):
row.prop(strip.proxy, "build_50")
row.prop(strip.proxy, "build_75")
row.prop(strip.proxy, "build_100")
layout.prop(strip.proxy, "use_overwrite");
layout.prop(strip.proxy, "use_overwrite")
col = layout.column()
col.label(text="Build JPEG quality")
@ -1079,8 +1079,8 @@ class SEQUENCER_PT_grease_pencil_tools(GreasePencilToolsPanel, SequencerButtonsP
bl_region_type = 'UI'
# NOTE: this is just a wrapper around the generic GP tools panel
# It contains access to some essential tools usually found only in
# toolbar, which doesn't exist here...
# It contains access to some essential tools usually found only in
# toolbar, which doesn't exist here...
if __name__ == "__main__": # only for live edit.

View File

@ -174,7 +174,7 @@ class VIEW3D_MT_editor_menus(Menu):
# ********** Utilities **********
class ShowHideMenu():
class ShowHideMenu:
bl_label = "Show/Hide"
_operator_name = ""
@ -2723,6 +2723,7 @@ class VIEW3D_MT_edit_armature_roll(Menu):
# ********** Panel **********
class VIEW3D_PT_grease_pencil(GreasePencilDataPanel, Panel):
bl_space_type = 'VIEW_3D'
bl_region_type = 'UI'

View File

@ -31,7 +31,7 @@ from bl_ui.properties_paint_common import (
)
class View3DPanel():
class View3DPanel:
bl_space_type = 'VIEW_3D'
bl_region_type = 'TOOLS'
@ -786,6 +786,7 @@ class View3DPaintPanel(UnifiedPaintPanel):
bl_space_type = 'VIEW_3D'
bl_region_type = 'TOOLS'
class VIEW3D_PT_imapaint_tools_missing(Panel, View3DPaintPanel):
bl_category = "Tools"
bl_label = "Missing Data"
@ -806,14 +807,13 @@ class VIEW3D_PT_imapaint_tools_missing(Panel, View3DPaintPanel):
col.label("Missing UVs", icon='INFO')
col.label("Unwrap the mesh in edit mode or generate a simple UV layer")
col.operator("paint.add_simple_uvs")
if toolsettings.mode == 'MATERIAL':
if toolsettings.missing_materials:
col.separator()
col.label("Missing Materials", icon='INFO')
col.label("Add a material and paint slot below")
col.operator_menu_enum("paint.add_texture_paint_slot", "type", text="Add Paint Slot")
elif toolsettings.missing_texture:
ob = context.active_object
mat = ob.active_material
@ -827,7 +827,6 @@ class VIEW3D_PT_imapaint_tools_missing(Panel, View3DPaintPanel):
col.label("Missing Materials", icon='INFO')
col.label("Add a material and paint slot below")
col.operator_menu_enum("paint.add_texture_paint_slot", "type", text="Add Paint Slot")
elif toolsettings.mode == 'IMAGE':
if toolsettings.missing_texture:
@ -846,6 +845,7 @@ class VIEW3D_PT_imapaint_tools_missing(Panel, View3DPaintPanel):
col.template_ID(toolsettings, "stencil_image")
col.operator("image.new", text="New").gen_context = 'PAINT_STENCIL'
class VIEW3D_PT_tools_brush(Panel, View3DPaintPanel):
bl_category = "Tools"
bl_label = "Brush"
@ -1074,6 +1074,7 @@ class TEXTURE_UL_texpaintslots(UIList):
layout.alignment = 'CENTER'
layout.label(text="")
class VIEW3D_MT_tools_projectpaint_uvlayer(Menu):
bl_label = "Clone Layer"
@ -1137,7 +1138,7 @@ class VIEW3D_PT_slots_projectpaint(View3DPanel, Panel):
if slot:
col.prop(mat.texture_slots[slot.index], "blend_type")
col.separator()
if slot and slot.index != -1:
col.label("UV Map")
col.prop_search(slot, "uv_layer", ob.data, "uv_textures", text="")
@ -1189,7 +1190,6 @@ class VIEW3D_PT_stencil_projectpaint(View3DPanel, Panel):
col.template_ID(ipaint, "stencil_image")
col.operator("image.new", text="New").gen_context = 'PAINT_STENCIL'
col.label("Visualization")
row = col.row(align=True)
row.prop(ipaint, "stencil_color", text="")

View File

@ -63,7 +63,7 @@ def image_from_file(filepath):
try:
import bpy
except:
except ImportError:
bpy = None
if bpy is not None:

View File

@ -95,13 +95,23 @@ def main():
print(" %s" % f)
# strict imports
print("\n\n\n# running pep8...")
print("\n\n\n# checking imports...")
import re
import_check = re.compile(r"\s*from\s+[A-z\.]+\s+import \*\s*")
for f, pep8_type in files:
for i, l in enumerate(open(f, 'r', encoding='utf8')):
if import_check.match(l):
print("%s:%d:0: global import bad practice" % (f, i + 1))
del re, import_check
print("\n\n\n# checking class definitions...")
import re
class_check = re.compile(r"\s*class\s+.*\(\):.*")
for f, pep8_type in files:
for i, l in enumerate(open(f, 'r', encoding='utf8')):
if class_check.match(l):
print("%s:%d:0: empty class (), remove" % (f, i + 1))
del re, class_check
print("\n\n\n# running pep8...")