diff options
author | Matt Ebb <matt@mke3.net> | 2010-05-24 11:30:50 +0400 |
---|---|---|
committer | Matt Ebb <matt@mke3.net> | 2010-05-24 11:30:50 +0400 |
commit | 9777072c0e42931848ea82dc606d155717fc3adf (patch) | |
tree | 9613d72a2bbd9195bfa8fdb63a54b452974ec1d9 /source/blender | |
parent | a1ada0f21c5f90d80a7e2b89b9f08fa1e756f675 (diff) |
Fix [#21521] Displacement modifier does not update when modifing texture
Depgraph now handles texture dependencies - textures can affect objects/data via modifiers.
Diffstat (limited to 'source/blender')
-rw-r--r-- | source/blender/blenkernel/intern/depsgraph.c | 21 | ||||
-rw-r--r-- | source/blender/editors/space_view3d/space_view3d.c | 4 |
2 files changed, 25 insertions, 0 deletions
diff --git a/source/blender/blenkernel/intern/depsgraph.c b/source/blender/blenkernel/intern/depsgraph.c index 1e5f276ba95..0568050950f 100644 --- a/source/blender/blenkernel/intern/depsgraph.c +++ b/source/blender/blenkernel/intern/depsgraph.c @@ -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) { diff --git a/source/blender/editors/space_view3d/space_view3d.c b/source/blender/editors/space_view3d/space_view3d.c index e78618f4627..78ae13d255e 100644 --- a/source/blender/editors/space_view3d/space_view3d.c +++ b/source/blender/editors/space_view3d/space_view3d.c @@ -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) { |