freestyle lineset `tag` attribute was defined but not used, also some code cleanup.
This commit is contained in:
parent
6774e727a2
commit
63d523336f
|
@ -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"
|
||||
|
@ -297,7 +298,8 @@ class CyclesRender_PT_layer_options(CyclesButtonsPanel, Panel):
|
|||
col = split.column()
|
||||
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"
|
||||
|
|
|
@ -654,8 +654,9 @@ 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'").
|
||||
If no enum_name is given, the third element will always be void.
|
||||
: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
|
||||
"""
|
||||
src = src_rna = src_enum = ""
|
||||
|
|
|
@ -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
|
||||
"""
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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"
|
||||
|
||||
|
|
|
@ -93,7 +93,7 @@ class RENDERLAYER_UL_linesets(UIList):
|
|||
layout.label("", icon_value=icon)
|
||||
|
||||
##ifdef WITH_FREESTYLE
|
||||
# else if (RNA_struct_is_a(itemptr->type, &RNA_SceneRenderLayer) ||
|
||||
# else if (RNA_struct_is_a(itemptr->type, &RNA_SceneRenderLayer) ||
|
||||
# RNA_struct_is_a(itemptr->type, &RNA_FreestyleLineSet)) {
|
||||
##else
|
||||
# else if (RNA_struct_is_a(itemptr->type, &RNA_SceneRenderLayer)) {
|
||||
|
|
|
@ -222,9 +222,9 @@ class OBJECT_PT_display(ObjectButtonsPanel, Panel):
|
|||
col = split.column()
|
||||
col.prop(obj, "show_name", text="Name")
|
||||
col.prop(obj, "show_axis", text="Axis")
|
||||
|
||||
|
||||
obj_type = obj.type
|
||||
|
||||
|
||||
if obj_type in {'MESH', 'CURVE', 'SURFACE', 'META', 'FONT'}:
|
||||
# Makes no sense for cameras, armtures, etc.!
|
||||
col.prop(obj, "show_wire", text="Wire")
|
||||
|
|
|
@ -82,7 +82,7 @@ def brush_texture_settings(layout, brush, sculpt):
|
|||
else:
|
||||
layout.row().prop(tex_slot, "tex_paint_map_mode", text="")
|
||||
layout.separator()
|
||||
|
||||
|
||||
if tex_slot.map_mode == 'STENCIL':
|
||||
layout.operator("brush.stencil_fit_image_aspect")
|
||||
|
||||
|
|
|
@ -786,7 +786,7 @@ class IMAGE_PT_paint_stroke(BrushButtonsPanel, Panel):
|
|||
col = layout.column()
|
||||
|
||||
col.label(text="Stroke Method:")
|
||||
|
||||
|
||||
col.prop(brush, "stroke_method", text="")
|
||||
|
||||
if brush.use_anchor:
|
||||
|
@ -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()
|
||||
|
||||
|
|
|
@ -151,7 +151,7 @@ class NODE_MT_select(Menu):
|
|||
layout.operator("node.select_all", text="Inverse").action = 'INVERT'
|
||||
layout.operator("node.select_linked_from")
|
||||
layout.operator("node.select_linked_to")
|
||||
|
||||
|
||||
layout.separator()
|
||||
|
||||
layout.operator("node.select_same_type")
|
||||
|
|
|
@ -1641,12 +1641,12 @@ 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()
|
||||
|
||||
|
||||
layout.operator("pose.select_constraint_target")
|
||||
layout.operator("pose.flip_names")
|
||||
layout.operator("pose.paths_calculate")
|
||||
|
|
|
@ -707,7 +707,7 @@ class VIEW3D_PT_tools_brush(Panel, View3DPaintPanel):
|
|||
self.prop_unified_strength(row, context, brush, "use_pressure_strength")
|
||||
|
||||
row = col.row(align=True)
|
||||
|
||||
|
||||
col.prop(brush, "vertex_tool", text="Blend")
|
||||
|
||||
# Vertex Paint Mode #
|
||||
|
@ -815,7 +815,7 @@ class VIEW3D_PT_tools_brush_stroke(Panel, View3DPaintPanel):
|
|||
col = layout.column()
|
||||
|
||||
col.label(text="Stroke Method:")
|
||||
|
||||
|
||||
if context.sculpt_object:
|
||||
col.prop(brush, "sculpt_stroke_method", text="")
|
||||
else:
|
||||
|
@ -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'}
|
||||
|
|
|
@ -58,7 +58,7 @@ void MixHueOperation::executePixel(float output[4], float x, float y, PixelSampl
|
|||
output[2] = valuem * (inputColor1[2]) + value * tmpb;
|
||||
}
|
||||
else {
|
||||
copy_v3_v3(output, inputColor1);
|
||||
copy_v3_v3(output, inputColor1);
|
||||
}
|
||||
output[3] = inputColor1[3];
|
||||
|
||||
|
|
|
@ -3901,7 +3901,7 @@ static int edbm_mark_freestyle_edge(bContext *C, wmOperator *op)
|
|||
}
|
||||
|
||||
DAG_id_tag_update(obedit->data, OB_RECALC_DATA);
|
||||
WM_event_add_notifier(C, NC_GEOM|ND_DATA, obedit->data);
|
||||
WM_event_add_notifier(C, NC_GEOM | ND_DATA, obedit->data);
|
||||
|
||||
return OPERATOR_FINISHED;
|
||||
}
|
||||
|
@ -3918,7 +3918,7 @@ void MESH_OT_mark_freestyle_edge(wmOperatorType *ot)
|
|||
ot->poll = ED_operator_editmesh;
|
||||
|
||||
/* flags */
|
||||
ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO;
|
||||
ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO;
|
||||
|
||||
RNA_def_boolean(ot->srna, "clear", 0, "Clear", "");
|
||||
}
|
||||
|
@ -3962,7 +3962,7 @@ static int edbm_mark_freestyle_face_exec(bContext *C, wmOperator *op)
|
|||
}
|
||||
|
||||
DAG_id_tag_update(obedit->data, OB_RECALC_DATA);
|
||||
WM_event_add_notifier(C, NC_GEOM|ND_DATA, obedit->data);
|
||||
WM_event_add_notifier(C, NC_GEOM | ND_DATA, obedit->data);
|
||||
|
||||
return OPERATOR_FINISHED;
|
||||
}
|
||||
|
@ -3979,7 +3979,7 @@ void MESH_OT_mark_freestyle_face(wmOperatorType *ot)
|
|||
ot->poll = ED_operator_editmesh;
|
||||
|
||||
/* flags */
|
||||
ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO;
|
||||
ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO;
|
||||
|
||||
RNA_def_boolean(ot->srna, "clear", 0, "Clear", "");
|
||||
}
|
||||
|
|
|
@ -1137,7 +1137,7 @@ void SCENE_OT_freestyle_modifier_copy(wmOperatorType *ot)
|
|||
ot->poll = freestyle_active_lineset_poll;
|
||||
|
||||
/* flags */
|
||||
ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO;
|
||||
ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO;
|
||||
}
|
||||
|
||||
static int freestyle_modifier_move_exec(bContext *C, wmOperator *op)
|
||||
|
|
|
@ -643,7 +643,7 @@ static int stencil_fit_image_aspect_exec(bContext *C, wmOperator *UNUSED(op))
|
|||
orig_area = aspx*aspy;
|
||||
stencil_area = br->stencil_dimension[0]*br->stencil_dimension[1];
|
||||
|
||||
factor = sqrt(stencil_area/orig_area);
|
||||
factor = sqrt(stencil_area / orig_area);
|
||||
|
||||
br->stencil_dimension[0] = factor*aspx;
|
||||
br->stencil_dimension[1] = factor*aspy;
|
||||
|
|
|
@ -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");
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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++) {
|
||||
|
@ -3506,20 +3509,22 @@ static void init_render_mesh(Render *re, ObjectRen *obr, int timeoffset)
|
|||
{
|
||||
int edge_mark = 0;
|
||||
|
||||
if(has_freestyle_edge_mark(edge_hash, v1, v2)) edge_mark |= R_EDGE_V1V2;
|
||||
if(has_freestyle_edge_mark(edge_hash, v2, v3)) edge_mark |= R_EDGE_V2V3;
|
||||
if (has_freestyle_edge_mark(edge_hash, v1, v2)) edge_mark |= R_EDGE_V1V2;
|
||||
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 {
|
||||
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;
|
||||
if (has_freestyle_edge_mark(edge_hash, v3, v1)) edge_mark |= R_EDGE_V3V1;
|
||||
}
|
||||
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;
|
||||
}
|
||||
vlr->freestyle_edge_mark= edge_mark;
|
||||
}
|
||||
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
|
||||
|
|
|
@ -51,7 +51,7 @@ def test_load_addons():
|
|||
addon_utils.enable(mod_name)
|
||||
if mod_name not in addons:
|
||||
addons_fail.append(mod_name)
|
||||
|
||||
|
||||
if addons_fail:
|
||||
print("addons failed to load (%d):" % len(addons_fail))
|
||||
for mod_name in addons_fail:
|
||||
|
@ -94,7 +94,7 @@ def reload_addons(do_reload=True, do_reverse=True):
|
|||
def main():
|
||||
# first load addons, print a list of all addons that fail
|
||||
test_load_addons()
|
||||
|
||||
|
||||
reload_addons(do_reload=False, do_reverse=False)
|
||||
reload_addons(do_reload=False, do_reverse=True)
|
||||
reload_addons(do_reload=True, do_reverse=True)
|
||||
|
|
|
@ -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...")
|
||||
|
|
Loading…
Reference in New Issue