[Bf-blender-cvs] [8217fba8c5d] master: Merge branch 'blender-v2.83-release'

2020-05-04 Thread Campbell Barton
Commit: 8217fba8c5d03cb29df21f166f8d9b71aeb40fd2
Author: Campbell Barton
Date:   Tue May 5 13:47:10 2020 +1000
Branches: master
https://developer.blender.org/rB8217fba8c5d03cb29df21f166f8d9b71aeb40fd2

Merge branch 'blender-v2.83-release'

===



===



___
Bf-blender-cvs mailing list
Bf-blender-cvs@blender.org
https://lists.blender.org/mailman/listinfo/bf-blender-cvs


[Bf-blender-cvs] [9b8e0c6d0f5] master: Merge branch 'blender-v2.83-release'

2020-05-04 Thread Campbell Barton
Commit: 9b8e0c6d0f5c8a4520ce49b03a072d114e985a7c
Author: Campbell Barton
Date:   Tue May 5 13:47:05 2020 +1000
Branches: master
https://developer.blender.org/rB9b8e0c6d0f5c8a4520ce49b03a072d114e985a7c

Merge branch 'blender-v2.83-release'

===



===



___
Bf-blender-cvs mailing list
Bf-blender-cvs@blender.org
https://lists.blender.org/mailman/listinfo/bf-blender-cvs


[Bf-blender-cvs] [75be3bc4b94] master: Merge branch 'blender-v2.83-release'

2020-05-04 Thread Campbell Barton
Commit: 75be3bc4b940a9026a52be2024ec09b4dee4d937
Author: Campbell Barton
Date:   Tue May 5 13:46:58 2020 +1000
Branches: master
https://developer.blender.org/rB75be3bc4b940a9026a52be2024ec09b4dee4d937

Merge branch 'blender-v2.83-release'

===



===



___
Bf-blender-cvs mailing list
Bf-blender-cvs@blender.org
https://lists.blender.org/mailman/listinfo/bf-blender-cvs


[Bf-blender-cvs] [36ad59b550a] blender-v2.83-release: Fix T76224: Grid fill offset doesn't work

2020-05-04 Thread Campbell Barton
Commit: 36ad59b550a29767c2a380c1e6feeb28b1826bc3
Author: Campbell Barton
Date:   Tue May 5 13:13:48 2020 +1000
Branches: blender-v2.83-release
https://developer.blender.org/rB36ad59b550a29767c2a380c1e6feeb28b1826bc3

Fix T76224: Grid fill offset doesn't work

Regression in own recent commit b1037aa88fedb.

===

M   source/blender/editors/mesh/editmesh_tools.c

===

diff --git a/source/blender/editors/mesh/editmesh_tools.c 
b/source/blender/editors/mesh/editmesh_tools.c
index 24c5cbb8573..fd5bf006829 100644
--- a/source/blender/editors/mesh/editmesh_tools.c
+++ b/source/blender/editors/mesh/editmesh_tools.c
@@ -4633,6 +4633,9 @@ static bool edbm_fill_grid_prepare(BMesh *bm, int offset, 
int *span_p, const boo
   BLI_listbase_rotate_first(verts, v_act_link);
 }
 
+/* Run again to update the edge order from the rotated vertex list. */
+BM_edgeloop_edges_get(el_store, edges);
+
 if (span_calc) {
   /* calculate the span by finding the next corner in 'verts'
* we dont know what defines a corner exactly so find the 4 verts

___
Bf-blender-cvs mailing list
Bf-blender-cvs@blender.org
https://lists.blender.org/mailman/listinfo/bf-blender-cvs


[Bf-blender-cvs] [d8133b3eb99] blender-v2.83-release: Fix T76318: lower part of new preferences window does not work

2020-05-04 Thread Brecht Van Lommel
Commit: d8133b3eb99ac7ccc420d54a6a52a3f750e497ac
Author: Brecht Van Lommel
Date:   Mon May 4 23:58:58 2020 +0200
Branches: blender-v2.83-release
https://developer.blender.org/rBd8133b3eb99ac7ccc420d54a6a52a3f750e497ac

Fix T76318: lower part of new preferences window does not work

Regression after recent changes. The precise cause is unclear to me, but
we do not need to update the size right after creating a new window.

===

M   source/blender/windowmanager/intern/wm_window.c

===

diff --git a/source/blender/windowmanager/intern/wm_window.c 
b/source/blender/windowmanager/intern/wm_window.c
index 2a5fdc0ab74..8fb7e47cd45 100644
--- a/source/blender/windowmanager/intern/wm_window.c
+++ b/source/blender/windowmanager/intern/wm_window.c
@@ -953,7 +953,8 @@ wmWindow *WM_window_open_temp(bContext *C,
 
   /* make window active, and validate/resize */
   CTX_wm_window_set(C, win);
-  if (!win->ghostwin) {
+  const bool new_window = (win->ghostwin == NULL);
+  if (new_window) {
 wm_window_ghostwindow_ensure(wm, win, dialog);
   }
   WM_check(C);
@@ -972,7 +973,7 @@ wmWindow *WM_window_open_temp(bContext *C,
 
   ED_screen_change(C, screen);
 
-  if (win->ghostwin) {
+  if (!new_window) {
 /* Set size in GHOST window and then update size and position from GHOST,
  * in case they where changed by GHOST to fit the monitor/screen. */
 wm_window_set_size(win, win->sizex, win->sizey);

___
Bf-blender-cvs mailing list
Bf-blender-cvs@blender.org
https://lists.blender.org/mailman/listinfo/bf-blender-cvs


[Bf-blender-cvs] [ac6be6759ec] blender-v2.83-release: Fix Cycles Python error when device name is not a valid UTF-8 string

2020-05-04 Thread Brecht Van Lommel
Commit: ac6be6759ecc6c6503e8785ee405c003e0ca2fe5
Author: Brecht Van Lommel
Date:   Mon May 4 20:02:08 2020 +0200
Branches: blender-v2.83-release
https://developer.blender.org/rBac6be6759ecc6c6503e8785ee405c003e0ca2fe5

Fix Cycles Python error when device name is not a valid UTF-8 string

This may fix or help diagnose T76378.

===

M   intern/cycles/blender/blender_python.cpp

===

diff --git a/intern/cycles/blender/blender_python.cpp 
b/intern/cycles/blender/blender_python.cpp
index 89bcebda193..8c7c0bc1daa 100644
--- a/intern/cycles/blender/blender_python.cpp
+++ b/intern/cycles/blender/blender_python.cpp
@@ -60,6 +60,12 @@ void *pylong_as_voidptr_typesafe(PyObject *object)
   return PyLong_AsVoidPtr(object);
 }
 
+PyObject *pyunicode_from_string(const char *str)
+{
+  /* Ignore errors if device API returns invalid UTF-8 strings. */
+  return PyUnicode_DecodeUTF8(str, strlen(str), "ignore");
+}
+
 /* Synchronize debug flags from a given Blender scene.
  * Return truth when device list needs invalidation.
  */
@@ -429,9 +435,9 @@ static PyObject *available_devices_func(PyObject * 
/*self*/, PyObject *args)
 DeviceInfo  = devices[i];
 string type_name = Device::string_from_type(device.type);
 PyObject *device_tuple = PyTuple_New(3);
-PyTuple_SET_ITEM(device_tuple, 0, 
PyUnicode_FromString(device.description.c_str()));
-PyTuple_SET_ITEM(device_tuple, 1, PyUnicode_FromString(type_name.c_str()));
-PyTuple_SET_ITEM(device_tuple, 2, PyUnicode_FromString(device.id.c_str()));
+PyTuple_SET_ITEM(device_tuple, 0, 
pyunicode_from_string(device.description.c_str()));
+PyTuple_SET_ITEM(device_tuple, 1, 
pyunicode_from_string(type_name.c_str()));
+PyTuple_SET_ITEM(device_tuple, 2, 
pyunicode_from_string(device.id.c_str()));
 PyTuple_SET_ITEM(ret, i, device_tuple);
   }
 
@@ -642,7 +648,7 @@ static PyObject *osl_compile_func(PyObject * /*self*/, 
PyObject *args)
 static PyObject *system_info_func(PyObject * /*self*/, PyObject * /*value*/)
 {
   string system_info = Device::device_capabilities();
-  return PyUnicode_FromString(system_info.c_str());
+  return pyunicode_from_string(system_info.c_str());
 }
 
 #ifdef WITH_OPENCL

___
Bf-blender-cvs mailing list
Bf-blender-cvs@blender.org
https://lists.blender.org/mailman/listinfo/bf-blender-cvs


[Bf-blender-cvs] [375a50dad9c] master: Merge branch 'blender-v2.83-release'

2020-05-04 Thread Sebastián Barschkis
Commit: 375a50dad9c5829e2ed205216e0bb7317635868e
Author: Sebastián Barschkis
Date:   Mon May 4 18:18:15 2020 +0200
Branches: master
https://developer.blender.org/rB375a50dad9c5829e2ed205216e0bb7317635868e

Merge branch 'blender-v2.83-release'

===



===

diff --cc intern/mantaflow/intern/MANTA_main.cpp
index fd273b728e7,d6c1d05e0da..58d49622597
--- a/intern/mantaflow/intern/MANTA_main.cpp
+++ b/intern/mantaflow/intern/MANTA_main.cpp
@@@ -3062,7 -3232,7 +3062,7 @@@ void MANTA::updatePointers(
  
  bool MANTA::hasConfig(FluidModifierData *mmd, int framenr)
  {
-   string extension = getCacheFileEnding(mmd->domain->cache_data_format);
 -  std::string extension = FLUID_DOMAIN_EXTENSION_UNI;
++  string extension = FLUID_DOMAIN_EXTENSION_UNI;
return BLI_exists(
getFile(mmd, FLUID_DOMAIN_DIR_CONFIG, FLUID_DOMAIN_FILE_CONFIG, 
extension, framenr).c_str());
  }

___
Bf-blender-cvs mailing list
Bf-blender-cvs@blender.org
https://lists.blender.org/mailman/listinfo/bf-blender-cvs


[Bf-blender-cvs] [8b5868cc15d] blender-v2.83-release: Fix T75883: Smoke simulations with Adaptive Domain broken for 'Final' bakes with OpenVDB in 2.83

2020-05-04 Thread Sebastián Barschkis
Commit: 8b5868cc15dac0a967bb7cd03e0ed2a15026fb35
Author: Sebastián Barschkis
Date:   Mon May 4 18:16:09 2020 +0200
Branches: blender-v2.83-release
https://developer.blender.org/rB8b5868cc15dac0a967bb7cd03e0ed2a15026fb35

Fix T75883: Smoke simulations with Adaptive Domain broken for 'Final' bakes 
with OpenVDB in 2.83

Config files always use the .uni extenstion.

===

M   intern/mantaflow/intern/MANTA_main.cpp

===

diff --git a/intern/mantaflow/intern/MANTA_main.cpp 
b/intern/mantaflow/intern/MANTA_main.cpp
index a56ce4c1f60..d6c1d05e0da 100644
--- a/intern/mantaflow/intern/MANTA_main.cpp
+++ b/intern/mantaflow/intern/MANTA_main.cpp
@@ -3232,7 +3232,7 @@ void MANTA::updatePointers()
 
 bool MANTA::hasConfig(FluidModifierData *mmd, int framenr)
 {
-  std::string extension = getCacheFileEnding(mmd->domain->cache_data_format);
+  std::string extension = FLUID_DOMAIN_EXTENSION_UNI;
   return BLI_exists(
   getFile(mmd, FLUID_DOMAIN_DIR_CONFIG, FLUID_DOMAIN_FILE_CONFIG, 
extension, framenr).c_str());
 }

___
Bf-blender-cvs mailing list
Bf-blender-cvs@blender.org
https://lists.blender.org/mailman/listinfo/bf-blender-cvs


[Bf-blender-cvs] [1771c7e4415] master: Merge remote-tracking branch 'origin/blender-v2.83-release'

2020-05-04 Thread Sybren A. Stüvel
Commit: 1771c7e4415a89246e69057f759aea27cce76005
Author: Sybren A. Stüvel
Date:   Mon May 4 18:08:17 2020 +0200
Branches: master
https://developer.blender.org/rB1771c7e4415a89246e69057f759aea27cce76005

Merge remote-tracking branch 'origin/blender-v2.83-release'

===



===



___
Bf-blender-cvs mailing list
Bf-blender-cvs@blender.org
https://lists.blender.org/mailman/listinfo/bf-blender-cvs


[Bf-blender-cvs] [0c8b872188a] blender-v2.83-release: Fix T76355: USD test fails in debug mode

2020-05-04 Thread Sybren A. Stüvel
Commit: 0c8b872188a3b413e08e84d1661bc1fd482359c1
Author: Sybren A. Stüvel
Date:   Mon May 4 18:03:19 2020 +0200
Branches: blender-v2.83-release
https://developer.blender.org/rB0c8b872188a3b413e08e84d1661bc1fd482359c1

Fix T76355: USD test fails in debug mode

Thanks @LazyDodo for the help!

No functional changes.

===

M   tests/gtests/usd/hierarchy_context_order_test.cc

===

diff --git a/tests/gtests/usd/hierarchy_context_order_test.cc 
b/tests/gtests/usd/hierarchy_context_order_test.cc
index ce3b43484e7..2068ea26227 100644
--- a/tests/gtests/usd/hierarchy_context_order_test.cc
+++ b/tests/gtests/usd/hierarchy_context_order_test.cc
@@ -36,11 +36,11 @@ static Object *fake_pointer(int value)
 
 TEST_F(HierarchyContextOrderTest, ObjectPointerTest)
 {
-  HierarchyContext ctx_a;
+  HierarchyContext ctx_a = {0};
   ctx_a.object = fake_pointer(1);
   ctx_a.duplicator = nullptr;
 
-  HierarchyContext ctx_b;
+  HierarchyContext ctx_b = {0};
   ctx_b.object = fake_pointer(2);
   ctx_b.duplicator = nullptr;
 
@@ -51,12 +51,12 @@ TEST_F(HierarchyContextOrderTest, ObjectPointerTest)
 
 TEST_F(HierarchyContextOrderTest, DuplicatorPointerTest)
 {
-  HierarchyContext ctx_a;
+  HierarchyContext ctx_a = {0};
   ctx_a.object = fake_pointer(1);
   ctx_a.duplicator = fake_pointer(1);
   ctx_a.export_name = "A";
 
-  HierarchyContext ctx_b;
+  HierarchyContext ctx_b = {0};
   ctx_b.object = fake_pointer(1);
   ctx_b.duplicator = fake_pointer(1);
   ctx_b.export_name = "B";
@@ -68,11 +68,11 @@ TEST_F(HierarchyContextOrderTest, DuplicatorPointerTest)
 
 TEST_F(HierarchyContextOrderTest, ExportParentTest)
 {
-  HierarchyContext ctx_a;
+  HierarchyContext ctx_a = {0};
   ctx_a.object = fake_pointer(1);
   ctx_a.export_parent = fake_pointer(1);
 
-  HierarchyContext ctx_b;
+  HierarchyContext ctx_b = {0};
   ctx_b.object = fake_pointer(1);
   ctx_b.export_parent = fake_pointer(2);
 
@@ -83,25 +83,25 @@ TEST_F(HierarchyContextOrderTest, ExportParentTest)
 
 TEST_F(HierarchyContextOrderTest, TransitiveTest)
 {
-  HierarchyContext ctx_a;
+  HierarchyContext ctx_a = {0};
   ctx_a.object = fake_pointer(1);
   ctx_a.export_parent = fake_pointer(1);
   ctx_a.duplicator = nullptr;
   ctx_a.export_name = "A";
 
-  HierarchyContext ctx_b;
+  HierarchyContext ctx_b = {0};
   ctx_b.object = fake_pointer(2);
   ctx_b.export_parent = nullptr;
   ctx_b.duplicator = fake_pointer(1);
   ctx_b.export_name = "B";
 
-  HierarchyContext ctx_c;
+  HierarchyContext ctx_c = {0};
   ctx_c.object = fake_pointer(2);
   ctx_c.export_parent = fake_pointer(2);
   ctx_c.duplicator = fake_pointer(1);
   ctx_c.export_name = "C";
 
-  HierarchyContext ctx_d;
+  HierarchyContext ctx_d = {0};
   ctx_d.object = fake_pointer(2);
   ctx_d.export_parent = fake_pointer(3);
   ctx_d.duplicator = nullptr;

___
Bf-blender-cvs mailing list
Bf-blender-cvs@blender.org
https://lists.blender.org/mailman/listinfo/bf-blender-cvs


[Bf-blender-cvs] [41da5df29be] master: Merge branch 'blender-v2.83-release'

2020-05-04 Thread Sergey Sharybin
Commit: 41da5df29be20467bb6468d49201611f317bff40
Author: Sergey Sharybin
Date:   Mon May 4 17:49:49 2020 +0200
Branches: master
https://developer.blender.org/rB41da5df29be20467bb6468d49201611f317bff40

Merge branch 'blender-v2.83-release'

===



===



___
Bf-blender-cvs mailing list
Bf-blender-cvs@blender.org
https://lists.blender.org/mailman/listinfo/bf-blender-cvs


[Bf-blender-cvs] [4a38a120245] blender-v2.83-release: Fix T76251: Animated procedural texture does not influence particle system

2020-05-04 Thread Luc Revardel
Commit: 4a38a120245d400cb3ff56711d14231ba9c7a1b8
Author: Luc Revardel
Date:   Mon May 4 17:47:08 2020 +0200
Branches: blender-v2.83-release
https://developer.blender.org/rB4a38a120245d400cb3ff56711d14231ba9c7a1b8

Fix T76251: Animated procedural texture does not influence particle system

Dependancy missing while building depsgraph for particle systems.
fix: adding a relation texture->particles when texture has animation data.

Reviewed By: sergey

Maniphest Tasks: T76251

Differential Revision: https://developer.blender.org/D7573

===

M   source/blender/depsgraph/intern/builder/deg_builder_relations.cc

===

diff --git a/source/blender/depsgraph/intern/builder/deg_builder_relations.cc 
b/source/blender/depsgraph/intern/builder/deg_builder_relations.cc
index 552546ff094..9bad796c541 100644
--- a/source/blender/depsgraph/intern/builder/deg_builder_relations.cc
+++ b/source/blender/depsgraph/intern/builder/deg_builder_relations.cc
@@ -1877,8 +1877,9 @@ void 
DepsgraphRelationBuilder::build_particle_settings(ParticleSettings *part)
 ComponentKey texture_key(>tex->id, NodeType::GENERIC_DATABLOCK);
 add_relation(texture_key,
  particle_settings_reset_key,
- "Particle Texture",
+ "Particle Texture -> Particle Reset",
  RELATION_FLAG_FLUSH_USER_EDIT_ONLY);
+add_relation(texture_key, particle_settings_eval_key, "Particle Texture -> 
Particle Eval");
 /* TODO(sergey): Consider moving texture space handling to an own
  * function. */
 if (mtex->texco == TEXCO_OBJECT && mtex->object != nullptr) {

___
Bf-blender-cvs mailing list
Bf-blender-cvs@blender.org
https://lists.blender.org/mailman/listinfo/bf-blender-cvs


[Bf-blender-cvs] [673f44fa16e] master: Merge branch 'blender-v2.83-release'

2020-05-04 Thread Sergey Sharybin
Commit: 673f44fa16e6cd83efbe228b9040263f27a5c9ca
Author: Sergey Sharybin
Date:   Mon May 4 17:40:57 2020 +0200
Branches: master
https://developer.blender.org/rB673f44fa16e6cd83efbe228b9040263f27a5c9ca

Merge branch 'blender-v2.83-release'

===



===

diff --cc source/blender/editors/object/object_modifier.c
index 35dd3ba4cec,a24f3ba2269..bcc5bf3e1ae
--- a/source/blender/editors/object/object_modifier.c
+++ b/source/blender/editors/object/object_modifier.c
@@@ -1462,15 -1442,8 +1462,10 @@@ static int multires_subdivide_exec(bCon
  return OPERATOR_CANCELLED;
}
  
 -  multiresModifier_subdivide(object, mmd);
 +  const eMultiresSubdivideModeType subdivide_mode = 
(eMultiresSubdivideModeType)(
 +  RNA_enum_get(op->ptr, "mode"));
- 
-   ED_sculpt_undo_push_multires_mesh_begin(C, op->type->name);
- 
 +  multiresModifier_subdivide(object, mmd, subdivide_mode);
  
-   ED_sculpt_undo_push_multires_mesh_end(C, op->type->name);
- 
ED_object_iter_other(
CTX_data_main(C), object, true, ED_object_multires_update_totlevels_cb, 
>totlvl);

___
Bf-blender-cvs mailing list
Bf-blender-cvs@blender.org
https://lists.blender.org/mailman/listinfo/bf-blender-cvs


[Bf-blender-cvs] [1222f561a21] blender-v2.83-release: Revert "Fix T76313: Redo in Multires doesn't bring back stroke made after a subdivide"

2020-05-04 Thread Sergey Sharybin
Commit: 1222f561a21f03bba2b80cf5ea57018d65da693b
Author: Sergey Sharybin
Date:   Mon May 4 17:38:15 2020 +0200
Branches: blender-v2.83-release
https://developer.blender.org/rB1222f561a21f03bba2b80cf5ea57018d65da693b

Revert "Fix T76313: Redo in Multires doesn't bring back stroke made after a 
subdivide"

The fix was actually missing few bits:

- Firstly, the operator itself is not to do UNDO push
- Secondly, multires sculpt/top level are not pushed to the undo
  node, so undo can not happen reliably.

It should be possible to incorporate some of the work from WIP patch
for propagation undo, but it needs more work.

Reverting code base to the previous state, since currently things
are actually a bit more confusing then they used to be.

This reverts commit 0c928087a3c8a4f758a907fe3096346f88d678c9.

===

M   source/blender/editors/object/object_modifier.c

===

diff --git a/source/blender/editors/object/object_modifier.c 
b/source/blender/editors/object/object_modifier.c
index 35905b09080..a24f3ba2269 100644
--- a/source/blender/editors/object/object_modifier.c
+++ b/source/blender/editors/object/object_modifier.c
@@ -1442,12 +1442,8 @@ static int multires_subdivide_exec(bContext *C, 
wmOperator *op)
 return OPERATOR_CANCELLED;
   }
 
-  ED_sculpt_undo_push_multires_mesh_begin(C, op->type->name);
-
   multiresModifier_subdivide(object, mmd);
 
-  ED_sculpt_undo_push_multires_mesh_end(C, op->type->name);
-
   ED_object_iter_other(
   CTX_data_main(C), object, true, ED_object_multires_update_totlevels_cb, 
>totlvl);

___
Bf-blender-cvs mailing list
Bf-blender-cvs@blender.org
https://lists.blender.org/mailman/listinfo/bf-blender-cvs


[Bf-blender-cvs] [0a344b387ab] greasepencil-object: Cleanup: rename mcords to mcoords

2020-05-04 Thread Antonio Vazquez
Commit: 0a344b387abd080675e7c5b724d290a4cc671a90
Author: Antonio Vazquez
Date:   Mon May 4 17:27:08 2020 +0200
Branches: greasepencil-object
https://developer.blender.org/rB0a344b387abd080675e7c5b724d290a4cc671a90

Cleanup: rename mcords to mcoords

===

M   source/blender/editors/gpencil/gpencil_select.c

===

diff --git a/source/blender/editors/gpencil/gpencil_select.c 
b/source/blender/editors/gpencil/gpencil_select.c
index 17d676f6d41..7accf48832a 100644
--- a/source/blender/editors/gpencil/gpencil_select.c
+++ b/source/blender/editors/gpencil/gpencil_select.c
@@ -79,9 +79,9 @@ static bool gpencil_point_inside_stroke(bGPDstroke *gps,
 return hit;
   }
 
-  int(*mcords)[2] = NULL;
+  int(*mcoords)[2] = NULL;
   int len = gps->totpoints;
-  mcords = MEM_mallocN(sizeof(int) * 2 * len, __func__);
+  mcoords = MEM_mallocN(sizeof(int) * 2 * len, __func__);
 
   /* Convert stroke to 2D array of points. */
   bGPDspoint *pt;
@@ -89,20 +89,20 @@ static bool gpencil_point_inside_stroke(bGPDstroke *gps,
   for (i = 0, pt = gps->points; i < gps->totpoints; i++, pt++) {
 bGPDspoint pt2;
 gp_point_to_parent_space(pt, diff_mat, );
-gp_point_to_xy(gsc, gps, , [i][0], [i][1]);
+gp_point_to_xy(gsc, gps, , [i][0], [i][1]);
   }
 
   /* Compute boundbox of lasso (for faster testing later). */
   rcti rect;
-  BLI_lasso_boundbox(, mcords, len);
+  BLI_lasso_boundbox(, mcoords, len);
 
   /* Test if point inside stroke. */
   hit = ((!ELEM(V2D_IS_CLIPPED, mouse[0], mouse[1])) &&
  BLI_rcti_isect_pt(, mouse[0], mouse[1]) &&
- BLI_lasso_is_point_inside(mcords, len, mouse[0], mouse[1], INT_MAX));
+ BLI_lasso_is_point_inside(mcoords, len, mouse[0], mouse[1], INT_MAX));
 
   /* Free memory. */
-  MEM_SAFE_FREE(mcords);
+  MEM_SAFE_FREE(mcoords);
 
   return hit;
 }

___
Bf-blender-cvs mailing list
Bf-blender-cvs@blender.org
https://lists.blender.org/mailman/listinfo/bf-blender-cvs


[Bf-blender-cvs] [d3bd805c963] greasepencil-object: Merge branch 'master' into greasepencil-object

2020-05-04 Thread Antonio Vazquez
Commit: d3bd805c963ef2bc46feb74df5f8a2167870fd55
Author: Antonio Vazquez
Date:   Mon May 4 17:24:13 2020 +0200
Branches: greasepencil-object
https://developer.blender.org/rBd3bd805c963ef2bc46feb74df5f8a2167870fd55

Merge branch 'master' into greasepencil-object

===



===

diff --cc source/blender/editors/gpencil/gpencil_select.c
index dc166210713,69d22b52ded..17d676f6d41
--- a/source/blender/editors/gpencil/gpencil_select.c
+++ b/source/blender/editors/gpencil/gpencil_select.c
@@@ -1406,12 -1358,11 +1406,12 @@@ static int gpencil_lasso_select_exec(bC
}
  
/* Compute boundbox of lasso (for faster testing later). */
-   BLI_lasso_boundbox(, data.mcords, data.mcords_len);
+   BLI_lasso_boundbox(, data.mcoords, data.mcoords_len);
  
 -  int ret = gpencil_generic_select_exec(C, op, gpencil_test_lasso, );
 +  rcti rect = data.rect;
 +  int ret = gpencil_generic_select_exec(C, op, gpencil_test_lasso, rect, 
);
  
-   MEM_freeN((void *)data.mcords);
+   MEM_freeN((void *)data.mcoords);
  
return ret;
  }

___
Bf-blender-cvs mailing list
Bf-blender-cvs@blender.org
https://lists.blender.org/mailman/listinfo/bf-blender-cvs


[Bf-blender-cvs] [7b35a9818cc] master: Merge branch 'blender-v2.83-release'

2020-05-04 Thread Sergey Sharybin
Commit: 7b35a9818ccbed6bb5204d3256828719bdcfc7f8
Author: Sergey Sharybin
Date:   Mon May 4 17:17:38 2020 +0200
Branches: master
https://developer.blender.org/rB7b35a9818ccbed6bb5204d3256828719bdcfc7f8

Merge branch 'blender-v2.83-release'

===



===

diff --cc source/blender/editors/object/object_modifier.c
index bcc5bf3e1ae,35905b09080..35dd3ba4cec
--- a/source/blender/editors/object/object_modifier.c
+++ b/source/blender/editors/object/object_modifier.c
@@@ -1462,10 -1442,12 +1462,15 @@@ static int multires_subdivide_exec(bCon
  return OPERATOR_CANCELLED;
}
  
 +  const eMultiresSubdivideModeType subdivide_mode = 
(eMultiresSubdivideModeType)(
 +  RNA_enum_get(op->ptr, "mode"));
++
+   ED_sculpt_undo_push_multires_mesh_begin(C, op->type->name);
+ 
 -  multiresModifier_subdivide(object, mmd);
 +  multiresModifier_subdivide(object, mmd, subdivide_mode);
  
+   ED_sculpt_undo_push_multires_mesh_end(C, op->type->name);
+ 
ED_object_iter_other(
CTX_data_main(C), object, true, ED_object_multires_update_totlevels_cb, 
>totlvl);

___
Bf-blender-cvs mailing list
Bf-blender-cvs@blender.org
https://lists.blender.org/mailman/listinfo/bf-blender-cvs


[Bf-blender-cvs] [0c928087a3c] blender-v2.83-release: Fix T76313: Redo in Multires doesn't bring back stroke made after a subdivide

2020-05-04 Thread Sergey Sharybin
Commit: 0c928087a3c8a4f758a907fe3096346f88d678c9
Author: Sergey Sharybin
Date:   Mon May 4 15:59:32 2020 +0200
Branches: blender-v2.83-release
https://developer.blender.org/rB0c928087a3c8a4f758a907fe3096346f88d678c9

Fix T76313: Redo in Multires doesn't bring back stroke made after a subdivide

Differential Revision: https://developer.blender.org/D7620

===

M   source/blender/editors/object/object_modifier.c

===

diff --git a/source/blender/editors/object/object_modifier.c 
b/source/blender/editors/object/object_modifier.c
index a24f3ba2269..35905b09080 100644
--- a/source/blender/editors/object/object_modifier.c
+++ b/source/blender/editors/object/object_modifier.c
@@ -1442,8 +1442,12 @@ static int multires_subdivide_exec(bContext *C, 
wmOperator *op)
 return OPERATOR_CANCELLED;
   }
 
+  ED_sculpt_undo_push_multires_mesh_begin(C, op->type->name);
+
   multiresModifier_subdivide(object, mmd);
 
+  ED_sculpt_undo_push_multires_mesh_end(C, op->type->name);
+
   ED_object_iter_other(
   CTX_data_main(C), object, true, ED_object_multires_update_totlevels_cb, 
>totlvl);

___
Bf-blender-cvs mailing list
Bf-blender-cvs@blender.org
https://lists.blender.org/mailman/listinfo/bf-blender-cvs


[Bf-blender-cvs] [df16c23832a] master: Add StringMap.LookupOrAdd and StringMap.LookupOrAddDefault

2020-05-04 Thread Jacques Lucke
Commit: df16c23832abe423da5e8fee9bd1cabb643e65de
Author: Jacques Lucke
Date:   Mon May 4 17:12:12 2020 +0200
Branches: master
https://developer.blender.org/rBdf16c23832abe423da5e8fee9bd1cabb643e65de

Add StringMap.LookupOrAdd and StringMap.LookupOrAddDefault

===

M   source/blender/blenlib/BLI_string_map.hh
M   tests/gtests/blenlib/BLI_string_map_test.cc

===

diff --git a/source/blender/blenlib/BLI_string_map.hh 
b/source/blender/blenlib/BLI_string_map.hh
index ed23ea3aaa0..caa7e16d1f3 100644
--- a/source/blender/blenlib/BLI_string_map.hh
+++ b/source/blender/blenlib/BLI_string_map.hh
@@ -341,6 +341,27 @@ template class StringMap {
 }
   }
 
+  /**
+   * Return the value that corresponds to the given key.
+   * If it does not exist yet, create and insert it first.
+   */
+  template T _or_add(StringRef key, const 
CreateValueF _value)
+  {
+return *this->add_or_modify(
+key,
+[&](T *value) { return new (value) T(create_value()); },
+[](T *value) { return value; });
+  }
+
+  /**
+   * Return the value that corresponds to the given key.
+   * If it does not exist yet, insert a new default constructed value and 
return that.
+   */
+  T _or_add_default(StringRef key)
+  {
+return this->lookup_or_add(key, []() { return T(); });
+  }
+
   /**
* Do a linear search over all items to find a key for a value.
*/
diff --git a/tests/gtests/blenlib/BLI_string_map_test.cc 
b/tests/gtests/blenlib/BLI_string_map_test.cc
index 41cda920a89..6acad0ce581 100644
--- a/tests/gtests/blenlib/BLI_string_map_test.cc
+++ b/tests/gtests/blenlib/BLI_string_map_test.cc
@@ -249,3 +249,27 @@ TEST(string_map, AddOrModify)
   EXPECT_FALSE(map.add_or_modify("Hello", create_func, modify_func));
   EXPECT_EQ(map.lookup("Hello"), 15);
 }
+
+TEST(string_map, LookupOrAdd)
+{
+  StringMap map;
+  auto return_5 = []() { return 5; };
+  auto return_8 = []() { return 8; };
+
+  int  = map.lookup_or_add("A", return_5);
+  EXPECT_EQ(a, 5);
+  EXPECT_EQ(map.lookup_or_add("A", return_8), 5);
+  EXPECT_EQ(map.lookup_or_add("B", return_8), 8);
+}
+
+TEST(string_map, LookupOrAddDefault)
+{
+  StringMap map;
+
+  std::string  = map.lookup_or_add_default("A");
+  EXPECT_EQ(a.size(), 0);
+  a += "Test";
+  EXPECT_EQ(a.size(), 4);
+  std::string  = map.lookup_or_add_default("A");
+  EXPECT_EQ(b, "Test");
+}

___
Bf-blender-cvs mailing list
Bf-blender-cvs@blender.org
https://lists.blender.org/mailman/listinfo/bf-blender-cvs


[Bf-blender-cvs] [ba43c2a040f] master: Windows: Silence LNK4099 warning.

2020-05-04 Thread Ray Molenkamp
Commit: ba43c2a040fb92435308c497043f480cb03a3705
Author: Ray Molenkamp
Date:   Mon May 4 08:29:48 2020 -0600
Branches: master
https://developer.blender.org/rBba43c2a040fb92435308c497043f480cb03a3705

Windows: Silence LNK4099 warning.

Ever since debug symbols were added for release builds the linker
has been on the chatty side about symbols being missing for our
binary libs.

There's currently no plans to supply those, so best for the linker
not to warn us about them.

===

M   build_files/cmake/platform/platform_win32.cmake

===

diff --git a/build_files/cmake/platform/platform_win32.cmake 
b/build_files/cmake/platform/platform_win32.cmake
index 5076057e0f6..6760da95767 100644
--- a/build_files/cmake/platform/platform_win32.cmake
+++ b/build_files/cmake/platform/platform_win32.cmake
@@ -111,9 +111,10 @@ endif()
 unset(_min_ver)
 
 # needed for some MSVC installations
-set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} /SAFESEH:NO")
-set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} /SAFESEH:NO")
-set(CMAKE_MODULE_LINKER_FLAGS "${CMAKE_MODULE_LINKER_FLAGS} /SAFESEH:NO")
+# 4099 : PDB 'filename' was not found with 'object/library'
+set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} /SAFESEH:NO 
/ignore:4099")
+set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} /SAFESEH:NO 
/ignore:4099")
+set(CMAKE_MODULE_LINKER_FLAGS "${CMAKE_MODULE_LINKER_FLAGS} /SAFESEH:NO 
/ignore:4099")
 
 list(APPEND PLATFORM_LINKLIBS
   ws2_32 vfw32 winmm kernel32 user32 gdi32 comdlg32 Comctl32 version

___
Bf-blender-cvs mailing list
Bf-blender-cvs@blender.org
https://lists.blender.org/mailman/listinfo/bf-blender-cvs


[Bf-blender-cvs] [d8011902f48] master: Merge branch 'blender-v2.83-release'

2020-05-04 Thread Hans Goudey
Commit: d8011902f48cf50c67eece99828de7f28139e0d4
Author: Hans Goudey
Date:   Mon May 4 10:21:07 2020 -0400
Branches: master
https://developer.blender.org/rBd8011902f48cf50c67eece99828de7f28139e0d4

Merge branch 'blender-v2.83-release'

===



===



___
Bf-blender-cvs mailing list
Bf-blender-cvs@blender.org
https://lists.blender.org/mailman/listinfo/bf-blender-cvs


[Bf-blender-cvs] [133c2381ec7] blender-v2.83-release: Fix T76062: Interpolate Radius in Curve Subdivide Special Case

2020-05-04 Thread Hans Goudey
Commit: 133c2381ec7829578fb1652d0b6cbfe8bf314249
Author: Hans Goudey
Date:   Fri May 1 16:49:36 2020 -0500
Branches: blender-v2.83-release
https://developer.blender.org/rB133c2381ec7829578fb1652d0b6cbfe8bf314249

Fix T76062: Interpolate Radius in Curve Subdivide Special Case

Differential Revision: https://developer.blender.org/D7523

===

M   source/blender/editors/curve/editcurve.c

===

diff --git a/source/blender/editors/curve/editcurve.c 
b/source/blender/editors/curve/editcurve.c
index 818acd28ecd..d6256f67066 100644
--- a/source/blender/editors/curve/editcurve.c
+++ b/source/blender/editors/curve/editcurve.c
@@ -3592,6 +3592,7 @@ static void subdividenurb(Object *obedit, View3D *v3d, 
int number_cuts)
 
   memcpy(bpn, nextbp, sizeof(BPoint));
   interp_v4_v4v4(bpn->vec, bp->vec, nextbp->vec, factor);
+  bpn->radius = interpf(bp->radius, nextbp->radius, factor);
   bpn++;
 }
   }

___
Bf-blender-cvs mailing list
Bf-blender-cvs@blender.org
https://lists.blender.org/mailman/listinfo/bf-blender-cvs


[Bf-blender-cvs] [b3553c09610] master: Cleanup: USD tests, use `EXPECT_LT` and `EXPECT_FALSE` where appropriate

2020-05-04 Thread Sybren A. Stüvel
Commit: b3553c09610e885ccc72230596cb7484369468f6
Author: Sybren A. Stüvel
Date:   Mon May 4 16:17:54 2020 +0200
Branches: master
https://developer.blender.org/rBb3553c09610e885ccc72230596cb7484369468f6

Cleanup: USD tests, use `EXPECT_LT` and `EXPECT_FALSE` where appropriate

Unfortunately there is no `EXPECT_NOT_LT`; as the `HierarchyContext` only
has an `operator<()` function, testing for `(A < B) == false` is different
than simply testing `(A >= B)`.

No functional changes.

===

M   tests/gtests/usd/hierarchy_context_order_test.cc

===

diff --git a/tests/gtests/usd/hierarchy_context_order_test.cc 
b/tests/gtests/usd/hierarchy_context_order_test.cc
index ce3b43484e7..a6a8aa16766 100644
--- a/tests/gtests/usd/hierarchy_context_order_test.cc
+++ b/tests/gtests/usd/hierarchy_context_order_test.cc
@@ -44,9 +44,9 @@ TEST_F(HierarchyContextOrderTest, ObjectPointerTest)
   ctx_b.object = fake_pointer(2);
   ctx_b.duplicator = nullptr;
 
-  EXPECT_EQ(true, ctx_a < ctx_b);
-  EXPECT_EQ(false, ctx_b < ctx_a);
-  EXPECT_EQ(false, ctx_a < ctx_a);
+  EXPECT_LT(ctx_a, ctx_b);
+  EXPECT_FALSE(ctx_b < ctx_a);
+  EXPECT_FALSE(ctx_a < ctx_a);
 }
 
 TEST_F(HierarchyContextOrderTest, DuplicatorPointerTest)
@@ -61,9 +61,9 @@ TEST_F(HierarchyContextOrderTest, DuplicatorPointerTest)
   ctx_b.duplicator = fake_pointer(1);
   ctx_b.export_name = "B";
 
-  EXPECT_EQ(true, ctx_a < ctx_b);
-  EXPECT_EQ(false, ctx_b < ctx_a);
-  EXPECT_EQ(false, ctx_a < ctx_a);
+  EXPECT_LT(ctx_a, ctx_b);
+  EXPECT_FALSE(ctx_b < ctx_a);
+  EXPECT_FALSE(ctx_a < ctx_a);
 }
 
 TEST_F(HierarchyContextOrderTest, ExportParentTest)
@@ -76,9 +76,9 @@ TEST_F(HierarchyContextOrderTest, ExportParentTest)
   ctx_b.object = fake_pointer(1);
   ctx_b.export_parent = fake_pointer(2);
 
-  EXPECT_EQ(true, ctx_a < ctx_b);
-  EXPECT_EQ(false, ctx_b < ctx_a);
-  EXPECT_EQ(false, ctx_a < ctx_a);
+  EXPECT_LT(ctx_a, ctx_b);
+  EXPECT_FALSE(ctx_b < ctx_a);
+  EXPECT_FALSE(ctx_a < ctx_a);
 }
 
 TEST_F(HierarchyContextOrderTest, TransitiveTest)
@@ -107,17 +107,17 @@ TEST_F(HierarchyContextOrderTest, TransitiveTest)
   ctx_d.duplicator = nullptr;
   ctx_d.export_name = "D";
 
-  EXPECT_EQ(true, ctx_a < ctx_b);
-  EXPECT_EQ(true, ctx_a < ctx_c);
-  EXPECT_EQ(true, ctx_a < ctx_d);
-  EXPECT_EQ(true, ctx_b < ctx_c);
-  EXPECT_EQ(true, ctx_b < ctx_d);
-  EXPECT_EQ(true, ctx_c < ctx_d);
-
-  EXPECT_EQ(false, ctx_b < ctx_a);
-  EXPECT_EQ(false, ctx_c < ctx_a);
-  EXPECT_EQ(false, ctx_d < ctx_a);
-  EXPECT_EQ(false, ctx_c < ctx_b);
-  EXPECT_EQ(false, ctx_d < ctx_b);
-  EXPECT_EQ(false, ctx_d < ctx_c);
+  EXPECT_LT(ctx_a, ctx_b);
+  EXPECT_LT(ctx_a, ctx_c);
+  EXPECT_LT(ctx_a, ctx_d);
+  EXPECT_LT(ctx_b, ctx_c);
+  EXPECT_LT(ctx_b, ctx_d);
+  EXPECT_LT(ctx_c, ctx_d);
+
+  EXPECT_FALSE(ctx_b < ctx_a);
+  EXPECT_FALSE(ctx_c < ctx_a);
+  EXPECT_FALSE(ctx_d < ctx_a);
+  EXPECT_FALSE(ctx_c < ctx_b);
+  EXPECT_FALSE(ctx_d < ctx_b);
+  EXPECT_FALSE(ctx_d < ctx_c);
 }

___
Bf-blender-cvs mailing list
Bf-blender-cvs@blender.org
https://lists.blender.org/mailman/listinfo/bf-blender-cvs


[Bf-blender-cvs] [37182c369aa] blender-v2.83-release: GPU: Set Default Buffer Size Immediate Mode

2020-05-04 Thread Jeroen Bakker
Commit: 37182c369aa64eda8cb287a1e7dc857c8f58906f
Author: Jeroen Bakker
Date:   Mon May 4 16:00:47 2020 +0200
Branches: blender-v2.83-release
https://developer.blender.org/rB37182c369aa64eda8cb287a1e7dc857c8f58906f

GPU: Set Default Buffer Size Immediate Mode

We set the default buffer size for strict buffers to 0. This increased
the performance on intel but reduced the performance on old AMD cards.
This patch sets back the default buffer size for strict buffers. After
testing I didn't detect a slow-down anymore.

Note that today new firmwares were pushed to the device what might fix
some issues.

===

M   source/blender/gpu/intern/gpu_immediate.c

===

diff --git a/source/blender/gpu/intern/gpu_immediate.c 
b/source/blender/gpu/intern/gpu_immediate.c
index 2d093dacdce..7bcb0a7a552 100644
--- a/source/blender/gpu/intern/gpu_immediate.c
+++ b/source/blender/gpu/intern/gpu_immediate.c
@@ -48,7 +48,6 @@ typedef struct ImmediateDrawBuffer {
   GLubyte *buffer_data;
   uint buffer_offset;
   uint buffer_size;
-  uint default_size;
 } ImmediateDrawBuffer;
 
 typedef struct {
@@ -96,12 +95,10 @@ void immInit(void)
 
   imm.draw_buffer.vbo_id = GPU_buf_alloc();
   imm.draw_buffer.buffer_size = DEFAULT_INTERNAL_BUFFER_SIZE;
-  imm.draw_buffer.default_size = DEFAULT_INTERNAL_BUFFER_SIZE;
   glBindBuffer(GL_ARRAY_BUFFER, imm.draw_buffer.vbo_id);
   glBufferData(GL_ARRAY_BUFFER, imm.draw_buffer.buffer_size, NULL, 
GL_DYNAMIC_DRAW);
   imm.draw_buffer_strict.vbo_id = GPU_buf_alloc();
-  imm.draw_buffer_strict.buffer_size = 0;
-  imm.draw_buffer_strict.default_size = 0;
+  imm.draw_buffer_strict.buffer_size = DEFAULT_INTERNAL_BUFFER_SIZE;
   glBindBuffer(GL_ARRAY_BUFFER, imm.draw_buffer_strict.vbo_id);
   glBufferData(GL_ARRAY_BUFFER, imm.draw_buffer_strict.buffer_size, NULL, 
GL_DYNAMIC_DRAW);
 
@@ -251,10 +248,10 @@ void immBegin(GPUPrimType prim_type, uint vertex_len)
 active_buffer->buffer_size = bytes_needed;
 recreate_buffer = true;
   }
-  else if (bytes_needed < active_buffer->default_size &&
-   active_buffer->buffer_size > active_buffer->default_size) {
+  else if (bytes_needed < DEFAULT_INTERNAL_BUFFER_SIZE &&
+   active_buffer->buffer_size > DEFAULT_INTERNAL_BUFFER_SIZE) {
 /* shrink the internal buffer */
-active_buffer->buffer_size = active_buffer->default_size;
+active_buffer->buffer_size = DEFAULT_INTERNAL_BUFFER_SIZE;
 recreate_buffer = true;
   }

___
Bf-blender-cvs mailing list
Bf-blender-cvs@blender.org
https://lists.blender.org/mailman/listinfo/bf-blender-cvs


[Bf-blender-cvs] [194070e6f4d] master: Added missing return statement

2020-05-04 Thread Sybren A. Stüvel
Commit: 194070e6f4d6efe5a1594b1dd0faf1a337b71249
Author: Sybren A. Stüvel
Date:   Mon May 4 15:47:23 2020 +0200
Branches: master
https://developer.blender.org/rB194070e6f4d6efe5a1594b1dd0faf1a337b71249

Added missing return statement

Every code path through the `fcurve_eval_keyframes_interpolate()` function
has a valid `return` statement, but in debug mode GCC still doesn't like it.

===

M   source/blender/blenkernel/intern/fcurve.c

===

diff --git a/source/blender/blenkernel/intern/fcurve.c 
b/source/blender/blenkernel/intern/fcurve.c
index 3f55831cfeb..543d5c8b7c7 100644
--- a/source/blender/blenkernel/intern/fcurve.c
+++ b/source/blender/blenkernel/intern/fcurve.c
@@ -1719,6 +1719,8 @@ static float fcurve_eval_keyframes_interpolate(FCurve 
*fcu, BezTriple *bezts, fl
 default:
   return prevbezt->vec[1][1];
   }
+
+  return 0.0f;
 }
 
 /* Calculate F-Curve value for 'evaltime' using BezTriple keyframes */

___
Bf-blender-cvs mailing list
Bf-blender-cvs@blender.org
https://lists.blender.org/mailman/listinfo/bf-blender-cvs


[Bf-blender-cvs] [0a1fbfee2ba] master: Tweak the pressure/size dynamic range of Clay Strips

2020-05-04 Thread Pablo Dobarro
Commit: 0a1fbfee2ba51e88436fd9c1ab4d349f97c47491
Author: Pablo Dobarro
Date:   Sat Apr 25 01:07:09 2020 +0200
Branches: master
https://developer.blender.org/rB0a1fbfee2ba51e88436fd9c1ab4d349f97c47491

Tweak the pressure/size dynamic range of Clay Strips

The current clay strips brush has a huge dynamic range which is nice for
certain effects, but in some pen tablets it is quite hard to control on
the higher values and it ends up producing unwanted artifacts. This
changes the input curves a bit in an attempt to make it more
controllable.

After adding a brush management system I will expose all these values to
be configurable per brush (the round version of clay strips is a little
bit better with different curves, but that is something that we can't
support now), but for now this default are probably safer.

Reviewed By: jbakker

Differential Revision: https://developer.blender.org/D7524

===

M   source/blender/editors/sculpt_paint/sculpt.c

===

diff --git a/source/blender/editors/sculpt_paint/sculpt.c 
b/source/blender/editors/sculpt_paint/sculpt.c
index 7bd7714b725..ce5433f680e 100644
--- a/source/blender/editors/sculpt_paint/sculpt.c
+++ b/source/blender/editors/sculpt_paint/sculpt.c
@@ -2100,7 +2100,7 @@ static float brush_strength(const Sculpt *sd,
   return alpha * pressure * overlap * feather * 2.0f;
 case SCULPT_TOOL_CLAY_STRIPS:
   /* Clay Strips needs less strength to compensate the curve. */
-  final_pressure = pressure * pressure * pressure;
+  final_pressure = powf(pressure, 1.5f);
   return alpha * flip * final_pressure * overlap * feather * 0.3f;
 case SCULPT_TOOL_CLAY_THUMB:
   final_pressure = pressure * pressure;
@@ -4624,7 +4624,7 @@ static void do_clay_strips_brush(Sculpt *sd, Object *ob, 
PBVHNode **nodes, int t
   const bool flip = (ss->cache->bstrength < 0.0f);
   const float radius = flip ? -ss->cache->radius : ss->cache->radius;
   const float offset = SCULPT_brush_plane_offset_get(sd, ss);
-  const float displace = radius * (0.25f + offset);
+  const float displace = radius * (0.18f + offset);
 
   /* The sculpt-plane normal (whatever its set to). */
   float area_no_sp[3];
@@ -6189,7 +6189,7 @@ static float sculpt_brush_dynamic_size_get(Brush *brush, 
StrokeCache *cache, flo
 case SCULPT_TOOL_CLAY:
   return max_ff(initial_size * 0.20f, initial_size * 
pow3f(cache->pressure));
 case SCULPT_TOOL_CLAY_STRIPS:
-  return max_ff(initial_size * 0.30f, initial_size * 
pow2f(cache->pressure));
+  return max_ff(initial_size * 0.30f, initial_size * powf(cache->pressure, 
1.5f));
 case SCULPT_TOOL_CLAY_THUMB: {
   float clay_stabilized_pressure = 
sculpt_clay_thumb_get_stabilized_pressure(cache);
   return initial_size * clay_stabilized_pressure;

___
Bf-blender-cvs mailing list
Bf-blender-cvs@blender.org
https://lists.blender.org/mailman/listinfo/bf-blender-cvs


[Bf-blender-cvs] [31ba1869831] master: Merge remote-tracking branch 'origin/blender-v2.83-release'

2020-05-04 Thread Sybren A. Stüvel
Commit: 31ba1869831dcf580c69b318da1e63a744f71f97
Author: Sybren A. Stüvel
Date:   Mon May 4 15:30:17 2020 +0200
Branches: master
https://developer.blender.org/rB31ba1869831dcf580c69b318da1e63a744f71f97

Merge remote-tracking branch 'origin/blender-v2.83-release'

===



===



___
Bf-blender-cvs mailing list
Bf-blender-cvs@blender.org
https://lists.blender.org/mailman/listinfo/bf-blender-cvs


[Bf-blender-cvs] [079fc65e0a3] blender-v2.83-release: T76121 Driver depending on animated modifier property does not update

2020-05-04 Thread Sybren A. Stüvel
Commit: 079fc65e0a306ff4bfc7d03a121d164ab67d0cb3
Author: Sybren A. Stüvel
Date:   Mon May 4 13:43:15 2020 +0200
Branches: blender-v2.83-release
https://developer.blender.org/rB079fc65e0a306ff4bfc7d03a121d164ab67d0cb3

T76121 Driver depending on animated modifier property does not update

This fixes an issue where an animated modifier property that's used as
variable in a driver wouldn't animate that driver's value.

Building the relations for the driver target creates the relation
`PARAMETERS_EVAL` → `DRIVER(variable)`. Building the relations for the
FCurve targeting the modifier property creates the relation
`ANIMATION_EXIT` → `GEOMETRY_EVAL_INIT`.

This means that there is NOT a relation `ANIMATION_EXIT` →
`PARAMETERS_EVAL`, and as a result, the driver is not properly updated
when its variable reads animated data. This is resolved in this commit
by adding the missing relation.

Differential Revision: https://developer.blender.org/D7615

===

M   source/blender/depsgraph/intern/builder/deg_builder_relations.cc

===

diff --git a/source/blender/depsgraph/intern/builder/deg_builder_relations.cc 
b/source/blender/depsgraph/intern/builder/deg_builder_relations.cc
index 4caea4b8aee..552546ff094 100644
--- a/source/blender/depsgraph/intern/builder/deg_builder_relations.cc
+++ b/source/blender/depsgraph/intern/builder/deg_builder_relations.cc
@@ -1234,6 +1234,12 @@ void DepsgraphRelationBuilder::build_animdata(ID *id)
   build_animdata_curves(id);
   /* Drivers. */
   build_animdata_drivers(id);
+
+  if (check_id_has_anim_component(id)) {
+ComponentKey animation_key(id, NodeType::ANIMATION);
+ComponentKey parameters_key(id, NodeType::PARAMETERS);
+add_relation(animation_key, parameters_key, "Animation -> Parameters");
+  }
 }
 
 void DepsgraphRelationBuilder::build_animdata_curves(ID *id)

___
Bf-blender-cvs mailing list
Bf-blender-cvs@blender.org
https://lists.blender.org/mailman/listinfo/bf-blender-cvs


[Bf-blender-cvs] [19ea4ba9c50] master: Fix T76399: Wrong API docs for mathutils.Vector.dot

2020-05-04 Thread Jacques Lucke
Commit: 19ea4ba9c50343056ca8a5b450f7dbd34c3a5404
Author: Jacques Lucke
Date:   Mon May 4 14:33:48 2020 +0200
Branches: master
https://developer.blender.org/rB19ea4ba9c50343056ca8a5b450f7dbd34c3a5404

Fix T76399: Wrong API docs for mathutils.Vector.dot

===

M   source/blender/python/mathutils/mathutils_Vector.c

===

diff --git a/source/blender/python/mathutils/mathutils_Vector.c 
b/source/blender/python/mathutils/mathutils_Vector.c
index 6ea0dd52ed7..ace7480ee81 100644
--- a/source/blender/python/mathutils/mathutils_Vector.c
+++ b/source/blender/python/mathutils/mathutils_Vector.c
@@ -930,7 +930,7 @@ PyDoc_STRVAR(Vector_dot_doc,
  "   :arg other: The other vector to perform the dot product 
with.\n"
  "   :type other: :class:`Vector`\n"
  "   :return: The dot product.\n"
- "   :rtype: :class:`Vector`\n");
+ "   :rtype: float\n");
 static PyObject *Vector_dot(VectorObject *self, PyObject *value)
 {
   float *tvec;

___
Bf-blender-cvs mailing list
Bf-blender-cvs@blender.org
https://lists.blender.org/mailman/listinfo/bf-blender-cvs


[Bf-blender-cvs] [d1226a6d9d2] master: Revert "Possible fix for T76113: Use GL_STATIC_DRAW in immBegin"

2020-05-04 Thread mano-wii
Commit: d1226a6d9d2714443cbc6e911ddd26904edcde44
Author: mano-wii
Date:   Mon May 4 08:40:45 2020 -0300
Branches: master
https://developer.blender.org/rBd1226a6d9d2714443cbc6e911ddd26904edcde44

Revert "Possible fix for T76113: Use GL_STATIC_DRAW in immBegin"

This reverts commit 7df51ca11a227b5e51290f8dc976972a01db5d81.
Did not solve the main problem.

===

M   source/blender/gpu/intern/gpu_immediate.c

===

diff --git a/source/blender/gpu/intern/gpu_immediate.c 
b/source/blender/gpu/intern/gpu_immediate.c
index f91a13a3b62..5a5dfb3e1e8 100644
--- a/source/blender/gpu/intern/gpu_immediate.c
+++ b/source/blender/gpu/intern/gpu_immediate.c
@@ -268,8 +268,7 @@ void immBegin(GPUPrimType prim_type, uint vertex_len)
   else {
 /* orphan this buffer & start with a fresh one */
 /* this method works on all platforms, old & new */
-/* `GL_DYNAMIC_DRAW` was causing problems when closing temporary windows 
on old AMD GPUs. */
-glBufferData(GL_ARRAY_BUFFER, active_buffer->buffer_size, NULL, 
GL_STATIC_DRAW);
+glBufferData(GL_ARRAY_BUFFER, active_buffer->buffer_size, NULL, 
GL_DYNAMIC_DRAW);
 
 active_buffer->buffer_offset = 0;
   }

___
Bf-blender-cvs mailing list
Bf-blender-cvs@blender.org
https://lists.blender.org/mailman/listinfo/bf-blender-cvs


[Bf-blender-cvs] [6ea71cb1041] master: Fluid: Fix for refactor 99ee1de094a1

2020-05-04 Thread Sebastián Barschkis
Commit: 6ea71cb104109d7108f964742dff2b9c2766917a
Author: Sebastián Barschkis
Date:   Mon May 4 13:36:23 2020 +0200
Branches: master
https://developer.blender.org/rB6ea71cb104109d7108f964742dff2b9c2766917a

Fluid: Fix for refactor 99ee1de094a1

Use booleans instead of 0 / 1 in Python

===

M   intern/mantaflow/intern/MANTA_main.cpp
M   intern/mantaflow/intern/strings/liquid_script.h

===

diff --git a/intern/mantaflow/intern/MANTA_main.cpp 
b/intern/mantaflow/intern/MANTA_main.cpp
index d59c7464934..fd273b728e7 100644
--- a/intern/mantaflow/intern/MANTA_main.cpp
+++ b/intern/mantaflow/intern/MANTA_main.cpp
@@ -627,6 +627,11 @@ static string getCacheFileEnding(char cache_format)
   }
 }
 
+static string getBooleanString(int value)
+{
+  return (value) ? "True" : "False";
+}
+
 void MANTA::initializeRNAMap(FluidModifierData *mmd)
 {
   if (with_debug)
@@ -643,10 +648,6 @@ void MANTA::initializeRNAMap(FluidModifierData *mmd)
   FluidDomainSettings *mds = mmd->domain;
   bool is2D = (mds->solver_res == 2);
 
-  int openDomain = (FLUID_DOMAIN_BORDER_BACK | FLUID_DOMAIN_BORDER_FRONT |
-FLUID_DOMAIN_BORDER_LEFT | FLUID_DOMAIN_BORDER_RIGHT |
-FLUID_DOMAIN_BORDER_BOTTOM | FLUID_DOMAIN_BORDER_TOP);
-
   string borderCollisions = "";
   if ((mds->border_collisions & FLUID_DOMAIN_BORDER_LEFT) == 0)
 borderCollisions += "x";
@@ -693,20 +694,38 @@ void MANTA::initializeRNAMap(FluidModifierData *mmd)
 
   string cacheDirectory(mds->cache_directory);
 
-  mRNAMap["USING_SMOKE"] = to_string((mds->type == FLUID_DOMAIN_TYPE_GAS) != 
0);
-  mRNAMap["USING_LIQUID"] = to_string((mds->type == FLUID_DOMAIN_TYPE_LIQUID) 
!= 0);
-  mRNAMap["USING_COLORS"] = to_string((mds->active_fields & 
FLUID_DOMAIN_ACTIVE_COLORS) != 0);
-  mRNAMap["USING_HEAT"] = to_string((mds->active_fields & 
FLUID_DOMAIN_ACTIVE_HEAT) != 0);
-  mRNAMap["USING_FIRE"] = to_string((mds->active_fields & 
FLUID_DOMAIN_ACTIVE_FIRE) != 0);
-  mRNAMap["USING_NOISE"] = to_string((mds->flags & FLUID_DOMAIN_USE_NOISE) != 
0);
-  mRNAMap["USING_OBSTACLE"] = to_string((mds->active_fields & 
FLUID_DOMAIN_ACTIVE_OBSTACLE) != 0);
-  mRNAMap["USING_GUIDING"] = to_string((mds->flags & FLUID_DOMAIN_USE_GUIDE) 
!= 0);
-  mRNAMap["USING_INVEL"] = to_string((mds->active_fields & 
FLUID_DOMAIN_ACTIVE_INVEL) != 0);
-  mRNAMap["USING_OUTFLOW"] = to_string((mds->active_fields & 
FLUID_DOMAIN_ACTIVE_OUTFLOW) != 0);
-  mRNAMap["USING_LOG_DISSOLVE"] = to_string((mds->flags & 
FLUID_DOMAIN_USE_DISSOLVE_LOG) != 0);
-  mRNAMap["USING_DISSOLVE"] = to_string((mds->flags & 
FLUID_DOMAIN_USE_DISSOLVE) != 0);
+  float viscosity = mds->viscosity_base * pow(10.0f, -mds->viscosity_exponent);
+  float domainSize = MAX3(mds->global_size[0], mds->global_size[1], 
mds->global_size[2]);
+
+  mRNAMap["USING_SMOKE"] = getBooleanString(mds->type == 
FLUID_DOMAIN_TYPE_GAS);
+  mRNAMap["USING_LIQUID"] = getBooleanString(mds->type == 
FLUID_DOMAIN_TYPE_LIQUID);
+  mRNAMap["USING_COLORS"] = getBooleanString(mds->active_fields & 
FLUID_DOMAIN_ACTIVE_COLORS);
+  mRNAMap["USING_HEAT"] = getBooleanString(mds->active_fields & 
FLUID_DOMAIN_ACTIVE_HEAT);
+  mRNAMap["USING_FIRE"] = getBooleanString(mds->active_fields & 
FLUID_DOMAIN_ACTIVE_FIRE);
+  mRNAMap["USING_NOISE"] = getBooleanString(mds->flags & 
FLUID_DOMAIN_USE_NOISE);
+  mRNAMap["USING_OBSTACLE"] = getBooleanString(mds->active_fields & 
FLUID_DOMAIN_ACTIVE_OBSTACLE);
+  mRNAMap["USING_GUIDING"] = getBooleanString(mds->flags & 
FLUID_DOMAIN_USE_GUIDE);
+  mRNAMap["USING_INVEL"] = getBooleanString(mds->active_fields & 
FLUID_DOMAIN_ACTIVE_INVEL);
+  mRNAMap["USING_OUTFLOW"] = getBooleanString(mds->active_fields & 
FLUID_DOMAIN_ACTIVE_OUTFLOW);
+  mRNAMap["USING_LOG_DISSOLVE"] = getBooleanString(mds->flags & 
FLUID_DOMAIN_USE_DISSOLVE_LOG);
+  mRNAMap["USING_DISSOLVE"] = getBooleanString(mds->flags & 
FLUID_DOMAIN_USE_DISSOLVE);
+  mRNAMap["DO_OPEN"] = getBooleanString(mds->border_collisions == 0);
+  mRNAMap["CACHE_RESUMABLE"] = getBooleanString(mds->cache_type != 
FLUID_DOMAIN_CACHE_FINAL);
+  mRNAMap["USING_ADAPTIVETIME"] = getBooleanString(mds->flags & 
FLUID_DOMAIN_USE_ADAPTIVE_TIME);
+  mRNAMap["USING_SPEEDVECTORS"] = getBooleanString(mds->flags & 
FLUID_DOMAIN_USE_SPEED_VECTORS);
+  mRNAMap["USING_FRACTIONS"] = getBooleanString(mds->flags & 
FLUID_DOMAIN_USE_FRACTIONS);
+  mRNAMap["DELETE_IN_OBSTACLE"] = getBooleanString(mds->flags & 
FLUID_DOMAIN_DELETE_IN_OBSTACLE);
+  mRNAMap["USING_DIFFUSION"] = getBooleanString(mds->flags & 
FLUID_DOMAIN_USE_DIFFUSION);
+  mRNAMap["USING_MESH"] = getBooleanString(mds->flags & FLUID_DOMAIN_USE_MESH);
+  mRNAMap["USING_IMPROVED_MESH"] = getBooleanString(mds->mesh_generator ==
+
FLUID_DOMAIN_MESH_IMPROVED);
+  mRNAMap["USING_SNDPARTS"] = getBooleanString(mds->particle_type & 

[Bf-blender-cvs] [838e1f248d8] master: Nodes: add Combine Strings and Group Instance ID node UIs

2020-05-04 Thread Jacques Lucke
Commit: 838e1f248d8459ae4092b713bb1522900646972b
Author: Jacques Lucke
Date:   Mon May 4 12:49:25 2020 +0200
Branches: master
https://developer.blender.org/rB838e1f248d8459ae4092b713bb1522900646972b

Nodes: add Combine Strings and Group Instance ID node UIs

Reviewers: brecht

Differential Revision: https://developer.blender.org/D7494

===

M   release/scripts/startup/nodeitems_builtins.py
M   source/blender/blenkernel/BKE_node.h
M   source/blender/blenkernel/intern/node.c
M   source/blender/nodes/CMakeLists.txt
M   source/blender/nodes/NOD_function.h
M   source/blender/nodes/NOD_static_types.h
A   source/blender/nodes/function/nodes/node_fn_combine_strings.cc
A   source/blender/nodes/function/nodes/node_fn_group_instance_id.cc

===

diff --git a/release/scripts/startup/nodeitems_builtins.py 
b/release/scripts/startup/nodeitems_builtins.py
index 48df4ae8b90..2dc6c6cd409 100644
--- a/release/scripts/startup/nodeitems_builtins.py
+++ b/release/scripts/startup/nodeitems_builtins.py
@@ -483,6 +483,7 @@ simulation_node_categories = [
 SimulationNodeCategory("SIM_INPUTS", "Input", items=[
 NodeItem("SimulationNodeTime"),
 NodeItem("SimulationNodeParticleAttribute"),
+NodeItem("FunctionNodeGroupInstanceID"),
 ]),
 SimulationNodeCategory("SIM_EMITTERS", "Emitters", items=[
 NodeItem("SimulationNodeParticleMeshEmitter"),
@@ -527,6 +528,7 @@ simulation_node_categories = [
 NodeItem("FunctionNodeBooleanMath"),
 NodeItem("FunctionNodeFloatCompare"),
 NodeItem("FunctionNodeSwitch"),
+NodeItem("FunctionNodeCombineStrings"),
 ]),
 SimulationNodeCategory("SIM_GROUP", "Group", items=node_group_items),
 SimulationNodeCategory("SIM_LAYOUT", "Layout", items=[
diff --git a/source/blender/blenkernel/BKE_node.h 
b/source/blender/blenkernel/BKE_node.h
index 7c77d57bc69..536d04f8bd3 100644
--- a/source/blender/blenkernel/BKE_node.h
+++ b/source/blender/blenkernel/BKE_node.h
@@ -1309,6 +1309,8 @@ int ntreeTexExecTree(struct bNodeTree *ntree,
 #define FN_NODE_BOOLEAN_MATH 1200
 #define FN_NODE_SWITCH 1201
 #define FN_NODE_FLOAT_COMPARE 1202
+#define FN_NODE_GROUP_INSTANCE_ID 1203
+#define FN_NODE_COMBINE_STRINGS 1204
 
 /** \} */
 
diff --git a/source/blender/blenkernel/intern/node.c 
b/source/blender/blenkernel/intern/node.c
index f9477339b9b..e6547012b88 100644
--- a/source/blender/blenkernel/intern/node.c
+++ b/source/blender/blenkernel/intern/node.c
@@ -4248,6 +4248,8 @@ static void registerFunctionNodes(void)
   register_node_type_fn_boolean_math();
   register_node_type_fn_float_compare();
   register_node_type_fn_switch();
+  register_node_type_fn_group_instance_id();
+  register_node_type_fn_combine_strings();
 }
 
 void init_nodesystem(void)
diff --git a/source/blender/nodes/CMakeLists.txt 
b/source/blender/nodes/CMakeLists.txt
index 469a230f467..80bf0f7c5e2 100644
--- a/source/blender/nodes/CMakeLists.txt
+++ b/source/blender/nodes/CMakeLists.txt
@@ -130,7 +130,9 @@ set(SRC
   composite/node_composite_util.c
 
   function/nodes/node_fn_boolean_math.cc
+  function/nodes/node_fn_combine_strings.cc
   function/nodes/node_fn_float_compare.cc
+  function/nodes/node_fn_group_instance_id.cc
   function/nodes/node_fn_switch.cc
   function/node_function_util.cc
 
diff --git a/source/blender/nodes/NOD_function.h 
b/source/blender/nodes/NOD_function.h
index 58597b3d410..377ae8bfb84 100644
--- a/source/blender/nodes/NOD_function.h
+++ b/source/blender/nodes/NOD_function.h
@@ -24,6 +24,8 @@ extern "C" {
 void register_node_type_fn_boolean_math(void);
 void register_node_type_fn_float_compare(void);
 void register_node_type_fn_switch(void);
+void register_node_type_fn_group_instance_id(void);
+void register_node_type_fn_combine_strings(void);
 
 #ifdef __cplusplus
 }
diff --git a/source/blender/nodes/NOD_static_types.h 
b/source/blender/nodes/NOD_static_types.h
index 354c87c554a..91aa11566d3 100644
--- a/source/blender/nodes/NOD_static_types.h
+++ b/source/blender/nodes/NOD_static_types.h
@@ -274,6 +274,8 @@ DefNode(SimulationNode, SIM_NODE_PARTICLE_ATTRIBUTE, 
def_sim_particle_attribute,
 DefNode(FunctionNode, FN_NODE_BOOLEAN_MATH,  def_boolean_math,  
"BOOLEAN_MATH",  BooleanMath,  "Boolean Math", "")
 DefNode(FunctionNode, FN_NODE_FLOAT_COMPARE, def_float_compare, 
"FLOAT_COMPARE", FloatCompare, "Float Compare", "")
 DefNode(FunctionNode, FN_NODE_SWITCH,def_fn_switch, "SWITCH",  
  Switch,   "Switch", "")
+DefNode(FunctionNode, FN_NODE_GROUP_INSTANCE_ID, 0, 
"GROUP_INSTANCE_ID", GroupInstanceID,  "Group Instance ID", "")
+DefNode(FunctionNode, FN_NODE_COMBINE_STRINGS, 0,   
"COMBINE_STRINGS", CombineStrings, "Combine Strings", "")
 
 
 /* undefine macros */
diff --git a/source/blender/nodes/function/nodes/node_fn_combine_strings.cc 

[Bf-blender-cvs] [dc1c562f632] simulation-access-modifier: Merge branch 'master' into simulation-access-modifier

2020-05-04 Thread Jacques Lucke
Commit: dc1c562f632e1370702e85df0711929f3f77d7ea
Author: Jacques Lucke
Date:   Mon May 4 12:29:39 2020 +0200
Branches: simulation-access-modifier
https://developer.blender.org/rBdc1c562f632e1370702e85df0711929f3f77d7ea

Merge branch 'master' into simulation-access-modifier

===



===



___
Bf-blender-cvs mailing list
Bf-blender-cvs@blender.org
https://lists.blender.org/mailman/listinfo/bf-blender-cvs


[Bf-blender-cvs] [0b41497c3cd] simulation-access-modifier: remove "Access" from name

2020-05-04 Thread Jacques Lucke
Commit: 0b41497c3cd4809321673baa2cb6dc6e4b6b129a
Author: Jacques Lucke
Date:   Mon May 4 12:36:11 2020 +0200
Branches: simulation-access-modifier
https://developer.blender.org/rB0b41497c3cd4809321673baa2cb6dc6e4b6b129a

remove "Access" from name

===

M   release/scripts/startup/bl_ui/properties_data_modifier.py
M   source/blender/editors/space_outliner/outliner_draw.c
M   source/blender/makesdna/DNA_modifier_types.h
M   source/blender/makesrna/intern/rna_modifier.c
M   source/blender/modifiers/CMakeLists.txt
M   source/blender/modifiers/MOD_modifiertypes.h
R078source/blender/modifiers/intern/MOD_simulation_access.cc
source/blender/modifiers/intern/MOD_simulation.cc
M   source/blender/modifiers/intern/MOD_util.c

===

diff --git a/release/scripts/startup/bl_ui/properties_data_modifier.py 
b/release/scripts/startup/bl_ui/properties_data_modifier.py
index 9efb2e693ee..3d1adf89e64 100644
--- a/release/scripts/startup/bl_ui/properties_data_modifier.py
+++ b/release/scripts/startup/bl_ui/properties_data_modifier.py
@@ -1821,7 +1821,7 @@ class DATA_PT_modifiers(ModifierButtonsPanel, Panel):
 col.prop(md, "thresh", text="Threshold")
 col.prop(md, "face_influence")
 
-def SIMULATION_ACCESS(self, layout, ob, md):
+def SIMULATION(self, layout, ob, md):
 layout.prop(md, "simulation")
 layout.prop(md, "data_path")
 
diff --git a/source/blender/editors/space_outliner/outliner_draw.c 
b/source/blender/editors/space_outliner/outliner_draw.c
index d8d9e1189c6..13cbda5aad7 100644
--- a/source/blender/editors/space_outliner/outliner_draw.c
+++ b/source/blender/editors/space_outliner/outliner_draw.c
@@ -2191,7 +2191,7 @@ TreeElementIcon tree_element_get_icon(TreeStoreElem 
*tselem, TreeElement *te)
 case eModifierType_WeightedNormal:
   data.icon = ICON_MOD_NORMALEDIT;
   break;
-case eModifierType_SimulationAccess:
+case eModifierType_Simulation:
   data.icon = ICON_PHYSICS; /* TODO: Use correct icon. */
   break;
   /* Default */
diff --git a/source/blender/makesdna/DNA_modifier_types.h 
b/source/blender/makesdna/DNA_modifier_types.h
index c996483a38f..ac526face72 100644
--- a/source/blender/makesdna/DNA_modifier_types.h
+++ b/source/blender/makesdna/DNA_modifier_types.h
@@ -94,7 +94,7 @@ typedef enum ModifierType {
   eModifierType_WeightedNormal = 54,
   eModifierType_Weld = 55,
   eModifierType_Fluid = 56,
-  eModifierType_SimulationAccess = 57,
+  eModifierType_Simulation = 57,
   NUM_MODIFIER_TYPES,
 } ModifierType;
 
@@ -2118,12 +2118,12 @@ enum {
 #define MOD_MESHSEQ_READ_ALL \
   (MOD_MESHSEQ_READ_VERT | MOD_MESHSEQ_READ_POLY | MOD_MESHSEQ_READ_UV | 
MOD_MESHSEQ_READ_COLOR)
 
-typedef struct SimulationAccessModifierData {
+typedef struct SimulationModifierData {
   ModifierData modifier;
 
   struct Simulation *simulation;
   char data_path[64];
-} SimulationAccessModifierData;
+} SimulationModifierData;
 
 #ifdef __cplusplus
 }
diff --git a/source/blender/makesrna/intern/rna_modifier.c 
b/source/blender/makesrna/intern/rna_modifier.c
index 7727f68c4c0..1b5a01aca75 100644
--- a/source/blender/makesrna/intern/rna_modifier.c
+++ b/source/blender/makesrna/intern/rna_modifier.c
@@ -290,10 +290,10 @@ const EnumPropertyItem 
rna_enum_object_modifier_type_items[] = {
 {eModifierType_Softbody, "SOFT_BODY", ICON_MOD_SOFT, "Soft Body", ""},
 {eModifierType_Surface, "SURFACE", ICON_MODIFIER, "Surface", ""},
 #ifdef WITH_NEW_SIMULATION_TYPE
-{eModifierType_SimulationAccess,
- "SIMULATION_ACCESS",
+{eModifierType_Simulation,
+ "SIMULATION",
  ICON_PHYSICS,
- "Simulation Access",
+ "Simulation",
  ""}, /* TODO: Use correct icon. */
 #endif
 {0, NULL, 0, NULL, NULL},
@@ -723,8 +723,8 @@ static StructRNA *rna_Modifier_refine(struct PointerRNA 
*ptr)
   return _SurfaceDeformModifier;
 case eModifierType_WeightedNormal:
   return _WeightedNormalModifier;
-case eModifierType_SimulationAccess:
-  return _SimulationAccessModifier;
+case eModifierType_Simulation:
+  return _SimulationModifier;
 /* Default */
 case eModifierType_Fluidsim: /* deprecated */
 case eModifierType_None:
@@ -6560,9 +6560,9 @@ static void rna_def_modifier_simulation_access(BlenderRNA 
*brna)
   StructRNA *srna;
   PropertyRNA *prop;
 
-  srna = RNA_def_struct(brna, "SimulationAccessModifier", "Modifier");
-  RNA_def_struct_ui_text(srna, "Simulation Access Modifier", "");
-  RNA_def_struct_sdna(srna, "SimulationAccessModifierData");
+  srna = RNA_def_struct(brna, "SimulationModifier", "Modifier");
+  RNA_def_struct_ui_text(srna, "Simulation Modifier", "");
+  RNA_def_struct_sdna(srna, "SimulationModifierData");
   RNA_def_struct_ui_icon(srna, ICON_PHYSICS); /* TODO: Use correct 

[Bf-blender-cvs] [10fad7c88db] simulation-access-modifier: add ifdefs

2020-05-04 Thread Jacques Lucke
Commit: 10fad7c88db642277be784ba77941faa7abc5d9a
Author: Jacques Lucke
Date:   Tue Apr 28 12:40:55 2020 +0200
Branches: simulation-access-modifier
https://developer.blender.org/rB10fad7c88db642277be784ba77941faa7abc5d9a

add ifdefs

===

M   source/blender/makesrna/intern/rna_modifier.c

===

diff --git a/source/blender/makesrna/intern/rna_modifier.c 
b/source/blender/makesrna/intern/rna_modifier.c
index e831599f4c2..c32a88b9918 100644
--- a/source/blender/makesrna/intern/rna_modifier.c
+++ b/source/blender/makesrna/intern/rna_modifier.c
@@ -289,11 +289,13 @@ const EnumPropertyItem 
rna_enum_object_modifier_type_items[] = {
  "Spawn particles from the shape"},
 {eModifierType_Softbody, "SOFT_BODY", ICON_MOD_SOFT, "Soft Body", ""},
 {eModifierType_Surface, "SURFACE", ICON_MODIFIER, "Surface", ""},
+#ifdef WITH_NEW_SIMULATION_TYPE
 {eModifierType_SimulationAccess,
  "SIMULATION_ACCESS",
  ICON_PHYSICS,
  "Simulation Access",
  ""}, /* TODO: Use correct icon. */
+#endif
 {0, NULL, 0, NULL, NULL},
 };
 
@@ -6563,10 +6565,12 @@ static void 
rna_def_modifier_simulation_access(BlenderRNA *brna)
   RNA_def_struct_sdna(srna, "SimulationAccessModifierData");
   RNA_def_struct_ui_icon(srna, ICON_PHYSICS); /* TODO: Use correct icon. */
 
+#  ifdef WITH_NEW_SIMULATION_TYPE
   prop = RNA_def_property(srna, "simulation", PROP_POINTER, PROP_NONE);
   RNA_def_property_ui_text(prop, "Simulation", "Simulation to access");
   RNA_def_property_flag(prop, PROP_EDITABLE);
   RNA_def_property_update(prop, 0, "rna_Modifier_dependency_update");
+#  endif
 
   prop = RNA_def_property(srna, "data_path", PROP_STRING, PROP_NONE);
   RNA_def_property_ui_text(

___
Bf-blender-cvs mailing list
Bf-blender-cvs@blender.org
https://lists.blender.org/mailman/listinfo/bf-blender-cvs


[Bf-blender-cvs] [9adb81f5849] master: Modifiers: Rename Simulate category to Physics

2020-05-04 Thread Jacques Lucke
Commit: 9adb81f58494731438f3afdcbacb1599a4a32bb9
Author: Jacques Lucke
Date:   Mon May 4 12:24:12 2020 +0200
Branches: master
https://developer.blender.org/rB9adb81f58494731438f3afdcbacb1599a4a32bb9

Modifiers: Rename Simulate category to Physics

While the name "Simulate" might be more accurate, there is
a naming collision with the new modifier added in D7549.
Therefore, we decided to rename the category for now.

===

M   source/blender/makesrna/intern/rna_modifier.c

===

diff --git a/source/blender/makesrna/intern/rna_modifier.c 
b/source/blender/makesrna/intern/rna_modifier.c
index ccc141c1bb2..645527bce22 100644
--- a/source/blender/makesrna/intern/rna_modifier.c
+++ b/source/blender/makesrna/intern/rna_modifier.c
@@ -266,7 +266,7 @@ const EnumPropertyItem 
rna_enum_object_modifier_type_items[] = {
  ICON_MOD_WAVE,
  "Wave",
  "Adds a ripple-like motion to an object’s geometry"},
-{0, "", 0, N_("Simulate"), ""},
+{0, "", 0, N_("Physics"), ""},
 {eModifierType_Cloth, "CLOTH", ICON_MOD_CLOTH, "Cloth", ""},
 {eModifierType_Collision, "COLLISION", ICON_MOD_PHYSICS, "Collision", ""},
 {eModifierType_DynamicPaint, "DYNAMIC_PAINT", ICON_MOD_DYNAMICPAINT, 
"Dynamic Paint", ""},

___
Bf-blender-cvs mailing list
Bf-blender-cvs@blender.org
https://lists.blender.org/mailman/listinfo/bf-blender-cvs


[Bf-blender-cvs] [9eb46d6c29e] master: Cleanup: rename mcords to mcoords

2020-05-04 Thread Campbell Barton
Commit: 9eb46d6c29edec3c888e6ebde4328b05d3f0dc6c
Author: Campbell Barton
Date:   Mon May 4 19:50:06 2020 +1000
Branches: master
https://developer.blender.org/rB9eb46d6c29edec3c888e6ebde4328b05d3f0dc6c

Cleanup: rename mcords to mcoords

- 'coords' is an abbreviation for coordinates, not 'cords'.
- Rename 'moves' to 'coords_len'.

===

M   source/blender/blenlib/BLI_lasso_2d.h
M   source/blender/blenlib/intern/lasso_2d.c
M   source/blender/editors/animation/keyframes_edit.c
M   source/blender/editors/gpencil/gpencil_edit.c
M   source/blender/editors/gpencil/gpencil_select.c
M   source/blender/editors/include/ED_keyframes_edit.h
M   source/blender/editors/include/ED_particle.h
M   source/blender/editors/mask/mask_select.c
M   source/blender/editors/physics/particle_edit.c
M   source/blender/editors/sculpt_paint/paint_mask.c
M   source/blender/editors/space_action/action_select.c
M   source/blender/editors/space_clip/tracking_select.c
M   source/blender/editors/space_graph/graph_select.c
M   source/blender/editors/space_node/node_select.c
M   source/blender/editors/space_view3d/view3d_select.c
M   source/blender/editors/uvedit/uvedit_select.c
M   source/blender/windowmanager/WM_api.h
M   source/blender/windowmanager/intern/wm_gesture.c
M   source/blender/windowmanager/intern/wm_gesture_ops.c

===

diff --git a/source/blender/blenlib/BLI_lasso_2d.h 
b/source/blender/blenlib/BLI_lasso_2d.h
index 56db360dab0..fb661c41784 100644
--- a/source/blender/blenlib/BLI_lasso_2d.h
+++ b/source/blender/blenlib/BLI_lasso_2d.h
@@ -30,14 +30,14 @@ extern "C" {
 
 struct rcti;
 
-void BLI_lasso_boundbox(struct rcti *rect, const int mcords[][2], const 
unsigned int moves);
-bool BLI_lasso_is_point_inside(const int mcords[][2],
-   const unsigned int moves,
+void BLI_lasso_boundbox(struct rcti *rect, const int mcoords[][2], const 
unsigned int mcoords_len);
+bool BLI_lasso_is_point_inside(const int mcoords[][2],
+   const unsigned int mcoords_len,
const int sx,
const int sy,
const int error_value);
-bool BLI_lasso_is_edge_inside(const int mcords[][2],
-  const unsigned int moves,
+bool BLI_lasso_is_edge_inside(const int mcoords[][2],
+  const unsigned int mcoords_len,
   int x0,
   int y0,
   int x1,
diff --git a/source/blender/blenlib/intern/lasso_2d.c 
b/source/blender/blenlib/intern/lasso_2d.c
index f1e9b1e655f..a01adf4fa6a 100644
--- a/source/blender/blenlib/intern/lasso_2d.c
+++ b/source/blender/blenlib/intern/lasso_2d.c
@@ -28,47 +28,47 @@
 
 #include "BLI_lasso_2d.h" /* own include */
 
-void BLI_lasso_boundbox(rcti *rect, const int mcords[][2], const unsigned int 
moves)
+void BLI_lasso_boundbox(rcti *rect, const int mcoords[][2], const unsigned int 
mcoords_len)
 {
   unsigned int a;
 
-  rect->xmin = rect->xmax = mcords[0][0];
-  rect->ymin = rect->ymax = mcords[0][1];
+  rect->xmin = rect->xmax = mcoords[0][0];
+  rect->ymin = rect->ymax = mcoords[0][1];
 
-  for (a = 1; a < moves; a++) {
-if (mcords[a][0] < rect->xmin) {
-  rect->xmin = mcords[a][0];
+  for (a = 1; a < mcoords_len; a++) {
+if (mcoords[a][0] < rect->xmin) {
+  rect->xmin = mcoords[a][0];
 }
-else if (mcords[a][0] > rect->xmax) {
-  rect->xmax = mcords[a][0];
+else if (mcoords[a][0] > rect->xmax) {
+  rect->xmax = mcoords[a][0];
 }
-if (mcords[a][1] < rect->ymin) {
-  rect->ymin = mcords[a][1];
+if (mcoords[a][1] < rect->ymin) {
+  rect->ymin = mcoords[a][1];
 }
-else if (mcords[a][1] > rect->ymax) {
-  rect->ymax = mcords[a][1];
+else if (mcoords[a][1] > rect->ymax) {
+  rect->ymax = mcoords[a][1];
 }
   }
 }
 
-bool BLI_lasso_is_point_inside(const int mcords[][2],
-   const unsigned int moves,
+bool BLI_lasso_is_point_inside(const int mcoords[][2],
+   const unsigned int mcoords_len,
const int sx,
const int sy,
const int error_value)
 {
-  if (sx == error_value || moves == 0) {
+  if (sx == error_value || mcoords_len == 0) {
 return false;
   }
   else {
 int pt[2] = {sx, sy};
-return isect_point_poly_v2_int(pt, mcords, moves, true);
+return isect_point_poly_v2_int(pt, mcoords, mcoords_len, true);
   }
 }
 
 /* edge version for lasso select. we assume boundbox check was done */
-bool BLI_lasso_is_edge_inside(const int mcords[][2],
-  const unsigned int moves,
+bool 

[Bf-blender-cvs] [2addc868dee] master: Cleanup: pass ARegion, View2D as const

2020-05-04 Thread Campbell Barton
Commit: 2addc868dee7d93daccbfb06e9cb7ee39c796370
Author: Campbell Barton
Date:   Mon May 4 19:32:59 2020 +1000
Branches: master
https://developer.blender.org/rB2addc868dee7d93daccbfb06e9cb7ee39c796370

Cleanup: pass ARegion, View2D as const

===

M   source/blender/editors/include/ED_image.h
M   source/blender/editors/include/UI_view2d.h
M   source/blender/editors/interface/view2d.c
M   source/blender/editors/space_image/image_edit.c
M   source/blender/editors/space_view3d/view3d_select.c
M   source/blender/editors/uvedit/uvedit_select.c

===

diff --git a/source/blender/editors/include/ED_image.h 
b/source/blender/editors/include/ED_image.h
index 910cf362a37..a8476e3d1ca 100644
--- a/source/blender/editors/include/ED_image.h
+++ b/source/blender/editors/include/ED_image.h
@@ -69,7 +69,7 @@ void ED_space_image_get_size(struct SpaceImage *sima, int 
*r_width, int *r_heigh
 void ED_space_image_get_size_fl(struct SpaceImage *sima, float r_size[2]);
 void ED_space_image_get_aspect(struct SpaceImage *sima, float *r_aspx, float 
*r_aspy);
 void ED_space_image_get_zoom(struct SpaceImage *sima,
- struct ARegion *region,
+ const struct ARegion *region,
  float *r_zoomx,
  float *r_zoomy);
 void ED_space_image_get_uv_aspect(struct SpaceImage *sima, float *r_aspx, 
float *r_aspy);
@@ -88,14 +88,18 @@ void ED_image_get_uv_aspect(struct Image *ima,
 float *r_aspx,
 float *r_aspy);
 void ED_image_mouse_pos(struct SpaceImage *sima,
-struct ARegion *region,
+const struct ARegion *region,
 const int mval[2],
 float co[2]);
 void ED_image_view_center_to_point(struct SpaceImage *sima, float x, float y);
-void ED_image_point_pos(
-struct SpaceImage *sima, struct ARegion *region, float x, float y, float 
*r_x, float *r_y);
+void ED_image_point_pos(struct SpaceImage *sima,
+const struct ARegion *region,
+float x,
+float y,
+float *r_x,
+float *r_y);
 void ED_image_point_pos__reverse(struct SpaceImage *sima,
- struct ARegion *region,
+ const struct ARegion *region,
  const float co[2],
  float r_co[2]);
 bool ED_image_slot_cycle(struct Image *image, int direction);
diff --git a/source/blender/editors/include/UI_view2d.h 
b/source/blender/editors/include/UI_view2d.h
index d4db1b14074..ffc06e94a90 100644
--- a/source/blender/editors/include/UI_view2d.h
+++ b/source/blender/editors/include/UI_view2d.h
@@ -137,9 +137,9 @@ void UI_view2d_view_orthoSpecial(struct ARegion *region, 
struct View2D *v2d, con
 void UI_view2d_view_restore(const struct bContext *C);
 
 /* grid drawing */
-void UI_view2d_constant_grid_draw(struct View2D *v2d, float step);
+void UI_view2d_constant_grid_draw(const struct View2D *v2d, float step);
 void UI_view2d_multi_grid_draw(
-struct View2D *v2d, int colorid, float step, int level_size, int 
totlevels);
+const struct View2D *v2d, int colorid, float step, int level_size, int 
totlevels);
 
 void UI_view2d_draw_lines_y__values(const struct View2D *v2d);
 void UI_view2d_draw_lines_x__values(const struct View2D *v2d);
@@ -209,14 +209,17 @@ bool UI_view2d_view_to_region_clip(
 const struct View2D *v2d, float x, float y, int *r_region_x, int 
*r_region_y) ATTR_NONNULL();
 
 void UI_view2d_view_to_region(
-struct View2D *v2d, float x, float y, int *r_region_x, int *r_region_y) 
ATTR_NONNULL();
-void UI_view2d_view_to_region_fl(
-struct View2D *v2d, float x, float y, float *r_region_x, float 
*r_region_y) ATTR_NONNULL();
-void UI_view2d_view_to_region_m4(struct View2D *v2d, float matrix[4][4]) 
ATTR_NONNULL();
-void UI_view2d_view_to_region_rcti(struct View2D *v2d,
+const struct View2D *v2d, float x, float y, int *r_region_x, int 
*r_region_y) ATTR_NONNULL();
+void UI_view2d_view_to_region_fl(const struct View2D *v2d,
+ float x,
+ float y,
+ float *r_region_x,
+ float *r_region_y) ATTR_NONNULL();
+void UI_view2d_view_to_region_m4(const struct View2D *v2d, float matrix[4][4]) 
ATTR_NONNULL();
+void UI_view2d_view_to_region_rcti(const struct View2D *v2d,
const struct rctf *rect_src,
struct rcti *rect_dst) ATTR_NONNULL();
-bool UI_view2d_view_to_region_rcti_clip(struct View2D *v2d,
+bool UI_view2d_view_to_region_rcti_clip(const struct View2D 

[Bf-blender-cvs] [411c5238a2f] master: UV: support edge-selection for box/circle/lasso select

2020-05-04 Thread Campbell Barton
Commit: 411c5238a2fefe54100453e8536c2c80fae1e9a0
Author: Campbell Barton
Date:   Mon May 4 19:01:00 2020 +1000
Branches: master
https://developer.blender.org/rB411c5238a2fefe54100453e8536c2c80fae1e9a0

UV: support edge-selection for box/circle/lasso select

===

M   source/blender/editors/uvedit/uvedit_select.c

===

diff --git a/source/blender/editors/uvedit/uvedit_select.c 
b/source/blender/editors/uvedit/uvedit_select.c
index fbbafde04d3..e9be10318b0 100644
--- a/source/blender/editors/uvedit/uvedit_select.c
+++ b/source/blender/editors/uvedit/uvedit_select.c
@@ -2495,6 +2495,9 @@ static int uv_box_select_exec(bContext *C, wmOperator *op)
   const bool use_face_center = ((ts->uv_flag & UV_SYNC_SELECTION) ?
 (ts->selectmode == SCE_SELECT_FACE) :
 (ts->uv_selectmode == UV_SELECT_FACE));
+  const bool use_edge = ((ts->uv_flag & UV_SYNC_SELECTION) ?
+ (ts->selectmode == SCE_SELECT_EDGE) :
+ (ts->uv_selectmode == UV_SELECT_EDGE));
 
   /* get rectangle from operator */
   WM_operator_properties_border_to_rctf(op, );
@@ -2550,6 +2553,41 @@ static int uv_box_select_exec(bContext *C, wmOperator 
*op)
 uv_select_flush_from_tag_face(sima, scene, obedit, select);
   }
 }
+else if (use_edge && !pinned) {
+  changed = true;
+  BM_mesh_elem_hflag_disable_all(em->bm, BM_VERT, BM_ELEM_TAG, false);
+
+  BM_ITER_MESH (efa, , em->bm, BM_FACES_OF_MESH) {
+if (!uvedit_face_visible_test(scene, obedit, ima, efa)) {
+  continue;
+}
+
+BMLoop *l_prev = BM_FACE_FIRST_LOOP(efa)->prev;
+MLoopUV *luv_prev = BM_ELEM_CD_GET_VOID_P(l_prev, cd_loop_uv_offset);
+bool luv_select_prev = uvedit_uv_select_test(scene, l_prev, 
cd_loop_uv_offset);
+
+BM_ITER_ELEM (l, , efa, BM_LOOPS_OF_FACE) {
+  luv = BM_ELEM_CD_GET_VOID_P(l, cd_loop_uv_offset);
+  const bool luv_select = uvedit_uv_select_test(scene, l, 
cd_loop_uv_offset);
+  if ((select != luv_select) || (select != luv_select_prev)) {
+if (BLI_rctf_isect_pt_v(, luv->uv) &&
+BLI_rctf_isect_pt_v(, luv_prev->uv)) {
+  uvedit_uv_select_set(em, scene, l, select, false, 
cd_loop_uv_offset);
+  uvedit_uv_select_set(em, scene, l_prev, select, false, 
cd_loop_uv_offset);
+  BM_elem_flag_enable(l->v, BM_ELEM_TAG);
+  BM_elem_flag_enable(l_prev->v, BM_ELEM_TAG);
+}
+  }
+  l_prev = l;
+  luv_prev = luv;
+  luv_select_prev = luv_select;
+}
+  }
+
+  if (sima->sticky == SI_STICKY_VERTEX) {
+uvedit_vertex_select_tagged(em, scene, select, cd_loop_uv_offset);
+  }
+}
 else {
   /* other selection modes */
   changed = true;
@@ -2637,13 +2675,33 @@ void UV_OT_select_box(wmOperatorType *ot)
 /** \name Circle Select Operator
  * \{ */
 
-static int uv_inside_circle(const float uv[2], const float offset[2], const 
float ellipse[2])
+static int uv_circle_select_is_point_inside(const float uv[2],
+const float offset[2],
+const float ellipse[2])
+{
+  /* normalized ellipse: ell[0] = scaleX, ell[1] = scaleY */
+  const float co[2] = {
+  (uv[0] - offset[0]) * ellipse[0],
+  (uv[1] - offset[1]) * ellipse[1],
+  };
+  return len_squared_v2(co) < 1.0f;
+}
+
+static int uv_circle_select_is_edge_inside(const float uv_a[2],
+   const float uv_b[2],
+   const float offset[2],
+   const float ellipse[2])
 {
   /* normalized ellipse: ell[0] = scaleX, ell[1] = scaleY */
-  float x, y;
-  x = (uv[0] - offset[0]) * ellipse[0];
-  y = (uv[1] - offset[1]) * ellipse[1];
-  return ((x * x + y * y) < 1.0f);
+  const float co_a[2] = {
+  (uv_a[0] - offset[0]) * ellipse[0],
+  (uv_a[1] - offset[1]) * ellipse[1],
+  };
+  const float co_b[2] = {
+  (uv_b[0] - offset[0]) * ellipse[0],
+  (uv_b[1] - offset[1]) * ellipse[1],
+  };
+  return dist_squared_to_line_segment_v2((const float[2]){0.0f, 0.0f}, co_a, 
co_b) < 1.0f;
 }
 
 static int uv_circle_select_exec(bContext *C, wmOperator *op)
@@ -2666,6 +2724,9 @@ static int uv_circle_select_exec(bContext *C, wmOperator 
*op)
   const bool use_face_center = ((ts->uv_flag & UV_SYNC_SELECTION) ?
 (ts->selectmode == SCE_SELECT_FACE) :
 (ts->uv_selectmode == UV_SELECT_FACE));
+  const bool use_edge = ((ts->uv_flag & UV_SYNC_SELECTION) ?
+ (ts->selectmode == SCE_SELECT_EDGE) :
+ (ts->uv_selectmode == 

[Bf-blender-cvs] [88b9505b841] master: BLI: simplify memory management in OpenAddressingArray

2020-05-04 Thread Jacques Lucke
Commit: 88b9505b8419f4a363e52bb1930cb1946bf327fe
Author: Jacques Lucke
Date:   Mon May 4 11:11:46 2020 +0200
Branches: master
https://developer.blender.org/rB88b9505b8419f4a363e52bb1930cb1946bf327fe

BLI: simplify memory management in OpenAddressingArray

===

M   source/blender/blenlib/BLI_array.hh
M   source/blender/blenlib/BLI_open_addressing.hh

===

diff --git a/source/blender/blenlib/BLI_array.hh 
b/source/blender/blenlib/BLI_array.hh
index 61d57599619..9dd8341aa76 100644
--- a/source/blender/blenlib/BLI_array.hh
+++ b/source/blender/blenlib/BLI_array.hh
@@ -80,7 +80,7 @@ class Array {
 m_allocator = other.m_allocator;
 
 m_data = this->get_buffer_for_size(other.size());
-copy_n(other.begin(), m_size, m_data);
+uninitialized_copy_n(other.begin(), m_size, m_data);
   }
 
   Array(Array &) noexcept
@@ -202,6 +202,11 @@ class Array {
 return IndexRange(m_size);
   }
 
+  Allocator ()
+  {
+return m_allocator;
+  }
+
  private:
   T *get_buffer_for_size(uint size)
   {
diff --git a/source/blender/blenlib/BLI_open_addressing.hh 
b/source/blender/blenlib/BLI_open_addressing.hh
index d466a915b2f..3bd932350d0 100644
--- a/source/blender/blenlib/BLI_open_addressing.hh
+++ b/source/blender/blenlib/BLI_open_addressing.hh
@@ -34,6 +34,7 @@
 #include 
 
 #include "BLI_allocator.hh"
+#include "BLI_array.hh"
 #include "BLI_math_base.h"
 #include "BLI_memory_utils.hh"
 #include "BLI_utildefines.h"
@@ -114,8 +115,6 @@ class OpenAddressingArray {
*   m_slots_set_or_dummy < m_slots_total
*/
 
-  /* Array containing the actual hash table. Might be a pointer to the inlined 
storage. */
-  Item *m_items;
   /* Number of items in the hash table. Must be a power of two. */
   uint32_t m_item_amount;
   /* Exponent of the current item amount. */
@@ -130,9 +129,8 @@ class OpenAddressingArray {
   uint32_t m_slots_usable;
   /* Can be used to map a hash value into the range of valid slot indices. */
   uint32_t m_slot_mask;
-  Allocator m_allocator;
-  AlignedBuffer<(uint)sizeof(Item) * s_items_in_small_storage, 
(uint)alignof(Item)>
-  m_local_storage;
+
+  Array m_items;
 
  public:
   explicit OpenAddressingArray(uint8_t item_exponent = 
s_small_storage_item_exponent)
@@ -147,51 +145,12 @@ class OpenAddressingArray {
   
(uint64_t)s_max_load_factor_numerator,
   
(uint64_t)s_max_load_factor_denominator);
 
-if (m_item_amount <= s_items_in_small_storage) {
-  m_items = this->small_storage();
-}
-else {
-  m_items = (Item *)m_allocator.allocate_aligned(
-  (uint32_t)sizeof(Item) * m_item_amount, 
std::alignment_of::value, __func__);
-}
-
-for (uint32_t i = 0; i < m_item_amount; i++) {
-  new (m_items + i) Item();
-}
+m_items = Array(m_item_amount);
   }
 
-  ~OpenAddressingArray()
-  {
-if (m_items != nullptr) {
-  for (uint32_t i = 0; i < m_item_amount; i++) {
-m_items[i].~Item();
-  }
-  if (!this->is_in_small_storage()) {
-m_allocator.deallocate((void *)m_items);
-  }
-}
-  }
-
-  OpenAddressingArray(const OpenAddressingArray )
-  {
-m_slots_total = other.m_slots_total;
-m_slots_set_or_dummy = other.m_slots_set_or_dummy;
-m_slots_dummy = other.m_slots_dummy;
-m_slots_usable = other.m_slots_usable;
-m_slot_mask = other.m_slot_mask;
-m_item_amount = other.m_item_amount;
-m_item_exponent = other.m_item_exponent;
-
-if (m_item_amount <= s_items_in_small_storage) {
-  m_items = this->small_storage();
-}
-else {
-  m_items = (Item *)m_allocator.allocate_aligned(
-  sizeof(Item) * m_item_amount, std::alignment_of::value, 
__func__);
-}
+  ~OpenAddressingArray() = default;
 
-uninitialized_copy_n(other.m_items, m_item_amount, m_items);
-  }
+  OpenAddressingArray(const OpenAddressingArray ) = default;
 
   OpenAddressingArray(OpenAddressingArray &) noexcept
   {
@@ -202,15 +161,8 @@ class OpenAddressingArray {
 m_slot_mask = other.m_slot_mask;
 m_item_amount = other.m_item_amount;
 m_item_exponent = other.m_item_exponent;
-if (other.is_in_small_storage()) {
-  m_items = this->small_storage();
-  uninitialized_relocate_n(other.m_items, m_item_amount, m_items);
-}
-else {
-  m_items = other.m_items;
-}
+m_items = std::move(other.m_items);
 
-other.m_items = nullptr;
 other.~OpenAddressingArray();
 new () OpenAddressingArray();
   }
@@ -237,7 +189,7 @@ class OpenAddressingArray {
 
   Allocator ()
   {
-return m_allocator;
+return m_items.allocator();
   }
 
   /* Prepare a new array that can hold a minimum of min_usable_slots elements. 
All entries are
@@ -340,33 +292,22 @@ class OpenAddressingArray {
 
   Item *begin()
   {
-return m_items;
+return 

[Bf-blender-cvs] [fdebdfa320e] master: Cleanup: rename uv_sel_co_from_eve, pass in UV layer offset

2020-05-04 Thread Campbell Barton
Commit: fdebdfa320ec11ddfd6a6319fde86a120769c6f5
Author: Campbell Barton
Date:   Mon May 4 17:08:57 2020 +1000
Branches: master
https://developer.blender.org/rBfdebdfa320ec11ddfd6a6319fde86a120769c6f5

Cleanup: rename uv_sel_co_from_eve, pass in UV layer offset

===

M   source/blender/editors/uvedit/uvedit_intern.h
M   source/blender/editors/uvedit/uvedit_ops.c
M   source/blender/editors/uvedit/uvedit_select.c

===

diff --git a/source/blender/editors/uvedit/uvedit_intern.h 
b/source/blender/editors/uvedit/uvedit_intern.h
index 784345a2611..ffab5bd094f 100644
--- a/source/blender/editors/uvedit/uvedit_intern.h
+++ b/source/blender/editors/uvedit/uvedit_intern.h
@@ -121,11 +121,11 @@ bool uvedit_select_is_any_selected_multi(struct Scene 
*scene,
  struct Image *ima,
  struct Object **objects,
  const uint objects_len);
-float *uv_sel_co_from_eve(struct Scene *scene,
-  struct Object *obedit,
-  struct Image *ima,
-  struct BMEditMesh *em,
-  struct BMVert *eve);
+const float *uvedit_first_selected_uv_from_vertex(struct Scene *scene,
+  struct Object *obedit,
+  struct Image *ima,
+  struct BMVert *eve,
+  const int cd_loop_uv_offset);
 
 void UV_OT_select_all(struct wmOperatorType *ot);
 void UV_OT_select(struct wmOperatorType *ot);
diff --git a/source/blender/editors/uvedit/uvedit_ops.c 
b/source/blender/editors/uvedit/uvedit_ops.c
index 931cb73c7b8..a99e05cb52b 100644
--- a/source/blender/editors/uvedit/uvedit_ops.c
+++ b/source/blender/editors/uvedit/uvedit_ops.c
@@ -618,9 +618,10 @@ static void uv_weld_align(bContext *C, eUVWeldAlign tool)
 if (BLI_array_len(eve_line) > 2) {
 
   /* we know the returns from these must be valid */
-  const float *uv_start = uv_sel_co_from_eve(scene, obedit, ima, em, 
eve_line[0]);
-  const float *uv_end = uv_sel_co_from_eve(
-  scene, obedit, ima, em, eve_line[BLI_array_len(eve_line) - 1]);
+  const float *uv_start = uvedit_first_selected_uv_from_vertex(
+  scene, obedit, ima, eve_line[0], cd_loop_uv_offset);
+  const float *uv_end = uvedit_first_selected_uv_from_vertex(
+  scene, obedit, ima, eve_line[BLI_array_len(eve_line) - 1], 
cd_loop_uv_offset);
   /* For UV_STRAIGHTEN_X & UV_STRAIGHTEN_Y modes */
   float a = 0.0f;
   eUVWeldAlign tool_local = tool;
diff --git a/source/blender/editors/uvedit/uvedit_select.c 
b/source/blender/editors/uvedit/uvedit_select.c
index e3fe58f15ea..fbbafde04d3 100644
--- a/source/blender/editors/uvedit/uvedit_select.c
+++ b/source/blender/editors/uvedit/uvedit_select.c
@@ -1117,15 +1117,16 @@ static void uv_select_linked_multi(Scene *scene,
   }
 }
 
-/* WATCH IT: this returns first selected UV,
- * not ideal in many cases since there could be multiple */
-float *uv_sel_co_from_eve(Scene *scene, Object *obedit, Image *ima, BMEditMesh 
*em, BMVert *eve)
+/**
+ * \warning This returns first selected UV,
+ * not ideal in many cases since there could be multiple.
+ */
+const float *uvedit_first_selected_uv_from_vertex(
+Scene *scene, Object *obedit, Image *ima, BMVert *eve, const int 
cd_loop_uv_offset)
 {
   BMIter liter;
   BMLoop *l;
 
-  const int cd_loop_uv_offset = CustomData_get_offset(>bm->ldata, 
CD_MLOOPUV);
-
   BM_ITER_ELEM (l, , eve, BM_LOOPS_OF_VERT) {
 if (!uvedit_face_visible_test(scene, obedit, ima, l->f)) {
   continue;

___
Bf-blender-cvs mailing list
Bf-blender-cvs@blender.org
https://lists.blender.org/mailman/listinfo/bf-blender-cvs


[Bf-blender-cvs] [b0482728255] master: Cleanup: split selection operations into uvedit_select.c

2020-05-04 Thread Campbell Barton
Commit: b0482728255bff3d0dc689281267343fd4d8dc1a
Author: Campbell Barton
Date:   Mon May 4 16:39:59 2020 +1000
Branches: master
https://developer.blender.org/rBb0482728255bff3d0dc689281267343fd4d8dc1a

Cleanup: split selection operations into uvedit_select.c

===

M   source/blender/editors/uvedit/CMakeLists.txt
M   source/blender/editors/uvedit/uvedit_intern.h
M   source/blender/editors/uvedit/uvedit_ops.c
A   source/blender/editors/uvedit/uvedit_select.c

===

diff --git a/source/blender/editors/uvedit/CMakeLists.txt 
b/source/blender/editors/uvedit/CMakeLists.txt
index d2ba9ab9591..b40b82c50fb 100644
--- a/source/blender/editors/uvedit/CMakeLists.txt
+++ b/source/blender/editors/uvedit/CMakeLists.txt
@@ -40,6 +40,7 @@ set(SRC
   uvedit_draw.c
   uvedit_ops.c
   uvedit_parametrizer.c
+  uvedit_select.c
   uvedit_smart_stitch.c
   uvedit_unwrap_ops.c
 
diff --git a/source/blender/editors/uvedit/uvedit_intern.h 
b/source/blender/editors/uvedit/uvedit_intern.h
index 7bc6b048585..737e0f65908 100644
--- a/source/blender/editors/uvedit/uvedit_intern.h
+++ b/source/blender/editors/uvedit/uvedit_intern.h
@@ -99,6 +99,7 @@ bool uv_find_nearest_face_multi(struct Scene *scene,
 void uvedit_live_unwrap_update(struct SpaceImage *sima,
struct Scene *scene,
struct Object *obedit);
+void uvedit_pixel_to_float(struct SpaceImage *sima, float r_dist[2], float 
pixeldist);
 
 /* operators */
 
@@ -113,4 +114,31 @@ void UV_OT_sphere_project(struct wmOperatorType *ot);
 void UV_OT_unwrap(struct wmOperatorType *ot);
 void UV_OT_stitch(struct wmOperatorType *ot);
 
+/* uvedit_select.c */
+
+bool uvedit_select_is_any_selected(struct Scene *scene, struct Image *ima, 
struct Object *obedit);
+bool uvedit_select_is_any_selected_multi(struct Scene *scene,
+ struct Image *ima,
+ struct Object **objects,
+ const uint objects_len);
+float *uv_sel_co_from_eve(struct Scene *scene,
+  struct Object *obedit,
+  struct Image *ima,
+  struct BMEditMesh *em,
+  struct BMVert *eve);
+
+void UV_OT_select_all(struct wmOperatorType *ot);
+void UV_OT_select(struct wmOperatorType *ot);
+void UV_OT_select_loop(struct wmOperatorType *ot);
+void UV_OT_select_linked(struct wmOperatorType *ot);
+void UV_OT_select_linked_pick(struct wmOperatorType *ot);
+void UV_OT_select_split(struct wmOperatorType *ot);
+void UV_OT_select_pinned(struct wmOperatorType *ot);
+void UV_OT_select_box(struct wmOperatorType *ot);
+void UV_OT_select_lasso(struct wmOperatorType *ot);
+void UV_OT_select_circle(struct wmOperatorType *ot);
+void UV_OT_select_more(struct wmOperatorType *ot);
+void UV_OT_select_less(struct wmOperatorType *ot);
+void UV_OT_select_overlap(struct wmOperatorType *ot);
+
 #endif /* __UVEDIT_INTERN_H__ */
diff --git a/source/blender/editors/uvedit/uvedit_ops.c 
b/source/blender/editors/uvedit/uvedit_ops.c
index e169222380e..e8ebe0aa709 100644
--- a/source/blender/editors/uvedit/uvedit_ops.c
+++ b/source/blender/editors/uvedit/uvedit_ops.c
@@ -36,15 +36,9 @@
 #include "DNA_scene_types.h"
 #include "DNA_space_types.h"
 
-#include "BLI_alloca.h"
 #include "BLI_array.h"
-#include "BLI_blenlib.h"
-#include "BLI_hash.h"
-#include "BLI_kdopbvh.h"
 #include "BLI_kdtree.h"
-#include "BLI_lasso_2d.h"
 #include "BLI_math.h"
-#include "BLI_polyfill_2d.h"
 #include "BLI_utildefines.h"
 
 #include "BLT_translation.h"
@@ -52,31 +46,22 @@
 #include "BKE_context.h"
 #include "BKE_customdata.h"
 #include "BKE_editmesh.h"
-#include "BKE_image.h"
 #include "BKE_layer.h"
 #include "BKE_main.h"
 #include "BKE_material.h"
-#include "BKE_mesh.h"
 #include "BKE_mesh_mapping.h"
 #include "BKE_node.h"
-#include "BKE_report.h"
-#include "BKE_scene.h"
 
 #include "DEG_depsgraph.h"
-#include "DEG_depsgraph_query.h"
 
 #include "ED_image.h"
 #include "ED_mesh.h"
 #include "ED_node.h"
-#include "ED_object.h"
 #include "ED_screen.h"
-#include "ED_select_utils.h"
-#include "ED_transform.h"
 #include "ED_uvedit.h"
 
 #include "RNA_access.h"
 #include "RNA_define.h"
-#include "RNA_enum_types.h"
 
 #include "WM_api.h"
 #include "WM_message.h"
@@ -88,26 +73,6 @@
 
 #include "uvedit_intern.h"
 
-static bool uv_select_is_any_selected(Scene *scene, Image *ima, Object 
*obedit);
-static bool uv_select_is_any_selected_multi(Scene *scene,
-Image *ima,
-Object **objects,
-const uint objects_len);
-static void uv_select_all_perform(Scene *scene, Image *ima, Object *obedit, 
int action);
-static void uv_select_all_perform_multi(
-Scene *scene, Image 

[Bf-blender-cvs] [a9ef6d5ad74] master: Cleanup: replace UV_SELECT_ISLAND_LIMIT macro with a function

2020-05-04 Thread Campbell Barton
Commit: a9ef6d5ad749965f94681534a0a1f53d3e038f5d
Author: Campbell Barton
Date:   Mon May 4 16:59:04 2020 +1000
Branches: master
https://developer.blender.org/rBa9ef6d5ad749965f94681534a0a1f53d3e038f5d

Cleanup: replace UV_SELECT_ISLAND_LIMIT macro with a function

Also make return argument last for uvedit_pixel_to_float.

===

M   source/blender/editors/uvedit/uvedit_intern.h
M   source/blender/editors/uvedit/uvedit_ops.c
M   source/blender/editors/uvedit/uvedit_select.c

===

diff --git a/source/blender/editors/uvedit/uvedit_intern.h 
b/source/blender/editors/uvedit/uvedit_intern.h
index 737e0f65908..784345a2611 100644
--- a/source/blender/editors/uvedit/uvedit_intern.h
+++ b/source/blender/editors/uvedit/uvedit_intern.h
@@ -99,7 +99,7 @@ bool uv_find_nearest_face_multi(struct Scene *scene,
 void uvedit_live_unwrap_update(struct SpaceImage *sima,
struct Scene *scene,
struct Object *obedit);
-void uvedit_pixel_to_float(struct SpaceImage *sima, float r_dist[2], float 
pixeldist);
+void uvedit_pixel_to_float(struct SpaceImage *sima, float pixeldist, float 
r_dist[2]);
 
 /* operators */
 
diff --git a/source/blender/editors/uvedit/uvedit_ops.c 
b/source/blender/editors/uvedit/uvedit_ops.c
index e8ebe0aa709..931cb73c7b8 100644
--- a/source/blender/editors/uvedit/uvedit_ops.c
+++ b/source/blender/editors/uvedit/uvedit_ops.c
@@ -190,7 +190,7 @@ void ED_object_assign_active_image(Main *bmain, Object *ob, 
int mat_nr, Image *i
 /** \name Space Conversion
  * \{ */
 
-void uvedit_pixel_to_float(SpaceImage *sima, float r_dist[2], float pixeldist)
+void uvedit_pixel_to_float(SpaceImage *sima, float pixeldist, float r_dist[2])
 {
   int width, height;
 
diff --git a/source/blender/editors/uvedit/uvedit_select.c 
b/source/blender/editors/uvedit/uvedit_select.c
index 5ecb380de1e..e3fe58f15ea 100644
--- a/source/blender/editors/uvedit/uvedit_select.c
+++ b/source/blender/editors/uvedit/uvedit_select.c
@@ -89,6 +89,11 @@ static void uv_select_tag_update_for_object(Depsgraph 
*depsgraph,
 /** \name Visibility and Selection Utilities
  * \{ */
 
+static void uv_select_island_limit_default(SpaceImage *sima, float r_limit[2])
+{
+  uvedit_pixel_to_float(sima, 0.05f, r_limit);
+}
+
 static void uvedit_vertex_select_tagged(BMEditMesh *em,
 Scene *scene,
 bool select,
@@ -1527,8 +1532,8 @@ static int uv_mouse_select_multi(bContext *C,
   float penalty_dist;
   {
 float penalty[2];
-uvedit_pixel_to_float(sima, limit, 0.05f);
-uvedit_pixel_to_float(sima, penalty, 5.0f / (sima ? sima->zoom : 1.0f));
+uvedit_pixel_to_float(sima, 0.05f, limit);
+uvedit_pixel_to_float(sima, 5.0f / (sima ? sima->zoom : 1.0f), penalty);
 penalty_dist = len_v2(penalty);
   }
 
@@ -1959,7 +1964,7 @@ static int uv_select_linked_internal(bContext *C, 
wmOperator *op, const wmEvent
 extend = RNA_boolean_get(op->ptr, "extend");
 deselect = RNA_boolean_get(op->ptr, "deselect");
   }
-  uvedit_pixel_to_float(sima, limit, 0.05f);
+  uv_select_island_limit_default(sima, limit);
 
   uint objects_len = 0;
   Object **objects = 
BKE_view_layer_array_from_objects_in_edit_mode_unique_data_with_uvs(
@@ -2346,7 +2351,7 @@ static void uv_select_flush_from_tag_face(SpaceImage 
*sima,
 float limit[2];
 uint efa_index;
 
-uvedit_pixel_to_float(sima, limit, 0.05);
+uv_select_island_limit_default(sima, limit);
 
 BM_mesh_elem_table_ensure(em->bm, BM_FACE);
 vmap = BM_uv_vert_map_create(em->bm, limit, false, false);
@@ -2433,7 +2438,7 @@ static void uv_select_flush_from_tag_loop(SpaceImage 
*sima,
 float limit[2];
 uint efa_index;
 
-uvedit_pixel_to_float(sima, limit, 0.05);
+uv_select_island_limit_default(sima, limit);
 
 BM_mesh_elem_table_ensure(em->bm, BM_FACE);
 vmap = BM_uv_vert_map_create(em->bm, limit, false, false);
@@ -2466,10 +2471,6 @@ static void uv_select_flush_from_tag_loop(SpaceImage 
*sima,
 
 /** \} */
 
-#define UV_SELECT_ISLAND_LIMIT \
-  float limit[2]; \
-  uvedit_pixel_to_float(sima, limit, 0.05f)
-
 /*  */
 /** \name Box Select Operator
  * \{ */
@@ -2489,6 +2490,7 @@ static int uv_box_select_exec(bContext *C, wmOperator *op)
   MLoopUV *luv;
   rctf rectf;
   bool pinned;
+  float limit[2];
   const bool use_face_center = ((ts->uv_flag & UV_SYNC_SELECTION) ?
 (ts->selectmode == SCE_SELECT_FACE) :
 (ts->uv_selectmode == UV_SELECT_FACE));
@@ -2503,7 +2505,7 @@ static int uv_box_select_exec(bContext *C, wmOperator *op)
 
   pinned = RNA_boolean_get(op->ptr, "pinned");
 
-  UV_SELECT_ISLAND_LIMIT;
+  uv_select_island_limit_default(sima, limit);
 
   bool 

[Bf-blender-cvs] [b84c380aaa4] master: Merge branch 'blender-v2.83-release'

2020-05-04 Thread Antonio Vazquez
Commit: b84c380aaa4ba1775678f1678bf04f80918067ff
Author: Antonio Vazquez
Date:   Mon May 4 08:24:08 2020 +0200
Branches: master
https://developer.blender.org/rBb84c380aaa4ba1775678f1678bf04f80918067ff

Merge branch 'blender-v2.83-release'

===



===



___
Bf-blender-cvs mailing list
Bf-blender-cvs@blender.org
https://lists.blender.org/mailman/listinfo/bf-blender-cvs


[Bf-blender-cvs] [000fdd8a6ea] blender-v2.83-release: GPencil: Fix Chisel Brush pressure

2020-05-04 Thread Antonio Vazquez
Commit: 000fdd8a6eae1a774aa86778a32c187bd0eec2d1
Author: Antonio Vazquez
Date:   Mon May 4 08:23:27 2020 +0200
Branches: blender-v2.83-release
https://developer.blender.org/rB000fdd8a6eae1a774aa86778a32c187bd0eec2d1

GPencil: Fix Chisel Brush pressure

In previous commit the pressure was disabled by error.

===

M   source/blender/blenkernel/intern/brush.c

===

diff --git a/source/blender/blenkernel/intern/brush.c 
b/source/blender/blenkernel/intern/brush.c
index 8041779880e..8d35abc1523 100644
--- a/source/blender/blenkernel/intern/brush.c
+++ b/source/blender/blenkernel/intern/brush.c
@@ -597,7 +597,7 @@ void BKE_gpencil_brush_preset_set(Main *bmain, Brush 
*brush, const short type)
 }
 case GP_BRUSH_PRESET_MARKER_CHISEL: {
   brush->size = 150.0f;
-  brush->gpencil_settings->flag &= ~GP_BRUSH_USE_PRESSURE;
+  brush->gpencil_settings->flag |= GP_BRUSH_USE_PRESSURE;
 
   brush->gpencil_settings->draw_strength = 1.0f;

___
Bf-blender-cvs mailing list
Bf-blender-cvs@blender.org
https://lists.blender.org/mailman/listinfo/bf-blender-cvs