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:
authorBastien Montagne <montagne29@wanadoo.fr>2017-04-19 23:07:57 +0300
committerBastien Montagne <montagne29@wanadoo.fr>2017-04-19 23:07:57 +0300
commit1873ea337c24e7a169c306a7467ce899a53eb0f8 (patch)
treeb11432c0a526cdce1f302ddc70a13beaa6fd8812 /source/blender/editors/object
parent1c28e124145a095b7e5f4c110d7864dba32a7f31 (diff)
Fix T51243: Delete Globally won't work with Datablock ID Properties.
That's a quick hack to address that specific case, new pointer IDProp actually enlights a generic problem - datablocks using themselves - which is not really handled by current code, would consider this not-so-urgent TODO though.
Diffstat (limited to 'source/blender/editors/object')
-rw-r--r--source/blender/editors/object/object_add.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/source/blender/editors/object/object_add.c b/source/blender/editors/object/object_add.c
index 20523264cd9..b278d6e1e87 100644
--- a/source/blender/editors/object/object_add.c
+++ b/source/blender/editors/object/object_add.c
@@ -1154,7 +1154,21 @@ static int object_delete_exec(bContext *C, wmOperator *op)
base->object->id.name + 2, scene->id.name + 2);
continue;
}
+
+ /* This is sort of a quick hack to address T51243 - Proper thing to do here would be to nuke most of all this
+ * custom scene/object/base handling, and use generic lib remap/query for that.
+ * But this is for later (aka 2.8, once layers & co are settled and working).
+ */
+ if (use_global && base->object->id.lib == NULL) {
+ /* We want to nuke the object, let's nuke it the easy way (not for linked data though)... */
+ BKE_libblock_delete(bmain, &base->object->id);
+ changed = true;
+ continue;
+ }
+
/* 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->gpencil.first; gpd; gpd = gpd->id.next) {
for (bGPDlayer *gpl = gpd->layers.first; gpl; gpl = gpl->next) {
if (gpl->parent != NULL) {