Merge branch 'master' into blender2.8

This commit is contained in:
Bastien Montagne 2017-04-19 22:11:53 +02:00
commit 6a5b53fe6f
2 changed files with 22 additions and 1 deletions

View File

@ -991,13 +991,20 @@ void BKE_library_foreach_ID_link(Main *bmain, ID *id, LibraryIDLinkCallback call
}
break;
}
case ID_GD:
{
bGPdata *gpencil = (bGPdata *) id;
for (bGPDlayer *gp_layer = gpencil->layers.first; gp_layer; gp_layer = gp_layer->next) {
CALLBACK_INVOKE(gp_layer->parent, IDWALK_CB_NOP);
}
}
/* Nothing needed for those... */
case ID_IM:
case ID_VF:
case ID_TXT:
case ID_SO:
case ID_GD:
case ID_WM:
case ID_PAL:
case ID_PC:

View File

@ -1157,7 +1157,21 @@ static int object_delete_exec(bContext *C, wmOperator *op)
ob->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) {