Style cleanup: C & pep8
This commit is contained in:
@@ -204,8 +204,10 @@ class BPyOpsSubModOp(object):
|
|||||||
import bpy
|
import bpy
|
||||||
idname = self.idname()
|
idname = self.idname()
|
||||||
as_string = op_as_string(idname)
|
as_string = op_as_string(idname)
|
||||||
# XXX You never quite know what you get from bpy.types, with operators... Operator and OperatorProperties
|
# XXX You never quite know what you get from bpy.types,
|
||||||
# are shadowing each other, and not in the same way for native ops and py ones! See T39158.
|
# with operators... Operator and OperatorProperties
|
||||||
|
# are shadowing each other, and not in the same way for
|
||||||
|
# native ops and py ones! See T39158.
|
||||||
# op_class = getattr(bpy.types, idname)
|
# op_class = getattr(bpy.types, idname)
|
||||||
op_class = op_get_rna(idname)
|
op_class = op_get_rna(idname)
|
||||||
descr = op_class.bl_rna.description
|
descr = op_class.bl_rna.description
|
||||||
|
|||||||
@@ -49,6 +49,7 @@ class MyCustomSocket(NodeSocket):
|
|||||||
def draw_color(self, context, node):
|
def draw_color(self, context, node):
|
||||||
return (1.0, 0.4, 0.216, 0.5)
|
return (1.0, 0.4, 0.216, 0.5)
|
||||||
|
|
||||||
|
|
||||||
# Mix-in class for all custom nodes in this tree type.
|
# Mix-in class for all custom nodes in this tree type.
|
||||||
# Defines a poll function to enable instantiation.
|
# Defines a poll function to enable instantiation.
|
||||||
class MyCustomTreeNode:
|
class MyCustomTreeNode:
|
||||||
@@ -56,6 +57,7 @@ class MyCustomTreeNode :
|
|||||||
def poll(cls, ntree):
|
def poll(cls, ntree):
|
||||||
return ntree.bl_idname == 'CustomTreeType'
|
return ntree.bl_idname == 'CustomTreeType'
|
||||||
|
|
||||||
|
|
||||||
# Derived from the Node base type.
|
# Derived from the Node base type.
|
||||||
class MyCustomNode(Node, MyCustomTreeNode):
|
class MyCustomNode(Node, MyCustomTreeNode):
|
||||||
# === Basics ===
|
# === Basics ===
|
||||||
@@ -123,6 +125,7 @@ class MyCustomNode(Node, MyCustomTreeNode):
|
|||||||
import nodeitems_utils
|
import nodeitems_utils
|
||||||
from nodeitems_utils import NodeCategory, NodeItem
|
from nodeitems_utils import NodeCategory, NodeItem
|
||||||
|
|
||||||
|
|
||||||
# our own base class with an appropriate poll function,
|
# our own base class with an appropriate poll function,
|
||||||
# so the categories only show up in our own tree type
|
# so the categories only show up in our own tree type
|
||||||
class MyNodeCategory(NodeCategory):
|
class MyNodeCategory(NodeCategory):
|
||||||
|
|||||||
@@ -16,7 +16,6 @@ def main(context, event, ray_max=10000.0):
|
|||||||
ray_origin = view3d_utils.region_2d_to_origin_3d(region, rv3d, coord)
|
ray_origin = view3d_utils.region_2d_to_origin_3d(region, rv3d, coord)
|
||||||
ray_target = ray_origin + (view_vector * ray_max)
|
ray_target = ray_origin + (view_vector * ray_max)
|
||||||
|
|
||||||
|
|
||||||
def visible_objects_and_duplis():
|
def visible_objects_and_duplis():
|
||||||
"""Loop over (object, matrix) pairs (mesh only)"""
|
"""Loop over (object, matrix) pairs (mesh only)"""
|
||||||
|
|
||||||
|
|||||||
@@ -2414,8 +2414,8 @@ static void draw_dm_loop_normals(BMEditMesh *em, Scene *scene, Object *ob, Deriv
|
|||||||
|
|
||||||
if (lnors) {
|
if (lnors) {
|
||||||
drawDMNormal_userData data;
|
drawDMNormal_userData data;
|
||||||
MLoop *mloops = dm->getLoopArray(dm);
|
const MLoop *mloops = dm->getLoopArray(dm);
|
||||||
MVert *mverts = dm->getVertArray(dm);
|
const MVert *mverts = dm->getVertArray(dm);
|
||||||
int i, totloops = dm->getNumLoops(dm);
|
int i, totloops = dm->getNumLoops(dm);
|
||||||
|
|
||||||
data.bm = em->bm;
|
data.bm = em->bm;
|
||||||
@@ -2426,7 +2426,7 @@ static void draw_dm_loop_normals(BMEditMesh *em, Scene *scene, Object *ob, Deriv
|
|||||||
glBegin(GL_LINES);
|
glBegin(GL_LINES);
|
||||||
for (i = 0; i < totloops; i++, mloops++, lnors++) {
|
for (i = 0; i < totloops; i++, mloops++, lnors++) {
|
||||||
float no[3];
|
float no[3];
|
||||||
float *co = mverts[mloops->v].co;
|
const float *co = mverts[mloops->v].co;
|
||||||
|
|
||||||
if (!data.uniform_scale) {
|
if (!data.uniform_scale) {
|
||||||
mul_v3_m3v3(no, data.tmat, (float *)lnors);
|
mul_v3_m3v3(no, data.tmat, (float *)lnors);
|
||||||
|
|||||||
@@ -54,7 +54,7 @@ def is_pep8(path):
|
|||||||
print("\nfile contains BOM, remove first 3 bytes: %r\n" % path)
|
print("\nfile contains BOM, remove first 3 bytes: %r\n" % path)
|
||||||
|
|
||||||
# templates don't have a header but should be pep8
|
# templates don't have a header but should be pep8
|
||||||
for d in ("presets", "templates", "examples"):
|
for d in ("presets", "templates_py", "examples"):
|
||||||
if ("%s%s%s" % (os.sep, d, os.sep)) in path:
|
if ("%s%s%s" % (os.sep, d, os.sep)) in path:
|
||||||
return 1
|
return 1
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user