Fix for bug #9867: issues with making particle systems local.
authorBrecht Van Lommel <brechtvanlommel@pandora.be>
Wed, 30 Apr 2008 13:29:57 +0000 (13:29 +0000)
committerBrecht Van Lommel <brechtvanlommel@pandora.be>
Wed, 30 Apr 2008 13:29:57 +0000 (13:29 +0000)
source/blender/blenkernel/BKE_particle.h
source/blender/blenkernel/intern/object.c
source/blender/blenkernel/intern/particle.c
source/blender/src/editobject.c

index fbde861891d9cc6233557f80a6f87dd50a500b7c..944a90816798bce1568ca62fc8834ba97570638e 100644 (file)
@@ -231,6 +231,7 @@ struct ParticleSystemModifierData *psys_get_modifier(struct Object *ob, struct P
 struct ParticleSettings *psys_new_settings(char *name, struct Main *main);
 struct ParticleSettings *psys_copy_settings(struct ParticleSettings *part);
 void psys_flush_settings(struct ParticleSettings *part, int event, int hair_recalc);
+void make_local_particlesettings(struct ParticleSettings *part);
 
 struct LinkNode *psys_using_settings(struct ParticleSettings *part, int flush_update);
 void psys_changed_type(struct ParticleSystem *psys);
index 2423c949204be570da6314938ca177b0271b1a4d..5594a1dfaf7f2d6671dbf84696bfce04f8c1d190 100644 (file)
@@ -1215,6 +1215,7 @@ Object *copy_object(Object *ob)
 void expand_local_object(Object *ob)
 {
        bActionStrip *strip;
+       ParticleSystem *psys;
        int a;
        
        id_lib_extern((ID *)ob->action);
@@ -1228,7 +1229,8 @@ void expand_local_object(Object *ob)
        for (strip=ob->nlastrips.first; strip; strip=strip->next) {
                id_lib_extern((ID *)strip->act);
        }
-
+       for(psys=ob->particlesystem.first; psys; psys=psys->next)
+               id_lib_extern((ID *)psys->part);
 }
 
 void make_local_object(Object *ob)
index 207ab56de9b043bdb80680536d93eca1d6a2dcc0..1eb47fa3da058975c9c74776db5543fabfaf19b5 100644 (file)
@@ -2988,7 +2988,7 @@ ParticleSettings *psys_copy_settings(ParticleSettings *part)
        return partn;
 }
 
-void psys_make_local_settings(ParticleSettings *part)
+void make_local_particlesettings(ParticleSettings *part)
 {
        Object *ob;
        ParticleSettings *par;
index 335c8378507aefdde12cf8813f567ff4c32ae499..512a29edbc24207643da7d49b76ff2a6c59782b4 100644 (file)
@@ -4783,6 +4783,7 @@ void make_local(int mode)
        Base *base;
        Object *ob;
        bActionStrip *strip;
+       ParticleSystem *psys;
        Material *ma, ***matarar;
        Lamp *la;
        Curve *cu;
@@ -4869,6 +4870,9 @@ void make_local(int mode)
                                        make_local_armature ((bArmature *)id);
                                        break;
                                }
+
+                               for(psys=ob->particlesystem.first; psys; psys=psys->next)
+                                       make_local_particlesettings(psys->part);
                        }
                        id= (ID *)ob->ipo;
                        if(id && id->lib) make_local_ipo(ob->ipo);
@@ -4876,11 +4880,10 @@ void make_local(int mode)
                        id= (ID *)ob->action;
                        if(id && id->lib) make_local_action(ob->action);
                        
-                       for (strip=ob->nlastrips.first; strip; strip=strip->next) {
+                       for(strip=ob->nlastrips.first; strip; strip=strip->next) {
                                if(strip->act && strip->act->id.lib)
                                        make_local_action(strip->act);
                        }
-                       
                }
                base= base->next;               
        }