try:
import bpy # blender module
-except:
+except ImportError:
print("\nERROR: this script must run from inside Blender")
print(SCRIPT_HELP_MSG)
import sys
rd = context.scene.render
scene = context.scene
- cscene = scene.cycles
+ # cscene = scene.cycles
layout.active = rd.use_motion_blur
rd = context.scene.render
scene = context.scene
- cscene = scene.cycles
+ # cscene = scene.cycles
ob = context.object
cob = ob.cycles
@classmethod
def poll(cls, context):
scene = context.scene
- cscene = scene.cycles
+ # cscene = scene.cycles
psys = context.particle_system
return CyclesButtonsPanel.poll(context) and psys and psys.settings.type == 'HAIR'
@classmethod
def poll(cls, context):
scene = context.scene
- cscene = scene.cycles
+ # cscene = scene.cycles
ccscene = scene.cycles_curves
psys = context.particle_system
use_curves = ccscene.use_curves and psys
def _addon_ensure(module_name):
addons = _user_preferences.addons
- addon = _user_preferences.addons.get(module_name)
+ addon = addons.get(module_name)
if not addon:
- addon = _user_preferences.addons.new()
+ addon = addons.new()
addon.module = module_name
:return: The origin of the viewpoint in 3d space.
:rtype: :class:`mathutils.Vector`
"""
- from mathutils import Vector
-
viewinv = rv3d.view_matrix.inverted()
if rv3d.is_perspective:
- from mathutils.geometry import intersect_line_plane
-
origin_start = viewinv.translation.copy()
else:
- from mathutils.geometry import intersect_point_line
persmat = rv3d.perspective_matrix.copy()
dx = (2.0 * coord[0] / region.width) - 1.0
dy = (2.0 * coord[1] / region.height) - 1.0
# <pep8 compliant>
import bpy
-from bpy.types import Menu, Panel
class NodeCategory():
def draw_node_item(self, context):
layout = self.layout
col = layout.column()
- default_context = bpy.app.translations.contexts.default
for item in self.category.items(context):
item.draw(item, col, context)
kmi_type_set.add(v)
return kmi_type_set
- kmi_type_set_combine = None
for i, kmi_type in enumerate(filter_text_split):
kmi_type_set = kmi_type_set_from_string(kmi_type)
from bpy.props import (FloatProperty,
IntProperty,
- BoolProperty,
)
from bpy.app.translations import pgettext_data as data_
polys = mesh.polygons
loops = mesh.loops
- verts = mesh.vertices
uv_loops = mesh.uv_layers.active.data
nbr_polys = len(polys)
@staticmethod
def store_mouse_cursor(context, event):
space = context.space_data
- v2d = context.region.view2d
tree = space.edit_tree
# convert mouse position to the View2D for later node placement
DELTA_PATHS = STANDARD_TO_DELTA_PATHS.values()
# try to apply on each selected object
- success = False
for obj in context.selected_editable_objects:
adt = obj.animation_data
if (adt is None) or (adt.action is None):
return (context.active_object is not None)
def execute(self, context):
- scene = context.scene
ob = context.active_object
prefix = ""
return (context.active_object is not None)
def execute(self, context):
- scene = context.scene
ob = context.active_object
if ob.lod_levels:
def execute(self, context):
import time
- from math import radians
obj = context.object
mesh = obj.data
# <pep8-80 compliant>
import bpy
-import mathutils
from bpy.types import Operator
from bpy.props import BoolProperty
# <pep8 compliant>
import bpy
-from bpy.types import Menu, Operator
+from bpy.types import Operator
from bpy.props import (StringProperty,
BoolProperty,
IntProperty,
return a list mapping org_idx -> new_idx,
or an empty list if no sorting has been done.
"""
- neworder = [None] * len(items)
_sort = [(idx, getattr(it, propname, "")) for idx, it in enumerate(items)]
return cls.sort_items_helper(_sort, lambda e: e[1].lower())
return (context.object) and (context.armature)
def draw(self, context):
- layout = self.layout
+ # layout = self.layout
ob = context.object
avs = ob.pose.animation_visualization
def draw_item(self, context, layout, data, item, icon, active_data, active_propname, index):
# assert(isinstance(item, bpy.types.ShapeKey)
obj = active_data
- key = data
+ # key = data
key_block = item
if self.layout_type in {'DEFAULT', 'COMPACT'}:
split = layout.split(0.66, False)
layout = self.layout
me = context.mesh
- lay = me.uv_textures.active
row = layout.row()
col = row.column()
layout = self.layout
me = context.mesh
- lay = me.vertex_colors.active
row = layout.row()
col = row.column()
def draw(self, context):
layout = self.layout
- sc = context.space_data
layout.operator("mask.select_border")
layout.operator("mask.select_circle")
class MATERIAL_UL_matslots(UIList):
def draw_item(self, context, layout, data, item, icon, active_data, active_propname, index):
# assert(isinstance(item, bpy.types.MaterialSlot)
- ob = data
+ # ob = data
slot = item
ma = slot.material
if self.layout_type in {'DEFAULT', 'COMPACT'}:
return (context.object)
def draw(self, context):
- layout = self.layout
+ # layout = self.layout
ob = context.object
avs = ob.animation_visualization
# <pep8 compliant>
import bpy
-from bpy.types import Menu, Panel, UIList
+from bpy.types import Panel, UIList
class RenderLayerButtonsPanel():
layout = self.layout
scene = context.scene
- rd = scene.render
col = layout.column()
col.label(text="Display:")
sc = context.space_data
clip = sc.clip
- settings = clip.tracking.settings
col = layout.column(align=True)
row = col.row(align=True)
def draw(self, context):
layout = self.layout
- sc = context.space_data
clip = context.space_data.clip
active_track = clip.tracking.plane_tracks.active
layout = self.layout
sc = context.space_data
- clip = sc.clip
col = layout.column()
col.template_movieclip_information(sc, "clip", sc.clip_user)
sima = context.space_data
ima = sima.image
- show_render = sima.show_render
show_uvedit = sima.show_uvedit
show_maskedit = sima.show_maskedit
toolsettings = context.tool_settings.image_paint
brush = toolsettings.brush
- tex_slot = brush.texture_slot
col = layout.column()
col.template_ID_preview(brush, "texture", new="texture.new", rows=3, cols=8)
layout = self.layout
brush = context.tool_settings.image_paint.brush
- tex_slot_alpha = brush.mask_texture_slot
col = layout.column()
@classmethod
def poll(cls, context):
- space = context.space_data
return context.active_node is not None
def draw(self, context):
@classmethod
def poll(cls, context):
- space = context.space_data
return context.active_node is not None
def draw_header(self, context):
@classmethod
def poll(cls, context):
- space = context.space_data
return context.active_node is not None
def draw(self, context):
def draw(self, context):
layout = self.layout
- sequencer = context.scene.sequence_editor
strip = act_strip(context)
if strip.input_count > 0:
layout = self.layout
view = context.space_data
- mode_string = context.mode
- edit_object = context.edit_object
+ # mode_string = context.mode
obj = context.active_object
toolsettings = context.tool_settings
view = context.space_data
scene = context.scene
- gs = scene.game_settings
- obj = context.object
col = layout.column()
col.prop(view, "show_only_render")
settings = self.paint_settings(context)
brush = settings.brush
- tex_slot = brush.texture_slot
col = layout.column()
layout = self.layout
brush = context.tool_settings.image_paint.brush
- tex_slot_alpha = brush.mask_texture_slot
col = layout.column()
minx_icon, miny_icon, maxx_icon, maxy_icon,
spacex_icon, spacey_icon,
):
- import struct
is_simple = (max(minx, miny, maxx, maxy,
minx_icon, miny_icon, maxx_icon, maxy_icon,
# simple, no margins
if is_simple:
- sub_x = x * icon_x
+ sub_x = x * icon_w
sub_y = y * icon_h
else:
sub_x = minx + ((x * (icon_w + spacex_icon)) + minx_icon)
import rna_wiki_reference
import urllib.error
- from urllib.request import urlopen
+ from urllib.request import urlopen
prefix = rna_wiki_reference.url_manual_prefix
urls = {suffix for (rna_id, suffix) in rna_wiki_reference.url_manual_mapping}
print(" %s ... " % url_full, end="")
sys.stdout.flush()
try:
- urllib.request.urlopen(url_full)
+ urlopen(url_full)
print(color_green + "OK" + color_normal)
except urllib.error.HTTPError:
print(color_red + "FAIL!" + color_normal)
import os
-# depends on pep8, pyflakes, pylint
+# depends on pep8, frosted, pylint
# for Ubuntu
#
-# sudo apt-get install pylint pyflakes
+# sudo apt-get install pylint
#
# sudo apt-get install python-setuptools python-pip
# sudo pip install pep8
+# sudo pip install frosted
#
-# in Debian install pylint pyflakes pep8 with apt-get/aptitude/etc
+# in Debian install pylint pep8 with apt-get/aptitude/etc
#
# on *nix run
# python source/tests/pep8.py > test_pep8.log 2>&1
os.system("pep8 --repeat --ignore=%s '%s'" % (",".join(ignore_tmp), f))
- # pyflakes
- print("\n\n\n# running pyflakes...")
+ # frosted
+ print("\n\n\n# running frosted...")
for f, pep8_type in files:
- os.system("pyflakes '%s'" % f)
+ os.system("frosted '%s'" % f)
print("\n\n\n# running pylint...")
for f, pep8_type in files:
indent_map = {}
indent_prev = 0
f = open(filepath, encoding="utf-8")
- indent_lists = []
for i, line in enumerate(f):
line_strip = line.lstrip()
# ^\.\.\s[a-zA-Z09\-]+::.*$