diff options
author | Ove Murberg Henriksen <sorayasilvermoon@hotmail.com> | 2012-05-21 19:14:32 +0400 |
---|---|---|
committer | Ove Murberg Henriksen <sorayasilvermoon@hotmail.com> | 2012-05-21 19:14:32 +0400 |
commit | 7d1cfe4daea8cc0f5004e8afe8307fe58bf7a2e0 (patch) | |
tree | bd94735918d05470f3b2bd2cba0f1509a55bc914 /source/blender/editors | |
parent | 74a889d8b1a8e9f83214fa885f530b7b167b4a32 (diff) | |
parent | c55bb6eae27142a34446440ef3433d5bd7597598 (diff) |
svn merge ^/trunk/blender -r46750:HEAD
Diffstat (limited to 'source/blender/editors')
91 files changed, 603 insertions, 492 deletions
diff --git a/source/blender/editors/animation/anim_channels_defines.c b/source/blender/editors/animation/anim_channels_defines.c index 2e683d4d57b..dd9a0600725 100644 --- a/source/blender/editors/animation/anim_channels_defines.c +++ b/source/blender/editors/animation/anim_channels_defines.c @@ -2968,7 +2968,7 @@ static void achannel_setting_slider_cb(bContext *C, void *id_poin, void *fcu_poi Scene *scene = CTX_data_scene(C); PointerRNA id_ptr, ptr; PropertyRNA *prop; - short flag = 0, done = 0; + short flag = 0, done = FALSE; float cfra; /* get current frame */ @@ -3006,7 +3006,7 @@ static void achannel_setting_slider_shapekey_cb(bContext *C, void *key_poin, voi Scene *scene = CTX_data_scene(C); PointerRNA id_ptr, ptr; PropertyRNA *prop; - short flag = 0, done = 0; + short flag = 0, done = FALSE; float cfra; /* get current frame */ diff --git a/source/blender/editors/animation/anim_channels_edit.c b/source/blender/editors/animation/anim_channels_edit.c index df8c1d29079..159c4681951 100644 --- a/source/blender/editors/animation/anim_channels_edit.c +++ b/source/blender/editors/animation/anim_channels_edit.c @@ -840,7 +840,7 @@ static short rearrange_animchannel_islands(ListBase *list, AnimChanRearrangeFp r { ListBase islands = {NULL, NULL}; Link *channel, *chanNext = NULL; - short done = 0; + short done = FALSE; /* don't waste effort on an empty list */ if (list->first == NULL) @@ -866,7 +866,7 @@ static short rearrange_animchannel_islands(ListBase *list, AnimChanRearrangeFp r /* perform rearranging */ if (rearrange_func(&islands, island)) { island->flag |= REORDER_ISLAND_MOVED; - done = 1; + done = TRUE; } } } diff --git a/source/blender/editors/animation/anim_draw.c b/source/blender/editors/animation/anim_draw.c index 0514700e120..ddc4f4d943c 100644 --- a/source/blender/editors/animation/anim_draw.c +++ b/source/blender/editors/animation/anim_draw.c @@ -191,7 +191,7 @@ static void draw_cfra_number(Scene *scene, View2D *v2d, float cfra, short time) */ if (time) ANIM_timecode_string_from_frame(&numstr[4], scene, 0, time, FRA2TIME(cfra)); - else + else ANIM_timecode_string_from_frame(&numstr[4], scene, 1, time, cfra); slen = (short)UI_GetStringWidth(numstr) - 1; diff --git a/source/blender/editors/animation/drivers.c b/source/blender/editors/animation/drivers.c index 0cc92394a40..416df6bccba 100644 --- a/source/blender/editors/animation/drivers.c +++ b/source/blender/editors/animation/drivers.c @@ -141,7 +141,7 @@ short ANIM_add_driver(ReportList *reports, ID *id, const char rna_path[], int ar PropertyRNA *prop; FCurve *fcu; int array_index_max; - int done = 0; + int done = FALSE; /* validate pointer first - exit if failure */ RNA_id_pointer_create(id, &id_ptr); diff --git a/source/blender/editors/armature/editarmature.c b/source/blender/editors/armature/editarmature.c index 7ce2988b067..4ccdc610cae 100644 --- a/source/blender/editors/armature/editarmature.c +++ b/source/blender/editors/armature/editarmature.c @@ -276,7 +276,7 @@ EditBone *make_boneList(ListBase *edbo, ListBase *bones, EditBone *parent, Bone else { /* if the bone is not selected, but connected to its parent * copy the parents tip selection state */ - if (eBone->parent && (eBone->flag & BONE_CONNECTED)) { + if (eBone->parent && (eBone->flag & BONE_CONNECTED)) { /* selecting with the mouse gives this behavior */ if (eBone->parent->flag & BONE_TIPSEL) { eBone->flag |= BONE_ROOTSEL; @@ -3325,9 +3325,9 @@ static int armature_extrude_exec(bContext *C, wmOperator *op) for (ebone = arm->edbo->first; ((ebone) && (ebone != first)); ebone = ebone->next) { if (EBONE_VISIBLE(arm, ebone)) { /* we extrude per definition the tip */ - do_extrude = 0; + do_extrude = FALSE; if (ebone->flag & (BONE_TIPSEL | BONE_SELECTED)) - do_extrude = 1; + do_extrude = TRUE; else if (ebone->flag & BONE_ROOTSEL) { /* but, a bone with parent deselected we do the root... */ if (ebone->parent && (ebone->parent->flag & BONE_TIPSEL)) ; @@ -3361,7 +3361,7 @@ static int armature_extrude_exec(bContext *C, wmOperator *op) totbone++; newbone = MEM_callocN(sizeof(EditBone), "extrudebone"); - if (do_extrude == 1) { + if (do_extrude == TRUE) { copy_v3_v3(newbone->head, ebone->tail); copy_v3_v3(newbone->tail, newbone->head); newbone->parent = ebone; @@ -3653,7 +3653,7 @@ static int armature_switch_direction_exec(bContext *C, wmOperator *UNUSED(op)) ebo->parent = child; if ((child) && equals_v3v3(ebo->head, child->tail)) ebo->flag |= BONE_CONNECTED; - else + else ebo->flag &= ~BONE_CONNECTED; /* get next bones diff --git a/source/blender/editors/armature/editarmature_retarget.c b/source/blender/editors/armature/editarmature_retarget.c index 80f8c61694c..d90bd96a6f1 100644 --- a/source/blender/editors/armature/editarmature_retarget.c +++ b/source/blender/editors/armature/editarmature_retarget.c @@ -733,7 +733,7 @@ static void RIG_reconnectControlBones(RigGraph *rg) /* DO SOME MAGIC HERE */ for (pchan = rg->ob->pose->chanbase.first; pchan; pchan = pchan->next) { - for (con = pchan->constraints.first; con; con = con->next) { + for (con = pchan->constraints.first; con; con = con->next) { bConstraintTypeInfo *cti = constraint_get_typeinfo(con); ListBase targets = {NULL, NULL}; bConstraintTarget *ct; @@ -858,7 +858,7 @@ static void RIG_reconnectControlBones(RigGraph *rg) /* DO SOME MAGIC HERE */ for (pchan = rg->ob->pose->chanbase.first; pchan; pchan = pchan->next) { - for (con = pchan->constraints.first; con; con = con->next) { + for (con = pchan->constraints.first; con; con = con->next) { bConstraintTypeInfo *cti = constraint_get_typeinfo(con); ListBase targets = {NULL, NULL}; bConstraintTarget *ct; diff --git a/source/blender/editors/armature/meshlaplacian.c b/source/blender/editors/armature/meshlaplacian.c index b975d156868..ab96656406e 100644 --- a/source/blender/editors/armature/meshlaplacian.c +++ b/source/blender/editors/armature/meshlaplacian.c @@ -1393,7 +1393,8 @@ static void meshdeform_bind_floodfill(MeshDeformBind *mdb) if (b != -1) { if (tag[b] == MESHDEFORM_TAG_UNTYPED || - (tag[b] == MESHDEFORM_TAG_BOUNDARY && !mdb->boundisect[a][i - 1])) { + (tag[b] == MESHDEFORM_TAG_BOUNDARY && !mdb->boundisect[a][i - 1])) + { tag[b] = MESHDEFORM_TAG_EXTERIOR; stack[stacksize++] = b; } diff --git a/source/blender/editors/armature/poseobject.c b/source/blender/editors/armature/poseobject.c index e9c960c4080..df970171a54 100644 --- a/source/blender/editors/armature/poseobject.c +++ b/source/blender/editors/armature/poseobject.c @@ -1136,7 +1136,7 @@ static bPoseChannel *pose_bone_do_paste(Object *ob, bPoseChannel *chan, short se /* quat/euler to axis angle */ if (chan->rotmode > 0) eulO_to_axis_angle(pchan->rotAxis, &pchan->rotAngle, chan->eul, chan->rotmode); - else + else quat_to_axis_angle(pchan->rotAxis, &pchan->rotAngle, chan->quat); } else { @@ -1451,7 +1451,7 @@ static int pose_group_assign_exec(bContext *C, wmOperator *op) ScrArea *sa = CTX_wm_area(C); Object *ob; bPose *pose; - short done = 0; + short done = FALSE; /* since this call may also be used from the buttons window, we need to check for where to get the object */ if (sa->spacetype == SPACE_BUTS) @@ -1476,7 +1476,7 @@ static int pose_group_assign_exec(bContext *C, wmOperator *op) CTX_DATA_BEGIN (C, bPoseChannel *, pchan, selected_pose_bones) { pchan->agrp_index = pose->active_group; - done = 1; + done = TRUE; } CTX_DATA_END; @@ -1514,7 +1514,7 @@ static int pose_group_unassign_exec(bContext *C, wmOperator *UNUSED(op)) { ScrArea *sa = CTX_wm_area(C); Object *ob; - short done = 0; + short done = FALSE; /* since this call may also be used from the buttons window, we need to check for where to get the object */ if (sa->spacetype == SPACE_BUTS) @@ -1531,7 +1531,7 @@ static int pose_group_unassign_exec(bContext *C, wmOperator *UNUSED(op)) { if (pchan->agrp_index) { pchan->agrp_index = 0; - done = 1; + done = TRUE; } } CTX_DATA_END; diff --git a/source/blender/editors/armature/reeb.c b/source/blender/editors/armature/reeb.c index 316c4699c0b..a629312e732 100644 --- a/source/blender/editors/armature/reeb.c +++ b/source/blender/editors/armature/reeb.c @@ -1818,7 +1818,7 @@ int filterSmartReebGraph(ReebGraph *UNUSED(rg), float UNUSED(threshold)) static void filterGraph(ReebGraph *rg, short options, float threshold_internal, float threshold_external) { - int done = 1; + int done = TRUE; calculateGraphLength(rg); @@ -1833,7 +1833,7 @@ static void filterGraph(ReebGraph *rg, short options, float threshold_internal, if (threshold_internal > 0 || threshold_external > 0) { /* filter until there's nothing more to do */ while (done == 1) { - done = 0; /* no work done yet */ + done = FALSE; /* no work done yet */ done = filterInternalExternalReebGraph(rg, threshold_internal, threshold_external); } @@ -1860,7 +1860,7 @@ static void finalizeGraph(ReebGraph *rg, char passes, char method) sortArcs(rg); - for (i = 0; i < passes; i++) { + for (i = 0; i < passes; i++) { postprocessGraph(rg, method); } diff --git a/source/blender/editors/curve/editcurve.c b/source/blender/editors/curve/editcurve.c index 7afba049232..aa29100ccbe 100644 --- a/source/blender/editors/curve/editcurve.c +++ b/source/blender/editors/curve/editcurve.c @@ -270,7 +270,7 @@ void printknots(Object *obedit) int a, num; for (nu = editnurb->first; nu; nu = nu->next) { - if (isNurbsel(nu) && nu->type == CU_NURBS) { + if (isNurbsel(nu) && nu->type == CU_NURBS) { if (nu->knotsu) { num = KNOTSU(nu); for (a = 0; a < num; a++) printf("knotu %d: %f\n", a, nu->knotsu[a]); diff --git a/source/blender/editors/gpencil/gpencil_paint.c b/source/blender/editors/gpencil/gpencil_paint.c index 5c23aba9024..6ffe3f1feeb 100644 --- a/source/blender/editors/gpencil/gpencil_paint.c +++ b/source/blender/editors/gpencil/gpencil_paint.c @@ -214,7 +214,7 @@ static void gp_get_3d_reference(tGPsdata *p, float vec[3]) sub_v3_v3v3(vec, fp, ob->loc); } else -#endif +#endif { /* use 3D-cursor */ copy_v3_v3(vec, fp); diff --git a/source/blender/editors/interface/interface_draw.c b/source/blender/editors/interface/interface_draw.c index 2f9e763a7d0..e535990e7e9 100644 --- a/source/blender/editors/interface/interface_draw.c +++ b/source/blender/editors/interface/interface_draw.c @@ -79,7 +79,7 @@ int uiGetRoundBox(void) void uiDrawBox(int mode, float minx, float miny, float maxx, float maxy, float rad) { float vec[7][2] = {{0.195, 0.02}, {0.383, 0.067}, {0.55, 0.169}, {0.707, 0.293}, - {0.831, 0.45}, {0.924, 0.617}, {0.98, 0.805}}; + {0.831, 0.45}, {0.924, 0.617}, {0.98, 0.805}}; int a; /* mult */ @@ -147,7 +147,7 @@ static void round_box_shade_col(const float col1[3], float const col2[3], const void uiDrawBoxShade(int mode, float minx, float miny, float maxx, float maxy, float rad, float shadetop, float shadedown) { float vec[7][2] = {{0.195, 0.02}, {0.383, 0.067}, {0.55, 0.169}, {0.707, 0.293}, - {0.831, 0.45}, {0.924, 0.617}, {0.98, 0.805}}; + {0.831, 0.45}, {0.924, 0.617}, {0.98, 0.805}}; const float div = maxy - miny; const float idiv = 1.0f / div; float coltop[3], coldown[3], color[4]; @@ -256,7 +256,7 @@ void uiDrawBoxVerticalShade(int mode, float minx, float miny, float maxx, float float rad, float shadeLeft, float shadeRight) { float vec[7][2] = {{0.195, 0.02}, {0.383, 0.067}, {0.55, 0.169}, {0.707, 0.293}, - {0.831, 0.45}, {0.924, 0.617}, {0.98, 0.805}}; + {0.831, 0.45}, {0.924, 0.617}, {0.98, 0.805}}; const float div = maxx - minx; const float idiv = 1.0f / div; float colLeft[3], colRight[3], color[4]; diff --git a/source/blender/editors/interface/interface_handlers.c b/source/blender/editors/interface/interface_handlers.c index 8b0c3ecfcf3..428ddb3059f 100644 --- a/source/blender/editors/interface/interface_handlers.c +++ b/source/blender/editors/interface/interface_handlers.c @@ -50,6 +50,8 @@ #include "BLI_utildefines.h" #include "BLI_string_cursor_utf8.h" +#include "BLF_translation.h" + #include "PIL_time.h" #include "BKE_colortools.h" @@ -1307,7 +1309,7 @@ static void ui_textedit_set_cursor_pos(uiBut *but, uiHandleButtonData *data, sho /* check if position is found */ if (cdist < x) { - /* check is previous location was infact closer */ + /* check is previous location was in fact closer */ if (((float)x - cdist) > (cdist_prev - (float)x)) { but->pos = pos_prev; } @@ -4401,10 +4403,10 @@ static int ui_but_menu(bContext *C, uiBut *but) if (but->rnaprop) name = RNA_property_ui_name(but->rnaprop); - else if (but->optype) - name = but->optype->name; + else if (but->optype && but->optype->srna) + name = RNA_struct_ui_name(but->optype->srna); else - name = "<needs_name>"; // XXX - should never happen. + name = IFACE_("<needs_name>"); // XXX - should never happen. pup = uiPupMenuBegin(C, name, ICON_NONE); layout = uiPupMenuLayout(pup); @@ -4424,14 +4426,20 @@ static int ui_but_menu(bContext *C, uiBut *but) if (but->flag & UI_BUT_ANIMATED_KEY) { /* replace/delete keyfraemes */ if (length) { - uiItemBooleanO(layout, "Replace Keyframes", ICON_NONE, "ANIM_OT_keyframe_insert_button", "all", 1); - uiItemBooleanO(layout, "Replace Single Keyframe", ICON_NONE, "ANIM_OT_keyframe_insert_button", "all", 0); - uiItemBooleanO(layout, "Delete Keyframes", ICON_NONE, "ANIM_OT_keyframe_delete_button", "all", 1); - uiItemBooleanO(layout, "Delete Single Keyframe", ICON_NONE, "ANIM_OT_keyframe_delete_button", "all", 0); + uiItemBooleanO(layout, CTX_IFACE_(BLF_I18NCONTEXT_OPERATOR_DEFAULT, "Replace Keyframes"), + ICON_NONE, "ANIM_OT_keyframe_insert_button", "all", 1); + uiItemBooleanO(layout, CTX_IFACE_(BLF_I18NCONTEXT_OPERATOR_DEFAULT, "Replace Single Keyframe"), + ICON_NONE, "ANIM_OT_keyframe_insert_button", "all", 0); + uiItemBooleanO(layout, CTX_IFACE_(BLF_I18NCONTEXT_OPERATOR_DEFAULT, "Delete Keyframes"), + ICON_NONE, "ANIM_OT_keyframe_delete_button", "all", 1); + uiItemBooleanO(layout, CTX_IFACE_(BLF_I18NCONTEXT_OPERATOR_DEFAULT, "Delete Single Keyframe"), + ICON_NONE, "ANIM_OT_keyframe_delete_button", "all", 0); } else { - uiItemBooleanO(layout, "Replace Keyframe", ICON_NONE, "ANIM_OT_keyframe_insert_button", "all", 0); - uiItemBooleanO(layout, "Delete Keyframe", ICON_NONE, "ANIM_OT_keyframe_delete_button", "all", 0); + uiItemBooleanO(layout, CTX_IFACE_(BLF_I18NCONTEXT_OPERATOR_DEFAULT, "Replace Keyframe"), + ICON_NONE, "ANIM_OT_keyframe_insert_button", "all", 0); + uiItemBooleanO(layout, CTX_IFACE_(BLF_I18NCONTEXT_OPERATOR_DEFAULT, "Delete Keyframe"), + ICON_NONE, "ANIM_OT_keyframe_delete_button", "all", 0); } /* keyframe settings */ @@ -4442,11 +4450,14 @@ static int ui_but_menu(bContext *C, uiBut *but) else if (but->flag & UI_BUT_DRIVEN) ; else if (is_anim) { if (length) { - uiItemBooleanO(layout, "Insert Keyframes", ICON_NONE, "ANIM_OT_keyframe_insert_button", "all", 1); - uiItemBooleanO(layout, "Insert Single Keyframe", ICON_NONE, "ANIM_OT_keyframe_insert_button", "all", 0); + uiItemBooleanO(layout, CTX_IFACE_(BLF_I18NCONTEXT_OPERATOR_DEFAULT, "Insert Keyframes"), + ICON_NONE, "ANIM_OT_keyframe_insert_button", "all", 1); + uiItemBooleanO(layout, CTX_IFACE_(BLF_I18NCONTEXT_OPERATOR_DEFAULT, "Insert Single Keyframe"), + ICON_NONE, "ANIM_OT_keyframe_insert_button", "all", 0); } else - uiItemBooleanO(layout, "Insert Keyframe", ICON_NONE, "ANIM_OT_keyframe_insert_button", "all", 0); + uiItemBooleanO(layout, CTX_IFACE_(BLF_I18NCONTEXT_OPERATOR_DEFAULT, "Insert Keyframe"), + ICON_NONE, "ANIM_OT_keyframe_insert_button", "all", 0); } /* Drivers */ @@ -4454,29 +4465,38 @@ static int ui_but_menu(bContext *C, uiBut *but) uiItemS(layout); if (length) { - uiItemBooleanO(layout, "Delete Drivers", ICON_NONE, "ANIM_OT_driver_button_remove", "all", 1); - uiItemBooleanO(layout, "Delete Single Driver", ICON_NONE, "ANIM_OT_driver_button_remove", "all", 0); + uiItemBooleanO(layout, CTX_IFACE_(BLF_I18NCONTEXT_OPERATOR_DEFAULT, "Delete Drivers"), + ICON_NONE, "ANIM_OT_driver_button_remove", "all", 1); + uiItemBooleanO(layout, CTX_IFACE_(BLF_I18NCONTEXT_OPERATOR_DEFAULT, "Delete Single Driver"), + ICON_NONE, "ANIM_OT_driver_button_remove", "all", 0); } else - uiItemBooleanO(layout, "Delete Driver", ICON_NONE, "ANIM_OT_driver_button_remove", "all", 0); + uiItemBooleanO(layout, CTX_IFACE_(BLF_I18NCONTEXT_OPERATOR_DEFAULT, "Delete Driver"), + ICON_NONE, "ANIM_OT_driver_button_remove", "all", 0); - uiItemO(layout, "Copy Driver", ICON_NONE, "ANIM_OT_copy_driver_button"); + uiItemO(layout, CTX_IFACE_(BLF_I18NCONTEXT_OPERATOR_DEFAULT, "Copy Driver"), + ICON_NONE, "ANIM_OT_copy_driver_button"); if (ANIM_driver_can_paste()) - uiItemO(layout, "Paste Driver", ICON_NONE, "ANIM_OT_paste_driver_button"); + uiItemO(layout, CTX_IFACE_(BLF_I18NCONTEXT_OPERATOR_DEFAULT, "Paste Driver"), + ICON_NONE, "ANIM_OT_paste_driver_button"); } else if (but->flag & (UI_BUT_ANIMATED_KEY | UI_BUT_ANIMATED)) ; else if (is_anim) { uiItemS(layout); if (length) { - uiItemBooleanO(layout, "Add Drivers", ICON_NONE, "ANIM_OT_driver_button_add", "all", 1); - uiItemBooleanO(layout, "Add Single Driver", ICON_NONE, "ANIM_OT_driver_button_add", "all", 0); + uiItemBooleanO(layout, CTX_IFACE_(BLF_I18NCONTEXT_OPERATOR_DEFAULT, "Add Drivers"), + ICON_NONE, "ANIM_OT_driver_button_add", "all", 1); + uiItemBooleanO(layout, CTX_IFACE_(BLF_I18NCONTEXT_OPERATOR_DEFAULT, "Add Single Driver"), + ICON_NONE, "ANIM_OT_driver_button_add", "all", 0); } else - uiItemBooleanO(layout, "Add Driver", ICON_NONE, "ANIM_OT_driver_button_add", "all", 0); + uiItemBooleanO(layout, CTX_IFACE_(BLF_I18NCONTEXT_OPERATOR_DEFAULT, "Add Driver"), + ICON_NONE, "ANIM_OT_driver_button_add", "all", 0); if (ANIM_driver_can_paste()) - uiItemO(layout, "Paste Driver", ICON_NONE, "ANIM_OT_paste_driver_button"); + uiItemO(layout, CTX_IFACE_(BLF_I18NCONTEXT_OPERATOR_DEFAULT, "Paste Driver"), + ICON_NONE, "ANIM_OT_paste_driver_button"); } /* Keying Sets */ @@ -4485,13 +4505,18 @@ static int ui_but_menu(bContext *C, uiBut *but) uiItemS(layout); if (length) { - uiItemBooleanO(layout, "Add All to Keying Set", ICON_NONE, "ANIM_OT_keyingset_button_add", "all", 1); - uiItemBooleanO(layout, "Add Single to Keying Set", ICON_NONE, "ANIM_OT_keyingset_button_add", "all", 0); - uiItemO(layout, "Remove from Keying Set", ICON_NONE, "ANIM_OT_keyingset_button_remove"); + uiItemBooleanO(layout, CTX_IFACE_(BLF_I18NCONTEXT_OPERATOR_DEFAULT, "Add All to Keying Set"), + ICON_NONE, "ANIM_OT_keyingset_button_add", "all", 1); + uiItemBooleanO(layout, CTX_IFACE_(BLF_I18NCONTEXT_OPERATOR_DEFAULT, "Add Single to Keying Set"), + ICON_NONE, "ANIM_OT_keyingset_button_add", "all", 0); + uiItemO(layout, CTX_IFACE_(BLF_I18NCONTEXT_OPERATOR_DEFAULT, "Remove from Keying Set"), + ICON_NONE, "ANIM_OT_keyingset_button_remove"); } else { - uiItemBooleanO(layout, "Add to Keying Set", ICON_NONE, "ANIM_OT_keyingset_button_add", "all", 0); - uiItemO(layout, "Remove from Keying Set", ICON_NONE, "ANIM_OT_keyingset_button_remove"); + uiItemBooleanO(layout, CTX_IFACE_(BLF_I18NCONTEXT_OPERATOR_DEFAULT, "Add to Keying Set"), + ICON_NONE, "ANIM_OT_keyingset_button_add", "all", 0); + uiItemO(layout, CTX_IFACE_(BLF_I18NCONTEXT_OPERATOR_DEFAULT, "Remove from Keying Set"), + ICON_NONE, "ANIM_OT_keyingset_button_remove"); } } @@ -4503,14 +4528,19 @@ static int ui_but_menu(bContext *C, uiBut *but) //Paste Property Value if (length) { - uiItemBooleanO(layout, "Reset All to Default Values", ICON_NONE, "UI_OT_reset_default_button", "all", 1); - uiItemBooleanO(layout, "Reset Single to Default Value", ICON_NONE, "UI_OT_reset_default_button", "all", 0); + uiItemBooleanO(layout, CTX_IFACE_(BLF_I18NCONTEXT_OPERATOR_DEFAULT, "Reset All to Default Values"), + ICON_NONE, "UI_OT_reset_default_button", "all", 1); + uiItemBooleanO(layout, CTX_IFACE_(BLF_I18NCONTEXT_OPERATOR_DEFAULT, "Reset Single to Default Value"), + ICON_NONE, "UI_OT_reset_default_button", "all", 0); } else - uiItemO(layout, "Reset to Default Value", ICON_NONE, "UI_OT_reset_default_button"); + uiItemO(layout, CTX_IFACE_(BLF_I18NCONTEXT_OPERATOR_DEFAULT, "Reset to Default Value"), + ICON_NONE, "UI_OT_reset_default_button"); - uiItemO(layout, "Copy Data Path", ICON_NONE, "UI_OT_copy_data_path_button"); - uiItemO(layout, "Copy To Selected", ICON_NONE, "UI_OT_copy_to_selected_button"); + uiItemO(layout, CTX_IFACE_(BLF_I18NCONTEXT_OPERATOR_DEFAULT, "Copy Data Path"), + ICON_NONE, "UI_OT_copy_data_path_button"); + uiItemO(layout, CTX_IFACE_(BLF_I18NCONTEXT_OPERATOR_DEFAULT, "Copy To Selected"), + ICON_NONE, "UI_OT_copy_to_selected_button"); uiItemS(layout); } @@ -4534,15 +4564,18 @@ static int ui_but_menu(bContext *C, uiBut *but) // would rather use a block but, but gets weirdly positioned... //uiDefBlockBut(block, menu_change_shortcut, but, "Change Shortcut", 0, 0, uiLayoutGetWidth(layout), UI_UNIT_Y, ""); - but2 = uiDefIconTextBut(block, BUT, 0, 0, "Change Shortcut", 0, 0, w, UI_UNIT_Y, NULL, 0, 0, 0, 0, ""); + but2 = uiDefIconTextBut(block, BUT, 0, 0, CTX_IFACE_(BLF_I18NCONTEXT_OPERATOR_DEFAULT, "Change Shortcut"), + 0, 0, w, UI_UNIT_Y, NULL, 0, 0, 0, 0, ""); uiButSetFunc(but2, popup_change_shortcut_func, but, NULL); - but2 = uiDefIconTextBut(block, BUT, 0, 0, "Remove Shortcut", 0, 0, w, UI_UNIT_Y, NULL, 0, 0, 0, 0, ""); + but2 = uiDefIconTextBut(block, BUT, 0, 0, CTX_IFACE_(BLF_I18NCONTEXT_OPERATOR_DEFAULT, "Remove Shortcut"), + 0, 0, w, UI_UNIT_Y, NULL, 0, 0, 0, 0, ""); uiButSetFunc(but2, remove_shortcut_func, but, NULL); } /* only show 'add' if there's a suitable key map for it to go in */ else if (WM_keymap_guess_opname(C, but->optype->idname)) { - but2 = uiDefIconTextBut(block, BUT, 0, 0, "Add Shortcut", 0, 0, w, UI_UNIT_Y, NULL, 0, 0, 0, 0, ""); + but2 = uiDefIconTextBut(block, BUT, 0, 0, CTX_IFACE_(BLF_I18NCONTEXT_OPERATOR_DEFAULT, "Add Shortcut"), + 0, 0, w, UI_UNIT_Y, NULL, 0, 0, 0, 0, ""); uiButSetFunc(but2, popup_add_shortcut_func, but, NULL); } @@ -4560,7 +4593,8 @@ static int ui_but_menu(bContext *C, uiBut *but) WM_operator_properties_create(&ptr_props, "WM_OT_doc_view"); RNA_string_set(&ptr_props, "doc_id", buf); - uiItemFullO(layout, "WM_OT_doc_view", "Python Documentation", ICON_NONE, ptr_props.data, WM_OP_EXEC_DEFAULT, 0); + uiItemFullO(layout, "WM_OT_doc_view", CTX_IFACE_(BLF_I18NCONTEXT_OPERATOR_DEFAULT, "Python Documentation"), + ICON_NONE, ptr_props.data, WM_OP_EXEC_DEFAULT, 0); /* XXX inactive option, not for public! */ #if 0 @@ -4576,19 +4610,22 @@ static int ui_but_menu(bContext *C, uiBut *but) WM_operator_properties_create(&ptr_props, "WM_OT_doc_view"); RNA_string_set(&ptr_props, "doc_id", buf); - uiItemFullO(layout, "WM_OT_doc_view", "Python Documentation", ICON_NONE, ptr_props.data, WM_OP_EXEC_DEFAULT, 0); + uiItemFullO(layout, "WM_OT_doc_view", CTX_IFACE_(BLF_I18NCONTEXT_OPERATOR_DEFAULT, "Python Documentation"), + ICON_NONE, ptr_props.data, WM_OP_EXEC_DEFAULT, 0); WM_operator_properties_create(&ptr_props, "WM_OT_doc_edit"); RNA_string_set(&ptr_props, "doc_id", buf); RNA_string_set(&ptr_props, "doc_new", but->optype->description); - uiItemFullO(layout, "WM_OT_doc_edit", "Submit Description", ICON_NONE, ptr_props.data, WM_OP_INVOKE_DEFAULT, 0); + uiItemFullO(layout, "WM_OT_doc_edit", CTX_IFACE_(BLF_I18NCONTEXT_OPERATOR_DEFAULT, "Submit Description"), + ICON_NONE, ptr_props.data, WM_OP_INVOKE_DEFAULT, 0); } } /* perhaps we should move this into (G.debug & G_DEBUG) - campbell */ - uiItemFullO(layout, "UI_OT_editsource", "Edit Source", ICON_NONE, NULL, WM_OP_INVOKE_DEFAULT, 0); + uiItemFullO(layout, "UI_OT_editsource", CTX_IFACE_(BLF_I18NCONTEXT_OPERATOR_DEFAULT, "Edit Source"), + ICON_NONE, NULL, WM_OP_INVOKE_DEFAULT, 0); uiPupMenuEnd(C, pup); @@ -5185,7 +5222,7 @@ static void button_activate_init(bContext *C, ARegion *ar, uiBut *but, uiButtonA but->block->auto_open = FALSE; if (type == BUTTON_ACTIVATE_OVER) { - data->used_mouse = 1; + data->used_mouse = TRUE; } button_activate_state(C, but, BUTTON_STATE_HIGHLIGHT); @@ -5714,7 +5751,8 @@ static int ui_handle_list_event(bContext *C, wmEvent *event, ARegion *ar) Panel *pa = but->block->panel; if (ELEM(event->type, UPARROWKEY, DOWNARROWKEY) || - ((ELEM(event->type, WHEELUPMOUSE, WHEELDOWNMOUSE) && event->alt))) { + ((ELEM(event->type, WHEELUPMOUSE, WHEELDOWNMOUSE) && event->alt))) + { /* activate up/down the list */ value = RNA_property_int_get(&but->rnapoin, but->rnaprop); @@ -5808,7 +5846,7 @@ static void ui_handle_button_return_submenu(bContext *C, wmEvent *event, uiBut * else { if (ISKEYBOARD(event->type)) { /* keyboard menu hierarchy navigation, going back to previous level */ - but->active->used_mouse = 0; + but->active->used_mouse = FALSE; button_activate_state(C, but, BUTTON_STATE_HIGHLIGHT); } else { diff --git a/source/blender/editors/interface/interface_layout.c b/source/blender/editors/interface/interface_layout.c index 958ee9f5420..4c2d86de502 100644 --- a/source/blender/editors/interface/interface_layout.c +++ b/source/blender/editors/interface/interface_layout.c @@ -2679,7 +2679,7 @@ void ui_layout_add_but(uiLayout *layout, uiBut *but) if (layout->context) { but->context = layout->context; - but->context->used = 1; + but->context->used = TRUE; } } diff --git a/source/blender/editors/interface/interface_ops.c b/source/blender/editors/interface/interface_ops.c index f2a43580fd8..dfd2d0cc4d0 100644 --- a/source/blender/editors/interface/interface_ops.c +++ b/source/blender/editors/interface/interface_ops.c @@ -368,7 +368,7 @@ static void UI_OT_reset_default_button(wmOperatorType *ot) static int copy_to_selected_list(bContext *C, PointerRNA *ptr, ListBase *lb, int *use_path) { - *use_path = 0; + *use_path = FALSE; if (RNA_struct_is_a(ptr->type, &RNA_EditBone)) *lb = CTX_data_collection_get(C, "selected_editable_bones"); @@ -381,7 +381,7 @@ static int copy_to_selected_list(bContext *C, PointerRNA *ptr, ListBase *lb, int if (id && GS(id->name) == ID_OB) { *lb = CTX_data_collection_get(C, "selected_editable_objects"); - *use_path = 1; + *use_path = TRUE; } else return 0; diff --git a/source/blender/editors/interface/interface_panel.c b/source/blender/editors/interface/interface_panel.c index dc2c3b4eea9..cbe44505263 100644 --- a/source/blender/editors/interface/interface_panel.c +++ b/source/blender/editors/interface/interface_panel.c @@ -754,14 +754,14 @@ static int uiAlignPanelStep(ScrArea *sa, ARegion *ar, float fac, int drag) } /* we interpolate */ - done = 0; + done = FALSE; ps = panelsort; for (a = 0; a < tot; a++, ps++) { if ((ps->pa->flag & PNL_SELECT) == 0) { if ((ps->orig->ofsx != ps->pa->ofsx) || (ps->orig->ofsy != ps->pa->ofsy)) { ps->orig->ofsx = floorf(0.5f + fac * (float)ps->pa->ofsx + (1.0f - fac) * (float)ps->orig->ofsx); ps->orig->ofsy = floorf(0.5f + fac * (float)ps->pa->ofsy + (1.0f - fac) * (float)ps->orig->ofsy); - done = 1; + done = TRUE; } } } diff --git a/source/blender/editors/interface/interface_widgets.c b/source/blender/editors/interface/interface_widgets.c index fe7a4e85418..42c6bfc3870 100644 --- a/source/blender/editors/interface/interface_widgets.c +++ b/source/blender/editors/interface/interface_widgets.c @@ -127,8 +127,11 @@ typedef struct uiWidgetType { /* *********************** draw data ************************** */ -static float cornervec[WIDGET_CURVE_RESOLU][2] = {{0.0, 0.0}, {0.195, 0.02}, {0.383, 0.067}, {0.55, 0.169}, - {0.707, 0.293}, {0.831, 0.45}, {0.924, 0.617}, {0.98, 0.805}, {1.0, 1.0}}; +static float cornervec[WIDGET_CURVE_RESOLU][2] = { + {0.0, 0.0}, {0.195, 0.02}, {0.383, 0.067}, + {0.55, 0.169}, {0.707, 0.293}, {0.831, 0.45}, + {0.924, 0.617}, {0.98, 0.805}, {1.0, 1.0} +}; #define WIDGET_AA_JITTER 8 static float jit[WIDGET_AA_JITTER][2] = { diff --git a/source/blender/editors/interface/resources.c b/source/blender/editors/interface/resources.c index 1589bbc123f..bf57dda44bf 100644 --- a/source/blender/editors/interface/resources.c +++ b/source/blender/editors/interface/resources.c @@ -1746,7 +1746,7 @@ void init_userdef_do_versions(void) rgba_char_args_set_fl(btheme->toops.selected_highlight, 0.51, 0.53, 0.55, 0.3); } - U.use_16bit_textures = 1; + U.use_16bit_textures = TRUE; } if (bmain->versionfile < 262 || (bmain->versionfile == 262 && bmain->subversionfile < 2)) { diff --git a/source/blender/editors/interface/view2d.c b/source/blender/editors/interface/view2d.c index ed010dc973a..1d315e9a5b8 100644 --- a/source/blender/editors/interface/view2d.c +++ b/source/blender/editors/interface/view2d.c @@ -419,14 +419,14 @@ void UI_view2d_curRect_validate_resize(View2D *v2d, int resize) /* check if we should restore aspect ratio (if view size changed) */ if (v2d->keepzoom & V2D_KEEPASPECT) { - short do_x = 0, do_y = 0, do_cur /* , do_win */ /* UNUSED */; + short do_x = FALSE, do_y = FALSE, do_cur /* , do_win */ /* UNUSED */; float /* curRatio, */ /* UNUSED */ winRatio; /* when a window edge changes, the aspect ratio can't be used to * find which is the best new 'cur' rect. thats why it stores 'old' */ - if (winx != v2d->oldwinx) do_x = 1; - if (winy != v2d->oldwiny) do_y = 1; + if (winx != v2d->oldwinx) do_x = TRUE; + if (winy != v2d->oldwiny) do_y = TRUE; /* curRatio= height / width; */ /* UNUSED */ winRatio = winy / winx; @@ -435,11 +435,11 @@ void UI_view2d_curRect_validate_resize(View2D *v2d, int resize) if (do_x == do_y) { if (do_x && do_y) { /* here is 1,1 case, so all others must be 0,0 */ - if (ABS(winx - v2d->oldwinx) > ABS(winy - v2d->oldwiny)) do_y = 0; - else do_x = 0; + if (ABS(winx - v2d->oldwinx) > ABS(winy - v2d->oldwiny)) do_y = FALSE; + else do_x = FALSE; } - else if (winRatio > 1.0f) do_x = 0; - else do_x = 1; + else if (winRatio > 1.0f) do_x = FALSE; + else do_x = TRUE; } do_cur = do_x; /* do_win= do_y; */ /* UNUSED */ @@ -1442,7 +1442,7 @@ View2DScrollers *UI_view2d_scrollers_calc(const bContext *C, View2D *v2d, short v2d->scroll |= V2D_SCROLL_HORIZONTAL_FULLR; scrollers->horfull = 1; } - else + else v2d->scroll &= ~V2D_SCROLL_HORIZONTAL_FULLR; } } @@ -1484,7 +1484,7 @@ View2DScrollers *UI_view2d_scrollers_calc(const bContext *C, View2D *v2d, short v2d->scroll |= V2D_SCROLL_VERTICAL_FULLR; scrollers->vertfull = 1; } - else + else v2d->scroll &= ~V2D_SCROLL_VERTICAL_FULLR; } } diff --git a/source/blender/editors/mesh/editface.c b/source/blender/editors/mesh/editface.c index 63704f5b8e6..3da2b4711f3 100644 --- a/source/blender/editors/mesh/editface.c +++ b/source/blender/editors/mesh/editface.c @@ -231,7 +231,7 @@ static void select_linked_tfaces_with_seams(int mode, Mesh *me, unsigned int ind MLoop *ml; MEdge *med; char *linkflag; - int a, b, doit = 1, mark = 0; + int a, b, do_it = TRUE, mark = 0; ehash = BLI_edgehash_new(); seamhash = BLI_edgehash_new(); @@ -259,8 +259,8 @@ static void select_linked_tfaces_with_seams(int mode, Mesh *me, unsigned int ind } } - while (doit) { - doit = 0; + while (do_it) { + do_it = FALSE; /* expand selection */ mp = me->mpoly; @@ -283,7 +283,7 @@ static void select_linked_tfaces_with_seams(int mode, Mesh *me, unsigned int ind if (mark) { linkflag[a] = 1; hash_add_face(ehash, mp, me->mloop + mp->loopstart); - doit = 1; + do_it = TRUE; } } } @@ -860,7 +860,7 @@ void ED_mesh_mirrtopo_init(Mesh *me, const int ob_mode, MirrTopoStore_t *mesh_to } if (tot_unique <= tot_unique_prev) { - /* Finish searching for unique valus when 1 loop dosnt give a + /* Finish searching for unique values when 1 loop dosnt give a * higher number of unique values compared to the previous loop */ break; } diff --git a/source/blender/editors/mesh/editmesh_knife.c b/source/blender/editors/mesh/editmesh_knife.c index a9ec893adb7..6bbcd1d253e 100644 --- a/source/blender/editors/mesh/editmesh_knife.c +++ b/source/blender/editors/mesh/editmesh_knife.c @@ -308,7 +308,7 @@ static KnifeVert *get_bm_knife_vert(KnifeTool_OpData *kcd, BMVert *v) /** * get a KnifeEdge wrapper for an existing BMEdge - * \note #knife_get_face_kedges / #get_bm_knife_edge are called recusively - KEEP STACK MEM USAGE LOW */ + * \note #knife_get_face_kedges / #get_bm_knife_edge are called recursively - KEEP STACK MEM USAGE LOW */ static KnifeEdge *get_bm_knife_edge(KnifeTool_OpData *kcd, BMEdge *e) { KnifeEdge *kfe = BLI_ghash_lookup(kcd->origedgemap, e); @@ -365,7 +365,7 @@ static void knife_start_cut(KnifeTool_OpData *kcd) } /** - * \note #knife_get_face_kedges / #get_bm_knife_edge are called recusively - KEEP STACK MEM USAGE LOW */ + * \note #knife_get_face_kedges / #get_bm_knife_edge are called recursively - KEEP STACK MEM USAGE LOW */ static ListBase *knife_get_face_kedges(KnifeTool_OpData *kcd, BMFace *f) { ListBase *lst = BLI_ghash_lookup(kcd->kedgefacemap, f); @@ -889,7 +889,7 @@ static void knifetool_draw_angle_snapping(KnifeTool_OpData *kcd) static void knife_init_colors(KnifeColors *colors) { /* possible BMESH_TODO: add explicit themes or calculate these by - * figuring out constrasting colors with grid / edges / verts + * figuring out contrasting colors with grid / edges / verts * a la UI_make_axis_color */ UI_GetThemeColor3ubv(TH_NURB_VLINE, colors->line); UI_GetThemeColor3ubv(TH_NURB_ULINE, colors->edge); diff --git a/source/blender/editors/mesh/editmesh_rip.c b/source/blender/editors/mesh/editmesh_rip.c index b74e8797d72..1bcd5cee111 100644 --- a/source/blender/editors/mesh/editmesh_rip.c +++ b/source/blender/editors/mesh/editmesh_rip.c @@ -139,7 +139,7 @@ static float edbm_rip_edge_side_measure(BMEdge *e, BMLoop *e_l, * connected edge loops. * The reason for using loops like this is because when the edges are split we don't which face user gets the newly * created edge (its as good as random so we cant assume new edges will be on once side). - * After splittingm, its very simple to walk along boundary loops since each only has one edge from a single side. + * After splitting, its very simple to walk along boundary loops since each only has one edge from a single side. * - The end loop pairs are stored in an array however to support multiple edge-selection-islands, so you can rip * multiple selections at once. * - * Execute the split * @@ -348,7 +348,8 @@ static int edbm_rip_call_edgesplit(BMEditMesh *em, wmOperator *op) BMOperator bmop; if (!EDBM_op_init(em, &bmop, op, "edgesplit edges=%he verts=%hv use_verts=%b", - BM_ELEM_TAG, BM_ELEM_SELECT, TRUE)) { + BM_ELEM_TAG, BM_ELEM_SELECT, TRUE)) + { return FALSE; } BMO_op_exec(em->bm, &bmop); @@ -710,7 +711,7 @@ static int edbm_rip_invoke(bContext *C, wmOperator *op, wmEvent *event) /* running in face mode hardly makes sense, so convert to region loop and rip */ if (em->bm->totfacesel) { - /* highly nifty but hard to sypport since the operator can fail and we're left + /* highly nifty but hard to support since the operator can fail and we're left * with modified selection */ // WM_operator_name_call(C, "MESH_OT_region_to_loop", WM_OP_INVOKE_DEFAULT, NULL); diff --git a/source/blender/editors/mesh/editmesh_select.c b/source/blender/editors/mesh/editmesh_select.c index 2df89a3df6c..55f575bbdea 100644 --- a/source/blender/editors/mesh/editmesh_select.c +++ b/source/blender/editors/mesh/editmesh_select.c @@ -931,23 +931,16 @@ static int edbm_loop_multiselect_exec(bContext *C, wmOperator *op) BMIter iter; int totedgesel = 0; - for (eed = BM_iter_new(&iter, em->bm, BM_EDGES_OF_MESH, NULL); - eed; eed = BM_iter_step(&iter)) { - + BM_ITER_MESH (eed, &iter, em->bm, BM_EDGES_OF_MESH) { if (BM_elem_flag_test(eed, BM_ELEM_SELECT)) { totedgesel++; } } - edarray = MEM_mallocN(sizeof(BMEdge *) * totedgesel, "edge array"); edindex = 0; - for (eed = BM_iter_new(&iter, em->bm, BM_EDGES_OF_MESH, NULL); - eed; - eed = BM_iter_step(&iter)) - { - + BM_ITER_MESH (eed, &iter, em->bm, BM_EDGES_OF_MESH) { if (BM_elem_flag_test(eed, BM_ELEM_SELECT)) { edarray[edindex] = eed; edindex++; @@ -1277,7 +1270,7 @@ static int edgetag_shortest_path(Scene *scene, BMEditMesh *em, BMEdge *source, B * path found so far to edge n. The visitedhash will of course contain entries * for edges that have been visited, cost[n] will contain the length of the shortest * path to edge n found so far, Finally, heap is a priority heap which is built on the - * the same data as the cost arry, but inverted: it is a worklist of edges prioritized + * the same data as the cost array, but inverted: it is a worklist of edges prioritized * by the shortest path found so far to the edge. */ @@ -2245,8 +2238,6 @@ static int edbm_select_sharp_edges_exec(bContext *C, wmOperator *op) BMLoop *l1, *l2; float sharp = RNA_float_get(op->ptr, "sharpness"), angle; - sharp = DEG2RADF(sharp); - BM_ITER_MESH (e, &iter, em->bm, BM_EDGES_OF_MESH) { if (BM_elem_flag_test(e, BM_ELEM_HIDDEN) || !e->l) continue; @@ -2273,9 +2264,11 @@ static int edbm_select_sharp_edges_exec(bContext *C, wmOperator *op) void MESH_OT_edges_select_sharp(wmOperatorType *ot) { + PropertyRNA *prop; + /* identifiers */ ot->name = "Select Sharp Edges"; - ot->description = "Marked selected edges as sharp"; + ot->description = "Select all sharp-enough edges"; ot->idname = "MESH_OT_edges_select_sharp"; /* api callbacks */ @@ -2286,7 +2279,9 @@ void MESH_OT_edges_select_sharp(wmOperatorType *ot) ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO; /* props */ - RNA_def_float(ot->srna, "sharpness", 1.0f, 0.01f, FLT_MAX, "sharpness", "", 1.0f, 180.0f); + prop = RNA_def_float_rotation(ot->srna, "sharpness", 0, NULL, DEG2RADF(0.01f), DEG2RADF(180.0f), + "Sharpness", "", DEG2RADF(1.0f), DEG2RADF(180.0f)); + RNA_def_property_float_default(prop, DEG2RADF(1.0f)); } static int edbm_select_linked_flat_faces_exec(bContext *C, wmOperator *op) @@ -2300,8 +2295,6 @@ static int edbm_select_linked_flat_faces_exec(bContext *C, wmOperator *op) float sharp = RNA_float_get(op->ptr, "sharpness"); int i; - sharp = (sharp * (float)M_PI) / 180.0f; - BM_ITER_MESH (f, &iter, em->bm, BM_FACES_OF_MESH) { BM_elem_flag_disable(f, BM_ELEM_TAG); } @@ -2354,6 +2347,8 @@ static int edbm_select_linked_flat_faces_exec(bContext *C, wmOperator *op) void MESH_OT_faces_select_linked_flat(wmOperatorType *ot) { + PropertyRNA *prop; + /* identifiers */ ot->name = "Select Linked Flat Faces"; ot->description = "Select linked faces by angle"; @@ -2367,7 +2362,9 @@ void MESH_OT_faces_select_linked_flat(wmOperatorType *ot) ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO; /* props */ - RNA_def_float(ot->srna, "sharpness", 1.0f, 0.01f, FLT_MAX, "sharpness", "", 1.0f, 180.0f); + prop = RNA_def_float_rotation(ot->srna, "sharpness", 0, NULL, DEG2RADF(0.01f), DEG2RADF(180.0f), + "Sharpness", "", DEG2RADF(1.0f), DEG2RADF(180.0f)); + RNA_def_property_float_default(prop, DEG2RADF(1.0f)); } static int edbm_select_non_manifold_exec(bContext *C, wmOperator *op) diff --git a/source/blender/editors/mesh/editmesh_tools.c b/source/blender/editors/mesh/editmesh_tools.c index 57f663aa571..507ed2de07f 100644 --- a/source/blender/editors/mesh/editmesh_tools.c +++ b/source/blender/editors/mesh/editmesh_tools.c @@ -722,7 +722,7 @@ static int edbm_dupli_extrude_cursor_invoke(bContext *C, wmOperator *op, wmEvent BMVert *v1; BMIter iter; float min[3], max[3]; - int done = 0; + int done = FALSE; short use_proj; em_setup_viewcontext(C, &vc); @@ -735,7 +735,7 @@ static int edbm_dupli_extrude_cursor_invoke(bContext *C, wmOperator *op, wmEvent BM_ITER_MESH (v1, &iter, vc.em->bm, BM_VERTS_OF_MESH) { if (BM_elem_flag_test(v1, BM_ELEM_SELECT)) { minmax_v3v3_v3(min, max, v1->co); - done = 1; + done = TRUE; } } @@ -753,7 +753,7 @@ static int edbm_dupli_extrude_cursor_invoke(bContext *C, wmOperator *op, wmEvent mval_f[1] = (float)event->mval[1]; /* check for edges that are half selected, use for rotation */ - done = 0; + done = FALSE; BM_ITER_MESH (eed, &iter, vc.em->bm, BM_EDGES_OF_MESH) { if (BM_elem_flag_test(eed, BM_ELEM_SELECT)) { float co1[3], co2[3]; @@ -776,7 +776,7 @@ static int edbm_dupli_extrude_cursor_invoke(bContext *C, wmOperator *op, wmEvent nor[1] += -(co2[0] - co1[0]); } } - done = 1; + done = TRUE; } if (done) { @@ -3534,8 +3534,7 @@ static int edbm_select_by_number_vertices_exec(bContext *C, wmOperator *op) int numverts = RNA_int_get(op->ptr, "number"); int type = RNA_enum_get(op->ptr, "type"); - for (efa = BM_iter_new(&iter, em->bm, BM_FACES_OF_MESH, NULL); - efa; efa = BM_iter_step(&iter)) { + BM_ITER_MESH (efa, &iter, em->bm, BM_FACES_OF_MESH) { int select = 0; @@ -3598,17 +3597,13 @@ static int edbm_select_loose_verts_exec(bContext *C, wmOperator *UNUSED(op)) BMEdge *eed; BMIter iter; - for (eve = BM_iter_new(&iter, em->bm, BM_VERTS_OF_MESH, NULL); - eve; eve = BM_iter_step(&iter)) { - + BM_ITER_MESH (eve, &iter, em->bm, BM_VERTS_OF_MESH) { if (!eve->e) { BM_vert_select_set(em->bm, eve, TRUE); } } - for (eed = BM_iter_new(&iter, em->bm, BM_EDGES_OF_MESH, NULL); - eed; eed = BM_iter_step(&iter)) { - + BM_ITER_MESH (eed, &iter, em->bm, BM_EDGES_OF_MESH) { if (!eed->l) { BM_edge_select_set(em->bm, eed, TRUE); } @@ -3967,7 +3962,7 @@ static void sort_bmelem_flag(bContext *C, const int types, const int flag, const else if (action == SRT_RANDOMIZE) { if (totelem[0]) { - /* Re-init random generator for each element type, to get consistant random when + /* Re-init random generator for each element type, to get consistent random when * enabling/disabling an element type. */ BLI_srandom(seed); pb = pblock[0] = MEM_callocN(sizeof(char) * totelem[0], "sort_bmelem vert pblock"); diff --git a/source/blender/editors/object/object_add.c b/source/blender/editors/object/object_add.c index 69aae5c4f06..fe5fafb0ca0 100644 --- a/source/blender/editors/object/object_add.c +++ b/source/blender/editors/object/object_add.c @@ -735,7 +735,7 @@ static int object_lamp_add_exec(bContext *C, wmOperator *op) if (BKE_scene_use_new_shading_nodes(scene)) { ED_node_shader_default(scene, &la->id); - la->use_nodes = 1; + la->use_nodes = TRUE; } return OPERATOR_FINISHED; @@ -901,7 +901,7 @@ static int object_delete_exec(bContext *C, wmOperator *op) Main *bmain = CTX_data_main(C); Scene *scene = CTX_data_scene(C); const short use_global = RNA_boolean_get(op->ptr, "use_global"); - /* int islamp= 0; */ /* UNUSED */ + /* int is_lamp = FALSE; */ /* UNUSED */ if (CTX_data_edit_object(C)) return OPERATOR_CANCELLED; @@ -909,7 +909,7 @@ static int object_delete_exec(bContext *C, wmOperator *op) CTX_DATA_BEGIN (C, Base *, base, selected_bases) { - /* if (base->object->type==OB_LAMP) islamp= 1; */ + /* if (base->object->type==OB_LAMP) is_lamp = TRUE; */ /* deselect object -- it could be used in other scenes */ base->object->flag &= ~SELECT; diff --git a/source/blender/editors/object/object_bake.c b/source/blender/editors/object/object_bake.c index cea9a0aae6b..b89562e772b 100644 --- a/source/blender/editors/object/object_bake.c +++ b/source/blender/editors/object/object_bake.c @@ -434,7 +434,7 @@ static void do_multires_bake(MultiresBakeRender *bkr, Image *ima, MPassKnownData bkr->baked_faces++; if (bkr->do_update) - *bkr->do_update = 1; + *bkr->do_update = TRUE; if (bkr->progress) *bkr->progress = ((float)bkr->baked_objects + (float)bkr->baked_faces / tot_face) / bkr->tot_obj; diff --git a/source/blender/editors/object/object_edit.c b/source/blender/editors/object/object_edit.c index c97ad9c62f9..107b19b0ed7 100644 --- a/source/blender/editors/object/object_edit.c +++ b/source/blender/editors/object/object_edit.c @@ -764,7 +764,7 @@ static void copy_attr(Main *bmain, Scene *scene, View3D *v3d, short event) Base *base; Curve *cu, *cu1; Nurb *nu; - int do_scene_sort = 0; + int do_scene_sort = FALSE; if (scene->id.lib) return; @@ -949,7 +949,7 @@ static void copy_attr(Main *bmain, Scene *scene, View3D *v3d, short event) /* Copy the constraint channels over */ copy_constraints(&base->object->constraints, &ob->constraints, TRUE); - do_scene_sort = 1; + do_scene_sort = TRUE; } else if (event == 23) { base->object->softflag = ob->softflag; @@ -1284,7 +1284,7 @@ static int shade_smooth_exec(bContext *C, wmOperator *op) Curve *cu; Nurb *nu; int clear = (strcmp(op->idname, "OBJECT_OT_shade_flat") == 0); - int done = 0; + int done = FALSE; CTX_DATA_BEGIN (C, Object *, ob, selected_editable_objects) { @@ -1295,7 +1295,7 @@ static int shade_smooth_exec(bContext *C, wmOperator *op) DAG_id_tag_update(&ob->id, OB_RECALC_DATA); WM_event_add_notifier(C, NC_OBJECT | ND_DRAW, ob); - done = 1; + done = TRUE; } else if (ELEM(ob->type, OB_SURF, OB_CURVE)) { cu = ob->data; @@ -1308,7 +1308,7 @@ static int shade_smooth_exec(bContext *C, wmOperator *op) DAG_id_tag_update(&ob->id, OB_RECALC_DATA); WM_event_add_notifier(C, NC_OBJECT | ND_DRAW, ob); - done = 1; + done = TRUE; } } CTX_DATA_END; @@ -1369,7 +1369,7 @@ static void UNUSED_FUNCTION(image_aspect) (Scene * scene, View3D * v3d) for (base = FIRSTBASE; base; base = base->next) { if (TESTBASELIB(v3d, base)) { ob = base->object; - done = 0; + done = FALSE; for (a = 1; a <= ob->totcol; a++) { ma = give_current_material(ob, a); @@ -1398,7 +1398,7 @@ static void UNUSED_FUNCTION(image_aspect) (Scene * scene, View3D * v3d) if (x > y) ob->size[0] = ob->size[1] * x / y; else ob->size[1] = ob->size[0] * y / x; - done = 1; + done = TRUE; DAG_id_tag_update(&ob->id, OB_RECALC_OB); } } diff --git a/source/blender/editors/object/object_modifier.c b/source/blender/editors/object/object_modifier.c index 191677989b9..47748fbd53b 100644 --- a/source/blender/editors/object/object_modifier.c +++ b/source/blender/editors/object/object_modifier.c @@ -45,6 +45,7 @@ #include "BLI_math.h" #include "BLI_listbase.h" #include "BLI_string.h" +#include "BLI_string_utf8.h" #include "BLI_path_util.h" #include "BLI_utildefines.h" @@ -125,8 +126,9 @@ ModifierData *ED_object_modifier_add(ReportList *reports, Main *bmain, Scene *sc else BLI_addtail(&ob->modifiers, new_md); - if (name) - BLI_strncpy(new_md->name, name, sizeof(new_md->name)); + if (name) { + BLI_strncpy_utf8(new_md->name, name, sizeof(new_md->name)); + } /* make sure modifier data has unique name */ @@ -223,7 +225,8 @@ static int object_modifier_remove(Object *ob, ModifierData *md, int *sort_depsgr } if (ELEM(md->type, eModifierType_Softbody, eModifierType_Cloth) && - ob->particlesystem.first == NULL) { + ob->particlesystem.first == NULL) + { ob->mode &= ~OB_MODE_PARTICLE_EDIT; } @@ -1530,7 +1533,7 @@ static void oceanbake_update(void *customdata, float progress, int *cancel) if (oceanbake_breakjob(oj)) *cancel = 1; - *(oj->do_update) = 1; + *(oj->do_update) = TRUE; *(oj->progress) = progress; } @@ -1546,7 +1549,7 @@ static void oceanbake_startjob(void *customdata, short *stop, short *do_update, BKE_bake_ocean(oj->ocean, oj->och, oceanbake_update, (void *)oj); - *do_update = 1; + *do_update = TRUE; *stop = 0; } diff --git a/source/blender/editors/object/object_ops.c b/source/blender/editors/object/object_ops.c index 986a294d065..afc493f66f9 100644 --- a/source/blender/editors/object/object_ops.c +++ b/source/blender/editors/object/object_ops.c @@ -430,7 +430,7 @@ void ED_object_generic_keymap(struct wmKeyConfig *UNUSED(keyconf), struct wmKeyM RNA_string_set(kmi->ptr, "data_path", "tool_settings.proportional_edit_falloff"); // Object mode - if (do_pet == 1) { + if (do_pet == TRUE) { kmi = WM_keymap_add_item(keymap, "WM_OT_context_toggle", OKEY, KM_PRESS, 0, 0); RNA_string_set(kmi->ptr, "data_path", "tool_settings.use_proportional_edit_objects"); diff --git a/source/blender/editors/object/object_relations.c b/source/blender/editors/object/object_relations.c index b3e16c8d4eb..2b622b21d2c 100644 --- a/source/blender/editors/object/object_relations.c +++ b/source/blender/editors/object/object_relations.c @@ -1108,7 +1108,7 @@ static int move_to_layer_exec(bContext *C, wmOperator *op) Scene *scene = CTX_data_scene(C); View3D *v3d = CTX_wm_view3d(C); unsigned int lay, local; - /* int islamp= 0; */ /* UNUSED */ + /* int is_lamp = FALSE; */ /* UNUSED */ lay = move_to_layer_init(C, op); lay &= 0xFFFFFF; @@ -1125,7 +1125,7 @@ static int move_to_layer_exec(bContext *C, wmOperator *op) base->object->lay = lay; base->object->flag &= ~SELECT; base->flag &= ~SELECT; - /* if (base->object->type==OB_LAMP) islamp= 1; */ + /* if (base->object->type==OB_LAMP) is_lamp = TRUE; */ } CTX_DATA_END; } @@ -1138,7 +1138,7 @@ static int move_to_layer_exec(bContext *C, wmOperator *op) local = base->lay & 0xFF000000; base->lay = lay + local; base->object->lay = lay; - /* if (base->object->type==OB_LAMP) islamp= 1; */ + /* if (base->object->type==OB_LAMP) is_lamp = TRUE; */ } CTX_DATA_END; } diff --git a/source/blender/editors/object/object_select.c b/source/blender/editors/object/object_select.c index 3a932b58fd9..fa86f089387 100644 --- a/source/blender/editors/object/object_select.c +++ b/source/blender/editors/object/object_select.c @@ -506,7 +506,7 @@ static short select_grouped_siblings(bContext *C, Object *ob) CTX_DATA_BEGIN (C, Base *, base, selectable_bases) { - if ((base->object->parent == ob->parent) && !(base->flag & SELECT)) { + if ((base->object->parent == ob->parent) && !(base->flag & SELECT)) { ED_base_object_select(base, BA_SELECT); changed = 1; } diff --git a/source/blender/editors/object/object_transform.c b/source/blender/editors/object/object_transform.c index 2e21fe9cdfe..07557d8ea4c 100644 --- a/source/blender/editors/object/object_transform.c +++ b/source/blender/editors/object/object_transform.c @@ -382,7 +382,7 @@ static int apply_objects_internal(bContext *C, ReportList *reports, int apply_lo Main *bmain = CTX_data_main(C); Scene *scene = CTX_data_scene(C); float rsmat[3][3], tmat[3][3], obmat[3][3], iobmat[3][3], mat[4][4], scale; - int a, change = 0; + int a, change = 1; /* first check if we can execute */ CTX_DATA_BEGIN (C, Object *, ob, selected_editable_objects) @@ -391,19 +391,19 @@ static int apply_objects_internal(bContext *C, ReportList *reports, int apply_lo if (ob->type == OB_MESH) { if (ID_REAL_USERS(ob->data) > 1) { BKE_report(reports, RPT_ERROR, "Can't apply to a multi user mesh, doing nothing"); - return OPERATOR_CANCELLED; + change = 0; } } else if (ob->type == OB_ARMATURE) { if (ID_REAL_USERS(ob->data) > 1) { BKE_report(reports, RPT_ERROR, "Can't apply to a multi user armature, doing nothing"); - return OPERATOR_CANCELLED; + change = 0; } } else if (ob->type == OB_LATTICE) { if (ID_REAL_USERS(ob->data) > 1) { BKE_report(reports, RPT_ERROR, "Can't apply to a multi user lattice, doing nothing"); - return OPERATOR_CANCELLED; + change = 0; } } else if (ELEM(ob->type, OB_CURVE, OB_SURF)) { @@ -411,23 +411,28 @@ static int apply_objects_internal(bContext *C, ReportList *reports, int apply_lo if (ID_REAL_USERS(ob->data) > 1) { BKE_report(reports, RPT_ERROR, "Can't apply to a multi user curve, doing nothing"); - return OPERATOR_CANCELLED; + change = 0; } cu = ob->data; if (!(cu->flag & CU_3D) && (apply_rot || apply_loc)) { BKE_report(reports, RPT_ERROR, "Neither rotation nor location could be applied to a 2d curve, doing nothing"); - return OPERATOR_CANCELLED; + change = 0; } if (cu->key) { BKE_report(reports, RPT_ERROR, "Can't apply to a curve with vertex keys, doing nothing"); - return OPERATOR_CANCELLED; + change = 0; } } } CTX_DATA_END; + if (!change) + return OPERATOR_CANCELLED; + + change = 0; + /* now execute */ CTX_DATA_BEGIN (C, Object *, ob, selected_editable_objects) { diff --git a/source/blender/editors/physics/physics_fluid.c b/source/blender/editors/physics/physics_fluid.c index 5a56672f766..c8ca75835e4 100644 --- a/source/blender/editors/physics/physics_fluid.c +++ b/source/blender/editors/physics/physics_fluid.c @@ -540,7 +540,7 @@ static void export_fluid_objects(ListBase *fobjects, Scene *scene, int length) fsmesh.volumeInitType = fluidmd->fss->volumeInitType; fsmesh.obstacleImpactFactor = fluidmd->fss->surfaceSmoothing; // misused value - if (fsmesh.type == OB_FLUIDSIM_CONTROL) { + if (fsmesh.type == OB_FLUIDSIM_CONTROL) { fsmesh.cpsTimeStart = fluidmd->fss->cpsTimeStart; fsmesh.cpsTimeEnd = fluidmd->fss->cpsTimeEnd; fsmesh.cpsQuality = fluidmd->fss->cpsQuality; @@ -708,7 +708,7 @@ static int fluid_init_filepaths(Object *fsDomain, char *targetDir, char *targetF strncpy(domainSettings->surfdataPath, newSurfdataPath, FILE_MAXDIR); BLI_path_abs(targetDir, G.main->name); // fixed #frame-no } -#endif +#endif return outStringsChanged; } @@ -750,8 +750,8 @@ static void fluidbake_updatejob(void *customdata, float progress) { FluidBakeJob *fb= (FluidBakeJob *)customdata; - *(fb->do_update)= 1; - *(fb->progress)= progress; + *(fb->do_update) = TRUE; + *(fb->progress) = progress; } static void fluidbake_startjob(void *customdata, short *stop, short *do_update, float *progress) @@ -765,7 +765,7 @@ static void fluidbake_startjob(void *customdata, short *stop, short *do_update, G.afbreek= 0; /* XXX shared with render - replace with job 'stop' switch */ elbeemSimulate(); - *do_update= 1; + *do_update = TRUE; *stop = 0; } diff --git a/source/blender/editors/render/render_internal.c b/source/blender/editors/render/render_internal.c index 595b51d22c4..7b4dda1a48f 100644 --- a/source/blender/editors/render/render_internal.c +++ b/source/blender/editors/render/render_internal.c @@ -340,7 +340,7 @@ static void image_renderinfo_cb(void *rjv, RenderStats *rs) RE_ReleaseResult(rj->re); /* make jobs timer to send notifier */ - *(rj->do_update) = 1; + *(rj->do_update) = TRUE; } @@ -352,7 +352,7 @@ static void render_progress_update(void *rjv, float progress) *rj->progress = progress; /* make jobs timer to send notifier */ - *(rj->do_update) = 1; + *(rj->do_update) = TRUE; } } @@ -372,7 +372,7 @@ static void image_rect_update(void *rjv, RenderResult *rr, volatile rcti *renrec image_buffer_rect_update(rj->scene, rr, ibuf, renrect); /* make jobs timer to send notifier */ - *(rj->do_update) = 1; + *(rj->do_update) = TRUE; } BKE_image_release_ibuf(ima, lock); } diff --git a/source/blender/editors/render/render_preview.c b/source/blender/editors/render/render_preview.c index f7024444e86..6357cb48a3d 100644 --- a/source/blender/editors/render/render_preview.c +++ b/source/blender/editors/render/render_preview.c @@ -473,7 +473,7 @@ static int ed_preview_draw_rect(ScrArea *sa, Scene *sce, ID *id, int split, int Render *re; RenderResult rres; char name[32]; - int do_gamma_correct = 0, do_predivide = 0; + int do_gamma_correct = FALSE, do_predivide = FALSE; int offx = 0, newx = rect->xmax - rect->xmin, newy = rect->ymax - rect->ymin; if (id && GS(id->name) != ID_TE) { @@ -583,7 +583,7 @@ static void shader_preview_draw(void *spv, RenderResult *UNUSED(rr), volatile st { ShaderPreview *sp = spv; - *(sp->do_update) = 1; + *(sp->do_update) = TRUE; } /* called by renderer, checks job value */ @@ -737,7 +737,7 @@ static void shader_preview_startjob(void *customdata, short *stop, short *do_upd else shader_preview_render(sp, sp->id, 0, 0); - *do_update = 1; + *do_update = TRUE; } static void shader_preview_free(void *customdata) @@ -910,7 +910,7 @@ static void icon_preview_startjob(void *customdata, short *stop, short *do_updat icon_copy_rect(ibuf, sp->sizex, sp->sizey, sp->pr_rect); - *do_update = 1; + *do_update = TRUE; } else if (idtype == ID_BR) { Brush *br = (Brush *)id; @@ -924,7 +924,7 @@ static void icon_preview_startjob(void *customdata, short *stop, short *do_updat icon_copy_rect(br->icon_imbuf, sp->sizex, sp->sizey, sp->pr_rect); - *do_update = 1; + *do_update = TRUE; } else { /* re-use shader job */ diff --git a/source/blender/editors/render/render_shading.c b/source/blender/editors/render/render_shading.c index 95312c07df1..21cd02c96f2 100644 --- a/source/blender/editors/render/render_shading.c +++ b/source/blender/editors/render/render_shading.c @@ -379,7 +379,7 @@ static int new_material_exec(bContext *C, wmOperator *UNUSED(op)) if (BKE_scene_use_new_shading_nodes(scene)) { ED_node_shader_default(scene, &ma->id); - ma->use_nodes = 1; + ma->use_nodes = TRUE; } } @@ -479,7 +479,7 @@ static int new_world_exec(bContext *C, wmOperator *UNUSED(op)) if (BKE_scene_use_new_shading_nodes(scene)) { ED_node_shader_default(scene, &wo->id); - wo->use_nodes = 1; + wo->use_nodes = TRUE; } } diff --git a/source/blender/editors/screen/area.c b/source/blender/editors/screen/area.c index 0f286d91613..9771fef2d58 100644 --- a/source/blender/editors/screen/area.c +++ b/source/blender/editors/screen/area.c @@ -145,7 +145,7 @@ void ED_area_do_refresh(bContext *C, ScrArea *sa) if (sa->type && sa->type->refresh) { sa->type->refresh(C, sa); } - sa->do_refresh = 0; + sa->do_refresh = FALSE; } /* based on screen region draw tags, set draw tags in azones, and future region tabs etc */ @@ -162,7 +162,7 @@ void ED_area_overdraw_flush(ScrArea *sa, ARegion *ar) /* test if inside */ if (BLI_in_rcti(&ar->winrct, xs, ys)) { - az->do_draw = 1; + az->do_draw = TRUE; } } } @@ -384,7 +384,7 @@ void ED_area_overdraw(bContext *C) } } - az->do_draw = 0; + az->do_draw = FALSE; } } } @@ -487,7 +487,7 @@ void ED_region_do_draw(bContext *C, ARegion *ar) ED_region_draw_cb_draw(C, ar, REGION_DRAW_POST_PIXEL); - ar->do_draw = 0; + ar->do_draw = FALSE; memset(&ar->drawrct, 0, sizeof(ar->drawrct)); uiFreeInactiveBlocks(C, &ar->uiblocks); @@ -559,7 +559,7 @@ void ED_area_tag_redraw_regiontype(ScrArea *sa, int regiontype) void ED_area_tag_refresh(ScrArea *sa) { if (sa) - sa->do_refresh = 1; + sa->do_refresh = TRUE; } /* *************************************************************** */ diff --git a/source/blender/editors/screen/screen_edit.c b/source/blender/editors/screen/screen_edit.c index d714f82b58b..3a2498d3fa2 100644 --- a/source/blender/editors/screen/screen_edit.c +++ b/source/blender/editors/screen/screen_edit.c @@ -421,7 +421,7 @@ bScreen *ED_screen_add(wmWindow *win, Scene *scene, const char *name) sc = BKE_libblock_alloc(&G.main->screen, ID_SCR, name); sc->scene = scene; - sc->do_refresh = 1; + sc->do_refresh = TRUE; sc->redraws_flag = TIME_ALL_3D_WIN | TIME_ALL_ANIM_WIN; sc->winid = win->winid; @@ -970,16 +970,16 @@ void ED_screen_do_listen(bContext *C, wmNotifier *note) switch (note->category) { case NC_WM: if (note->data == ND_FILEREAD) - win->screen->do_draw = 1; + win->screen->do_draw = TRUE; break; case NC_WINDOW: - win->screen->do_draw = 1; + win->screen->do_draw = TRUE; break; case NC_SCREEN: if (note->data == ND_SUBWINACTIVE) uiFreeActiveButtons(C, win->screen); if (note->action == NA_EDITED) - win->screen->do_draw = win->screen->do_refresh = 1; + win->screen->do_draw = win->screen->do_refresh = TRUE; break; case NC_SCENE: if (note->data == ND_MODE) @@ -1055,7 +1055,7 @@ void ED_screen_draw(wmWindow *win) glDisable(GL_BLEND); } - win->screen->do_draw = 0; + win->screen->do_draw = FALSE; } /* helper call for below, dpi changes headers */ @@ -1108,7 +1108,7 @@ void ED_screen_refresh(wmWindowManager *wm, wmWindow *win) if (G.debug & G_DEBUG_EVENTS) { printf("%s: set screen\n", __func__); } - win->screen->do_refresh = 0; + win->screen->do_refresh = FALSE; win->screen->context = ed_screen_context; } @@ -1276,11 +1276,11 @@ void ED_screen_set_subwinactive(bContext *C, wmEvent *event) if (oldswin != scr->subwinactive) { for (sa = scr->areabase.first; sa; sa = sa->next) { - int do_draw = 0; + int do_draw = FALSE; for (ar = sa->regionbase.first; ar; ar = ar->next) if (ar->swinid == oldswin || ar->swinid == scr->subwinactive) - do_draw = 1; + do_draw = TRUE; if (do_draw) { for (ar = sa->regionbase.first; ar; ar = ar->next) diff --git a/source/blender/editors/screen/screen_ops.c b/source/blender/editors/screen/screen_ops.c index 0d5aceb9870..5c68c92500b 100644 --- a/source/blender/editors/screen/screen_ops.c +++ b/source/blender/editors/screen/screen_ops.c @@ -37,6 +37,8 @@ #include "BLI_dlrbTree.h" #include "BLI_utildefines.h" +#include "BLF_translation.h" + #include "DNA_armature_types.h" #include "DNA_lattice_types.h" #include "DNA_object_types.h" @@ -1466,7 +1468,7 @@ static int area_split_modal(bContext *C, wmOperator *op, wmEvent *event) } } - CTX_wm_window(C)->screen->do_draw = 1; + CTX_wm_window(C)->screen->do_draw = TRUE; } @@ -1535,7 +1537,7 @@ static EnumPropertyItem prop_direction_items[] = { static void SCREEN_OT_area_split(wmOperatorType *ot) { - ot->name = "Split area"; + ot->name = "Split Area"; ot->description = "Split selected area into new windows"; ot->idname = "SCREEN_OT_area_split"; @@ -1911,7 +1913,7 @@ static int keyframe_jump_exec(bContext *C, wmOperator *op) ActKeyColumn *ak; float cfra; short next = RNA_boolean_get(op->ptr, "next"); - short done = 0; + short done = FALSE; /* sanity checks */ if (scene == NULL) @@ -1942,7 +1944,7 @@ static int keyframe_jump_exec(bContext *C, wmOperator *op) if (CFRA != (int)ak->cfra) { /* this changes the frame, so set the frame and we're done */ CFRA = (int)ak->cfra; - done = 1; + done = TRUE; } else { /* make this the new starting point for the search */ @@ -2351,7 +2353,7 @@ static int area_join_modal(bContext *C, wmOperator *op, wmEvent *event) static void SCREEN_OT_area_join(wmOperatorType *ot) { /* identifiers */ - ot->name = "Join area"; + ot->name = "Join Area"; ot->description = "Join selected areas into new window"; ot->idname = "SCREEN_OT_area_join"; @@ -2382,7 +2384,7 @@ static int screen_area_options_invoke(bContext *C, wmOperator *op, wmEvent *even if (actedge == NULL) return OPERATOR_CANCELLED; - pup = uiPupMenuBegin(C, op->type->name, ICON_NONE); + pup = uiPupMenuBegin(C, RNA_struct_ui_name(op->type->srna), ICON_NONE); layout = uiPupMenuLayout(pup); WM_operator_properties_create(&ptr1, "SCREEN_OT_area_join"); @@ -2399,8 +2401,8 @@ static int screen_area_options_invoke(bContext *C, wmOperator *op, wmEvent *even RNA_int_set(&ptr2, "mouse_x", event->x); RNA_int_set(&ptr2, "mouse_y", event->y); - uiItemFullO(layout, "SCREEN_OT_area_split", "Split Area", ICON_NONE, ptr2.data, WM_OP_INVOKE_DEFAULT, 0); - uiItemFullO(layout, "SCREEN_OT_area_join", "Join Area", ICON_NONE, ptr1.data, WM_OP_INVOKE_DEFAULT, 0); + uiItemFullO(layout, "SCREEN_OT_area_split", NULL, ICON_NONE, ptr2.data, WM_OP_INVOKE_DEFAULT, 0); + uiItemFullO(layout, "SCREEN_OT_area_join", NULL, ICON_NONE, ptr1.data, WM_OP_INVOKE_DEFAULT, 0); uiPupMenuEnd(C, pup); @@ -2499,11 +2501,11 @@ static int repeat_history_invoke(bContext *C, wmOperator *op, wmEvent *UNUSED(ev if (items == 0) return OPERATOR_CANCELLED; - pup = uiPupMenuBegin(C, op->type->name, ICON_NONE); + pup = uiPupMenuBegin(C, RNA_struct_ui_name(op->type->srna), ICON_NONE); layout = uiPupMenuLayout(pup); for (i = items - 1, lastop = wm->operators.last; lastop; lastop = lastop->prev, i--) - uiItemIntO(layout, lastop->type->name, ICON_NONE, op->type->idname, "index", i); + uiItemIntO(layout, RNA_struct_ui_name(lastop->type->srna), ICON_NONE, op->type->idname, "index", i); uiPupMenuEnd(C, pup); diff --git a/source/blender/editors/screen/screendump.c b/source/blender/editors/screen/screendump.c index 256df21b79a..77289360f98 100644 --- a/source/blender/editors/screen/screendump.c +++ b/source/blender/editors/screen/screendump.c @@ -333,7 +333,7 @@ static void screenshot_startjob(void *sjv, short *stop, short *do_update, float sj->stop = stop; sj->do_update = do_update; - *do_update = 1; // wait for opengl rect + *do_update = TRUE; /* wait for opengl rect */ while (*stop == 0) { @@ -377,7 +377,7 @@ static void screenshot_startjob(void *sjv, short *stop, short *do_update, float MEM_freeN(sj->dumprect); sj->dumprect = NULL; - *do_update = 1; + *do_update = TRUE; rd.cfra++; diff --git a/source/blender/editors/sculpt_paint/paint_cursor.c b/source/blender/editors/sculpt_paint/paint_cursor.c index ebc255f4e43..b5d44676cf6 100644 --- a/source/blender/editors/sculpt_paint/paint_cursor.c +++ b/source/blender/editors/sculpt_paint/paint_cursor.c @@ -342,7 +342,8 @@ static int sculpt_get_brush_geometry(bContext *C, ViewContext *vc, window[1] = y + vc->ar->winrct.ymin; if (vc->obact->sculpt && vc->obact->sculpt->pbvh && - sculpt_stroke_get_location(C, location, window)) { + sculpt_stroke_get_location(C, location, window)) + { *pixel_radius = project_brush_radius(vc, BKE_brush_unprojected_radius_get(scene, brush), diff --git a/source/blender/editors/sculpt_paint/paint_image.c b/source/blender/editors/sculpt_paint/paint_image.c index 9effba5b433..88fb728f334 100644 --- a/source/blender/editors/sculpt_paint/paint_image.c +++ b/source/blender/editors/sculpt_paint/paint_image.c @@ -2131,7 +2131,9 @@ static void project_bucket_clip_face( /* remove doubles */ /* first/last check */ - if (fabsf(isectVCosSS[0][0] - isectVCosSS[(*tot) - 1][0]) < PROJ_GEOM_TOLERANCE && fabsf(isectVCosSS[0][1] - isectVCosSS[(*tot) - 1][1]) < PROJ_GEOM_TOLERANCE) { + if (fabsf(isectVCosSS[0][0] - isectVCosSS[(*tot) - 1][0]) < PROJ_GEOM_TOLERANCE && + fabsf(isectVCosSS[0][1] - isectVCosSS[(*tot) - 1][1]) < PROJ_GEOM_TOLERANCE) + { (*tot)--; } @@ -2340,7 +2342,7 @@ static void project_paint_face_init(const ProjPaintState *ps, const int thread_i /* Use tf_uv_pxoffset instead of tf->uv so we can offset the UV half a pixel - * this is done so we can avoid offseting all the pixels by 0.5 which causes + * this is done so we can avoid offsetting all the pixels by 0.5 which causes * problems when wrapping negative coords */ xhalfpx = (0.5f + (PROJ_GEOM_TOLERANCE / 3.0f) ) / ibuf_xf; yhalfpx = (0.5f + (PROJ_GEOM_TOLERANCE / 4.0f) ) / ibuf_yf; @@ -2433,8 +2435,8 @@ static void project_paint_face_init(const ProjPaintState *ps, const int thread_i /* Note about IsectPoly2Df_twoside, checking the face or uv flipping doesnt work, * could check the poly direction but better to do this */ - if ((do_backfacecull && IsectPoly2Df(uv, uv_clip, uv_clip_tot)) || - (do_backfacecull == 0 && IsectPoly2Df_twoside(uv, uv_clip, uv_clip_tot))) + if ((do_backfacecull == TRUE && IsectPoly2Df(uv, uv_clip, uv_clip_tot)) || + (do_backfacecull == FALSE && IsectPoly2Df_twoside(uv, uv_clip, uv_clip_tot))) { has_x_isect = has_isect = 1; @@ -2453,7 +2455,9 @@ static void project_paint_face_init(const ProjPaintState *ps, const int thread_i /* Is this UV visible from the view? - raytrace */ /* project_paint_PickFace is less complex, use for testing */ //if (project_paint_PickFace(ps, pixelScreenCo, w, &side) == face_index) { - if (ps->do_occlude == 0 || !project_bucket_point_occluded(ps, bucketFaceNodes, face_index, pixelScreenCo)) { + if ((ps->do_occlude == FALSE) || + !project_bucket_point_occluded(ps, bucketFaceNodes, face_index, pixelScreenCo)) + { mask = project_paint_uvpixel_mask(ps, face_index, side, w); @@ -2629,8 +2633,9 @@ static void project_paint_face_init(const ProjPaintState *ps, const int thread_i pixelScreenCo[2] = pixelScreenCo[2] / pixelScreenCo[3]; /* Use the depth for bucket point occlusion */ } - if (ps->do_occlude == 0 || !project_bucket_point_occluded(ps, bucketFaceNodes, face_index, pixelScreenCo)) { - + if ((ps->do_occlude == FALSE) || + !project_bucket_point_occluded(ps, bucketFaceNodes, face_index, pixelScreenCo)) + { /* Only bother calculating the weights if we intersect */ if (ps->do_mask_normal || ps->dm_mtface_clone) { #if 1 @@ -3005,7 +3010,7 @@ static void project_paint_begin(ProjPaintState *ps) ps->dm_mtface_clone = CustomData_get_layer_n(&ps->dm->faceData, CD_MTFACE, layer_num); if (ps->dm_mtface_clone == NULL || ps->dm_mtface_clone == ps->dm_mtface) { - ps->do_layer_clone = 0; + ps->do_layer_clone = FALSE; ps->dm_mtface_clone = NULL; printf("ACK!\n"); } @@ -3018,7 +3023,7 @@ static void project_paint_begin(ProjPaintState *ps) ps->dm_mtface_stencil = CustomData_get_layer_n(&ps->dm->faceData, CD_MTFACE, layer_num); if (ps->dm_mtface_stencil == NULL || ps->dm_mtface_stencil == ps->dm_mtface) { - ps->do_layer_stencil = 0; + ps->do_layer_stencil = FALSE; ps->dm_mtface_stencil = NULL; } } @@ -3850,7 +3855,7 @@ static void *do_projectpaint_thread(void *ph_v) float falloff; int bucket_index; int is_floatbuf = 0; - int use_color_correction = 0; + int use_color_correction = FALSE; const short tool = ps->tool; rctf bucket_bounds; @@ -4808,7 +4813,7 @@ static void project_state_init(bContext *C, Object *ob, ProjPaintState *ps) ps->normal_angle_range = ps->normal_angle - ps->normal_angle_inner; if (ps->normal_angle_range <= 0.0f) - ps->do_mask_normal = 0; /* no need to do blending */ + ps->do_mask_normal = FALSE; /* no need to do blending */ } static void paint_brush_init_tex(Brush *brush) diff --git a/source/blender/editors/sculpt_paint/paint_ops.c b/source/blender/editors/sculpt_paint/paint_ops.c index 368729723eb..23d1c0090a0 100644 --- a/source/blender/editors/sculpt_paint/paint_ops.c +++ b/source/blender/editors/sculpt_paint/paint_ops.c @@ -225,7 +225,8 @@ static Brush *brush_tool_cycle(Main *bmain, Brush *brush_orig, const int tool, c brush = brush->id.next ? brush->id.next : bmain->brush.first) { if ((brush->ob_mode & ob_mode) && - (brush_tool(brush, tool_offset) == tool)) { + (brush_tool(brush, tool_offset) == tool)) + { return brush; } } diff --git a/source/blender/editors/sculpt_paint/paint_vertex.c b/source/blender/editors/sculpt_paint/paint_vertex.c index d544183ced8..7a9ebe9aec4 100644 --- a/source/blender/editors/sculpt_paint/paint_vertex.c +++ b/source/blender/editors/sculpt_paint/paint_vertex.c @@ -1867,7 +1867,7 @@ static void do_weight_paint_vertex( * * So! just balance out the 2 weights, it keeps them equal and everything normalized. * - * While it wont hit the desired weight immediatelty as the user waggles their mouse, + * While it wont hit the desired weight immediately as the user waggles their mouse, * constant painting and re-normalizing will get there. this is also just simpler logic. * - campbell */ dw_mirr->weight = dw->weight = (dw_mirr->weight + dw->weight) * 0.5f; @@ -1952,7 +1952,7 @@ static void do_weight_paint_vertex( /* dv may have been altered greatly */ dw = defvert_find_index(dv, vgroup); #else - dw = NULL; /* UNUSED after assignment, set to NULL to ensuyre we don't + dw = NULL; /* UNUSED after assignment, set to NULL to ensure we don't * use again, we thats needed un-ifdef the line above */ (void)dw; /* quiet warnigns */ #endif diff --git a/source/blender/editors/sculpt_paint/sculpt.c b/source/blender/editors/sculpt_paint/sculpt.c index 7e766ea3388..f5f8a790c55 100644 --- a/source/blender/editors/sculpt_paint/sculpt.c +++ b/source/blender/editors/sculpt_paint/sculpt.c @@ -350,7 +350,8 @@ static int sculpt_get_redraw_rect(ARegion *ar, RegionView3D *rv3d, bb_max, ar, rv3d, - ob)) { + ob)) + { return 0; } @@ -1884,14 +1885,14 @@ static void do_layer_brush(Sculpt *sd, Object *ob, PBVHNode **nodes, int totnode SculptSession *ss = ob->sculpt; Brush *brush = paint_brush(&sd->paint); float bstrength = ss->cache->bstrength; - float area_normal[3], offset[3]; + float offset[3]; float lim = brush->height; int n; if (bstrength < 0) lim = -lim; - mul_v3_v3v3(offset, ss->cache->scale, area_normal); + mul_v3_v3v3(offset, ss->cache->scale, ss->cache->sculpt_normal_symm); #pragma omp parallel for schedule(guided) if (sd->flags & SCULPT_USE_OPENMP) for (n = 0; n < totnode; n++) { @@ -1917,7 +1918,8 @@ static void do_layer_brush(Sculpt *sd, Object *ob, PBVHNode **nodes, int totnode { if (sculpt_brush_test(&test, origco[vd.i])) { const float fade = bstrength * tex_strength(ss, brush, vd.co, test.dist, - area_normal, vd.no, vd.fno, *vd.mask); + ss->cache->sculpt_normal_symm, + vd.no, vd.fno, *vd.mask); float *disp = &layer_disp[vd.i]; float val[3]; @@ -2775,7 +2777,8 @@ static void do_brush_action(Sculpt *sd, Object *ob, Brush *brush) } if (!ELEM(brush->sculpt_tool, SCULPT_TOOL_SMOOTH, SCULPT_TOOL_MASK) && - brush->autosmooth_factor > 0) { + brush->autosmooth_factor > 0) + { if (brush->flag & BRUSH_INVERSE_SMOOTH_PRESSURE) { smooth(sd, ob, nodes, totnode, brush->autosmooth_factor * (1 - ss->cache->pressure), FALSE); } @@ -2867,7 +2870,7 @@ static void sculpt_update_keyblock(Object *ob) SculptSession *ss = ob->sculpt; float (*vertCos)[3]; - /* Keyblock update happens after hadning deformation caused by modifiers, + /* Keyblock update happens after handling deformation caused by modifiers, * so ss->orig_cos would be updated with new stroke */ if (ss->orig_cos) vertCos = ss->orig_cos; else vertCos = BLI_pbvh_get_vertCos(ss->pbvh); @@ -3195,7 +3198,8 @@ static void sculpt_init_mirror_clipping(Object *ob, SculptSession *ss) for (md = ob->modifiers.first; md; md = md->next) { if (md->type == eModifierType_Mirror && - (md->mode & eModifierMode_Realtime)) { + (md->mode & eModifierMode_Realtime)) + { MirrorModifierData *mmd = (MirrorModifierData *)md; if (mmd->flag & MOD_MIR_CLIPPING) { @@ -3354,7 +3358,8 @@ static void sculpt_update_brush_delta(Sculpt *sd, Object *ob, Brush *brush) if (ELEM5(tool, SCULPT_TOOL_GRAB, SCULPT_TOOL_NUDGE, SCULPT_TOOL_CLAY_STRIPS, SCULPT_TOOL_SNAKE_HOOK, - SCULPT_TOOL_THUMB)) { + SCULPT_TOOL_THUMB)) + { float grab_location[3], imat[4][4], delta[3], loc[3]; if (cache->first_time) { diff --git a/source/blender/editors/space_clip/clip_draw.c b/source/blender/editors/space_clip/clip_draw.c index f92f639586d..c00359f0f32 100644 --- a/source/blender/editors/space_clip/clip_draw.c +++ b/source/blender/editors/space_clip/clip_draw.c @@ -263,7 +263,7 @@ static void draw_movieclip_buffer(SpaceClip *sc, ARegion *ar, ImBuf *ibuf, } } - /* if texture buffers aren't efifciently supported or texture is too large to + /* if texture buffers aren't efficiently supported or texture is too large to * be binder fallback to simple draw pixels solution */ if (need_fallback) { /* set zoom */ diff --git a/source/blender/editors/space_clip/clip_ops.c b/source/blender/editors/space_clip/clip_ops.c index 117e599cbbb..5131b728646 100644 --- a/source/blender/editors/space_clip/clip_ops.c +++ b/source/blender/editors/space_clip/clip_ops.c @@ -381,7 +381,7 @@ static int view_pan_modal(bContext *C, wmOperator *op, wmEvent *event) return OPERATOR_FINISHED; default: - if (event->type == vpd->event_type && event->val == KM_RELEASE) { + if (event->type == vpd->event_type && event->val == KM_RELEASE) { view_pan_exit(C, op, 0); return OPERATOR_FINISHED; diff --git a/source/blender/editors/space_console/console_ops.c b/source/blender/editors/space_console/console_ops.c index 5d63a223c08..5ed384d22af 100644 --- a/source/blender/editors/space_console/console_ops.c +++ b/source/blender/editors/space_console/console_ops.c @@ -277,7 +277,7 @@ static int console_move_exec(bContext *C, wmOperator *op) ConsoleLine *ci = console_history_verify(C); int type = RNA_enum_get(op->ptr, "type"); - int done = 0; + int done = FALSE; int pos; switch (type) { @@ -448,7 +448,7 @@ static int console_delete_exec(bContext *C, wmOperator *op) int stride; const short type = RNA_enum_get(op->ptr, "type"); - int done = 0; + int done = FALSE; if (ci->len == 0) { return OPERATOR_CANCELLED; @@ -466,7 +466,7 @@ static int console_delete_exec(bContext *C, wmOperator *op) if (stride) { memmove(ci->line + ci->cursor, ci->line + ci->cursor + stride, (ci->len - ci->cursor) + 1); ci->len -= stride; - done = 1; + done = TRUE; } } break; @@ -482,7 +482,7 @@ static int console_delete_exec(bContext *C, wmOperator *op) ci->cursor -= stride; /* same as above */ memmove(ci->line + ci->cursor, ci->line + ci->cursor + stride, (ci->len - ci->cursor) + 1); ci->len -= stride; - done = 1; + done = TRUE; } } break; diff --git a/source/blender/editors/space_file/file_ops.c b/source/blender/editors/space_file/file_ops.c index 3ff9c3c0520..4bb5a21cb3d 100644 --- a/source/blender/editors/space_file/file_ops.c +++ b/source/blender/editors/space_file/file_ops.c @@ -241,7 +241,7 @@ static int file_border_select_modal(bContext *C, wmOperator *op, wmEvent *event) result= WM_border_select_modal(C, op, event); - if (result==OPERATOR_RUNNING_MODAL) { + if (result == OPERATOR_RUNNING_MODAL) { rect.xmin = RNA_int_get(op->ptr, "xmin"); rect.ymin = RNA_int_get(op->ptr, "ymin"); @@ -820,9 +820,13 @@ void FILE_OT_parent(struct wmOperatorType *ot) static int file_refresh_exec(bContext *C, wmOperator *UNUSED(unused)) { SpaceFile *sfile= CTX_wm_space_file(C); + struct FSMenu* fsmenu = fsmenu_get(); ED_fileselect_clear(C, sfile); + /* refresh system directory menu */ + fsmenu_refresh_system_category(fsmenu); + WM_event_add_notifier(C, NC_SPACE|ND_SPACE_FILE_LIST, NULL); return OPERATOR_FINISHED; diff --git a/source/blender/editors/space_file/file_panels.c b/source/blender/editors/space_file/file_panels.c index 9fe1940e87b..a17a7edbd80 100644 --- a/source/blender/editors/space_file/file_panels.c +++ b/source/blender/editors/space_file/file_panels.c @@ -174,7 +174,7 @@ static void file_panel_operator_header(const bContext *C, Panel *pa) SpaceFile *sfile= CTX_wm_space_file(C); wmOperator *op= sfile->op; - BLI_strncpy(pa->drawname, op->type->name, sizeof(pa->drawname)); + BLI_strncpy(pa->drawname, RNA_struct_ui_name(op->type->srna), sizeof(pa->drawname)); } static int file_panel_check_prop(PointerRNA *UNUSED(ptr), PropertyRNA *prop) diff --git a/source/blender/editors/space_file/filelist.c b/source/blender/editors/space_file/filelist.c index 107acbf49b1..d84214413da 100644 --- a/source/blender/editors/space_file/filelist.c +++ b/source/blender/editors/space_file/filelist.c @@ -1299,7 +1299,7 @@ static void thumbnails_startjob(void *tjv, short *stop, short *do_update, float limg->flags |= MOVIEFILE_ICON; } } - *do_update = 1; + *do_update = TRUE; PIL_sleep_ms(10); limg = limg->next; } @@ -1319,7 +1319,7 @@ static void thumbnails_update(void *tjv) tj->filelist->filelist[limg->index].flags &= ~MOVIEFILE; tj->filelist->filelist[limg->index].flags |= MOVIEFILE_ICON; } - limg->done=1; + limg->done = TRUE; } limg = limg->next; } diff --git a/source/blender/editors/space_file/filesel.c b/source/blender/editors/space_file/filesel.c index b17ca5ee319..b0818d40e53 100644 --- a/source/blender/editors/space_file/filesel.c +++ b/source/blender/editors/space_file/filesel.c @@ -300,8 +300,9 @@ FileSelection ED_fileselect_layout_offset_rect(FileLayout* layout, const rcti* r colmax = (rect->xmax)/(layout->tile_w + 2*layout->tile_border_x); rowmax = (rect->ymax)/(layout->tile_h + 2*layout->tile_border_y); - if ( is_inside(colmin, rowmin, layout->columns, layout->rows) || - is_inside(colmax, rowmax, layout->columns, layout->rows) ) { + if (is_inside(colmin, rowmin, layout->columns, layout->rows) || + is_inside(colmax, rowmax, layout->columns, layout->rows) ) + { CLAMP(colmin, 0, layout->columns-1); CLAMP(rowmin, 0, layout->rows-1); CLAMP(colmax, 0, layout->columns-1); diff --git a/source/blender/editors/space_file/fsmenu.c b/source/blender/editors/space_file/fsmenu.c index 50261175852..ac3cc15fe88 100644 --- a/source/blender/editors/space_file/fsmenu.c +++ b/source/blender/editors/space_file/fsmenu.c @@ -39,6 +39,7 @@ #include "DNA_space_types.h" /* FILE_MAX */ +#include "BLI_utildefines.h" #include "BLI_blenlib.h" #include "BLI_linklist.h" #include "BLI_dynstr.h" @@ -295,7 +296,7 @@ void fsmenu_read_bookmarks(struct FSMenu *fsmenu, const char *filename) fclose(fp); } -void fsmenu_read_system(struct FSMenu *fsmenu) +void fsmenu_read_system(struct FSMenu *fsmenu, int read_bookmarks) { char line[256]; #ifdef WIN32 @@ -319,10 +320,12 @@ void fsmenu_read_system(struct FSMenu *fsmenu) } /* Adding Desktop and My Documents */ - SHGetSpecialFolderPath(0, line, CSIDL_PERSONAL, 0); - fsmenu_insert_entry(fsmenu, FS_CATEGORY_BOOKMARKS, line, 1, 0); - SHGetSpecialFolderPath(0, line, CSIDL_DESKTOPDIRECTORY, 0); - fsmenu_insert_entry(fsmenu, FS_CATEGORY_BOOKMARKS, line, 1, 0); + if (read_bookmarks) { + SHGetSpecialFolderPath(0, line, CSIDL_PERSONAL, 0); + fsmenu_insert_entry(fsmenu, FS_CATEGORY_BOOKMARKS, line, 1, 0); + SHGetSpecialFolderPath(0, line, CSIDL_DESKTOPDIRECTORY, 0); + fsmenu_insert_entry(fsmenu, FS_CATEGORY_BOOKMARKS, line, 1, 0); + } } #else #ifdef __APPLE__ @@ -352,7 +355,7 @@ void fsmenu_read_system(struct FSMenu *fsmenu) * assume they are the standard ones * TODO : replace hardcoded paths with proper BLI_get_folder calls */ home = getenv("HOME"); - if (home) { + if (read_bookmarks && home) { BLI_snprintf(line, 256, "%s/", home); fsmenu_insert_entry(fsmenu, FS_CATEGORY_BOOKMARKS, line, 1, 0); BLI_snprintf(line, 256, "%s/Desktop/", home); @@ -437,32 +440,34 @@ void fsmenu_read_system(struct FSMenu *fsmenu) } /* Finally get user favorite places */ - list = LSSharedFileListCreate(NULL, kLSSharedFileListFavoriteItems, NULL); - pathesArray = LSSharedFileListCopySnapshot(list, &seed); - pathesCount = CFArrayGetCount(pathesArray); - - for (i = 0; i < pathesCount; i++) { - itemRef = (LSSharedFileListItemRef)CFArrayGetValueAtIndex(pathesArray, i); - - err = LSSharedFileListItemResolve(itemRef, - kLSSharedFileListNoUserInteraction | - kLSSharedFileListDoNotMountVolumes, - &cfURL, NULL); - if (err != noErr) - continue; - - pathString = CFURLCopyFileSystemPath(cfURL, kCFURLPOSIXPathStyle); + if(read_bookmarks) { + list = LSSharedFileListCreate(NULL, kLSSharedFileListFavoriteItems, NULL); + pathesArray = LSSharedFileListCopySnapshot(list, &seed); + pathesCount = CFArrayGetCount(pathesArray); - if (!CFStringGetCString(pathString, line, 256, kCFStringEncodingASCII)) - continue; - fsmenu_insert_entry(fsmenu, FS_CATEGORY_BOOKMARKS, line, 1, 0); + for (i = 0; i < pathesCount; i++) { + itemRef = (LSSharedFileListItemRef)CFArrayGetValueAtIndex(pathesArray, i); + + err = LSSharedFileListItemResolve(itemRef, + kLSSharedFileListNoUserInteraction | + kLSSharedFileListDoNotMountVolumes, + &cfURL, NULL); + if (err != noErr) + continue; + + pathString = CFURLCopyFileSystemPath(cfURL, kCFURLPOSIXPathStyle); + + if (!CFStringGetCString(pathString, line, 256, kCFStringEncodingASCII)) + continue; + fsmenu_insert_entry(fsmenu, FS_CATEGORY_BOOKMARKS, line, 1, 0); + + CFRelease(pathString); + CFRelease(cfURL); + } - CFRelease(pathString); - CFRelease(cfURL); + CFRelease(pathesArray); + CFRelease(list); } - - CFRelease(pathesArray); - CFRelease(list); #endif /* OSX 10.5+ */ } #else @@ -470,7 +475,7 @@ void fsmenu_read_system(struct FSMenu *fsmenu) { const char *home = getenv("HOME"); - if (home) { + if (read_bookmarks && home) { BLI_snprintf(line, FILE_MAXDIR, "%s/", home); fsmenu_insert_entry(fsmenu, FS_CATEGORY_BOOKMARKS, line, 1, 0); BLI_snprintf(line, FILE_MAXDIR, "%s/Desktop/", home); @@ -537,6 +542,15 @@ static void fsmenu_free_category(struct FSMenu *fsmenu, FSMenuCategory category) } } +void fsmenu_refresh_system_category(struct FSMenu *fsmenu) +{ + fsmenu_free_category(fsmenu, FS_CATEGORY_SYSTEM); + fsmenu_set_category(fsmenu, FS_CATEGORY_SYSTEM, NULL); + + /* Add all entries to system category */ + fsmenu_read_system(fsmenu, FALSE); +} + void fsmenu_free(struct FSMenu *fsmenu) { fsmenu_free_category(fsmenu, FS_CATEGORY_SYSTEM); diff --git a/source/blender/editors/space_file/fsmenu.h b/source/blender/editors/space_file/fsmenu.h index c926a4f382c..e5b3d54ac9f 100644 --- a/source/blender/editors/space_file/fsmenu.h +++ b/source/blender/editors/space_file/fsmenu.h @@ -74,10 +74,13 @@ void fsmenu_write_file (struct FSMenu* fsmenu, const char *filename); void fsmenu_read_bookmarks (struct FSMenu* fsmenu, const char *filename); /** adds system specific directories */ -void fsmenu_read_system (struct FSMenu* fsmenu); +void fsmenu_read_system (struct FSMenu* fsmenu, int read_bookmarks); /** Free's all the memory associated with the fsmenu */ void fsmenu_free (struct FSMenu* fsmenu); + /** Refresh system directory menu */ +void fsmenu_refresh_system_category (struct FSMenu* fsmenu); + #endif diff --git a/source/blender/editors/space_file/space_file.c b/source/blender/editors/space_file/space_file.c index dac5d1e1347..a90daa7e1e9 100644 --- a/source/blender/editors/space_file/space_file.c +++ b/source/blender/editors/space_file/space_file.c @@ -151,6 +151,9 @@ static void file_init(struct wmWindowManager *UNUSED(wm), ScrArea *sa) SpaceFile *sfile= (SpaceFile*)sa->spacedata.first; //printf("file_init\n"); + /* refresh system directory list */ + fsmenu_refresh_system_category(fsmenu_get()); + if (sfile->layout) sfile->layout->dirty= TRUE; } @@ -613,7 +616,7 @@ void ED_file_init(void) { char *cfgdir = BLI_get_folder(BLENDER_USER_CONFIG, NULL); - fsmenu_read_system(fsmenu_get()); + fsmenu_read_system(fsmenu_get(), TRUE); if (cfgdir) { char name[FILE_MAX]; diff --git a/source/blender/editors/space_graph/graph_edit.c b/source/blender/editors/space_graph/graph_edit.c index 7371202b4fb..2d9a7baa213 100644 --- a/source/blender/editors/space_graph/graph_edit.c +++ b/source/blender/editors/space_graph/graph_edit.c @@ -2032,7 +2032,7 @@ static int graphkeys_smooth_exec(bContext *C, wmOperator *UNUSED(op)) /* smooth keyframes */ for (ale = anim_data.first; ale; ale = ale->next) { /* For now, we can only smooth by flattening handles AND smoothing curve values. - * Perhaps the mode argument could be removed, as that functionality is offerred through + * Perhaps the mode argument could be removed, as that functionality is offered through * Snap->Flatten Handles anyway. */ smooth_fcurve(ale->key_data); diff --git a/source/blender/editors/space_image/image_ops.c b/source/blender/editors/space_image/image_ops.c index e2ab5ea64e4..31389bcb20c 100644 --- a/source/blender/editors/space_image/image_ops.c +++ b/source/blender/editors/space_image/image_ops.c @@ -313,7 +313,7 @@ static int image_view_pan_modal(bContext *C, wmOperator *op, wmEvent *event) image_view_pan_exec(C, op); break; default: - if (event->type == vpd->event_type && event->val == KM_RELEASE) { + if (event->type == vpd->event_type && event->val == KM_RELEASE) { image_view_pan_exit(C, op, 0); return OPERATOR_FINISHED; } diff --git a/source/blender/editors/space_logic/logic_window.c b/source/blender/editors/space_logic/logic_window.c index 97b6c32d81d..dd21fca93ce 100644 --- a/source/blender/editors/space_logic/logic_window.c +++ b/source/blender/editors/space_logic/logic_window.c @@ -775,7 +775,7 @@ static ID **get_selected_and_linked_obs(bContext *C, short *count, short scavisf bSensor *sens; bController *cont; unsigned int lay; - int a, nr, doit; + int a, nr, do_it; /* we need a sorted object list */ /* set scavisflags flags in Objects to indicate these should be evaluated */ @@ -815,9 +815,9 @@ static ID **get_selected_and_linked_obs(bContext *C, short *count, short scavisf /* BUTS_XXX_STATE are similar to BUTS_XXX_LINK for selecting the object */ if (scavisflag & (BUTS_SENS_LINK|BUTS_CONT_LINK|BUTS_ACT_LINK|BUTS_SENS_STATE|BUTS_ACT_STATE)) { - doit= 1; - while (doit) { - doit= 0; + do_it = TRUE; + while (do_it) { + do_it = FALSE; ob= bmain->object.first; while (ob) { @@ -830,32 +830,32 @@ static ID **get_selected_and_linked_obs(bContext *C, short *count, short scavisf if (sens->links[a]) { obt= (Object *)sens->links[a]->mynew; if (obt && (obt->scavisflag & OB_VIS_CONT)) { - doit= 1; + do_it = TRUE; ob->scavisflag |= OB_VIS_SENS; break; } } } - if (doit) break; + if (do_it) break; sens= sens->next; } } /* 2nd case: select cont when act selected */ - if ((scavisflag & BUTS_CONT_LINK) && (ob->scavisflag & OB_VIS_CONT)==0) { + if ((scavisflag & BUTS_CONT_LINK) && (ob->scavisflag & OB_VIS_CONT)==0) { cont= ob->controllers.first; while (cont) { for (a=0; a<cont->totlinks; a++) { if (cont->links[a]) { obt= (Object *)cont->links[a]->mynew; if (obt && (obt->scavisflag & OB_VIS_ACT)) { - doit= 1; + do_it = TRUE; ob->scavisflag |= OB_VIS_CONT; break; } } } - if (doit) break; + if (do_it) break; cont= cont->next; } } @@ -868,7 +868,7 @@ static ID **get_selected_and_linked_obs(bContext *C, short *count, short scavisf if (sens->links[a]) { obt= (Object *)sens->links[a]->mynew; if (obt && (obt->scavisflag & OB_VIS_CONT)==0) { - doit= 1; + do_it = TRUE; obt->scavisflag |= OB_VIS_CONT; } } @@ -878,14 +878,14 @@ static ID **get_selected_and_linked_obs(bContext *C, short *count, short scavisf } /* 4th case: select actuator when controller selected */ - if ( (scavisflag & (BUTS_ACT_LINK|BUTS_ACT_STATE)) && (ob->scavisflag & OB_VIS_CONT)) { + if ( (scavisflag & (BUTS_ACT_LINK|BUTS_ACT_STATE)) && (ob->scavisflag & OB_VIS_CONT)) { cont= ob->controllers.first; while (cont) { for (a=0; a<cont->totlinks; a++) { if (cont->links[a]) { obt= (Object *)cont->links[a]->mynew; if (obt && (obt->scavisflag & OB_VIS_ACT)==0) { - doit= 1; + do_it = TRUE; obt->scavisflag |= OB_VIS_ACT; } } @@ -3333,7 +3333,7 @@ static void draw_sensor_joystick(uiLayout *layout, PointerRNA *ptr) uiItemR(layout, ptr, "use_all_events", 0, NULL, ICON_NONE); col = uiLayoutColumn(layout, 0); - uiLayoutSetActive(col, RNA_boolean_get(ptr, "use_all_events")==0); + uiLayoutSetActive(col, RNA_boolean_get(ptr, "use_all_events") == FALSE); uiItemR(col, ptr, "button_number", 0, NULL, ICON_NONE); break; case SENS_JOY_AXIS: @@ -3343,7 +3343,7 @@ static void draw_sensor_joystick(uiLayout *layout, PointerRNA *ptr) uiItemR(layout, ptr, "use_all_events", 0, NULL, ICON_NONE); col = uiLayoutColumn(layout, 0); - uiLayoutSetActive(col, RNA_boolean_get(ptr, "use_all_events")==0); + uiLayoutSetActive(col, RNA_boolean_get(ptr, "use_all_events") == FALSE); uiItemR(col, ptr, "axis_direction", 0, NULL, ICON_NONE); break; case SENS_JOY_HAT: @@ -3351,7 +3351,7 @@ static void draw_sensor_joystick(uiLayout *layout, PointerRNA *ptr) uiItemR(layout, ptr, "use_all_events", 0, NULL, ICON_NONE); col = uiLayoutColumn(layout, 0); - uiLayoutSetActive(col, RNA_boolean_get(ptr, "use_all_events")==0); + uiLayoutSetActive(col, RNA_boolean_get(ptr, "use_all_events") == FALSE); uiItemR(col, ptr, "hat_direction", 0, NULL, ICON_NONE); break; case SENS_JOY_AXIS_SINGLE: @@ -3371,13 +3371,13 @@ static void draw_sensor_keyboard(uiLayout *layout, PointerRNA *ptr) row = uiLayoutRow(layout, 0); uiItemL(row, "Key:", ICON_NONE); col = uiLayoutColumn(row, 0); - uiLayoutSetActive(col, RNA_boolean_get(ptr, "use_all_keys")==0); + uiLayoutSetActive(col, RNA_boolean_get(ptr, "use_all_keys") == FALSE); uiItemR(col, ptr, "key", UI_ITEM_R_EVENT, "", ICON_NONE); col = uiLayoutColumn(row, 0); uiItemR(col, ptr, "use_all_keys", UI_ITEM_R_TOGGLE, NULL, ICON_NONE); col = uiLayoutColumn(layout, 0); - uiLayoutSetActive(col, RNA_boolean_get(ptr, "use_all_keys")==0); + uiLayoutSetActive(col, RNA_boolean_get(ptr, "use_all_keys") == FALSE); row = uiLayoutRow(col, 0); uiItemL(row, "First Modifier:", ICON_NONE); uiItemR(row, ptr, "modifier_key_1", UI_ITEM_R_EVENT, "", ICON_NONE); @@ -3843,7 +3843,7 @@ static void draw_actuator_constraint(uiLayout *layout, PointerRNA *ptr, bContext col = uiLayoutColumn(row, 1); uiItemR(col, ptr, "use_force_distance", UI_ITEM_R_TOGGLE, NULL, ICON_NONE); sub = uiLayoutColumn(col, 0); - uiLayoutSetActive(sub, RNA_boolean_get(ptr, "use_force_distance")==1); + uiLayoutSetActive(sub, RNA_boolean_get(ptr, "use_force_distance") == TRUE); uiItemR(sub, ptr, "distance", 0, "", ICON_NONE); uiItemR(layout, ptr, "damping", UI_ITEM_R_SLIDER, NULL, ICON_NONE); @@ -3976,7 +3976,7 @@ static void draw_actuator_filter_2d(uiLayout *layout, PointerRNA *ptr) case ACT_2DFILTER_MOTIONBLUR: split=uiLayoutSplit(layout, 0.75, 1); row= uiLayoutRow(split, 0); - uiLayoutSetActive(row, RNA_boolean_get(ptr, "use_motion_blur")==1); + uiLayoutSetActive(row, RNA_boolean_get(ptr, "use_motion_blur") == TRUE); uiItemR(row, ptr, "motion_blur_factor", 0, NULL, ICON_NONE); uiItemR(split, ptr, "use_motion_blur", UI_ITEM_R_TOGGLE, NULL, ICON_NONE); break; @@ -4080,21 +4080,21 @@ static void draw_actuator_motion(uiLayout *layout, PointerRNA *ptr) col = uiLayoutColumn(row, 0); uiItemR(col, ptr, "use_servo_limit_x", UI_ITEM_R_TOGGLE, NULL, ICON_NONE); sub = uiLayoutColumn(col, 1); - uiLayoutSetActive(sub, RNA_boolean_get(ptr, "use_servo_limit_x")==1); + uiLayoutSetActive(sub, RNA_boolean_get(ptr, "use_servo_limit_x") == TRUE); uiItemR(sub, ptr, "force_max_x", 0, NULL, ICON_NONE); uiItemR(sub, ptr, "force_min_x", 0, NULL, ICON_NONE); col = uiLayoutColumn(row, 0); uiItemR(col, ptr, "use_servo_limit_y", UI_ITEM_R_TOGGLE, NULL, ICON_NONE); sub = uiLayoutColumn(col, 1); - uiLayoutSetActive(sub, RNA_boolean_get(ptr, "use_servo_limit_y")==1); + uiLayoutSetActive(sub, RNA_boolean_get(ptr, "use_servo_limit_y") == TRUE); uiItemR(sub, ptr, "force_max_y", 0, NULL, ICON_NONE); uiItemR(sub, ptr, "force_min_y", 0, NULL, ICON_NONE); col = uiLayoutColumn(row, 0); uiItemR(col, ptr, "use_servo_limit_z", UI_ITEM_R_TOGGLE, NULL, ICON_NONE); sub = uiLayoutColumn(col, 1); - uiLayoutSetActive(sub, RNA_boolean_get(ptr, "use_servo_limit_z")==1); + uiLayoutSetActive(sub, RNA_boolean_get(ptr, "use_servo_limit_z") == TRUE); uiItemR(sub, ptr, "force_max_z", 0, NULL, ICON_NONE); uiItemR(sub, ptr, "force_min_z", 0, NULL, ICON_NONE); @@ -4122,7 +4122,7 @@ static void draw_actuator_parent(uiLayout *layout, PointerRNA *ptr) row = uiLayoutRow(layout, 0); uiItemR(row, ptr, "use_compound", 0, NULL, ICON_NONE); sub= uiLayoutRow(row, 0); - uiLayoutSetActive(sub, RNA_boolean_get(ptr, "use_compound")==1); + uiLayoutSetActive(sub, RNA_boolean_get(ptr, "use_compound") == TRUE); uiItemR(sub, ptr, "use_ghost", 0, NULL, ICON_NONE); } } @@ -4305,7 +4305,7 @@ static void draw_actuator_sound(uiLayout *layout, PointerRNA *ptr, bContext *C) uiItemR(layout, ptr, "use_sound_3d", 0, NULL, ICON_NONE); col = uiLayoutColumn(layout, 0); - uiLayoutSetActive(col, RNA_boolean_get(ptr, "use_sound_3d")==1); + uiLayoutSetActive(col, RNA_boolean_get(ptr, "use_sound_3d") == TRUE); row = uiLayoutRow(col, 0); uiItemR(row, ptr, "gain_3d_min", 0, NULL, ICON_NONE); @@ -4565,7 +4565,7 @@ static void logic_buttons_new(bContext *C, ARegion *ar) subsplit= uiLayoutSplit(split, 0.85, 0); col= uiLayoutColumn(subsplit, 0); row= uiLayoutRow(col, 0); - uiLayoutSetActive(row, RNA_boolean_get(&settings_ptr, "use_all_states")==0); + uiLayoutSetActive(row, RNA_boolean_get(&settings_ptr, "use_all_states") == FALSE); uiTemplateLayers(row, &settings_ptr, "states_visible", &settings_ptr, "used_states", 0); row= uiLayoutRow(col, 0); uiTemplateLayers(row, &settings_ptr, "states_initial", &settings_ptr, "used_states", 0); @@ -5070,8 +5070,8 @@ void logic_buttons(bContext *C, ARegion *ar) if (!(slogic->scaflag & BUTS_ACT_STATE) || !(act->flag & ACT_LINKED) || /* always display actuators without links so that is can be edited */ (act->flag & ACT_VISIBLE) || /* this actuator has visible connection, display it */ - (act->flag & ACT_PIN && slogic->scaflag & BUTS_ACT_STATE)) { - + (act->flag & ACT_PIN && slogic->scaflag & BUTS_ACT_STATE)) + { pin = (slogic->scaflag & BUTS_ACT_STATE && (act->flag & SENS_SHOW || act->flag & SENS_PIN)) ? 1 : 0; act->flag |= ACT_VISIBLE; /* mark the actuator as visible to help implementing the up/down action */ diff --git a/source/blender/editors/space_nla/nla_buttons.c b/source/blender/editors/space_nla/nla_buttons.c index 95a56176523..63e518e5aaa 100644 --- a/source/blender/editors/space_nla/nla_buttons.c +++ b/source/blender/editors/space_nla/nla_buttons.c @@ -335,11 +335,11 @@ static void nla_panel_properties(const bContext *C, Panel *pa) * - blend in/out can only be set when autoblending is off */ column = uiLayoutColumn(layout, 1); - uiLayoutSetActive(column, RNA_boolean_get(&strip_ptr, "use_animated_influence") == 0); + uiLayoutSetActive(column, RNA_boolean_get(&strip_ptr, "use_animated_influence") == FALSE); uiItemR(column, &strip_ptr, "use_auto_blend", 0, NULL, ICON_NONE); // XXX as toggle? sub = uiLayoutColumn(column, 1); - uiLayoutSetActive(sub, RNA_boolean_get(&strip_ptr, "use_auto_blend") == 0); + uiLayoutSetActive(sub, RNA_boolean_get(&strip_ptr, "use_auto_blend") == FALSE); uiItemR(sub, &strip_ptr, "blend_in", 0, NULL, ICON_NONE); uiItemR(sub, &strip_ptr, "blend_out", 0, NULL, ICON_NONE); @@ -383,7 +383,7 @@ static void nla_panel_actclip(const bContext *C, Panel *pa) /* action usage */ column = uiLayoutColumn(layout, 1); - uiLayoutSetActive(column, RNA_boolean_get(&strip_ptr, "use_animated_time") == 0); + uiLayoutSetActive(column, RNA_boolean_get(&strip_ptr, "use_animated_time") == FALSE); uiItemL(column, "Playback Settings:", ICON_NONE); uiItemR(column, &strip_ptr, "scale", 0, NULL, ICON_NONE); uiItemR(column, &strip_ptr, "repeat", 0, NULL, ICON_NONE); diff --git a/source/blender/editors/space_nla/nla_draw.c b/source/blender/editors/space_nla/nla_draw.c index c12cd6f2d39..a6578ffb3f7 100644 --- a/source/blender/editors/space_nla/nla_draw.c +++ b/source/blender/editors/space_nla/nla_draw.c @@ -676,7 +676,7 @@ static void draw_nla_channel_list_gl(bAnimContext *ac, ListBase *anim_data, View short indent = 0, offset = 0, sel = 0, group = 0, nonSolo = 0; int expand = -1, protect = -1, special = -1, mute = -1; char name[128]; - short doDraw = 0; + short do_draw = FALSE; /* determine what needs to be drawn */ switch (ale->type) { @@ -695,7 +695,7 @@ static void draw_nla_channel_list_gl(bAnimContext *ac, ListBase *anim_data, View if (((nlt->flag & NLATRACK_ACTIVE) && (nlt->flag & NLATRACK_DISABLED)) == 0) { if (nlt->flag & NLATRACK_MUTED) mute = ICON_MUTE_IPO_ON; - else + else mute = ICON_MUTE_IPO_OFF; if (EDITABLE_NLT(nlt)) @@ -716,8 +716,8 @@ static void draw_nla_channel_list_gl(bAnimContext *ac, ListBase *anim_data, View sel = SEL_NLT(nlt); BLI_strncpy(name, nlt->name, sizeof(name)); - // draw manually still - doDraw = 1; + /* draw manually still */ + do_draw = TRUE; } break; case ANIMTYPE_NLAACTION: /* NLA Action-Line */ @@ -733,8 +733,8 @@ static void draw_nla_channel_list_gl(bAnimContext *ac, ListBase *anim_data, View else BLI_strncpy(name, "<No Action>", sizeof(name)); - // draw manually still - doDraw = 1; + /* draw manually still */ + do_draw = TRUE; } break; @@ -745,7 +745,7 @@ static void draw_nla_channel_list_gl(bAnimContext *ac, ListBase *anim_data, View } /* if special types, draw manually for now... */ - if (doDraw) { + if (do_draw) { if (ale->id) { /* special exception for textures */ if (GS(ale->id->name) == ID_TE) { diff --git a/source/blender/editors/space_nla/nla_edit.c b/source/blender/editors/space_nla/nla_edit.c index 8a7e2a8a904..5c9994e46d3 100644 --- a/source/blender/editors/space_nla/nla_edit.c +++ b/source/blender/editors/space_nla/nla_edit.c @@ -503,7 +503,7 @@ static int nlaedit_add_transition_exec(bContext *C, wmOperator *op) bAnimListElem *ale; int filter; - int done = 0; + int done = FALSE; /* get editor data */ if (ANIM_animdata_get_context(C, &ac) == 0) @@ -822,7 +822,7 @@ static int nlaedit_duplicate_exec(bContext *C, wmOperator *UNUSED(op)) bAnimListElem *ale; int filter; - short done = 0; + short done = FALSE; /* get editor data */ if (ANIM_animdata_get_context(C, &ac) == 0) diff --git a/source/blender/editors/space_node/drawnode.c b/source/blender/editors/space_node/drawnode.c index d9fc793adb3..ecdd30ce966 100644 --- a/source/blender/editors/space_node/drawnode.c +++ b/source/blender/editors/space_node/drawnode.c @@ -1262,6 +1262,9 @@ static void node_composit_buts_image(uiLayout *layout, bContext *C, PointerRNA * } col= uiLayoutColumn(layout, 0); + + if (RNA_enum_get(&imaptr, "type")== IMA_TYPE_MULTILAYER) + uiItemR(col, ptr, "layer", 0, NULL, ICON_NONE); } static void node_composit_buts_renderlayers(uiLayout *layout, bContext *C, PointerRNA *ptr) @@ -1376,7 +1379,7 @@ static void node_composit_buts_defocus(uiLayout *layout, bContext *UNUSED(C), Po uiItemR(layout, ptr, "use_gamma_correction", 0, NULL, ICON_NONE); col = uiLayoutColumn(layout, 0); - uiLayoutSetActive(col, RNA_boolean_get(ptr, "use_zbuffer")==1); + uiLayoutSetActive(col, RNA_boolean_get(ptr, "use_zbuffer") == TRUE); uiItemR(col, ptr, "f_stop", 0, NULL, ICON_NONE); uiItemR(layout, ptr, "blur_max", 0, NULL, ICON_NONE); @@ -1391,7 +1394,7 @@ static void node_composit_buts_defocus(uiLayout *layout, bContext *UNUSED(C), Po col = uiLayoutColumn(layout, 0); uiItemR(col, ptr, "use_zbuffer", 0, NULL, ICON_NONE); sub = uiLayoutColumn(col, 0); - uiLayoutSetActive(sub, RNA_boolean_get(ptr, "use_zbuffer")==0); + uiLayoutSetActive(sub, RNA_boolean_get(ptr, "use_zbuffer") == FALSE); uiItemR(sub, ptr, "z_scale", 0, NULL, ICON_NONE); } @@ -1453,7 +1456,7 @@ static void node_composit_buts_lensdist(uiLayout *layout, bContext *UNUSED(C), P uiItemR(col, ptr, "use_projector", 0, NULL, ICON_NONE); col = uiLayoutColumn(col, 0); - uiLayoutSetActive(col, RNA_boolean_get(ptr, "use_projector")==0); + uiLayoutSetActive(col, RNA_boolean_get(ptr, "use_projector") == FALSE); uiItemR(col, ptr, "use_jitter", 0, NULL, ICON_NONE); uiItemR(col, ptr, "use_fit", 0, NULL, ICON_NONE); } @@ -1579,7 +1582,11 @@ static void node_composit_buts_hue_sat(uiLayout *layout, bContext *UNUSED(C), Po static void node_composit_buts_dilateerode(uiLayout *layout, bContext *UNUSED(C), PointerRNA *ptr) { + uiItemR(layout, ptr, "type", 0, NULL, ICON_NONE); uiItemR(layout, ptr, "distance", 0, NULL, ICON_NONE); + if (RNA_enum_get(ptr, "type") == CMP_NODE_DILATEERODE_DISTANCE) { + uiItemR(layout, ptr, "edge", 0, NULL, ICON_NONE); + } } static void node_composit_buts_diff_matte(uiLayout *layout, bContext *UNUSED(C), PointerRNA *ptr) @@ -1624,7 +1631,7 @@ static void node_composit_buts_color_spill(uiLayout *layout, bContext *UNUSED(C) uiItemR(col, ptr, "ratio", UI_ITEM_R_SLIDER, NULL, ICON_NONE); uiItemR(col, ptr, "use_unspill", 0, NULL, ICON_NONE); - if (RNA_boolean_get(ptr, "use_unspill")== 1) { + if (RNA_boolean_get(ptr, "use_unspill") == TRUE) { uiItemR(col, ptr, "unspill_red", UI_ITEM_R_SLIDER, NULL, ICON_NONE); uiItemR(col, ptr, "unspill_green", UI_ITEM_R_SLIDER, NULL, ICON_NONE); uiItemR(col, ptr, "unspill_blue", UI_ITEM_R_SLIDER, NULL, ICON_NONE); @@ -1815,7 +1822,7 @@ static void node_composit_buts_file_output_details(uiLayout *layout, bContext *C uiItemR(col, &active_input_ptr, "use_node_format", 0, NULL, 0); col= uiLayoutColumn(layout, 0); - uiLayoutSetActive(col, RNA_boolean_get(&active_input_ptr, "use_node_format")==0); + uiLayoutSetActive(col, RNA_boolean_get(&active_input_ptr, "use_node_format") == FALSE); uiTemplateImageSettings(col, &imfptr); } } @@ -2973,8 +2980,8 @@ void node_draw_link_straight(View2D *v2d, SpaceNode *snode, bNodeLink *link, int /* note; this is used for fake links in groups too */ void node_draw_link(View2D *v2d, SpaceNode *snode, bNodeLink *link) { - int do_shaded= 0, th_col1= TH_HEADER, th_col2= TH_HEADER; - int do_triple= 0, th_col3= TH_WIRE; + int do_shaded= FALSE, th_col1= TH_HEADER, th_col2= TH_HEADER; + int do_triple= FALSE, th_col3= TH_WIRE; if (link->fromsock==NULL && link->tosock==NULL) return; @@ -2982,7 +2989,7 @@ void node_draw_link(View2D *v2d, SpaceNode *snode, bNodeLink *link) /* new connection */ if (!link->fromsock || !link->tosock) { th_col1 = TH_ACTIVE; - do_triple = 1; + do_triple = TRUE; } else { /* going to give issues once... */ @@ -2994,7 +3001,7 @@ void node_draw_link(View2D *v2d, SpaceNode *snode, bNodeLink *link) /* a bit ugly... but thats how we detect the internal group links */ if (!link->fromnode || !link->tonode) { UI_ThemeColorBlend(TH_BACK, TH_WIRE, 0.5f); - do_shaded= 0; + do_shaded = FALSE; } else { /* check cyclic */ @@ -3010,8 +3017,8 @@ void node_draw_link(View2D *v2d, SpaceNode *snode, bNodeLink *link) if (link->tonode->flag & SELECT) th_col2= TH_EDGE_SELECT; } - do_shaded= 1; - do_triple= 1; + do_shaded = TRUE; + do_triple = TRUE; } else { th_col1 = TH_REDALERT; diff --git a/source/blender/editors/space_node/node_edit.c b/source/blender/editors/space_node/node_edit.c index f71ce3f960c..8847dc3650a 100644 --- a/source/blender/editors/space_node/node_edit.c +++ b/source/blender/editors/space_node/node_edit.c @@ -125,7 +125,7 @@ static void compo_redrawjob(void *cjv, char *UNUSED(str)) { CompoJob *cj= cjv; - *(cj->do_update)= 1; + *(cj->do_update) = TRUE; } static void compo_freejob(void *cjv) @@ -169,7 +169,7 @@ static void compo_startjob(void *cjv, short *stop, short *do_update, float *prog CompoJob *cj= cjv; bNodeTree *ntree= cj->localtree; - if (cj->scene->use_nodes==0) + if (cj->scene->use_nodes == FALSE) return; cj->stop= stop; @@ -2366,7 +2366,7 @@ static int node_link_modal(bContext *C, wmOperator *op, wmEvent *event) ntreeUpdateTree(snode->edittree); } else { - int do_update = 0; + int do_update = FALSE; for (linkdata=nldrag->links.first; linkdata; linkdata=linkdata->next) { link = linkdata->data; @@ -2377,11 +2377,12 @@ static int node_link_modal(bContext *C, wmOperator *op, wmEvent *event) link->tosock= NULL; snode->edittree->update |= NTREE_UPDATE_LINKS; - do_update = 1; + do_update = TRUE; } } - if (do_update) + if (do_update) { ntreeUpdateTree(snode->edittree); + } } } else { @@ -2408,7 +2409,7 @@ static int node_link_modal(bContext *C, wmOperator *op, wmEvent *event) ntreeUpdateTree(snode->edittree); } else { - int do_update = 0; + int do_update = FALSE; for (linkdata=nldrag->links.first; linkdata; linkdata=linkdata->next) { link = linkdata->data; @@ -2419,11 +2420,12 @@ static int node_link_modal(bContext *C, wmOperator *op, wmEvent *event) link->fromsock= NULL; snode->edittree->update |= NTREE_UPDATE_LINKS; - do_update = 1; + do_update = TRUE; } } - if (do_update) + if (do_update) { ntreeUpdateTree(snode->edittree); + } } } diff --git a/source/blender/editors/space_sequencer/sequencer_draw.c b/source/blender/editors/space_sequencer/sequencer_draw.c index 49fadf300e2..392e7793a0f 100644 --- a/source/blender/editors/space_sequencer/sequencer_draw.c +++ b/source/blender/editors/space_sequencer/sequencer_draw.c @@ -367,7 +367,8 @@ static void draw_seq_handle(View2D *v2d, Sequence *seq, float pixelx, short dire /* draw! */ if (seq->type < SEQ_EFFECT || - get_sequence_effect_num_inputs(seq->type) == 0) { + get_sequence_effect_num_inputs(seq->type) == 0) + { glEnable(GL_BLEND); glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); diff --git a/source/blender/editors/space_sequencer/sequencer_edit.c b/source/blender/editors/space_sequencer/sequencer_edit.c index 1590d08b4a1..2543b49a48d 100644 --- a/source/blender/editors/space_sequencer/sequencer_edit.c +++ b/source/blender/editors/space_sequencer/sequencer_edit.c @@ -840,7 +840,7 @@ static int insert_gap(Scene *scene, int gap, int cfra) { Sequence *seq; Editing *ed = BKE_sequencer_editing_get(scene, FALSE); - int done = 0; + int done = FALSE; /* all strips >= cfra are shifted */ @@ -851,7 +851,7 @@ static int insert_gap(Scene *scene, int gap, int cfra) if (seq->startdisp >= cfra) { seq->start += gap; calc_sequence(scene, seq); - done = 1; + done = TRUE; } } SEQ_END @@ -971,7 +971,7 @@ static void UNUSED_FUNCTION(no_gaps) (Scene * scene) if (evaluate_seq_frame(scene, cfra) ) first = 1; } else { - done = 1; + done = TRUE; while (evaluate_seq_frame(scene, cfra) == 0) { done = insert_gap(scene, -1, cfra); if (done == 0) break; @@ -1365,8 +1365,8 @@ static int sequencer_reassign_inputs_exec(bContext *C, wmOperator *op) /* see reassigning would create a cycle */ if (seq_is_predecessor(seq1, last_seq) || seq_is_predecessor(seq2, last_seq) || - seq_is_predecessor(seq3, last_seq) - ) { + seq_is_predecessor(seq3, last_seq)) + { BKE_report(op->reports, RPT_ERROR, "Can't reassign inputs: no cycles allowed"); return OPERATOR_CANCELLED; } @@ -2109,8 +2109,8 @@ static int sequencer_view_all_preview_exec(bContext *C, wmOperator *UNUSED(op)) imgwidth = (int)(imgwidth * (scene->r.xasp / scene->r.yasp)); if (((imgwidth >= width) || (imgheight >= height)) && - ((width > 0) && (height > 0))) { - + ((width > 0) && (height > 0))) + { /* Find the zoom value that will fit the image in the image space */ zoomX = ((float)width) / ((float)imgwidth); zoomY = ((float)height) / ((float)imgheight); diff --git a/source/blender/editors/space_sequencer/sequencer_select.c b/source/blender/editors/space_sequencer/sequencer_select.c index a59570a09e1..811a89b07a8 100644 --- a/source/blender/editors/space_sequencer/sequencer_select.c +++ b/source/blender/editors/space_sequencer/sequencer_select.c @@ -1100,7 +1100,7 @@ static short select_grouped_effect_link(Editing *ed, Sequence *actseq) actseq->tmp = SET_INT_IN_POINTER(TRUE); - for (seq_begin(ed, &iter, 1); iter.valid; seq_next(&iter)) { + for (seq_begin(ed, &iter, TRUE); iter.valid; seq_next(&iter)) { seq = iter.seq; /* Ignore all seqs already selected! */ @@ -1129,7 +1129,7 @@ static short select_grouped_effect_link(Editing *ed, Sequence *actseq) /* Unfortunately, we must restart checks from the beginning. */ seq_end(&iter); - seq_begin(ed, &iter, 1); + seq_begin(ed, &iter, TRUE); } /* Video strips bellow active one, or any strip for audio (order do no matters here!). */ diff --git a/source/blender/editors/space_text/text_draw.c b/source/blender/editors/space_text/text_draw.c index ffb686b6810..463a262c09c 100644 --- a/source/blender/editors/space_text/text_draw.c +++ b/source/blender/editors/space_text/text_draw.c @@ -1174,7 +1174,7 @@ static void calc_text_rcts(SpaceText *st, ARegion *ar, rcti *scroll, rcti *back) /* push hl start down */ hlstart = barstart + barheight; } - else if (lhlend > st->top && lhlstart < st->top && hlstart > barstart) { + else if (lhlend > st->top && lhlstart < st->top && hlstart > barstart) { /*fill out start */ hlstart = barstart; } diff --git a/source/blender/editors/space_text/text_ops.c b/source/blender/editors/space_text/text_ops.c index 04408173928..3ebc4eb974c 100644 --- a/source/blender/editors/space_text/text_ops.c +++ b/source/blender/editors/space_text/text_ops.c @@ -2888,7 +2888,7 @@ static int text_insert_exec(bContext *C, wmOperator *op) SpaceText *st = CTX_wm_space_text(C); Text *text = CTX_data_edit_text(C); char *str; - int done = 0; + int done = FALSE; size_t i = 0; unsigned int code; diff --git a/source/blender/editors/space_time/space_time.c b/source/blender/editors/space_time/space_time.c index 9e44d5207c0..01d27aaa0b3 100644 --- a/source/blender/editors/space_time/space_time.c +++ b/source/blender/editors/space_time/space_time.c @@ -354,7 +354,7 @@ static void time_draw_keyframes(const bContext *C, SpaceTime *stime, ARegion *ar time_draw_idblock_keyframes(v2d, (ID *)ob, onlysel); } else { - short active_done = 0; + short active_done = FALSE; /* draw keyframes from all selected objects */ CTX_DATA_BEGIN (C, Object *, obsel, selected_objects) @@ -364,7 +364,7 @@ static void time_draw_keyframes(const bContext *C, SpaceTime *stime, ARegion *ar /* if this object is the active one, set flag so that we don't draw again */ if (obsel == ob) - active_done = 1; + active_done = TRUE; } CTX_DATA_END; diff --git a/source/blender/editors/space_userpref/space_userpref.c b/source/blender/editors/space_userpref/space_userpref.c index 6c683eba085..248f73b9ab6 100644 --- a/source/blender/editors/space_userpref/space_userpref.c +++ b/source/blender/editors/space_userpref/space_userpref.c @@ -149,7 +149,7 @@ static void userpref_header_listener(ARegion *UNUSED(ar), wmNotifier *UNUSED(wmn default: break; } -#endif +#endif } /* only called once, from space/spacetypes.c */ diff --git a/source/blender/editors/space_view3d/drawarmature.c b/source/blender/editors/space_view3d/drawarmature.c index 2211b1ddb62..6a070070379 100644 --- a/source/blender/editors/space_view3d/drawarmature.c +++ b/source/blender/editors/space_view3d/drawarmature.c @@ -1667,7 +1667,7 @@ static void draw_pose_bones(Scene *scene, View3D *v3d, ARegion *ar, Base *base, GLfloat tmp; float smat[4][4], imat[4][4], bmat[4][4]; int index = -1; - short do_dashed = 3, draw_wire = 0; + short do_dashed = 3, draw_wire = FALSE; int flag; /* being set below */ diff --git a/source/blender/editors/space_view3d/drawmesh.c b/source/blender/editors/space_view3d/drawmesh.c index b5c44fd1a8c..de1d9f22667 100644 --- a/source/blender/editors/space_view3d/drawmesh.c +++ b/source/blender/editors/space_view3d/drawmesh.c @@ -233,7 +233,7 @@ static Material *give_current_material_or_def(Object *ob, int matnr) static struct TextureDrawState { Object *ob; - int islit, istex; + int is_lit, is_tex; int color_profile; unsigned char obcol[4]; } Gtexdraw = {NULL, 0, 0, 0, {0, 0, 0, 0}}; @@ -263,12 +263,12 @@ static int set_draw_settings_cached(int clearcache, MTFace *texface, Material *m c_has_texface = -1; } else { - textured = gtexdraw.istex; + textured = gtexdraw.is_tex; litob = gtexdraw.ob; } /* convert number of lights into boolean */ - if (gtexdraw.islit) lit = 1; + if (gtexdraw.is_lit) lit = 1; if (ma) { alphablend = ma->game.alpha_blend; @@ -343,7 +343,7 @@ static int set_draw_settings_cached(int clearcache, MTFace *texface, Material *m static void draw_textured_begin(Scene *scene, View3D *v3d, RegionView3D *rv3d, Object *ob) { unsigned char obcol[4]; - int istex, solidtex; + int is_tex, solidtex; // XXX scene->obedit warning @@ -351,27 +351,27 @@ static void draw_textured_begin(Scene *scene, View3D *v3d, RegionView3D *rv3d, O * with face selection in weight paint is not lit. */ if ((v3d->drawtype <= OB_WIRE) && (ob->mode & (OB_MODE_VERTEX_PAINT | OB_MODE_WEIGHT_PAINT))) { solidtex = FALSE; - Gtexdraw.islit = 0; + Gtexdraw.is_lit = 0; } else if (v3d->drawtype == OB_SOLID || ((ob->mode & OB_MODE_EDIT) && v3d->drawtype != OB_TEXTURE)) { /* draw with default lights in solid draw mode and edit mode */ solidtex = TRUE; - Gtexdraw.islit = -1; + Gtexdraw.is_lit = -1; } else { /* draw with lights in the scene otherwise */ solidtex = FALSE; - Gtexdraw.islit = GPU_scene_object_lights(scene, ob, v3d->lay, rv3d->viewmat, !rv3d->is_persp); + Gtexdraw.is_lit = GPU_scene_object_lights(scene, ob, v3d->lay, rv3d->viewmat, !rv3d->is_persp); } rgba_float_to_uchar(obcol, ob->col); glCullFace(GL_BACK); glEnable(GL_CULL_FACE); - if (solidtex || v3d->drawtype == OB_TEXTURE) istex = 1; - else istex = 0; + if (solidtex || v3d->drawtype == OB_TEXTURE) is_tex = 1; + else is_tex = 0; Gtexdraw.ob = ob; - Gtexdraw.istex = istex; + Gtexdraw.is_tex = is_tex; Gtexdraw.color_profile = scene->r.color_mgt_flag & R_COLOR_MANAGEMENT; memcpy(Gtexdraw.obcol, obcol, sizeof(obcol)); set_draw_settings_cached(1, NULL, NULL, Gtexdraw); diff --git a/source/blender/editors/space_view3d/drawobject.c b/source/blender/editors/space_view3d/drawobject.c index 00622f368f0..000f81a4f32 100644 --- a/source/blender/editors/space_view3d/drawobject.c +++ b/source/blender/editors/space_view3d/drawobject.c @@ -1967,7 +1967,7 @@ static void drawlattice(Scene *scene, View3D *v3d, Object *ob) Lattice *lt = ob->data; DispList *dl; int u, v, w; - int use_wcol = 0, is_edit = (lt->editlatt != NULL); + int use_wcol = FALSE, is_edit = (lt->editlatt != NULL); /* now we default make displist, this will modifiers work for non animated case */ if (ob->disp.first == NULL) @@ -2951,6 +2951,7 @@ static void draw_em_measure_stats(View3D *v3d, Object *ob, BMEditMesh *em, UnitS if (me->drawflag & ME_DRAWEXTRA_FACEANG) { BMFace *efa; + int is_rad = unit->system_rotation == USER_UNIT_ROT_RADIANS; UI_GetThemeColor3ubv(TH_DRAWEXTRA_FACEANG, col); @@ -2961,37 +2962,41 @@ static void draw_em_measure_stats(View3D *v3d, Object *ob, BMEditMesh *em, UnitS if (is_face_sel || do_moving) { BMIter liter; BMLoop *loop; - int cent_ok = FALSE; + int is_first = TRUE; BM_ITER_ELEM(loop, &liter, efa, BM_LOOPS_OF_FACE) { if (is_face_sel || (do_moving && BM_elem_flag_test(loop->v, BM_ELEM_SELECT))) { - /* yes, we should avoid triple matrix multiply every vertex for 'global' */ float angle; /* lazy init center calc */ - if (cent_ok == FALSE) { + if (is_first) { BM_face_calc_center_bounds(efa, vmid); - cent_ok = TRUE; + /* Avoid triple matrix multiply every vertex for 'global' */ + if (do_global) { + copy_v3_v3(v1, loop->prev->v->co); + copy_v3_v3(v2, loop->v->co); + mul_mat3_m4_v3(ob->obmat, v1); + mul_mat3_m4_v3(ob->obmat, v2); + } + is_first = FALSE; } if (do_global) { - copy_v3_v3(v1, loop->prev->v->co); - copy_v3_v3(v2, loop->v->co); copy_v3_v3(v3, loop->next->v->co); - mul_mat3_m4_v3(ob->obmat, v1); - mul_mat3_m4_v3(ob->obmat, v2); mul_mat3_m4_v3(ob->obmat, v3); angle = angle_v3v3v3(v1, v2, v3); interp_v3_v3v3(fvec, vmid, v2, 0.8f); + copy_v3_v3(v1, v2); + copy_v3_v3(v2, v3); } else { angle = angle_v3v3v3(loop->prev->v->co, loop->v->co, loop->next->v->co); interp_v3_v3v3(fvec, vmid, loop->v->co, 0.8f); } - BLI_snprintf(numstr, sizeof(numstr), "%.3f", RAD2DEGF(angle)); + BLI_snprintf(numstr, sizeof(numstr), "%.3f", is_rad ? angle : RAD2DEGF(angle)); view3d_cached_text_draw_add(fvec, numstr, 0, txt_flag, col); } } @@ -3241,7 +3246,8 @@ static void draw_em_fancy(Scene *scene, View3D *v3d, RegionView3D *rv3d, } if ((G.debug & G_DEBUG) && (me->drawflag & ME_DRAWEXTRA_INDICES) && - !(v3d->flag2 & V3D_RENDER_OVERRIDE)) { + !(v3d->flag2 & V3D_RENDER_OVERRIDE)) + { draw_em_indices(em); } } @@ -3543,7 +3549,7 @@ static int draw_mesh_object(Scene *scene, ARegion *ar, View3D *v3d, RegionView3D Object *obedit = scene->obedit; Mesh *me = ob->data; BMEditMesh *em = me->edit_btmesh; - int do_alpha_after = 0, drawlinked = 0, retval = 0, glsl, check_alpha, i; + int do_alpha_after = FALSE, drawlinked = 0, retval = 0, glsl, check_alpha, i; /* If we are drawing shadows and any of the materials don't cast a shadow, * then don't draw the object */ diff --git a/source/blender/editors/space_view3d/view3d_draw.c b/source/blender/editors/space_view3d/view3d_draw.c index fe142ced7fa..33141bb6abb 100644 --- a/source/blender/editors/space_view3d/view3d_draw.c +++ b/source/blender/editors/space_view3d/view3d_draw.c @@ -1296,7 +1296,8 @@ static void backdrawview3d(Scene *scene, ARegion *ar, View3D *v3d) /* do nothing */ } else if (scene->obedit && v3d->drawtype > OB_WIRE && - (v3d->flag & V3D_ZBUF_SELECT)) { + (v3d->flag & V3D_ZBUF_SELECT)) + { /* do nothing */ } else { @@ -1848,7 +1849,7 @@ static void draw_dupli_objects_color(Scene *scene, ARegion *ar, View3D *v3d, Bas /* generate displist, test for new object */ if (dob_prev && dob_prev->ob != dob->ob) { - if (use_displist == 1) + if (use_displist == TRUE) glDeleteLists(displist, 1); use_displist = -1; @@ -1870,7 +1871,7 @@ static void draw_dupli_objects_color(Scene *scene, ARegion *ar, View3D *v3d, Bas !(bb_tmp = BKE_object_boundbox_get(dob->ob))) { // printf("draw_dupli_objects_color: skipping displist for %s\n", dob->ob->id.name+2); - use_displist = 0; + use_displist = FALSE; } else { // printf("draw_dupli_objects_color: using displist for %s\n", dob->ob->id.name+2); @@ -1886,7 +1887,7 @@ static void draw_dupli_objects_color(Scene *scene, ARegion *ar, View3D *v3d, Bas draw_object(scene, ar, v3d, &tbase, DRAW_CONSTCOLOR); glEndList(); - use_displist = 1; + use_displist = TRUE; BKE_object_boundbox_flag(dob->ob, OB_BB_DISABLED, 0); } } @@ -2434,7 +2435,9 @@ void ED_view3d_draw_offscreen(Scene *scene, View3D *v3d, ARegion *ar, ar->winrct.ymin = 0; ar->winrct.xmax = winx; ar->winrct.ymax = winy; - + + /* set theme */ + UI_SetTheme(SPACE_VIEW3D, RGN_TYPE_WINDOW); /* set flags */ G.f |= G_RENDER_OGL; @@ -2732,8 +2735,8 @@ static void draw_viewport_fps(Scene *scene, ARegion *ar) } #endif - /* is this more then half a frame behind? */ - if (fps + 0.5f < (float)(FPS)) { + /* is this more then half a frame behind? */ + if (fps + 0.5f < (float)(FPS)) { UI_ThemeColor(TH_REDALERT); BLI_snprintf(printable, sizeof(printable), "fps: %.2f", fps); } @@ -3003,7 +3006,7 @@ static void view3d_main_area_draw_info(const bContext *C, ARegion *ar, const cha if (U.uiflag & USER_SHOW_ROTVIEWICON) draw_view_axis(rv3d); - else + else draw_view_icon(rv3d); ob = OBACT; diff --git a/source/blender/editors/space_view3d/view3d_edit.c b/source/blender/editors/space_view3d/view3d_edit.c index 4bfb6dd9fd6..8ba0d75c786 100644 --- a/source/blender/editors/space_view3d/view3d_edit.c +++ b/source/blender/editors/space_view3d/view3d_edit.c @@ -2051,7 +2051,7 @@ static int view3d_all_exec(bContext *C, wmOperator *op) /* was view3d_home() in int center = RNA_boolean_get(op->ptr, "center"); float size, min[3], max[3], afm[3]; - int ok = 1, onedone = 0; + int ok = 1, onedone = FALSE; if (center) { /* in 2.4x this also move the cursor to (0, 0, 0) (with shift+c). */ @@ -2066,7 +2066,7 @@ static int view3d_all_exec(bContext *C, wmOperator *op) /* was view3d_home() in for (base = scene->base.first; base; base = base->next) { if (BASE_VISIBLE(v3d, base)) { - onedone = 1; + onedone = TRUE; if (skip_camera && base->object == v3d->camera) { continue; diff --git a/source/blender/editors/space_view3d/view3d_fly.c b/source/blender/editors/space_view3d/view3d_fly.c index 2dab26e7781..06cae3585cd 100644 --- a/source/blender/editors/space_view3d/view3d_fly.c +++ b/source/blender/editors/space_view3d/view3d_fly.c @@ -580,7 +580,7 @@ static void flyEvent(FlyInfo *fly, wmEvent *event) fly->pan_view = TRUE; break; case FLY_MODAL_PAN_DISABLE: -//XXX2.5 warp_pointer(cent_orig[0], cent_orig[1]); +//XXX2.5 WM_cursor_warp(CTX_wm_window(C), cent_orig[0], cent_orig[1]); fly->pan_view = FALSE; break; diff --git a/source/blender/editors/space_view3d/view3d_select.c b/source/blender/editors/space_view3d/view3d_select.c index 583736716c6..0bbd03c10bb 100644 --- a/source/blender/editors/space_view3d/view3d_select.c +++ b/source/blender/editors/space_view3d/view3d_select.c @@ -405,7 +405,7 @@ static void do_lasso_select_mesh__doSelectEdge(void *userData, BMEdge *eed, int BLI_lasso_is_point_inside(data->mcords, data->moves, x1, y1, IS_CLIPPED)) { BM_edge_select_set(data->vc->em->bm, eed, data->select); - data->done = 1; + data->done = TRUE; } } else { @@ -443,7 +443,7 @@ static void do_lasso_select_mesh(ViewContext *vc, int mcords[][2], short moves, data.mcords = mcords; data.moves = moves; data.select = select; - data.done = 0; + data.done = FALSE; data.pass = 0; if (extend == 0 && select) @@ -1180,19 +1180,19 @@ static Base *mouse_select_eval_buffer(ViewContext *vc, unsigned int *buffer, int View3D *v3d = vc->v3d; Base *base, *basact = NULL; static int lastmval[2] = {-100, -100}; - int a, donearest = 0; + int a, do_nearest = FALSE; /* define if we use solid nearest select or not */ if (v3d->drawtype > OB_WIRE) { - donearest = 1; + do_nearest = TRUE; if (ABS(mval[0] - lastmval[0]) < 3 && ABS(mval[1] - lastmval[1]) < 3) { if (!has_bones) /* hrms, if theres bones we always do nearest */ - donearest = 0; + do_nearest = FALSE; } } lastmval[0] = mval[0]; lastmval[1] = mval[1]; - if (donearest) { + if (do_nearest) { unsigned int min = 0xFFFFFFFF; int selcol = 0, notcol = 0; @@ -1623,7 +1623,7 @@ static void do_mesh_box_select__doSelectEdge(void *userData, BMEdge *eed, int x0 if (data->pass == 0) { if (edge_fully_inside_rect(data->rect, x0, y0, x1, y1)) { BM_edge_select_set(data->vc->em->bm, eed, data->select); - data->done = 1; + data->done = TRUE; } } else { @@ -1651,7 +1651,7 @@ static int do_mesh_box_select(ViewContext *vc, rcti *rect, int select, int exten data.rect = rect; data.select = select; data.pass = 0; - data.done = 0; + data.done = FALSE; if (extend == 0 && select) EDBM_flag_disable_all(vc->em, BM_ELEM_SELECT); diff --git a/source/blender/editors/space_view3d/view3d_toolbar.c b/source/blender/editors/space_view3d/view3d_toolbar.c index 82ab6cd7193..ff896a95941 100644 --- a/source/blender/editors/space_view3d/view3d_toolbar.c +++ b/source/blender/editors/space_view3d/view3d_toolbar.c @@ -64,7 +64,7 @@ #include "UI_interface.h" #include "UI_resources.h" -#include "view3d_intern.h" // own include +#include "view3d_intern.h" /* own include */ /* ******************* view3d space & buttons ************** */ @@ -78,15 +78,17 @@ static void view3d_panel_operator_redo_header(const bContext *C, Panel *pa) { wmOperator *op = WM_operator_last_redo(C); - if (op) BLI_strncpy(pa->drawname, op->type->name, sizeof(pa->drawname)); - else BLI_strncpy(pa->drawname, IFACE_("Operator"), sizeof(pa->drawname)); + if (op) + BLI_strncpy(pa->drawname, RNA_struct_ui_name(op->type->srna), sizeof(pa->drawname)); + else + BLI_strncpy(pa->drawname, IFACE_("Operator"), sizeof(pa->drawname)); } static void view3d_panel_operator_redo_operator(const bContext *C, Panel *pa, wmOperator *op) { if (op->type->flag & OPTYPE_MACRO) { for (op = op->macro.first; op; op = op->next) { - uiItemL(pa->layout, op->type->name, ICON_NONE); + uiItemL(pa->layout, RNA_struct_ui_name(op->type->srna), ICON_NONE); view3d_panel_operator_redo_operator(C, pa, op); } } diff --git a/source/blender/editors/space_view3d/view3d_view.c b/source/blender/editors/space_view3d/view3d_view.c index 95ae0ac971f..8fb012a18d6 100644 --- a/source/blender/editors/space_view3d/view3d_view.c +++ b/source/blender/editors/space_view3d/view3d_view.c @@ -142,7 +142,7 @@ void smooth_view(bContext *C, View3D *v3d, ARegion *ar, Object *oldcamera, Objec sms.to_camera = 0; /* note on camera locking, this is a little confusing but works ok. - * we may be changing the view 'as if' there is no active camera, but infact + * we may be changing the view 'as if' there is no active camera, but in fact * there is an active camera which is locked to the view. * * In the case where smooth view is moving _to_ a camera we don't want that diff --git a/source/blender/editors/transform/transform.c b/source/blender/editors/transform/transform.c index d07ae468f35..cefc6837e5f 100644 --- a/source/blender/editors/transform/transform.c +++ b/source/blender/editors/transform/transform.c @@ -2111,7 +2111,7 @@ static void constraintRotLim(TransInfo *UNUSED(t), TransData *td) bConstraintTypeInfo *cti= get_constraint_typeinfo(CONSTRAINT_TYPE_ROTLIMIT); bConstraintOb cob; bConstraint *con; - int dolimit = 0; + int do_limit = FALSE; /* Evaluate valid constraints */ for (con= td->con; con; con= con->next) { @@ -2133,9 +2133,9 @@ static void constraintRotLim(TransInfo *UNUSED(t), TransData *td) continue; /* only do conversion if necessary, to preserve quats and eulers */ - if (!dolimit) { + if (do_limit == FALSE) { constraintob_from_transdata(&cob, td); - dolimit= 1; + do_limit = TRUE; } /* do space conversions */ @@ -2157,7 +2157,7 @@ static void constraintRotLim(TransInfo *UNUSED(t), TransData *td) } } - if (dolimit) { + if (do_limit) { /* copy results from cob->matrix */ if (td->ext->rotOrder == ROT_MODE_QUAT) { /* quats */ @@ -2311,8 +2311,8 @@ int handleEventWarp(TransInfo *t, wmEvent *event) if (event->type == MIDDLEMOUSE && event->val == KM_PRESS) { // Use customData pointer to signal warp direction - if (t->customData == NULL) - t->customData = (void*)1; + if (t->customData == NULL) + t->customData = (void *)1; else t->customData = NULL; @@ -2451,7 +2451,7 @@ int handleEventShear(TransInfo *t, wmEvent *event) if (event->type == MIDDLEMOUSE && event->val == KM_PRESS) { // Use customData pointer to signal Shear direction - if (t->customData == NULL) { + if (t->customData == NULL) { initMouseInputMode(t, &t->mouse, INPUT_VERTICAL_ABSOLUTE); t->customData = (void*)1; } @@ -3096,7 +3096,7 @@ static void ElementRotation(TransInfo *t, TransData *td, float mat[3][3], short /* rotation */ if ((t->flag & T_V3D_ALIGN)==0) { // align mode doesn't rotate objects itself /* euler or quaternion? */ - if ((td->ext->rotOrder == ROT_MODE_QUAT) || (td->flag & TD_USEQUAT)) { + if ((td->ext->rotOrder == ROT_MODE_QUAT) || (td->flag & TD_USEQUAT)) { mul_serie_m3(fmat, td->mtx, mat, td->smtx, NULL, NULL, NULL, NULL, NULL); mat3_to_quat(quat, fmat); // Actual transform @@ -4711,7 +4711,7 @@ void projectSVData(TransInfo *t, int final) /* BMESH_TODO, this interpolates between vertex/loops which are not moved * (are only apart of a face attached to a slide vert), couldn't we iterate BM_LOOPS_OF_VERT - * here and only iterpolate those? */ + * here and only interpolate those? */ BM_ITER_ELEM (f, &fiter, sv->v, BM_FACES_OF_VERT) { BMIter liter; BMLoop *l; @@ -5438,10 +5438,10 @@ static void doAnimEdit_SnapFrame(TransInfo *t, TransData *td, TransData2D *td2d, /* snap key to nearest frame? */ if (autosnap == SACTSNAP_FRAME) { -#if 0 /* 'doTime' disabled for now */ +#if 0 /* 'do_time' disabled for now */ const Scene *scene= t->scene; - const short doTime= 0; //getAnimEdit_DrawTime(t); // NOTE: this works, but may be confusing behavior given the option's label, hence disabled + const short do_time= 0; //getAnimEdit_DrawTime(t); // NOTE: this works, but may be confusing behavior given the option's label, hence disabled const double secf= FPS; #endif double val; @@ -5452,10 +5452,10 @@ static void doAnimEdit_SnapFrame(TransInfo *t, TransData *td, TransData2D *td2d, else val= *(td->val); -#if 0 /* 'doTime' disabled for now */ +#if 0 /* 'do_time' disabled for now */ /* do the snapping to nearest frame/second */ - if (doTime) { + if (do_time) { val= (float)(floor((val/secf) + 0.5f) * secf); } else @@ -5540,19 +5540,19 @@ static void headerTimeTranslate(TransInfo *t, char *str) else { const Scene *scene = t->scene; const short autosnap= getAnimEdit_SnapMode(t); - const short doTime = getAnimEdit_DrawTime(t); + const short do_time = getAnimEdit_DrawTime(t); const double secf= FPS; float val = t->values[0]; /* apply snapping + frame->seconds conversions */ if (autosnap == SACTSNAP_STEP) { - if (doTime) + if (do_time) val= floorf((double)val/secf + 0.5f); else val= floorf(val + 0.5f); } else { - if (doTime) + if (do_time) val= (float)((double)val / secf); } @@ -5572,7 +5572,7 @@ static void applyTimeTranslate(TransInfo *t, float UNUSED(sval)) Scene *scene = t->scene; int i; - const short doTime= getAnimEdit_DrawTime(t); + const short do_time= getAnimEdit_DrawTime(t); const double secf= FPS; const short autosnap= getAnimEdit_SnapMode(t); @@ -5594,7 +5594,7 @@ static void applyTimeTranslate(TransInfo *t, float UNUSED(sval)) deltax = t->values[0]; if (autosnap == SACTSNAP_STEP) { - if (doTime) + if (do_time) deltax= (float)(floor((deltax/secf) + 0.5f) * secf); else deltax= (float)(floor(deltax + 0.5f)); @@ -5608,7 +5608,7 @@ static void applyTimeTranslate(TransInfo *t, float UNUSED(sval)) deltax = val = t->values[0]; if (autosnap == SACTSNAP_STEP) { - if (doTime) + if (do_time) val= (float)(floor((deltax/secf) + 0.5f) * secf); else val= (float)(floor(val + 0.5f)); @@ -5846,7 +5846,7 @@ static void applyTimeScale(TransInfo *t) int i; const short autosnap= getAnimEdit_SnapMode(t); - const short doTime= getAnimEdit_DrawTime(t); + const short do_time= getAnimEdit_DrawTime(t); const double secf= FPS; @@ -5860,7 +5860,7 @@ static void applyTimeScale(TransInfo *t) float fac= t->values[0]; if (autosnap == SACTSNAP_STEP) { - if (doTime) + if (do_time) fac= (float)(floor(fac/secf + 0.5f) * secf); else fac= (float)(floor(fac + 0.5f)); diff --git a/source/blender/editors/transform/transform_conversions.c b/source/blender/editors/transform/transform_conversions.c index c9eb975cb77..1c974a963bd 100644 --- a/source/blender/editors/transform/transform_conversions.c +++ b/source/blender/editors/transform/transform_conversions.c @@ -1393,10 +1393,10 @@ static void createTransCurveVerts(bContext *C, TransInfo *t) if (bezt->hide==0) { TransDataCurveHandleFlags *hdata = NULL; - if ( propmode || - ((bezt->f2 & SELECT) && hide_handles) || - ((bezt->f1 & SELECT) && hide_handles == 0) - ) { + if (propmode || + ((bezt->f2 & SELECT) && hide_handles) || + ((bezt->f1 & SELECT) && hide_handles == 0)) + { copy_v3_v3(td->iloc, bezt->vec[0]); td->loc= bezt->vec[0]; copy_v3_v3(td->center, bezt->vec[(hide_handles || bezt->f2 & SELECT) ? 1:0]); @@ -1455,10 +1455,10 @@ static void createTransCurveVerts(bContext *C, TransInfo *t) count++; tail++; } - if ( propmode || - ((bezt->f2 & SELECT) && hide_handles) || - ((bezt->f3 & SELECT) && hide_handles == 0) - ) { + if (propmode || + ((bezt->f2 & SELECT) && hide_handles) || + ((bezt->f3 & SELECT) && hide_handles == 0)) + { copy_v3_v3(td->iloc, bezt->vec[2]); td->loc= bezt->vec[2]; copy_v3_v3(td->center, bezt->vec[(hide_handles || bezt->f2 & SELECT) ? 1:2]); @@ -3757,42 +3757,42 @@ static void SeqTransInfo(TransInfo *t, Sequence *seq, int *recursive, int *count /* *** Extend Transform *** */ - Scene * scene= t->scene; + Scene *scene = t->scene; int cfra= CFRA; int left= seq_tx_get_final_left(seq, 1); int right= seq_tx_get_final_right(seq, 1); if (seq->depth == 0 && ((seq->flag & SELECT) == 0 || (seq->flag & SEQ_LOCK))) { - *recursive= 0; - *count= 0; - *flag= 0; + *recursive = FALSE; + *count = 0; + *flag = 0; } - else if (seq->type ==SEQ_META) { + else if (seq->type == SEQ_META) { /* for meta's we only ever need to extend their children, no matter what depth * just check the meta's are in the bounds */ - if (t->frame_side=='R' && right <= cfra) *recursive= 0; - else if (t->frame_side=='L' && left >= cfra) *recursive= 0; - else *recursive= 1; + if (t->frame_side=='R' && right <= cfra) *recursive = FALSE; + else if (t->frame_side=='L' && left >= cfra) *recursive = FALSE; + else *recursive = TRUE; *count= 1; *flag= (seq->flag | SELECT) & ~(SEQ_LEFTSEL|SEQ_RIGHTSEL); } else { - *recursive= 0; /* not a meta, so no thinking here */ - *count= 1; /* unless its set to 0, extend will never set 2 handles at once */ - *flag= (seq->flag | SELECT) & ~(SEQ_LEFTSEL|SEQ_RIGHTSEL); + *recursive = FALSE; /* not a meta, so no thinking here */ + *count = 1; /* unless its set to 0, extend will never set 2 handles at once */ + *flag = (seq->flag | SELECT) & ~(SEQ_LEFTSEL|SEQ_RIGHTSEL); if (t->frame_side=='R') { - if (right <= cfra) *count= *flag= 0; /* ignore */ - else if (left > cfra) ; /* keep the selection */ - else *flag |= SEQ_RIGHTSEL; + if (right <= cfra) *count = *flag= 0; /* ignore */ + else if (left > cfra) ; /* keep the selection */ + else *flag |= SEQ_RIGHTSEL; } else { - if (left >= cfra) *count= *flag= 0; /* ignore */ - else if (right < cfra) ; /* keep the selection */ - else *flag |= SEQ_LEFTSEL; + if (left >= cfra) *count = *flag= 0; /* ignore */ + else if (right < cfra) ; /* keep the selection */ + else *flag |= SEQ_LEFTSEL; } } } @@ -3808,9 +3808,9 @@ static void SeqTransInfo(TransInfo *t, Sequence *seq, int *recursive, int *count /* Non nested strips (resect selection and handles) */ if ((seq->flag & SELECT) == 0 || (seq->flag & SEQ_LOCK)) { - *recursive= 0; - *count= 0; - *flag= 0; + *recursive = FALSE; + *count = 0; + *flag = 0; } else { if ((seq->flag & (SEQ_LEFTSEL|SEQ_RIGHTSEL)) == (SEQ_LEFTSEL|SEQ_RIGHTSEL)) { @@ -3826,10 +3826,10 @@ static void SeqTransInfo(TransInfo *t, Sequence *seq, int *recursive, int *count if ((seq->type == SEQ_META) && ((seq->flag & (SEQ_LEFTSEL|SEQ_RIGHTSEL)) == 0)) { /* if any handles are selected, don't recurse */ - *recursive = 1; + *recursive = TRUE; } else { - *recursive = 0; + *recursive = FALSE; } } } @@ -3837,23 +3837,23 @@ static void SeqTransInfo(TransInfo *t, Sequence *seq, int *recursive, int *count /* Nested, different rules apply */ #ifdef SEQ_TX_NESTED_METAS - *flag= (seq->flag | SELECT) & ~(SEQ_LEFTSEL|SEQ_RIGHTSEL); - *count= 1; /* ignore the selection for nested */ - *recursive = (seq->type == SEQ_META ); + *flag = (seq->flag | SELECT) & ~(SEQ_LEFTSEL|SEQ_RIGHTSEL); + *count = 1; /* ignore the selection for nested */ + *recursive = (seq->type == SEQ_META); #else if (seq->type == SEQ_META) { /* Meta's can only directly be moved between channels since they * don't have their start and length set directly (children affect that) - * since this Meta is nested we don't need any of its data infact. + * since this Meta is nested we don't need any of its data in fact. * calc_sequence() will update its settings when run on the toplevel meta */ *flag= 0; *count= 0; - *recursive = 1; + *recursive = TRUE; } else { *flag= (seq->flag | SELECT) & ~(SEQ_LEFTSEL|SEQ_RIGHTSEL); *count= 1; /* ignore the selection for nested */ - *recursive = 0; + *recursive = FALSE; } #endif } @@ -4131,9 +4131,9 @@ static void freeSeqData(TransInfo *t) for (seq= seqbasep->first; seq; seq= seq->next) { /* We might want to build a list of effects that need to be updated during transform */ if (seq->type & SEQ_EFFECT) { - if (seq->seq1 && seq->seq1->flag & SELECT) calc_sequence(t->scene, seq); - else if (seq->seq2 && seq->seq2->flag & SELECT) calc_sequence(t->scene, seq); - else if (seq->seq3 && seq->seq3->flag & SELECT) calc_sequence(t->scene, seq); + if (seq->seq1 && seq->seq1->flag & SELECT) calc_sequence(t->scene, seq); + else if (seq->seq2 && seq->seq2->flag & SELECT) calc_sequence(t->scene, seq); + else if (seq->seq3 && seq->seq3->flag & SELECT) calc_sequence(t->scene, seq); } } @@ -4438,7 +4438,7 @@ static void set_trans_object_base_flags(TransInfo *t) if (parsel) { /* rotation around local centers are allowed to propagate */ - if ((t->mode == TFM_ROTATION || t->mode == TFM_TRACKBALL) && t->around == V3D_LOCAL) { + if ((t->mode == TFM_ROTATION || t->mode == TFM_TRACKBALL) && t->around == V3D_LOCAL) { base->flag |= BA_TRANSFORM_CHILD; } else { @@ -4487,7 +4487,7 @@ static int count_proportional_objects(TransInfo *t) Base *base; /* rotations around local centers are allowed to propagate, so we take all objects */ - if (!((t->mode == TFM_ROTATION || t->mode == TFM_TRACKBALL) && t->around == V3D_LOCAL)) { + if (!((t->mode == TFM_ROTATION || t->mode == TFM_TRACKBALL) && t->around == V3D_LOCAL)) { /* mark all parents */ for (base= scene->base.first; base; base= base->next) { if (TESTBASELIB_BGMODE(v3d, scene, base)) { @@ -4599,45 +4599,45 @@ void autokeyframe_ob_cb_func(bContext *C, Scene *scene, View3D *v3d, Object *ob, } } else if (IS_AUTOKEY_FLAG(scene, INSERTNEEDED)) { - short doLoc=0, doRot=0, doScale=0; + short do_loc = FALSE, do_rot = FALSE, do_scale = FALSE; /* filter the conditions when this happens (assume that curarea->spacetype==SPACE_VIE3D) */ if (tmode == TFM_TRANSLATION) { - doLoc = 1; + do_loc = TRUE; } else if (tmode == TFM_ROTATION) { if (v3d->around == V3D_ACTIVE) { if (ob != OBACT) - doLoc = 1; + do_loc = TRUE; } else if (v3d->around == V3D_CURSOR) - doLoc = 1; + do_loc = TRUE; if ((v3d->flag & V3D_ALIGN)==0) - doRot = 1; + do_rot = TRUE; } else if (tmode == TFM_RESIZE) { if (v3d->around == V3D_ACTIVE) { if (ob != OBACT) - doLoc = 1; + do_loc = TRUE; } else if (v3d->around == V3D_CURSOR) - doLoc = 1; + do_loc = TRUE; if ((v3d->flag & V3D_ALIGN)==0) - doScale = 1; + do_scale = TRUE; } /* insert keyframes for the affected sets of channels using the builtin KeyingSets found */ - if (doLoc) { + if (do_loc) { KeyingSet *ks= ANIM_builtin_keyingset_get_named(NULL, ANIM_KS_LOCATION_ID); ANIM_apply_keyingset(C, &dsources, NULL, ks, MODIFYKEY_MODE_INSERT, cfra); } - if (doRot) { + if (do_rot) { KeyingSet *ks= ANIM_builtin_keyingset_get_named(NULL, ANIM_KS_ROTATION_ID); ANIM_apply_keyingset(C, &dsources, NULL, ks, MODIFYKEY_MODE_INSERT, cfra); } - if (doScale) { + if (do_scale) { KeyingSet *ks= ANIM_builtin_keyingset_get_named(NULL, ANIM_KS_SCALING_ID); ANIM_apply_keyingset(C, &dsources, NULL, ks, MODIFYKEY_MODE_INSERT, cfra); } @@ -4720,39 +4720,39 @@ void autokeyframe_pose_cb_func(bContext *C, Scene *scene, View3D *v3d, Object *o } /* only insert keyframe if needed? */ else if (IS_AUTOKEY_FLAG(scene, INSERTNEEDED)) { - short doLoc=0, doRot=0, doScale=0; + short do_loc = FALSE, do_rot = FALSE, do_scale = FALSE; /* filter the conditions when this happens (assume that curarea->spacetype==SPACE_VIE3D) */ if (tmode == TFM_TRANSLATION) { if (targetless_ik) - doRot= 1; + do_rot = TRUE; else - doLoc = 1; + do_loc = TRUE; } else if (tmode == TFM_ROTATION) { if (ELEM(v3d->around, V3D_CURSOR, V3D_ACTIVE)) - doLoc = 1; + do_loc = TRUE; if ((v3d->flag & V3D_ALIGN)==0) - doRot = 1; + do_rot = TRUE; } else if (tmode == TFM_RESIZE) { if (ELEM(v3d->around, V3D_CURSOR, V3D_ACTIVE)) - doLoc = 1; + do_loc = TRUE; if ((v3d->flag & V3D_ALIGN)==0) - doScale = 1; + do_scale = TRUE; } - if (doLoc) { + if (do_loc) { KeyingSet *ks= ANIM_builtin_keyingset_get_named(NULL, ANIM_KS_LOCATION_ID); ANIM_apply_keyingset(C, &dsources, NULL, ks, MODIFYKEY_MODE_INSERT, cfra); } - if (doRot) { + if (do_rot) { KeyingSet *ks= ANIM_builtin_keyingset_get_named(NULL, ANIM_KS_ROTATION_ID); ANIM_apply_keyingset(C, &dsources, NULL, ks, MODIFYKEY_MODE_INSERT, cfra); } - if (doScale) { + if (do_scale) { KeyingSet *ks= ANIM_builtin_keyingset_get_named(NULL, ANIM_KS_SCALING_ID); ANIM_apply_keyingset(C, &dsources, NULL, ks, MODIFYKEY_MODE_INSERT, cfra); } diff --git a/source/blender/editors/transform/transform_generics.c b/source/blender/editors/transform/transform_generics.c index a9179f95d4e..23c1fba6107 100644 --- a/source/blender/editors/transform/transform_generics.c +++ b/source/blender/editors/transform/transform_generics.c @@ -1606,7 +1606,7 @@ void calculatePropRatio(TransInfo *t) td->factor = 0.0f; restoreElement(td); } - else if ((connected && (td->flag & TD_NOTCONNECTED || td->dist > t->prop_size)) || + else if ((connected && (td->flag & TD_NOTCONNECTED || td->dist > t->prop_size)) || (connected == 0 && td->rdist > t->prop_size)) { /* diff --git a/source/blender/editors/transform/transform_input.c b/source/blender/editors/transform/transform_input.c index b25c76fe193..f12961df0d9 100644 --- a/source/blender/editors/transform/transform_input.c +++ b/source/blender/editors/transform/transform_input.c @@ -87,11 +87,11 @@ static void InputSpringFlip(TransInfo *t, MouseInput *mi, const int mval[2], flo /* flip scale */ /* values can become really big when zoomed in so use longs [#26598] */ - if ((long long int)(mi->center[0] - mval[0]) * (long long int)(mi->center[0] - mi->imval[0]) + - (long long int)(mi->center[1] - mval[1]) * (long long int)(mi->center[1] - mi->imval[1]) < 0) - { + if ((long long int)(mi->center[0] - mval[0]) * (long long int)(mi->center[0] - mi->imval[0]) + + (long long int)(mi->center[1] - mval[1]) * (long long int)(mi->center[1] - mi->imval[1]) < 0) + { output[0] *= -1.0f; - } + } } static void InputTrackBall(TransInfo *UNUSED(t), MouseInput *mi, const int mval[2], float output[3]) diff --git a/source/blender/editors/transform/transform_manipulator.c b/source/blender/editors/transform/transform_manipulator.c index a869af56537..7d0e9dd6005 100644 --- a/source/blender/editors/transform/transform_manipulator.c +++ b/source/blender/editors/transform/transform_manipulator.c @@ -662,9 +662,9 @@ static void partial_doughnut(float radring, float radhole, int start, int end, i float cos_theta, sin_theta; float cos_theta1, sin_theta1; float ring_delta, side_delta; - int i, j, docaps= 1; + int i, j, do_caps = TRUE; - if (start==0 && end==nrings) docaps= 0; + if (start == 0 && end == nrings) do_caps = FALSE; ring_delta= 2.0f*(float)M_PI/(float)nrings; side_delta= 2.0f*(float)M_PI/(float)nsides; @@ -678,7 +678,7 @@ static void partial_doughnut(float radring, float radhole, int start, int end, i cos_theta1= (float)cos(theta1); sin_theta1= (float)sin(theta1); - if (docaps && i==start) { // cap + if (do_caps && i==start) { // cap glBegin(GL_POLYGON); phi= 0.0; for (j= nsides; j >= 0; j--) { @@ -710,7 +710,7 @@ static void partial_doughnut(float radring, float radhole, int start, int end, i glEnd(); } - if (docaps && i==end) { // cap + if (do_caps && i==end) { // cap glBegin(GL_POLYGON); phi= 0.0; for (j= nsides; j >= 0; j--) { diff --git a/source/blender/editors/transform/transform_orientations.c b/source/blender/editors/transform/transform_orientations.c index 04207643aa4..91f62291450 100644 --- a/source/blender/editors/transform/transform_orientations.c +++ b/source/blender/editors/transform/transform_orientations.c @@ -476,7 +476,7 @@ static int count_bone_select(bArmature *arm, ListBase *lb, int do_it) if (bone->flag & BONE_SELECTED) { bone->flag |= BONE_TRANSFORM; total++; - do_next= 0; // no transform on children if one parent bone is selected + do_next = FALSE; // no transform on children if one parent bone is selected } } } diff --git a/source/blender/editors/transform/transform_snap.c b/source/blender/editors/transform/transform_snap.c index b875886e80a..137d0838587 100644 --- a/source/blender/editors/transform/transform_snap.c +++ b/source/blender/editors/transform/transform_snap.c @@ -323,7 +323,7 @@ void applySnapping(TransInfo *t, float *vec) // Time base quirky code to go around findnearest slowness /* !TODO! add exception for object mode, no need to slow it down then */ - if (current - t->tsnap.last >= 0.01) { + if (current - t->tsnap.last >= 0.01) { t->tsnap.calcSnap(t, vec); t->tsnap.targetSnap(t); @@ -689,7 +689,7 @@ static float RotationBetween(TransInfo *t, float p1[3], float p2[3]) if (dot_v3v3(tmp, axis) < 0.0f) angle = -acos(dot_v3v3(start, end)); - else + else angle = acos(dot_v3v3(start, end)); } else { @@ -1066,7 +1066,7 @@ static int snapFace(ARegion *ar, float v1co[3], float v2co[3], float v3co[3], fl project_int(ar, location, screen_loc); new_dist = abs(screen_loc[0] - (int)mval[0]) + abs(screen_loc[1] - (int)mval[1]); - if (new_dist <= *dist && new_depth < *depth) { + if (new_dist <= *dist && new_depth < *depth) { *depth = new_depth; retval = 1; diff --git a/source/blender/editors/util/editmode_undo.c b/source/blender/editors/util/editmode_undo.c index ac0f8306259..9aaccb57fe2 100644 --- a/source/blender/editors/util/editmode_undo.c +++ b/source/blender/editors/util/editmode_undo.c @@ -209,19 +209,19 @@ static void undo_clean_stack(bContext *C) uel = undobase.first; while (uel) { void *editdata = uel->getdata(C); - int isvalid = 0; + int is_valid = FALSE; next = uel->next; /* for when objects are converted, renamed, or global undo changes pointers... */ if (uel->type == obedit->type) { if (strcmp(uel->id.name, obedit->id.name) == 0) { if (uel->validate_undo == NULL) - isvalid = 1; + is_valid = TRUE; else if (uel->validate_undo(uel->undodata, editdata)) - isvalid = 1; + is_valid = TRUE; } } - if (isvalid) + if (is_valid) uel->ob = obedit; else { if (uel == curundo) diff --git a/source/blender/editors/util/undo.c b/source/blender/editors/util/undo.c index cd88614f8fe..e7a9ab9ca73 100644 --- a/source/blender/editors/util/undo.c +++ b/source/blender/editors/util/undo.c @@ -165,15 +165,15 @@ static int ed_undo_step(bContext *C, int step, const char *undoname) } } else { - int do_glob_undo = 0; + int do_glob_undo = FALSE; if (obact && obact->mode & OB_MODE_TEXTURE_PAINT) { if (!ED_undo_paint_step(C, UNDO_PAINT_IMAGE, step, undoname)) - do_glob_undo = 1; + do_glob_undo = TRUE; } else if (obact && obact->mode & OB_MODE_SCULPT) { if (!ED_undo_paint_step(C, UNDO_PAINT_MESH, step, undoname)) - do_glob_undo = 1; + do_glob_undo = TRUE; } else if (obact && obact->mode & OB_MODE_PARTICLE_EDIT) { if (step == 1) @@ -182,7 +182,7 @@ static int ed_undo_step(bContext *C, int step, const char *undoname) PE_redo(CTX_data_scene(C)); } else { - do_glob_undo = 1; + do_glob_undo = TRUE; } if (do_glob_undo) { diff --git a/source/blender/editors/uvedit/uvedit_ops.c b/source/blender/editors/uvedit/uvedit_ops.c index a4227d92e27..53331dbe079 100644 --- a/source/blender/editors/uvedit/uvedit_ops.c +++ b/source/blender/editors/uvedit/uvedit_ops.c @@ -2490,7 +2490,8 @@ static int border_select_exec(bContext *C, wmOperator *op) } else if (pinned) { if ((luv->flag & MLOOPUV_PINNED) && - BLI_in_rctf(&rectf, luv->uv[0], luv->uv[1])) { + BLI_in_rctf(&rectf, luv->uv[0], luv->uv[1])) + { if (select) uvedit_uv_select_enable(em, scene, l, FALSE); else uvedit_uv_select_disable(em, scene, l); } diff --git a/source/blender/editors/uvedit/uvedit_parametrizer.c b/source/blender/editors/uvedit/uvedit_parametrizer.c index d596c553f7e..4a6de737e7a 100644 --- a/source/blender/editors/uvedit/uvedit_parametrizer.c +++ b/source/blender/editors/uvedit/uvedit_parametrizer.c @@ -4457,6 +4457,9 @@ void param_average(ParamHandle *handle) for (i = 0; i < phandle->ncharts; i++) { PFace *f; chart = phandle->charts[i]; + + if (chart->flag & PCHART_NOPACK) + continue; chart->u.pack.area = 0.0f; /* 3d area */ chart->u.pack.rescale = 0.0f; /* UV area, abusing rescale for tmp storage, oh well :/ */ @@ -4479,6 +4482,10 @@ void param_average(ParamHandle *handle) for (i = 0; i < phandle->ncharts; i++) { chart = phandle->charts[i]; + + if (chart->flag & PCHART_NOPACK) + continue; + if (chart->u.pack.area != 0.0f && chart->u.pack.rescale != 0.0f) { fac = chart->u.pack.area / chart->u.pack.rescale; diff --git a/source/blender/editors/uvedit/uvedit_smart_stitch.c b/source/blender/editors/uvedit/uvedit_smart_stitch.c index b30821dc56a..43f3e81ae92 100644 --- a/source/blender/editors/uvedit/uvedit_smart_stitch.c +++ b/source/blender/editors/uvedit/uvedit_smart_stitch.c @@ -319,7 +319,7 @@ static void stitch_calculate_island_snapping(StitchState *state, PreviewPosition int i; UvElement *element; - for (i = 0; i < state->element_map->totalIslands; i++) { + for (i = 0; i < state->element_map->totalIslands; i++) { if (island_stitch_data[i].addedForPreview) { int numOfIslandUVs = 0, j; @@ -649,7 +649,7 @@ static int stitch_process_data(StitchState *state, Scene *scene, int final) * Setup preview for stitchable islands * *****************************************/ if (state->snap_islands) { - for (i = 0; i < state->element_map->totalIslands; i++) { + for (i = 0; i < state->element_map->totalIslands; i++) { if (island_stitch_data[i].addedForPreview) { int numOfIslandUVs = 0, j; UvElement *element; @@ -827,7 +827,7 @@ static int stitch_process_data(StitchState *state, Scene *scene, int final) UvEdge *edge = state->edges + i; if ((state->uvs[edge->uv1]->flag & STITCH_STITCHABLE) && (state->uvs[edge->uv2]->flag & STITCH_STITCHABLE)) { stitch_island_calculate_edge_rotation(edge, state, final_position, uvfinal_map, island_stitch_data); - island_stitch_data[state->uvs[edge->uv1]->island].use_edge_rotation = 1; + island_stitch_data[state->uvs[edge->uv1]->island].use_edge_rotation = TRUE; } } |