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/object | |
parent | 74a889d8b1a8e9f83214fa885f530b7b167b4a32 (diff) | |
parent | c55bb6eae27142a34446440ef3433d5bd7597598 (diff) |
svn merge ^/trunk/blender -r46750:HEAD
Diffstat (limited to 'source/blender/editors/object')
-rw-r--r-- | source/blender/editors/object/object_add.c | 6 | ||||
-rw-r--r-- | source/blender/editors/object/object_bake.c | 2 | ||||
-rw-r--r-- | source/blender/editors/object/object_edit.c | 14 | ||||
-rw-r--r-- | source/blender/editors/object/object_modifier.c | 13 | ||||
-rw-r--r-- | source/blender/editors/object/object_ops.c | 2 | ||||
-rw-r--r-- | source/blender/editors/object/object_relations.c | 6 | ||||
-rw-r--r-- | source/blender/editors/object/object_select.c | 2 | ||||
-rw-r--r-- | source/blender/editors/object/object_transform.c | 19 |
8 files changed, 36 insertions, 28 deletions
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) { |