forked from bartvdbraak/blender
pep8 checker, mostly pedantic style changes but also found an error in mesh_utils.mesh_linked_faces()
This commit is contained in:
parent
14e94d742e
commit
c8652b301f
@ -94,11 +94,11 @@ if platform == '':
|
|||||||
sys.exit(1)
|
sys.exit(1)
|
||||||
|
|
||||||
# extract
|
# extract
|
||||||
dir = 'public_html/download'
|
directory = 'public_html/download'
|
||||||
|
|
||||||
try:
|
try:
|
||||||
zf = z.open(package)
|
zf = z.open(package)
|
||||||
f = file(os.path.join(dir, packagename), "wb")
|
f = file(os.path.join(directory, packagename), "wb")
|
||||||
|
|
||||||
shutil.copyfileobj(zf, f)
|
shutil.copyfileobj(zf, f)
|
||||||
|
|
||||||
@ -112,10 +112,10 @@ except Exception, ex:
|
|||||||
|
|
||||||
# remove other files from the same platform
|
# remove other files from the same platform
|
||||||
try:
|
try:
|
||||||
for f in os.listdir(dir):
|
for f in os.listdir(directory):
|
||||||
if platform.lower() in f.lower():
|
if platform.lower() in f.lower():
|
||||||
if f != packagename:
|
if f != packagename:
|
||||||
os.remove(os.path.join(dir, f))
|
os.remove(os.path.join(directory, f))
|
||||||
except Exception, ex:
|
except Exception, ex:
|
||||||
sys.stderr.write('Failed to remove old packages: %s\n' % str(ex))
|
sys.stderr.write('Failed to remove old packages: %s\n' % str(ex))
|
||||||
sys.exit(1)
|
sys.exit(1)
|
||||||
|
@ -41,12 +41,12 @@ if builder.find('scons') != -1:
|
|||||||
sys.exit(retcode)
|
sys.exit(retcode)
|
||||||
|
|
||||||
# clean release directory if it already exists
|
# clean release directory if it already exists
|
||||||
dir = 'release'
|
directory = 'release'
|
||||||
|
|
||||||
if os.path.exists(dir):
|
if os.path.exists(directory):
|
||||||
for f in os.listdir(dir):
|
for f in os.listdir(directory):
|
||||||
if os.path.isfile(os.path.join(dir, f)):
|
if os.path.isfile(os.path.join(directory, f)):
|
||||||
os.remove(os.path.join(dir, f))
|
os.remove(os.path.join(directory, f))
|
||||||
|
|
||||||
# create release package
|
# create release package
|
||||||
try:
|
try:
|
||||||
@ -56,7 +56,7 @@ except Exception, ex:
|
|||||||
sys.exit(1)
|
sys.exit(1)
|
||||||
|
|
||||||
# find release directory, must exist this time
|
# find release directory, must exist this time
|
||||||
if not os.path.exists(dir):
|
if not os.path.exists(directory):
|
||||||
sys.stderr.write("Failed to find release directory.\n")
|
sys.stderr.write("Failed to find release directory.\n")
|
||||||
sys.exit(1)
|
sys.exit(1)
|
||||||
|
|
||||||
@ -64,8 +64,8 @@ if not os.path.exists(dir):
|
|||||||
file = None
|
file = None
|
||||||
filepath = None
|
filepath = None
|
||||||
|
|
||||||
for f in os.listdir(dir):
|
for f in os.listdir(directory):
|
||||||
rf = os.path.join(dir, f)
|
rf = os.path.join(directory, f)
|
||||||
if os.path.isfile(rf) and f.startswith('blender'):
|
if os.path.isfile(rf) and f.startswith('blender'):
|
||||||
file = f
|
file = f
|
||||||
filepath = rf
|
filepath = rf
|
||||||
|
@ -114,7 +114,6 @@ def cmake_advanced_info():
|
|||||||
"""
|
"""
|
||||||
|
|
||||||
def create_eclipse_project(CMAKE_DIR):
|
def create_eclipse_project(CMAKE_DIR):
|
||||||
import sys
|
|
||||||
if sys.platform == "win32":
|
if sys.platform == "win32":
|
||||||
cmd = 'cmake %r -G"Eclipse CDT4 - MinGW Makefiles"' % CMAKE_DIR
|
cmd = 'cmake %r -G"Eclipse CDT4 - MinGW Makefiles"' % CMAKE_DIR
|
||||||
else:
|
else:
|
||||||
@ -125,7 +124,7 @@ def cmake_advanced_info():
|
|||||||
includes = []
|
includes = []
|
||||||
defines = []
|
defines = []
|
||||||
|
|
||||||
import os
|
|
||||||
|
|
||||||
create_eclipse_project(CMAKE_DIR)
|
create_eclipse_project(CMAKE_DIR)
|
||||||
|
|
||||||
|
@ -43,8 +43,8 @@ def main():
|
|||||||
targets = set()
|
targets = set()
|
||||||
|
|
||||||
# collect targets
|
# collect targets
|
||||||
file = open("Makefile", "r")
|
makefile = open("Makefile", "r")
|
||||||
for line in file:
|
for line in makefile:
|
||||||
line = line.rstrip()
|
line = line.rstrip()
|
||||||
if not line or line[0] in ". \t@$#":
|
if not line or line[0] in ". \t@$#":
|
||||||
continue
|
continue
|
||||||
@ -59,7 +59,7 @@ def main():
|
|||||||
continue
|
continue
|
||||||
|
|
||||||
targets.add(line)
|
targets.add(line)
|
||||||
file.close()
|
makefile.close()
|
||||||
|
|
||||||
# remove cmake targets
|
# remove cmake targets
|
||||||
bad = set([
|
bad = set([
|
||||||
|
@ -246,7 +246,6 @@ def disable(module_name, default_set=True):
|
|||||||
:type module_name: string
|
:type module_name: string
|
||||||
"""
|
"""
|
||||||
import sys
|
import sys
|
||||||
import traceback
|
|
||||||
import bpy_types as _bpy_types
|
import bpy_types as _bpy_types
|
||||||
|
|
||||||
mod = sys.modules.get(module_name)
|
mod = sys.modules.get(module_name)
|
||||||
@ -259,6 +258,7 @@ def disable(module_name, default_set=True):
|
|||||||
try:
|
try:
|
||||||
mod.unregister()
|
mod.unregister()
|
||||||
except:
|
except:
|
||||||
|
import traceback
|
||||||
traceback.print_exc()
|
traceback.print_exc()
|
||||||
else:
|
else:
|
||||||
print("addon_utils.disable", module_name, "not loaded")
|
print("addon_utils.disable", module_name, "not loaded")
|
||||||
|
@ -347,7 +347,6 @@ def keyconfig_set(filepath):
|
|||||||
|
|
||||||
print("loading preset:", filepath)
|
print("loading preset:", filepath)
|
||||||
keyconfigs = _bpy.context.window_manager.keyconfigs
|
keyconfigs = _bpy.context.window_manager.keyconfigs
|
||||||
kc_orig = keyconfigs.active
|
|
||||||
|
|
||||||
keyconfigs_old = keyconfigs[:]
|
keyconfigs_old = keyconfigs[:]
|
||||||
|
|
||||||
|
@ -65,7 +65,7 @@ def _parse_rna_args(base, py_node):
|
|||||||
|
|
||||||
|
|
||||||
def _call_recursive(context, base, py_node):
|
def _call_recursive(context, base, py_node):
|
||||||
prop = base.bl_rna.properties.get(py_node[TAG])
|
# prop = base.bl_rna.properties.get(py_node[TAG])
|
||||||
if py_node[TAG] in base.bl_rna.properties:
|
if py_node[TAG] in base.bl_rna.properties:
|
||||||
value = py_node[ARGS].get("expr")
|
value = py_node[ARGS].get("expr")
|
||||||
if value:
|
if value:
|
||||||
@ -73,7 +73,7 @@ def _call_recursive(context, base, py_node):
|
|||||||
setattr(base, py_node[TAG], value)
|
setattr(base, py_node[TAG], value)
|
||||||
else:
|
else:
|
||||||
value = py_node[ARGS]['value'] # have to have this
|
value = py_node[ARGS]['value'] # have to have this
|
||||||
setattr(base, name, value)
|
setattr(base, py_node[TAG], value)
|
||||||
else:
|
else:
|
||||||
args = _parse_rna_args(base, py_node)
|
args = _parse_rna_args(base, py_node)
|
||||||
func_new = getattr(base, py_node[TAG])
|
func_new = getattr(base, py_node[TAG])
|
||||||
|
@ -19,7 +19,7 @@
|
|||||||
# <pep8 compliant>
|
# <pep8 compliant>
|
||||||
|
|
||||||
|
|
||||||
def mesh_linked_faces(me):
|
def mesh_linked_faces(mesh):
|
||||||
'''
|
'''
|
||||||
Splits the mesh into connected parts,
|
Splits the mesh into connected parts,
|
||||||
these parts are returned as lists of faces.
|
these parts are returned as lists of faces.
|
||||||
|
@ -18,7 +18,6 @@
|
|||||||
|
|
||||||
# <pep8 compliant>
|
# <pep8 compliant>
|
||||||
|
|
||||||
import mathutils
|
|
||||||
from mathutils import Vector
|
from mathutils import Vector
|
||||||
import bpy
|
import bpy
|
||||||
from bpy.props import BoolProperty, EnumProperty, IntProperty, FloatProperty, FloatVectorProperty
|
from bpy.props import BoolProperty, EnumProperty, IntProperty, FloatProperty, FloatVectorProperty
|
||||||
@ -80,6 +79,7 @@ class MakeFur(bpy.types.Operator):
|
|||||||
|
|
||||||
return {'FINISHED'}
|
return {'FINISHED'}
|
||||||
|
|
||||||
|
|
||||||
def obj_bb_minmax(obj, min_co, max_co):
|
def obj_bb_minmax(obj, min_co, max_co):
|
||||||
for i in range(0, 8):
|
for i in range(0, 8):
|
||||||
bb_vec = Vector((obj.bound_box[i][0], obj.bound_box[i][1], obj.bound_box[i][2])) * obj.matrix_world
|
bb_vec = Vector((obj.bound_box[i][0], obj.bound_box[i][1], obj.bound_box[i][2])) * obj.matrix_world
|
||||||
@ -91,6 +91,7 @@ def obj_bb_minmax(obj, min_co, max_co):
|
|||||||
max_co[1] = max(bb_vec[1], max_co[1])
|
max_co[1] = max(bb_vec[1], max_co[1])
|
||||||
max_co[2] = max(bb_vec[2], max_co[2])
|
max_co[2] = max(bb_vec[2], max_co[2])
|
||||||
|
|
||||||
|
|
||||||
class MakeSmoke(bpy.types.Operator):
|
class MakeSmoke(bpy.types.Operator):
|
||||||
bl_idname = "object.make_smoke"
|
bl_idname = "object.make_smoke"
|
||||||
bl_label = "Make Smoke"
|
bl_label = "Make Smoke"
|
||||||
@ -148,8 +149,8 @@ class MakeSmoke(bpy.types.Operator):
|
|||||||
obj.name = "Smoke Domain"
|
obj.name = "Smoke Domain"
|
||||||
|
|
||||||
# give the smoke some room above the flows
|
# give the smoke some room above the flows
|
||||||
obj.location = 0.5 * (max_co + min_co) + Vector((0,0,1))
|
obj.location = 0.5 * (max_co + min_co) + Vector((0.0, 0.0, 1.0))
|
||||||
obj.scale = 0.5 * (max_co - min_co) + Vector((1,1,2))
|
obj.scale = 0.5 * (max_co - min_co) + Vector((1.0, 1.0, 2.0))
|
||||||
|
|
||||||
# setup smoke domain
|
# setup smoke domain
|
||||||
bpy.ops.object.modifier_add({"object": obj}, type='SMOKE')
|
bpy.ops.object.modifier_add({"object": obj}, type='SMOKE')
|
||||||
@ -261,8 +262,8 @@ class MakeFluid(bpy.types.Operator):
|
|||||||
|
|
||||||
# give the fluid some room below the flows and scale with initial velocity
|
# give the fluid some room below the flows and scale with initial velocity
|
||||||
v = 0.5 * self.initial_velocity
|
v = 0.5 * self.initial_velocity
|
||||||
obj.location = 0.5 * (max_co + min_co) + Vector((0,0,-1)) + v
|
obj.location = 0.5 * (max_co + min_co) + Vector((0.0, 0.0, -1.0)) + v
|
||||||
obj.scale = 0.5 * (max_co - min_co) + Vector((1,1,2)) + Vector((abs(v[0]), abs(v[1]), abs(v[2])))
|
obj.scale = 0.5 * (max_co - min_co) + Vector((1.0, 1.0, 2.0)) + Vector((abs(v[0]), abs(v[1]), abs(v[2])))
|
||||||
|
|
||||||
# setup smoke domain
|
# setup smoke domain
|
||||||
bpy.ops.object.modifier_add({"object": obj}, type='FLUID_SIMULATION')
|
bpy.ops.object.modifier_add({"object": obj}, type='FLUID_SIMULATION')
|
||||||
@ -279,7 +280,7 @@ class MakeFluid(bpy.types.Operator):
|
|||||||
mat.specular_intensity = 1
|
mat.specular_intensity = 1
|
||||||
mat.specular_hardness = 100
|
mat.specular_hardness = 100
|
||||||
mat.use_transparency = True
|
mat.use_transparency = True
|
||||||
mat.alpha = 0
|
mat.alpha = 0.0
|
||||||
mat.transparency_method = 'RAYTRACE'
|
mat.transparency_method = 'RAYTRACE'
|
||||||
mat.raytrace_transparency.ior = 1.33
|
mat.raytrace_transparency.ior = 1.33
|
||||||
mat.raytrace_transparency.depth = 4
|
mat.raytrace_transparency.depth = 4
|
||||||
|
@ -84,7 +84,7 @@ def randomize_selected(seed, delta, loc, rot, scale, scale_even):
|
|||||||
uniform(0.0, 0.0), uniform(0.0, 0.0), uniform(0.0, 0.0)
|
uniform(0.0, 0.0), uniform(0.0, 0.0), uniform(0.0, 0.0)
|
||||||
|
|
||||||
|
|
||||||
from bpy.props import IntProperty, BoolProperty, FloatProperty, FloatVectorProperty
|
from bpy.props import IntProperty, BoolProperty, FloatVectorProperty
|
||||||
|
|
||||||
|
|
||||||
class RandomizeLocRotSize(bpy.types.Operator):
|
class RandomizeLocRotSize(bpy.types.Operator):
|
||||||
|
@ -19,7 +19,6 @@
|
|||||||
# <pep8 compliant>
|
# <pep8 compliant>
|
||||||
|
|
||||||
import bpy
|
import bpy
|
||||||
import os
|
|
||||||
|
|
||||||
|
|
||||||
class AddPresetBase():
|
class AddPresetBase():
|
||||||
|
@ -859,6 +859,7 @@ class WM_OT_keyconfig_activate(bpy.types.Operator):
|
|||||||
bpy.utils.keyconfig_set(self.filepath)
|
bpy.utils.keyconfig_set(self.filepath)
|
||||||
return {'FINISHED'}
|
return {'FINISHED'}
|
||||||
|
|
||||||
|
|
||||||
class WM_OT_appconfig_default(bpy.types.Operator):
|
class WM_OT_appconfig_default(bpy.types.Operator):
|
||||||
bl_idname = "wm.appconfig_default"
|
bl_idname = "wm.appconfig_default"
|
||||||
bl_label = "Default Application Configuration"
|
bl_label = "Default Application Configuration"
|
||||||
@ -871,10 +872,11 @@ class WM_OT_appconfig_default(bpy.types.Operator):
|
|||||||
filepath = os.path.join(bpy.utils.preset_paths("interaction")[0], "blender.py")
|
filepath = os.path.join(bpy.utils.preset_paths("interaction")[0], "blender.py")
|
||||||
|
|
||||||
if os.path.exists(filepath):
|
if os.path.exists(filepath):
|
||||||
bpy.ops.script.execute_preset(filepath = filepath, menu_idname = "USERPREF_MT_interaction_presets")
|
bpy.ops.script.execute_preset(filepath=filepath, menu_idname="USERPREF_MT_interaction_presets")
|
||||||
|
|
||||||
return {'FINISHED'}
|
return {'FINISHED'}
|
||||||
|
|
||||||
|
|
||||||
class WM_OT_appconfig_activate(bpy.types.Operator):
|
class WM_OT_appconfig_activate(bpy.types.Operator):
|
||||||
bl_idname = "wm.appconfig_activate"
|
bl_idname = "wm.appconfig_activate"
|
||||||
bl_label = "Activate Application Configuration"
|
bl_label = "Activate Application Configuration"
|
||||||
@ -888,10 +890,11 @@ class WM_OT_appconfig_activate(bpy.types.Operator):
|
|||||||
filepath = self.filepath.replace("keyconfig", "interaction")
|
filepath = self.filepath.replace("keyconfig", "interaction")
|
||||||
|
|
||||||
if os.path.exists(filepath):
|
if os.path.exists(filepath):
|
||||||
bpy.ops.script.execute_preset(filepath = filepath, menu_idname = "USERPREF_MT_interaction_presets")
|
bpy.ops.script.execute_preset(filepath=filepath, menu_idname="USERPREF_MT_interaction_presets")
|
||||||
|
|
||||||
return {'FINISHED'}
|
return {'FINISHED'}
|
||||||
|
|
||||||
|
|
||||||
class WM_OT_sysinfo(bpy.types.Operator):
|
class WM_OT_sysinfo(bpy.types.Operator):
|
||||||
'''Generate System Info'''
|
'''Generate System Info'''
|
||||||
bl_idname = "wm.sysinfo"
|
bl_idname = "wm.sysinfo"
|
||||||
|
@ -17,8 +17,6 @@
|
|||||||
# ##### END GPL LICENSE BLOCK #####
|
# ##### END GPL LICENSE BLOCK #####
|
||||||
|
|
||||||
# <pep8 compliant>
|
# <pep8 compliant>
|
||||||
import bpy
|
|
||||||
|
|
||||||
|
|
||||||
# Generic Panels (Independent of DataType)
|
# Generic Panels (Independent of DataType)
|
||||||
|
|
||||||
|
@ -21,7 +21,7 @@ import bpy
|
|||||||
import os
|
import os
|
||||||
import addon_utils
|
import addon_utils
|
||||||
|
|
||||||
from bpy.props import StringProperty, BoolProperty, EnumProperty
|
from bpy.props import StringProperty, BoolProperty
|
||||||
|
|
||||||
|
|
||||||
def ui_items_general(col, context):
|
def ui_items_general(col, context):
|
||||||
@ -119,6 +119,7 @@ class USERPREF_MT_interaction_presets(bpy.types.Menu):
|
|||||||
preset_operator = "script.execute_preset"
|
preset_operator = "script.execute_preset"
|
||||||
draw = bpy.types.Menu.draw_preset
|
draw = bpy.types.Menu.draw_preset
|
||||||
|
|
||||||
|
|
||||||
class USERPREF_MT_appconfigs(bpy.types.Menu):
|
class USERPREF_MT_appconfigs(bpy.types.Menu):
|
||||||
bl_label = "AppPresets"
|
bl_label = "AppPresets"
|
||||||
preset_subdir = "keyconfig"
|
preset_subdir = "keyconfig"
|
||||||
@ -130,6 +131,7 @@ class USERPREF_MT_appconfigs(bpy.types.Menu):
|
|||||||
# now draw the presets
|
# now draw the presets
|
||||||
bpy.types.Menu.draw_preset(self, context)
|
bpy.types.Menu.draw_preset(self, context)
|
||||||
|
|
||||||
|
|
||||||
class USERPREF_MT_splash(bpy.types.Menu):
|
class USERPREF_MT_splash(bpy.types.Menu):
|
||||||
bl_label = "Splash"
|
bl_label = "Splash"
|
||||||
|
|
||||||
|
@ -1,5 +1,4 @@
|
|||||||
import bpy
|
import bpy
|
||||||
from bpy.props import IntProperty, FloatProperty
|
|
||||||
|
|
||||||
|
|
||||||
class ModalTimerOperator(bpy.types.Operator):
|
class ModalTimerOperator(bpy.types.Operator):
|
||||||
|
@ -113,11 +113,6 @@ def ctx_editmode_mball():
|
|||||||
bpy.ops.object.mode_set(mode='EDIT')
|
bpy.ops.object.mode_set(mode='EDIT')
|
||||||
|
|
||||||
|
|
||||||
def ctx_editmode_mball():
|
|
||||||
bpy.ops.object.metaball_add()
|
|
||||||
bpy.ops.object.mode_set(mode='EDIT')
|
|
||||||
|
|
||||||
|
|
||||||
def ctx_editmode_text():
|
def ctx_editmode_text():
|
||||||
bpy.ops.object.text_add()
|
bpy.ops.object.text_add()
|
||||||
bpy.ops.object.mode_set(mode='EDIT')
|
bpy.ops.object.mode_set(mode='EDIT')
|
||||||
|
Loading…
Reference in New Issue
Block a user