freestyle lineset `tag` attribute was defined but not used, also some code cleanup.

This commit is contained in:
Campbell Barton 2013-04-07 01:38:03 +00:00
parent 6774e727a2
commit 63d523336f
21 changed files with 70 additions and 41 deletions

View File

@ -267,6 +267,7 @@ class CyclesRender_PT_layers(CyclesButtonsPanel, Panel):
row.prop(rl, "name")
row.prop(rd, "use_single_layer", text="", icon_only=True)
class CyclesRender_PT_layer_options(CyclesButtonsPanel, Panel):
bl_label = "Layer"
bl_context = "render_layer"
@ -298,6 +299,7 @@ class CyclesRender_PT_layer_options(CyclesButtonsPanel, Panel):
col.prop(rl, "samples")
col.prop(rl, "use_sky", "Use Environment")
class CyclesRender_PT_layer_passes(CyclesButtonsPanel, Panel):
bl_label = "Passes"
bl_context = "render_layer"

View File

@ -654,7 +654,8 @@ def make_rna_paths(struct_name, prop_name, enum_name):
:type prop_name: string
:arg enum_name: Name of a RNA enum identifier.
:type enum_name: string
:return: A triple of three "RNA paths" (most_complete_path, "struct.prop", "struct.prop:'enum'").
:return: A triple of three "RNA paths"
(most_complete_path, "struct.prop", "struct.prop:'enum'").
If no enum_name is given, the third element will always be void.
:rtype: tuple of strings
"""

View File

@ -328,10 +328,12 @@ def ngon_tessellate(from_data, indices, fix_loops=True):
fgon to create from existing verts.
from_data: either a mesh, or a list/tuple of vectors.
:arg indices: a list of indices to use this list is the ordered closed polyline
:arg indices: a list of indices to use this list
is the ordered closed polyline
to fill, and can be a subset of the data given.
:type indices: list
:arg fix_loops: If this is enabled polylines that use loops to make multiple
:arg fix_loops: If this is enabled polylines
that use loops to make multiple
polylines are delt with correctly.
:type fix_loops: bool
"""

View File

@ -191,7 +191,8 @@ class AddObjectHelper:
def object_add_grid_scale(context):
"""
Return scale which should be applied on object data to align it to grid scale
Return scale which should be applied on object
data to align it to grid scale
"""
space_data = context.space_data

View File

@ -473,7 +473,8 @@ class ShapeTransfer(Operator):
class JoinUVs(Operator):
"""Transfer UV Layouts from active to selected objects (needs matching geometry)"""
"""Transfer UV Layouts from active to selected objects """ \
"""(needs matching geometry)"""
bl_idname = "object.join_uvs"
bl_label = "Transfer UV Layouts"

View File

@ -804,7 +804,6 @@ class IMAGE_PT_paint_stroke(BrushButtonsPanel, Panel):
row.prop(brush, "spacing", text="Spacing")
row.prop(brush, "use_pressure_spacing", toggle=True, text="")
col = layout.column()
col.separator()

View File

@ -1642,8 +1642,8 @@ class VIEW3D_MT_pose_specials(Menu):
def draw(self, context):
layout = self.layout
layout.operator("paint.weight_from_bones", text="Assign Automatic from Bones").type="AUTOMATIC"
layout.operator("paint.weight_from_bones", text="Assign from Bone Envelopes").type="ENVELOPES"
layout.operator("paint.weight_from_bones", text="Assign Automatic from Bones").type = 'AUTOMATIC'
layout.operator("paint.weight_from_bones", text="Assign from Bone Envelopes").type = 'ENVELOPES'
layout.separator()

View File

@ -880,6 +880,7 @@ class VIEW3D_PT_tools_brush_stroke(Panel, View3DPaintPanel):
sub.prop(brush, "smooth_stroke_radius", text="Radius", slider=True)
sub.prop(brush, "smooth_stroke_factor", text="Factor", slider=True)
class VIEW3D_PT_tools_brush_curve(Panel, View3DPaintPanel):
bl_label = "Curve"
bl_options = {'DEFAULT_CLOSED'}

View File

@ -1949,6 +1949,10 @@ void RNA_def_main_linestyles(BlenderRNA *brna, PropertyRNA *cprop)
RNA_def_struct_sdna(srna, "Main");
RNA_def_struct_ui_text(srna, "Main Line Styles", "Collection of line styles");
func = RNA_def_function(srna, "tag", "rna_Main_linestyle_tag");
parm = RNA_def_boolean(func, "value", 0, "Value", "");
RNA_def_property_flag(parm, PROP_REQUIRED);
func = RNA_def_function(srna, "new", "rna_Main_linestyles_new");
RNA_def_function_ui_description(func, "Add a new line style instance to the main database");
parm = RNA_def_string(func, "name", "FreestyleLineStyle", 0, "", "New name for the datablock");

View File

@ -102,7 +102,7 @@ static char *bmp_slots_as_args(const BMOSlotType slot_types[BMO_OP_MAX_SLOTS], c
}
BLI_dynstr_appendf(dyn_str, i ? ", %.*s=%s" : "%.*s=%s", name_len, slot_types[i].name, value);
i++;
};
}
ret = BLI_dynstr_get_cstring(dyn_str);
BLI_dynstr_free(dyn_str);

View File

@ -2731,7 +2731,8 @@ static void init_render_dm(DerivedMesh *dm, Render *re, ObjectRen *obr,
if (ffa) {
int index = (index_mf_to_mpoly) ? DM_origindex_mface_mpoly(index_mf_to_mpoly, index_mp_to_orig, a) : a;
vlr->freestyle_face_mark= (ffa[index].flag & FREESTYLE_FACE_MARK) ? 1 : 0;
} else {
}
else {
vlr->freestyle_face_mark= 0;
}
#endif
@ -3398,8 +3399,10 @@ static void init_render_mesh(Render *re, ObjectRen *obr, int timeoffset)
if (need_origindex) {
index_vert_orig = dm->getVertDataArray(dm, CD_ORIGINDEX);
/* double lookup for faces -> polys */
#ifdef WITH_FREESTYLE
index_mf_to_mpoly = dm->getTessFaceDataArray(dm, CD_ORIGINDEX);
index_mp_to_orig = dm->getPolyDataArray(dm, CD_ORIGINDEX);
#endif
}
for (a=0; a<totvert; a++, mvert++) {
@ -3510,7 +3513,8 @@ static void init_render_mesh(Render *re, ObjectRen *obr, int timeoffset)
if (has_freestyle_edge_mark(edge_hash, v2, v3)) edge_mark |= R_EDGE_V2V3;
if (!v4) {
if (has_freestyle_edge_mark(edge_hash, v3, v1)) edge_mark |= R_EDGE_V3V1;
} else {
}
else {
if (has_freestyle_edge_mark(edge_hash, v3, v4)) edge_mark |= R_EDGE_V3V4;
if (has_freestyle_edge_mark(edge_hash, v4, v1)) edge_mark |= R_EDGE_V4V1;
}
@ -3519,7 +3523,8 @@ static void init_render_mesh(Render *re, ObjectRen *obr, int timeoffset)
if (ffa) {
int index = (index_mf_to_mpoly) ? DM_origindex_mface_mpoly(index_mf_to_mpoly, index_mp_to_orig, a) : a;
vlr->freestyle_face_mark= (ffa[index].flag & FREESTYLE_FACE_MARK) ? 1 : 0;
} else {
}
else {
vlr->freestyle_face_mark= 0;
}
#endif

View File

@ -37,6 +37,7 @@ import os
# should be directly after the license header, ~20 in most cases
PEP8_SEEK_COMMENT = 40
SKIP_PREFIX = "./tools", "./config", "./scons", "./extern"
SKIP_ADDONS = True
FORCE_PEP8_ALL = False
@ -76,6 +77,10 @@ def main():
if [None for prefix in SKIP_PREFIX if f.startswith(prefix)]:
continue
if SKIP_ADDONS:
if (os.sep + "addons") in f:
continue
pep8_type = FORCE_PEP8_ALL or is_pep8(f)
if pep8_type:
@ -98,12 +103,20 @@ def main():
print("%s:%d:0: global import bad practice" % (f, i + 1))
print("\n\n\n# running pep8...")
# these are very picky and often hard to follow
# while keeping common script formatting.
ignore = "E122", "E123", "E124", "E125", "E126", "E127", "E128"
for f, pep8_type in files:
if pep8_type == 1:
# E501:80 line length
os.system("pep8 --repeat --ignore=E501 '%s'" % (f))
ignore_tmp = ignore + ("E501", )
else:
os.system("pep8 --repeat '%s'" % (f))
ignore_tmp = ignore
os.system("pep8 --repeat --ignore=%s '%s'" % (",".join(ignore_tmp), f))
# pyflakes
print("\n\n\n# running pyflakes...")