Fix T49028: crash when copying a scene without grease pencil data.
This commit is contained in:
parent
28c3bdf50b
commit
b4cd289cdf
Notes:
blender-bot
2023-06-12 00:52:52 +02:00
Referenced by issue #49028, New scene. Full copy.
|
@ -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;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue