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:
parent
a1ada0f21c
commit
9777072c0e
@ -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)
|
||||
{
|
||||
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 */
|
||||
if(idtype == ID_KE) {
|
||||
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 */
|
||||
ED_region_tag_redraw(ar);
|
||||
break;
|
||||
case NC_TEXTURE:
|
||||
/* same as above */
|
||||
ED_region_tag_redraw(ar);
|
||||
break;
|
||||
case NC_SPACE:
|
||||
if(wmn->data == ND_SPACE_VIEW3D) {
|
||||
if (wmn->subtype == NS_VIEW3D_GPU) {
|
||||
|
Loading…
Reference in New Issue
Block a user