Bugfix #3046
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.
This commit is contained in:
@@ -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);
|
||||
|
||||
|
||||
@@ -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 ***************** */
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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();
|
||||
|
||||
@@ -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");
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -4839,19 +4839,10 @@ 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);
|
||||
}
|
||||
}
|
||||
sa= sa->next;
|
||||
}
|
||||
|
||||
|
||||
@@ -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 */
|
||||
|
||||
Reference in New Issue
Block a user