diff options
author | Brecht Van Lommel <brechtvanlommel@gmail.com> | 2019-09-16 11:45:49 +0300 |
---|---|---|
committer | Brecht Van Lommel <brechtvanlommel@gmail.com> | 2019-09-19 12:32:35 +0300 |
commit | e7a514369fe700dcc5a1fe433c8f709ed9595ded (patch) | |
tree | 52ccedf52f694bf0be9c2ee10687ece24c58acd8 /source/blender/blenkernel/intern/smoke.c | |
parent | 5516e52fad046d648241409df01730079370e99b (diff) |
Modifiers: every modifier now copies mesh settings, fixing texture space issues
Modifier stack evaluation would copy mesh settings other than mesh topology
automatically, outside of the individual modifier evaluation. This leads to hard
to understand code, and makes it unclear which settings are available in following
modifiers, and which only after the entire stack is evaluated.
Now every modifier is responsible to ensure the mesh it outputs preserves materials,
texture space and other settings, or alters them as needed.
Fixes T64739: incorrect texture space for various modifiers
Differential Revision: https://developer.blender.org/D5808
Diffstat (limited to 'source/blender/blenkernel/intern/smoke.c')
-rw-r--r-- | source/blender/blenkernel/intern/smoke.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/source/blender/blenkernel/intern/smoke.c b/source/blender/blenkernel/intern/smoke.c index 74873db179d..e6c414b92da 100644 --- a/source/blender/blenkernel/intern/smoke.c +++ b/source/blender/blenkernel/intern/smoke.c @@ -3352,14 +3352,16 @@ struct Mesh *smokeModifier_do( if (smd->type & MOD_SMOKE_TYPE_DOMAIN && smd->domain && smd->domain->flags & MOD_SMOKE_ADAPTIVE_DOMAIN && smd->domain->base_res[0]) { result = createDomainGeometry(smd->domain, ob); + BKE_mesh_copy_settings(result, me); } else { result = BKE_mesh_copy_for_eval(me, false); } - /* XXX This is really not a nice hack, but until root of the problem is understood, - * this should be an acceptable workaround I think. - * See T58492 for details on the issue. */ - result->texflag |= ME_AUTOSPACE; + + /* Smoke simulation needs a texture space relative to the adaptive domain bounds, not the + * original mesh. So recompute it at this point in the modifier stack. See T58492. */ + BKE_mesh_texspace_calc(result); + return result; } |