Code cleanup: replace 0 with OB_MODE_OBJECT

This commit is contained in:
Campbell Barton 2014-06-18 16:01:51 +10:00
parent b16bf6c3d4
commit 3c63eee7b4
4 changed files with 5 additions and 5 deletions

@ -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 */

@ -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++;

@ -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;

@ -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))