Merging trunk up to r38932.
[blender.git] / source / blender / blenloader / intern / readfile.c
index 18b461e..1737b44 100644 (file)
@@ -3163,7 +3163,7 @@ static void lib_link_particlesettings(FileData *fd, Main *main)
                        if(part->effector_weights)
                                part->effector_weights->group = newlibadr(fd, part->id.lib, part->effector_weights->group);
 
-                       if(part->dupliweights.first) {
+                       if(part->dupliweights.first && part->dup_group) {
                                int index_ok = 0;
                                /* check for old files without indices (all indexes 0) */
                                dw = part->dupliweights.first;
@@ -3194,6 +3194,9 @@ static void lib_link_particlesettings(FileData *fd, Main *main)
                                                dw->ob = newlibadr(fd, part->id.lib, dw->ob);
                                }
                        }
+                       else {
+                               part->dupliweights.first = part->dupliweights.last = NULL;
+                       }
 
                        if(part->boids) {
                                BoidState *state = part->boids->states.first;