Appending a single object with particle system, will now also expand to
authorTon Roosendaal <ton@blender.org>
Sun, 5 Feb 2006 19:43:46 +0000 (19:43 +0000)
committerTon Roosendaal <ton@blender.org>
Sun, 5 Feb 2006 19:43:46 +0000 (19:43 +0000)
append its group and objects.

source/blender/blenloader/intern/readfile.c

index 7b32a814f9882641b32d1975800106db0830b1cf..bac79cf4d01a0f60a54aad02316b6636b62bd9f1 100644 (file)
@@ -5820,6 +5820,7 @@ static void expand_object(FileData *fd, Main *mainvar, Object *ob)
        bController *cont;
        bActuator *act;
        bActionStrip *strip;
        bController *cont;
        bActuator *act;
        bActionStrip *strip;
+       PartEff *paf;
        int a;
 
 
        int a;
 
 
@@ -5845,6 +5846,10 @@ static void expand_object(FileData *fd, Main *mainvar, Object *ob)
                expand_doit(fd, mainvar, ob->mat[a]);
        }
        
                expand_doit(fd, mainvar, ob->mat[a]);
        }
        
+       paf = give_parteff(ob);
+       if (paf && paf->group) 
+               expand_doit(fd, mainvar, paf->group);
+
        sens= ob->sensors.first;
        while(sens) {
                for(a=0; a<sens->totlinks; a++) {
        sens= ob->sensors.first;
        while(sens) {
                for(a=0; a<sens->totlinks; a++) {
@@ -6024,13 +6029,14 @@ static void give_base_to_objects(Scene *sce, ListBase *lb)
        Object *ob;
        Base *base;
 
        Object *ob;
        Base *base;
 
-       /* give all objects which are LIB_EXTERN and LIB_NEEDLINK a base */
+       /* give all objects which are LIB_INDIRECT a base */
        ob= lb->first;
        while(ob) {
 
        ob= lb->first;
        while(ob) {
 
-               if(ob->id.us==0) {
+               if( ob->id.flag & LIB_INDIRECT ) {
+                       /* hrmf... groups give user counter, so we check in that case entire scene */
+                       if(ob->id.us==0 || ((ob->flag & OB_FROMGROUP) && object_in_scene(ob, sce)==0) ) {
 
 
-                       if( ob->id.flag & LIB_INDIRECT ) {
                                base= MEM_callocN( sizeof(Base), "add_ext_base");
                                BLI_addtail(&(sce->base), base);
                                base->lay= ob->lay;
                                base= MEM_callocN( sizeof(Base), "add_ext_base");
                                BLI_addtail(&(sce->base), base);
                                base->lay= ob->lay;