diff options
author | Campbell Barton <ideasman42@gmail.com> | 2021-03-28 10:28:07 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2021-03-28 10:48:57 +0300 |
commit | 0a6bca1f75398aa9acbeae8bd596550cd2ee23e6 (patch) | |
tree | e1e2dbff667ff15366ef7888ac104bb94534761b /source/blender/editors/object | |
parent | 46d980228b22b153416cd1223bb5fa3e766fac85 (diff) |
Cleanup: revert part of da160dc32d1518dc3e59a8fb7995b59c88870444
The grease-pencil parent check was enabled when deleting objects,
when previously it was only done when unlinking.
While harmless, the previous logic is correct.
Diffstat (limited to 'source/blender/editors/object')
-rw-r--r-- | source/blender/editors/object/object_add.c | 26 |
1 files changed, 12 insertions, 14 deletions
diff --git a/source/blender/editors/object/object_add.c b/source/blender/editors/object/object_add.c index c0b31d6ed65..7c192190c06 100644 --- a/source/blender/editors/object/object_add.c +++ b/source/blender/editors/object/object_add.c @@ -1965,20 +1965,6 @@ static int object_delete_exec(bContext *C, wmOperator *op) DEG_id_tag_update(&gpd->id, ID_RECALC_TRANSFORM | ID_RECALC_GEOMETRY); } - /* remove from Grease Pencil parent */ - /* XXX This is likely not correct? - * Will also remove parent from grease pencil from other scenes, - * even when use_global is false... */ - for (bGPdata *gpd = bmain->gpencils.first; gpd; gpd = gpd->id.next) { - LISTBASE_FOREACH (bGPDlayer *, gpl, &gpd->layers) { - if (gpl->parent != NULL) { - if (gpl->parent == ob) { - gpl->parent = NULL; - } - } - } - } - /* Use multi tagged delete if `use_global=True`, or the object is used only in one scene. */ if (use_global || ID_REAL_USERS(ob) <= 1) { ob->id.tag |= LIB_TAG_DOIT; @@ -1988,6 +1974,18 @@ static int object_delete_exec(bContext *C, wmOperator *op) /* Object is used in multiple scenes. Delete the object from the current scene only. */ ED_object_base_free_and_unlink_no_indirect_check(bmain, scene, ob); changed_count += 1; + + /* FIXME: this will also remove parent from grease pencil from other scenes. */ + /* Remove from Grease Pencil parent */ + for (bGPdata *gpd = bmain->gpencils.first; gpd; gpd = gpd->id.next) { + LISTBASE_FOREACH (bGPDlayer *, gpl, &gpd->layers) { + if (gpl->parent != NULL) { + if (gpl->parent == ob) { + gpl->parent = NULL; + } + } + } + } } } CTX_DATA_END; |