Fix T64981: background images do not come along with linked cameras
authorBrecht Van Lommel <brechtvanlommel@gmail.com>
Wed, 22 May 2019 08:44:02 +0000 (10:44 +0200)
committerBrecht Van Lommel <brechtvanlommel@gmail.com>
Wed, 22 May 2019 08:44:02 +0000 (10:44 +0200)
source/blender/blenloader/intern/readfile.c

index 77deb86..5edba27 100644 (file)
@@ -10775,6 +10775,15 @@ static void expand_camera(FileData *fd, Main *mainvar, Camera *ca)
 {
   expand_doit(fd, mainvar, ca->ipo);  // XXX deprecated - old animation system
 
+  for (CameraBGImage *bgpic = ca->bg_images.first; bgpic; bgpic = bgpic->next) {
+    if (bgpic->source == CAM_BGIMG_SOURCE_IMAGE) {
+      expand_doit(fd, mainvar, bgpic->ima);
+    }
+    else if (bgpic->source == CAM_BGIMG_SOURCE_MOVIE) {
+      expand_doit(fd, mainvar, bgpic->ima);
+    }
+  }
+
   if (ca->adt) {
     expand_animdata(fd, mainvar, ca->adt);
   }