Fix [#21521] Displacement modifier does not update when modifing texture

Depgraph now handles texture dependencies - textures can affect objects/data via modifiers.
This commit is contained in:
Matt Ebb 2010-05-24 07:30:50 +00:00
parent a1ada0f21c
commit 9777072c0e
2 changed files with 25 additions and 0 deletions

@ -2250,6 +2250,16 @@ void DAG_on_load_update(void)
} }
} }
static void dag_id_flush_update__isDependentTexture(void *userData, Object *ob, ID **idpoin)
{
struct { ID *id; int is_dependent; } *data = userData;
if(*idpoin && GS((*idpoin)->name)==ID_TE) {
if (data->id == (*idpoin))
data->is_dependent = 1;
}
}
void DAG_id_flush_update(ID *id, short flag) void DAG_id_flush_update(ID *id, short flag)
{ {
Main *bmain= G.main; Main *bmain= G.main;
@ -2304,6 +2314,17 @@ void DAG_id_flush_update(ID *id, short flag)
} }
} }
/* set flags based on textures - can influence depgraph via modifiers */
if(idtype == ID_TE) {
for(obt=bmain->object.first; obt; obt= obt->id.next) {
struct { ID *id; int is_dependent; } data = {id, 0};
modifiers_foreachIDLink(obt, dag_id_flush_update__isDependentTexture, &data);
if (data.is_dependent)
obt->recalc |= OB_RECALC_DATA;
}
}
/* set flags based on ShapeKey */ /* set flags based on ShapeKey */
if(idtype == ID_KE) { if(idtype == ID_KE) {
for(obt=bmain->object.first; obt; obt= obt->id.next) { for(obt=bmain->object.first; obt; obt= obt->id.next) {

@ -610,6 +610,10 @@ static void view3d_main_area_listener(ARegion *ar, wmNotifier *wmn)
* more context than just the region */ * more context than just the region */
ED_region_tag_redraw(ar); ED_region_tag_redraw(ar);
break; break;
case NC_TEXTURE:
/* same as above */
ED_region_tag_redraw(ar);
break;
case NC_SPACE: case NC_SPACE:
if(wmn->data == ND_SPACE_VIEW3D) { if(wmn->data == ND_SPACE_VIEW3D) {
if (wmn->subtype == NS_VIEW3D_GPU) { if (wmn->subtype == NS_VIEW3D_GPU) {