From cfb7664d5b48d5b5dcb60f47fc6237cdb2be7cb1 Mon Sep 17 00:00:00 2001 From: Jacques Lucke Date: Tue, 19 May 2020 17:36:40 +0200 Subject: [PATCH 1/6] Fix: build error due to missing definitions Reviewers: sergey, brecht Differential Revision: https://developer.blender.org/D7787 --- intern/opensubdiv/CMakeLists.txt | 2 +- source/blender/draw/CMakeLists.txt | 2 ++ source/blender/render/CMakeLists.txt | 2 ++ 3 files changed, 5 insertions(+), 1 deletion(-) diff --git a/intern/opensubdiv/CMakeLists.txt b/intern/opensubdiv/CMakeLists.txt index e7292872e9c..c411e58be35 100644 --- a/intern/opensubdiv/CMakeLists.txt +++ b/intern/opensubdiv/CMakeLists.txt @@ -105,8 +105,8 @@ if(WITH_OPENSUBDIV) data_to_c_simple(shader/gpu_shader_opensubdiv_geometry.glsl SRC) data_to_c_simple(shader/gpu_shader_opensubdiv_fragment.glsl SRC) - add_definitions(-DGLEW_STATIC) add_definitions(-DOSD_USES_GLEW) + add_definitions(${GL_DEFINITIONS}) if(WIN32) add_definitions(-DNOMINMAX) diff --git a/source/blender/draw/CMakeLists.txt b/source/blender/draw/CMakeLists.txt index 6f932bf8797..0214a8e1887 100644 --- a/source/blender/draw/CMakeLists.txt +++ b/source/blender/draw/CMakeLists.txt @@ -401,4 +401,6 @@ if(WITH_XR_OPENXR) add_definitions(-DWITH_XR_OPENXR) endif() +add_definitions(${GL_DEFINITIONS}) + blender_add_lib(bf_draw "${SRC}" "${INC}" "${INC_SYS}" "${LIB}") diff --git a/source/blender/render/CMakeLists.txt b/source/blender/render/CMakeLists.txt index a1dd9b3d5b0..f49c68a258d 100644 --- a/source/blender/render/CMakeLists.txt +++ b/source/blender/render/CMakeLists.txt @@ -108,4 +108,6 @@ if(APPLE) endif() endif() +add_definitions(${GL_DEFINITIONS}) + blender_add_lib_nolist(bf_render "${SRC}" "${INC}" "${INC_SYS}" "${LIB}") From 059f79bdd745dd2fc1b55738623330f32b2c68eb Mon Sep 17 00:00:00 2001 From: Philipp Oeser Date: Tue, 19 May 2020 13:48:17 +0200 Subject: [PATCH 2/6] Clarify autokeyframe tootip This applies to masks as well. Spotted while looking into T76872. Differential Revision: https://developer.blender.org/D7788 --- source/blender/makesrna/intern/rna_scene.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/source/blender/makesrna/intern/rna_scene.c b/source/blender/makesrna/intern/rna_scene.c index b16eb17747b..81343f12af2 100644 --- a/source/blender/makesrna/intern/rna_scene.c +++ b/source/blender/makesrna/intern/rna_scene.c @@ -3374,14 +3374,15 @@ static void rna_def_tool_settings(BlenderRNA *brna) prop = RNA_def_property(srna, "use_keyframe_insert_auto", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "autokey_mode", AUTOKEY_ON); RNA_def_property_ui_text( - prop, "Auto Keying", "Automatic keyframe insertion for Objects and Bones"); + prop, "Auto Keying", "Automatic keyframe insertion for Objects, Bones and Masks"); RNA_def_property_ui_icon(prop, ICON_REC, 0); prop = RNA_def_property(srna, "auto_keying_mode", PROP_ENUM, PROP_NONE); RNA_def_property_enum_bitflag_sdna(prop, NULL, "autokey_mode"); RNA_def_property_enum_items(prop, auto_key_items); - RNA_def_property_ui_text( - prop, "Auto-Keying Mode", "Mode of automatic keyframe insertion for Objects and Bones"); + RNA_def_property_ui_text(prop, + "Auto-Keying Mode", + "Mode of automatic keyframe insertion for Objects, Bones and Masks"); prop = RNA_def_property(srna, "use_record_with_nla", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "autokey_flag", ANIMRECORD_FLAG_WITHNLA); From a4cbacacbf8e32038e77e567a29716ede5b5db0a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9ment=20Foucault?= Date: Tue, 19 May 2020 16:29:13 +0200 Subject: [PATCH 3/6] Fix T73847 Overlay: Camera orthographic scale moves background image --- source/blender/draw/engines/overlay/overlay_image.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/source/blender/draw/engines/overlay/overlay_image.c b/source/blender/draw/engines/overlay/overlay_image.c index c592f11a855..be3510967b6 100644 --- a/source/blender/draw/engines/overlay/overlay_image.c +++ b/source/blender/draw/engines/overlay/overlay_image.c @@ -287,6 +287,9 @@ static void image_camera_background_matrix_get(const Camera *cam, translate[3][0] = bgpic->offset[0]; translate[3][1] = bgpic->offset[1]; translate[3][2] = cam_corners[0][2]; + if (cam->type == CAM_ORTHO) { + mul_v2_fl(translate[3], cam->ortho_scale); + } /* These lines are for keeping 2.80 behavior and could be removed to keep 2.79 behavior. */ translate[3][0] *= min_ff(1.0f, cam_aspect); translate[3][1] /= max_ff(1.0f, cam_aspect) * (image_aspect / cam_aspect); From fa270a37e874abacb7aee8d85de620ce67e91e95 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9ment=20Foucault?= Date: Tue, 19 May 2020 21:00:55 +0200 Subject: [PATCH 4/6] Fix T76564 Curve: Missing orco cause mesh to not render --- source/blender/draw/intern/draw_cache_impl_curve.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/blender/draw/intern/draw_cache_impl_curve.c b/source/blender/draw/intern/draw_cache_impl_curve.c index 72ee7fe17c1..5642ffba4f1 100644 --- a/source/blender/draw/intern/draw_cache_impl_curve.c +++ b/source/blender/draw/intern/draw_cache_impl_curve.c @@ -1034,7 +1034,7 @@ void DRW_curve_batch_cache_create_requested(Object *ob) } if (DRW_vbo_requested(cache->ordered.loop_pos_nor) || - DRW_vbo_requested(cache->ordered.loop_uv)) { + DRW_vbo_requested(cache->ordered.loop_uv) || DRW_vbo_requested(cache->ordered.loop_tan)) { DRW_displist_vertbuf_create_loop_pos_and_nor_and_uv_and_tan( lb, cache->ordered.loop_pos_nor, cache->ordered.loop_uv, cache->ordered.loop_tan); } From 61280e5af3da50286ae3f42fa673ca7545bd0bd8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebasti=C3=A1n=20Barschkis?= Date: Tue, 19 May 2020 21:09:43 +0200 Subject: [PATCH 5/6] Fluid: Updated Mantaflow source files Includes changes for particle skipping during advection. --- extern/mantaflow/preprocessed/gitinfo.h | 2 +- extern/mantaflow/preprocessed/particle.h | 54 ++++++++++++++++++------ 2 files changed, 43 insertions(+), 13 deletions(-) diff --git a/extern/mantaflow/preprocessed/gitinfo.h b/extern/mantaflow/preprocessed/gitinfo.h index 791dd001bbe..786f6aad4b1 100644 --- a/extern/mantaflow/preprocessed/gitinfo.h +++ b/extern/mantaflow/preprocessed/gitinfo.h @@ -1,3 +1,3 @@ -#define MANTA_GIT_VERSION "commit 21303fab2eda588ec22988bf9e5762d2001c131f" +#define MANTA_GIT_VERSION "commit 534495ae4528094e382e4daadbacaa32d5878de1" diff --git a/extern/mantaflow/preprocessed/particle.h b/extern/mantaflow/preprocessed/particle.h index 2d41397a961..74c565593fd 100644 --- a/extern/mantaflow/preprocessed/particle.h +++ b/extern/mantaflow/preprocessed/particle.h @@ -469,6 +469,7 @@ template class ParticleSystem : public ParticleBase { const int integrationMode, const bool deleteInObstacle = true, const bool stopInObstacle = true, + const bool skipNew = false, const ParticleDataImpl *ptype = NULL, const int exclude = 0); static PyObject *_W_9(PyObject *_self, PyObject *_linargs, PyObject *_kwds) @@ -486,13 +487,20 @@ template class ParticleSystem : public ParticleBase { const int integrationMode = _args.get("integrationMode", 2, &_lock); const bool deleteInObstacle = _args.getOpt("deleteInObstacle", 3, true, &_lock); const bool stopInObstacle = _args.getOpt("stopInObstacle", 4, true, &_lock); + const bool skipNew = _args.getOpt("skipNew", 5, false, &_lock); const ParticleDataImpl *ptype = _args.getPtrOpt>( - "ptype", 5, NULL, &_lock); - const int exclude = _args.getOpt("exclude", 6, 0, &_lock); + "ptype", 6, NULL, &_lock); + const int exclude = _args.getOpt("exclude", 7, 0, &_lock); pbo->_args.copy(_args); _retval = getPyNone(); - pbo->advectInGrid( - flags, vel, integrationMode, deleteInObstacle, stopInObstacle, ptype, exclude); + pbo->advectInGrid(flags, + vel, + integrationMode, + deleteInObstacle, + stopInObstacle, + skipNew, + ptype, + exclude); pbo->_args.check(); } pbFinalizePlugin(pbo->getParent(), "ParticleSystem::advectInGrid", !noTiming); @@ -1863,6 +1871,7 @@ template struct _GridAdvectKernel : public KernelBase { const Real dt, const bool deleteInObstacle, const bool stopInObstacle, + const bool skipNew, const ParticleDataImpl *ptype, const int exclude, std::vector &u) @@ -1873,6 +1882,7 @@ template struct _GridAdvectKernel : public KernelBase { dt(dt), deleteInObstacle(deleteInObstacle), stopInObstacle(stopInObstacle), + skipNew(skipNew), ptype(ptype), exclude(exclude), u(u) @@ -1885,11 +1895,13 @@ template struct _GridAdvectKernel : public KernelBase { const Real dt, const bool deleteInObstacle, const bool stopInObstacle, + const bool skipNew, const ParticleDataImpl *ptype, const int exclude, std::vector &u) const { - if ((p[idx].flag & ParticleBase::PDELETE) || (ptype && ((*ptype)[idx] & exclude))) { + if ((p[idx].flag & ParticleBase::PDELETE) || (ptype && ((*ptype)[idx] & exclude)) || + (skipNew && (p[idx].flag & ParticleBase::PNEW))) { u[idx] = 0.; return; } @@ -1910,7 +1922,7 @@ template struct _GridAdvectKernel : public KernelBase { void operator()(const tbb::blocked_range &__r) const { for (IndexInt idx = __r.begin(); idx != (IndexInt)__r.end(); idx++) - op(idx, p, vel, flags, dt, deleteInObstacle, stopInObstacle, ptype, exclude, u); + op(idx, p, vel, flags, dt, deleteInObstacle, stopInObstacle, skipNew, ptype, exclude, u); } void run() { @@ -1922,6 +1934,7 @@ template struct _GridAdvectKernel : public KernelBase { const Real dt; const bool deleteInObstacle; const bool stopInObstacle; + const bool skipNew; const ParticleDataImpl *ptype; const int exclude; std::vector &u; @@ -1933,6 +1946,7 @@ template struct GridAdvectKernel : public KernelBase { const Real dt, const bool deleteInObstacle, const bool stopInObstacle, + const bool skipNew, const ParticleDataImpl *ptype, const int exclude) : KernelBase(p.size()), @@ -1943,6 +1957,7 @@ template struct GridAdvectKernel : public KernelBase { dt, deleteInObstacle, stopInObstacle, + skipNew, ptype, exclude, u), @@ -1952,6 +1967,7 @@ template struct GridAdvectKernel : public KernelBase { dt(dt), deleteInObstacle(deleteInObstacle), stopInObstacle(stopInObstacle), + skipNew(skipNew), ptype(ptype), exclude(exclude), u((size)) @@ -2001,16 +2017,21 @@ template struct GridAdvectKernel : public KernelBase { return stopInObstacle; } typedef bool type5; - inline const ParticleDataImpl *getArg6() + inline const bool &getArg6() + { + return skipNew; + } + typedef bool type6; + inline const ParticleDataImpl *getArg7() { return ptype; } - typedef ParticleDataImpl type6; - inline const int &getArg7() + typedef ParticleDataImpl type7; + inline const int &getArg8() { return exclude; } - typedef int type7; + typedef int type8; void runMessage() { debMsg("Executing kernel GridAdvectKernel ", 3); @@ -2025,6 +2046,7 @@ template struct GridAdvectKernel : public KernelBase { const Real dt; const bool deleteInObstacle; const bool stopInObstacle; + const bool skipNew; const ParticleDataImpl *ptype; const int exclude; std::vector u; @@ -2195,6 +2217,7 @@ void ParticleSystem::advectInGrid(const FlagGrid &flags, const int integrationMode, const bool deleteInObstacle, const bool stopInObstacle, + const bool skipNew, const ParticleDataImpl *ptype, const int exclude) { @@ -2208,8 +2231,15 @@ void ParticleSystem::advectInGrid(const FlagGrid &flags, } // update positions - GridAdvectKernel kernel( - mData, vel, flags, getParent()->getDt(), deleteInObstacle, stopInObstacle, ptype, exclude); + GridAdvectKernel kernel(mData, + vel, + flags, + getParent()->getDt(), + deleteInObstacle, + stopInObstacle, + skipNew, + ptype, + exclude); integratePointSet(kernel, integrationMode); if (!deleteInObstacle) { From 7bb3d9787ead90d2a389eeccf05d7be9c56f03e6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebasti=C3=A1n=20Barschkis?= Date: Tue, 19 May 2020 21:12:22 +0200 Subject: [PATCH 6/6] Fix T76812: [Mantaflow] Inflow particles not continuous Makes use of the new particle skipping option introduced in f25a882955cb. --- intern/mantaflow/intern/strings/liquid_script.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/intern/mantaflow/intern/strings/liquid_script.h b/intern/mantaflow/intern/strings/liquid_script.h index e70ede206ba..57f0cbc20b7 100644 --- a/intern/mantaflow/intern/strings/liquid_script.h +++ b/intern/mantaflow/intern/strings/liquid_script.h @@ -232,7 +232,7 @@ def liquid_step_$ID$():\n\ mantaMsg('Liquid step')\n\ \n\ mantaMsg('Advecting particles')\n\ - pp_s$ID$.advectInGrid(flags=flags_s$ID$, vel=vel_s$ID$, integrationMode=IntRK4, deleteInObstacle=deleteInObstacle_s$ID$, stopInObstacle=False)\n\ + pp_s$ID$.advectInGrid(flags=flags_s$ID$, vel=vel_s$ID$, integrationMode=IntRK4, deleteInObstacle=deleteInObstacle_s$ID$, stopInObstacle=False, skipNew=True)\n\ \n\ mantaMsg('Pushing particles out of obstacles')\n\ pushOutofObs(parts=pp_s$ID$, flags=flags_s$ID$, phiObs=phiObs_s$ID$)\n\