diff options
author | Campbell Barton <ideasman42@gmail.com> | 2019-04-22 02:19:45 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2019-04-22 12:48:16 +0300 |
commit | 620b960d3d8cfd90b9f0df6ba3671c33eccb8309 (patch) | |
tree | 64f69db4bf9d44f0a32d1c92b0714bf2dc98ff2d /source/blender/editors/render/render_shading.c | |
parent | bba60bb564cf5a16cfcac744d4ba82cf8eba3da9 (diff) |
Cleanup: style, use braces for editors
Diffstat (limited to 'source/blender/editors/render/render_shading.c')
-rw-r--r-- | source/blender/editors/render/render_shading.c | 60 |
1 files changed, 40 insertions, 20 deletions
diff --git a/source/blender/editors/render/render_shading.c b/source/blender/editors/render/render_shading.c index 70157abf2ef..3186f011c6a 100644 --- a/source/blender/editors/render/render_shading.c +++ b/source/blender/editors/render/render_shading.c @@ -131,8 +131,9 @@ static int material_slot_add_exec(bContext *C, wmOperator *UNUSED(op)) Main *bmain = CTX_data_main(C); Object *ob = ED_object_context(C); - if (!ob) + if (!ob) { return OPERATOR_CANCELLED; + } BKE_object_material_slot_add(bmain, ob); @@ -168,8 +169,9 @@ static int material_slot_remove_exec(bContext *C, wmOperator *op) { Object *ob = ED_object_context(C); - if (!ob) + if (!ob) { return OPERATOR_CANCELLED; + } /* Removing material slots in edit mode screws things up, see bug #21822.*/ if (ob == CTX_data_edit_object(C)) { @@ -366,10 +368,12 @@ static int material_slot_de_select(bContext *C, bool select) while (a--) { if (bp->hide == 0) { changed = true; - if (select) + if (select) { bp->f1 |= SELECT; - else + } + else { bp->f1 &= ~SELECT; + } } bp++; } @@ -435,13 +439,15 @@ static int material_slot_copy_exec(bContext *C, wmOperator *UNUSED(op)) Object *ob = ED_object_context(C); Material ***matar; - if (!ob || !(matar = give_matarar(ob))) + if (!ob || !(matar = give_matarar(ob))) { return OPERATOR_CANCELLED; + } CTX_DATA_BEGIN (C, Object *, ob_iter, selected_editable_objects) { if (ob != ob_iter && give_matarar(ob_iter)) { - if (ob->data != ob_iter->data) + if (ob->data != ob_iter->data) { assign_matarar(bmain, ob_iter, matar, ob->totcol); + } if (ob_iter->totcol == ob->totcol) { ob_iter->actcol = ob->actcol; @@ -1026,8 +1032,9 @@ static int render_view_remove_exec(bContext *C, wmOperator *UNUSED(op)) Scene *scene = CTX_data_scene(C); SceneRenderView *rv = BLI_findlink(&scene->r.views, scene->r.actview); - if (!BKE_scene_remove_render_view(scene, rv)) + if (!BKE_scene_remove_render_view(scene, rv)) { return OPERATOR_CANCELLED; + } WM_event_add_notifier(C, NC_SCENE | ND_RENDER_OPTIONS, scene); @@ -1544,14 +1551,18 @@ void SCENE_OT_freestyle_geometry_modifier_add(wmOperatorType *ot) static int freestyle_get_modifier_type(PointerRNA *ptr) { - if (RNA_struct_is_a(ptr->type, &RNA_LineStyleColorModifier)) + if (RNA_struct_is_a(ptr->type, &RNA_LineStyleColorModifier)) { return LS_MODIFIER_TYPE_COLOR; - else if (RNA_struct_is_a(ptr->type, &RNA_LineStyleAlphaModifier)) + } + else if (RNA_struct_is_a(ptr->type, &RNA_LineStyleAlphaModifier)) { return LS_MODIFIER_TYPE_ALPHA; - else if (RNA_struct_is_a(ptr->type, &RNA_LineStyleThicknessModifier)) + } + else if (RNA_struct_is_a(ptr->type, &RNA_LineStyleThicknessModifier)) { return LS_MODIFIER_TYPE_THICKNESS; - else if (RNA_struct_is_a(ptr->type, &RNA_LineStyleGeometryModifier)) + } + else if (RNA_struct_is_a(ptr->type, &RNA_LineStyleGeometryModifier)) { return LS_MODIFIER_TYPE_GEOMETRY; + } return -1; } @@ -1831,8 +1842,9 @@ static int copy_material_exec(bContext *C, wmOperator *UNUSED(op)) { Material *ma = CTX_data_pointer_get_type(C, "material", &RNA_Material).data; - if (ma == NULL) + if (ma == NULL) { return OPERATOR_CANCELLED; + } copy_matcopybuf(CTX_data_main(C), ma); @@ -1858,8 +1870,9 @@ static int paste_material_exec(bContext *C, wmOperator *UNUSED(op)) { Material *ma = CTX_data_pointer_get_type(C, "material", &RNA_Material).data; - if (ma == NULL) + if (ma == NULL) { return OPERATOR_CANCELLED; + } paste_matcopybuf(CTX_data_main(C), ma); @@ -1919,8 +1932,9 @@ static void paste_mtex_copybuf(ID *id) { MTex **mtex = NULL; - if (mtexcopied == 0 || mtexcopybuf.tex == NULL) + if (mtexcopied == 0 || mtexcopybuf.tex == NULL) { return; + } switch (GS(id->name)) { case ID_PA: @@ -1999,19 +2013,25 @@ static int paste_mtex_exec(bContext *C, wmOperator *UNUSED(op)) FreestyleLineStyle *linestyle = CTX_data_pointer_get_type(C, "line_style", &RNA_FreestyleLineStyle).data; - if (ma) + if (ma) { id = &ma->id; - else if (la) + } + else if (la) { id = &la->id; - else if (wo) + } + else if (wo) { id = &wo->id; - else if (psys) + } + else if (psys) { id = &psys->part->id; - else if (linestyle) + } + else if (linestyle) { id = &linestyle->id; + } - if (id == NULL) + if (id == NULL) { return OPERATOR_CANCELLED; + } } paste_mtex_copybuf(id); |