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/blenkernel/intern/depsgraph.c | |
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/blenkernel/intern/depsgraph.c')
-rw-r--r-- | source/blender/blenkernel/intern/depsgraph.c | 21 |
1 files changed, 21 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) { |