Bug fix: loading a file that had particles using a dupligroup from a liblinked file...
authorJanne Karhu <jhkarh@gmail.com>
Sun, 31 Jul 2011 16:26:02 +0000 (16:26 +0000)
committerJanne Karhu <jhkarh@gmail.com>
Sun, 31 Jul 2011 16:26:02 +0000 (16:26 +0000)
source/blender/blenloader/intern/readfile.c

index 4ad99c0..0633794 100644 (file)
@@ -3162,7 +3162,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;
@@ -3193,6 +3193,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;