[Bf-blender-cvs] [630472a615e] temp-gpencil-eval: GPencil: Move triangulation to modifiers and remove force fill recalc

2020-01-16 Thread Antonio Vazquez
Commit: 630472a615e0869e8af4a4f3eaa21c03cc615b0d
Author: Antonio Vazquez
Date:   Fri Jan 17 08:55:33 2020 +0100
Branches: temp-gpencil-eval
https://developer.blender.org/rB630472a615e0869e8af4a4f3eaa21c03cc615b0d

GPencil: Move triangulation to modifiers and remove force fill recalc

===

M   release/scripts/startup/bl_ui/properties_data_gpencil.py
M   source/blender/blenkernel/intern/gpencil.c
M   source/blender/blenkernel/intern/gpencil_modifier.c
M   source/blender/gpencil_modifiers/intern/MOD_gpencilarmature.c
M   source/blender/gpencil_modifiers/intern/MOD_gpencilhook.c
M   source/blender/gpencil_modifiers/intern/MOD_gpencillattice.c
M   source/blender/gpencil_modifiers/intern/MOD_gpenciloffset.c
M   source/blender/makesdna/DNA_gpencil_types.h
M   source/blender/makesrna/intern/rna_gpencil.c

===

diff --git a/release/scripts/startup/bl_ui/properties_data_gpencil.py 
b/release/scripts/startup/bl_ui/properties_data_gpencil.py
index 3ba0d5582d7..192b68e6c10 100644
--- a/release/scripts/startup/bl_ui/properties_data_gpencil.py
+++ b/release/scripts/startup/bl_ui/properties_data_gpencil.py
@@ -367,8 +367,6 @@ class DATA_PT_gpencil_strokes(DataButtonsPanel, Panel):
 sub.active = gpd.stroke_thickness_space == 'WORLDSPACE'
 sub.prop(gpd, "pixel_factor", text="Thickness Scale")
 
-layout.prop(gpd, "use_force_fill_recalc", text="Force Fill Update")
-
 
 class DATA_PT_gpencil_display(DataButtonsPanel, Panel):
 bl_label = "Viewport Display"
diff --git a/source/blender/blenkernel/intern/gpencil.c 
b/source/blender/blenkernel/intern/gpencil.c
index 153b2d06d5f..f577563641a 100644
--- a/source/blender/blenkernel/intern/gpencil.c
+++ b/source/blender/blenkernel/intern/gpencil.c
@@ -437,7 +437,6 @@ bGPdata *BKE_gpencil_data_addnew(Main *bmain, const char 
name[])
 
   /* general flags */
   gpd->flag |= GP_DATA_VIEWALIGN;
-  gpd->flag |= GP_DATA_STROKE_FORCE_RECALC;
   /* always enable object onion skin switch */
   gpd->flag |= GP_DATA_SHOW_ONIONSKINS;
   /* GP object specific settings */
@@ -1795,6 +1794,7 @@ bool BKE_gpencil_sample_stroke(bGPDstroke *gps, const 
float dist, const bool sel
 
   gps->totpoints = i;
 
+  /* Calc geometry data. */
   BKE_gpencil_stroke_geometry_update(gps);
 
   return true;
@@ -3177,6 +3177,9 @@ void BKE_gpencil_merge_distance_stroke(bGPDframe *gpf,
   if (tagged) {
 BKE_gpencil_dissolve_points(gpf, gps, GP_SPOINT_TAG);
   }
+
+  /* Calc geometry data. */
+  BKE_gpencil_stroke_geometry_update(gps);
 }
 
 /* Helper: Check materials with same color. */
diff --git a/source/blender/blenkernel/intern/gpencil_modifier.c 
b/source/blender/blenkernel/intern/gpencil_modifier.c
index 4cc224438f4..e145df56e5c 100644
--- a/source/blender/blenkernel/intern/gpencil_modifier.c
+++ b/source/blender/blenkernel/intern/gpencil_modifier.c
@@ -192,6 +192,7 @@ void BKE_gpencil_simplify_stroke(bGPDstroke *gps, float 
epsilon)
 
   gps->totpoints = j;
 
+  /* Calc geometry data. */
   BKE_gpencil_stroke_geometry_update(gps);
 
   MEM_SAFE_FREE(old_points);
@@ -253,6 +254,7 @@ void BKE_gpencil_simplify_fixed(bGPDstroke *gps)
   }
 
   gps->totpoints = j;
+  /* Calc geometry data. */
   BKE_gpencil_stroke_geometry_update(gps);
 
   MEM_SAFE_FREE(old_points);
@@ -377,20 +379,6 @@ void BKE_gpencil_stroke_modifiers(Depsgraph *depsgraph,
 
   if (mti && mti->deformStroke) {
 mti->deformStroke(md, depsgraph, ob, gpl, gpf, gps);
-/* Subdivide always requires geometry update. */
-if (md->type == eGpencilModifierType_Subdiv) {
-  BKE_gpencil_stroke_geometry_update(gps);
-}
-/* Some modifiers could require a recalc of fill triangulation data. */
-else if (gpd->flag & GP_DATA_STROKE_FORCE_RECALC) {
-  if (ELEM(md->type,
-   eGpencilModifierType_Armature,
-   eGpencilModifierType_Hook,
-   eGpencilModifierType_Lattice,
-   eGpencilModifierType_Offset)) {
-BKE_gpencil_stroke_geometry_update(gps);
-  }
-}
   }
 }
   }
@@ -790,6 +778,8 @@ void BKE_gpencil_subdivide(bGPDstroke *gps, int level, int 
flag)
   MEM_SAFE_FREE(temp_points);
 }
   }
+
+  /* Calc geometry data. */
   BKE_gpencil_stroke_geometry_update(gps);
 }
 
@@ -956,13 +946,6 @@ void BKE_gpencil_modifiers_calc(Depsgraph *depsgraph, 
Scene *scene, Object *ob)
   /* Apply modifiers that only deform geometry */
   BKE_gpencil_stroke_modifiers(depsgraph, ob, gpl, gpf, gps, is_render);
 }
-
-/* Review triangulation for filling after applying modifiers and verify if 
any updated is
- * required.
- * This is needed if some modifiers tagged the stroke triangulation to be 
recalc. */
-LISTBASE_FOREACH (bGPDstroke *, gps, >strokes) {
-  

[Bf-blender-cvs] [74acb006845] master: Merge branch 'blender-v2.82-release'

2020-01-16 Thread Campbell Barton
Commit: 74acb0068452ff9c7d42e52a594371123190bbf2
Author: Campbell Barton
Date:   Fri Jan 17 18:26:11 2020 +1100
Branches: master
https://developer.blender.org/rB74acb0068452ff9c7d42e52a594371123190bbf2

Merge branch 'blender-v2.82-release'

===



===



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


[Bf-blender-cvs] [192940e8c2c] blender-v2.82-release: Cleanup: bad brace placement for manually formatted blocks

2020-01-16 Thread Campbell Barton
Commit: 192940e8c2c86613e4cdca82ad772aa210fc96e0
Author: Campbell Barton
Date:   Fri Jan 17 18:11:50 2020 +1100
Branches: blender-v2.82-release
https://developer.blender.org/rB192940e8c2c86613e4cdca82ad772aa210fc96e0

Cleanup: bad brace placement for manually formatted blocks

===

M   source/blender/editors/space_text/text_format_lua.c
M   source/blender/editors/space_text/text_format_osl.c
M   source/blender/editors/space_text/text_format_pov.c
M   source/blender/editors/space_text/text_format_pov_ini.c
M   source/blender/editors/space_text/text_format_py.c

===

diff --git a/source/blender/editors/space_text/text_format_lua.c 
b/source/blender/editors/space_text/text_format_lua.c
index 935e288c7be..6bbb0d529ab 100644
--- a/source/blender/editors/space_text/text_format_lua.c
+++ b/source/blender/editors/space_text/text_format_lua.c
@@ -66,7 +66,8 @@ static int txtfmt_lua_find_keyword(const char *string)
   } else if (STR_LITERAL_STARTSWITH(string, "then", len)) { i = len;
   } else if (STR_LITERAL_STARTSWITH(string, "until",len)) { i = len;
   } else if (STR_LITERAL_STARTSWITH(string, "while",len)) { i = len;
-  } else {  i = 0; }
+  } else  { i = 0;
+  }
 
   /* clang-format on */
 
@@ -123,7 +124,8 @@ static int txtfmt_lua_find_specialvar(const char *string)
   } else if (STR_LITERAL_STARTSWITH(string, "unpack",   len)) {   i = 
len;
   } else if (STR_LITERAL_STARTSWITH(string, "_VERSION", len)) {   i = 
len;
   } else if (STR_LITERAL_STARTSWITH(string, "xpcall",   len)) {   i = 
len;
-  } else {i = 
0; }
+  } else  {   i = 
0;
+  }
 
   /* clang-format on */
 
@@ -144,7 +146,8 @@ static int txtfmt_lua_find_bool(const char *string)
   if(STR_LITERAL_STARTSWITH(string, "nil",len)) { i = len;
   } else if (STR_LITERAL_STARTSWITH(string, "true",   len)) { i = len;
   } else if (STR_LITERAL_STARTSWITH(string, "false",  len)) { i = len;
-  } else {i = 0; }
+  } else{ i = 0;
+  }
 
   /* clang-format on */
 
@@ -164,7 +167,8 @@ static char txtfmt_lua_format_identifier(const char *str)
 
   if((txtfmt_lua_find_specialvar(str))  != -1) { fmt = 
FMT_TYPE_SPECIAL;
   } else if ((txtfmt_lua_find_keyword(str)) != -1) { fmt = 
FMT_TYPE_KEYWORD;
-  } else {   fmt = 
FMT_TYPE_DEFAULT; }
+  } else   { fmt = 
FMT_TYPE_DEFAULT;
+  }
 
   /* clang-format on */
 
@@ -308,9 +312,9 @@ static void txtfmt_lua_format_line(SpaceText *st, TextLine 
*line, const bool do_
 
 /* Special vars(v) or built-in keywords(b) */
 /* keep in sync with 'txtfmt_osl_format_identifier()' */
-if  ((i = txtfmt_lua_find_specialvar(str))   != -1) { prev = 
FMT_TYPE_SPECIAL;
+if((i = txtfmt_lua_find_specialvar(str))   != -1) { prev = 
FMT_TYPE_SPECIAL;
 } else if ((i = txtfmt_lua_find_keyword(str))  != -1) { prev = 
FMT_TYPE_KEYWORD;
-}
+}
 
 /* clang-format on */
 
diff --git a/source/blender/editors/space_text/text_format_osl.c 
b/source/blender/editors/space_text/text_format_osl.c
index 2da4488e901..0275a293e7a 100644
--- a/source/blender/editors/space_text/text_format_osl.c
+++ b/source/blender/editors/space_text/text_format_osl.c
@@ -64,8 +64,8 @@ static int txtfmt_osl_find_builtinfunc(const char *string)
   } else if (STR_LITERAL_STARTSWITH(string, "vector",   len)) { i = len;
   } else if (STR_LITERAL_STARTSWITH(string, "void", len)) { i = len;
   } else if (STR_LITERAL_STARTSWITH(string, "while",len)) { i = len;
-  } else {  i = 0;
-}
+  } else  { i = 0;
+  }
 
   /* clang-format on */
 
@@ -122,8 +122,8 @@ static int txtfmt_osl_find_reserved(const char *string)
   } else if (STR_LITERAL_STARTSWITH(string, "varying",  len)) { i = len;
   } else if (STR_LITERAL_STARTSWITH(string, "virtual",  len)) { i = len;
   } else if (STR_LITERAL_STARTSWITH(string, "volatile", len)) { i = len;
-  } else {  i = 0;
-}
+  } else  { i = 0;
+  }
 
   /* clang-format on */
 
@@ -153,8 +153,8 @@ static int txtfmt_osl_find_specialvar(const char *string)
   } else if (STR_LITERAL_STARTSWITH(string, "surface",  len)) { i = len;
   } else if (STR_LITERAL_STARTSWITH(string, "volume",   len)) { i = len;
   } else if 

[Bf-blender-cvs] [61072f08193] blender-v2.82-release: Fix T72964: Text editor Python syntax highlighting for numerals

2020-01-16 Thread Peter Lönnebring
Commit: 61072f08193c44ef345d2513a787e9614ba7c507
Author: Peter Lönnebring
Date:   Fri Jan 17 17:56:29 2020 +1100
Branches: blender-v2.82-release
https://developer.blender.org/rB61072f08193c44ef345d2513a787e9614ba7c507

Fix T72964: Text editor Python syntax highlighting for numerals

Less common notation for numbers wasn't highlighted eg:
0b0, 0o0, 0x0, 1.0e0, 1.0E-1, 100_000j

===

M   source/blender/editors/space_text/text_format_py.c

===

diff --git a/source/blender/editors/space_text/text_format_py.c 
b/source/blender/editors/space_text/text_format_py.c
index d84beb79be6..243e9908fc8 100644
--- a/source/blender/editors/space_text/text_format_py.c
+++ b/source/blender/editors/space_text/text_format_py.c
@@ -170,6 +170,144 @@ static int txtfmt_py_find_bool(const char *string)
   return i;
 }
 
+/* Numeral character matching. */
+#define TXTFMT_PY_NUMERAL_STRING_COUNT_IMPL(txtfmt_py_numeral_char_is_fn) \
+  { \
+uint count = 0; \
+for (; txtfmt_py_numeral_char_is_fn(*string); string += 1) { \
+  count += 1; \
+} \
+return count; \
+  } \
+  ((void)0)
+
+/* Binary. */
+static bool txtfmt_py_numeral_char_is_binary(const char c)
+{
+  return ELEM(c, '0', '1') || (c == '_');
+}
+static uint txtfmt_py_numeral_string_count_binary(const char *string)
+{
+  TXTFMT_PY_NUMERAL_STRING_COUNT_IMPL(txtfmt_py_numeral_char_is_binary);
+}
+
+/* Octal. */
+static bool txtfmt_py_numeral_char_is_octal(const char c)
+{
+  return (c >= '0' && c <= '7') || (c == '_');
+}
+static uint txtfmt_py_numeral_string_count_octal(const char *string)
+{
+  TXTFMT_PY_NUMERAL_STRING_COUNT_IMPL(txtfmt_py_numeral_char_is_octal);
+}
+
+/* Decimal. */
+static bool txtfmt_py_numeral_char_is_decimal(const char c)
+{
+  return (c >= '0' && c <= '9') || (c == '_');
+}
+static uint txtfmt_py_numeral_string_count_decimal(const char *string)
+{
+  TXTFMT_PY_NUMERAL_STRING_COUNT_IMPL(txtfmt_py_numeral_char_is_decimal);
+}
+
+/* Hexadecimal. */
+static bool txtfmt_py_numeral_char_is_hexadecimal(const char c)
+{
+  return (c >= '0' && c <= '9') || (c >= 'a' && c <= 'f') || (c >= 'A' && c <= 
'F') || (c == '_');
+}
+static uint txtfmt_py_numeral_string_count_hexadecimal(const char *string)
+{
+  TXTFMT_PY_NUMERAL_STRING_COUNT_IMPL(txtfmt_py_numeral_char_is_hexadecimal);
+}
+
+/* Zeros. */
+static bool txtfmt_py_numeral_char_is_zero(const char c)
+{
+  return (c == '0') || (c == '_');
+}
+static uint txtfmt_py_numeral_string_count_zeros(const char *string)
+{
+  TXTFMT_PY_NUMERAL_STRING_COUNT_IMPL(txtfmt_py_numeral_char_is_zero);
+}
+
+#undef TXTFMT_PY_NUMERAL_STRING_COUNT_IMPL
+
+static int txtfmt_py_find_numeral_inner(const char *string)
+{
+  if (string == NULL || *string == '\0') {
+return -1;
+  }
+
+  const char first = *string, second = *(string + 1);
+
+  /* Decimal dot must be followed by a digit, any decimal digit.
+   * Note that the there can be any number of leading zeros after
+   * the decimal point (leading zeros are not allowed in integers) */
+  if (first == '.') {
+if (text_check_digit(second)) {
+  return 1 + txtfmt_py_numeral_string_count_decimal(string + 1);
+}
+  }
+  else if (first == '0') {
+/* Numerals starting with '0x' or '0X' is followed by hexadecimal digits. 
*/
+if (ELEM(second, 'x', 'X')) {
+  return 2 + txtfmt_py_numeral_string_count_hexadecimal(string + 2);
+}
+/* Numerals starting with '0o' or '0O' is followed by octal digits. */
+if (ELEM(second, 'o', 'O')) {
+  return 2 + txtfmt_py_numeral_string_count_octal(string + 2);
+}
+/* Numerals starting with '0b' or '0B' is followed by binary digits. */
+if (ELEM(second, 'b', 'B')) {
+  return 2 + txtfmt_py_numeral_string_count_binary(string + 2);
+}
+/* Other numerals starting with '0' can be followed by any number of '0' 
characters. */
+if (ELEM(second, '0', '_')) {
+  return 2 + txtfmt_py_numeral_string_count_zeros(string + 2);
+}
+  }
+  /* Any non-zero digit is the start of a decimal number. */
+  else if (first > '0' && first <= '9') {
+return 1 + txtfmt_py_numeral_string_count_decimal(string + 1);
+  }
+  /* A single zero is also allowed. */
+  return (first == '0') ? 1 : 0;
+}
+
+static int txtfmt_py_literal_numeral(const char *string, char prev_fmt)
+{
+  if (string == NULL || *string == '\0') {
+return -1;
+  }
+
+  const char first = *string, second = *(string + 1);
+
+  if (prev_fmt == FMT_TYPE_NUMERAL) {
+/* Previous was a number; if immediately followed by 'e' or 'E' and a 
digit,
+ * it's a base 10 exponent (scientific notation). */
+if (ELEM(first, 'e', 'E') && (text_check_digit(second) || second == '-')) {
+  return 1 + txtfmt_py_find_numeral_inner(string + 1);
+}
+/* Previous was a number; if immediately followed by '.' it's a floating 
point decimal number.
+ * Note: keep the decimal point, 

[Bf-blender-cvs] [4aca02064f2] blender-v2.82-release: Fix T72905: EEVEE + UV Edit Unused Map

2020-01-16 Thread Jeroen Bakker
Commit: 4aca02064f2bd581346f1e47b9ca7f641433955c
Author: Jeroen Bakker
Date:   Mon Jan 6 14:39:15 2020 +0100
Branches: blender-v2.82-release
https://developer.blender.org/rB4aca02064f2bd581346f1e47b9ca7f641433955c

Fix T72905: EEVEE + UV Edit Unused Map

There is a cornercase when the user edits an uvmap, that is not part of
the material (yet). When this is the case the uvmap was not added to the
uv buffer and the 'pos' alias was not created.

This change will always request the active uv map when uv editing.

Reviewed By: fclem

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

===

M   source/blender/draw/intern/draw_cache_impl_mesh.c

===

diff --git a/source/blender/draw/intern/draw_cache_impl_mesh.c 
b/source/blender/draw/intern/draw_cache_impl_mesh.c
index a3897148802..aadcc2a939a 100644
--- a/source/blender/draw/intern/draw_cache_impl_mesh.c
+++ b/source/blender/draw/intern/draw_cache_impl_mesh.c
@@ -930,6 +930,7 @@ static void edituv_request_active_uv(MeshBatchCache *cache, 
Mesh *me)
 {
   DRW_MeshCDMask cd_needed;
   mesh_cd_layers_type_clear(_needed);
+  mesh_cd_calc_active_uv_layer(me, _needed);
   mesh_cd_calc_edit_uv_layer(me, _needed);
 
   BLI_assert(cd_needed.edit_uv != 0 &&

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


[Bf-blender-cvs] [55c70a908ea] master: Merge branch 'blender-v2.82-release'

2020-01-16 Thread mano-wii
Commit: 55c70a908ea979d874a8c441753c67a55ef60e77
Author: mano-wii
Date:   Thu Jan 16 23:34:13 2020 -0300
Branches: master
https://developer.blender.org/rB55c70a908ea979d874a8c441753c67a55ef60e77

Merge branch 'blender-v2.82-release'

===



===



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


[Bf-blender-cvs] [9b3c9ab61a4] blender-v2.82-release: Fix T53178: Casting in Blur node with Relative

2020-01-16 Thread mano-wii
Commit: 9b3c9ab61a4feefc0b2ad2cc9227b81cfe5446d5
Author: mano-wii
Date:   Thu Jan 16 23:32:45 2020 -0300
Branches: blender-v2.82-release
https://developer.blender.org/rB9b3c9ab61a4feefc0b2ad2cc9227b81cfe5446d5

Fix T53178: Casting in Blur node with Relative

In this case the user expects rounding.

===

M   source/blender/compositor/operations/COM_BlurBaseOperation.cpp

===

diff --git a/source/blender/compositor/operations/COM_BlurBaseOperation.cpp 
b/source/blender/compositor/operations/COM_BlurBaseOperation.cpp
index 1b2e3b2821e..24c68ddbec7 100644
--- a/source/blender/compositor/operations/COM_BlurBaseOperation.cpp
+++ b/source/blender/compositor/operations/COM_BlurBaseOperation.cpp
@@ -44,20 +44,22 @@ void BlurBaseOperation::initExecution()
   this->m_data.image_in_width = this->getWidth();
   this->m_data.image_in_height = this->getHeight();
   if (this->m_data.relative) {
+int sizex, sizey;
 switch (this->m_data.aspect) {
-  case CMP_NODE_BLUR_ASPECT_NONE:
-this->m_data.sizex = (int)(this->m_data.percentx * 0.01f * 
this->m_data.image_in_width);
-this->m_data.sizey = (int)(this->m_data.percenty * 0.01f * 
this->m_data.image_in_height);
-break;
   case CMP_NODE_BLUR_ASPECT_Y:
-this->m_data.sizex = (int)(this->m_data.percentx * 0.01f * 
this->m_data.image_in_width);
-this->m_data.sizey = (int)(this->m_data.percenty * 0.01f * 
this->m_data.image_in_width);
+sizex = sizey = this->m_data.image_in_width;
 break;
   case CMP_NODE_BLUR_ASPECT_X:
-this->m_data.sizex = (int)(this->m_data.percentx * 0.01f * 
this->m_data.image_in_height);
-this->m_data.sizey = (int)(this->m_data.percenty * 0.01f * 
this->m_data.image_in_height);
+sizex = sizey = this->m_data.image_in_height;
+break;
+  default:
+BLI_assert(this->m_data.aspect == CMP_NODE_BLUR_ASPECT_NONE);
+sizex = this->m_data.image_in_width;
+sizey = this->m_data.image_in_height;
 break;
 }
+this->m_data.sizex = round_fl_to_int(this->m_data.percentx * 0.01f * 
sizex);
+this->m_data.sizey = round_fl_to_int(this->m_data.percenty * 0.01f * 
sizey);
   }
 
   QualityStepHelper::initExecution(COM_QH_MULTIPLY);

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


[Bf-blender-cvs] [9d90cad3ed3] master: Cleanup: Fix typo in instruction comments

2020-01-16 Thread Hans Goudey
Commit: 9d90cad3ed3912b956da33390964642feb6762c8
Author: Hans Goudey
Date:   Thu Jan 16 19:13:37 2020 -0500
Branches: master
https://developer.blender.org/rB9d90cad3ed3912b956da33390964642feb6762c8

Cleanup: Fix typo in instruction comments

===

M   tests/python/bevel_operator.py
M   tests/python/boolean_operator.py

===

diff --git a/tests/python/bevel_operator.py b/tests/python/bevel_operator.py
index f91c208bae3..3cdbeb9300b 100644
--- a/tests/python/bevel_operator.py
+++ b/tests/python/bevel_operator.py
@@ -17,9 +17,9 @@
 # # END GPL LICENSE BLOCK #
 
 # To run all tests, use
-# BLENDER_VERBOSE=1 blender path/to/bevel_regression.blend --python 
path/to/bevel_operator.py -- --run_all_tests
+# BLENDER_VERBOSE=1 blender path/to/bevel_regression.blend --python 
path/to/bevel_operator.py -- --run-all-tests
 # To run one test, use
-# BLENDER_VERBOSE=1 blender path/to/bevel_regression.blend --python 
path/to/bevel_operator.py -- --run_test 
+# BLENDER_VERBOSE=1 blender path/to/bevel_regression.blend --python 
path/to/bevel_operator.py -- --run-test 
 # where  is the index of the test specified in the list tests.
 
 import bpy
diff --git a/tests/python/boolean_operator.py b/tests/python/boolean_operator.py
index 8183b527591..b05e60eea6c 100644
--- a/tests/python/boolean_operator.py
+++ b/tests/python/boolean_operator.py
@@ -19,9 +19,9 @@
 # 
 
 # To run all tests, use
-# BLENDER_VERBOSE=1 blender path/to/bool_regression.blend --python 
path/to/boolean_operator.py -- --run_all_tests
+# BLENDER_VERBOSE=1 blender path/to/bool_regression.blend --python 
path/to/boolean_operator.py -- --run-all-tests
 # To run one test, use
-# BLENDER_VERBOSE=1 blender path/to/bool_regression.blend --python 
path/to/boolean_operator.py -- --run_test 
+# BLENDER_VERBOSE=1 blender path/to/bool_regression.blend --python 
path/to/boolean_operator.py -- --run-test 
 # where  is the index of the test specified in the list tests.
 
 import bpy

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


[Bf-blender-cvs] [8b02f761d99] greasepencil-refactor: GPencil: Refactor: Allocate GPU framebuffers only if necessary

2020-01-16 Thread Clément Foucault
Commit: 8b02f761d99e787b64d39fe697d78cbfd874b446
Author: Clément Foucault
Date:   Fri Jan 17 01:11:48 2020 +0100
Branches: greasepencil-refactor
https://developer.blender.org/rB8b02f761d99e787b64d39fe697d78cbfd874b446

GPencil: Refactor: Allocate GPU framebuffers only if necessary

Also use signed format only if needed.

Note that you cannot see subtractive, overlay and divide blend modes in
the viewport because of the srgb hack AND the current viewport framebuffer
format.

===

M   source/blender/draw/engines/gpencil/gpencil_cache_utils.c
M   source/blender/draw/engines/gpencil/gpencil_engine.c
M   source/blender/draw/engines/gpencil/gpencil_engine.h
M   source/blender/draw/engines/gpencil/gpencil_shader_fx.c

===

diff --git a/source/blender/draw/engines/gpencil/gpencil_cache_utils.c 
b/source/blender/draw/engines/gpencil/gpencil_cache_utils.c
index e18512af565..9871da45130 100644
--- a/source/blender/draw/engines/gpencil/gpencil_cache_utils.c
+++ b/source/blender/draw/engines/gpencil/gpencil_cache_utils.c
@@ -171,6 +171,8 @@ GPENCIL_tLayer *gpencil_layer_cache_add(GPENCIL_PrivateData 
*pd, Object *ob, bGP
 DRW_shgroup_state_enable(grp, DRW_STATE_BLEND_ADD_FULL);
 DRW_shgroup_uniform_int_copy(grp, "isFirstPass", false);
 DRW_shgroup_call_procedural_triangles(grp, NULL, 1);
+
+pd->use_mask_fb = true;
   }
   else if ((gpl->blend_mode != eGplBlendMode_Regular) || (gpl->opacity < 
1.0f)) {
 DRWState state = DRW_STATE_WRITE_COLOR | DRW_STATE_STENCIL_EQUAL;
@@ -182,22 +184,20 @@ GPENCIL_tLayer 
*gpencil_layer_cache_add(GPENCIL_PrivateData *pd, Object *ob, bGP
 state |= DRW_STATE_BLEND_ADD_FULL;
 break;
   case eGplBlendMode_Subtract:
-/* Caveat. This effect only propagates if target buffer has
- * a signed floating point color buffer.
- * i.e: This will not be conserved after this blending step.
- * TODO(fclem) To make things consistent, we might create a dummy vfx
- * for objects that use this blend type to always avoid the subtract
- * affecting other objects. */
 state |= DRW_STATE_BLEND_SUB;
 break;
   case eGplBlendMode_Multiply:
   case eGplBlendMode_Divide:
-/* Same Caveat as Subtract. This is conserved until there is a blend 
with a LDR buffer. */
   case eGplBlendMode_Overlay:
 state |= DRW_STATE_BLEND_MUL;
 break;
 }
 
+if (ELEM(gpl->blend_mode, eGplBlendMode_Subtract, eGplBlendMode_Overlay)) {
+  /* For these effect to propagate, we need a signed floating point 
buffer. */
+  pd->use_signed_fb = true;
+}
+
 tgp_layer->blend_ps = DRW_pass_create("GPencil Blend Layer", state);
 
 GPUShader *sh = GPENCIL_shader_layer_blend_get();
@@ -218,6 +218,8 @@ GPENCIL_tLayer *gpencil_layer_cache_add(GPENCIL_PrivateData 
*pd, Object *ob, bGP
   DRW_shgroup_uniform_int_copy(grp, "blendMode", 999);
   DRW_shgroup_call_procedural_triangles(grp, NULL, 1);
 }
+
+pd->use_layer_fb = true;
   }
   else {
 tgp_layer->blend_ps = NULL;
diff --git a/source/blender/draw/engines/gpencil/gpencil_engine.c 
b/source/blender/draw/engines/gpencil/gpencil_engine.c
index 0210b289344..4860ad4152d 100644
--- a/source/blender/draw/engines/gpencil/gpencil_engine.c
+++ b/source/blender/draw/engines/gpencil/gpencil_engine.c
@@ -168,6 +168,10 @@ void GPENCIL_cache_init(void *ved)
 
   const DRWContextState *draw_ctx = DRW_context_state_get();
   pd->cfra = (int)DEG_get_ctime(draw_ctx->depsgraph);
+  pd->use_layer_fb = false;
+  pd->use_object_fb = false;
+  pd->use_mask_fb = false;
+  pd->use_signed_fb = false;
 
   if (draw_ctx->v3d) {
 const bool hide_overlay = ((draw_ctx->v3d->flag2 & V3D_HIDE_OVERLAYS) != 
0);
@@ -620,18 +624,13 @@ void GPENCIL_cache_finish(void *ved)
 
   /* Create framebuffers only if needed. */
   if (pd->tobjects.first) {
-/* TODO(fclem) Detect use of layers and vfx. */
-bool use_layer_fb = true;
-bool use_mask_fb = true;
-bool use_object_fb = true;
+eGPUTextureFormat format = pd->use_signed_fb ? GPU_RGBA16F : 
GPU_R11F_G11F_B10F;
 
 const float *size = DRW_viewport_size_get();
 pd->depth_tx = DRW_texture_pool_query_2d(
 size[0], size[1], GPU_DEPTH24_STENCIL8, _engine_gpencil_type);
-pd->color_tx = DRW_texture_pool_query_2d(
-size[0], size[1], GPU_R11F_G11F_B10F, _engine_gpencil_type);
-pd->reveal_tx = DRW_texture_pool_query_2d(
-size[0], size[1], GPU_R11F_G11F_B10F, _engine_gpencil_type);
+pd->color_tx = DRW_texture_pool_query_2d(size[0], size[1], format, 
_engine_gpencil_type);
+pd->reveal_tx = DRW_texture_pool_query_2d(size[0], size[1], format, 
_engine_gpencil_type);
 
 GPU_framebuffer_ensure_config(>gpencil_fb,
   {
@@ -640,11 +639,11 @@ void GPENCIL_cache_finish(void *ved)
 

[Bf-blender-cvs] [4ce820c819c] temp-gpencil-eval: Cleanup: Rename BKE_gpencil_calc_stroke_uv function to BKE_gpencil_stroke_uv_update

2020-01-16 Thread Antonio Vazquez
Commit: 4ce820c819c5a6bd5cbb47304e44993206d7b429
Author: Antonio Vazquez
Date:   Thu Jan 16 22:56:45 2020 +0100
Branches: temp-gpencil-eval
https://developer.blender.org/rB4ce820c819c5a6bd5cbb47304e44993206d7b429

Cleanup: Rename BKE_gpencil_calc_stroke_uv function to 
BKE_gpencil_stroke_uv_update

===

M   source/blender/blenkernel/BKE_gpencil.h
M   source/blender/blenkernel/intern/gpencil.c
M   source/blender/editors/gpencil/gpencil_utils.c

===

diff --git a/source/blender/blenkernel/BKE_gpencil.h 
b/source/blender/blenkernel/BKE_gpencil.h
index c49a3b3cb56..0bc599556a2 100644
--- a/source/blender/blenkernel/BKE_gpencil.h
+++ b/source/blender/blenkernel/BKE_gpencil.h
@@ -261,7 +261,7 @@ void BKE_gpencil_stroke_2d_flat_ref(const struct bGPDspoint 
*ref_points,
 int *r_direction);
 void BKE_gpencil_stroke_fill_triangulate(struct bGPDstroke *gps);
 void BKE_gpencil_stroke_geometry_update(struct bGPDstroke *gps);
-void BKE_gpencil_calc_stroke_uv(struct bGPDstroke *gps);
+void BKE_gpencil_stroke_uv_update(struct bGPDstroke *gps);
 
 void BKE_gpencil_transform(struct bGPdata *gpd, float mat[4][4]);
 
diff --git a/source/blender/blenkernel/intern/gpencil.c 
b/source/blender/blenkernel/intern/gpencil.c
index 8b95bf6872d..153b2d06d5f 100644
--- a/source/blender/blenkernel/intern/gpencil.c
+++ b/source/blender/blenkernel/intern/gpencil.c
@@ -2784,7 +2784,7 @@ void BKE_gpencil_stroke_fill_triangulate(bGPDstroke *gps)
 }
 
 /* texture coordinate utilities */
-void BKE_gpencil_calc_stroke_uv(bGPDstroke *gps)
+void BKE_gpencil_stroke_uv_update(bGPDstroke *gps)
 {
   if (gps == NULL || gps->totpoints == 0) {
 return;
@@ -2811,7 +2811,7 @@ void BKE_gpencil_stroke_geometry_update(bGPDstroke *gps)
   }
 
   /* calc uv data along the stroke */
-  BKE_gpencil_calc_stroke_uv(gps);
+  BKE_gpencil_stroke_uv_update(gps);
 }
 
 float BKE_gpencil_stroke_length(const bGPDstroke *gps, bool use_3d)
diff --git a/source/blender/editors/gpencil/gpencil_utils.c 
b/source/blender/editors/gpencil/gpencil_utils.c
index ea9c7ed6a1b..ab3394c2e92 100644
--- a/source/blender/editors/gpencil/gpencil_utils.c
+++ b/source/blender/editors/gpencil/gpencil_utils.c
@@ -2030,7 +2030,7 @@ void ED_gpencil_update_color_uv(Main *bmain, Material 
*mat)
   gps_ma = BKE_material_gpencil_get(ob, gps->mat_nr + 1);
   /* update */
   if ((gps_ma) && (gps_ma == mat)) {
-BKE_gpencil_calc_stroke_uv(gps);
+BKE_gpencil_stroke_uv_update(gps);
   }
 }
   }

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


[Bf-blender-cvs] [7656611924c] temp-gpencil-eval: Revert "Tag any stroke using the material property"

2020-01-16 Thread Antonio Vazquez
Commit: 7656611924cf9f916321171b8424d2564a65735a
Author: Antonio Vazquez
Date:   Thu Jan 16 16:29:47 2020 +0100
Branches: temp-gpencil-eval
https://developer.blender.org/rB7656611924cf9f916321171b8424d2564a65735a

Revert "Tag any stroke using the material property"

This reverts commit 07c2a935cfb17c1d4b13d715d6ede26b632c7447.

===

M   source/blender/editors/gpencil/gpencil_utils.c
M   source/blender/editors/include/ED_gpencil.h
M   source/blender/makesrna/intern/rna_material.c

===

diff --git a/source/blender/editors/gpencil/gpencil_utils.c 
b/source/blender/editors/gpencil/gpencil_utils.c
index aca13d863b6..eef36c3ab73 100644
--- a/source/blender/editors/gpencil/gpencil_utils.c
+++ b/source/blender/editors/gpencil/gpencil_utils.c
@@ -2040,31 +2040,6 @@ void ED_gpencil_update_color_uv(Main *bmain, Material 
*mat)
   }
 }
 
-/* Tag any stroke using the material */
-void ED_gpencil_material_strokes_tag(Main *bmain, Material *mat)
-{
-  Material *gps_ma = NULL;
-  /* read all strokes  */
-  for (Object *ob = bmain->objects.first; ob; ob = ob->id.next) {
-if (ob->type == OB_GPENCIL) {
-  bGPdata *gpd = (bGPdata *)ob->data;
-  LISTBASE_FOREACH (bGPDlayer *, gpl, >layers) {
-LISTBASE_FOREACH (bGPDframe *, gpf, >frames) {
-  LISTBASE_FOREACH (bGPDstroke *, gps, >strokes) {
-gps_ma = BKE_material_gpencil_get(ob, gps->mat_nr + 1);
-/* update */
-if ((gps_ma) && (gps_ma == mat)) {
-  gps->tot_triangles = 0;
-  gps->flag |= GP_STROKE_RECALC_GEOMETRY;
-}
-  }
-}
-  }
-  DEG_id_tag_update(>id, ID_RECALC_TRANSFORM | ID_RECALC_GEOMETRY);
-}
-  }
-}
-
 static bool gpencil_check_collision(bGPDstroke *gps,
 bGPDstroke **gps_array,
 GHash *all_2d,
diff --git a/source/blender/editors/include/ED_gpencil.h 
b/source/blender/editors/include/ED_gpencil.h
index 35e01df299c..a458f1b3797 100644
--- a/source/blender/editors/include/ED_gpencil.h
+++ b/source/blender/editors/include/ED_gpencil.h
@@ -242,10 +242,10 @@ void ED_gp_project_point_to_plane(const struct Scene 
*scene,
   const int axis,
   struct bGPDspoint *pt);
 void ED_gpencil_drawing_reference_get(const struct Scene *scene,
-  const struct Object *ob,
-  struct bGPDlayer *gpl,
-  char align_flag,
-  float vec[3]);
+ const struct Object *ob,
+ struct bGPDlayer *gpl,
+ char align_flag,
+ float vec[3]);
 void ED_gpencil_project_stroke_to_view(struct bContext *C,
struct bGPDlayer *gpl,
struct bGPDstroke *gps);
@@ -262,15 +262,13 @@ void ED_gpencil_vgroup_deselect(struct bContext *C, 
struct Object *ob);
 /* join objects */
 int ED_gpencil_join_objects_exec(struct bContext *C, struct wmOperator *op);
 
-/* texture coordinate and tag utilities */
+/* texture coordinate utilities */
 void ED_gpencil_tpoint_to_point(struct ARegion *ar,
 float origin[3],
 const struct tGPspoint *tpt,
 struct bGPDspoint *pt);
 void ED_gpencil_update_color_uv(struct Main *bmain, struct Material *mat);
 
-void ED_gpencil_material_strokes_tag(struct Main *bmain, struct Material *mat);
-
 /* extend selection to stroke intersections
  * returns:
  * 0 - No hit
diff --git a/source/blender/makesrna/intern/rna_material.c 
b/source/blender/makesrna/intern/rna_material.c
index c0a004b93ce..bc18af9e532 100644
--- a/source/blender/makesrna/intern/rna_material.c
+++ b/source/blender/makesrna/intern/rna_material.c
@@ -112,9 +112,6 @@ static void rna_MaterialGpencil_update(Main *bmain, Scene 
*scene, PointerRNA *pt
 {
   Material *ma = (Material *)ptr->owner_id;
 
-  /* Tag any related stroke. */
-  ED_gpencil_material_strokes_tag(bmain, ma);
-
   rna_Material_update(bmain, scene, ptr);
   WM_main_add_notifier(NC_GPENCIL | ND_DATA, ma);
 }

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


[Bf-blender-cvs] [467f65ca203] temp-gpencil-eval: Calculate Filling data when stroke is modified

2020-01-16 Thread Antonio Vazquez
Commit: 467f65ca203484f6578e48de43ed9a4afd70b072
Author: Antonio Vazquez
Date:   Thu Jan 16 22:51:41 2020 +0100
Branches: temp-gpencil-eval
https://developer.blender.org/rB467f65ca203484f6578e48de43ed9a4afd70b072

Calculate Filling data when stroke is modified

Instead to calculate the geometry data in runtime, now this data is calculated 
when the stroke is created or modified and saved.

===

M   release/scripts/startup/bl_ui/properties_data_gpencil.py
M   source/blender/blenkernel/BKE_gpencil.h
M   source/blender/blenkernel/intern/gpencil.c
M   source/blender/blenkernel/intern/gpencil_modifier.c
M   source/blender/blenloader/intern/readfile.c
M   source/blender/blenloader/intern/versioning_280.c
M   source/blender/blenloader/intern/writefile.c
M   source/blender/depsgraph/intern/eval/deg_eval_copy_on_write.cc
M   source/blender/editors/gpencil/annotate_paint.c
M   source/blender/editors/gpencil/drawgpencil.c
M   source/blender/editors/gpencil/gpencil_add_monkey.c
M   source/blender/editors/gpencil/gpencil_add_stroke.c
M   source/blender/editors/gpencil/gpencil_edit.c
M   source/blender/editors/gpencil/gpencil_fill.c
M   source/blender/editors/gpencil/gpencil_interpolate.c
M   source/blender/editors/gpencil/gpencil_merge.c
M   source/blender/editors/gpencil/gpencil_paint.c
M   source/blender/editors/gpencil/gpencil_primitive.c
M   source/blender/editors/gpencil/gpencil_sculpt_paint.c
M   source/blender/editors/gpencil/gpencil_utils.c
M   source/blender/editors/gpencil/gpencil_uv.c
M   source/blender/editors/transform/transform_generics.c
M   source/blender/gpencil_modifiers/intern/MOD_gpencilbuild.c
M   source/blender/gpencil_modifiers/intern/MOD_gpencilmultiply.c
M   source/blender/makesdna/DNA_gpencil_types.h
M   source/blender/makesrna/intern/rna_gpencil.c

===

diff --git a/release/scripts/startup/bl_ui/properties_data_gpencil.py 
b/release/scripts/startup/bl_ui/properties_data_gpencil.py
index 874c4213c02..3ba0d5582d7 100644
--- a/release/scripts/startup/bl_ui/properties_data_gpencil.py
+++ b/release/scripts/startup/bl_ui/properties_data_gpencil.py
@@ -368,7 +368,6 @@ class DATA_PT_gpencil_strokes(DataButtonsPanel, Panel):
 sub.prop(gpd, "pixel_factor", text="Thickness Scale")
 
 layout.prop(gpd, "use_force_fill_recalc", text="Force Fill Update")
-layout.prop(gpd, "use_adaptive_uv", text="Adaptive UVs")
 
 
 class DATA_PT_gpencil_display(DataButtonsPanel, Panel):
diff --git a/source/blender/blenkernel/BKE_gpencil.h 
b/source/blender/blenkernel/BKE_gpencil.h
index 2c49878005f..c49a3b3cb56 100644
--- a/source/blender/blenkernel/BKE_gpencil.h
+++ b/source/blender/blenkernel/BKE_gpencil.h
@@ -259,10 +259,8 @@ void BKE_gpencil_stroke_2d_flat_ref(const struct 
bGPDspoint *ref_points,
 float (*points2d)[2],
 const float scale,
 int *r_direction);
-void BKE_gpencil_triangulate_stroke_fill(struct bGPdata *gpd, struct 
bGPDstroke *gps);
-void BKE_gpencil_recalc_geometry_caches(struct Object *ob,
-struct bGPDlayer *gpl,
-struct bGPDstroke *gps);
+void BKE_gpencil_stroke_fill_triangulate(struct bGPDstroke *gps);
+void BKE_gpencil_stroke_geometry_update(struct bGPDstroke *gps);
 void BKE_gpencil_calc_stroke_uv(struct bGPDstroke *gps);
 
 void BKE_gpencil_transform(struct bGPdata *gpd, float mat[4][4]);
@@ -329,7 +327,6 @@ extern "C" {
 void BKE_gpencil_frame_original_pointers_update(const struct bGPDframe 
*gpf_orig,
 const struct bGPDframe 
*gpf_eval);
 void BKE_gpencil_update_orig_pointers(const struct Object *ob_orig, const 
struct Object *ob_eval);
-void BKE_gpencil_prepare_filling_data(const struct Object *ob_orig, const 
struct Object *ob_eval);
 
 #ifdef __cplusplus
 }
diff --git a/source/blender/blenkernel/intern/gpencil.c 
b/source/blender/blenkernel/intern/gpencil.c
index 9241829075f..8b95bf6872d 100644
--- a/source/blender/blenkernel/intern/gpencil.c
+++ b/source/blender/blenkernel/intern/gpencil.c
@@ -507,15 +507,13 @@ bGPDstroke *BKE_gpencil_stroke_add(bGPDframe *gpf, int 
mat_idx, int totpoints, s
 
   gps->inittime = 0;
 
-  /* enable recalculation flag by default */
-  gps->flag = GP_STROKE_RECALC_GEOMETRY | GP_STROKE_3DSPACE;
+  gps->flag = GP_STROKE_3DSPACE;
 
   gps->totpoints = totpoints;
   gps->points = MEM_callocN(sizeof(bGPDspoint) * gps->totpoints, 
"gp_stroke_points");
 
   /* initialize triangle memory to dummy data */
   gps->triangles = NULL;
-  gps->flag |= GP_STROKE_RECALC_GEOMETRY;
   gps->tot_triangles = 0;
 
   gps->mat_nr = mat_idx;
@@ -570,12 +568,7 @@ bGPDstroke 

[Bf-blender-cvs] [07c2a935cfb] temp-gpencil-eval: Tag any stroke using the material property

2020-01-16 Thread Antonio Vazquez
Commit: 07c2a935cfb17c1d4b13d715d6ede26b632c7447
Author: Antonio Vazquez
Date:   Thu Jan 16 16:29:47 2020 +0100
Branches: temp-gpencil-eval
https://developer.blender.org/rB07c2a935cfb17c1d4b13d715d6ede26b632c7447

Tag any stroke using the material property

This is required to calculate triangulation if the material is changed from NO 
Fill to Fill

===

M   source/blender/editors/gpencil/gpencil_utils.c
M   source/blender/editors/include/ED_gpencil.h
M   source/blender/makesrna/intern/rna_material.c

===

diff --git a/source/blender/editors/gpencil/gpencil_utils.c 
b/source/blender/editors/gpencil/gpencil_utils.c
index eef36c3ab73..aca13d863b6 100644
--- a/source/blender/editors/gpencil/gpencil_utils.c
+++ b/source/blender/editors/gpencil/gpencil_utils.c
@@ -2040,6 +2040,31 @@ void ED_gpencil_update_color_uv(Main *bmain, Material 
*mat)
   }
 }
 
+/* Tag any stroke using the material */
+void ED_gpencil_material_strokes_tag(Main *bmain, Material *mat)
+{
+  Material *gps_ma = NULL;
+  /* read all strokes  */
+  for (Object *ob = bmain->objects.first; ob; ob = ob->id.next) {
+if (ob->type == OB_GPENCIL) {
+  bGPdata *gpd = (bGPdata *)ob->data;
+  LISTBASE_FOREACH (bGPDlayer *, gpl, >layers) {
+LISTBASE_FOREACH (bGPDframe *, gpf, >frames) {
+  LISTBASE_FOREACH (bGPDstroke *, gps, >strokes) {
+gps_ma = BKE_material_gpencil_get(ob, gps->mat_nr + 1);
+/* update */
+if ((gps_ma) && (gps_ma == mat)) {
+  gps->tot_triangles = 0;
+  gps->flag |= GP_STROKE_RECALC_GEOMETRY;
+}
+  }
+}
+  }
+  DEG_id_tag_update(>id, ID_RECALC_TRANSFORM | ID_RECALC_GEOMETRY);
+}
+  }
+}
+
 static bool gpencil_check_collision(bGPDstroke *gps,
 bGPDstroke **gps_array,
 GHash *all_2d,
diff --git a/source/blender/editors/include/ED_gpencil.h 
b/source/blender/editors/include/ED_gpencil.h
index a458f1b3797..35e01df299c 100644
--- a/source/blender/editors/include/ED_gpencil.h
+++ b/source/blender/editors/include/ED_gpencil.h
@@ -242,10 +242,10 @@ void ED_gp_project_point_to_plane(const struct Scene 
*scene,
   const int axis,
   struct bGPDspoint *pt);
 void ED_gpencil_drawing_reference_get(const struct Scene *scene,
- const struct Object *ob,
- struct bGPDlayer *gpl,
- char align_flag,
- float vec[3]);
+  const struct Object *ob,
+  struct bGPDlayer *gpl,
+  char align_flag,
+  float vec[3]);
 void ED_gpencil_project_stroke_to_view(struct bContext *C,
struct bGPDlayer *gpl,
struct bGPDstroke *gps);
@@ -262,13 +262,15 @@ void ED_gpencil_vgroup_deselect(struct bContext *C, 
struct Object *ob);
 /* join objects */
 int ED_gpencil_join_objects_exec(struct bContext *C, struct wmOperator *op);
 
-/* texture coordinate utilities */
+/* texture coordinate and tag utilities */
 void ED_gpencil_tpoint_to_point(struct ARegion *ar,
 float origin[3],
 const struct tGPspoint *tpt,
 struct bGPDspoint *pt);
 void ED_gpencil_update_color_uv(struct Main *bmain, struct Material *mat);
 
+void ED_gpencil_material_strokes_tag(struct Main *bmain, struct Material *mat);
+
 /* extend selection to stroke intersections
  * returns:
  * 0 - No hit
diff --git a/source/blender/makesrna/intern/rna_material.c 
b/source/blender/makesrna/intern/rna_material.c
index bc18af9e532..c0a004b93ce 100644
--- a/source/blender/makesrna/intern/rna_material.c
+++ b/source/blender/makesrna/intern/rna_material.c
@@ -112,6 +112,9 @@ static void rna_MaterialGpencil_update(Main *bmain, Scene 
*scene, PointerRNA *pt
 {
   Material *ma = (Material *)ptr->owner_id;
 
+  /* Tag any related stroke. */
+  ED_gpencil_material_strokes_tag(bmain, ma);
+
   rna_Material_update(bmain, scene, ptr);
   WM_main_add_notifier(NC_GPENCIL | ND_DATA, ma);
 }

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


[Bf-blender-cvs] [e61e177e4c9] temp-gpencil-eval: Remove gp_style parameter

2020-01-16 Thread Antonio Vazquez
Commit: e61e177e4c9d28a3d4dbd3e6e23e70a182e95705
Author: Antonio Vazquez
Date:   Thu Jan 16 18:40:59 2020 +0100
Branches: temp-gpencil-eval
https://developer.blender.org/rBe61e177e4c9d28a3d4dbd3e6e23e70a182e95705

Remove gp_style parameter

===

M   source/blender/blenkernel/BKE_gpencil.h
M   source/blender/blenkernel/intern/gpencil.c
M   source/blender/blenkernel/intern/gpencil_modifier.c

===

diff --git a/source/blender/blenkernel/BKE_gpencil.h 
b/source/blender/blenkernel/BKE_gpencil.h
index 5efdc2ccace..2c49878005f 100644
--- a/source/blender/blenkernel/BKE_gpencil.h
+++ b/source/blender/blenkernel/BKE_gpencil.h
@@ -262,7 +262,6 @@ void BKE_gpencil_stroke_2d_flat_ref(const struct bGPDspoint 
*ref_points,
 void BKE_gpencil_triangulate_stroke_fill(struct bGPdata *gpd, struct 
bGPDstroke *gps);
 void BKE_gpencil_recalc_geometry_caches(struct Object *ob,
 struct bGPDlayer *gpl,
-struct MaterialGPencilStyle *gp_style,
 struct bGPDstroke *gps);
 void BKE_gpencil_calc_stroke_uv(struct bGPDstroke *gps);
 
diff --git a/source/blender/blenkernel/intern/gpencil.c 
b/source/blender/blenkernel/intern/gpencil.c
index 2d40ef1ecb3..9241829075f 100644
--- a/source/blender/blenkernel/intern/gpencil.c
+++ b/source/blender/blenkernel/intern/gpencil.c
@@ -2771,13 +2771,9 @@ void BKE_gpencil_triangulate_stroke_fill(bGPdata *gpd, 
bGPDstroke *gps)
   gps->tot_triangles = gps->totpoints - 2;
   /* save triangulation data in stroke cache */
   if (gps->tot_triangles > 0) {
-if (gps->triangles == NULL) {
-  gps->triangles = MEM_callocN(sizeof(*gps->triangles) * 
gps->tot_triangles,
-   "GP Stroke triangulation");
-}
-else {
-  gps->triangles = MEM_recallocN(gps->triangles, sizeof(*gps->triangles) * 
gps->tot_triangles);
-}
+MEM_SAFE_FREE(gps->triangles);
+gps->triangles = MEM_callocN(sizeof(*gps->triangles) * gps->tot_triangles,
+ "GP Stroke triangulation");
 
 for (int i = 0; i < gps->tot_triangles; i++) {
   memcpy(gps->triangles[i].verts, tmp_triangles[i], sizeof(uint[3]));
@@ -2825,19 +2821,11 @@ void BKE_gpencil_calc_stroke_uv(bGPDstroke *gps)
 }
 
 /* Recalc the internal geometry caches for fill and uvs. */
-void BKE_gpencil_recalc_geometry_caches(Object *ob,
-bGPDlayer *gpl,
-MaterialGPencilStyle *gp_style,
-bGPDstroke *gps)
+void BKE_gpencil_recalc_geometry_caches(Object *ob, bGPDlayer *gpl, bGPDstroke 
*gps)
 {
   if (gps->flag & GP_STROKE_RECALC_GEOMETRY) {
-/* Calculate triangles cache for filling area (must be done only after 
changes) */
-if ((gps->tot_triangles == 0) || (gps->triangles == NULL)) {
-  if ((gps->totpoints > 2) && (gp_style->flag & GP_MATERIAL_FILL_SHOW) &&
-  ((gp_style->fill_rgba[3] > GPENCIL_ALPHA_OPACITY_THRESH) || 
(gp_style->fill_style > 0) ||
-   (gpl->blend_mode != eGplBlendMode_Regular))) {
-BKE_gpencil_triangulate_stroke_fill((bGPdata *)ob->data, gps);
-  }
+if (gps->totpoints > 2) {
+  BKE_gpencil_triangulate_stroke_fill((bGPdata *)ob->data, gps);
 }
 
 /* calc uv data along the stroke */
@@ -3845,11 +3833,7 @@ static void gpencil_prepare_filling(const Object *ob)
   LISTBASE_FOREACH (bGPDlayer *, gpl, >layers) {
 LISTBASE_FOREACH (bGPDframe *, gpf, >frames) {
   LISTBASE_FOREACH (bGPDstroke *, gps, >strokes) {
-MaterialGPencilStyle *gp_style = 
BKE_material_gpencil_settings_get((Object *)ob,
-   
gps->mat_nr + 1);
-if (gp_style) {
-  BKE_gpencil_recalc_geometry_caches((Object *)ob, gpl, gp_style, gps);
-}
+BKE_gpencil_recalc_geometry_caches((Object *)ob, gpl, gps);
   }
 }
   }
diff --git a/source/blender/blenkernel/intern/gpencil_modifier.c 
b/source/blender/blenkernel/intern/gpencil_modifier.c
index 63f2efb919a..f5df4fa3a3f 100644
--- a/source/blender/blenkernel/intern/gpencil_modifier.c
+++ b/source/blender/blenkernel/intern/gpencil_modifier.c
@@ -965,10 +965,7 @@ void BKE_gpencil_modifiers_calc(Depsgraph *depsgraph, 
Scene *scene, Object *ob)
  * required.
  * This is needed if some modifiers tagged the stroke triangulation to be 
recalc. */
 LISTBASE_FOREACH (bGPDstroke *, gps, >strokes) {
-  MaterialGPencilStyle *gp_style = BKE_material_gpencil_settings_get(ob, 
gps->mat_nr + 1);
-  if (gp_style) {
-BKE_gpencil_recalc_geometry_caches(ob, gpl, gp_style, gps);
-  }
+  BKE_gpencil_recalc_geometry_caches(ob, gpl, gps);
 }
   }

___
Bf-blender-cvs 

[Bf-blender-cvs] [86db35845a8] master: libs/windows: Prevent USD exports from leaking into blender binary.

2020-01-16 Thread Ray Molenkamp
Commit: 86db35845a83b15f3b460fe878592ac6dd58a6dd
Author: Ray Molenkamp
Date:   Thu Jan 16 13:11:07 2020 -0700
Branches: master
https://developer.blender.org/rB86db35845a83b15f3b460fe878592ac6dd58a6dd

libs/windows: Prevent USD exports from leaking into blender binary.

Even though we build USD as static, it still feels the need to mark its
symbols with declspec(dllexport) which means the blender binary now exports
these symbols.

this patch fixes that unwanted behaviour, however USD libs still need to
rebuild before this becomes visible in the blender binary

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

Reviewed By: sybren

===

M   build_files/build_environment/patches/usd.diff

===

diff --git a/build_files/build_environment/patches/usd.diff 
b/build_files/build_environment/patches/usd.diff
index 0a98fa220b2..6302f13796b 100644
--- a/build_files/build_environment/patches/usd.diff
+++ b/build_files/build_environment/patches/usd.diff
@@ -121,3 +121,19 @@ diff -Naur 
external_usd_orig/pxr/base/lib/tf/preprocessorUtils.h external_usd/px
  #define TF_PP_IS_TUPLE(sequence) \
  BOOST_VMD_IS_TUPLE(sequence)
  #else
+diff -Naur external_usd_base/cmake/macros/Public.cmake 
external_usd/cmake/macros/Public.cmake
+--- external_usd_base/cmake/macros/Public.cmake2019-10-24 14:39:53 
-0600
 external_usd/cmake/macros/Public.cmake 2020-01-11 13:33:29 -0700
+@@ -996,6 +996,12 @@
+ foreach(lib ${PXR_OBJECT_LIBS})
+ string(TOUPPER ${lib} uppercaseName)
+ list(APPEND exports "${uppercaseName}_EXPORTS=1")
++# When building for blender, we do NOT want to export all symbols on 
windows.
++# This is a dirty hack, but USD makes it impossible to do the right 
thing
++# with the default options exposed.
++if (WIN32)
++list(APPEND exports "PXR_STATIC=1")
++endif()
+ endforeach()
+ foreach(lib ${PXR_OBJECT_LIBS})
+ set(objects "${objects};\$")

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


[Bf-blender-cvs] [b963745cdf9] master: Merge branch 'blender-v2.82-release'

2020-01-16 Thread Stefan Werner
Commit: b963745cdf9b8e96086da52812617b8634978e4c
Author: Stefan Werner
Date:   Thu Jan 16 20:54:11 2020 +0100
Branches: master
https://developer.blender.org/rBb963745cdf9b8e96086da52812617b8634978e4c

Merge branch 'blender-v2.82-release'

===



===



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


[Bf-blender-cvs] [6257cdc376a] blender-v2.82-release: Fix T73064: Embree does not like Bevel shader

2020-01-16 Thread Stefan Werner
Commit: 6257cdc376af02e93b61073b67ffc0514f8af4ac
Author: Stefan Werner
Date:   Wed Jan 15 14:33:16 2020 +0100
Branches: blender-v2.82-release
https://developer.blender.org/rB6257cdc376af02e93b61073b67ffc0514f8af4ac

Fix T73064: Embree does not like Bevel shader

Embree's local intersection routine was not prepared
for local intersections without per-object BVH.
Now it should be able to handle any kind of local
intersection, such as AO, bevel and SSS.

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

===

M   intern/cycles/bvh/bvh_embree.cpp
M   intern/cycles/kernel/bvh/bvh.h
M   intern/cycles/kernel/bvh/bvh_embree.h

===

diff --git a/intern/cycles/bvh/bvh_embree.cpp b/intern/cycles/bvh/bvh_embree.cpp
index ac7cf6501ba..3e4978a2c0a 100644
--- a/intern/cycles/bvh/bvh_embree.cpp
+++ b/intern/cycles/bvh/bvh_embree.cpp
@@ -146,7 +146,21 @@ static void rtc_filter_occluded_func(const 
RTCFilterFunctionNArguments *args)
   }
   break;
 }
+case CCLIntersectContext::RAY_LOCAL:
 case CCLIntersectContext::RAY_SSS: {
+  /* Check if it's hitting the correct object. */
+  Intersection current_isect;
+  if (ctx->type == CCLIntersectContext::RAY_SSS) {
+kernel_embree_convert_sss_hit(kg, ray, hit, _isect, 
ctx->local_object_id);
+  }
+  else {
+kernel_embree_convert_hit(kg, ray, hit, _isect);
+if (ctx->local_object_id != current_isect.object) {
+  /* This tells Embree to continue tracing. */
+  *args->valid = 0;
+}
+  }
+
   /* No intersection information requested, just return a hit. */
   if (ctx->max_hits == 0) {
 break;
@@ -160,8 +174,8 @@ static void rtc_filter_occluded_func(const 
RTCFilterFunctionNArguments *args)
   }
 
   /* See triangle_intersect_subsurface() for the native equivalent. */
-  for (int i = min(ctx->max_hits, ctx->ss_isect->num_hits) - 1; i >= 0; 
--i) {
-if (ctx->ss_isect->hits[i].t == ray->tfar) {
+  for (int i = min(ctx->max_hits, ctx->local_isect->num_hits) - 1; i >= 0; 
--i) {
+if (ctx->local_isect->hits[i].t == ray->tfar) {
   /* This tells Embree to continue tracing. */
   *args->valid = 0;
   break;
@@ -172,14 +186,14 @@ static void rtc_filter_occluded_func(const 
RTCFilterFunctionNArguments *args)
 
   if (ctx->lcg_state) {
 
-++ctx->ss_isect->num_hits;
-if (ctx->ss_isect->num_hits <= ctx->max_hits) {
-  hit_idx = ctx->ss_isect->num_hits - 1;
+++ctx->local_isect->num_hits;
+if (ctx->local_isect->num_hits <= ctx->max_hits) {
+  hit_idx = ctx->local_isect->num_hits - 1;
 }
 else {
   /* reservoir sampling: if we are at the maximum number of
* hits, randomly replace element or skip it */
-  hit_idx = lcg_step_uint(ctx->lcg_state) % ctx->ss_isect->num_hits;
+  hit_idx = lcg_step_uint(ctx->lcg_state) % ctx->local_isect->num_hits;
 
   if (hit_idx >= ctx->max_hits) {
 /* This tells Embree to continue tracing. */
@@ -189,15 +203,11 @@ static void rtc_filter_occluded_func(const 
RTCFilterFunctionNArguments *args)
 }
   }
   else {
-ctx->ss_isect->num_hits = 1;
+ctx->local_isect->num_hits = 1;
   }
   /* record intersection */
-  kernel_embree_convert_local_hit(
-  kg, ray, hit, >ss_isect->hits[hit_idx], ctx->sss_object_id);
-  ctx->ss_isect->Ng[hit_idx].x = hit->Ng_x;
-  ctx->ss_isect->Ng[hit_idx].y = hit->Ng_y;
-  ctx->ss_isect->Ng[hit_idx].z = hit->Ng_z;
-  ctx->ss_isect->Ng[hit_idx] = normalize(ctx->ss_isect->Ng[hit_idx]);
+  ctx->local_isect->hits[hit_idx] = current_isect;
+  ctx->local_isect->Ng[hit_idx] = normalize(make_float3(hit->Ng_x, 
hit->Ng_y, hit->Ng_z));
   /* This tells Embree to continue tracing .*/
   *args->valid = 0;
   break;
diff --git a/intern/cycles/kernel/bvh/bvh.h b/intern/cycles/kernel/bvh/bvh.h
index 0346f5e09e7..8e17ab9af7a 100644
--- a/intern/cycles/kernel/bvh/bvh.h
+++ b/intern/cycles/kernel/bvh/bvh.h
@@ -329,24 +329,26 @@ ccl_device_intersect bool 
scene_intersect_local(KernelGlobals *kg,
 
 #ifdef __EMBREE__
   if (kernel_data.bvh.scene) {
-CCLIntersectContext ctx(kg, CCLIntersectContext::RAY_SSS);
+const bool has_bvh = !(kernel_tex_fetch(__object_flag, local_object) &
+   SD_OBJECT_TRANSFORM_APPLIED);
+CCLIntersectContext ctx(
+kg, has_bvh ? CCLIntersectContext::RAY_SSS : 
CCLIntersectContext::RAY_LOCAL);
 ctx.lcg_state = lcg_state;
 ctx.max_hits = max_hits;
-ctx.ss_isect = local_isect;
+ctx.local_isect = local_isect;
 local_isect->num_hits = 0;
-ctx.sss_object_id = local_object;
+ctx.local_object_id = local_object;
 IntersectContext rtc_ctx();
 RTCRay rtc_ray;
 

[Bf-blender-cvs] [9ebd64ec7e3] master: Merge branch 'blender-v2.82-release'

2020-01-16 Thread Philipp Oeser
Commit: 9ebd64ec7e3d25c1ae027b18f3b467d0156bddce
Author: Philipp Oeser
Date:   Thu Jan 16 20:34:44 2020 +0100
Branches: master
https://developer.blender.org/rB9ebd64ec7e3d25c1ae027b18f3b467d0156bddce

Merge branch 'blender-v2.82-release'

===



===



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


[Bf-blender-cvs] [b05bca23641] blender-v2.82-release: Fix (unreported) surface deform modifier not reporting its errors in the UI

2020-01-16 Thread Philipp Oeser
Commit: b05bca23641fc8760b1c340928654f23ea04c6f2
Author: Philipp Oeser
Date:   Fri Jan 3 22:10:15 2020 +0100
Branches: blender-v2.82-release
https://developer.blender.org/rBb05bca23641fc8760b1c340928654f23ea04c6f2

Fix (unreported) surface deform modifier not reporting its errors in the
UI

Seems like we need to set the error with the evaluated ModifierData.
Pass this to 'surfacedeformBind' and report with that.

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

===

M   source/blender/modifiers/intern/MOD_surfacedeform.c

===

diff --git a/source/blender/modifiers/intern/MOD_surfacedeform.c 
b/source/blender/modifiers/intern/MOD_surfacedeform.c
index de32b90a5e3..6ec7d1069de 100644
--- a/source/blender/modifiers/intern/MOD_surfacedeform.c
+++ b/source/blender/modifiers/intern/MOD_surfacedeform.c
@@ -979,7 +979,8 @@ static void bindVert(void *__restrict userdata,
   freeBindData(bwdata);
 }
 
-static bool surfacedeformBind(SurfaceDeformModifierData *smd,
+static bool surfacedeformBind(SurfaceDeformModifierData *smd_orig,
+  SurfaceDeformModifierData *smd_eval,
   float (*vertexCos)[3],
   uint numverts,
   uint tnumpoly,
@@ -999,38 +1000,38 @@ static bool surfacedeformBind(SurfaceDeformModifierData 
*smd,
 
   vert_edges = MEM_calloc_arrayN(tnumverts, sizeof(*vert_edges), 
"SDefVertEdgeMap");
   if (vert_edges == NULL) {
-modifier_setError((ModifierData *)smd, "Out of memory");
+modifier_setError((ModifierData *)smd_eval, "Out of memory");
 return false;
   }
 
   adj_array = MEM_malloc_arrayN(tnumedges, 2 * sizeof(*adj_array), 
"SDefVertEdge");
   if (adj_array == NULL) {
-modifier_setError((ModifierData *)smd, "Out of memory");
+modifier_setError((ModifierData *)smd_eval, "Out of memory");
 MEM_freeN(vert_edges);
 return false;
   }
 
   edge_polys = MEM_calloc_arrayN(tnumedges, sizeof(*edge_polys), 
"SDefEdgeFaceMap");
   if (edge_polys == NULL) {
-modifier_setError((ModifierData *)smd, "Out of memory");
+modifier_setError((ModifierData *)smd_eval, "Out of memory");
 MEM_freeN(vert_edges);
 MEM_freeN(adj_array);
 return false;
   }
 
-  smd->verts = MEM_malloc_arrayN(numverts, sizeof(*smd->verts), 
"SDefBindVerts");
-  if (smd->verts == NULL) {
-modifier_setError((ModifierData *)smd, "Out of memory");
+  smd_orig->verts = MEM_malloc_arrayN(numverts, sizeof(*smd_orig->verts), 
"SDefBindVerts");
+  if (smd_orig->verts == NULL) {
+modifier_setError((ModifierData *)smd_eval, "Out of memory");
 freeAdjacencyMap(vert_edges, adj_array, edge_polys);
 return false;
   }
 
   BKE_bvhtree_from_mesh_get(, target, BVHTREE_FROM_LOOPTRI, 2);
   if (treeData.tree == NULL) {
-modifier_setError((ModifierData *)smd, "Out of memory");
+modifier_setError((ModifierData *)smd_eval, "Out of memory");
 freeAdjacencyMap(vert_edges, adj_array, edge_polys);
-MEM_freeN(smd->verts);
-smd->verts = NULL;
+MEM_freeN(smd_orig->verts);
+smd_orig->verts = NULL;
 return false;
   }
 
@@ -1038,16 +1039,16 @@ static bool surfacedeformBind(SurfaceDeformModifierData 
*smd,
   mpoly, medge, mloop, tnumpoly, tnumedges, vert_edges, adj_array, 
edge_polys);
 
   if (adj_result == MOD_SDEF_BIND_RESULT_NONMANY_ERR) {
-modifier_setError((ModifierData *)smd, "Target has edges with more than 
two polygons");
+modifier_setError((ModifierData *)smd_eval, "Target has edges with more 
than two polygons");
 freeAdjacencyMap(vert_edges, adj_array, edge_polys);
 free_bvhtree_from_mesh();
-MEM_freeN(smd->verts);
-smd->verts = NULL;
+MEM_freeN(smd_orig->verts);
+smd_orig->verts = NULL;
 return false;
   }
 
-  smd->numverts = numverts;
-  smd->numpoly = tnumpoly;
+  smd_orig->numverts = numverts;
+  smd_orig->numpoly = tnumpoly;
 
   SDefBindCalcData data = {
   .treeData = ,
@@ -1058,22 +1059,22 @@ static bool surfacedeformBind(SurfaceDeformModifierData 
*smd,
   .mloop = mloop,
   .looptri = BKE_mesh_runtime_looptri_ensure(target),
   .targetCos = MEM_malloc_arrayN(tnumverts, sizeof(float[3]), 
"SDefTargetBindVertArray"),
-  .bind_verts = smd->verts,
+  .bind_verts = smd_orig->verts,
   .vertexCos = vertexCos,
-  .falloff = smd->falloff,
+  .falloff = smd_orig->falloff,
   .success = MOD_SDEF_BIND_RESULT_SUCCESS,
   };
 
   if (data.targetCos == NULL) {
-modifier_setError((ModifierData *)smd, "Out of memory");
-freeData((ModifierData *)smd);
+modifier_setError((ModifierData *)smd_eval, "Out of memory");
+freeData((ModifierData *)smd_orig);
 return false;
   }
 
-  invert_m4_m4(data.imat, smd->mat);
+  invert_m4_m4(data.imat, smd_orig->mat);
 
   for (int i = 0; i < tnumverts; i++) {
-

[Bf-blender-cvs] [f640704654e] vr_scene_inspection: Fix view stuck at center on session start without positional tracking

2020-01-16 Thread Julian Eisel
Commit: f640704654e335781f358d2d331dfd9f45a06c05
Author: Julian Eisel
Date:   Thu Jan 16 19:53:31 2020 +0100
Branches: vr_scene_inspection
https://developer.blender.org/rBf640704654e335781f358d2d331dfd9f45a06c05

Fix view stuck at center on session start without positional tracking

===

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

===

diff --git a/source/blender/windowmanager/intern/wm_xr.c 
b/source/blender/windowmanager/intern/wm_xr.c
index bced6717173..64c3f15b0a0 100644
--- a/source/blender/windowmanager/intern/wm_xr.c
+++ b/source/blender/windowmanager/intern/wm_xr.c
@@ -204,6 +204,10 @@ static bXrRuntimeSessionState 
*wm_xr_runtime_session_state_create(const Scene *s
 unit_qt(state->reference_pose.orientation_quat);
   }
 
+  /* Make sure the final reference pose is set, even if positional tracking is 
disabled on session
+   * start. */
+  copy_v3_v3(state->final_reference_pose.position, 
state->reference_pose.position);
+
   return state;
 }

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


[Bf-blender-cvs] [d72ffb5e9a4] blender-v2.82-release: Overlay: Fix wrong 3D icon for cubemap lightprobes

2020-01-16 Thread Clément Foucault
Commit: d72ffb5e9a40fc2a29e76c15103e57bffd32
Author: Clément Foucault
Date:   Thu Jan 16 19:47:13 2020 +0100
Branches: blender-v2.82-release
https://developer.blender.org/rBd72ffb5e9a40fc2a29e76c15103e57bffd32

Overlay: Fix wrong 3D icon for cubemap lightprobes

===

M   source/blender/draw/engines/overlay/overlay_extra.c
M   source/blender/draw/intern/draw_cache.c

===

diff --git a/source/blender/draw/engines/overlay/overlay_extra.c 
b/source/blender/draw/engines/overlay/overlay_extra.c
index 6f4fe5573ec..3b04e99b5b2 100644
--- a/source/blender/draw/engines/overlay/overlay_extra.c
+++ b/source/blender/draw/engines/overlay/overlay_extra.c
@@ -140,7 +140,7 @@ void OVERLAY_extra_cache_init(OVERLAY_Data *vedata)
   cb->light_point = BUF_INSTANCE(grp_sub, format, 
DRW_cache_light_point_lines_get());
   cb->light_spot = BUF_INSTANCE(grp_sub, format, 
DRW_cache_light_spot_lines_get());
   cb->light_sun = BUF_INSTANCE(grp_sub, format, 
DRW_cache_light_sun_lines_get());
-  cb->probe_cube = BUF_INSTANCE(grp_sub, format, 
DRW_cache_lightprobe_planar_get());
+  cb->probe_cube = BUF_INSTANCE(grp_sub, format, 
DRW_cache_lightprobe_cube_get());
   cb->probe_grid = BUF_INSTANCE(grp_sub, format, 
DRW_cache_lightprobe_grid_get());
   cb->probe_planar = BUF_INSTANCE(grp_sub, format, 
DRW_cache_lightprobe_planar_get());
   cb->solid_quad = BUF_INSTANCE(grp_sub, format, DRW_cache_quad_get());
@@ -707,7 +707,7 @@ void OVERLAY_lightprobe_cache_populate(OVERLAY_Data 
*vedata, Object *ob)
 case LIGHTPROBE_TYPE_CUBE:
   instdata.clip_sta = show_clipping ? prb->clipsta : -1.0;
   instdata.clip_end = show_clipping ? prb->clipend : -1.0;
-  DRW_buffer_add_entry(cb->probe_grid, color_p, );
+  DRW_buffer_add_entry(cb->probe_cube, color_p, );
   DRW_buffer_add_entry(cb->groundline, instdata.pos);
 
   if (show_influence) {
diff --git a/source/blender/draw/intern/draw_cache.c 
b/source/blender/draw/intern/draw_cache.c
index 69135f8ade3..4d10e781e79 100644
--- a/source/blender/draw/intern/draw_cache.c
+++ b/source/blender/draw/intern/draw_cache.c
@@ -1636,45 +1636,52 @@ GPUBatch *DRW_cache_speaker_get(void)
 GPUBatch *DRW_cache_lightprobe_cube_get(void)
 {
   if (!SHC.drw_lightprobe_cube) {
-int v_idx = 0;
+GPUVertFormat format = extra_vert_format();
+
+int v_len = (6 + 3 + (1 + 2 * DIAMOND_NSEGMENTS) * 6) * 2;
+GPUVertBuf *vbo = GPU_vertbuf_create_with_format();
+GPU_vertbuf_data_alloc(vbo, v_len);
+
+const float r = 14.0f;
+int v = 0;
+int flag = VCLASS_SCREENSPACE;
+/* Icon */
 const float sin_pi_3 = 0.86602540378f;
 const float cos_pi_3 = 0.5f;
-const float v[7][3] = {
-{0.0f, 1.0f, 0.0f},
-{sin_pi_3, cos_pi_3, 0.0f},
-{sin_pi_3, -cos_pi_3, 0.0f},
-{0.0f, -1.0f, 0.0f},
-{-sin_pi_3, -cos_pi_3, 0.0f},
-{-sin_pi_3, cos_pi_3, 0.0f},
-{0.0f, 0.0f, 0.0f},
+const float p[7][2] = {
+{0.0f, 1.0f},
+{sin_pi_3, cos_pi_3},
+{sin_pi_3, -cos_pi_3},
+{0.0f, -1.0f},
+{-sin_pi_3, -cos_pi_3},
+{-sin_pi_3, cos_pi_3},
+{0.0f, 0.0f},
 };
-
-/* Position Only 3D format */
-static GPUVertFormat format = {0};
-static struct {
-  uint pos;
-} attr_id;
-if (format.attr_len == 0) {
-  attr_id.pos = GPU_vertformat_attr_add(, "pos", GPU_COMP_F32, 3, 
GPU_FETCH_FLOAT);
+for (int i = 0; i < 6; i++) {
+  float t1[2], t2[2];
+  copy_v2_v2(t1, p[i]);
+  copy_v2_v2(t2, p[(i + 1) % 6]);
+  GPU_vertbuf_vert_set(vbo, v++, &(Vert){{t1[0] * r, t1[1] * r, 0.0f}, 
flag});
+  GPU_vertbuf_vert_set(vbo, v++, &(Vert){{t2[0] * r, t2[1] * r, 0.0f}, 
flag});
 }
-
-GPUVertBuf *vbo = GPU_vertbuf_create_with_format();
-GPU_vertbuf_data_alloc(vbo, (6 + 3) * 2);
-
+GPU_vertbuf_vert_set(vbo, v++, &(Vert){{p[1][0] * r, p[1][1] * r, 0.0f}, 
flag});
+GPU_vertbuf_vert_set(vbo, v++, &(Vert){{p[6][0] * r, p[6][1] * r, 0.0f}, 
flag});
+GPU_vertbuf_vert_set(vbo, v++, &(Vert){{p[5][0] * r, p[5][1] * r, 0.0f}, 
flag});
+GPU_vertbuf_vert_set(vbo, v++, &(Vert){{p[6][0] * r, p[6][1] * r, 0.0f}, 
flag});
+GPU_vertbuf_vert_set(vbo, v++, &(Vert){{p[3][0] * r, p[3][1] * r, 0.0f}, 
flag});
+GPU_vertbuf_vert_set(vbo, v++, &(Vert){{p[6][0] * r, p[6][1] * r, 0.0f}, 
flag});
+/* Direction Lines */
+flag = VCLASS_LIGHT_DIST | VCLASS_SCREENSPACE;
 for (int i = 0; i < 6; i++) {
-  GPU_vertbuf_attr_set(vbo, attr_id.pos, v_idx++, v[i]);
-  GPU_vertbuf_attr_set(vbo, attr_id.pos, v_idx++, v[(i + 1) % 6]);
+  char axes[] = "zZyYxX";
+  float zsta = light_distance_z_get(axes[i], true);
+  float zend = light_distance_z_get(axes[i], false);
+  GPU_vertbuf_vert_set(vbo, v++, &(Vert){{0.0f, 0.0f, zsta}, flag});
+  

[Bf-blender-cvs] [5d5add5de2b] blender-v2.82-release: Fix T69794 "Bake Cubemap Only" resets Irradiance Volume if world is updated

2020-01-16 Thread Clément Foucault
Commit: 5d5add5de2b384797851d5b9d964b2cf0e1410c7
Author: Clément Foucault
Date:   Thu Jan 16 19:45:08 2020 +0100
Branches: blender-v2.82-release
https://developer.blender.org/rB5d5add5de2b384797851d5b9d964b2cf0e1410c7

Fix T69794 "Bake Cubemap Only" resets Irradiance Volume if world is updated

Was caused by a clear done for when irradiance need to be baked.

===

M   source/blender/draw/engines/eevee/eevee_lightcache.c

===

diff --git a/source/blender/draw/engines/eevee/eevee_lightcache.c 
b/source/blender/draw/engines/eevee/eevee_lightcache.c
index 261b7f00e42..aa904036463 100644
--- a/source/blender/draw/engines/eevee/eevee_lightcache.c
+++ b/source/blender/draw/engines/eevee/eevee_lightcache.c
@@ -830,17 +830,19 @@ static void eevee_lightbake_render_world_sample(void 
*ved, void *user_data)
   EEVEE_lightbake_render_world(sldata, vedata, lbake->rt_fb);
   EEVEE_lightbake_filter_diffuse(sldata, vedata, lbake->rt_color, 
lbake->store_fb, 0, 1.0f);
 
-  /* Clear the cache to avoid white values in the grid. */
-  GPU_framebuffer_texture_attach(lbake->store_fb, lbake->grid_prev, 0, 0);
-  GPU_framebuffer_bind(lbake->store_fb);
-  /* Clear to 1.0f for visibility. */
-  GPU_framebuffer_clear_color(lbake->store_fb, ((float[4]){1.0f, 1.0f, 1.0f, 
1.0f}));
-  DRW_draw_pass(vedata->psl->probe_grid_fill);
+  if (lcache->flag & LIGHTCACHE_UPDATE_GRID) {
+/* Clear the cache to avoid white values in the grid. */
+GPU_framebuffer_texture_attach(lbake->store_fb, lbake->grid_prev, 0, 0);
+GPU_framebuffer_bind(lbake->store_fb);
+/* Clear to 1.0f for visibility. */
+GPU_framebuffer_clear_color(lbake->store_fb, ((float[4]){1.0f, 1.0f, 1.0f, 
1.0f}));
+DRW_draw_pass(vedata->psl->probe_grid_fill);
 
-  SWAP(GPUTexture *, lbake->grid_prev, lcache->grid_tx.tex);
+SWAP(GPUTexture *, lbake->grid_prev, lcache->grid_tx.tex);
 
-  /* Make a copy for later. */
-  eevee_lightbake_copy_irradiance(lbake, lcache);
+/* Make a copy for later. */
+eevee_lightbake_copy_irradiance(lbake, lcache);
+  }
 
   lcache->cube_len = 1;
   lcache->grid_len = lbake->grid_len;

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


[Bf-blender-cvs] [d42a7bbd6ea] master: Integrate hair collisions with cloth collision

2020-01-16 Thread Luca Rood
Commit: d42a7bbd6ea57c69293d3bf978aae2c0e4241b57
Author: Luca Rood
Date:   Thu Jan 16 18:45:23 2020 +0100
Branches: master
https://developer.blender.org/rBd42a7bbd6ea57c69293d3bf978aae2c0e4241b57

Integrate hair collisions with cloth collision

This integrates hair collisions with the new cloth collision system,
greatly improving reliability, and reducing the amount of hair-specific
code paths in the cloth code.

The removes all the point constraint based collision stuff, instead
implementing segment impulse based collisions, using the same collision
response code as the normal cloth solver.

The hair system can now also collide with the emitter if it is a
collision object.

Reviewed By: mano-wii, Sebastian Parborg

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

===

M   source/blender/blenkernel/BKE_cloth.h
M   source/blender/blenkernel/intern/cloth.c
M   source/blender/blenkernel/intern/collision.c
M   source/blender/physics/intern/BPH_mass_spring.cpp

===

diff --git a/source/blender/blenkernel/BKE_cloth.h 
b/source/blender/blenkernel/BKE_cloth.h
index 17de53be42a..2862dda8ead 100644
--- a/source/blender/blenkernel/BKE_cloth.h
+++ b/source/blender/blenkernel/BKE_cloth.h
@@ -74,11 +74,11 @@ typedef struct ClothSolverResult {
  * own connectivity of the mesh based on the actual edges in the mesh.
  */
 typedef struct Cloth {
-  struct ClothVertex *verts; /* The vertices that represent this cloth. */
-  struct LinkNode *springs;  /* The springs connecting the mesh. */
-  unsigned int numsprings;   /* The count of springs. */
-  unsigned int mvert_num;/* The number of verts == m * n. */
-  unsigned int tri_num;
+  struct ClothVertex *verts; /* The vertices that represent this cloth. */
+  struct LinkNode *springs;  /* The springs connecting the mesh. */
+  unsigned int numsprings;   /* The count of springs. */
+  unsigned int mvert_num;/* The number of verts == m * n. */
+  unsigned int primitive_num;/* Number of triangles for cloth and edges 
for hair. */
   unsigned char old_solver_type; /* unused, only 1 solver here */
   unsigned char pad2;
   short pad3;
@@ -89,6 +89,7 @@ typedef struct Cloth {
   struct EdgeSet *edgeset;/* used for selfcollisions */
   int last_frame;
   float initial_mesh_volume; /* Initial volume of the mesh. Used for pressure 
*/
+  struct MEdge *edges;   /* Used for hair collisions. */
 } Cloth;
 
 /**
@@ -265,15 +266,6 @@ int cloth_bvh_collision(struct Depsgraph *depsgraph,
 float step,
 float dt);
 
-void cloth_find_point_contacts(struct Depsgraph *depsgraph,
-   struct Object *ob,
-   struct ClothModifierData *clmd,
-   float step,
-   float dt,
-   ColliderContacts **r_collider_contacts,
-   int *r_totcolliders);
-void cloth_free_contacts(ColliderContacts *collider_contacts, int 
totcolliders);
-
 
 
 /
diff --git a/source/blender/blenkernel/intern/cloth.c 
b/source/blender/blenkernel/intern/cloth.c
index c26800aefba..7332c3e0d43 100644
--- a/source/blender/blenkernel/intern/cloth.c
+++ b/source/blender/blenkernel/intern/cloth.c
@@ -190,22 +190,36 @@ static BVHTree 
*bvhtree_build_from_cloth(ClothModifierData *clmd, float epsilon)
   vt = cloth->tri;
 
   /* in the moment, return zero if no faces there */
-  if (!cloth->tri_num) {
+  if (!cloth->primitive_num) {
 return NULL;
   }
 
   /* create quadtree with k=26 */
-  bvhtree = BLI_bvhtree_new(cloth->tri_num, epsilon, 4, 26);
+  bvhtree = BLI_bvhtree_new(cloth->primitive_num, epsilon, 4, 26);
 
   /* fill tree */
-  for (i = 0; i < cloth->tri_num; i++, vt++) {
-float co[3][3];
+  if (clmd->hairdata == NULL) {
+for (i = 0; i < cloth->primitive_num; i++, vt++) {
+  float co[3][3];
 
-copy_v3_v3(co[0], verts[vt->tri[0]].xold);
-copy_v3_v3(co[1], verts[vt->tri[1]].xold);
-copy_v3_v3(co[2], verts[vt->tri[2]].xold);
+  copy_v3_v3(co[0], verts[vt->tri[0]].xold);
+  copy_v3_v3(co[1], verts[vt->tri[1]].xold);
+  copy_v3_v3(co[2], verts[vt->tri[2]].xold);
 
-BLI_bvhtree_insert(bvhtree, i, co[0], 3);
+  BLI_bvhtree_insert(bvhtree, i, co[0], 3);
+}
+  }
+  else {
+MEdge *edges = cloth->edges;
+
+for (i = 0; i < cloth->primitive_num; i++) {
+  float co[2][3];
+
+  copy_v3_v3(co[0], verts[edges[i].v1].xold);
+  copy_v3_v3(co[1], verts[edges[i].v2].xold);
+
+  BLI_bvhtree_insert(bvhtree, i, co[0], 2);
+}
   }
 
   /* balance tree */
@@ -222,6 +236,8 @@ void bvhtree_update_from_cloth(ClothModifierData *clmd, 
bool moving, bool self)
   ClothVertex *verts = 

[Bf-blender-cvs] [7c2f0074f3f] blender-v2.82-release: Python: disable environment variables by default

2020-01-16 Thread Campbell Barton
Commit: 7c2f0074f3fe2411daa7a6e351d7cbc535246871
Author: Campbell Barton
Date:   Thu Jan 16 21:11:05 2020 +1100
Branches: blender-v2.82-release
https://developer.blender.org/rB7c2f0074f3fe2411daa7a6e351d7cbc535246871

Python: disable environment variables by default

This avoids the problem where Blender doesn't start because
the PYTHONPATH points to an incompatible Python version,
see T72807.

Previously we chose to assume people who set the PYTHONPATH know what
they're doing, however users may have set this for non Blender projects.
So it's not obvious that this is the cause of Blender not to launch
on their system.

To use Python's environment vars, pass the argument:
--python-use-system-env

Note that this only impacts Python run-time environment variables
documented in `python --help`, Access from `os.environ` remains.

===

M   source/blender/python/BPY_extern.h
M   source/blender/python/intern/bpy_interface.c
M   source/creator/creator_args.c

===

diff --git a/source/blender/python/BPY_extern.h 
b/source/blender/python/BPY_extern.h
index be2fd6c4e53..810c86c115a 100644
--- a/source/blender/python/BPY_extern.h
+++ b/source/blender/python/BPY_extern.h
@@ -51,6 +51,7 @@ int BPY_is_pyconstraint(struct Text *text);
 void BPY_python_start(int argc, const char **argv);
 void BPY_python_end(void);
 void BPY_python_reset(struct bContext *C);
+void BPY_python_use_system_env(void);
 
 /* global interpreter lock */
 
diff --git a/source/blender/python/intern/bpy_interface.c 
b/source/blender/python/intern/bpy_interface.c
index 9acf05abfe2..28afab1a6eb 100644
--- a/source/blender/python/intern/bpy_interface.c
+++ b/source/blender/python/intern/bpy_interface.c
@@ -84,6 +84,9 @@ CLG_LOGREF_DECLARE_GLOBAL(BPY_LOG_RNA, "bpy.rna");
  * stop bpy_context_clear from invalidating. */
 static int py_call_level = 0;
 
+/* Set by command line arguments before Python starts. */
+static bool py_use_system_env = false;
+
 // #define TIME_PY_RUN // simple python tests. prints on exit.
 
 #ifdef TIME_PY_RUN
@@ -276,6 +279,10 @@ void BPY_python_start(int argc, const char **argv)
* While harmless, it's noisy. */
   Py_FrozenFlag = 1;
 
+  /* Only use the systems environment variables when explicitly requested.
+   * Since an incorrect 'PYTHONPATH' causes difficult to debug errors, see: 
T72807. */
+  Py_IgnoreEnvironmentFlag = !py_use_system_env;
+
   Py_Initialize();
 
   // PySys_SetArgv(argc, argv);  /* broken in py3, not a huge deal */
@@ -408,6 +415,12 @@ void BPY_python_reset(bContext *C)
   BPY_modules_load_user(C);
 }
 
+void BPY_python_use_system_env(void)
+{
+  BLI_assert(!Py_IsInitialized());
+  py_use_system_env = true;
+}
+
 static void python_script_error_jump_text(struct Text *text)
 {
   int lineno;
diff --git a/source/creator/creator_args.c b/source/creator/creator_args.c
index 6e3988a5ea6..c7df4888c0d 100644
--- a/source/creator/creator_args.c
+++ b/source/creator/creator_args.c
@@ -559,6 +559,7 @@ static int arg_handle_print_help(int UNUSED(argc), const 
char **UNUSED(argv), vo
   BLI_argsPrintArgDoc(ba, "--python-expr");
   BLI_argsPrintArgDoc(ba, "--python-console");
   BLI_argsPrintArgDoc(ba, "--python-exit-code");
+  BLI_argsPrintArgDoc(ba, "--python-use-system-env");
   BLI_argsPrintArgDoc(ba, "--addons");
 
   printf("\n");
@@ -1907,6 +1908,17 @@ static int arg_handle_python_exit_code_set(int argc, 
const char **argv, void *UN
   }
 }
 
+static const char arg_handle_python_use_system_env_set_doc[] =
+"\n\t"
+"Allow Python to use system environment variables such as 'PYTHONPATH'.";
+static int arg_handle_python_use_system_env_set(int UNUSED(argc),
+const char **UNUSED(argv),
+void *UNUSED(data))
+{
+  BPY_python_use_system_env();
+  return 0;
+}
+
 static const char arg_handle_addons_set_doc[] =
 "\n"
 "\tComma separated list of add-ons (no spaces).";
@@ -2188,6 +2200,9 @@ void main_args_setup(bContext *C, bArgs *ba)
   ba, 1, NULL, "--env-system-scripts", CB_EX(arg_handle_env_system_set, 
scripts), NULL);
   BLI_argsAdd(ba, 1, NULL, "--env-system-python", 
CB_EX(arg_handle_env_system_set, python), NULL);
 
+  BLI_argsAdd(
+  ba, 1, NULL, "--python-use-system-env", 
CB(arg_handle_python_use_system_env_set), NULL);
+
   /* second pass: custom window stuff */
   BLI_argsAdd(ba, 2, "-p", "--window-geometry", 
CB(arg_handle_window_geometry), NULL);
   BLI_argsAdd(ba, 2, "-w", "--window-border", CB(arg_handle_with_borders), 
NULL);

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


[Bf-blender-cvs] [2cd3298fde4] master: Minor correction to previous commit

2020-01-16 Thread Julian Eisel
Commit: 2cd3298fde496b1632dac5cb7e9ff21d22e9bad3
Author: Julian Eisel
Date:   Thu Jan 16 17:31:09 2020 +0100
Branches: master
https://developer.blender.org/rB2cd3298fde496b1632dac5cb7e9ff21d22e9bad3

Minor correction to previous commit

===

M   source/blender/blenloader/intern/versioning_280.c

===

diff --git a/source/blender/blenloader/intern/versioning_280.c 
b/source/blender/blenloader/intern/versioning_280.c
index e746bbf1800..0754e59cb8a 100644
--- a/source/blender/blenloader/intern/versioning_280.c
+++ b/source/blender/blenloader/intern/versioning_280.c
@@ -2848,7 +2848,7 @@ void blo_do_versions_280(FileData *fd, Library 
*UNUSED(lib), Main *bmain)
* fine to always insert headers first. */
   BLI_assert(!do_versions_find_region_or_null(regionbase, 
RGN_TYPE_TOOL_HEADER));
 
-  ARegion *ar = do_versions_add_region(RGN_TYPE_HEADER, "footer 
for text");
+  ARegion *ar = do_versions_add_region(RGN_TYPE_HEADER, "header 
2.83.1 versioning");
   ar->alignment = (U.uiflag & USER_HEADER_BOTTOM) ? 
RGN_ALIGN_BOTTOM : RGN_ALIGN_TOP;
   BLI_addhead(regionbase, ar);
 }

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


[Bf-blender-cvs] [3cd1c8ccffe] master: Fix failing asserts in versioning with some pre 2.5 files

2020-01-16 Thread Julian Eisel
Commit: 3cd1c8ccffec516c6ecb6c048dc3aba07d3ad6e5
Author: Julian Eisel
Date:   Thu Jan 16 17:24:28 2020 +0100
Branches: master
https://developer.blender.org/rB3cd1c8ccffec516c6ecb6c048dc3aba07d3ad6e5

Fix failing asserts in versioning with some pre 2.5 files

Old pre 2.5 files may have had non active spaces stored that doen't have
a header. The 2.5 versioning only added headers for active spaces, not
inactive (so invisible) ones.
Newer versioning code assumed there to always be a header though.

Inserted a version patch to make sure there's always a header now.

Fixes error reported to Debian,
https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=949035.

===

M   source/blender/blenloader/intern/versioning_280.c

===

diff --git a/source/blender/blenloader/intern/versioning_280.c 
b/source/blender/blenloader/intern/versioning_280.c
index 6d4dd98729a..e746bbf1800 100644
--- a/source/blender/blenloader/intern/versioning_280.c
+++ b/source/blender/blenloader/intern/versioning_280.c
@@ -2828,6 +2828,35 @@ void blo_do_versions_280(FileData *fd, Library 
*UNUSED(lib), Main *bmain)
   }
 }
 
+/* Files stored pre 2.5 (possibly re-saved with newer versions) may have 
non-visible
+ * spaces without a header (visible/active ones are properly versioned).
+ * Multiple version patches below assume there's always a header though. 
So inserting this
+ * patch in-between older ones to add a header when needed.
+ *
+ * From here on it should be fine to assume there always is a header.
+ */
+if (!MAIN_VERSION_ATLEAST(bmain, 283, 1)) {
+  for (bScreen *screen = bmain->screens.first; screen; screen = 
screen->id.next) {
+for (ScrArea *sa = screen->areabase.first; sa; sa = sa->next) {
+  for (SpaceLink *sl = sa->spacedata.first; sl; sl = sl->next) {
+ListBase *regionbase = (sl == sa->spacedata.first) ? 
>regionbase : >regionbase;
+ARegion *ar_header = do_versions_find_region_or_null(regionbase, 
RGN_TYPE_HEADER);
+
+if (!ar_header) {
+  /* Headers should always be first in the region list, except if 
there's also a
+   * tool-header. These were only introduced in later versions 
though, so should be
+   * fine to always insert headers first. */
+  BLI_assert(!do_versions_find_region_or_null(regionbase, 
RGN_TYPE_TOOL_HEADER));
+
+  ARegion *ar = do_versions_add_region(RGN_TYPE_HEADER, "footer 
for text");
+  ar->alignment = (U.uiflag & USER_HEADER_BOTTOM) ? 
RGN_ALIGN_BOTTOM : RGN_ALIGN_TOP;
+  BLI_addhead(regionbase, ar);
+}
+  }
+}
+  }
+}
+
 for (bScreen *screen = bmain->screens.first; screen; screen = 
screen->id.next) {
   for (ScrArea *sa = screen->areabase.first; sa; sa = sa->next) {
 for (SpaceLink *sl = sa->spacedata.first; sl; sl = sl->next) {

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


[Bf-blender-cvs] [09122883b2a] master: Merge branch 'blender-v2.82-release'

2020-01-16 Thread Campbell Barton
Commit: 09122883b2a198351e4234546230cd03f6d89718
Author: Campbell Barton
Date:   Fri Jan 17 02:55:31 2020 +1100
Branches: master
https://developer.blender.org/rB09122883b2a198351e4234546230cd03f6d89718

Merge branch 'blender-v2.82-release'

===



===



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


[Bf-blender-cvs] [abdaf2a4f50] blender-v2.82-release: Fix T53704: Error scaling f-curve handles by -1

2020-01-16 Thread Campbell Barton
Commit: abdaf2a4f509f79bf2f0eb231341858045957573
Author: Campbell Barton
Date:   Fri Jan 17 02:31:05 2020 +1100
Branches: blender-v2.82-release
https://developer.blender.org/rBabdaf2a4f509f79bf2f0eb231341858045957573

Fix T53704: Error scaling f-curve handles by -1

The last handle wasn't corrected, also, there is no reason
to flip the handles while sorting (checking the same handles many times)
move this into it's own loop.

===

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

===

diff --git a/source/blender/blenkernel/intern/fcurve.c 
b/source/blender/blenkernel/intern/fcurve.c
index 3876033eaaa..08687ef8cee 100644
--- a/source/blender/blenkernel/intern/fcurve.c
+++ b/source/blender/blenkernel/intern/fcurve.c
@@ -1171,16 +1171,16 @@ void testhandles_fcurve(FCurve *fcu, eBezTriple_Flag 
sel_flag, const bool use_ha
  */
 void sort_time_fcurve(FCurve *fcu)
 {
-  bool ok = true;
 
   /* keep adjusting order of beztriples until nothing moves (bubble-sort) */
-  while (ok) {
-ok = 0;
+  if (fcu->bezt) {
+BezTriple *bezt;
+uint a;
 
-/* currently, will only be needed when there are beztriples */
-if (fcu->bezt) {
-  BezTriple *bezt;
-  unsigned int a;
+bool ok = true;
+while (ok) {
+  ok = 0;
+  /* currently, will only be needed when there are beztriples */
 
   /* loop over ALL points to adjust position in array and recalculate 
handles */
   for (a = 0, bezt = fcu->bezt; a < fcu->totvert; a++, bezt++) {
@@ -1191,20 +1191,22 @@ void sort_time_fcurve(FCurve *fcu)
 SWAP(BezTriple, *bezt, *(bezt + 1));
 ok = 1;
   }
-
-  /* if either one of both of the points exceeds crosses over the 
keyframe time... */
-  if ((bezt->vec[0][0] > bezt->vec[1][0]) && (bezt->vec[2][0] < 
bezt->vec[1][0])) {
-/* swap handles if they have switched sides for some reason */
-swap_v2_v2(bezt->vec[0], bezt->vec[2]);
-  }
-  else {
-/* clamp handles */
-CLAMP_MAX(bezt->vec[0][0], bezt->vec[1][0]);
-CLAMP_MIN(bezt->vec[2][0], bezt->vec[1][0]);
-  }
 }
   }
 }
+
+for (a = 0, bezt = fcu->bezt; a < fcu->totvert; a++, bezt++) {
+  /* if either one of both of the points exceeds crosses over the keyframe 
time... */
+  if ((bezt->vec[0][0] > bezt->vec[1][0]) && (bezt->vec[2][0] < 
bezt->vec[1][0])) {
+/* swap handles if they have switched sides for some reason */
+swap_v2_v2(bezt->vec[0], bezt->vec[2]);
+  }
+  else {
+/* clamp handles */
+CLAMP_MAX(bezt->vec[0][0], bezt->vec[1][0]);
+CLAMP_MIN(bezt->vec[2][0], bezt->vec[1][0]);
+  }
+}
   }
 }

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


[Bf-blender-cvs] [db338672707] blender-v2.82-release: Fix T71952, T70125: Blender Linux crash on startup with some tablets

2020-01-16 Thread Brecht Van Lommel
Commit: db338672707c32ad8fd4c85e4190bd2bc626a207
Author: Brecht Van Lommel
Date:   Thu Jan 16 16:03:11 2020 +0100
Branches: blender-v2.82-release
https://developer.blender.org/rBdb338672707c32ad8fd4c85e4190bd2bc626a207

Fix T71952, T70125: Blender Linux crash on startup with some tablets

It's not certain this fixes the issue since I can't reproduce the crash, but
the code was wrong in any case.

Thanks to Ray Molenkamp and Anonymous for finding this.

===

M   intern/ghost/intern/GHOST_SystemX11.cpp

===

diff --git a/intern/ghost/intern/GHOST_SystemX11.cpp 
b/intern/ghost/intern/GHOST_SystemX11.cpp
index 24a577a18c4..c50ff8e7426 100644
--- a/intern/ghost/intern/GHOST_SystemX11.cpp
+++ b/intern/ghost/intern/GHOST_SystemX11.cpp
@@ -2533,7 +2533,7 @@ void GHOST_SystemX11::refreshXInputDevices()
   XAnyClassPtr ici = device_info[i].inputclassinfo;
 
   if (ici != NULL) {
-for (int j = 0; j < xtablet.Device->num_classes; ++j) {
+for (int j = 0; j < device_info[i].num_classes; ++j) {
   if (ici->c_class == ValuatorClass) {
 XValuatorInfo *xvi = (XValuatorInfo *)ici;
 if (xvi->axes != NULL) {

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


[Bf-blender-cvs] [d52551401e1] master: Fix wrong usages of region align enumerations

2020-01-16 Thread Julian Eisel
Commit: d52551401e185a3e1092fb07edebd07d552e04e2
Author: Julian Eisel
Date:   Thu Jan 16 15:55:49 2020 +0100
Branches: master
https://developer.blender.org/rBd52551401e185a3e1092fb07edebd07d552e04e2

Fix wrong usages of region align enumerations

`ARegion.alignment` unfortunately is a mixture of value and bitflag
enumerations. When checking for left/right/top/bottom region alignment,
the flags have to be masked out usually.
Most of the fixed cases here probably didn't cause issues in practice,
but could in fact break at any point when surrounding logic changes.

In fact the assert in #region_visible_rect_calc() failed in an older
file from https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=949035. This
fixes it.

===

M   source/blender/editors/interface/interface_align.c
M   source/blender/editors/interface/interface_handlers.c
M   source/blender/editors/interface/interface_layout.c
M   source/blender/editors/interface/interface_panel.c
M   source/blender/editors/interface/interface_region_menu_popup.c
M   source/blender/editors/interface/interface_region_popover.c
M   source/blender/editors/screen/area.c
M   source/blender/editors/screen/area_query.c
M   source/blender/editors/screen/screen_ops.c
M   source/blender/editors/space_statusbar/space_statusbar.c
M   source/blender/editors/space_topbar/space_topbar.c
M   source/blender/windowmanager/intern/wm_draw.c

===

diff --git a/source/blender/editors/interface/interface_align.c 
b/source/blender/editors/interface/interface_align.c
index cc68e303e4a..c058fefb4fa 100644
--- a/source/blender/editors/interface/interface_align.c
+++ b/source/blender/editors/interface/interface_align.c
@@ -124,7 +124,7 @@ bool ui_but_can_align(const uiBut *but)
 
 int ui_but_align_opposite_to_area_align_get(const ARegion *ar)
 {
-  switch (ar->alignment) {
+  switch (RGN_ALIGN_ENUM_FROM_MASK(ar->alignment)) {
 case RGN_ALIGN_TOP:
   return UI_BUT_ALIGN_DOWN;
 case RGN_ALIGN_BOTTOM:
diff --git a/source/blender/editors/interface/interface_handlers.c 
b/source/blender/editors/interface/interface_handlers.c
index 05d5f03a363..16996681695 100644
--- a/source/blender/editors/interface/interface_handlers.c
+++ b/source/blender/editors/interface/interface_handlers.c
@@ -1886,11 +1886,13 @@ static bool ui_but_drag_init(bContext *C,
RGN_TYPE_HEADER,
RGN_TYPE_TOOL_HEADER,
RGN_TYPE_FOOTER)) {
+const int ar_alignment = 
RGN_ALIGN_ENUM_FROM_MASK(data->region->alignment);
 int lock_axis = -1;
-if (ELEM(data->region->alignment, RGN_ALIGN_LEFT, RGN_ALIGN_RIGHT)) {
+
+if (ELEM(ar_alignment, RGN_ALIGN_LEFT, RGN_ALIGN_RIGHT)) {
   lock_axis = 0;
 }
-else if (ELEM(data->region->alignment, RGN_ALIGN_TOP, 
RGN_ALIGN_BOTTOM)) {
+else if (ELEM(ar_alignment, RGN_ALIGN_TOP, RGN_ALIGN_BOTTOM)) {
   lock_axis = 1;
 }
 if (lock_axis != -1) {
diff --git a/source/blender/editors/interface/interface_layout.c 
b/source/blender/editors/interface/interface_layout.c
index 68cd450a451..179fe84264f 100644
--- a/source/blender/editors/interface/interface_layout.c
+++ b/source/blender/editors/interface/interface_layout.c
@@ -1241,17 +1241,19 @@ static void ui_item_menu_hold(struct bContext *C, 
ARegion *butregion, uiBut *but
 
   char direction = UI_DIR_DOWN;
   if (!but->drawstr[0]) {
-if (butregion->alignment == RGN_ALIGN_LEFT) {
-  direction = UI_DIR_RIGHT;
-}
-else if (butregion->alignment == RGN_ALIGN_RIGHT) {
-  direction = UI_DIR_LEFT;
-}
-else if (butregion->alignment == RGN_ALIGN_BOTTOM) {
-  direction = UI_DIR_UP;
-}
-else {
-  direction = UI_DIR_DOWN;
+switch (RGN_ALIGN_ENUM_FROM_MASK(butregion->alignment)) {
+  case RGN_ALIGN_LEFT:
+direction = UI_DIR_RIGHT;
+break;
+  case RGN_ALIGN_RIGHT:
+direction = UI_DIR_LEFT;
+break;
+  case RGN_ALIGN_BOTTOM:
+direction = UI_DIR_UP;
+break;
+  default:
+direction = UI_DIR_DOWN;
+break;
 }
   }
   UI_block_direction_set(block, direction);
diff --git a/source/blender/editors/interface/interface_panel.c 
b/source/blender/editors/interface/interface_panel.c
index 8adb82a22c8..3b21b689ba0 100644
--- a/source/blender/editors/interface/interface_panel.c
+++ b/source/blender/editors/interface/interface_panel.c
@@ -1065,7 +1065,7 @@ static bool uiAlignPanelStep(ScrArea *sa, ARegion *ar, 
const float fac, const bo
   ps->pa->ofsy = -get_panel_size_y(ps->pa);
 
   if (has_category_tabs) {
-if (align == BUT_VERTICAL && (ar->alignment != RGN_ALIGN_RIGHT)) {
+if (align == BUT_VERTICAL && (RGN_ALIGN_ENUM_FROM_MASK(ar->alignment) != 
RGN_ALIGN_RIGHT)) {
   ps->pa->ofsx += UI_PANEL_CATEGORY_MARGIN_WIDTH;
 }
   }
@@ 

[Bf-blender-cvs] [5b8c2301d8b] master: Merge branch 'blender-v2.82-release'

2020-01-16 Thread Bastien Montagne
Commit: 5b8c2301d8b7400013903fe0b02071ba19aafb9f
Author: Bastien Montagne
Date:   Thu Jan 16 16:08:17 2020 +0100
Branches: master
https://developer.blender.org/rB5b8c2301d8b7400013903fe0b02071ba19aafb9f

Merge branch 'blender-v2.82-release'

===



===



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


[Bf-blender-cvs] [d74f9c4b7b4] blender-v2.82-release: Fix T72887: Outliner crashes when after undo of some linking operation.

2020-01-16 Thread Bastien Montagne
Commit: d74f9c4b7b4f2b9b72462f908bdd7e251a42f478
Author: Bastien Montagne
Date:   Thu Jan 16 16:04:23 2020 +0100
Branches: blender-v2.82-release
https://developer.blender.org/rBd74f9c4b7b4f2b9b72462f908bdd7e251a42f478

Fix T72887: Outliner crashes when after undo of some linking operation.

Outliner tree building code was not handling properly empty libraries
(i.e. Lib datablocks in our bmain which have no used actual data
anymore).

Main issue here is unclean states of indirect hierarchies of linking
involving several libraries after undo operation.

This is not a critical issue though, just annoying and untidy.

===

M   source/blender/editors/space_outliner/outliner_tree.c

===

diff --git a/source/blender/editors/space_outliner/outliner_tree.c 
b/source/blender/editors/space_outliner/outliner_tree.c
index ed0d85477f1..1bb1a1c5964 100644
--- a/source/blender/editors/space_outliner/outliner_tree.c
+++ b/source/blender/editors/space_outliner/outliner_tree.c
@@ -1267,6 +1267,7 @@ static TreeElement *outliner_add_library_contents(Main 
*mainvar,
   for (a = 0; a < tot; a++) {
 if (lbarray[a] && lbarray[a]->first) {
   ID *id = lbarray[a]->first;
+  const bool is_library = (GS(id->name) == ID_LI) && (lib != NULL);
 
   /* check if there's data in current lib */
   for (; id; id = id->next) {
@@ -1275,7 +1276,9 @@ static TreeElement *outliner_add_library_contents(Main 
*mainvar,
 }
   }
 
-  if (id) {
+  /* We always want to create an entry for libraries, even if/when we have 
no more IDs from
+   * them. This invalid state is important to show to user as well.*/
+  if (id != NULL || is_library) {
 if (!tenlib) {
   /* Create library tree element on demand, depending if there are any 
data-blocks. */
   if (lib) {
@@ -1288,18 +1291,20 @@ static TreeElement *outliner_add_library_contents(Main 
*mainvar,
 }
 
 /* Create data-block list parent element on demand. */
-if (filter_id_type) {
-  ten = tenlib;
-}
-else {
-  ten = outliner_add_element(soops, >subtree, lbarray[a], 
NULL, TSE_ID_BASE, 0);
-  ten->directdata = lbarray[a];
-  ten->name = outliner_idcode_to_plural(GS(id->name));
-}
+if (id != NULL) {
+  if (filter_id_type) {
+ten = tenlib;
+  }
+  else {
+ten = outliner_add_element(soops, >subtree, lbarray[a], 
NULL, TSE_ID_BASE, 0);
+ten->directdata = lbarray[a];
+ten->name = outliner_idcode_to_plural(GS(id->name));
+  }
 
-for (id = lbarray[a]->first; id; id = id->next) {
-  if (outliner_library_id_show(lib, id, filter_id_type)) {
-outliner_add_element(soops, >subtree, id, ten, 0, 0);
+  for (id = lbarray[a]->first; id; id = id->next) {
+if (outliner_library_id_show(lib, id, filter_id_type)) {
+  outliner_add_element(soops, >subtree, id, ten, 0, 0);
+}
   }
 }
   }
@@ -2306,9 +2311,8 @@ void outliner_build_tree(
 
 for (lib = mainvar->libraries.first; lib; lib = lib->id.next) {
   ten = outliner_add_library_contents(mainvar, soops, >tree, lib);
-  if (ten) {
-lib->id.newid = (ID *)ten;
-  }
+  BLI_assert(ten != NULL);
+  lib->id.newid = (ID *)ten;
 }
 /* make hierarchy */
 ten = soops->tree.first;

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


[Bf-blender-cvs] [faf563d27ca] blender-v2.82-release: Fix T71788 Invalid (pink) shader when using wireframe node

2020-01-16 Thread Clément Foucault
Commit: faf563d27ca8aa5451be7f835f8f6798a00c1699
Author: Clément Foucault
Date:   Thu Jan 16 15:29:07 2020 +0100
Branches: blender-v2.82-release
https://developer.blender.org/rBfaf563d27ca8aa5451be7f835f8f6798a00c1699

Fix T71788 Invalid (pink) shader when using wireframe node

This was caused by the clip distance not being passed by the geometry
shader.

===

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

===

diff --git a/source/blender/gpu/intern/gpu_codegen.c 
b/source/blender/gpu/intern/gpu_codegen.c
index 1da7274b2cd..5a5c3ace552 100644
--- a/source/blender/gpu/intern/gpu_codegen.c
+++ b/source/blender/gpu/intern/gpu_codegen.c
@@ -1340,17 +1340,12 @@ static char *code_generate_geometry(ListBase *nodes, 
const char *geom_code, cons
   "barycentricPosg[2]);\n");
   }
 
-  BLI_dynstr_append(ds, "\tgl_Position = gl_in[0].gl_Position;\n");
-  BLI_dynstr_append(ds, "\tpass_attr(0);\n");
-  BLI_dynstr_append(ds, "\tEmitVertex();\n");
-
-  BLI_dynstr_append(ds, "\tgl_Position = gl_in[1].gl_Position;\n");
-  BLI_dynstr_append(ds, "\tpass_attr(1);\n");
-  BLI_dynstr_append(ds, "\tEmitVertex();\n");
-
-  BLI_dynstr_append(ds, "\tgl_Position = gl_in[2].gl_Position;\n");
-  BLI_dynstr_append(ds, "\tpass_attr(2);\n");
-  BLI_dynstr_append(ds, "\tEmitVertex();\n");
+  for (int i = 0; i < 3; i++) {
+BLI_dynstr_appendf(ds, "\tgl_Position = gl_in[%d].gl_Position;\n", i);
+BLI_dynstr_appendf(ds, "\tgl_ClipDistance[0] = 
gl_in[%d].gl_ClipDistance[0];\n", i);
+BLI_dynstr_appendf(ds, "\tpass_attr(%d);\n", i);
+BLI_dynstr_append(ds, "\tEmitVertex();\n");
+  }
   BLI_dynstr_append(ds, "}\n");
 }
   }

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


[Bf-blender-cvs] [32f0bb05230] blender-v2.82-release: Fix T70766 EEVEE: Performance drop with node tree in 2.81

2020-01-16 Thread Clément Foucault
Commit: 32f0bb052308a31313ba2abc15e59f5a5e668bbe
Author: Clément Foucault
Date:   Thu Jan 16 15:04:06 2020 +0100
Branches: blender-v2.82-release
https://developer.blender.org/rB32f0bb052308a31313ba2abc15e59f5a5e668bbe

Fix T70766 EEVEE: Performance drop with node tree in 2.81

===

M   source/blender/blenkernel/BKE_node.h
M   source/blender/blenkernel/intern/node.c
M   source/blender/nodes/shader/node_shader_tree.c

===

diff --git a/source/blender/blenkernel/BKE_node.h 
b/source/blender/blenkernel/BKE_node.h
index 11f151af44d..b599e1e1b2c 100644
--- a/source/blender/blenkernel/BKE_node.h
+++ b/source/blender/blenkernel/BKE_node.h
@@ -545,7 +545,8 @@ void nodeRemoveNode(struct Main *bmain,
 
 struct bNode *BKE_node_copy_ex(struct bNodeTree *ntree,
const struct bNode *node_src,
-   const int flag);
+   const int flag,
+   const bool unique_name);
 
 /* Same as BKE_node_copy_ex() but stores pointers to a new node and its 
sockets in the source
  * node.
diff --git a/source/blender/blenkernel/intern/node.c 
b/source/blender/blenkernel/intern/node.c
index 13169d9ace8..75e0d044c7c 100644
--- a/source/blender/blenkernel/intern/node.c
+++ b/source/blender/blenkernel/intern/node.c
@@ -1089,7 +1089,11 @@ static void node_socket_copy(bNodeSocket *sock_dst, 
const bNodeSocket *sock_src,
 
 /* keep socket listorder identical, for copying links */
 /* ntree is the target tree */
-bNode *BKE_node_copy_ex(bNodeTree *ntree, const bNode *node_src, const int 
flag)
+/* unique_name needs to be true. It's only disabled for speed when doing 
GPUnodetrees. */
+bNode *BKE_node_copy_ex(bNodeTree *ntree,
+const bNode *node_src,
+const int flag,
+const bool unique_name)
 {
   bNode *node_dst = MEM_callocN(sizeof(bNode), "dupli node");
   bNodeSocket *sock_dst, *sock_src;
@@ -1098,7 +1102,9 @@ bNode *BKE_node_copy_ex(bNodeTree *ntree, const bNode 
*node_src, const int flag)
   *node_dst = *node_src;
   /* can be called for nodes outside a node tree (e.g. clipboard) */
   if (ntree) {
-nodeUniqueName(ntree, node_dst);
+if (unique_name) {
+  nodeUniqueName(ntree, node_dst);
+}
 
 BLI_addtail(>nodes, node_dst);
   }
@@ -1186,7 +1192,7 @@ static void node_set_new_pointers(bNode *node_src, bNode 
*new_node)
 
 bNode *BKE_node_copy_store_new_pointers(bNodeTree *ntree, bNode *node_src, 
const int flag)
 {
-  bNode *new_node = BKE_node_copy_ex(ntree, node_src, flag);
+  bNode *new_node = BKE_node_copy_ex(ntree, node_src, flag, true);
   node_set_new_pointers(node_src, new_node);
   return new_node;
 }
@@ -1516,7 +1522,7 @@ void BKE_node_tree_copy_data(Main *UNUSED(bmain),
   GHash *new_pointers = BLI_ghash_ptr_new("BKE_node_tree_copy_data");
 
   for (const bNode *node_src = ntree_src->nodes.first; node_src; node_src = 
node_src->next) {
-bNode *new_node = BKE_node_copy_ex(ntree_dst, node_src, flag_subdata);
+bNode *new_node = BKE_node_copy_ex(ntree_dst, node_src, flag_subdata, 
true);
 BLI_ghash_insert(new_pointers, (void *)node_src, new_node);
 /* Store mapping to inputs. */
 bNodeSocket *new_input_sock = new_node->inputs.first;
diff --git a/source/blender/nodes/shader/node_shader_tree.c 
b/source/blender/nodes/shader/node_shader_tree.c
index ffeeb7525d5..dfbc49577e3 100644
--- a/source/blender/nodes/shader/node_shader_tree.c
+++ b/source/blender/nodes/shader/node_shader_tree.c
@@ -636,7 +636,7 @@ static bNode *ntree_shader_copy_branch(bNodeTree *ntree,
 if (node->tmp_flag >= 0) {
   int id = node->tmp_flag;
   nodes_copy[id] = BKE_node_copy_ex(
-  ntree, node, LIB_ID_CREATE_NO_USER_REFCOUNT | LIB_ID_CREATE_NO_MAIN);
+  ntree, node, LIB_ID_CREATE_NO_USER_REFCOUNT | LIB_ID_CREATE_NO_MAIN, 
false);
   nodes_copy[id]->tmp_flag = -2; /* Copy */
   /* Make sure to clear all sockets links as they are invalid. */
   LISTBASE_FOREACH (bNodeSocket *, sock, _copy[id]->inputs) {

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


[Bf-blender-cvs] [0461ff764af] blender-v2.82-release: Fix EEVEE: Planar Reflection data has inverted facing

2020-01-16 Thread Clément Foucault
Commit: 0461ff764afbaa58676b6711b2273ee2f9dcd647
Author: Clément Foucault
Date:   Thu Jan 16 15:42:59 2020 +0100
Branches: blender-v2.82-release
https://developer.blender.org/rB0461ff764afbaa58676b6711b2273ee2f9dcd647

Fix EEVEE: Planar Reflection data has inverted facing

Unreported bug

===

M   
source/blender/draw/engines/eevee/shaders/lightprobe_planar_display_vert.glsl

===

diff --git 
a/source/blender/draw/engines/eevee/shaders/lightprobe_planar_display_vert.glsl 
b/source/blender/draw/engines/eevee/shaders/lightprobe_planar_display_vert.glsl
index 540f2ac4728..65506e5c7b1 100644
--- 
a/source/blender/draw/engines/eevee/shaders/lightprobe_planar_display_vert.glsl
+++ 
b/source/blender/draw/engines/eevee/shaders/lightprobe_planar_display_vert.glsl
@@ -9,7 +9,7 @@ flat out int probeIdx;
 
 void main()
 {
-  gl_Position = ViewProjectionMatrix * probe_mat * vec4(pos, 1.0);
-  worldPosition = (probe_mat * vec4(pos, 1.0)).xyz;
+  worldPosition = (probe_mat * vec4(-pos.x, pos.y, 0.0, 1.0)).xyz;
+  gl_Position = ViewProjectionMatrix * vec4(worldPosition, 1.0);
   probeIdx = probe_id;
 }

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


[Bf-blender-cvs] [59d3e4357a9] master: Merge branch 'blender-v2.82-release'

2020-01-16 Thread Brecht Van Lommel
Commit: 59d3e4357a9054fd65be455198051634e4b40156
Author: Brecht Van Lommel
Date:   Thu Jan 16 15:52:53 2020 +0100
Branches: master
https://developer.blender.org/rB59d3e4357a9054fd65be455198051634e4b40156

Merge branch 'blender-v2.82-release'

===



===



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


[Bf-blender-cvs] [7fc7df1bd3d] master: CMake: Fix linking of ffmpeg_test on macOS

2020-01-16 Thread Sergey Sharybin
Commit: 7fc7df1bd3d81f7dd7440a958b420e356c2bf732
Author: Sergey Sharybin
Date:   Thu Jan 16 15:50:34 2020 +0100
Branches: master
https://developer.blender.org/rB7fc7df1bd3d81f7dd7440a958b420e356c2bf732

CMake: Fix linking of ffmpeg_test on macOS

Part of the issue was missing library path to png library.
Other part was missing iconv passed to linker.

===

M   tests/gtests/ffmpeg/CMakeLists.txt

===

diff --git a/tests/gtests/ffmpeg/CMakeLists.txt 
b/tests/gtests/ffmpeg/CMakeLists.txt
index 8eea5d6c57b..dbd4f9f1fed 100644
--- a/tests/gtests/ffmpeg/CMakeLists.txt
+++ b/tests/gtests/ffmpeg/CMakeLists.txt
@@ -21,7 +21,10 @@
 set(INC
   .
   ..
+
   ${FFMPEG_INCLUDE_DIRS}
+  ${PNG_INCLUDE_DIRS}
+  ${ZLIB_INCLUDE_DIRS}
 )
 
 set(LIB
@@ -34,6 +37,8 @@ if(WITH_IMAGE_OPENJPEG)
   set(LIB ${LIB} ${OPENJPEG_LIBRARIES})
 endif()
 
+setup_platform_linker_flags()
+link_directories(${FFMPEG_LIBPATH} ${PNG_LIBPATH} ${ZLIB_LIBPATH})
 include_directories(${INC})
 
 BLENDER_SRC_GTEST(ffmpeg "ffmpeg_codecs.cc" "${LIB}")

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


[Bf-blender-cvs] [216291ddb39] blender-v2.82-release: Fix T68000: load previous settings error if config folder already exists

2020-01-16 Thread Brecht Van Lommel
Commit: 216291ddb39e3460361b8bd7350878a30e34945b
Author: Brecht Van Lommel
Date:   Thu Jan 16 15:09:07 2020 +0100
Branches: blender-v2.82-release
https://developer.blender.org/rB216291ddb39e3460361b8bd7350878a30e34945b

Fix T68000: load previous settings error if config folder already exists

This happened when opening Blender and not clicking Load Previous Settings
or Next, and then reopening Blender again and using Load Previous Settings.

===

M   release/scripts/startup/bl_operators/userpref.py

===

diff --git a/release/scripts/startup/bl_operators/userpref.py 
b/release/scripts/startup/bl_operators/userpref.py
index 4c5c269955a..4cb6ddd3fa3 100644
--- a/release/scripts/startup/bl_operators/userpref.py
+++ b/release/scripts/startup/bl_operators/userpref.py
@@ -49,6 +49,44 @@ def module_filesystem_remove(path_base, module_name):
 else:
 os.remove(f_full)
 
+# This duplicates shutil.copytree from Python 3.8, with the new dirs_exist_ok
+# argument that we need. Once we upgrade to 3.8 we can remove this.
+def _preferences_copytree(entries, src, dst):
+import shutil
+import os
+os.makedirs(dst, exist_ok=True)
+errors = []
+
+for srcentry in entries:
+srcname = os.path.join(src, srcentry.name)
+dstname = os.path.join(dst, srcentry.name)
+srcobj = srcentry
+try:
+if srcentry.is_symlink():
+linkto = os.readlink(srcname)
+os.symlink(linkto, dstname)
+shutil.copystat(srcobj, dstname, follow_symlinks=False)
+elif srcentry.is_dir():
+preferences_copytree(srcobj, dstname)
+else:
+shutil.copy2(srcentry, dstname)
+except Error as err:
+errors.extend(err.args[0])
+except OSError as why:
+errors.append((srcname, dstname, str(why)))
+try:
+shutil.copystat(src, dst)
+except OSError as why:
+if getattr(why, 'winerror', None) is None:
+errors.append((src, dst, str(why)))
+if errors:
+raise Error(errors)
+return dst
+
+def preferences_copytree(src, dst):
+import os
+with os.scandir(src) as entries:
+return _preferences_copytree(entries=entries, src=src, dst=dst)
 
 class PREFERENCES_OT_keyconfig_activate(Operator):
 bl_idname = "preferences.keyconfig_activate"
@@ -110,9 +148,10 @@ class PREFERENCES_OT_copy_prev(Operator):
 return os.path.isfile(old_userpref) and not 
os.path.isfile(new_userpref)
 
 def execute(self, _context):
-import shutil
-
-shutil.copytree(self._old_path(), self._new_path(), symlinks=True)
+# Use this instead once we upgrade to Python 3.8 with dirs_exist_ok.
+# import shutil
+# shutil.copytree(self._old_path(), self._new_path(), 
dirs_exist_ok=True)
+preferences_copytree(self._old_path(), self._new_path())
 
 # reload preferences and recent-files.txt
 bpy.ops.wm.read_userpref()

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


[Bf-blender-cvs] [ca0dd753d36] temp-gpencil-eval: Fixes after first code review

2020-01-16 Thread Antonio Vazquez
Commit: ca0dd753d3665dd5d2a6f65ac8e3bbdba94e388d
Author: Antonio Vazquez
Date:   Thu Jan 16 15:49:19 2020 +0100
Branches: temp-gpencil-eval
https://developer.blender.org/rBca0dd753d3665dd5d2a6f65ac8e3bbdba94e388d

Fixes after first code review

===

M   source/blender/blenkernel/BKE_gpencil.h
M   source/blender/blenkernel/intern/gpencil.c
M   source/blender/blenkernel/intern/gpencil_modifier.c

===

diff --git a/source/blender/blenkernel/BKE_gpencil.h 
b/source/blender/blenkernel/BKE_gpencil.h
index fd3318b62c9..5efdc2ccace 100644
--- a/source/blender/blenkernel/BKE_gpencil.h
+++ b/source/blender/blenkernel/BKE_gpencil.h
@@ -327,8 +327,8 @@ extern void (*BKE_gpencil_batch_cache_free_cb)(struct 
bGPdata *gpd);
 #ifdef __cplusplus
 extern "C" {
 #endif
-void BKE_gpencil_update_frame_reference_pointers(const struct bGPDframe 
*gpf_orig,
- const struct bGPDframe 
*gpf_eval);
+void BKE_gpencil_frame_original_pointers_update(const struct bGPDframe 
*gpf_orig,
+const struct bGPDframe 
*gpf_eval);
 void BKE_gpencil_update_orig_pointers(const struct Object *ob_orig, const 
struct Object *ob_eval);
 void BKE_gpencil_prepare_filling_data(const struct Object *ob_orig, const 
struct Object *ob_eval);
 
diff --git a/source/blender/blenkernel/intern/gpencil.c 
b/source/blender/blenkernel/intern/gpencil.c
index 694d7bbdec5..2d40ef1ecb3 100644
--- a/source/blender/blenkernel/intern/gpencil.c
+++ b/source/blender/blenkernel/intern/gpencil.c
@@ -3864,8 +3864,8 @@ void BKE_gpencil_prepare_filling_data(const struct Object 
*ob_orig, const struct
   gpencil_prepare_filling(ob_eval);
 }
 
-void BKE_gpencil_update_frame_reference_pointers(const struct bGPDframe 
*gpf_orig,
- const struct bGPDframe 
*gpf_eval)
+void BKE_gpencil_frame_original_pointers_update(const struct bGPDframe 
*gpf_orig,
+const struct bGPDframe 
*gpf_eval)
 {
   int stroke_idx = -1;
   LISTBASE_FOREACH (bGPDstroke *, gps_orig, _orig->strokes) {
@@ -3894,7 +3894,7 @@ void BKE_gpencil_update_orig_pointers(const Object 
*ob_orig, const Object *ob_ev
   bGPdata *gpd_orig = (bGPdata *)ob_orig->data;
 
   /* Assign pointers to the original stroke and points to the evaluated data. 
This must
-   * be done before apply any modifier because at this moment the structure is 
equals,
+   * be done before applying any modifier because at this moment the structure 
is equals,
* so we can assume the layer index is the same in both datablocks.
* This data will be used by operators. */
 
@@ -3917,7 +3917,7 @@ void BKE_gpencil_update_orig_pointers(const Object 
*ob_orig, const Object *ob_ev
 
   /* Update frame reference pointers. */
   gpf_eval->runtime.gpf_orig = (bGPDframe *)gpf_orig;
-  BKE_gpencil_update_frame_reference_pointers(gpf_orig, gpf_eval);
+  BKE_gpencil_frame_original_pointers_update(gpf_orig, gpf_eval);
 }
   }
 }
diff --git a/source/blender/blenkernel/intern/gpencil_modifier.c 
b/source/blender/blenkernel/intern/gpencil_modifier.c
index 7f91b793be1..63f2efb919a 100644
--- a/source/blender/blenkernel/intern/gpencil_modifier.c
+++ b/source/blender/blenkernel/intern/gpencil_modifier.c
@@ -851,7 +851,7 @@ void BKE_gpencil_prepare_eval_data(Depsgraph *depsgraph, 
Scene *scene, Object *o
 
 ob->runtime.gpd_eval = BKE_gpencil_copy_for_eval(ob->runtime.gpd_orig, 
true);
 gpencil_assign_object_eval(ob);
-BKE_gpencil_update_orig_pointers((Object *)ob_orig, (Object *)ob);
+BKE_gpencil_update_orig_pointers(ob_orig, (Object *)ob);
   }
   else {
 /* Replace only active frame. */
@@ -918,7 +918,7 @@ void BKE_gpencil_prepare_eval_data(Depsgraph *depsgraph, 
Scene *scene, Object *o
   BKE_gpencil_frame_copy_strokes(gpf_orig, gpf_eval);
 
   gpf_eval->runtime.gpf_orig = (bGPDframe *)gpf_orig;
-  BKE_gpencil_update_frame_reference_pointers(gpf_orig, gpf_eval);
+  BKE_gpencil_frame_original_pointers_update(gpf_orig, gpf_eval);
 }
   }
 }

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


[Bf-blender-cvs] [d4261760c7e] blender-v2.82-release: Fluid: Fix for mesh velocities

2020-01-16 Thread Sebastián Barschkis
Commit: d4261760c7ea1095dd0be6f6a5196db711f916a9
Author: Sebastián Barschkis
Date:   Thu Jan 16 15:32:54 2020 +0100
Branches: blender-v2.82-release
https://developer.blender.org/rBd4261760c7ea1095dd0be6f6a5196db711f916a9

Fluid: Fix for mesh velocities

Was using incorrect file format when reading mesh velocities from cache

===

M   intern/mantaflow/intern/MANTA_main.cpp

===

diff --git a/intern/mantaflow/intern/MANTA_main.cpp 
b/intern/mantaflow/intern/MANTA_main.cpp
index 1980c11fe87..e44498bff84 100644
--- a/intern/mantaflow/intern/MANTA_main.cpp
+++ b/intern/mantaflow/intern/MANTA_main.cpp
@@ -1438,6 +1438,7 @@ int MANTA::readMesh(FluidModifierData *mmd, int framenr)
   targetFile[0] = '\0';
 
   std::string mformat = getCacheFileEnding(mmd->domain->cache_mesh_format);
+  std::string dformat = getCacheFileEnding(mmd->domain->cache_data_format);
 
   BLI_path_join(cacheDirMesh,
 sizeof(cacheDirMesh),
@@ -1463,7 +1464,7 @@ int MANTA::readMesh(FluidModifierData *mmd, int framenr)
 if (mUsingMVel) {
   ss.str("");
   ss << "liquid_load_meshvel_" << mCurrentID << "('" << 
escapeSlashes(cacheDirMesh) << "', "
- << framenr << ", '" << mformat << "')";
+ << framenr << ", '" << dformat << "')";
   pythonCommands.push_back(ss.str());
 }
   }

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


[Bf-blender-cvs] [de75be1eaaf] cycles_texture_cache: Merge branch 'master' into cycles_texture_cache

2020-01-16 Thread Stefan Werner
Commit: de75be1eaaf73959407ff1968484ba873bcc3ffd
Author: Stefan Werner
Date:   Thu Jan 16 15:16:24 2020 +0100
Branches: cycles_texture_cache
https://developer.blender.org/rBde75be1eaaf73959407ff1968484ba873bcc3ffd

Merge branch 'master' into cycles_texture_cache

===



===

diff --cc intern/cycles/blender/addon/properties.py
index a7aabf3ddbb,5f163c2510b..c94a7d66de4
--- a/intern/cycles/blender/addon/properties.py
+++ b/intern/cycles/blender/addon/properties.py
@@@ -705,81 -717,12 +717,87 @@@ class CyclesRenderSettings(bpy.types.Pr
  items=enum_texture_limit
  )
  
 +use_texture_cache: BoolProperty(
 +name="Use Texture Cache",
 +default=False,
 +description="Enables out-of-core texturing to conserve RAM"
 +)
 +
 +texture_cache_size: IntProperty(
 +name="Texture Cache Size (MB)",
 +default=1024,
 +description="The size of the OpenImageIO texture cache in MB",
 +min=0
 +)
 +
 +texture_auto_convert: BoolProperty(
 +name="Auto Convert Textures",
 +default=True,
 +description="Automatically convert textures to .tx files for optimal 
texture cache performance"
 +)
 +
 +texture_accept_unmipped: BoolProperty(
 +name="Accept Unmipped",
 +default=True,
 +description="Texture cached rendering without mip mapping is very 
expensive. Uncheck to prevent Cycles from using textures that are not mip 
mapped"
 +)
 +
 +texture_accept_untiled: BoolProperty(
 +name="Accept Untiled",
 +default=True,
 +description="Texture cached rendering without tiled textures is very 
expensive. Uncheck to prevent Cycles from using textures that are not tiled"
 +)
 +
 +texture_auto_tile: BoolProperty(
 +name="Auto Tile",
 +default=True,
 +description="On the fly creation of tiled versions of textures that 
are not tiled. This can increase render time but helps reduce memory usage"
 +)
 +
 +texture_auto_mip: BoolProperty(
 +name="Auto Mip",
 +default=True,
 +description="On the fly creation of mip maps of textures that are not 
mip mapped. This can increase render time but helps reduce memory usage"
 +)
 +
 +texture_tile_size: IntProperty(
 +name="Tile Size",
 +default=64,
 +description="The size of tiles that Cycles uses for auto tiling"
 +)
 +
 +texture_blur_diffuse: FloatProperty(
 +name="Diffuse Blur",
 +default=0.0156,
 +description="The amount of texture blur applied to diffuse bounces",
 +min = 0.0, max = 1.0
 +)
 +
 +texture_blur_glossy: FloatProperty(
 +name="Glossy Blur",
 +default=0.0,
 +description="The amount of texture blur applied to glossy bounces",
 +min = 0.0, max = 1.0
 +)
 +
 +use_custom_cache_path: BoolProperty(
 +name="Use Custom Cache Path",
 +default=False,
 +description="Use a custom path for the texture cache, as oppoosed to 
placing cache files next to the original file"
 +)
 +
 +custom_cache_path: StringProperty(
 +name="Custom Cache Path",
 +default="",
 +subtype="DIR_PATH",
 +description="Custom path for the texture cache"
 +)
+ ao_bounces: IntProperty(
+ name="AO Bounces",
+ default=0,
+ description="Approximate indirect light with background tinted 
ambient occlusion at the specified bounce, 0 disables this feature",
+ min=0, max=1024,
+ )
  
  ao_bounces_render: IntProperty(
  name="AO Bounces Render",
diff --cc intern/cycles/blender/blender_sync.cpp
index 8a191db628b,20dbe23cdb7..eabed4a89c6
--- a/intern/cycles/blender/blender_sync.cpp
+++ b/intern/cycles/blender/blender_sync.cpp
@@@ -714,27 -736,7 +735,28 @@@ SceneParams BlenderSync::get_scene_para
 
params.bvh_layout;
  #endif
  
 +  params.texture.use_cache = RNA_boolean_get(, "use_texture_cache");
 +  params.texture.cache_size = RNA_int_get(, "texture_cache_size");
 +  params.texture.auto_convert = RNA_boolean_get(, 
"texture_auto_convert");
 +  params.texture.accept_unmipped = RNA_boolean_get(, 
"texture_accept_unmipped");
 +  params.texture.accept_untiled = RNA_boolean_get(, 
"texture_accept_untiled");
 +  params.texture.tile_size = RNA_int_get(, "texture_tile_size");
 +  params.texture.auto_mip = RNA_boolean_get(, "texture_auto_mip");
 +  params.texture.auto_tile = RNA_boolean_get(, "texture_auto_tile");
 +  params.texture.diffuse_blur = RNA_float_get(, 
"texture_blur_diffuse");
 +  params.texture.glossy_blur = RNA_float_get(, "texture_blur_glossy");
 +  params.texture.use_custom_cache_path = RNA_boolean_get(, 
"use_custom_cache_path");
 +  if (params.texture.use_custom_cache_path) {
 +   

[Bf-blender-cvs] [59589457a56] blender-v2.82-release: Cleanup: Clarification of the `Particle.uv_on_emitter()` function docs

2020-01-16 Thread Sybren A. Stüvel
Commit: 59589457a56630e033748aa07579d8108f422d8d
Author: Sybren A. Stüvel
Date:   Thu Jan 16 14:54:55 2020 +0100
Branches: blender-v2.82-release
https://developer.blender.org/rB59589457a56630e033748aa07579d8108f422d8d

Cleanup: Clarification of the `Particle.uv_on_emitter()` function docs

Just some rewording of the documentation of `Particle.uv_on_emitter()`,
so that it no longer refers to 'derived mesh' but 'evaluated mesh', and
document that it expects a modifier from an evaluated object.

No functional changes.

===

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

===

diff --git a/source/blender/makesrna/intern/rna_particle.c 
b/source/blender/makesrna/intern/rna_particle.c
index 0ed9678ae06..d1cb7ad0604 100644
--- a/source/blender/makesrna/intern/rna_particle.c
+++ b/source/blender/makesrna/intern/rna_particle.c
@@ -1768,9 +1768,14 @@ static void rna_def_particle(BlenderRNA *brna)
 
   /* UVs */
   func = RNA_def_function(srna, "uv_on_emitter", "rna_Particle_uv_on_emitter");
-  RNA_def_function_ui_description(func, "Obtain uv for particle on derived 
mesh");
+  RNA_def_function_ui_description(func,
+  "Obtain UV coordinates for a particle on an 
evaluated mesh.");
   RNA_def_function_flag(func, FUNC_USE_REPORTS);
-  parm = RNA_def_pointer(func, "modifier", "ParticleSystemModifier", "", 
"Particle modifier");
+  parm = RNA_def_pointer(func,
+ "modifier",
+ "ParticleSystemModifier",
+ "",
+ "Particle modifier from an evaluated object");
   RNA_def_parameter_flags(parm, PROP_NEVER_NULL, PARM_REQUIRED);
   parm = RNA_def_property(func, "uv", PROP_FLOAT, PROP_COORDS);
   RNA_def_property_array(parm, 2);

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


[Bf-blender-cvs] [3c426feb127] blender-v2.82-release: Fix T73121: Blender crashes on accessing particle uv_on_emitter

2020-01-16 Thread Sybren A. Stüvel
Commit: 3c426feb127271994ad4de7178dc166831f30b00
Author: Sybren A. Stüvel
Date:   Thu Jan 16 14:52:01 2020 +0100
Branches: blender-v2.82-release
https://developer.blender.org/rB3c426feb127271994ad4de7178dc166831f30b00

Fix T73121: Blender crashes on accessing particle uv_on_emitter

Blender wasn't checking whether the passed modifier actually contained an
evaluated mesh, before accessing the mesh pointer.

===

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

===

diff --git a/source/blender/makesrna/intern/rna_particle.c 
b/source/blender/makesrna/intern/rna_particle.c
index 4da42eb6bba..0ed9678ae06 100644
--- a/source/blender/makesrna/intern/rna_particle.c
+++ b/source/blender/makesrna/intern/rna_particle.c
@@ -286,6 +286,11 @@ static void rna_Particle_uv_on_emitter(ParticleData 
*particle,
   psmd, part->from, pa->num, pa->num_dmcache, pa->fuv, pa->foffset, co, 
nor, 0, 0, sd.orco, 0);
 #  endif
 
+  if (modifier->mesh_final == NULL) {
+BKE_report(reports, RPT_ERROR, "uv_on_emitter() requires a modifier from 
an evaluated object");
+return;
+  }
+
   /* get uvco & mcol */
   int num = particle->num_dmcache;
   int from = modifier->psys->part->from;

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


[Bf-blender-cvs] [a26735ac91f] temp-gpencil-eval: Create duplication of material array for eval datablock

2020-01-16 Thread Antonio Vazquez
Commit: a26735ac91f586426ff69e5385fabda2a7c6a7c2
Author: Antonio Vazquez
Date:   Thu Jan 16 13:19:40 2020 +0100
Branches: temp-gpencil-eval
https://developer.blender.org/rBa26735ac91f586426ff69e5385fabda2a7c6a7c2

Create duplication of material array for eval datablock

If this copy is not done, when the datablock is cleared, the first datablock 
that use the material array, destroy the array, and in the second time the 
pointer is used, it's invalid.

Now, each datablock, uses its own material array.

===

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

===

diff --git a/source/blender/blenkernel/intern/gpencil_modifier.c 
b/source/blender/blenkernel/intern/gpencil_modifier.c
index 78ba52555de..7f91b793be1 100644
--- a/source/blender/blenkernel/intern/gpencil_modifier.c
+++ b/source/blender/blenkernel/intern/gpencil_modifier.c
@@ -863,9 +863,12 @@ void BKE_gpencil_prepare_eval_data(Depsgraph *depsgraph, 
Scene *scene, Object *o
   /* Copy all relevant data of the datablock. */
   ListBase layers = gpd_eval->layers;
   bGPdata_Runtime runtime = gpd_eval->runtime;
+  MEM_SAFE_FREE(gpd_eval->mat);
+
   memcpy(gpd_eval, gpd_orig, sizeof(bGPdata));
   gpd_eval->layers = layers;
   gpd_eval->runtime = runtime;
+  gpd_eval->mat = MEM_dupallocN(gpd_orig->mat);
 
   /* Assign. */
   ob->data = ob->runtime.gpd_eval;

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


[Bf-blender-cvs] [e7e454f964f] master: Merge branch 'blender-v2.82-release'

2020-01-16 Thread mano-wii
Commit: e7e454f964f9751dc6664b9e42aff9e87552d8de
Author: mano-wii
Date:   Thu Jan 16 09:16:46 2020 -0300
Branches: master
https://developer.blender.org/rBe7e454f964f9751dc6664b9e42aff9e87552d8de

Merge branch 'blender-v2.82-release'

===



===



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


[Bf-blender-cvs] [9a6551543b9] blender-v2.82-release: Fix crash with Proportional Edit Connected in UV editing

2020-01-16 Thread mano-wii
Commit: 9a6551543b92d54e7d565570988271e461104a89
Author: mano-wii
Date:   Thu Jan 16 09:14:27 2020 -0300
Branches: blender-v2.82-release
https://developer.blender.org/rB9a6551543b92d54e7d565570988271e461104a89

Fix crash with Proportional Edit Connected in UV editing

Caused by rB86a2ffc3ab32

===

M   source/blender/editors/transform/transform_convert_mesh.c

===

diff --git a/source/blender/editors/transform/transform_convert_mesh.c 
b/source/blender/editors/transform/transform_convert_mesh.c
index 006f913f218..5d3d1d936a2 100644
--- a/source/blender/editors/transform/transform_convert_mesh.c
+++ b/source/blender/editors/transform/transform_convert_mesh.c
@@ -1451,7 +1451,8 @@ void createTransUVs(bContext *C, TransInfo *t)
 if (is_prop_connected || is_island_center) {
   /* create element map with island information */
   const bool use_facesel = (ts->uv_flag & UV_SYNC_SELECTION) == 0;
-  elementmap = BM_uv_element_map_create(em->bm, scene, use_facesel, true, 
false, true);
+  const bool use_uvsel = !is_prop_connected;
+  elementmap = BM_uv_element_map_create(em->bm, scene, use_facesel, 
use_uvsel, false, true);
   if (elementmap == NULL) {
 continue;
   }
@@ -1547,16 +1548,17 @@ void createTransUVs(bContext *C, TransInfo *t)
 
 if (is_prop_connected || is_island_center) {
   UvElement *element = BM_uv_element_get(elementmap, efa, l);
-
-  if (is_prop_connected) {
-if (!BLI_BITMAP_TEST(island_enabled, element->island)) {
-  count_rejected++;
-  continue;
+  if (element) {
+if (is_prop_connected) {
+  if (!BLI_BITMAP_TEST(island_enabled, element->island)) {
+count_rejected++;
+continue;
+  }
 }
-  }
 
-  if (is_island_center) {
-center = island_center[element->island].co;
+if (is_island_center) {
+  center = island_center[element->island].co;
+}
   }
 }

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


[Bf-blender-cvs] [003be8aa7c6] master: UI: Use same precision in "Move" redo panel as elsewhere

2020-01-16 Thread Julian Eisel
Commit: 003be8aa7c6d837d43bdadb99f60cd5f6dca72bd
Author: Julian Eisel
Date:   Thu Jan 16 12:08:17 2020 +0100
Branches: master
https://developer.blender.org/rB003be8aa7c6d837d43bdadb99f60cd5f6dca72bd

UI: Use same precision in "Move" redo panel as elsewhere

The floating "Move" redo panel showed transform values with less
precision than in other places (e.g. sidebar and properties editor).
With Millimeters as unit it would even round to full integers, which
may be an issue since you typically work at higher precisions with this
unit.

Note that this only applies to the visual precision, internally we use
full floating point `float`s still.

Fixes T70367.

===

M   source/blender/editors/transform/transform_ops.c
M   source/blender/makesrna/RNA_define.h
M   source/blender/makesrna/intern/rna_define.c

===

diff --git a/source/blender/editors/transform/transform_ops.c 
b/source/blender/editors/transform/transform_ops.c
index b2d8671fbce..09992e8be0e 100644
--- a/source/blender/editors/transform/transform_ops.c
+++ b/source/blender/editors/transform/transform_ops.c
@@ -720,7 +720,7 @@ static void TRANSFORM_OT_translate(struct wmOperatorType 
*ot)
   ot->poll = ED_operator_screenactive;
   ot->poll_property = transform_poll_property;
 
-  RNA_def_float_vector_xyz(
+  RNA_def_float_translation(
   ot->srna, "value", 3, NULL, -FLT_MAX, FLT_MAX, "Move", "", -FLT_MAX, 
FLT_MAX);
 
   WM_operatortype_props_advanced_begin(ot);
diff --git a/source/blender/makesrna/RNA_define.h 
b/source/blender/makesrna/RNA_define.h
index 0beb14614ec..349b30fa64e 100644
--- a/source/blender/makesrna/RNA_define.h
+++ b/source/blender/makesrna/RNA_define.h
@@ -233,6 +233,16 @@ PropertyRNA *RNA_def_float_matrix(StructOrFunctionRNA 
*cont,
   const char *ui_description,
   float softmin,
   float softmax);
+PropertyRNA *RNA_def_float_translation(StructOrFunctionRNA *cont,
+   const char *identifier,
+   int len,
+   const float *default_value,
+   float hardmin,
+   float hardmax,
+   const char *ui_name,
+   const char *ui_description,
+   float softmin,
+   float softmax);
 PropertyRNA *RNA_def_float_rotation(StructOrFunctionRNA *cont,
 const char *identifier,
 int len,
diff --git a/source/blender/makesrna/intern/rna_define.c 
b/source/blender/makesrna/intern/rna_define.c
index 55aa529a30e..73a59cbba11 100644
--- a/source/blender/makesrna/intern/rna_define.c
+++ b/source/blender/makesrna/intern/rna_define.c
@@ -3888,6 +3888,36 @@ PropertyRNA *RNA_def_float_matrix(StructOrFunctionRNA 
*cont_,
   return prop;
 }
 
+PropertyRNA *RNA_def_float_translation(StructOrFunctionRNA *cont_,
+   const char *identifier,
+   int len,
+   const float *default_value,
+   float hardmin,
+   float hardmax,
+   const char *ui_name,
+   const char *ui_description,
+   float softmin,
+   float softmax)
+{
+  PropertyRNA *prop;
+
+  prop = RNA_def_float_vector(cont_,
+  identifier,
+  len,
+  default_value,
+  hardmin,
+  hardmax,
+  ui_name,
+  ui_description,
+  softmin,
+  softmax);
+  prop->subtype = PROP_TRANSLATION;
+
+  RNA_def_property_ui_range(prop, softmin, softmax, 1, 
RNA_TRANSLATION_PREC_DEFAULT);
+
+  return prop;
+}
+
 PropertyRNA *RNA_def_float_rotation(StructOrFunctionRNA *cont_,
 const char *identifier,
 int len,

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


[Bf-blender-cvs] [25cb12dc71e] master: UI: Show animation cancel button in all status-bars

2020-01-16 Thread Julian Eisel
Commit: 25cb12dc71e83a331d31568f33ecd6315c5605fa
Author: Julian Eisel
Date:   Thu Jan 16 11:53:45 2020 +0100
Branches: master
https://developer.blender.org/rB25cb12dc71e83a331d31568f33ecd6315c5605fa

UI: Show animation cancel button in all status-bars

Previously the button would only show up in the status-bar located in
the same window that had the screen with the animation timer.
I don't see a reason not to show the button in all status-bars instead,
other animation feedback is also displayed in all windows.

Fixes T72194.

===

M   source/blender/editors/interface/interface_templates.c

===

diff --git a/source/blender/editors/interface/interface_templates.c 
b/source/blender/editors/interface/interface_templates.c
index 0880da91005..f0e15e16e91 100644
--- a/source/blender/editors/interface/interface_templates.c
+++ b/source/blender/editors/interface/interface_templates.c
@@ -6863,7 +6863,6 @@ static char *progress_tooltip_func(bContext *UNUSED(C), 
void *argN, const char *
 
 void uiTemplateRunningJobs(uiLayout *layout, bContext *C)
 {
-  bScreen *screen = CTX_wm_screen(C);
   wmWindowManager *wm = CTX_wm_manager(C);
   ScrArea *sa = CTX_wm_area(C);
   uiBlock *block;
@@ -7045,7 +7044,7 @@ void uiTemplateRunningJobs(uiLayout *layout, bContext *C)
 }
   }
 
-  if (screen->animtimer) {
+  if (ED_screen_animation_playing(wm)) {
 uiDefIconTextBut(block,
  UI_BTYPE_BUT,
  B_STOPANIM,

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


[Bf-blender-cvs] [dd4d27e907c] master: Merge branch 'blender-v2.82-release'

2020-01-16 Thread Bastien Montagne
Commit: dd4d27e907c72e8066bf122e3e493f42c09b215e
Author: Bastien Montagne
Date:   Thu Jan 16 11:36:20 2020 +0100
Branches: master
https://developer.blender.org/rBdd4d27e907c72e8066bf122e3e493f42c09b215e

Merge branch 'blender-v2.82-release'

===



===



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


[Bf-blender-cvs] [3ee6d74f933] blender-v2.82-release: Fix T73125: Crash when opening a file containing a Line Style.

2020-01-16 Thread Bastien Montagne
Commit: 3ee6d74f933aa5779ffe8a4da348f07a23cc034e
Author: Bastien Montagne
Date:   Thu Jan 16 11:35:10 2020 +0100
Branches: blender-v2.82-release
https://developer.blender.org/rB3ee6d74f933aa5779ffe8a4da348f07a23cc034e

Fix T73125: Crash when opening a file containing a Line Style.

Dummy typo in rB2e6159a4.

===

M   source/blender/blenloader/intern/versioning_280.c

===

diff --git a/source/blender/blenloader/intern/versioning_280.c 
b/source/blender/blenloader/intern/versioning_280.c
index d696aef76d4..6d4dd98729a 100644
--- a/source/blender/blenloader/intern/versioning_280.c
+++ b/source/blender/blenloader/intern/versioning_280.c
@@ -1034,7 +1034,7 @@ static void do_version_curvemapping_walker(Main *bmain, 
void (*callback)(CurveMa
 
   /* Free Style */
   LISTBASE_FOREACH (struct FreestyleLineStyle *, linestyle, 
>linestyles) {
-LISTBASE_FOREACH (LineStyleModifier *, m, >thickness_modifiers) 
{
+LISTBASE_FOREACH (LineStyleModifier *, m, >alpha_modifiers) {
   switch (m->type) {
 case LS_MODIFIER_ALONG_STROKE:
   callback(((LineStyleAlphaModifier_AlongStroke *)m)->curve);

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


[Bf-blender-cvs] [2dfeb25c54d] master: Cleanup: remove unused PYTHONPATH from freestyle

2020-01-16 Thread Campbell Barton
Commit: 2dfeb25c54d1e3aa346393f016d0e16dfea52199
Author: Campbell Barton
Date:   Thu Jan 16 21:04:09 2020 +1100
Branches: master
https://developer.blender.org/rB2dfeb25c54d1e3aa346393f016d0e16dfea52199

Cleanup: remove unused PYTHONPATH from freestyle

This accesses PYTHONPATH directly, ignoring Py_IgnoreEnvironmentFlag.
Remove since it's not used.

===

M   source/blender/freestyle/intern/application/AppConfig.cpp
M   source/blender/freestyle/intern/application/AppConfig.h

===

diff --git a/source/blender/freestyle/intern/application/AppConfig.cpp 
b/source/blender/freestyle/intern/application/AppConfig.cpp
index 3e3a939a8fe..a2f0a3395af 100644
--- a/source/blender/freestyle/intern/application/AppConfig.cpp
+++ b/source/blender/freestyle/intern/application/AppConfig.cpp
@@ -53,10 +53,6 @@ void Path::setRootDir(const string )
   string(DIR_SEP.c_str());
   _BrushesPath = _ProjectDir + string(DIR_SEP.c_str()) + "data" + 
string(DIR_SEP.c_str()) +
  "textures" + string(DIR_SEP.c_str()) + "brushes" + 
string(DIR_SEP.c_str());
-  _PythonPath = _ProjectDir + string(DIR_SEP.c_str()) + "modules" + 
string(DIR_SEP.c_str());
-  if (getenv("PYTHONPATH")) {
-_PythonPath += string(PATH_SEP.c_str()) + string(getenv("PYTHONPATH"));
-  }
   _EnvMapDir = _ProjectDir + string(DIR_SEP.c_str()) + "data" + 
string(DIR_SEP.c_str()) +
"env_map" + string(DIR_SEP.c_str());
   _MapsDir = _ProjectDir + string(DIR_SEP.c_str()) + "data" + 
string(DIR_SEP.c_str()) + "maps" +
diff --git a/source/blender/freestyle/intern/application/AppConfig.h 
b/source/blender/freestyle/intern/application/AppConfig.h
index cc2a3962ecd..9369ed81d50 100644
--- a/source/blender/freestyle/intern/application/AppConfig.h
+++ b/source/blender/freestyle/intern/application/AppConfig.h
@@ -43,7 +43,6 @@ class Path {
   string _ModelsPath;
   string _PatternsPath;
   string _BrushesPath;
-  string _PythonPath;
   string _EnvMapDir;
   string _MapsDir;
   string _HomeDir;
@@ -72,10 +71,6 @@ class Path {
   {
 return _BrushesPath;
   }
-  const string () const
-  {
-return _PythonPath;
-  }
   const string () const
   {
 return _EnvMapDir;

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


[Bf-blender-cvs] [bd72aa89841] temp-gpencil-eval: Cleanup: More use of LISTBASE_FOREACH

2020-01-16 Thread Antonio Vazquez
Commit: bd72aa89841928e67c5ef29a6d25f655724fa402
Author: Antonio Vazquez
Date:   Thu Jan 16 10:32:03 2020 +0100
Branches: temp-gpencil-eval
https://developer.blender.org/rBbd72aa89841928e67c5ef29a6d25f655724fa402

Cleanup: More use of LISTBASE_FOREACH

===

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

===

diff --git a/source/blender/blenkernel/intern/gpencil.c 
b/source/blender/blenkernel/intern/gpencil.c
index 0b76d8cf23c..694d7bbdec5 100644
--- a/source/blender/blenkernel/intern/gpencil.c
+++ b/source/blender/blenkernel/intern/gpencil.c
@@ -3868,7 +3868,7 @@ void BKE_gpencil_update_frame_reference_pointers(const 
struct bGPDframe *gpf_ori
  const struct bGPDframe 
*gpf_eval)
 {
   int stroke_idx = -1;
-  for (bGPDstroke *gps_orig = gpf_orig->strokes.first; gps_orig; gps_orig = 
gps_orig->next) {
+  LISTBASE_FOREACH (bGPDstroke *, gps_orig, _orig->strokes) {
 stroke_idx++;
 
 /* Assign original stroke pointer. */
@@ -3899,7 +3899,7 @@ void BKE_gpencil_update_orig_pointers(const Object 
*ob_orig, const Object *ob_ev
* This data will be used by operators. */
 
   int layer_idx = -1;
-  for (bGPDlayer *gpl = gpd_orig->layers.first; gpl; gpl = gpl->next) {
+  LISTBASE_FOREACH (bGPDlayer *, gpl, _orig->layers) {
 layer_idx++;
 /* Retry evaluated layer. */
 bGPDlayer *gpl_eval = BLI_findlink(_eval->layers, layer_idx);
@@ -3907,7 +3907,7 @@ void BKE_gpencil_update_orig_pointers(const Object 
*ob_orig, const Object *ob_ev
   continue;
 }
 int frame_idx = -1;
-for (bGPDframe *gpf_orig = gpl->frames.first; gpf_orig; gpf_orig = 
gpf_orig->next) {
+LISTBASE_FOREACH (bGPDframe *, gpf_orig, >frames) {
   frame_idx++;
   /* Retry evaluated frame. */
   bGPDframe *gpf_eval = BLI_findlink(_eval->frames, frame_idx);

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


[Bf-blender-cvs] [3edadc47bf3] temp-gpencil-eval: Cleanup: Use LISTBASE_FOREACH

2020-01-16 Thread Antonio Vazquez
Commit: 3edadc47bf3247ac7f50075762c1f14a4f6bc26f
Author: Antonio Vazquez
Date:   Thu Jan 16 10:24:43 2020 +0100
Branches: temp-gpencil-eval
https://developer.blender.org/rB3edadc47bf3247ac7f50075762c1f14a4f6bc26f

Cleanup: Use LISTBASE_FOREACH

===

M   source/blender/blenkernel/intern/gpencil.c
M   source/blender/blenkernel/intern/gpencil_modifier.c

===

diff --git a/source/blender/blenkernel/intern/gpencil.c 
b/source/blender/blenkernel/intern/gpencil.c
index 6cb8e13813e..0b76d8cf23c 100644
--- a/source/blender/blenkernel/intern/gpencil.c
+++ b/source/blender/blenkernel/intern/gpencil.c
@@ -3842,9 +3842,9 @@ void BKE_gpencil_visible_stroke_iter(
 static void gpencil_prepare_filling(const Object *ob)
 {
   bGPdata *gpd = (bGPdata *)ob->data;
-  for (bGPDlayer *gpl = gpd->layers.first; gpl; gpl = gpl->next) {
-for (bGPDframe *gpf = gpl->frames.first; gpf; gpf = gpf->next) {
-  for (bGPDstroke *gps = gpf->strokes.first; gps; gps = gps->next) {
+  LISTBASE_FOREACH (bGPDlayer *, gpl, >layers) {
+LISTBASE_FOREACH (bGPDframe *, gpf, >frames) {
+  LISTBASE_FOREACH (bGPDstroke *, gps, >strokes) {
 MaterialGPencilStyle *gp_style = 
BKE_material_gpencil_settings_get((Object *)ob,

gps->mat_nr + 1);
 if (gp_style) {
diff --git a/source/blender/blenkernel/intern/gpencil_modifier.c 
b/source/blender/blenkernel/intern/gpencil_modifier.c
index 3991f4b0747..78ba52555de 100644
--- a/source/blender/blenkernel/intern/gpencil_modifier.c
+++ b/source/blender/blenkernel/intern/gpencil_modifier.c
@@ -871,7 +871,7 @@ void BKE_gpencil_prepare_eval_data(Depsgraph *depsgraph, 
Scene *scene, Object *o
   ob->data = ob->runtime.gpd_eval;
 
   int layer_index = -1;
-  for (bGPDlayer *gpl_orig = gpd_orig->layers.first; gpl_orig; gpl_orig = 
gpl_orig->next) {
+  LISTBASE_FOREACH (bGPDlayer *, gpl_orig, _orig->layers) {
 layer_index++;
 
 int remap_cfra = gpencil_remap_time_get(depsgraph, scene, ob, 
gpl_orig);
@@ -938,7 +938,7 @@ void BKE_gpencil_modifiers_calc(Depsgraph *depsgraph, Scene 
*scene, Object *ob)
   BKE_gpencil_lattice_init(ob);
 
   /* Loop all layers and apply modifiers. */
-  for (bGPDlayer *gpl = gpd->layers.first; gpl; gpl = gpl->next) {
+  LISTBASE_FOREACH (bGPDlayer *, gpl, >layers) {
 /* Remap frame (Time modifier) */
 int remap_cfra = gpencil_remap_time_get(depsgraph, scene, ob, gpl);
 bGPDframe *gpf = BKE_gpencil_layer_frame_get(gpl, remap_cfra, 
GP_GETFRAME_USE_PREV);
@@ -953,7 +953,7 @@ void BKE_gpencil_modifiers_calc(Depsgraph *depsgraph, Scene 
*scene, Object *ob)
 }
 
 /* Apply deform modifiers (only change geometry). */
-for (bGPDstroke *gps = gpf->strokes.first; gps; gps = gps->next) {
+LISTBASE_FOREACH (bGPDstroke *, gps, >strokes) {
   /* Apply modifiers that only deform geometry */
   BKE_gpencil_stroke_modifiers(depsgraph, ob, gpl, gpf, gps, is_render);
 }
@@ -961,7 +961,7 @@ void BKE_gpencil_modifiers_calc(Depsgraph *depsgraph, Scene 
*scene, Object *ob)
 /* Review triangulation for filling after applying modifiers and verify if 
any updated is
  * required.
  * This is needed if some modifiers tagged the stroke triangulation to be 
recalc. */
-for (bGPDstroke *gps = gpf->strokes.first; gps; gps = gps->next) {
+LISTBASE_FOREACH (bGPDstroke *, gps, >strokes) {
   MaterialGPencilStyle *gp_style = BKE_material_gpencil_settings_get(ob, 
gps->mat_nr + 1);
   if (gp_style) {
 BKE_gpencil_recalc_geometry_caches(ob, gpl, gp_style, gps);

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


[Bf-blender-cvs] [e9e9934d1b0] temp-gpencil-eval: Fix bug introduced in previous commit checking number of users

2020-01-16 Thread Antonio Vazquez
Commit: e9e9934d1b051250c087614d469512f33472da64
Author: Antonio Vazquez
Date:   Thu Jan 16 10:09:00 2020 +0100
Branches: temp-gpencil-eval
https://developer.blender.org/rBe9e9934d1b051250c087614d469512f33472da64

Fix bug introduced in previous commit checking number of users

If the eval is not used for 1 user, the modifier is added again and again.

To avoid this eval, it would be required a flag to check if the modifier was 
applied before, but this need more work and we will do in the future.

===

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

===

diff --git a/source/blender/blenkernel/intern/gpencil_modifier.c 
b/source/blender/blenkernel/intern/gpencil_modifier.c
index 7dee5b3bfc6..3991f4b0747 100644
--- a/source/blender/blenkernel/intern/gpencil_modifier.c
+++ b/source/blender/blenkernel/intern/gpencil_modifier.c
@@ -829,11 +829,10 @@ void BKE_gpencil_prepare_eval_data(Depsgraph *depsgraph, 
Scene *scene, Object *o
 {
   bGPdata *gpd_eval = (bGPdata *)ob->data;
   Object *ob_orig = (Object *)DEG_get_original_id(>id);
-  bGPdata *gpd = (bGPdata *)ob_orig->data;
 
   const bool is_multiedit = (bool)GPENCIL_MULTIEDIT_SESSIONS_ON(gpd_eval);
   const bool do_modifiers = (bool)((!is_multiedit) && 
(ob->greasepencil_modifiers.first != NULL) &&
-   (!GPENCIL_SIMPLIFY_MODIF(scene)) && 
(gpd->id.us > 1));
+   (!GPENCIL_SIMPLIFY_MODIF(scene)));
   if (!do_modifiers) {
 return;
   }

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