Cleanup: pep8
This commit is contained in:
@@ -1,6 +1,6 @@
|
|||||||
|
"""
|
||||||
.. _operator-execution_context:
|
.. _operator-execution_context:
|
||||||
|
|
||||||
"""
|
|
||||||
Execution Context
|
Execution Context
|
||||||
-----------------
|
-----------------
|
||||||
|
|
||||||
|
@@ -455,8 +455,10 @@ ClassMethodDescriptorType = type(dict.__dict__['fromkeys'])
|
|||||||
MethodDescriptorType = type(dict.get)
|
MethodDescriptorType = type(dict.get)
|
||||||
GetSetDescriptorType = type(int.real)
|
GetSetDescriptorType = type(int.real)
|
||||||
StaticMethodType = type(staticmethod(lambda: None))
|
StaticMethodType = type(staticmethod(lambda: None))
|
||||||
from types import (MemberDescriptorType,
|
from types import (
|
||||||
|
MemberDescriptorType,
|
||||||
MethodType,
|
MethodType,
|
||||||
|
FunctionType,
|
||||||
)
|
)
|
||||||
|
|
||||||
_BPY_STRUCT_FAKE = "bpy_struct"
|
_BPY_STRUCT_FAKE = "bpy_struct"
|
||||||
@@ -869,7 +871,7 @@ def pymodule2sphinx(basepath, module_name, module, title):
|
|||||||
module_dir_value_type.sort(key=lambda triple: str(triple[2]))
|
module_dir_value_type.sort(key=lambda triple: str(triple[2]))
|
||||||
|
|
||||||
for attribute, value, value_type in module_dir_value_type:
|
for attribute, value, value_type in module_dir_value_type:
|
||||||
if value_type == types.FunctionType:
|
if value_type == FunctionType:
|
||||||
pyfunc2sphinx("", fw, module_name, None, attribute, value, is_class=False)
|
pyfunc2sphinx("", fw, module_name, None, attribute, value, is_class=False)
|
||||||
elif value_type in {types.BuiltinMethodType, types.BuiltinFunctionType}: # both the same at the moment but to be future proof
|
elif value_type in {types.BuiltinMethodType, types.BuiltinFunctionType}: # both the same at the moment but to be future proof
|
||||||
# note: can't get args from these, so dump the string as is
|
# note: can't get args from these, so dump the string as is
|
||||||
@@ -939,7 +941,7 @@ def pymodule2sphinx(basepath, module_name, module, title):
|
|||||||
|
|
||||||
# needed for pure python classes
|
# needed for pure python classes
|
||||||
for key, descr in descr_items:
|
for key, descr in descr_items:
|
||||||
if type(descr) == types.FunctionType:
|
if type(descr) == FunctionType:
|
||||||
pyfunc2sphinx(" ", fw, module_name, type_name, key, descr, is_class=True)
|
pyfunc2sphinx(" ", fw, module_name, type_name, key, descr, is_class=True)
|
||||||
|
|
||||||
for key, descr in descr_items:
|
for key, descr in descr_items:
|
||||||
|
@@ -30,8 +30,10 @@ bl_info = {
|
|||||||
|
|
||||||
import bpy
|
import bpy
|
||||||
|
|
||||||
from . import engine
|
from . import (
|
||||||
from . import version_update
|
engine,
|
||||||
|
version_update,
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
class CyclesRender(bpy.types.RenderEngine):
|
class CyclesRender(bpy.types.RenderEngine):
|
||||||
|
@@ -18,7 +18,11 @@
|
|||||||
|
|
||||||
import bpy
|
import bpy
|
||||||
|
|
||||||
from bpy.types import Panel, Menu, Operator, UIList
|
from bpy.types import (
|
||||||
|
Panel,
|
||||||
|
Menu,
|
||||||
|
Operator,
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
class CYCLES_MT_sampling_presets(Menu):
|
class CYCLES_MT_sampling_presets(Menu):
|
||||||
@@ -55,6 +59,7 @@ def use_cpu(context):
|
|||||||
|
|
||||||
return (device_type == 'NONE' or cscene.device == 'CPU')
|
return (device_type == 'NONE' or cscene.device == 'CPU')
|
||||||
|
|
||||||
|
|
||||||
def use_branched_path(context):
|
def use_branched_path(context):
|
||||||
cscene = context.scene.cycles
|
cscene = context.scene.cycles
|
||||||
device_type = context.user_preferences.system.compute_device_type
|
device_type = context.user_preferences.system.compute_device_type
|
||||||
@@ -442,7 +447,6 @@ class CyclesRender_PT_views(CyclesButtonsPanel, Panel):
|
|||||||
rd = scene.render
|
rd = scene.render
|
||||||
rv = rd.views.active
|
rv = rd.views.active
|
||||||
|
|
||||||
|
|
||||||
layout.active = rd.use_multiview
|
layout.active = rd.use_multiview
|
||||||
basic_stereo = (rd.views_format == 'STEREO_3D')
|
basic_stereo = (rd.views_format == 'STEREO_3D')
|
||||||
|
|
||||||
@@ -518,7 +522,7 @@ class CyclesCamera_PT_dof(CyclesButtonsPanel, Panel):
|
|||||||
sub = col.column(align=True)
|
sub = col.column(align=True)
|
||||||
sub.label("Viewport:")
|
sub.label("Viewport:")
|
||||||
subhq = sub.column()
|
subhq = sub.column()
|
||||||
subhq.active = hq_support;
|
subhq.active = hq_support
|
||||||
subhq.prop(dof_options, "use_high_quality")
|
subhq.prop(dof_options, "use_high_quality")
|
||||||
sub.prop(dof_options, "fstop")
|
sub.prop(dof_options, "fstop")
|
||||||
if dof_options.use_high_quality and hq_support:
|
if dof_options.use_high_quality and hq_support:
|
||||||
|
@@ -226,7 +226,8 @@ def resolve_ncase(path):
|
|||||||
if _os.path.isdir(dirpath):
|
if _os.path.isdir(dirpath):
|
||||||
try:
|
try:
|
||||||
files = _os.listdir(dirpath)
|
files = _os.listdir(dirpath)
|
||||||
except PermissionError: # We might not have the permission to list dirpath...
|
except PermissionError:
|
||||||
|
# We might not have the permission to list dirpath...
|
||||||
return path, False
|
return path, False
|
||||||
else:
|
else:
|
||||||
return path, False
|
return path, False
|
||||||
|
@@ -35,7 +35,11 @@ __all__ = (
|
|||||||
)
|
)
|
||||||
|
|
||||||
import bpy
|
import bpy
|
||||||
from bpy.props import StringProperty, BoolProperty, EnumProperty
|
from bpy.props import (
|
||||||
|
StringProperty,
|
||||||
|
BoolProperty,
|
||||||
|
EnumProperty,
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
def _check_axis_conversion(op):
|
def _check_axis_conversion(op):
|
||||||
|
@@ -31,7 +31,10 @@ __all__ = (
|
|||||||
|
|
||||||
import bpy
|
import bpy
|
||||||
|
|
||||||
from bpy.props import BoolProperty, FloatVectorProperty
|
from bpy.props import (
|
||||||
|
BoolProperty,
|
||||||
|
FloatVectorProperty,
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
def add_object_align_init(context, operator):
|
def add_object_align_init(context, operator):
|
||||||
@@ -287,7 +290,8 @@ def world_to_camera_view(scene, obj, coord):
|
|||||||
Returns the camera space coords for a 3d point.
|
Returns the camera space coords for a 3d point.
|
||||||
(also known as: normalized device coordinates - NDC).
|
(also known as: normalized device coordinates - NDC).
|
||||||
|
|
||||||
Where (0, 0) is the bottom left and (1, 1) is the top right of the camera frame.
|
Where (0, 0) is the bottom left and (1, 1)
|
||||||
|
is the top right of the camera frame.
|
||||||
values outside 0-1 are also supported.
|
values outside 0-1 are also supported.
|
||||||
A negative 'z' value means the point is behind the camera.
|
A negative 'z' value means the point is behind the camera.
|
||||||
|
|
||||||
@@ -300,7 +304,8 @@ def world_to_camera_view(scene, obj, coord):
|
|||||||
:type obj: :class:`bpy.types.Object`
|
:type obj: :class:`bpy.types.Object`
|
||||||
:arg coord: World space location.
|
:arg coord: World space location.
|
||||||
:type coord: :class:`mathutils.Vector`
|
:type coord: :class:`mathutils.Vector`
|
||||||
:return: a vector where X and Y map to the view plane and Z is the depth on the view axis.
|
:return: a vector where X and Y map to the view plane and
|
||||||
|
Z is the depth on the view axis.
|
||||||
:rtype: :class:`mathutils.Vector`
|
:rtype: :class:`mathutils.Vector`
|
||||||
"""
|
"""
|
||||||
from mathutils import Vector
|
from mathutils import Vector
|
||||||
|
@@ -69,11 +69,13 @@ def region_2d_to_origin_3d(region, rv3d, coord, clamp=None):
|
|||||||
|
|
||||||
.. note::
|
.. note::
|
||||||
|
|
||||||
Orthographic views have a less obvious origin, the far clip is used to define the viewport near/far extents.
|
Orthographic views have a less obvious origin,
|
||||||
Since far clip can be a very large value, the result may give with numeric precision issues.
|
the far clip is used to define the viewport near/far extents.
|
||||||
|
Since far clip can be a very large value,
|
||||||
|
the result may give with numeric precision issues.
|
||||||
|
|
||||||
To avoid this problem, you can optionally clamp the far clip to a smaller value
|
To avoid this problem, you can optionally clamp the far clip to a
|
||||||
based on the data you're operating on.
|
smaller value based on the data you're operating on.
|
||||||
|
|
||||||
:arg region: region of the 3D viewport, typically bpy.context.region.
|
:arg region: region of the 3D viewport, typically bpy.context.region.
|
||||||
:type region: :class:`bpy.types.Region`
|
:type region: :class:`bpy.types.Region`
|
||||||
|
@@ -340,7 +340,10 @@ def align_objects(context,
|
|||||||
return True
|
return True
|
||||||
|
|
||||||
|
|
||||||
from bpy.props import EnumProperty, BoolProperty
|
from bpy.props import (
|
||||||
|
EnumProperty,
|
||||||
|
BoolProperty
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
class AlignObjects(Operator):
|
class AlignObjects(Operator):
|
||||||
|
@@ -128,6 +128,7 @@ class FILEBROWSER_PT_system_folders(Panel):
|
|||||||
row.template_list("FILEBROWSER_UL_dir", "system_folders", space, "system_folders",
|
row.template_list("FILEBROWSER_UL_dir", "system_folders", space, "system_folders",
|
||||||
space, "system_folders_active", item_dyntip_propname="path", rows=1, maxrows=10)
|
space, "system_folders_active", item_dyntip_propname="path", rows=1, maxrows=10)
|
||||||
|
|
||||||
|
|
||||||
class FILEBROWSER_PT_system_bookmarks(Panel):
|
class FILEBROWSER_PT_system_bookmarks(Panel):
|
||||||
bl_space_type = 'FILE_BROWSER'
|
bl_space_type = 'FILE_BROWSER'
|
||||||
bl_region_type = 'TOOLS'
|
bl_region_type = 'TOOLS'
|
||||||
|
Reference in New Issue
Block a user