fix for own error r35918, generalizing looping over modifier ID links
authorCampbell Barton <ideasman42@gmail.com>
Wed, 8 Jun 2011 16:00:52 +0000 (16:00 +0000)
committerCampbell Barton <ideasman42@gmail.com>
Wed, 8 Jun 2011 16:00:52 +0000 (16:00 +0000)
broke loading smoke group references because they already had calls to
newlibadr_us() elsewhere, removing those assignments fixes loading.

source/blender/blenloader/intern/readfile.c
source/blender/modifiers/intern/MOD_smoke.c

index 6f0400d5764f58a9cd2c5e2766916742bd7df674..3987b082aeb03fcacb6fe0ddf5f16bb7a9145aed 100644 (file)
@@ -3843,12 +3843,6 @@ static void lib_link_object(FileData *fd, Main *main)
                                
                                if(smd && smd->type == MOD_SMOKE_TYPE_DOMAIN && smd->domain) 
                                {
-                                       smd->domain->coll_group = newlibadr_us(fd, ob->id.lib, smd->domain->coll_group);
-                                       smd->domain->eff_group = newlibadr_us(fd, ob->id.lib, smd->domain->eff_group);
-                                       smd->domain->fluid_group = newlibadr_us(fd, ob->id.lib, smd->domain->fluid_group);
-
-                                       smd->domain->effector_weights->group = newlibadr(fd, ob->id.lib, smd->domain->effector_weights->group);
-
                                        smd->domain->flags |= MOD_SMOKE_FILE_LOAD; /* flag for refreshing the simulation after loading */
                                }
                        }
index d8e94e92bfa265dd23f788c302cf84bae8300e8d..b6203bb3c1dcb01f451d670543fd15823570d117 100644 (file)
@@ -43,6 +43,7 @@
 #include "DNA_object_types.h"
 #include "DNA_scene_types.h"
 #include "DNA_smoke_types.h"
+#include "DNA_object_force.h"
 
 #include "BLI_utildefines.h"
 
@@ -156,6 +157,10 @@ static void foreachIDLink(ModifierData *md, Object *ob,
                walk(userData, ob, (ID **)&smd->domain->coll_group);
                walk(userData, ob, (ID **)&smd->domain->fluid_group);
                walk(userData, ob, (ID **)&smd->domain->eff_group);
+
+               if(smd->domain->effector_weights) {
+                       walk(userData, ob, (ID **)&smd->domain->effector_weights->group);
+               }
        }
 }