diff options
author | Campbell Barton <ideasman42@gmail.com> | 2013-04-07 05:38:03 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2013-04-07 05:38:03 +0400 |
commit | 63d523336f3876f6dca5affd66a190df88a87747 (patch) | |
tree | b4fb4677fe1138ae0476526d442a52b0804fa30b /source/blender | |
parent | 6774e727a28186258b6bfa443da0ef7aec280be3 (diff) |
freestyle lineset `tag` attribute was defined but not used, also some code cleanup.
Diffstat (limited to 'source/blender')
-rw-r--r-- | source/blender/compositor/operations/COM_MixHueOperation.cpp | 2 | ||||
-rw-r--r-- | source/blender/editors/mesh/editmesh_tools.c | 8 | ||||
-rw-r--r-- | source/blender/editors/render/render_shading.c | 2 | ||||
-rw-r--r-- | source/blender/editors/sculpt_paint/paint_ops.c | 2 | ||||
-rw-r--r-- | source/blender/makesrna/intern/rna_main_api.c | 4 | ||||
-rw-r--r-- | source/blender/python/bmesh/bmesh_py_ops.c | 2 | ||||
-rw-r--r-- | source/blender/render/intern/source/convertblender.c | 21 |
7 files changed, 25 insertions, 16 deletions
diff --git a/source/blender/compositor/operations/COM_MixHueOperation.cpp b/source/blender/compositor/operations/COM_MixHueOperation.cpp index 8f898cf8ecf..12cd16bb73b 100644 --- a/source/blender/compositor/operations/COM_MixHueOperation.cpp +++ b/source/blender/compositor/operations/COM_MixHueOperation.cpp @@ -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]; diff --git a/source/blender/editors/mesh/editmesh_tools.c b/source/blender/editors/mesh/editmesh_tools.c index 4f691efe950..f46721ddd62 100644 --- a/source/blender/editors/mesh/editmesh_tools.c +++ b/source/blender/editors/mesh/editmesh_tools.c @@ -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", ""); } diff --git a/source/blender/editors/render/render_shading.c b/source/blender/editors/render/render_shading.c index 5652d4c4b71..62b73b5b0c2 100644 --- a/source/blender/editors/render/render_shading.c +++ b/source/blender/editors/render/render_shading.c @@ -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) diff --git a/source/blender/editors/sculpt_paint/paint_ops.c b/source/blender/editors/sculpt_paint/paint_ops.c index d8f3f2827c5..c3b8cc0b275 100644 --- a/source/blender/editors/sculpt_paint/paint_ops.c +++ b/source/blender/editors/sculpt_paint/paint_ops.c @@ -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; diff --git a/source/blender/makesrna/intern/rna_main_api.c b/source/blender/makesrna/intern/rna_main_api.c index a2f9b554d3f..b9fb269638a 100644 --- a/source/blender/makesrna/intern/rna_main_api.c +++ b/source/blender/makesrna/intern/rna_main_api.c @@ -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"); diff --git a/source/blender/python/bmesh/bmesh_py_ops.c b/source/blender/python/bmesh/bmesh_py_ops.c index 234dd1e5fec..8826baf81b7 100644 --- a/source/blender/python/bmesh/bmesh_py_ops.c +++ b/source/blender/python/bmesh/bmesh_py_ops.c @@ -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); diff --git a/source/blender/render/intern/source/convertblender.c b/source/blender/render/intern/source/convertblender.c index aaaab319cc8..95bd967e56e 100644 --- a/source/blender/render/intern/source/convertblender.c +++ b/source/blender/render/intern/source/convertblender.c @@ -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 |