diff --git a/source/blender/blenkernel/intern/object.c b/source/blender/blenkernel/intern/object.c index a3e8ddccf0b..415606d1fdc 100644 --- a/source/blender/blenkernel/intern/object.c +++ b/source/blender/blenkernel/intern/object.c @@ -1479,7 +1479,7 @@ Object *BKE_object_copy_ex(Main *bmain, Object *ob, bool copy_caches) defgroup_copy_list(&obn->defbase, &ob->defbase); BKE_constraints_copy(&obn->constraints, &ob->constraints, true); - obn->mode = 0; + obn->mode = OB_MODE_OBJECT; obn->sculpt = NULL; /* increase user numbers */ diff --git a/source/blender/blenloader/intern/readfile.c b/source/blender/blenloader/intern/readfile.c index 066c4ea67f1..b0edb41f96d 100644 --- a/source/blender/blenloader/intern/readfile.c +++ b/source/blender/blenloader/intern/readfile.c @@ -8924,7 +8924,7 @@ static ID *append_named_part_ex(const bContext *C, Main *mainl, FileData *fd, co ob->lay = v3d ? v3d->layact : scene->lay; } - ob->mode = 0; + ob->mode = OB_MODE_OBJECT; base->lay = ob->lay; base->object = ob; ob->id.us++; diff --git a/source/blender/editors/screen/screen_ops.c b/source/blender/editors/screen/screen_ops.c index 8b6a1b22a5c..eb79b0ca550 100644 --- a/source/blender/editors/screen/screen_ops.c +++ b/source/blender/editors/screen/screen_ops.c @@ -166,7 +166,7 @@ int ED_operator_objectmode(bContext *C) return 0; /* add a check for ob->mode too? */ - if (obact && obact->mode) + if (obact && (obact->mode != OB_MODE_OBJECT)) return 0; return 1; diff --git a/source/blender/editors/util/ed_util.c b/source/blender/editors/util/ed_util.c index 178af8c836a..4dfaed98aab 100644 --- a/source/blender/editors/util/ed_util.c +++ b/source/blender/editors/util/ed_util.c @@ -96,8 +96,8 @@ void ED_editors_init(bContext *C) for (ob = bmain->object.first; ob; ob = ob->id.next) { int mode = ob->mode; - if (mode && (mode != OB_MODE_POSE)) { - ob->mode = 0; + if (!ELEM(mode, OB_MODE_OBJECT, OB_MODE_POSE)) { + ob->mode = OB_MODE_OBJECT; data = ob->data; if (ob == obact && !ob->id.lib && !(data && data->lib))