Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBastien Montagne <montagne29@wanadoo.fr>2019-01-22 23:49:38 +0300
committerBastien Montagne <montagne29@wanadoo.fr>2019-01-22 23:52:15 +0300
commit3891ad8e03176d993b8082292638117a2963f931 (patch)
tree93e626c089fc510a9b76571ddd0b225e71cde87d
parent7886db9ba977016199f5b28cbfa179cb97940ff0 (diff)
Fix T58492: smoke flow jitters around flow source when using adaptive domain.
This is more like a band-aid than a real fix actually, real fix would be to understand why rendering smoke requires auto texspace to be ON (afaict, this was not the case in 2.7x)... But I've already spent way too much time on this issue, at least now we get better situation than before (i.e. smoke with adaptive domain works well even when orig domain mesh has autospace flag disabled).
-rw-r--r--source/blender/blenkernel/intern/DerivedMesh.c6
-rw-r--r--source/blender/blenkernel/intern/smoke.c10
2 files changed, 13 insertions, 3 deletions
diff --git a/source/blender/blenkernel/intern/DerivedMesh.c b/source/blender/blenkernel/intern/DerivedMesh.c
index 8428bc580d4..6b557e1749a 100644
--- a/source/blender/blenkernel/intern/DerivedMesh.c
+++ b/source/blender/blenkernel/intern/DerivedMesh.c
@@ -2052,7 +2052,11 @@ static void mesh_build_data(
#endif
BKE_object_boundbox_calc_from_mesh(ob, ob->runtime.mesh_eval);
- BKE_mesh_texspace_copy_from_object(ob->runtime.mesh_eval, ob);
+ /* Only copy texspace from orig mesh if some modifier (hint: smoke sim, see T58492)
+ * did not re-enable that flag (which always get disabled for eval mesh as a start). */
+ if (!(ob->runtime.mesh_eval->texflag & ME_AUTOSPACE)) {
+ BKE_mesh_texspace_copy_from_object(ob->runtime.mesh_eval, ob);
+ }
mesh_finalize_eval(ob);
diff --git a/source/blender/blenkernel/intern/smoke.c b/source/blender/blenkernel/intern/smoke.c
index ac9c593ef65..918185e0ffb 100644
--- a/source/blender/blenkernel/intern/smoke.c
+++ b/source/blender/blenkernel/intern/smoke.c
@@ -2898,15 +2898,21 @@ struct Mesh *smokeModifier_do(
BLI_rw_mutex_unlock(smd->domain->fluid_mutex);
/* return generated geometry for adaptive domain */
+ Mesh *result;
if (smd->type & MOD_SMOKE_TYPE_DOMAIN && smd->domain &&
smd->domain->flags & MOD_SMOKE_ADAPTIVE_DOMAIN &&
smd->domain->base_res[0])
{
- return createDomainGeometry(smd->domain, ob);
+ result = createDomainGeometry(smd->domain, ob);
}
else {
- return BKE_mesh_copy_for_eval(me, false);
+ 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;
+ return result;
}
static float calc_voxel_transp(float *result, float *input, int res[3], int *pixel, float *tRay, float correct)