Switching layers reveiled hidden objects in wrong positions, changes
are currently not being handled for hidden objects. 
Only way to fix it is by completely update newly visible objects...

(Also fixed a typo and a compile warning)
This commit is contained in:
Ton Roosendaal 2011-02-16 18:04:03 +00:00
parent aed7eaf0d9
commit 9d168f7337
3 changed files with 13 additions and 4 deletions

@ -139,10 +139,11 @@ static void handle_view3d_lock(bContext *C)
static int view3d_layers_exec(bContext *C, wmOperator *op)
{
Main *bmain= CTX_data_main(C);
Scene *scene= CTX_data_scene(C);
ScrArea *sa= CTX_wm_area(C);
View3D *v3d= sa->spacedata.first;
Base *base;
int oldlay= v3d->lay;
int nr= RNA_int_get(op->ptr, "nr");
int toggle= RNA_boolean_get(op->ptr, "toggle");
@ -200,8 +201,14 @@ static int view3d_layers_exec(bContext *C, wmOperator *op)
if(v3d->scenelock) handle_view3d_lock(C);
/* new layers might need unflushed events events */
DAG_scene_update_flags(bmain, scene, v3d->lay, FALSE); /* tags all that moves and flushes */
/* XXX new layers might need updates, there is no provision yet to detect if that's needed */
oldlay= ~oldlay & v3d->lay;
for (base= scene->base.first; base; base= base->next) {
if(base->lay & oldlay)
base->object->recalc= OB_RECALC_OB|OB_RECALC_DATA;
if(base->lay & oldlay)
printf("recalc %s\n", base->object->id.name+2);
}
ED_area_tag_redraw(sa);

@ -1941,6 +1941,7 @@ static void VertsToTransData(TransInfo *t, TransData *td, EditMesh *em, EditVert
}
}
#if 0
static void createTransBMeshVerts(TransInfo *t, BME_Mesh *bm, BME_TransData_Head *td) {
BME_Vert *v;
BME_TransData *vtd;
@ -1965,6 +1966,7 @@ static void createTransBMeshVerts(TransInfo *t, BME_Mesh *bm, BME_TransData_Head
* (i.e. we can't depend on td->len to determine the number of actual elements) */
t->total = i;
}
#endif
static void createTransEditVerts(bContext *C, TransInfo *t)
{

@ -1875,7 +1875,7 @@ static void rna_def_texture_slots(BlenderRNA *brna, PropertyRNA *cprop, const ch
func= RNA_def_function(srna, "clear", "rna_mtex_texture_slots_clear");
RNA_def_function_flag(func, FUNC_USE_SELF_ID|FUNC_NO_SELF|FUNC_USE_CONTEXT|FUNC_USE_REPORTS);
parm= RNA_def_int(func, "index", 0, 0, INT_MAX, "Index", "Slot index to clar.", 0, INT_MAX);
parm= RNA_def_int(func, "index", 0, 0, INT_MAX, "Index", "Slot index to clear.", 0, INT_MAX);
RNA_def_property_flag(parm, PROP_REQUIRED);
}