Merge branch 'master' into blender2.8

This commit is contained in:
Bastien Montagne
2016-08-06 12:57:21 +02:00
2 changed files with 24 additions and 6 deletions

View File

@@ -837,7 +837,7 @@ bool BKE_library_idtype_can_use_idtype(const short id_type_owner, const short id
return id_type_can_have_animdata(id_type_owner);
}
switch (id_type_owner) {
switch ((ID_Type)id_type_owner) {
case ID_LI:
return ELEM(id_type_used, ID_LI);
case ID_SCE:
@@ -894,9 +894,24 @@ bool BKE_library_idtype_can_use_idtype(const short id_type_owner, const short id
return ELEM(id_type_used, ID_MC); /* WARNING! mask->parent.id, not typed. */
case ID_LS:
return (ELEM(id_type_used, ID_TE, ID_OB) || BKE_library_idtype_can_use_idtype(ID_NT, id_type_used));
default:
case ID_IM:
case ID_VF:
case ID_TXT:
case ID_SO:
case ID_AR:
case ID_AC:
case ID_GD:
case ID_WM:
case ID_PAL:
case ID_PC:
case ID_CF:
/* Those types never use/reference other IDs... */
return false;
case ID_IP:
/* Deprecated... */
return false;
}
return false;
}

View File

@@ -1763,10 +1763,13 @@ static void single_object_users(Main *bmain, Scene *scene, View3D *v3d, const in
/* copy already clears */
}
/* remap gpencil parenting */
bGPdata *gpd = scene->gpd;
for (bGPDlayer *gpl = gpd->layers.first; gpl; gpl = gpl->next) {
if (gpl->parent == ob) {
gpl->parent = obn;
if (scene->gpd) {
bGPdata *gpd = scene->gpd;
for (bGPDlayer *gpl = gpd->layers.first; gpl; gpl = gpl->next) {
if (gpl->parent == ob) {
gpl->parent = obn;
}
}
}