Bugfix #3046
authorTon Roosendaal <ton@blender.org>
Mon, 3 Oct 2005 09:04:57 +0000 (09:04 +0000)
committerTon Roosendaal <ton@blender.org>
Mon, 3 Oct 2005 09:04:57 +0000 (09:04 +0000)
When using 3d window "unlocked" (own layer and own camera possible), the
dependency updates didn't work, these were only using Scene layers.

Changed the dependency graph call DAG_scene_flush_update()
to accept an argument for all visible layers in a Screen.

source/blender/blenkernel/BKE_depsgraph.h
source/blender/blenkernel/intern/depsgraph.c
source/blender/include/BIF_screen.h
source/blender/src/edit.c
source/blender/src/editipo.c
source/blender/src/editobject.c
source/blender/src/editscreen.c
source/blender/src/editview.c
source/blender/src/space.c
source/blender/src/transform_conversions.c

index 0c592364d7286e5a8772c6c33547735d5763b425..4ac70df66a7a0723a5c743d120e1ff1f3045d5b4 100644 (file)
@@ -97,7 +97,7 @@ void  draw_all_deps(void);
 
 void   DAG_scene_sort(struct Scene *sce);
 void   DAG_scene_update_flags(struct Scene *sce, unsigned int lay);
-void   DAG_scene_flush_update(struct Scene *sce);
+void   DAG_scene_flush_update(struct Scene *sce, unsigned int lay);
 void   DAG_object_flush_update(struct Scene *sce, struct Object *ob, short flag);
 void   DAG_pose_sort(struct Object *ob);
 
index 45c9d0b874eebb623f1e23a72e0e6ca0ec9b11a3..2780887ea49b8a8f069798292b95e297dce883c2 100644 (file)
@@ -1405,7 +1405,7 @@ static unsigned int flush_layer_node(DagNode *node, int curtime)
 }
 
 /* flushes all recalc flags in objects down the dependency tree */
-void DAG_scene_flush_update(Scene *sce)
+void DAG_scene_flush_update(Scene *sce, unsigned int lay)
 {
        DagNode *firstnode;
        DagAdjList *itA;
@@ -1426,7 +1426,7 @@ void DAG_scene_flush_update(Scene *sce)
        lasttime= sce->theDag->time;
        for(itA = firstnode->child; itA; itA= itA->next) {
                if(itA->node->lasttime!=lasttime && itA->node->type==ID_OB) 
-                       flush_update_node(itA->node, sce->lay, lasttime);
+                       flush_update_node(itA->node, lay, lasttime);
        }
 }
 
@@ -1515,7 +1515,7 @@ void DAG_scene_update_flags(Scene *sce, unsigned int lay)
                        }
                }
        }
-       DAG_scene_flush_update(sce);
+       DAG_scene_flush_update(sce, lay);
 }
 
 /* flag this object and all its relations to recalc */
@@ -1544,7 +1544,7 @@ void DAG_object_flush_update(Scene *sce, Object *ob, short flag)
                }
        }
        
-       DAG_scene_flush_update(sce);
+       DAG_scene_flush_update(sce, sce->lay);
 }
 
 /* ******************* DAG FOR ARMATURE POSE ***************** */
index 39fcd4ed9c3ab3beeb6289170f84077dbc73897a..bc14851b965da8ded3da5d62b2e1a83c281689d6 100644 (file)
@@ -139,6 +139,9 @@ int has_screenhandler(struct bScreen *sc, short eventcode);
  */
 void screen_draw_info_text(struct bScreen *sc, char *text);
 
+/* return all layers of all 3d windows in a screen */
+unsigned int screen_view3d_layers(void);
+
 #ifdef __cplusplus
 }
 #endif
index 7e9787a3b079c329d8561afec50511d3970f1365..877c0f000fd3f35dc86d54119a85c4a61af6d6d6 100644 (file)
@@ -1102,7 +1102,7 @@ void snap_sel_to_grid()
 
                base= base->next;
        }
-       DAG_scene_flush_update(G.scene);
+       DAG_scene_flush_update(G.scene, screen_view3d_layers());
        allqueue(REDRAWVIEW3D, 0);
 }
 
@@ -1180,7 +1180,7 @@ void snap_sel_to_curs()
 
                base= base->next;
        }
-       DAG_scene_flush_update(G.scene);
+       DAG_scene_flush_update(G.scene, screen_view3d_layers());
        allqueue(REDRAWVIEW3D, 0);
 }
 
@@ -1483,7 +1483,7 @@ void snap_to_center()
 
                base= base->next;
        }
-       DAG_scene_flush_update(G.scene);
+       DAG_scene_flush_update(G.scene, screen_view3d_layers());
        allqueue(REDRAWVIEW3D, 0);
 }
 
index a3f579db4c534c7cc0ecf22f8779dcf07b7d772a..0025d723d77aa0bb7019d9ef4a683f41314a94f6 100644 (file)
@@ -5017,7 +5017,7 @@ void transform_ipo(int mode)
                                                }
                                                base= base->next;
                                        }
-                                       DAG_scene_flush_update(G.scene);
+                                       DAG_scene_flush_update(G.scene, screen_view3d_layers());
                                        force_draw_plus(SPACE_VIEW3D, 0);
                                }
                                else force_draw(0);
index c7f4de25c7ecaf68f86de90b1fbb399c26680b0c..cd7279b7878002d1b724d8182f2e93e929049149 100644 (file)
@@ -884,7 +884,7 @@ void clear_parent(void)
        }
 
        DAG_scene_sort(G.scene);
-       DAG_scene_flush_update(G.scene);
+       DAG_scene_flush_update(G.scene, screen_view3d_layers());
        allqueue(REDRAWVIEW3D, 0);
        allqueue(REDRAWOOPS, 0);
        
@@ -987,7 +987,7 @@ void clear_object(char mode)
        }
        
        allqueue(REDRAWVIEW3D, 0);
-       DAG_scene_flush_update(G.scene);
+       DAG_scene_flush_update(G.scene, screen_view3d_layers());
        BIF_undo_push(str);
 }
 
@@ -1417,7 +1417,7 @@ void make_parent(void)
        allqueue(REDRAWOOPS, 0);
        
        DAG_scene_sort(G.scene);
-       DAG_scene_flush_update(G.scene);
+       DAG_scene_flush_update(G.scene, screen_view3d_layers());
        
        BIF_undo_push("make Parent");
 }
@@ -1827,7 +1827,7 @@ void docentre(int centremode)
        }
 
        allqueue(REDRAWVIEW3D, 0);
-       DAG_scene_flush_update(G.scene);
+       DAG_scene_flush_update(G.scene, screen_view3d_layers());
        BIF_undo_push("Do Centre");     
 }
 
@@ -2853,7 +2853,7 @@ void copy_attr(short event)
        }
        
        allqueue(REDRAWVIEW3D, 0);
-       DAG_scene_flush_update(G.scene);
+       DAG_scene_flush_update(G.scene, screen_view3d_layers());
 
        if(event==20) {
                allqueue(REDRAWBUTSOBJECT, 0);
@@ -3077,7 +3077,7 @@ void make_links(short event)
        allqueue(REDRAWOOPS, 0);
        allqueue(REDRAWBUTSHEAD, 0);
 
-       DAG_scene_flush_update(G.scene);
+       DAG_scene_flush_update(G.scene, screen_view3d_layers());
 
        BIF_undo_push("Create links");
 }
@@ -4362,7 +4362,7 @@ void adduplicate(int noTrans)
        }
 
        DAG_scene_sort(G.scene);
-       DAG_scene_flush_update(G.scene);
+       DAG_scene_flush_update(G.scene, screen_view3d_layers());
        set_sca_new_poins();
 
        clear_id_newpoins();
index 693b1b30a927396a46475fd44032ef56c3c523cf..82c96ec4b6cfc48b5cf82173ec15dfa6fc16db76 100644 (file)
@@ -3557,6 +3557,19 @@ void drawscredge_area(ScrArea *sa)
 
 /* ********************************* */
 
+/* for depgraph updating, all layers visible in a screen */
+unsigned int screen_view3d_layers(void)
+{
+       ScrArea *sa;
+       int layer= 0;
+       
+       for(sa= G.curscreen->areabase.first; sa; sa= sa->next) {
+               if(sa->spacetype==SPACE_VIEW3D)
+                       layer |= ((View3D *)sa->spacedata.first)->lay;
+       }
+       return layer;
+}
+
 bScreen *default_twosplit() 
 {
        bScreen *sc= addscreen("screen");
index 04a94edbce96134c6bb12ca048444b2f8c5ca45a..5651be4bb0901170cc4b7fed64841b5b2b8ebf11 100644 (file)
@@ -61,6 +61,7 @@
 #include "BLI_editVert.h"
 
 #include "BKE_armature.h"
+#include "BKE_depsgraph.h"
 #include "BKE_global.h"
 #include "BKE_lattice.h"
 #include "BKE_mesh.h"
@@ -1004,6 +1005,7 @@ static unsigned int samplerect(unsigned int *buf, int size, unsigned int dontdo)
 
 void set_active_base(Base *base)
 {
+       Base *tbase;
        
        BASACT= base;
        
@@ -1014,12 +1016,18 @@ void set_active_base(Base *base)
                set_active_group();
                
                /* signal to ipo */
-
                if (base) {
                        allqueue(REDRAWIPO, base->object->ipowin);
                        allqueue(REDRAWACTION, 0);
                        allqueue(REDRAWNLA, 0);
                }
+               /* disable temporal locks */
+               for(tbase=FIRSTBASE; tbase; tbase= tbase->next) {
+                       if(base!=tbase && (tbase->object->shapeflag & OB_SHAPE_TEMPLOCK)) {
+                               tbase->object->shapeflag &= ~OB_SHAPE_TEMPLOCK;
+                               DAG_object_flush_update(G.scene, tbase->object, OB_RECALC_DATA);
+                       }
+               }
        }
 }
 
index f22c27c9752e1d2932d9a32a668b610c031d4982..e7c6438eaf74f0e1e627b8d6e4bf77888deba820 100644 (file)
@@ -4839,18 +4839,9 @@ void force_draw(int header)
        sa= G.curscreen->areabase.first;
        while(sa) {
                if(sa!=tempsa && sa->spacetype==tempsa->spacetype) {
-                       if(sa->spacetype==SPACE_VIEW3D) {
-                               if( ((View3D *)sa->spacedata.first)->lay & ((View3D *)tempsa->spacedata.first)->lay) {
-                                       areawinset(sa->win);
-                                       scrarea_do_windraw(sa);
-                                       scrarea_do_headdraw(sa);
-                               }
-                       }
-                       else {
-                               areawinset(sa->win);
-                               scrarea_do_windraw(sa);
-                               scrarea_do_headdraw(sa);
-                       }
+                       areawinset(sa->win);
+                       scrarea_do_windraw(sa);
+                       scrarea_do_headdraw(sa);
                }
                sa= sa->next;
        }
index b8f8f0b39921e9f108d75486054cec3ccdce6091..b2834fd10ddf96186f670904896ede0d474f4ad6 100755 (executable)
@@ -1570,7 +1570,7 @@ static void set_trans_object_base_flags(TransInfo *t)
                }
        }
        /* all recalc flags get flushed */
-       DAG_scene_flush_update(G.scene);
+       DAG_scene_flush_update(G.scene, screen_view3d_layers());
        
        /* and we store them temporal in base (only used for transform code) */
        /* this because after doing updates, the object->recalc is cleared */