Tuesday merger of bf-blender into orange branch.
[blender-staging.git] / source / blender / src / drawview.c
index 603e7023f2349d81c62ee6c404c5057e111abe31..58b6e759aeeb19f34da1e84a8d7a2b72a7f638fd 100644 (file)
@@ -2167,6 +2167,7 @@ void drawview3dspace(ScrArea *sa, void *spacedata)
        View3D *v3d= spacedata;
        Base *base;
        Object *ob;
+       Scene *setscene;
        
        setwinmatrixview3d(0);  /* 0= no pick rect */
        setviewmatrixview3d();  /* note: calls where_is_object for camera... */
@@ -2249,9 +2250,10 @@ void drawview3dspace(ScrArea *sa, void *spacedata)
                view3d_set_clipping(v3d);
        
        /* draw set first */
-       if(G.scene->set) {
+       setscene= G.scene->set;
+       if(setscene) { /* if(G.scene->set) { */
        
-               base= G.scene->set->base.first;
+               base= setscene->base.first; /* base= G.scene->set->base.first; */
                while(base) {
                        
                        if(v3d->lay & base->lay) {
@@ -2265,7 +2267,12 @@ void drawview3dspace(ScrArea *sa, void *spacedata)
                                        draw_dupli_objects(v3d, base);
                                }
                        }
+                       
                        base= base->next;
+                       if(base==0 && setscene && setscene->set) {
+                               setscene= setscene->set;
+                               base= setscene->base.first;
+                       }
                }
 
                /* Transp and X-ray afterdraw stuff */
@@ -2372,6 +2379,7 @@ void drawview3d_render(struct View3D *v3d)
 {
        extern short v3d_windowmode;
        Base *base;
+       Scene *setscene;
 
        update_for_newframe_muted();    /* first, since camera can be animated */
 
@@ -2415,9 +2423,10 @@ void drawview3d_render(struct View3D *v3d)
        G.f |= G_SIMULATION;
 
        /* first draw set */
-       if(G.scene->set) {
+       setscene= G.scene->set;
+       if(setscene) { /* if(G.scene->set) { */
        
-               base= G.scene->set->base.first;
+               base= setscene->base.first; /* base= G.scene->set->base.first; */
                while(base) {
                        if(v3d->lay & base->lay) {
                                if ELEM3(base->object->type, OB_LAMP, OB_CAMERA, OB_LATTICE);
@@ -2433,6 +2442,10 @@ void drawview3d_render(struct View3D *v3d)
                                }
                        }
                        base= base->next;
+                       if(base==0 && setscene && setscene->set) {
+                               setscene= setscene->set;
+                               base= setscene->base.first;
+                       }
                }
                
                /* Transp and X-ray afterdraw stuff */