Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'source/blender/editors/object/object_edit.c')
-rw-r--r--source/blender/editors/object/object_edit.c48
1 files changed, 30 insertions, 18 deletions
diff --git a/source/blender/editors/object/object_edit.c b/source/blender/editors/object/object_edit.c
index 4e532b0ab41..795e1dd66a5 100644
--- a/source/blender/editors/object/object_edit.c
+++ b/source/blender/editors/object/object_edit.c
@@ -139,8 +139,9 @@ Object *ED_object_active_context(bContext *C)
Object *ob = NULL;
if (C) {
ob = ED_object_context(C);
- if (!ob)
+ if (!ob) {
ob = CTX_data_active_object(C);
+ }
}
return ob;
}
@@ -702,8 +703,6 @@ static int editmode_toggle_exec(bContext *C, wmOperator *op)
}
}
- ED_space_image_uv_sculpt_update(bmain, CTX_wm_manager(C), scene);
-
WM_msg_publish_rna_prop(mbus, &obact->id, obact, Object, mode);
if (G.background == false) {
@@ -718,8 +717,9 @@ static bool editmode_toggle_poll(bContext *C)
Object *ob = CTX_data_active_object(C);
/* covers proxies too */
- if (ELEM(NULL, ob, ob->data) || ID_IS_LINKED(ob->data))
+ if (ELEM(NULL, ob, ob->data) || ID_IS_LINKED(ob->data)) {
return 0;
+ }
/* if hidden but in edit mode, we still display */
if ((ob->restrictflag & OB_RESTRICT_VIEW) && !(ob->mode & OB_MODE_EDIT)) {
@@ -857,12 +857,15 @@ static int forcefield_toggle_exec(bContext *C, wmOperator *UNUSED(op))
{
Object *ob = CTX_data_active_object(C);
- if (ob->pd == NULL)
+ if (ob->pd == NULL) {
ob->pd = BKE_partdeflect_new(PFIELD_FORCE);
- else if (ob->pd->forcefield == 0)
+ }
+ else if (ob->pd->forcefield == 0) {
ob->pd->forcefield = PFIELD_FORCE;
- else
+ }
+ else {
ob->pd->forcefield = 0;
+ }
ED_object_check_force_modifiers(CTX_data_main(C), CTX_data_scene(C), ob);
WM_event_add_notifier(C, NC_OBJECT | ND_DRAW, ob);
@@ -935,8 +938,9 @@ static int object_calculate_paths_invoke(bContext *C, wmOperator *op, const wmEv
{
Object *ob = CTX_data_active_object(C);
- if (ob == NULL)
+ if (ob == NULL) {
return OPERATOR_CANCELLED;
+ }
/* set default settings from existing/stored settings */
{
@@ -1032,8 +1036,9 @@ static int object_update_paths_exec(bContext *C, wmOperator *UNUSED(op))
{
Scene *scene = CTX_data_scene(C);
- if (scene == NULL)
+ if (scene == NULL) {
return OPERATOR_CANCELLED;
+ }
/* calculate the paths for objects that have them (and are tagged to get refreshed) */
ED_objects_recalculate_paths(C, scene, false);
@@ -1204,10 +1209,12 @@ static int shade_smooth_exec(bContext *C, wmOperator *op)
cu = ob->data;
for (nu = cu->nurb.first; nu; nu = nu->next) {
- if (!clear)
+ if (!clear) {
nu->flag |= ME_SMOOTH;
- else
+ }
+ else {
nu->flag &= ~ME_SMOOTH;
+ }
}
DEG_id_tag_update(&ob->id, ID_RECALC_GEOMETRY);
@@ -1218,8 +1225,9 @@ static int shade_smooth_exec(bContext *C, wmOperator *op)
}
CTX_DATA_END;
- if (linked_data)
+ if (linked_data) {
BKE_report(op->reports, RPT_WARNING, "Can't edit linked mesh or curve data");
+ }
return (done) ? OPERATOR_FINISHED : OPERATOR_CANCELLED;
}
@@ -1271,8 +1279,9 @@ static const EnumPropertyItem *object_mode_set_itemsf(bContext *C,
Object *ob;
int totitem = 0;
- if (!C) /* needed for docs */
+ if (!C) { /* needed for docs */
return rna_enum_object_mode_items;
+ }
ob = CTX_data_active_object(C);
if (ob) {
@@ -1320,10 +1329,12 @@ static bool object_mode_set_poll(bContext *C)
* to still work in that case when there's no active object
* so that users can exit editmode this way as per normal.
*/
- if (ED_operator_object_active_editable(C))
+ if (ED_operator_object_active_editable(C)) {
return true;
- else
+ }
+ else {
return (CTX_data_gpencil_data(C) != NULL);
+ }
}
static int object_mode_set_exec(bContext *C, wmOperator *op)
@@ -1354,8 +1365,9 @@ static int object_mode_set_exec(bContext *C, wmOperator *op)
mode = OB_MODE_EDIT_GPENCIL;
}
- if (!ob || !ED_object_mode_compat_test(ob, mode))
+ if (!ob || !ED_object_mode_compat_test(ob, mode)) {
return OPERATOR_PASS_THROUGH;
+ }
if (ob->mode != mode) {
/* we should be able to remove this call, each operator calls */
@@ -1406,7 +1418,7 @@ void OBJECT_OT_mode_set(wmOperatorType *ot)
/* api callbacks */
ot->exec = object_mode_set_exec;
- ot->poll = object_mode_set_poll; //ED_operator_object_active_editable;
+ ot->poll = object_mode_set_poll; // ED_operator_object_active_editable;
/* flags */
ot->flag = 0; /* no register/undo here, leave it to operators being called */
@@ -1432,7 +1444,7 @@ void OBJECT_OT_mode_set_or_submode(wmOperatorType *ot)
/* api callbacks */
ot->exec = object_mode_set_exec;
- ot->poll = object_mode_set_poll; //ED_operator_object_active_editable;
+ ot->poll = object_mode_set_poll; // ED_operator_object_active_editable;
/* flags */
ot->flag = 0; /* no register/undo here, leave it to operators being called */