Fix T49028: crash when copying a scene without grease pencil data.

This commit is contained in:
Kévin Dietrich 2016-08-06 12:43:37 +02:00
parent 28c3bdf50b
commit b4cd289cdf
Notes: blender-bot 2023-06-12 00:52:52 +02:00
Referenced by issue #49028, New scene. Full copy.
1 changed files with 7 additions and 4 deletions

View File

@ -1764,10 +1764,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;
}
}
}