[Bf-blender-cvs] [6f1237b2ebd] master: make_update.py: update windows library folder

2019-11-08 Thread Ray Molenkamp
Commit: 6f1237b2ebda5c55414851d5c227fb819c3bc75b
Author: Ray Molenkamp
Date:   Fri Nov 8 19:09:59 2019 -0700
Branches: master
https://developer.blender.org/rB6f1237b2ebda5c55414851d5c227fb819c3bc75b

make_update.py: update windows library folder

===

M   build_files/utils/make_update.py

===

diff --git a/build_files/utils/make_update.py b/build_files/utils/make_update.py
index ec72514fdfc..e0417bc6f09 100755
--- a/build_files/utils/make_update.py
+++ b/build_files/utils/make_update.py
@@ -48,7 +48,7 @@ def svn_update(args, release_version):
 # Windows checkout is usually handled by bat scripts since python3 to 
run
 # this script is bundled as part of the precompiled libraries. However 
it
 # is used by the buildbot.
-lib_platform = "win64_vc14"
+lib_platform = "win64_vc15"
 elif args.use_centos_libraries:
 lib_platform = "linux_centos7_x86_64"
 else:

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


[Bf-blender-cvs] [3ed7ff1f9f6] master: Merge branch 'blender-v2.81-release'

2019-11-08 Thread Campbell Barton
Commit: 3ed7ff1f9f603cb1bf19568869ce4b5a12898c60
Author: Campbell Barton
Date:   Sat Nov 9 10:05:30 2019 +1100
Branches: master
https://developer.blender.org/rB3ed7ff1f9f603cb1bf19568869ce4b5a12898c60

Merge branch 'blender-v2.81-release'

===



===



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


[Bf-blender-cvs] [0a0d735acd6] blender-v2.81-release: Fix T71379: Even edge slide shows random points on screen

2019-11-08 Thread Campbell Barton
Commit: 0a0d735acd6e7f50c59a3ea0d79253aff9a1706f
Author: Campbell Barton
Date:   Sat Nov 9 09:58:06 2019 +1100
Branches: blender-v2.81-release
https://developer.blender.org/rB0a0d735acd6e7f50c59a3ea0d79253aff9a1706f

Fix T71379: Even edge slide shows random points on screen

===

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

===

diff --git a/source/blender/editors/transform/transform.c 
b/source/blender/editors/transform/transform.c
index 9f53c38c403..dd43e487d92 100644
--- a/source/blender/editors/transform/transform.c
+++ b/source/blender/editors/transform/transform.c
@@ -7576,20 +7576,27 @@ static void drawEdgeSlide(TransInfo *t)
 }
 immEnd();
 
-immUniformThemeColorShadeAlpha(TH_SELECT, -30, alpha_shade);
-GPU_point_size(ctrl_size);
-immBegin(GPU_PRIM_POINTS, 1);
-if (slp->flipped) {
-  if (curr_sv->v_side[1]) {
-immVertex3fv(pos, curr_sv->v_side[1]->co);
+{
+  float *co_test = NULL;
+  if (slp->flipped) {
+if (curr_sv->v_side[1]) {
+  co_test = curr_sv->v_side[1]->co;
+}
   }
-}
-else {
-  if (curr_sv->v_side[0]) {
-immVertex3fv(pos, curr_sv->v_side[0]->co);
+  else {
+if (curr_sv->v_side[0]) {
+  co_test = curr_sv->v_side[0]->co;
+}
+  }
+
+  if (co_test != NULL) {
+immUniformThemeColorShadeAlpha(TH_SELECT, -30, alpha_shade);
+GPU_point_size(ctrl_size);
+immBegin(GPU_PRIM_POINTS, 1);
+immVertex3fv(pos, co_test);
+immEnd();
   }
 }
-immEnd();
 
 immUniformThemeColorShadeAlpha(TH_SELECT, 255, alpha_shade);
 GPU_point_size(guide_size);

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


[Bf-blender-cvs] [4b229f9e2d5] master: Fix T69799: Glitches when moving object camera is locked to

2019-11-08 Thread mano-wii
Commit: 4b229f9e2d5d8863dd795865726971b1dd4bad3a
Author: mano-wii
Date:   Fri Nov 8 17:58:00 2019 -0300
Branches: master
https://developer.blender.org/rB4b229f9e2d5d8863dd795865726971b1dd4bad3a

Fix T69799: Glitches when moving object camera is locked to

The idea is to indicate that the view3d matrix is being transformed too
and this avoids cyclic dependencies.

===

M   source/blender/editors/transform/transform.h
M   source/blender/editors/transform/transform_convert.c

===

diff --git a/source/blender/editors/transform/transform.h 
b/source/blender/editors/transform/transform.h
index c437714956a..0264069c368 100644
--- a/source/blender/editors/transform/transform.h
+++ b/source/blender/editors/transform/transform.h
@@ -727,7 +727,7 @@ enum {
   T_EDIT = 1 << 1,
   T_POSE = 1 << 2,
   T_TEXTURE = 1 << 3,
-  /** Transforming the camera while in camera view. */
+  /** Transforming the 3d view. */
   T_CAMERA = 1 << 4,
   /** Transforming the 3D cursor. */
   T_CURSOR = 1 << 5,
diff --git a/source/blender/editors/transform/transform_convert.c 
b/source/blender/editors/transform/transform_convert.c
index 64ad8b2091e..c17a726576a 100644
--- a/source/blender/editors/transform/transform_convert.c
+++ b/source/blender/editors/transform/transform_convert.c
@@ -2727,6 +2727,9 @@ void createTransData(bContext *C, TransInfo *t)
   t->flag |= T_CAMERA;
 }
   }
+  else if (v3d->ob_centre && v3d->ob_centre->id.tag & LIB_TAG_DOIT) {
+t->flag |= T_CAMERA;
+  }
 }
   }

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


[Bf-blender-cvs] [ef2b03e317f] functions-experimental-refactor: Merge branch 'master' into functions

2019-11-08 Thread Jacques Lucke
Commit: ef2b03e317f9ccb77c29b788e6d42cc90bbba7e0
Author: Jacques Lucke
Date:   Fri Nov 8 20:46:43 2019 +0100
Branches: functions-experimental-refactor
https://developer.blender.org/rBef2b03e317f9ccb77c29b788e6d42cc90bbba7e0

Merge branch 'master' into functions

===



===



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


[Bf-blender-cvs] [bb15b89375b] functions-experimental-refactor: Merge branch 'functions' into functions-experimental-refactor

2019-11-08 Thread Jacques Lucke
Commit: bb15b89375bed989de3ed9f05d9d014829c86bba
Author: Jacques Lucke
Date:   Fri Nov 8 20:46:56 2019 +0100
Branches: functions-experimental-refactor
https://developer.blender.org/rBbb15b89375bed989de3ed9f05d9d014829c86bba

Merge branch 'functions' into functions-experimental-refactor

===



===



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


[Bf-blender-cvs] [c51d160ab5b] greasepencil-object: GPencil: Fix origin of UV rotation using object location

2019-11-08 Thread Antonio Vazquez
Commit: c51d160ab5b7b1ba52b2d0cb36914092d6f8ab39
Author: Antonio Vazquez
Date:   Fri Nov 8 20:52:58 2019 +0100
Branches: greasepencil-object
https://developer.blender.org/rBc51d160ab5b7b1ba52b2d0cb36914092d6f8ab39

GPencil: Fix origin of UV rotation using object location

===

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

===

diff --git a/source/blender/editors/gpencil/gpencil_uv.c 
b/source/blender/editors/gpencil/gpencil_uv.c
index 82a9a1f71ee..fb97d6afb48 100644
--- a/source/blender/editors/gpencil/gpencil_uv.c
+++ b/source/blender/editors/gpencil/gpencil_uv.c
@@ -183,6 +183,8 @@ static bool gpencil_uv_transform_init(bContext *C, 
wmOperator *op, const bool is
 if (gps->flag & GP_STROKE_SELECT) {
   float r_center[3];
   gpencil_stroke_center(gps, r_center);
+  /* Add object location. */
+  add_v3_v3(r_center, opdata->ob->obmat[3]);
   add_v3_v3(center, r_center);
   i++;
 }

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


[Bf-blender-cvs] [a74a2882ed2] functions-experimental-refactor: bring back compare node

2019-11-08 Thread Jacques Lucke
Commit: a74a2882ed2545dc9348e606b3cf2468d55f4b9b
Author: Jacques Lucke
Date:   Fri Nov 8 20:33:44 2019 +0100
Branches: functions-experimental-refactor
https://developer.blender.org/rBa74a2882ed2545dc9348e606b3cf2468d55f4b9b

bring back compare node

===

M   
source/blender/functions/intern/vtree_multi_function_network/mappings_nodes.cc

===

diff --git 
a/source/blender/functions/intern/vtree_multi_function_network/mappings_nodes.cc
 
b/source/blender/functions/intern/vtree_multi_function_network/mappings_nodes.cc
index 6ec71dbc268..8d431c42d22 100644
--- 
a/source/blender/functions/intern/vtree_multi_function_network/mappings_nodes.cc
+++ 
b/source/blender/functions/intern/vtree_multi_function_network/mappings_nodes.cc
@@ -435,6 +435,16 @@ static void INSERT_boolean_not(VTreeMFNetworkBuilder 
, const VNode 
   insert_single_input_math_function(builder, vnode);
 }
 
+static bool less_than_func_cb(float a, float b)
+{
+  return a < b;
+}
+
+static void INSERT_compare(VTreeMFNetworkBuilder , const VNode )
+{
+  insert_two_inputs_math_function(builder, vnode);
+}
+
 void add_vtree_node_mapping_info(VTreeMultiFunctionMappings )
 {
   mappings.vnode_inserters.add_new("fn_CombineColorNode", 
INSERT_combine_color);
@@ -451,6 +461,7 @@ void add_vtree_node_mapping_info(VTreeMultiFunctionMappings 
)
   mappings.vnode_inserters.add_new("fn_VertexInfoNode", INSERT_vertex_info);
   mappings.vnode_inserters.add_new("fn_FloatRangeNode", INSERT_float_range);
   mappings.vnode_inserters.add_new("fn_TimeInfoNode", INSERT_time_info);
+  mappings.vnode_inserters.add_new("fn_CompareNode", INSERT_compare);
 
   mappings.vnode_inserters.add_new("fn_AddFloatsNode", INSERT_add_floats);
   mappings.vnode_inserters.add_new("fn_MultiplyFloatsNode", 
INSERT_multiply_floats);

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


[Bf-blender-cvs] [6cddb446daf] greasepencil-object: Cleanup: Remove old commented lines

2019-11-08 Thread Antonio Vazquez
Commit: 6cddb446dafb1f1ace63fa7429a814e580cec68a
Author: Antonio Vazquez
Date:   Fri Nov 8 20:34:53 2019 +0100
Branches: greasepencil-object
https://developer.blender.org/rB6cddb446dafb1f1ace63fa7429a814e580cec68a

Cleanup: Remove old commented lines

===

M   source/blender/draw/engines/gpencil/gpencil_draw_utils.c

===

diff --git a/source/blender/draw/engines/gpencil/gpencil_draw_utils.c 
b/source/blender/draw/engines/gpencil/gpencil_draw_utils.c
index 304686703e7..236b15e45b5 100644
--- a/source/blender/draw/engines/gpencil/gpencil_draw_utils.c
+++ b/source/blender/draw/engines/gpencil/gpencil_draw_utils.c
@@ -332,9 +332,6 @@ static void gpencil_calc_stroke_fill_uv(const float 
(*points2d)[2],
 
   /* Calc center for rotation. */
   float center[2] = {0.5f, 0.5f};
-  //  sub_v2_v2v2(center, maxv, minv);
-  // mul_v2_fl(center, 0.5f);
-
   float d[2];
   d[0] = maxv[0] - minv[0];
   d[1] = maxv[1] - minv[1];

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


[Bf-blender-cvs] [f0b5d47802b] greasepencil-object: GPencil: Remove data from temp struct

2019-11-08 Thread Antonio Vazquez
Commit: f0b5d47802bd8890cfb53041cec568e774be1e7e
Author: Antonio Vazquez
Date:   Fri Nov 8 20:14:15 2019 +0100
Branches: greasepencil-object
https://developer.blender.org/rBf0b5d47802bd8890cfb53041cec568e774be1e7e

GPencil: Remove data from temp struct

These variables are not used now.

===

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

===

diff --git a/source/blender/editors/gpencil/gpencil_vertex_paint.c 
b/source/blender/editors/gpencil/gpencil_vertex_paint.c
index e55480c1ba8..df875e8385a 100644
--- a/source/blender/editors/gpencil/gpencil_vertex_paint.c
+++ b/source/blender/editors/gpencil/gpencil_vertex_paint.c
@@ -80,11 +80,9 @@ typedef struct tGP_selected {
 
 /* Context for brush operators */
 typedef struct tGP_BrushVertexpaintData {
-  struct Main *bmain;
   Scene *scene;
   Object *object;
 
-  ScrArea *sa;
   ARegion *ar;
 
   /* Current GPencil datablock */
@@ -313,7 +311,6 @@ static bool gp_vertexpaint_brush_init(bContext *C, 
wmOperator *op)
   gso = MEM_callocN(sizeof(tGP_BrushVertexpaintData), 
"tGP_BrushVertexpaintData");
   op->customdata = gso;
 
-  gso->bmain = CTX_data_main(C);
   gso->brush = paint->brush;
 
   gso->is_painting = false;
@@ -327,7 +324,6 @@ static bool gp_vertexpaint_brush_init(bContext *C, 
wmOperator *op)
   gso->scene = scene;
   gso->object = ob;
 
-  gso->sa = CTX_wm_area(C);
   gso->ar = CTX_wm_region(C);
 
   /* Save mask. */

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


[Bf-blender-cvs] [b9d42020be6] functions-experimental-refactor: make function name more precise

2019-11-08 Thread Jacques Lucke
Commit: b9d42020be64d1b86e3e051500894fe822b09d5a
Author: Jacques Lucke
Date:   Fri Nov 8 19:19:54 2019 +0100
Branches: functions-experimental-refactor
https://developer.blender.org/rBb9d42020be64d1b86e3e051500894fe822b09d5a

make function name more precise

===

M   source/blender/functions/FN_multi_function.h
M   source/blender/functions/intern/multi_functions/lists.cc
M   source/blender/functions/intern/multi_functions/mixed.cc
M   source/blender/functions/intern/multi_functions/mixed.h
M   source/blender/functions/intern/multi_functions/network.cc

===

diff --git a/source/blender/functions/FN_multi_function.h 
b/source/blender/functions/FN_multi_function.h
index d238f0aa20d..071ba5b8038 100644
--- a/source/blender/functions/FN_multi_function.h
+++ b/source/blender/functions/FN_multi_function.h
@@ -235,12 +235,13 @@ class MFParams {
 return m_virtual_list_refs[corrected_index];
   }
 
-  template MutableArrayRef single_output(uint index, StringRef 
name = "")
+  template
+  MutableArrayRef uninitialized_single_output(uint index, StringRef name = 
"")
   {
 BLI_assert(m_signature->is_single_output(index, name));
-return this->single_output(index, name).as_typed_ref();
+return this->uninitialized_single_output(index, name).as_typed_ref();
   }
-  GenericMutableArrayRef single_output(uint index, StringRef name = "")
+  GenericMutableArrayRef uninitialized_single_output(uint index, StringRef 
name = "")
   {
 UNUSED_VARS_NDEBUG(name);
 BLI_assert(m_signature->is_single_output(index, name));
diff --git a/source/blender/functions/intern/multi_functions/lists.cc 
b/source/blender/functions/intern/multi_functions/lists.cc
index 47571f478db..20a3f7db4e9 100644
--- a/source/blender/functions/intern/multi_functions/lists.cc
+++ b/source/blender/functions/intern/multi_functions/lists.cc
@@ -94,7 +94,7 @@ void MF_GetListElement::call(const MFMask ,
   VirtualListRef indices = params.readonly_single_input(1, "Index");
   GenericVirtualListRef fallbacks = params.readonly_single_input(2, 
"Fallback");
 
-  GenericMutableArrayRef output_values = params.single_output(3, "Value");
+  GenericMutableArrayRef output_values = params.uninitialized_single_output(3, 
"Value");
 
   for (uint i : mask.indices()) {
 int index = indices[i];
@@ -120,7 +120,7 @@ MF_ListLength::MF_ListLength(const CPPType _type) : 
m_base_type(base_type)
 void MF_ListLength::call(const MFMask , MFParams , MFContext 
(context)) const
 {
   GenericVirtualListListRef lists = params.readonly_vector_input(0, "List");
-  MutableArrayRef lengths = params.single_output(1, "Length");
+  MutableArrayRef lengths = params.uninitialized_single_output(1, 
"Length");
 
   for (uint i : mask.indices()) {
 lengths[i] = lists[i].size();
diff --git a/source/blender/functions/intern/multi_functions/mixed.cc 
b/source/blender/functions/intern/multi_functions/mixed.cc
index 877e2e356ec..a01da4a439e 100644
--- a/source/blender/functions/intern/multi_functions/mixed.cc
+++ b/source/blender/functions/intern/multi_functions/mixed.cc
@@ -33,7 +33,7 @@ void MF_AddFloats::call(const MFMask , MFParams , 
MFContext (
 {
   auto a = params.readonly_single_input(0, "A");
   auto b = params.readonly_single_input(1, "B");
-  auto result = params.single_output(2, "Result");
+  auto result = params.uninitialized_single_output(2, "Result");
 
   for (uint i : mask.indices()) {
 result[i] = a[i] + b[i];
@@ -53,7 +53,7 @@ void MF_AddFloat3s::call(const MFMask , MFParams 
, MFContext 
 {
   auto a = params.readonly_single_input(0, "A");
   auto b = params.readonly_single_input(1, "B");
-  auto result = params.single_output(2, "Result");
+  auto result = params.uninitialized_single_output(2, "Result");
 
   for (uint i : mask.indices()) {
 result[i] = a[i] + b[i];
@@ -77,7 +77,7 @@ void MF_CombineColor::call(const MFMask , MFParams 
, MFContext 
   VirtualListRef g = params.readonly_single_input(1, "G");
   VirtualListRef b = params.readonly_single_input(2, "B");
   VirtualListRef a = params.readonly_single_input(3, "A");
-  MutableArrayRef color = params.single_output(4, "Color");
+  MutableArrayRef color = 
params.uninitialized_single_output(4, "Color");
 
   for (uint i : mask.indices()) {
 color[i] = {r[i], g[i], b[i], a[i]};
@@ -98,10 +98,10 @@ MF_SeparateColor::MF_SeparateColor()
 void MF_SeparateColor::call(const MFMask , MFParams , MFContext 
(context)) const
 {
   auto color = params.readonly_single_input(0, "Color");
-  auto r = params.single_output(1, "R");
-  auto g = params.single_output(2, "G");
-  auto b = params.single_output(3, "B");
-  auto a = params.single_output(4, "A");
+  auto r = params.uninitialized_single_output(1, "R");
+  auto g = params.uninitialized_single_output(2, "G");
+  auto b = params.uninitialized_single_output(3, "B");
+  auto a = 

[Bf-blender-cvs] [b6027a2f152] functions-experimental-refactor: fix Is In Group input

2019-11-08 Thread Jacques Lucke
Commit: b6027a2f1520f9c25313cbc4986abd197cfc3ee7
Author: Jacques Lucke
Date:   Fri Nov 8 20:34:01 2019 +0100
Branches: functions-experimental-refactor
https://developer.blender.org/rBb6027a2f1520f9c25313cbc4986abd197cfc3ee7

fix Is In Group input

===

M   source/blender/simulations/bparticles/particle_function_builder.cpp

===

diff --git 
a/source/blender/simulations/bparticles/particle_function_builder.cpp 
b/source/blender/simulations/bparticles/particle_function_builder.cpp
index a5f4d8b946a..22cfd42b9b0 100644
--- a/source/blender/simulations/bparticles/particle_function_builder.cpp
+++ b/source/blender/simulations/bparticles/particle_function_builder.cpp
@@ -113,6 +113,7 @@ static ParticleFunctionInputProvider 
*INPUT_is_in_group(VTreeMFNetwork _da
   std::string group_name;
   BLI::destruct(_name);
   params_builder.add_single_output(ArrayRef(_name, 1));
+  fn.call(FN::MFMask({0}), params_builder.build(), context_builder.build());
 
   return new IsInGroupInputProvider(group_name);
 }

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


[Bf-blender-cvs] [fea9c7c1a39] functions-experimental-refactor: cleanup

2019-11-08 Thread Jacques Lucke
Commit: fea9c7c1a394360a40fae7f9575867cca0424463
Author: Jacques Lucke
Date:   Fri Nov 8 19:15:21 2019 +0100
Branches: functions-experimental-refactor
https://developer.blender.org/rBfea9c7c1a394360a40fae7f9575867cca0424463

cleanup

===

M   source/blender/functions/FN_multi_function.h
M   source/blender/functions/FN_multi_function_data_type.h
M   source/blender/functions/FN_multi_function_param_type.h
M   source/blender/functions/intern/multi_functions/mixed.cc
M   source/blender/functions/intern/multi_functions/mixed.h
M   source/blender/functions/intern/multi_functions/network.cc
M   source/blender/functions/intern/multi_functions/network.h
M   source/blender/functions/intern/vtree_multi_function_network/builder.cc
M   source/blender/functions/intern/vtree_multi_function_network/builder.h
M   
source/blender/functions/intern/vtree_multi_function_network/mappings_nodes.cc
M   source/blender/simulations/bparticles/particle_function.cpp

===

diff --git a/source/blender/functions/FN_multi_function.h 
b/source/blender/functions/FN_multi_function.h
index 4b31ae57f0b..d238f0aa20d 100644
--- a/source/blender/functions/FN_multi_function.h
+++ b/source/blender/functions/FN_multi_function.h
@@ -42,9 +42,6 @@ class MFSignature {
 for (MFParamType param_type : m_param_types) {
   uint corrected_index = 0;
   switch (param_type.category()) {
-case MFParamType::None:
-  BLI_assert(false);
-  break;
 case MFParamType::ReadonlySingleInput:
   corrected_index = array_or_single_refs++;
   break;
diff --git a/source/blender/functions/FN_multi_function_data_type.h 
b/source/blender/functions/FN_multi_function_data_type.h
index 32f0babcc2c..4f8b520fa63 100644
--- a/source/blender/functions/FN_multi_function_data_type.h
+++ b/source/blender/functions/FN_multi_function_data_type.h
@@ -8,35 +8,36 @@ namespace FN {
 struct MFDataType {
  public:
   enum Category {
-None,
 Single,
 Vector,
   };
 
-  MFDataType() = default;
-
+ private:
   MFDataType(Category category, const CPPType ) : m_category(category), 
m_base_type()
   {
   }
 
-  static MFDataType ForNone()
-  {
-return MFDataType{};
-  }
+ public:
+  MFDataType() = default;
 
   template static MFDataType ForSingle()
   {
-return MFDataType(Category::Single, CPP_TYPE());
+return MFDataType::ForSingle(CPP_TYPE());
   }
 
   template static MFDataType ForVector()
   {
-return MFDataType(Category::Vector, CPP_TYPE());
+return MFDataType::ForVector(CPP_TYPE());
+  }
+
+  static MFDataType ForSingle(const CPPType )
+  {
+return MFDataType(Category::Single, type);
   }
 
-  bool is_none() const
+  static MFDataType ForVector(const CPPType )
   {
-return m_category == Category::None;
+return MFDataType(Category::Vector, type);
   }
 
   bool is_single() const
@@ -77,8 +78,8 @@ struct MFDataType {
   }
 
  private:
-  Category m_category = Category::None;
-  const CPPType *m_base_type = nullptr;
+  Category m_category;
+  const CPPType *m_base_type;
 };
 
 }  // namespace FN
diff --git a/source/blender/functions/FN_multi_function_param_type.h 
b/source/blender/functions/FN_multi_function_param_type.h
index e119bfd4967..7c9adaa8b2f 100644
--- a/source/blender/functions/FN_multi_function_param_type.h
+++ b/source/blender/functions/FN_multi_function_param_type.h
@@ -8,7 +8,6 @@ namespace FN {
 struct MFParamType {
  public:
   enum Category {
-None,
 ReadonlySingleInput,
 SingleOutput,
 ReadonlyVectorInput,
@@ -16,16 +15,12 @@ struct MFParamType {
 MutableVector,
   };
 
+ public:
   MFParamType(Category category, const CPPType *base_type = nullptr)
   : m_category(category), m_base_type(base_type)
   {
   }
 
-  bool is_none() const
-  {
-return m_category == MFParamType::None;
-  }
-
   bool is_readonly_single_input() const
   {
 return m_category == ReadonlySingleInput;
@@ -64,18 +59,16 @@ struct MFParamType {
   MFDataType as_data_type() const
   {
 switch (m_category) {
-  case None:
-return {};
   case ReadonlySingleInput:
   case SingleOutput:
-return {MFDataType::Single, *m_base_type};
+return MFDataType::ForSingle(*m_base_type);
   case ReadonlyVectorInput:
   case VectorOutput:
   case MutableVector:
-return {MFDataType::Vector, *m_base_type};
+return MFDataType::ForVector(*m_base_type);
 }
 BLI_assert(false);
-return {};
+return MFDataType::ForSingle();
   }
 
   Category category() const
@@ -99,8 +92,8 @@ struct MFParamType {
   }
 
  private:
-  Category m_category = Category::None;
-  const CPPType *m_base_type = nullptr;
+  Category m_category;
+  const CPPType *m_base_type;
 };
 
 }  // namespace FN
diff --git a/source/blender/functions/intern/multi_functions/mixed.cc 

[Bf-blender-cvs] [a708562177b] functions-experimental-refactor: move attribute defaults back into AttributesInfo

2019-11-08 Thread Jacques Lucke
Commit: a708562177b1c14bbbcc2c9609d4122bfe714dbc
Author: Jacques Lucke
Date:   Fri Nov 8 19:48:04 2019 +0100
Branches: functions-experimental-refactor
https://developer.blender.org/rBa708562177b1c14bbbcc2c9609d4122bfe714dbc

move attribute defaults back into AttributesInfo

===

M   source/blender/functions/FN_attributes_block_container.h
M   source/blender/functions/FN_attributes_ref.h
M   source/blender/functions/intern/attributes_block_container.cc
M   source/blender/functions/intern/attributes_ref.cc
M   source/blender/simulations/bparticles/integrator.cpp
M   source/blender/simulations/bparticles/node_frontend.cpp
M   source/blender/simulations/bparticles/particle_allocator.cpp
M   source/blender/simulations/bparticles/particle_allocator.hpp
M   source/blender/simulations/bparticles/simulate.cpp
M   source/blender/simulations/bparticles/simulate.hpp

===

diff --git a/source/blender/functions/FN_attributes_block_container.h 
b/source/blender/functions/FN_attributes_block_container.h
index 27cd95c55ae..b7e07820534 100644
--- a/source/blender/functions/FN_attributes_block_container.h
+++ b/source/blender/functions/FN_attributes_block_container.h
@@ -40,8 +40,7 @@ class AttributesBlockContainer : BLI::NonCopyable, 
BLI::NonMovable {
   template Vector flatten_attribute(StringRef name) const;
   void flatten_attribute(StringRef name, GenericMutableArrayRef dst) const;
 
-  void update_attributes(const AttributesInfoBuilder _info_builder,
- const AttributesDefaults );
+  void update_attributes(const AttributesInfoBuilder _info_builder);
 
   AttributesBlock _block();
   void release_block(AttributesBlock );
diff --git a/source/blender/functions/FN_attributes_ref.h 
b/source/blender/functions/FN_attributes_ref.h
index 9ae1b077eea..82870f9f15e 100644
--- a/source/blender/functions/FN_attributes_ref.h
+++ b/source/blender/functions/FN_attributes_ref.h
@@ -25,23 +25,29 @@ using BLI::VectorSet;
 
 class AttributesInfo;
 
-class AttributesInfoBuilder {
+class AttributesInfoBuilder : BLI::NonCopyable, BLI::NonMovable {
  private:
+  MonotonicAllocator<32> m_allocator;
   VectorSet m_names;
   Vector m_types;
+  Vector m_defaults;
 
  public:
   AttributesInfoBuilder() = default;
+  ~AttributesInfoBuilder();
 
-  template void add(StringRef name)
+  template void add(StringRef name, const T _value)
   {
-this->add(name, CPP_TYPE());
+this->add(name, CPP_TYPE(), (const void *)_value);
   }
 
-  void add(StringRef name, const CPPType )
+  void add(StringRef name, const CPPType , const void *default_value)
   {
 if (m_names.add(name)) {
   m_types.append();
+  void *dst = m_allocator.allocate(type.size(), type.alignment());
+  type.copy_to_uninitialized(default_value, dst);
+  m_defaults.append(dst);
 }
 else {
   BLI_assert(m_types[m_names.index(name)] == );
@@ -63,19 +69,27 @@ class AttributesInfoBuilder {
 return m_types;
   }
 
+  ArrayRef defaults() const
+  {
+return ArrayRef(m_defaults.begin(), m_defaults.size());
+  }
+
   void add(const AttributesInfoBuilder );
   void add(const AttributesInfo );
 };
 
 class AttributesInfo : BLI::NonCopyable, BLI::NonMovable {
  private:
+  MonotonicAllocator<32> m_allocator;
   StringMap m_index_by_name;
   Vector m_name_by_index;
   Vector m_type_by_index;
+  Vector m_defaults;
 
  public:
   AttributesInfo() = default;
   AttributesInfo(const AttributesInfoBuilder );
+  ~AttributesInfo();
 
   uint size() const
   {
@@ -92,6 +106,16 @@ class AttributesInfo : BLI::NonCopyable, BLI::NonMovable {
 return m_index_by_name.lookup(name);
   }
 
+  const void *default_of(uint index) const
+  {
+return m_defaults[index];
+  }
+
+  const void *default_of(StringRef name) const
+  {
+return this->default_of(this->index_of(name));
+  }
+
   int index_of_try(StringRef name, const CPPType ) const
   {
 int index = this->index_of_try(name);
@@ -332,58 +356,15 @@ class AttributesRefGroup {
   }
 };
 
-class AttributesDefaults : BLI::NonCopyable, BLI::NonMovable {
- private:
-  StringMap m_index_by_name;
-  Vector m_type_by_index;
-  MonotonicAllocator<> m_allocator;
-  Vector m_values;
-
- public:
-  template void add(StringRef name, T value)
-  {
-if (m_index_by_name.contains(name)) {
-  /* TODO: Check if different handling of this case works better. */
-  BLI_assert(false);
-}
-else {
-  uint index = m_type_by_index.size();
-  m_index_by_name.add_new(name, index);
-  const CPPType  = CPP_TYPE();
-  m_type_by_index.append();
-  void *value_buffer = m_allocator.allocate(type.size(), type.alignment());
-  new (value_buffer) T(std::move(value));
-  m_values.append(value_buffer);
-}
-  }
-
-  const void *get(StringRef name, const CPPType _type) const
-  {
-uint index = 

[Bf-blender-cvs] [9cc27bd6ff9] functions-experimental-refactor: remove a node

2019-11-08 Thread Jacques Lucke
Commit: 9cc27bd6ff95f78616da54c43f9a51a2e9df67ac
Author: Jacques Lucke
Date:   Fri Nov 8 18:49:49 2019 +0100
Branches: functions-experimental-refactor
https://developer.blender.org/rB9cc27bd6ff95f78616da54c43f9a51a2e9df67ac

remove a node

===

D   release/scripts/startup/nodes/function_nodes/random_number.py
M   release/scripts/startup/nodes/menu.py

===

diff --git a/release/scripts/startup/nodes/function_nodes/random_number.py 
b/release/scripts/startup/nodes/function_nodes/random_number.py
deleted file mode 100644
index 74c7a2a37f2..000
--- a/release/scripts/startup/nodes/function_nodes/random_number.py
+++ /dev/null
@@ -1,12 +0,0 @@
-import bpy
-from .. base import FunctionNode
-
-class RandomNumberNode(bpy.types.Node, FunctionNode):
-bl_idname = "fn_RandomNumberNode"
-bl_label = "Random Number"
-
-def declaration(self, builder):
-builder.fixed_input("seed", "Seed", "Float")
-builder.fixed_input("min", "Min", "Float")
-builder.fixed_input("max", "Max", "Float", default=1.0)
-builder.fixed_output("value", "Value", "Float")
diff --git a/release/scripts/startup/nodes/menu.py 
b/release/scripts/startup/nodes/menu.py
index b3e4cb5401d..d29110164ed 100644
--- a/release/scripts/startup/nodes/menu.py
+++ b/release/scripts/startup/nodes/menu.py
@@ -28,19 +28,13 @@ class FunctionNodesMenu(bpy.types.Menu):
 
 insert_node(layout, "fn_FunctionInputNode", "Function Input")
 insert_node(layout, "fn_FunctionOutputNode", "Function Output")
-insert_node(layout, "fn_CallNode", "Call")
 layout.separator()
 insert_node(layout, "fn_BooleanMathNode", "Boolean Math")
 insert_node(layout, "fn_CompareNode", "Compare")
 insert_node(layout, "fn_SwitchNode", "Switch")
 layout.separator()
-insert_node(layout, "fn_FloatMathNode", "Float Math")
 insert_node(layout, "fn_FloatRangeNode", "Float Range")
-insert_node(layout, "fn_ClampNode", "Clamp")
-insert_node(layout, "fn_RandomNumberNode", "Random Number")
-insert_node(layout, "fn_MapRangeNode", "Map Range")
 layout.separator()
-insert_node(layout, "fn_VectorMathNode", "Vector Math")
 insert_node(layout, "fn_CombineVectorNode", "Combine Vector")
 insert_node(layout, "fn_SeparateVectorNode", "Separate Vector")
 insert_node(layout, "fn_VectorDistanceNode", "Vector Distance")

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


[Bf-blender-cvs] [3a3970c2e07] functions-experimental-refactor: change uint8_t to bool

2019-11-08 Thread Jacques Lucke
Commit: 3a3970c2e074dc1aa4a6cff068d45ac09bfaa70d
Author: Jacques Lucke
Date:   Fri Nov 8 19:50:23 2019 +0100
Branches: functions-experimental-refactor
https://developer.blender.org/rB3a3970c2e074dc1aa4a6cff068d45ac09bfaa70d

change uint8_t to bool

===

M   source/blender/simulations/bparticles/action_interface.hpp
M   source/blender/simulations/bparticles/actions.cpp
M   source/blender/simulations/bparticles/events.cpp
M   source/blender/simulations/bparticles/node_frontend.cpp
M   
source/blender/simulations/bparticles/particle_function_input_providers.cpp
M   source/blender/simulations/bparticles/simulate.cpp

===

diff --git a/source/blender/simulations/bparticles/action_interface.hpp 
b/source/blender/simulations/bparticles/action_interface.hpp
index 5bb52b9d440..34abbfcecf3 100644
--- a/source/blender/simulations/bparticles/action_interface.hpp
+++ b/source/blender/simulations/bparticles/action_interface.hpp
@@ -310,7 +310,7 @@ inline ArrayRef ActionInterface::current_times()
 
 inline void ActionInterface::kill(ArrayRef pindices)
 {
-  auto kill_states = m_attributes.get("Kill State");
+  auto kill_states = m_attributes.get("Kill State");
   for (uint pindex : pindices) {
 kill_states[pindex] = 1;
   }
diff --git a/source/blender/simulations/bparticles/actions.cpp 
b/source/blender/simulations/bparticles/actions.cpp
index f9f7aec9046..d21a54dc066 100644
--- a/source/blender/simulations/bparticles/actions.cpp
+++ b/source/blender/simulations/bparticles/actions.cpp
@@ -179,7 +179,7 @@ void ConditionAction::execute(ActionInterface )
 
 void AddToGroupAction::execute(ActionInterface )
 {
-  auto is_in_group = interface.attributes().get(m_group_name);
+  auto is_in_group = interface.attributes().get(m_group_name);
   for (uint pindex : interface.pindices()) {
 is_in_group[pindex] = true;
   }
@@ -187,12 +187,12 @@ void AddToGroupAction::execute(ActionInterface )
 
 void RemoveFromGroupAction::execute(ActionInterface )
 {
-  auto is_in_group_optional = 
interface.attributes().try_get(m_group_name);
+  auto is_in_group_optional = 
interface.attributes().try_get(m_group_name);
   if (!is_in_group_optional.has_value()) {
 return;
   }
 
-  MutableArrayRef is_in_group = *is_in_group_optional;
+  MutableArrayRef is_in_group = *is_in_group_optional;
   for (uint pindex : interface.pindices()) {
 is_in_group[pindex] = false;
   }
diff --git a/source/blender/simulations/bparticles/events.cpp 
b/source/blender/simulations/bparticles/events.cpp
index c844ff356f4..067e402b8f6 100644
--- a/source/blender/simulations/bparticles/events.cpp
+++ b/source/blender/simulations/bparticles/events.cpp
@@ -27,7 +27,7 @@ void AgeReachedEvent::filter(EventFilterInterface )
 
   float end_time = interface.step_end_time();
   auto birth_times = attributes.get("Birth Time");
-  auto was_activated_before = 
attributes.get(m_is_triggered_attribute);
+  auto was_activated_before = attributes.get(m_is_triggered_attribute);
 
   for (uint pindex : interface.pindices()) {
 if (was_activated_before[pindex]) {
@@ -56,7 +56,7 @@ void AgeReachedEvent::filter(EventFilterInterface )
 
 void AgeReachedEvent::execute(EventExecuteInterface )
 {
-  auto was_activated_before = 
interface.attributes().get(m_is_triggered_attribute);
+  auto was_activated_before = 
interface.attributes().get(m_is_triggered_attribute);
   for (uint pindex : interface.pindices()) {
 was_activated_before[pindex] = true;
   }
@@ -69,7 +69,7 @@ void AgeReachedEvent::execute(EventExecuteInterface 
)
 
 void CustomEvent::filter(EventFilterInterface )
 {
-  auto was_activated_before = 
interface.attributes().get(m_is_triggered_attribute);
+  auto was_activated_before = 
interface.attributes().get(m_is_triggered_attribute);
 
   TemporaryVector pindices_to_check;
   pindices_to_check.reserve(interface.pindices().size());
@@ -97,7 +97,7 @@ void CustomEvent::filter(EventFilterInterface )
 
 void CustomEvent::execute(EventExecuteInterface )
 {
-  auto was_activated_before = 
interface.attributes().get(m_is_triggered_attribute);
+  auto was_activated_before = 
interface.attributes().get(m_is_triggered_attribute);
   for (uint pindex : interface.pindices()) {
 was_activated_before[pindex] = true;
   }
diff --git a/source/blender/simulations/bparticles/node_frontend.cpp 
b/source/blender/simulations/bparticles/node_frontend.cpp
index 87af2d2cb11..835ef7aef77 100644
--- a/source/blender/simulations/bparticles/node_frontend.cpp
+++ b/source/blender/simulations/bparticles/node_frontend.cpp
@@ -397,7 +397,7 @@ static std::unique_ptr 
ACTION_add_to_group(InfluencesCollector 
 
   /* Add group to all particle systems for now. */
   collector.m_attributes.foreach_value(
-  [&](AttributesInfoBuilder *builder) { builder->add(group_name, 
0); });
+  [&](AttributesInfoBuilder *builder) { 

[Bf-blender-cvs] [4449f8f8db3] greasepencil-object: GPencil: Review comments, remove unused code and make safe free memory

2019-11-08 Thread Antonio Vazquez
Commit: 4449f8f8db30b26ad65b39671bc787e23367afb6
Author: Antonio Vazquez
Date:   Fri Nov 8 20:08:24 2019 +0100
Branches: greasepencil-object
https://developer.blender.org/rB4449f8f8db30b26ad65b39671bc787e23367afb6

GPencil: Review comments, remove unused code and make safe free memory

===

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

===

diff --git a/source/blender/editors/gpencil/gpencil_vertex_paint.c 
b/source/blender/editors/gpencil/gpencil_vertex_paint.c
index 61e20b0235a..e55480c1ba8 100644
--- a/source/blender/editors/gpencil/gpencil_vertex_paint.c
+++ b/source/blender/editors/gpencil/gpencil_vertex_paint.c
@@ -239,34 +239,6 @@ static void brush_grab_calc_dvec(tGP_BrushVertexpaintData 
*gso)
 /* This section defines the callbacks used by each brush to perform their 
magic.
  * These are called on each point within the brush's radius. */
 
-static bool brush_fill_asspply(tGP_BrushVertexpaintData *gso,
-   bGPDstroke *gps,
-   const int radius,
-   const int co[2])
-{
-  Brush *brush = gso->brush;
-  float inf = gso->pressure;
-
-  float alpha_fill = gps->mix_color_fill[3];
-  if (brush_invert_check(gso)) {
-alpha_fill -= inf;
-  }
-  else {
-alpha_fill += inf;
-/* Limit max strength target. */
-CLAMP_MAX(alpha_fill, brush->gpencil_settings->draw_strength);
-  }
-
-  /* Apply color to Fill area. */
-  if (GPENCIL_TINT_VERTEX_COLOR_FILL(brush)) {
-CLAMP(alpha_fill, 0.0f, 1.0f);
-copy_v3_v3(gps->mix_color_fill, brush->rgb);
-gps->mix_color_fill[3] = alpha_fill;
-  }
-
-  return true;
-}
-
 /* Tint Brush */
 static bool brush_tint_apply(tGP_BrushVertexpaintData *gso,
  bGPDstroke *gps,
@@ -358,10 +330,10 @@ static bool gp_vertexpaint_brush_init(bContext *C, 
wmOperator *op)
   gso->sa = CTX_wm_area(C);
   gso->ar = CTX_wm_region(C);
 
-  /* save mask */
+  /* Save mask. */
   gso->mask = ts->gpencil_selectmode_vertex;
 
-  /* multiframe settings */
+  /* Multiframe settings. */
   gso->is_multiframe = (bool)GPENCIL_MULTIEDIT_SESSIONS_ON(gso->gpd);
   gso->use_multiframe_falloff = (ts->gp_sculpt.flag & 
GP_SCULPT_SETT_FLAG_FRAME_FALLOFF) != 0;
 
@@ -371,13 +343,13 @@ static bool gp_vertexpaint_brush_init(bContext *C, 
wmOperator *op)
 BKE_curvemapping_initialize(ts->gp_sculpt.cur_falloff);
   }
 
-  /* setup space conversions */
+  /* Setup space conversions. */
   gp_point_conversion_init(C, >gsc);
 
-  /* update header */
+  /* Update header. */
   gp_vertexpaint_brush_header_set(C, gso);
 
-  /* setup cursor drawing */
+  /* Setup cursor drawing. */
   ED_gpencil_toggle_brush_cursor(C, true, NULL);
   return true;
 }
@@ -386,20 +358,20 @@ static void gp_vertexpaint_brush_exit(bContext *C, 
wmOperator *op)
 {
   tGP_BrushVertexpaintData *gso = op->customdata;
 
-  /* disable cursor and headerprints */
+  /* Disable cursor and headerprints. */
   ED_workspace_status_text(C, NULL);
   ED_gpencil_toggle_brush_cursor(C, false, NULL);
 
-  /* disable temp invert flag */
+  /* Disable temp invert flag. */
   gso->brush->flag &= ~GP_VERTEX_FLAG_TMP_INVERT;
 
-  /* free operator data */
-  MEM_freeN(gso->pbuffer);
-  MEM_freeN(gso);
+  /* Free operator data */
+  MEM_SAFE_FREE(gso->pbuffer);
+  MEM_SAFE_FREE(gso);
   op->customdata = NULL;
 }
 
-/* Poll callback for stroke vertex paint operator(s) */
+/* Poll callback for stroke vertex paint operator. */
 static bool gp_vertexpaint_brush_poll(bContext *C)
 {
   /* NOTE: this is a bit slower, but is the most accurate... */
@@ -425,7 +397,7 @@ static void gp_save_selected_point(tGP_BrushVertexpaintData 
*gso,
   gso->pbuffer_used++;
 }
 
-/* Select points in this stroke */
+/* Select points in this stroke and add to an array to be used later. */
 static void gp_vertexpaint_select_stroke(tGP_BrushVertexpaintData *gso,
  bGPDstroke *gps,
  const float diff_mat[4][4])

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


[Bf-blender-cvs] [f99acbe54b3] greasepencil-object: Cleanup: More unused variables

2019-11-08 Thread Antonio Vazquez
Commit: f99acbe54b3faca7359a95d110d8787672e0dbf1
Author: Antonio Vazquez
Date:   Fri Nov 8 20:02:40 2019 +0100
Branches: greasepencil-object
https://developer.blender.org/rBf99acbe54b3faca7359a95d110d8787672e0dbf1

Cleanup: More unused variables

===

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

===

diff --git a/source/blender/editors/gpencil/gpencil_vertex_paint.c 
b/source/blender/editors/gpencil/gpencil_vertex_paint.c
index 3e3d5037d5f..61e20b0235a 100644
--- a/source/blender/editors/gpencil/gpencil_vertex_paint.c
+++ b/source/blender/editors/gpencil/gpencil_vertex_paint.c
@@ -172,13 +172,6 @@ static tGP_selected 
*gpencil_select_buffer_ensure(tGP_selected *buffer_array,
   return buffer_array;
 }
 
-/* Callback for performing some brush operation on a single point */
-typedef bool (*GP_VertexpaintApplyCb)(tGP_BrushVertexpaintData *gso,
-  bGPDstroke *gps,
-  int pt_index,
-  const int radius,
-  const int co[2]);
-
 /* Brush Operations --- */
 
 /* Invert behavior of brush? */

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


[Bf-blender-cvs] [d4ea8697f62] greasepencil-object: Cleanup: Remove unused variables

2019-11-08 Thread Antonio Vazquez
Commit: d4ea8697f62d71eed22a5d75e1b4cc45694b1981
Author: Antonio Vazquez
Date:   Fri Nov 8 20:00:31 2019 +0100
Branches: greasepencil-object
https://developer.blender.org/rBd4ea8697f62d71eed22a5d75e1b4cc45694b1981

Cleanup: Remove unused variables

===

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

===

diff --git a/source/blender/editors/gpencil/gpencil_vertex_paint.c 
b/source/blender/editors/gpencil/gpencil_vertex_paint.c
index 860a52e07be..3e3d5037d5f 100644
--- a/source/blender/editors/gpencil/gpencil_vertex_paint.c
+++ b/source/blender/editors/gpencil/gpencil_vertex_paint.c
@@ -99,7 +99,6 @@ typedef struct tGP_BrushVertexpaintData {
 
   /* Is the brush currently painting? */
   bool is_painting;
-  bool is_transformed;
 
   /* Start of new paint */
   bool first;
@@ -124,9 +123,6 @@ typedef struct tGP_BrushVertexpaintData {
   /* brush geometry (bounding box) */
   rcti brush_rect;
 
-  /* Object invert matrix */
-  float inv_mat[4][4];
-
   /* Temp data to save selected points */
   /** Stroke buffer. */
   tGP_selected *pbuffer;
@@ -365,15 +361,6 @@ static bool gp_vertexpaint_brush_init(bContext *C, 
wmOperator *op)
   gso->gpd = ED_gpencil_data_get_active(C);
   gso->scene = scene;
   gso->object = ob;
-  if (ob) {
-invert_m4_m4(gso->inv_mat, ob->obmat);
-/* Check if some modifier can transform the stroke. */
-gso->is_transformed = BKE_gpencil_has_transform_modifiers(ob);
-  }
-  else {
-unit_m4(gso->inv_mat);
-gso->is_transformed = false;
-  }
 
   gso->sa = CTX_wm_area(C);
   gso->ar = CTX_wm_region(C);

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


[Bf-blender-cvs] [bfa94bfeeeb] greasepencil-object: Cleanup: Fix typo error

2019-11-08 Thread Antonio Vazquez
Commit: bfa94bfeeeb97ce29adbeaf49feb974f271d7367
Author: Antonio Vazquez
Date:   Fri Nov 8 19:48:59 2019 +0100
Branches: greasepencil-object
https://developer.blender.org/rBbfa94bfeeeb97ce29adbeaf49feb974f271d7367

Cleanup: Fix typo error

===

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

===

diff --git a/source/blender/editors/gpencil/gpencil_vertex_paint.c 
b/source/blender/editors/gpencil/gpencil_vertex_paint.c
index c97351e9e27..860a52e07be 100644
--- a/source/blender/editors/gpencil/gpencil_vertex_paint.c
+++ b/source/blender/editors/gpencil/gpencil_vertex_paint.c
@@ -137,7 +137,7 @@ typedef struct tGP_BrushVertexpaintData {
 
 } tGP_BrushVertexpaintData;
 
-/* Ensure the buffer to hold temp selwcted point size is enough to save all 
points selected. */
+/* Ensure the buffer to hold temp selected point size is enough to save all 
points selected. */
 static tGP_selected *gpencil_select_buffer_ensure(tGP_selected *buffer_array,
   int *buffer_size,
   int *buffer_used,

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


[Bf-blender-cvs] [0b3df9561da] greasepencil-object: GPencil: Use an array to select Vertex Paint points

2019-11-08 Thread Antonio Vazquez
Commit: 0b3df9561daeadb16d90960b0684a4dc1a98
Author: Antonio Vazquez
Date:   Fri Nov 8 19:47:32 2019 +0100
Branches: greasepencil-object
https://developer.blender.org/rB0b3df9561daeadb16d90960b0684a4dc1a98

GPencil: Use an array to select Vertex Paint points

This is required for new brushes that need to have all points selected before 
applying the effect

===

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

===

diff --git a/source/blender/editors/gpencil/gpencil_vertex_paint.c 
b/source/blender/editors/gpencil/gpencil_vertex_paint.c
index 12ee20e2846..c97351e9e27 100644
--- a/source/blender/editors/gpencil/gpencil_vertex_paint.c
+++ b/source/blender/editors/gpencil/gpencil_vertex_paint.c
@@ -58,6 +58,7 @@
 
 /*  */
 /* General Brush Editing Context */
+#define GP_SELECT_BUFFER_CHUNK 256
 
 /* Temp Flags while Painting. */
 typedef enum eGPDvertex_brush_Flag {
@@ -67,6 +68,16 @@ typedef enum eGPDvertex_brush_Flag {
   GP_VERTEX_FLAG_TMP_INVERT = (1 << 1),
 } eGPDvertex_brush_Flag;
 
+/* List of points affected by brush. */
+typedef struct tGP_selected {
+  /** Referenced stroke. */
+  bGPDstroke *gps;
+  /** Point index in points array. */
+  int pt_index;
+  /** Position */
+  int pc[2];
+} tGP_selected;
+
 /* Context for brush operators */
 typedef struct tGP_BrushVertexpaintData {
   struct Main *bmain;
@@ -116,8 +127,55 @@ typedef struct tGP_BrushVertexpaintData {
   /* Object invert matrix */
   float inv_mat[4][4];
 
+  /* Temp data to save selected points */
+  /** Stroke buffer. */
+  tGP_selected *pbuffer;
+  /** Number of elements currently used in cache. */
+  int pbuffer_used;
+  /** Number of total elements available in cache. */
+  int pbuffer_size;
+
 } tGP_BrushVertexpaintData;
 
+/* Ensure the buffer to hold temp selwcted point size is enough to save all 
points selected. */
+static tGP_selected *gpencil_select_buffer_ensure(tGP_selected *buffer_array,
+  int *buffer_size,
+  int *buffer_used,
+  const bool clear)
+{
+  tGP_selected *p = NULL;
+
+  /* By default a buffer is created with one block with a predefined number of 
free slots,
+   * if the size is not enough, the cache is reallocated adding a new block of 
free slots.
+   * This is done in order to keep cache small and improve speed. */
+  if (*buffer_used + 1 > *buffer_size) {
+if ((*buffer_size == 0) || (buffer_array == NULL)) {
+  p = MEM_callocN(sizeof(struct tGP_selected) * GP_SELECT_BUFFER_CHUNK, 
__func__);
+  *buffer_size = GP_SELECT_BUFFER_CHUNK;
+}
+else {
+  *buffer_size += GP_SELECT_BUFFER_CHUNK;
+  p = MEM_recallocN(buffer_array, sizeof(struct tGP_selected) * 
*buffer_size);
+}
+
+if (p == NULL) {
+  *buffer_size = *buffer_used = 0;
+}
+
+buffer_array = p;
+  }
+
+  /* clear old data */
+  if (clear) {
+*buffer_used = 0;
+if (buffer_array != NULL) {
+  memset(buffer_array, 0, sizeof(tGP_selected) * *buffer_size);
+}
+  }
+
+  return buffer_array;
+}
+
 /* Callback for performing some brush operation on a single point */
 typedef bool (*GP_VertexpaintApplyCb)(tGP_BrushVertexpaintData *gso,
   bGPDstroke *gps,
@@ -300,6 +358,10 @@ static bool gp_vertexpaint_brush_init(bContext *C, 
wmOperator *op)
   gso->is_painting = false;
   gso->first = true;
 
+  gso->pbuffer = NULL;
+  gso->pbuffer_size = 0;
+  gso->pbuffer_used = 0;
+
   gso->gpd = ED_gpencil_data_get_active(C);
   gso->scene = scene;
   gso->object = ob;
@@ -352,6 +414,7 @@ static void gp_vertexpaint_brush_exit(bContext *C, 
wmOperator *op)
   gso->brush->flag &= ~GP_VERTEX_FLAG_TMP_INVERT;
 
   /* free operator data */
+  MEM_freeN(gso->pbuffer);
   MEM_freeN(gso);
   op->customdata = NULL;
 }
@@ -363,13 +426,29 @@ static bool gp_vertexpaint_brush_poll(bContext *C)
   return CTX_DATA_COUNT(C, editable_gpencil_strokes) != 0;
 }
 
-/* Apply --- */
+/* Helper to save the points selected by the brush. */
+static void gp_save_selected_point(tGP_BrushVertexpaintData *gso,
+   bGPDstroke *gps,
+   int index,
+   int pc[2])
+{
+  tGP_selected *selected;
+  /* Ensure the array to save the list of selected points is big enough. */
+  gso->pbuffer = gpencil_select_buffer_ensure(
+  gso->pbuffer, >pbuffer_size, >pbuffer_used, false);
+
+  selected = >pbuffer[gso->pbuffer_used];
+  selected->gps = gps;
+  selected->pt_index = index;
+  copy_v2_v2_int(selected->pc, pc);
+
+  gso->pbuffer_used++;
+}
 
-/* Apply brush operation to points in this stroke */
-static bool 

[Bf-blender-cvs] [d47962f7a9f] functions-experimental-refactor: boolean math nodes

2019-11-08 Thread Jacques Lucke
Commit: d47962f7a9f24afb6bf038b6fea0a503c3e64ac7
Author: Jacques Lucke
Date:   Fri Nov 8 17:11:29 2019 +0100
Branches: functions-experimental-refactor
https://developer.blender.org/rBd47962f7a9f24afb6bf038b6fea0a503c3e64ac7

boolean math nodes

===

D   release/scripts/startup/nodes/function_nodes/boolean.py
M   release/scripts/startup/nodes/function_nodes/math.py
M   
source/blender/functions/intern/vtree_multi_function_network/mappings_nodes.cc

===

diff --git a/release/scripts/startup/nodes/function_nodes/boolean.py 
b/release/scripts/startup/nodes/function_nodes/boolean.py
deleted file mode 100644
index 1e67bc52388..000
--- a/release/scripts/startup/nodes/function_nodes/boolean.py
+++ /dev/null
@@ -1,51 +0,0 @@
-import bpy
-from bpy.props import *
-from .. base import FunctionNode
-from .. node_builder import NodeBuilder
-
-operation_items = [
-("AND", "And", "", "", 1),
-("OR", "Or", "", "", 2),
-("NOT", "Not", "", "", 3),
-]
-single_value_operations = {
-"NOT"
-}
-class BooleanMathNode(bpy.types.Node, FunctionNode):
-bl_idname = "fn_BooleanMathNode"
-bl_label = "Boolean Math"
-
-search_terms = (
-("And", {"operation" : "AND"}),
-("Or", {"operation" : "OR"}),
-("Not", {"operation" : "NOT"}),
-)
-
-operation: EnumProperty(
-name="Operation",
-items=operation_items,
-update=FunctionNode.sync_tree,
-)
-
-use_list__a: NodeBuilder.VectorizedProperty()
-use_list__b: NodeBuilder.VectorizedProperty()
-
-def declaration(self, builder: NodeBuilder):
-builder.vectorized_input(
-"a", "use_list__a",
-"A", "A", "Boolean")
-prop_names = ["use_list__a"]
-
-if self.operation not in single_value_operations:
-builder.vectorized_input(
-"b", "use_list__b",
-"B", "B", "Boolean")
-prop_names.append("use_list__b")
-
-
-builder.vectorized_output(
-"result", prop_names,
-"Result", "Result", "Boolean")
-
-def draw(self, layout):
-layout.prop(self, "operation", text="")
diff --git a/release/scripts/startup/nodes/function_nodes/math.py 
b/release/scripts/startup/nodes/function_nodes/math.py
index d345a7f4306..bff9f13c404 100644
--- a/release/scripts/startup/nodes/function_nodes/math.py
+++ b/release/scripts/startup/nodes/function_nodes/math.py
@@ -78,3 +78,7 @@ VectorReflectNode = create_two_inputs_math_node("Vector", 
"fn_ReflectVectorNode"
 VectorProjectNode = create_two_inputs_math_node("Vector", 
"fn_ProjectVectorNode", "Project Vector")
 VectorDotProductNode = create_two_inputs_other_output_math_node("Vector", 
"Float", "fn_VectorDotProductNode", "Dot Product") 
 VectorDistanceNode = create_two_inputs_other_output_math_node("Vector", 
"Float", "fn_VectorDistanceNode", "Vector Distance")
+
+BooleanAndNode = create_variadic_math_node("Boolean", "fn_BooleanAndNode", 
"And")
+BooleanOrNode = create_variadic_math_node("Boolean", "fn_BooleanOrNode", "Or")
+BooleanNotNode = create_single_input_math_node("Boolean", "fn_BooleanNotNode", 
"Not")
diff --git 
a/source/blender/functions/intern/vtree_multi_function_network/mappings_nodes.cc
 
b/source/blender/functions/intern/vtree_multi_function_network/mappings_nodes.cc
index 7750feeef7c..303e980da4a 100644
--- 
a/source/blender/functions/intern/vtree_multi_function_network/mappings_nodes.cc
+++ 
b/source/blender/functions/intern/vtree_multi_function_network/mappings_nodes.cc
@@ -359,6 +359,36 @@ static void INSERT_vector_distance(VTreeMFNetworkBuilder 
, const VNode &
   insert_two_inputs_math_function(builder, vnode);
 }
 
+static bool bool_and_func_cb(bool a, bool b)
+{
+  return a && b;
+}
+
+static bool bool_or_func_cb(bool a, bool b)
+{
+  return a || b;
+}
+
+static bool bool_not_func_cb(const bool )
+{
+  return !a;
+}
+
+static void INSERT_boolean_and(VTreeMFNetworkBuilder , const VNode 
)
+{
+  insert_simple_math_function(builder, vnode, true);
+}
+
+static void INSERT_boolean_or(VTreeMFNetworkBuilder , const VNode 
)
+{
+  insert_simple_math_function(builder, vnode, false);
+}
+
+static void INSERT_boolean_not(VTreeMFNetworkBuilder , const VNode 
)
+{
+  insert_single_input_math_function(builder, vnode);
+}
+
 void add_vtree_node_mapping_info(VTreeMultiFunctionMappings )
 {
   mappings.vnode_inserters.add_new("fn_CombineVectorNode", 
INSERT_combine_vector);
@@ -396,6 +426,10 @@ void 
add_vtree_node_mapping_info(VTreeMultiFunctionMappings )
   mappings.vnode_inserters.add_new("fn_ProjectVectorNode", 
INSERT_project_vector);
   mappings.vnode_inserters.add_new("fn_VectorDotProductNode", 
INSERT_vector_dot_product);
   mappings.vnode_inserters.add_new("fn_VectorDistanceNode", 
INSERT_vector_distance);
+
+  mappings.vnode_inserters.add_new("fn_BooleanAndNode", INSERT_boolean_and);
+  

[Bf-blender-cvs] [366a427f04b] functions-experimental-refactor: more vector math

2019-11-08 Thread Jacques Lucke
Commit: 366a427f04b696d15efb5e048aa31bc864ef77ff
Author: Jacques Lucke
Date:   Fri Nov 8 16:56:06 2019 +0100
Branches: functions-experimental-refactor
https://developer.blender.org/rB366a427f04b696d15efb5e048aa31bc864ef77ff

more vector math

===

R087release/scripts/startup/nodes/function_nodes/float_math.py  
release/scripts/startup/nodes/function_nodes/math.py
M   release/scripts/startup/nodes/function_nodes/vector.py
M   source/blender/functions/FN_multi_function.h
M   source/blender/functions/intern/multi_functions/mixed.h
M   
source/blender/functions/intern/vtree_multi_function_network/mappings_nodes.cc

===

diff --git a/release/scripts/startup/nodes/function_nodes/float_math.py 
b/release/scripts/startup/nodes/function_nodes/math.py
similarity index 87%
rename from release/scripts/startup/nodes/function_nodes/float_math.py
rename to release/scripts/startup/nodes/function_nodes/math.py
index 3906e9b2371..d345a7f4306 100644
--- a/release/scripts/startup/nodes/function_nodes/float_math.py
+++ b/release/scripts/startup/nodes/function_nodes/math.py
@@ -22,32 +22,35 @@ def create_variadic_math_node(data_type, idname, label):
 return MathNode
 
 def create_two_inputs_math_node(data_type, idname, label):
+return create_two_inputs_other_output_math_node(data_type, data_type, 
idname, label)
+
+def create_single_input_math_node(data_type, idname, label):
 
 class MathNode(bpy.types.Node, FunctionNode):
 bl_idname = idname
 bl_label = label
 
-use_list__a: NodeBuilder.VectorizedProperty()
-use_list__b: NodeBuilder.VectorizedProperty()
+use_list: NodeBuilder.VectorizedProperty()
 
 def declaration(self, builder: NodeBuilder):
-builder.vectorized_input("a", "use_list__a", "A", "A", data_type)
-builder.vectorized_input("b", "use_list__b", "B", "B", data_type)
-builder.vectorized_output("result", ["use_list__a", 
"use_list__b"], "Result", "Result", data_type)
+builder.vectorized_input("input", "use_list", "Value", "Values", 
data_type)
+builder.vectorized_output("output", ["use_list"], "Result", 
"Result", data_type)
 
 return MathNode
 
-def create_single_input_math_node(data_type, idname, label):
+def create_two_inputs_other_output_math_node(input_type, output_type, idname, 
label):
 
 class MathNode(bpy.types.Node, FunctionNode):
 bl_idname = idname
 bl_label = label
 
-use_list: NodeBuilder.VectorizedProperty()
+use_list__a: NodeBuilder.VectorizedProperty()
+use_list__b: NodeBuilder.VectorizedProperty()
 
 def declaration(self, builder: NodeBuilder):
-builder.vectorized_input("input", "use_list", "Value", "Values", 
data_type)
-builder.vectorized_output("output", ["use_list"], "Result", 
"Result", data_type)
+builder.vectorized_input("a", "use_list__a", "A", "A", input_type)
+builder.vectorized_input("b", "use_list__b", "B", "B", input_type)
+builder.vectorized_output("result", ["use_list__a", 
"use_list__b"], "Result", "Result", output_type)
 
 return MathNode
 
@@ -73,3 +76,5 @@ DivideVectorsNode = create_two_inputs_math_node("Vector", 
"fn_DivideVectorsNode"
 VectorCrossProductNode = create_two_inputs_math_node("Vector", 
"fn_VectorCrossProductNode", "Cross Product")
 VectorReflectNode = create_two_inputs_math_node("Vector", 
"fn_ReflectVectorNode", "Reflect Vector")
 VectorProjectNode = create_two_inputs_math_node("Vector", 
"fn_ProjectVectorNode", "Project Vector")
+VectorDotProductNode = create_two_inputs_other_output_math_node("Vector", 
"Float", "fn_VectorDotProductNode", "Dot Product") 
+VectorDistanceNode = create_two_inputs_other_output_math_node("Vector", 
"Float", "fn_VectorDistanceNode", "Vector Distance")
diff --git a/release/scripts/startup/nodes/function_nodes/vector.py 
b/release/scripts/startup/nodes/function_nodes/vector.py
index c9824f7128f..ced712a6b86 100644
--- a/release/scripts/startup/nodes/function_nodes/vector.py
+++ b/release/scripts/startup/nodes/function_nodes/vector.py
@@ -3,61 +3,6 @@ from bpy.props import *
 from .. base import FunctionNode
 from .. node_builder import NodeBuilder
 
-'''
-class VectorMathNode(bpy.types.Node, FunctionNode):
-bl_idname = "fn_VectorMathNode"
-bl_label = "Vector Math"
-
-operation_items = [
-("ADD", "Add", "", "", 1),
-("SUB", "Subtract", "", "", 2),
-("MUL", "Multiply", "", "", 3),
-("DIV", "Divide", "", "", 4),
-("CROSS", "Cross Product", "", "", 5),
-("REFLECT", "Reflect", "", "", 6),
-("PROJECT", "Project", "", "", 7),
-("DOT", "Dot", "", "", 8),
-]
-
-operation: EnumProperty(
-name="Operation",
-items=operation_items,
-update=FunctionNode.sync_tree,

[Bf-blender-cvs] [5f8bd0fa712] functions-experimental-refactor: make switch node work again

2019-11-08 Thread Jacques Lucke
Commit: 5f8bd0fa71269f409d37b12f003006bff8182dbc
Author: Jacques Lucke
Date:   Fri Nov 8 18:21:26 2019 +0100
Branches: functions-experimental-refactor
https://developer.blender.org/rB5f8bd0fa71269f409d37b12f003006bff8182dbc

make switch node work again

===

M   source/blender/functions/intern/multi_functions/mixed.cc
M   source/blender/functions/intern/multi_functions/mixed.h
M   source/blender/functions/intern/vtree_multi_function_network/builder.cc
M   source/blender/functions/intern/vtree_multi_function_network/builder.h
M   source/blender/functions/intern/vtree_multi_function_network/mappings.h
M   
source/blender/functions/intern/vtree_multi_function_network/mappings_nodes.cc
M   
source/blender/functions/intern/vtree_multi_function_network/mappings_sockets.cc

===

diff --git a/source/blender/functions/intern/multi_functions/mixed.cc 
b/source/blender/functions/intern/multi_functions/mixed.cc
index 2ae08f85ffd..e8cc83a796a 100644
--- a/source/blender/functions/intern/multi_functions/mixed.cc
+++ b/source/blender/functions/intern/multi_functions/mixed.cc
@@ -292,6 +292,60 @@ void MF_ObjectWorldLocation::call(const MFMask ,
   }
 }
 
+MF_SwitchSingle::MF_SwitchSingle(const CPPType ) : m_type(type)
+{
+  MFSignatureBuilder signature("Switch");
+  signature.readonly_single_input("Condition");
+  signature.readonly_single_input("True", m_type);
+  signature.readonly_single_input("False", m_type);
+  signature.single_output("Result", m_type);
+  this->set_signature(signature);
+}
+
+void MF_SwitchSingle::call(const MFMask , MFParams , MFContext 
(context)) const
+{
+  VirtualListRef conditions = params.readonly_single_input(0, 
"Condition");
+  GenericVirtualListRef if_true = params.readonly_single_input(1, "True");
+  GenericVirtualListRef if_false = params.readonly_single_input(2, "False");
+  GenericMutableArrayRef results = params.single_output(3, "Result");
+
+  for (uint i : mask.indices()) {
+if (conditions[i]) {
+  results.copy_in__uninitialized(i, if_true[i]);
+}
+else {
+  results.copy_in__uninitialized(i, if_false[i]);
+}
+  }
+}
+
+MF_SwitchVector::MF_SwitchVector(const CPPType ) : m_type(type)
+{
+  MFSignatureBuilder signature("Switch");
+  signature.readonly_single_input("Condition");
+  signature.readonly_vector_input("True", m_type);
+  signature.readonly_vector_input("False", m_type);
+  signature.vector_output("Result", m_type);
+  this->set_signature(signature);
+}
+
+void MF_SwitchVector::call(const MFMask , MFParams , MFContext 
(context)) const
+{
+  VirtualListRef conditions = params.readonly_single_input(0, 
"Condition");
+  GenericVirtualListListRef if_true = params.readonly_vector_input(1, "True");
+  GenericVirtualListListRef if_false = params.readonly_vector_input(2, 
"False");
+  GenericVectorArray  = params.vector_output(3, "Result");
+
+  for (uint i : mask.indices()) {
+if (conditions[i]) {
+  results.extend_single__copy(i, if_true[i]);
+}
+else {
+  results.extend_single__copy(i, if_false[i]);
+}
+  }
+}
+
 MF_TextLength::MF_TextLength()
 {
   MFSignatureBuilder signature("Text Length");
diff --git a/source/blender/functions/intern/multi_functions/mixed.h 
b/source/blender/functions/intern/multi_functions/mixed.h
index 6fad879459a..60f9585fa03 100644
--- a/source/blender/functions/intern/multi_functions/mixed.h
+++ b/source/blender/functions/intern/multi_functions/mixed.h
@@ -142,6 +142,24 @@ class MF_ContextCurrentFrame final : public MultiFunction {
   void call(const MFMask , MFParams , MFContext ) const 
override;
 };
 
+class MF_SwitchSingle final : public MultiFunction {
+ private:
+  const CPPType _type;
+
+ public:
+  MF_SwitchSingle(const CPPType );
+  void call(const MFMask , MFParams , MFContext ) const 
override;
+};
+
+class MF_SwitchVector final : public MultiFunction {
+ private:
+  const CPPType _type;
+
+ public:
+  MF_SwitchVector(const CPPType );
+  void call(const MFMask , MFParams , MFContext ) const 
override;
+};
+
 template
 class MF_Mappping final : public MultiFunction {
  public:
diff --git 
a/source/blender/functions/intern/vtree_multi_function_network/builder.cc 
b/source/blender/functions/intern/vtree_multi_function_network/builder.cc
index 9073adde12d..06c6c8d4b06 100644
--- a/source/blender/functions/intern/vtree_multi_function_network/builder.cc
+++ b/source/blender/functions/intern/vtree_multi_function_network/builder.cc
@@ -129,6 +129,15 @@ const CPPType 
::cpp_type_from_property(const VNode ,
   return type;
 }
 
+MFDataType VTreeMFNetworkBuilder::data_type_from_property(const VNode ,
+  StringRefNull 
prop_name) const
+{
+  char *type_name = RNA_string_get_alloc(vnode.rna(), prop_name.data(), 
nullptr, 0);
+  MFDataType type = 

[Bf-blender-cvs] [8e1ced75964] functions-experimental-refactor: bring back color nodes

2019-11-08 Thread Jacques Lucke
Commit: 8e1ced75964bc9ba5d269d7c77eb7d619c1607fc
Author: Jacques Lucke
Date:   Fri Nov 8 17:32:20 2019 +0100
Branches: functions-experimental-refactor
https://developer.blender.org/rB8e1ced75964bc9ba5d269d7c77eb7d619c1607fc

bring back color nodes

===

D   release/scripts/startup/nodes/function_nodes/call.py
M   source/blender/functions/intern/multi_functions/mixed.cc
M   source/blender/functions/intern/multi_functions/mixed.h
M   
source/blender/functions/intern/vtree_multi_function_network/mappings_nodes.cc
M   
source/blender/functions/intern/vtree_multi_function_network/mappings_sockets.cc

===

diff --git a/release/scripts/startup/nodes/function_nodes/call.py 
b/release/scripts/startup/nodes/function_nodes/call.py
deleted file mode 100644
index 6b24d646a47..000
--- a/release/scripts/startup/nodes/function_nodes/call.py
+++ /dev/null
@@ -1,26 +0,0 @@
-import bpy
-from bpy.props import *
-from .. base import FunctionNode
-
-class CallNode(bpy.types.Node, FunctionNode):
-bl_idname = "fn_CallNode"
-bl_label = "Call"
-
-function_tree: PointerProperty(
-name="Function Tree",
-type=bpy.types.NodeTree,
-update=FunctionNode.sync_tree,
-)
-
-def declaration(self, builder):
-if self.function_tree is None:
-return
-builder.tree_interface_input("inputs", self.function_tree, "IN")
-builder.tree_interface_output("outputs", self.function_tree, "OUT")
-
-def draw(self, layout):
-layout.prop(self, "function_tree", text="")
-
-def iter_dependency_trees(self):
-if self.function_tree is not None:
-yield self.function_tree
diff --git a/source/blender/functions/intern/multi_functions/mixed.cc 
b/source/blender/functions/intern/multi_functions/mixed.cc
index d4607bd..64e4a6cec17 100644
--- a/source/blender/functions/intern/multi_functions/mixed.cc
+++ b/source/blender/functions/intern/multi_functions/mixed.cc
@@ -13,6 +13,7 @@
 namespace FN {
 
 using BLI::float3;
+using BLI::rgba_f;
 
 MF_AddFloats::MF_AddFloats()
 {
@@ -54,6 +55,58 @@ void MF_AddFloat3s::call(const MFMask , MFParams 
, MFContext 
   }
 }
 
+MF_CombineColor::MF_CombineColor()
+{
+  MFSignatureBuilder signature("Combine Color");
+  signature.readonly_single_input("R");
+  signature.readonly_single_input("G");
+  signature.readonly_single_input("B");
+  signature.readonly_single_input("A");
+  signature.single_output("Color");
+  this->set_signature(signature);
+}
+
+void MF_CombineColor::call(const MFMask , MFParams , MFContext 
(context)) const
+{
+  VirtualListRef r = params.readonly_single_input(0, "R");
+  VirtualListRef g = params.readonly_single_input(1, "G");
+  VirtualListRef b = params.readonly_single_input(2, "B");
+  VirtualListRef a = params.readonly_single_input(3, "A");
+  MutableArrayRef color = params.single_output(4, "Color");
+
+  for (uint i : mask.indices()) {
+color[i] = {r[i], g[i], b[i], a[i]};
+  }
+}
+
+MF_SeparateColor::MF_SeparateColor()
+{
+  MFSignatureBuilder signature("Separate Color");
+  signature.readonly_single_input("Color");
+  signature.single_output("R");
+  signature.single_output("G");
+  signature.single_output("B");
+  signature.single_output("A");
+  this->set_signature(signature);
+}
+
+void MF_SeparateColor::call(const MFMask , MFParams , MFContext 
(context)) const
+{
+  auto color = params.readonly_single_input(0, "Color");
+  auto r = params.single_output(1, "R");
+  auto g = params.single_output(2, "G");
+  auto b = params.single_output(3, "B");
+  auto a = params.single_output(4, "A");
+
+  for (uint i : mask.indices()) {
+rgba_f v = color[i];
+r[i] = v.r;
+g[i] = v.g;
+b[i] = v.b;
+a[i] = v.a;
+  }
+}
+
 MF_CombineVector::MF_CombineVector()
 {
   MFSignatureBuilder signature("Combine Vector");
@@ -66,10 +119,10 @@ MF_CombineVector::MF_CombineVector()
 
 void MF_CombineVector::call(const MFMask , MFParams , MFContext 
(context)) const
 {
-  auto x = params.readonly_single_input(0, "X");
-  auto y = params.readonly_single_input(1, "Y");
-  auto z = params.readonly_single_input(2, "Z");
-  auto vector = params.single_output(3, "Vector");
+  VirtualListRef x = params.readonly_single_input(0, "X");
+  VirtualListRef y = params.readonly_single_input(1, "Y");
+  VirtualListRef z = params.readonly_single_input(2, "Z");
+  MutableArrayRef vector = params.single_output(3, "Vector");
 
   for (uint i : mask.indices()) {
 vector[i] = {x[i], y[i], z[i]};
diff --git a/source/blender/functions/intern/multi_functions/mixed.h 
b/source/blender/functions/intern/multi_functions/mixed.h
index cb1bc3eceb6..8c7bc3467e0 100644
--- a/source/blender/functions/intern/multi_functions/mixed.h
+++ b/source/blender/functions/intern/multi_functions/mixed.h
@@ -16,6 +16,18 @@ class MF_AddFloat3s final : public MultiFunction {
   void 

[Bf-blender-cvs] [de3d75110ce] functions-experimental-refactor: bring back object mesh info node

2019-11-08 Thread Jacques Lucke
Commit: de3d75110ceedadee6fa5a85cca8ff48b8678e0c
Author: Jacques Lucke
Date:   Fri Nov 8 17:50:19 2019 +0100
Branches: functions-experimental-refactor
https://developer.blender.org/rBde3d75110ceedadee6fa5a85cca8ff48b8678e0c

bring back object mesh info node

===

M   source/blender/functions/intern/multi_functions/mixed.cc
M   source/blender/functions/intern/multi_functions/mixed.h
M   
source/blender/functions/intern/vtree_multi_function_network/mappings_nodes.cc

===

diff --git a/source/blender/functions/intern/multi_functions/mixed.cc 
b/source/blender/functions/intern/multi_functions/mixed.cc
index 64e4a6cec17..2ae08f85ffd 100644
--- a/source/blender/functions/intern/multi_functions/mixed.cc
+++ b/source/blender/functions/intern/multi_functions/mixed.cc
@@ -7,13 +7,18 @@
 #include "BLI_math_cxx.h"
 #include "BLI_lazy_init_cxx.h"
 #include "BLI_string_map.h"
+#include "BLI_array_cxx.h"
 
 #include "DNA_object_types.h"
+#include "DNA_mesh_types.h"
+#include "DNA_meshdata_types.h"
 
 namespace FN {
 
 using BLI::float3;
+using BLI::float4x4;
 using BLI::rgba_f;
+using BLI::TemporaryArray;
 
 MF_AddFloats::MF_AddFloats()
 {
@@ -230,6 +235,38 @@ void MF_FloatRange::call(const MFMask , MFParams 
, MFContext 
   }
 }
 
+MF_ObjectVertexPositions::MF_ObjectVertexPositions()
+{
+  MFSignatureBuilder signature{"Object Vertex Positions"};
+  signature.readonly_single_input("Object");
+  signature.vector_output("Positions");
+  this->set_signature(signature);
+}
+
+void MF_ObjectVertexPositions::call(const MFMask ,
+MFParams ,
+MFContext (context)) const
+{
+  VirtualListRef objects = params.readonly_single_input(0, 
"Object");
+  auto positions = params.vector_output(1, "Positions");
+
+  for (uint i : mask.indices()) {
+Object *object = objects[i];
+if (object == nullptr || object->type != OB_MESH) {
+  continue;
+}
+
+float4x4 transform = object->obmat;
+
+Mesh *mesh = (Mesh *)object->data;
+TemporaryArray coords(mesh->totvert);
+for (uint j = 0; j < mesh->totvert; j++) {
+  coords[j] = transform.transform_position(mesh->mvert[j].co);
+}
+positions.extend_single(i, coords);
+  }
+}
+
 MF_ObjectWorldLocation::MF_ObjectWorldLocation()
 {
   MFSignatureBuilder signature("Object Location");
diff --git a/source/blender/functions/intern/multi_functions/mixed.h 
b/source/blender/functions/intern/multi_functions/mixed.h
index 8c7bc3467e0..6fad879459a 100644
--- a/source/blender/functions/intern/multi_functions/mixed.h
+++ b/source/blender/functions/intern/multi_functions/mixed.h
@@ -64,6 +64,12 @@ class MF_ObjectWorldLocation final : public MultiFunction {
   void call(const MFMask , MFParams , MFContext ) const 
override;
 };
 
+class MF_ObjectVertexPositions final : public MultiFunction {
+ public:
+  MF_ObjectVertexPositions();
+  void call(const MFMask , MFParams , MFContext ) const 
override;
+};
+
 class MF_TextLength final : public MultiFunction {
  public:
   MF_TextLength();
diff --git 
a/source/blender/functions/intern/vtree_multi_function_network/mappings_nodes.cc
 
b/source/blender/functions/intern/vtree_multi_function_network/mappings_nodes.cc
index 8b0dfcb45c1..85ea9c1d857 100644
--- 
a/source/blender/functions/intern/vtree_multi_function_network/mappings_nodes.cc
+++ 
b/source/blender/functions/intern/vtree_multi_function_network/mappings_nodes.cc
@@ -139,6 +139,12 @@ static void INSERT_object_location(VTreeMFNetworkBuilder 
, const VNode &
   builder.add_function(fn, {0}, {1}, vnode);
 }
 
+static void INSERT_object_mesh_info(VTreeMFNetworkBuilder , const 
VNode )
+{
+  const MultiFunction  = 
builder.construct_fn();
+  builder.add_function(fn, {0}, {1}, vnode);
+}
+
 static void INSERT_text_length(VTreeMFNetworkBuilder , const VNode 
)
 {
   const MultiFunction  = builder.construct_fn();
@@ -418,6 +424,7 @@ void add_vtree_node_mapping_info(VTreeMultiFunctionMappings 
)
   mappings.vnode_inserters.add_new("fn_PackListNode", INSERT_pack_list);
   mappings.vnode_inserters.add_new("fn_GetListElementNode", 
INSERT_get_list_element);
   mappings.vnode_inserters.add_new("fn_ObjectTransformsNode", 
INSERT_object_location);
+  mappings.vnode_inserters.add_new("fn_ObjectMeshNode", 
INSERT_object_mesh_info);
   mappings.vnode_inserters.add_new("fn_TextLengthNode", INSERT_text_length);
   mappings.vnode_inserters.add_new("fn_VertexInfoNode", INSERT_vertex_info);
   mappings.vnode_inserters.add_new("fn_FloatRangeNode", INSERT_float_range);

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


[Bf-blender-cvs] [2bae4dd5034] functions-experimental-refactor: remove some nodes for now

2019-11-08 Thread Jacques Lucke
Commit: 2bae4dd503488f41398c457a6fadeddef19af388
Author: Jacques Lucke
Date:   Fri Nov 8 17:33:29 2019 +0100
Branches: functions-experimental-refactor
https://developer.blender.org/rB2bae4dd503488f41398c457a6fadeddef19af388

remove some nodes for now

===

D   release/scripts/startup/nodes/function_nodes/clamp.py
D   release/scripts/startup/nodes/function_nodes/map_range.py

===

diff --git a/release/scripts/startup/nodes/function_nodes/clamp.py 
b/release/scripts/startup/nodes/function_nodes/clamp.py
deleted file mode 100644
index 392c69aa33c..000
--- a/release/scripts/startup/nodes/function_nodes/clamp.py
+++ /dev/null
@@ -1,12 +0,0 @@
-import bpy
-from .. base import FunctionNode
-
-class ClampNode(bpy.types.Node, FunctionNode):
-bl_idname = "fn_ClampNode"
-bl_label = "Clamp"
-
-def declaration(self, builder):
-builder.fixed_input("value", "Value", "Float")
-builder.fixed_input("min", "Min", "Float")
-builder.fixed_input("max", "Max", "Float")
-builder.fixed_output("result", "Result", "Float")
diff --git a/release/scripts/startup/nodes/function_nodes/map_range.py 
b/release/scripts/startup/nodes/function_nodes/map_range.py
deleted file mode 100644
index 01ddc998812..000
--- a/release/scripts/startup/nodes/function_nodes/map_range.py
+++ /dev/null
@@ -1,15 +0,0 @@
-import bpy
-from bpy.props import *
-from .. base import FunctionNode
-
-class MapRangeNode(bpy.types.Node, FunctionNode):
-bl_idname = "fn_MapRangeNode"
-bl_label = "Map Range"
-
-def declaration(self, builder):
-builder.fixed_input("value", "Value", "Float")
-builder.fixed_input("from_min", "From Min", "Float", default=0)
-builder.fixed_input("from_max", "From Max", "Float", default=1)
-builder.fixed_input("to_min", "To Min", "Float", default=0)
-builder.fixed_input("to_max", "To Max", "Float", default=1)
-builder.fixed_output("value", "Value", "Float")

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


[Bf-blender-cvs] [fa7c300edc7] functions-experimental-refactor: more vector math

2019-11-08 Thread Jacques Lucke
Commit: fa7c300edc79944fc63a0a3e643b18f53f346b2b
Author: Jacques Lucke
Date:   Fri Nov 8 16:27:58 2019 +0100
Branches: functions-experimental-refactor
https://developer.blender.org/rBfa7c300edc79944fc63a0a3e643b18f53f346b2b

more vector math

===

M   release/scripts/startup/nodes/function_nodes/float_math.py
M   source/blender/blenlib/BLI_math_cxx.h
M   
source/blender/functions/intern/vtree_multi_function_network/mappings_nodes.cc

===

diff --git a/release/scripts/startup/nodes/function_nodes/float_math.py 
b/release/scripts/startup/nodes/function_nodes/float_math.py
index e6cd2affd6b..3906e9b2371 100644
--- a/release/scripts/startup/nodes/function_nodes/float_math.py
+++ b/release/scripts/startup/nodes/function_nodes/float_math.py
@@ -69,3 +69,7 @@ AddVectorsNode = create_variadic_math_node("Vector", 
"fn_AddVectorsNode", "Add V
 SubtractVectorsNode = create_two_inputs_math_node("Vector", 
"fn_SubtractVectorsNode", "Subtract Vectors")
 MultiplyVectorsNode = create_variadic_math_node("Vector", 
"fn_MultiplyVectorsNode", "Multiply Vectors")
 DivideVectorsNode = create_two_inputs_math_node("Vector", 
"fn_DivideVectorsNode", "Divide Vectors")
+
+VectorCrossProductNode = create_two_inputs_math_node("Vector", 
"fn_VectorCrossProductNode", "Cross Product")
+VectorReflectNode = create_two_inputs_math_node("Vector", 
"fn_ReflectVectorNode", "Reflect Vector")
+VectorProjectNode = create_two_inputs_math_node("Vector", 
"fn_ProjectVectorNode", "Project Vector")
diff --git a/source/blender/blenlib/BLI_math_cxx.h 
b/source/blender/blenlib/BLI_math_cxx.h
index 925cb09cbcd..59f1ddd44ec 100644
--- a/source/blender/blenlib/BLI_math_cxx.h
+++ b/source/blender/blenlib/BLI_math_cxx.h
@@ -263,6 +263,20 @@ struct float3 {
 return a.x * b.x + a.y * b.y + a.z * b.z;
   }
 
+  static float3 cross_high_precision(float3 a, float3 b)
+  {
+float3 result;
+cross_v3_v3v3_hi_prec(result, a, b);
+return result;
+  }
+
+  static float3 project(float3 a, float3 b)
+  {
+float3 result;
+project_v3_v3v3(result, a, b);
+return result;
+  }
+
   static float distance(float3 a, float3 b)
   {
 return (a - b).length();
diff --git 
a/source/blender/functions/intern/vtree_multi_function_network/mappings_nodes.cc
 
b/source/blender/functions/intern/vtree_multi_function_network/mappings_nodes.cc
index b853ef199a5..f5ee47c53e8 100644
--- 
a/source/blender/functions/intern/vtree_multi_function_network/mappings_nodes.cc
+++ 
b/source/blender/functions/intern/vtree_multi_function_network/mappings_nodes.cc
@@ -9,12 +9,6 @@ namespace FN {
 
 using BLI::float3;
 
-static void INSERT_vector_math(VTreeMFNetworkBuilder , const VNode 
)
-{
-  const MultiFunction  = builder.construct_fn();
-  builder.add_function(fn, {0, 1}, {2}, vnode);
-}
-
 static const MultiFunction _vectorized_function(
 VTreeMFNetworkBuilder ,
 const MultiFunction _function,
@@ -39,15 +33,6 @@ static const MultiFunction _vectorized_function(
   }
 }
 
-static void INSERT_float_math(VTreeMFNetworkBuilder , const VNode 
)
-{
-  const MultiFunction _fn = builder.construct_fn();
-  const MultiFunction  = get_vectorized_function(
-  builder, base_fn, vnode.rna(), {"use_list__a", "use_list__b"});
-
-  builder.add_function(fn, {0, 1}, {2}, vnode);
-}
-
 static void INSERT_combine_vector(VTreeMFNetworkBuilder , const VNode 
)
 {
   const MultiFunction _fn = builder.construct_fn();
@@ -341,10 +326,28 @@ static void INSERT_divide_vectors(VTreeMFNetworkBuilder 
, const VNode 
   insert_two_inputs_math_function(builder, vnode);
 }
 
+static float3 vector_reflect_func_cb(float3 a, float3 b)
+{
+  return a.reflected(b.normalized());
+}
+
+static void INSERT_vector_cross_product(VTreeMFNetworkBuilder , const 
VNode )
+{
+  insert_two_inputs_math_function(builder, vnode);
+}
+
+static void INSERT_reflect_vector(VTreeMFNetworkBuilder , const VNode 
)
+{
+  insert_two_inputs_math_function(builder, 
vnode);
+}
+
+static void INSERT_project_vector(VTreeMFNetworkBuilder , const VNode 
)
+{
+  insert_two_inputs_math_function(builder, vnode);
+}
+
 void add_vtree_node_mapping_info(VTreeMultiFunctionMappings )
 {
-  mappings.vnode_inserters.add_new("fn_FloatMathNode", INSERT_float_math);
-  mappings.vnode_inserters.add_new("fn_VectorMathNode", INSERT_vector_math);
   mappings.vnode_inserters.add_new("fn_CombineVectorNode", 
INSERT_combine_vector);
   mappings.vnode_inserters.add_new("fn_SeparateVectorNode", 
INSERT_separate_vector);
   mappings.vnode_inserters.add_new("fn_ListLengthNode", INSERT_list_length);
@@ -374,6 +377,10 @@ void 
add_vtree_node_mapping_info(VTreeMultiFunctionMappings )
   mappings.vnode_inserters.add_new("fn_SubtractVectorsNode", 
INSERT_subtract_vectors);
   mappings.vnode_inserters.add_new("fn_MultiplyVectorsNode", 
INSERT_multiply_vectors);
   mappings.vnode_inserters.add_new("fn_DivideVectorsNode", 

[Bf-blender-cvs] [e390a51cc71] functions-experimental-refactor: bring back some vector math nodes

2019-11-08 Thread Jacques Lucke
Commit: e390a51cc713c13c4807d66d35afd825078d9e95
Author: Jacques Lucke
Date:   Fri Nov 8 16:12:43 2019 +0100
Branches: functions-experimental-refactor
https://developer.blender.org/rBe390a51cc713c13c4807d66d35afd825078d9e95

bring back some vector math nodes

===

M   release/scripts/startup/nodes/function_nodes/float_math.py
M   release/scripts/startup/nodes/function_nodes/vector.py
M   
source/blender/functions/intern/vtree_multi_function_network/mappings_nodes.cc

===

diff --git a/release/scripts/startup/nodes/function_nodes/float_math.py 
b/release/scripts/startup/nodes/function_nodes/float_math.py
index f08d3edebce..e6cd2affd6b 100644
--- a/release/scripts/startup/nodes/function_nodes/float_math.py
+++ b/release/scripts/startup/nodes/function_nodes/float_math.py
@@ -62,5 +62,10 @@ PowerFloatsNode = create_two_inputs_math_node("Float", 
"fn_PowerFloatsNode", "Po
 
 SqrtFloatNode = create_single_input_math_node("Float", "fn_SqrtFloatNode", 
"Sqrt Float")
 AbsFloatNode = create_single_input_math_node("Float", "fn_AbsoluteFloatNode", 
"Absolute Float")
-SineNode = create_single_input_math_node("Float", "fn_SineNode", "Sine")
-CosineNode = create_single_input_math_node("Float", "fn_CosineNode", "Cosine")
+SineFloatNode = create_single_input_math_node("Float", "fn_SineFloatNode", 
"Sine")
+CosineFloatNode = create_single_input_math_node("Float", "fn_CosineFloatNode", 
"Cosine")
+
+AddVectorsNode = create_variadic_math_node("Vector", "fn_AddVectorsNode", "Add 
Vectors")
+SubtractVectorsNode = create_two_inputs_math_node("Vector", 
"fn_SubtractVectorsNode", "Subtract Vectors")
+MultiplyVectorsNode = create_variadic_math_node("Vector", 
"fn_MultiplyVectorsNode", "Multiply Vectors")
+DivideVectorsNode = create_two_inputs_math_node("Vector", 
"fn_DivideVectorsNode", "Divide Vectors")
diff --git a/release/scripts/startup/nodes/function_nodes/vector.py 
b/release/scripts/startup/nodes/function_nodes/vector.py
index 50a4b772849..c9824f7128f 100644
--- a/release/scripts/startup/nodes/function_nodes/vector.py
+++ b/release/scripts/startup/nodes/function_nodes/vector.py
@@ -3,7 +3,7 @@ from bpy.props import *
 from .. base import FunctionNode
 from .. node_builder import NodeBuilder
 
-
+'''
 class VectorMathNode(bpy.types.Node, FunctionNode):
 bl_idname = "fn_VectorMathNode"
 bl_label = "Vector Math"
@@ -47,7 +47,7 @@ class VectorMathNode(bpy.types.Node, FunctionNode):
 
 def draw(self, layout):
 layout.prop(self, "operation", text="")
-
+'''
 
 class VectorDistanceNode(bpy.types.Node, FunctionNode):
 bl_idname = "fn_VectorDistanceNode"
diff --git 
a/source/blender/functions/intern/vtree_multi_function_network/mappings_nodes.cc
 
b/source/blender/functions/intern/vtree_multi_function_network/mappings_nodes.cc
index 4568308c31b..b853ef199a5 100644
--- 
a/source/blender/functions/intern/vtree_multi_function_network/mappings_nodes.cc
+++ 
b/source/blender/functions/intern/vtree_multi_function_network/mappings_nodes.cc
@@ -3,8 +3,12 @@
 
 #include "FN_multi_functions.h"
 
+#include "BLI_math_cxx.h"
+
 namespace FN {
 
+using BLI::float3;
+
 static void INSERT_vector_math(VTreeMFNetworkBuilder , const VNode 
)
 {
   const MultiFunction  = builder.construct_fn();
@@ -307,16 +311,36 @@ static void INSERT_abs_float(VTreeMFNetworkBuilder 
, const VNode )
   insert_single_input_math_function>(builder, vnode);
 }
 
-static void INSERT_sine(VTreeMFNetworkBuilder , const VNode )
+static void INSERT_sine_float(VTreeMFNetworkBuilder , const VNode 
)
 {
   insert_single_input_math_function>(builder, 
vnode);
 }
 
-static void INSERT_cosine(VTreeMFNetworkBuilder , const VNode )
+static void INSERT_cosine_float(VTreeMFNetworkBuilder , const VNode 
)
 {
   insert_single_input_math_function>(builder, 
vnode);
 }
 
+static void INSERT_add_vectors(VTreeMFNetworkBuilder , const VNode 
)
+{
+  insert_simple_math_function>(builder, vnode, {0, 
0, 0});
+}
+
+static void INSERT_subtract_vectors(VTreeMFNetworkBuilder , const 
VNode )
+{
+  insert_two_inputs_math_function>(builder, 
vnode);
+}
+
+static void INSERT_multiply_vectors(VTreeMFNetworkBuilder , const 
VNode )
+{
+  insert_simple_math_function>(builder, vnode, {1, 
1, 1});
+}
+
+static void INSERT_divide_vectors(VTreeMFNetworkBuilder , const VNode 
)
+{
+  insert_two_inputs_math_function(builder, vnode);
+}
+
 void add_vtree_node_mapping_info(VTreeMultiFunctionMappings )
 {
   mappings.vnode_inserters.add_new("fn_FloatMathNode", INSERT_float_math);
@@ -343,8 +367,13 @@ void 
add_vtree_node_mapping_info(VTreeMultiFunctionMappings )
 
   mappings.vnode_inserters.add_new("fn_SqrtFloatNode", INSERT_sqrt_float);
   mappings.vnode_inserters.add_new("fn_AbsoluteFloatNode", INSERT_abs_float);
-  mappings.vnode_inserters.add_new("fn_SineNode", INSERT_sine);
-  mappings.vnode_inserters.add_new("fn_CosineNode", INSERT_cosine);
+  

[Bf-blender-cvs] [9c5e02d1d30] greasepencil-object: GPencil: Rename Tint to Vertex Paint

2019-11-08 Thread Antonio Vazquez
Commit: 9c5e02d1d30761f2b94cef6f1d797c798d8cbd8c
Author: Antonio Vazquez
Date:   Fri Nov 8 18:28:21 2019 +0100
Branches: greasepencil-object
https://developer.blender.org/rB9c5e02d1d30761f2b94cef6f1d797c798d8cbd8c

GPencil: Rename Tint to Vertex Paint

===

M   release/scripts/presets/keyconfig/keymap_data/blender_default.py
M   
release/scripts/presets/keyconfig/keymap_data/industry_compatible_data.py
M   release/scripts/startup/bl_ui/space_toolsystem_toolbar.py
M   source/blender/editors/gpencil/CMakeLists.txt
M   source/blender/editors/gpencil/gpencil_intern.h
M   source/blender/editors/gpencil/gpencil_ops.c
R084source/blender/editors/gpencil/gpencil_tint.c   
source/blender/editors/gpencil/gpencil_vertex_paint.c

===

diff --git a/release/scripts/presets/keyconfig/keymap_data/blender_default.py 
b/release/scripts/presets/keyconfig/keymap_data/blender_default.py
index 02f543bed01..5de0e04c3e5 100644
--- a/release/scripts/presets/keyconfig/keymap_data/blender_default.py
+++ b/release/scripts/presets/keyconfig/keymap_data/blender_default.py
@@ -3282,9 +3282,9 @@ def km_grease_pencil_stroke_paint_tint(params):
 
 items.extend([
 # Tint
-("gpencil.tint", {"type": 'LEFTMOUSE', "value": 'PRESS'},
+("gpencil.vertex_paint", {"type": 'LEFTMOUSE', "value": 'PRESS'},
  {"properties": [("wait_for_input", False)]}),
-("gpencil.tint", {"type": 'LEFTMOUSE', "value": 'PRESS', "ctrl": True},
+("gpencil.vertex_paint", {"type": 'LEFTMOUSE', "value": 'PRESS', 
"ctrl": True},
  {"properties": [("wait_for_input", False)]}),
 ])
 
@@ -3386,9 +3386,9 @@ def km_grease_pencil_stroke_vertex_draw(params):
 
 items.extend([
 # Tint
-("gpencil.tint", {"type": 'LEFTMOUSE', "value": 'PRESS'},
+("gpencil.vertex_paint", {"type": 'LEFTMOUSE', "value": 'PRESS'},
  {"properties": [("wait_for_input", False)]}),
-("gpencil.tint", {"type": 'LEFTMOUSE', "value": 'PRESS', "ctrl": True},
+("gpencil.vertex_paint", {"type": 'LEFTMOUSE', "value": 'PRESS', 
"ctrl": True},
  {"properties": [("wait_for_input", False)]}),
 # Brush strength
 ("wm.radial_control", {"type": 'F', "value": 'PRESS', "shift": True},
@@ -3411,9 +3411,9 @@ def km_grease_pencil_stroke_vertex_blur(params):
 
 items.extend([
 # Tint
-("gpencil.tint", {"type": 'LEFTMOUSE', "value": 'PRESS'},
+("gpencil.vertex_paint", {"type": 'LEFTMOUSE', "value": 'PRESS'},
  {"properties": [("wait_for_input", False)]}),
-("gpencil.tint", {"type": 'LEFTMOUSE', "value": 'PRESS', "ctrl": True},
+("gpencil.vertex_paint", {"type": 'LEFTMOUSE', "value": 'PRESS', 
"ctrl": True},
  {"properties": [("wait_for_input", False)]}),
 # Brush strength
 ("wm.radial_control", {"type": 'F', "value": 'PRESS', "shift": True},
@@ -3436,9 +3436,9 @@ def km_grease_pencil_stroke_vertex_average(params):
 
 items.extend([
 # Tint
-("gpencil.tint", {"type": 'LEFTMOUSE', "value": 'PRESS'},
+("gpencil.vertex_paint", {"type": 'LEFTMOUSE', "value": 'PRESS'},
  {"properties": [("wait_for_input", False)]}),
-("gpencil.tint", {"type": 'LEFTMOUSE', "value": 'PRESS', "ctrl": True},
+("gpencil.vertex_paint", {"type": 'LEFTMOUSE', "value": 'PRESS', 
"ctrl": True},
  {"properties": [("wait_for_input", False)]}),
 # Brush strength
 ("wm.radial_control", {"type": 'F', "value": 'PRESS', "shift": True},
@@ -3461,9 +3461,9 @@ def km_grease_pencil_stroke_vertex_smear(params):
 
 items.extend([
 # Tint
-("gpencil.tint", {"type": 'LEFTMOUSE', "value": 'PRESS'},
+("gpencil.vertex_paint", {"type": 'LEFTMOUSE', "value": 'PRESS'},
  {"properties": [("wait_for_input", False)]}),
-("gpencil.tint", {"type": 'LEFTMOUSE', "value": 'PRESS', "ctrl": True},
+("gpencil.vertex_paint", {"type": 'LEFTMOUSE', "value": 'PRESS', 
"ctrl": True},
  {"properties": [("wait_for_input", False)]}),
 # Brush strength
 ("wm.radial_control", {"type": 'F', "value": 'PRESS', "shift": True},
diff --git 
a/release/scripts/presets/keyconfig/keymap_data/industry_compatible_data.py 
b/release/scripts/presets/keyconfig/keymap_data/industry_compatible_data.py
index d0e0c73308a..037c3462dd7 100644
--- a/release/scripts/presets/keyconfig/keymap_data/industry_compatible_data.py
+++ b/release/scripts/presets/keyconfig/keymap_data/industry_compatible_data.py
@@ -2471,9 +2471,9 @@ def km_grease_pencil_stroke_paint_tint(params):
 
 items.extend([
 # Tint
-("gpencil.tint", {"type": 'LEFTMOUSE', "value": 'PRESS'},
+("gpencil.vertex_paint", {"type": 'LEFTMOUSE', "value": 'PRESS'},
  {"properties": [("wait_for_input", False)]}),
-

[Bf-blender-cvs] [e62b3dd3f51] sybren-usd: USD: added gtest for abstract hierarchy iterator

2019-11-08 Thread Sybren A. Stüvel
Commit: e62b3dd3f51af46453985db0aaa881c625fba955
Author: Sybren A. Stüvel
Date:   Fri Nov 8 16:27:00 2019 +0100
Branches: sybren-usd
https://developer.blender.org/rBe62b3dd3f51af46453985db0aaa881c625fba955

USD: added gtest for abstract hierarchy iterator

This test loads a blend file and asserts that the export paths are
reported correctly by the abstract hierarchy iterator.

===

M   source/blender/usd/intern/abstract_hierarchy_iterator.cc
M   source/blender/usd/intern/abstract_hierarchy_iterator.h
M   tests/gtests/CMakeLists.txt
M   tests/gtests/alembic/CMakeLists.txt
A   tests/gtests/usd/CMakeLists.txt
A   tests/gtests/usd/usd_export_hierarchy_iterator_test.cc

===

diff --git a/source/blender/usd/intern/abstract_hierarchy_iterator.cc 
b/source/blender/usd/intern/abstract_hierarchy_iterator.cc
index 9eb3c5d6ff2..d7f174396f5 100644
--- a/source/blender/usd/intern/abstract_hierarchy_iterator.cc
+++ b/source/blender/usd/intern/abstract_hierarchy_iterator.cc
@@ -51,6 +51,10 @@ void HierarchyContext::mark_as_not_instanced()
   original_export_path.clear();
 }
 
+AbstractHierarchyWriter::~AbstractHierarchyWriter()
+{
+}
+
 AbstractHierarchyIterator::AbstractHierarchyIterator(Depsgraph *depsgraph)
 : depsgraph(depsgraph), writers()
 {
diff --git a/source/blender/usd/intern/abstract_hierarchy_iterator.h 
b/source/blender/usd/intern/abstract_hierarchy_iterator.h
index ff5cfbcb05a..8e4039e54d6 100644
--- a/source/blender/usd/intern/abstract_hierarchy_iterator.h
+++ b/source/blender/usd/intern/abstract_hierarchy_iterator.h
@@ -89,6 +89,7 @@ struct HierarchyContext {
 
 class AbstractHierarchyWriter {
  public:
+  virtual ~AbstractHierarchyWriter();
   virtual void write(HierarchyContext ) = 0;
   // TODO(Sybren): add function like unused_during_iteration() that's called 
when a writer was
   // previously created, but wasn't used this iteration.
diff --git a/tests/gtests/CMakeLists.txt b/tests/gtests/CMakeLists.txt
index 285b414e997..b2ff5830ad9 100644
--- a/tests/gtests/CMakeLists.txt
+++ b/tests/gtests/CMakeLists.txt
@@ -18,4 +18,7 @@ if(WITH_GTESTS)
   if(WITH_ALEMBIC)
 add_subdirectory(alembic)
   endif()
+  if(WITH_USD)
+add_subdirectory(usd)
+  endif()
 endif()
diff --git a/tests/gtests/alembic/CMakeLists.txt 
b/tests/gtests/alembic/CMakeLists.txt
index 57b1fb52022..7da33a096e9 100644
--- a/tests/gtests/alembic/CMakeLists.txt
+++ b/tests/gtests/alembic/CMakeLists.txt
@@ -22,6 +22,7 @@ set(INC
   .
   ..
   ../../../source/blender/blenlib
+  ../../../source/blender/blenloader
   ../../../source/blender/blenkernel
   ../../../source/blender/alembic
   ../../../source/blender/makesdna
diff --git a/tests/gtests/alembic/CMakeLists.txt 
b/tests/gtests/usd/CMakeLists.txt
similarity index 85%
copy from tests/gtests/alembic/CMakeLists.txt
copy to tests/gtests/usd/CMakeLists.txt
index 57b1fb52022..8f5897d551f 100644
--- a/tests/gtests/alembic/CMakeLists.txt
+++ b/tests/gtests/usd/CMakeLists.txt
@@ -22,21 +22,24 @@ set(INC
   .
   ..
   ../../../source/blender/blenlib
+  ../../../source/blender/blenloader
   ../../../source/blender/blenkernel
-  ../../../source/blender/alembic
+  ../../../source/blender/usd
   ../../../source/blender/makesdna
+  ../../../source/blender/makesrna
   ../../../source/blender/depsgraph
-  ${ALEMBIC_INCLUDE_DIRS}
+  ../../../intern/guardedalloc
+  ${USD_INCLUDE_DIRS}
   ${BOOST_INCLUDE_DIR}
   ${HDF5_INCLUDE_DIRS}
   ${OPENEXR_INCLUDE_DIRS}
 )
 
 set(LIB
-  bf_blenloader  # Should not be needed but gives linking error without it.
+  bf_blenloader
   bf_intern_opencolorio # Should not be needed but gives windows linker errors 
if the ocio libs are linked before this
   bf_gpu # Should not be needed but gives windows linker errors if the ocio 
libs are linked before this
-  bf_alembic
+  bf_usd
 )
 
 include_directories(${INC})
@@ -51,8 +54,8 @@ else()
 endif()
 
 # For motivation on doubling BLENDER_SORTED_LIBS, see ../bmesh/CMakeLists.txt
-BLENDER_SRC_GTEST(alembic 
"abc_matrix_test.cc;abc_export_test.cc;${_buildinfo_src}" "${LIB}")
+BLENDER_SRC_GTEST(usd 
"usd_export_hierarchy_iterator_test.cc;${_buildinfo_src}" "${LIB}")
 
 unset(_buildinfo_src)
 
-setup_liblinks(alembic_test)
+setup_liblinks(usd_test)
diff --git a/tests/gtests/usd/usd_export_hierarchy_iterator_test.cc 
b/tests/gtests/usd/usd_export_hierarchy_iterator_test.cc
new file mode 100644
index 000..c8f34c0fad9
--- /dev/null
+++ b/tests/gtests/usd/usd_export_hierarchy_iterator_test.cc
@@ -0,0 +1,258 @@
+#include "testing/testing.h"
+
+// Keep first since utildefines defines AT which conflicts with STL
+#include "intern/abstract_hierarchy_iterator.h"
+
+extern "C" {
+#include "BKE_blender.h"
+#include "BKE_main.h"
+#include "BKE_modifier.h"
+#include "BKE_node.h"
+#include "BKE_scene.h"
+
+#include "BLI_utildefines.h"
+#include "BLI_math.h"
+
+#include 

[Bf-blender-cvs] [fadb658ede9] sybren-usd: USD: Removed `as_background_job` parameter from export operator

2019-11-08 Thread Sybren A. Stüvel
Commit: fadb658ede9cb9bd7ab10696211b2902840305a4
Author: Sybren A. Stüvel
Date:   Fri Nov 8 17:36:32 2019 +0100
Branches: sybren-usd
https://developer.blender.org/rBfadb658ede9cb9bd7ab10696211b2902840305a4

USD: Removed `as_background_job` parameter from export operator

The switch between foreground and background exports is now solely done
by respectively executing and invoking the export operator.

The `op->customdata` pointer is interpreted as an integer, and a bit is
set to indicate whether a background job should be run or not.

===

M   source/blender/editors/io/io_usd.c

===

diff --git a/source/blender/editors/io/io_usd.c 
b/source/blender/editors/io/io_usd.c
index a8b3aab884f..901cddb342a 100644
--- a/source/blender/editors/io/io_usd.c
+++ b/source/blender/editors/io/io_usd.c
@@ -30,6 +30,7 @@
 
 #  include "BLI_path_util.h"
 #  include "BLI_string.h"
+#  include "BLI_utildefines.h"
 
 #  include "RNA_access.h"
 #  include "RNA_define.h"
@@ -59,11 +60,14 @@ const EnumPropertyItem 
rna_enum_usd_export_evaluation_mode_items[] = {
 {0, NULL, 0, NULL, NULL},
 };
 
+/* Stored in the wmOperator's customdata field to indicate it should run as a 
background job.
+ * This is set when the operator is invoked, and not set when it is only 
executed. */
+#  define AS_BACKGROUND_JOB 1
+
 static int wm_usd_export_invoke(bContext *C, wmOperator *op, const wmEvent 
*event)
 {
-  if (!RNA_struct_property_is_set(op->ptr, "as_background_job")) {
-RNA_boolean_set(op->ptr, "as_background_job", true);
-  }
+  /* Mark this operator call as 'invoked', so that it'll run as a background 
job. */
+  op->customdata = POINTER_FROM_INT(AS_BACKGROUND_JOB);
 
   if (!RNA_struct_property_is_set(op->ptr, "filepath")) {
 Main *bmain = CTX_data_main(C);
@@ -97,7 +101,7 @@ static int wm_usd_export_exec(bContext *C, wmOperator *op)
   char filename[FILE_MAX];
   RNA_string_get(op->ptr, "filepath", filename);
 
-  const bool as_background_job = RNA_boolean_get(op->ptr, "as_background_job");
+  const bool as_background_job = (POINTER_AS_INT(op->customdata) & 
AS_BACKGROUND_JOB) != 0;
   const bool selected_objects_only = RNA_boolean_get(op->ptr, 
"selected_objects_only");
   const bool visible_objects_only = RNA_boolean_get(op->ptr, 
"visible_objects_only");
   const bool export_animation = RNA_boolean_get(op->ptr, "export_animation");
@@ -218,15 +222,6 @@ void WM_OT_usd_export(struct wmOperatorType *ot)
DAG_EVAL_RENDER,
"Evaluation Mode",
"Determines visibility of objects and modifier settings");
-
-  RNA_def_boolean(
-  ot->srna,
-  "as_background_job",
-  false,
-  "Run as Background Job",
-  "Enable this to run the import in the background, disable to block 
Blender while importing. "
-  "This option is deprecated; EXECUTE this operator to run in the 
foreground, and INVOKE it "
-  "to run as a background job");
 }
 
 #endif /* WITH_USD */

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


[Bf-blender-cvs] [9b51f79ba7e] sybren-usd: Merge remote-tracking branch 'origin/master' into sybren-usd

2019-11-08 Thread Sybren A. Stüvel
Commit: 9b51f79ba7efdac827a61321297f3615537538e1
Author: Sybren A. Stüvel
Date:   Fri Nov 8 16:29:40 2019 +0100
Branches: sybren-usd
https://developer.blender.org/rB9b51f79ba7efdac827a61321297f3615537538e1

Merge remote-tracking branch 'origin/master' into sybren-usd

===



===



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


[Bf-blender-cvs] [bcf008516f6] master: UI: Graph Editor Insert Keyframes Menu

2019-11-08 Thread Harley Acheson
Commit: bcf008516f6e149b52ef50690405a2f79ea61c01
Author: Harley Acheson
Date:   Fri Nov 8 08:48:05 2019 -0800
Branches: master
https://developer.blender.org/rBbcf008516f6e149b52ef50690405a2f79ea61c01

UI: Graph Editor Insert Keyframes Menu

Fixes alignment issues on Graph Editor menus used to insert keyframes.

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

Reviewed by Campbell Barton

===

M   source/blender/editors/space_graph/graph_edit.c

===

diff --git a/source/blender/editors/space_graph/graph_edit.c 
b/source/blender/editors/space_graph/graph_edit.c
index 59cf5f63de3..02d5eed4822 100644
--- a/source/blender/editors/space_graph/graph_edit.c
+++ b/source/blender/editors/space_graph/graph_edit.c
@@ -579,7 +579,6 @@ static const EnumPropertyItem 
prop_graphkeys_insertkey_types[] = {
  0,
  "Only Selected Channels",
  "Insert a keyframe on selected F-Curves using each curve's current 
value"},
-{0, "", 0, "", ""},
 {GRAPHKEYS_INSERTKEY_ACTIVE | GRAPHKEYS_INSERTKEY_CURSOR,
  "CURSOR_ACTIVE",
  0,

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


[Bf-blender-cvs] [8c695404a48] blender-v2.81-release: Fix T70778: Library Override dissabled after re-instancing same collection in different scene.

2019-11-08 Thread Bastien Montagne
Commit: 8c695404a481488879eb811b04e126fcdb92a915
Author: Bastien Montagne
Date:   Fri Nov 8 17:47:48 2019 +0100
Branches: blender-v2.81-release
https://developer.blender.org/rB8c695404a481488879eb811b04e126fcdb92a915

Fix T70778: Library Override dissabled after re-instancing same collection in 
different scene.

Very stupid mistake in own new generic ID lib_link function, that would try
to link ID pointers for all data-blocks, not only those actually needing it.

===

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

===

diff --git a/source/blender/blenloader/intern/readfile.c 
b/source/blender/blenloader/intern/readfile.c
index 452e75081d6..167917f7b6a 100644
--- a/source/blender/blenloader/intern/readfile.c
+++ b/source/blender/blenloader/intern/readfile.c
@@ -2618,10 +2618,13 @@ static void lib_link_id(FileData *fd, Main *main)
 ID *id;
 
 for (id = lb->first; id; id = id->next) {
-  if (id->override_library) {
-id->override_library->reference = newlibadr_us(
-fd, id->lib, id->override_library->reference);
-id->override_library->storage = newlibadr_us(fd, id->lib, 
id->override_library->storage);
+  if (id->tag & LIB_TAG_NEED_LINK) {
+if (id->override_library) {
+  id->override_library->reference = newlibadr_us(
+  fd, id->lib, id->override_library->reference);
+  id->override_library->storage = newlibadr_us(fd, id->lib, 
id->override_library->storage);
+}
+/* DO NOT clear LIB_TAG_NEED_LINK here, it is used again by 
per-ID-type linkers. */
   }
 }
   }

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


[Bf-blender-cvs] [f0bee884439] master: Merge branch 'blender-v2.81-release'

2019-11-08 Thread Bastien Montagne
Commit: f0bee884439af6d5e840fda1f6b55da064f386b5
Author: Bastien Montagne
Date:   Fri Nov 8 17:48:30 2019 +0100
Branches: master
https://developer.blender.org/rBf0bee884439af6d5e840fda1f6b55da064f386b5

Merge branch 'blender-v2.81-release'

===



===



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


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

2019-11-08 Thread Antonio Vazquez
Commit: 900100e85956131cc1683559a87c76d6ad5974b2
Author: Antonio Vazquez
Date:   Fri Nov 8 17:09:59 2019 +0100
Branches: greasepencil-object
https://developer.blender.org/rB900100e85956131cc1683559a87c76d6ad5974b2

Merge branch 'master' into greasepencil-object

===



===



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


[Bf-blender-cvs] [d3d1eee154c] greasepencil-object: GPencil: Add multiframe support to Vertex Paint

2019-11-08 Thread Antonio Vazquez
Commit: d3d1eee154c8362474ddf2a80965143c37f53f4a
Author: Antonio Vazquez
Date:   Fri Nov 8 17:08:12 2019 +0100
Branches: greasepencil-object
https://developer.blender.org/rBd3d1eee154c8362474ddf2a80965143c37f53f4a

GPencil: Add multiframe support to Vertex Paint

===

M   release/scripts/startup/bl_ui/space_view3d.py
M   source/blender/makesdna/DNA_gpencil_types.h

===

diff --git a/release/scripts/startup/bl_ui/space_view3d.py 
b/release/scripts/startup/bl_ui/space_view3d.py
index 0d19a2f2e12..346bce38bf2 100644
--- a/release/scripts/startup/bl_ui/space_view3d.py
+++ b/release/scripts/startup/bl_ui/space_view3d.py
@@ -662,7 +662,7 @@ class VIEW3D_HT_header(Header):
 row.prop(tool_settings, 
"use_gpencil_vertex_select_mask_stroke", text="")
 row.prop(tool_settings, 
"use_gpencil_vertex_select_mask_segment", text="")
 
-if gpd.use_stroke_edit_mode or gpd.is_stroke_sculpt_mode or 
gpd.is_stroke_weight_mode:
+if gpd.use_stroke_edit_mode or gpd.is_stroke_sculpt_mode or 
gpd.is_stroke_weight_mode or gpd.is_stroke_vertex_mode:
 row = layout.row(align=True)
 row.prop(gpd, "use_multiedit", text="", 
icon='GP_MULTIFRAME_EDITING')
 
diff --git a/source/blender/makesdna/DNA_gpencil_types.h 
b/source/blender/makesdna/DNA_gpencil_types.h
index 60c83b091b4..2fcd0e18933 100644
--- a/source/blender/makesdna/DNA_gpencil_types.h
+++ b/source/blender/makesdna/DNA_gpencil_types.h
@@ -668,8 +668,8 @@ typedef enum eGP_DrawMode {
 /* Check if 'multiedit sessions' is enabled */
 #define GPENCIL_MULTIEDIT_SESSIONS_ON(gpd) \
   ((gpd) && \
-   (gpd->flag & \
-(GP_DATA_STROKE_EDITMODE | GP_DATA_STROKE_SCULPTMODE | 
GP_DATA_STROKE_WEIGHTMODE)) && \
+   (gpd->flag & (GP_DATA_STROKE_EDITMODE | GP_DATA_STROKE_SCULPTMODE | \
+ GP_DATA_STROKE_WEIGHTMODE | GP_DATA_STROKE_VERTEXMODE)) && \
(gpd->flag & GP_DATA_STROKE_MULTIEDIT))
 
 /* Macros to check grease pencil modes */

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


[Bf-blender-cvs] [a67aa11b12e] master: Windows: Switch to the dynamic C runtime

2019-11-08 Thread Ray Molenkamp
Commit: a67aa11b12ec27a1abb9badb513a516c8d90daf5
Author: Ray Molenkamp
Date:   Fri Nov 8 09:01:00 2019 -0700
Branches: master
https://developer.blender.org/rBa67aa11b12ec27a1abb9badb513a516c8d90daf5

Windows: Switch to the dynamic C runtime

This change switches windows to the dynamic C runtime
avoiding issues coming from mixing the static and dynamic
runtime like the ones outlined in [1]

[1] https://developer.blender.org/D5387#122165

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

Reviewed by: @Sergey

===

M   build_files/build_environment/cmake/alembic.cmake
M   build_files/build_environment/cmake/boost.cmake
M   build_files/build_environment/cmake/clang.cmake
M   build_files/build_environment/cmake/harvest.cmake
M   build_files/build_environment/cmake/llvm.cmake
M   build_files/build_environment/cmake/opencolorio.cmake
M   build_files/build_environment/cmake/openimageio.cmake
M   build_files/build_environment/cmake/opensubdiv.cmake
M   build_files/build_environment/cmake/openvdb.cmake
M   build_files/build_environment/cmake/options.cmake
M   build_files/build_environment/cmake/osl.cmake
M   build_files/build_environment/cmake/versions.cmake
M   build_files/build_environment/cmake/webp.cmake
M   build_files/build_environment/cmake/yamlcpp.cmake
M   build_files/build_environment/patches/opencollada.diff
M   build_files/cmake/macros.cmake
M   build_files/cmake/platform/platform_win32.cmake
M   build_files/windows/check_libraries.cmd
M   build_files/windows/find_dependencies.cmd
M   build_files/windows/format.cmd
M   intern/cycles/CMakeLists.txt
M   intern/openvdb/CMakeLists.txt
M   source/blender/blenlib/intern/expr_pylike_eval.c

===

diff --git a/build_files/build_environment/cmake/alembic.cmake 
b/build_files/build_environment/cmake/alembic.cmake
index fa2d7243f7d..49c54ff6e82 100644
--- a/build_files/build_environment/cmake/alembic.cmake
+++ b/build_files/build_environment/cmake/alembic.cmake
@@ -40,7 +40,7 @@ set(ALEMBIC_EXTRA_ARGS
   -DBoost_USE_MULTITHREADED=ON
   -DUSE_STATIC_BOOST=On
   -DBoost_USE_STATIC_LIBS=ON
-  -DBoost_USE_STATIC_RUNTIME=ON
+  -DBoost_USE_STATIC_RUNTIME=OFF
   -DBoost_DEBUG=ON
   -DBOOST_ROOT=${LIBDIR}/boost
   -DBoost_NO_SYSTEM_PATHS=ON
diff --git a/build_files/build_environment/cmake/boost.cmake 
b/build_files/build_environment/cmake/boost.cmake
index fabc055ce29..4c5ce749cd5 100644
--- a/build_files/build_environment/cmake/boost.cmake
+++ b/build_files/build_environment/cmake/boost.cmake
@@ -29,13 +29,13 @@ if(WIN32)
 set(PYTHON_OUTPUTDIR 
${BUILD_DIR}/python/src/external_python/pcbuild/win32/)
 set(BOOST_ADDRESS_MODEL 32)
   endif()
-  if(MSVC14)
-set(BOOST_TOOLSET toolset=msvc-14.0)
-set(BOOST_COMPILER_STRING -vc140)
-  endif()
+
+  set(BOOST_TOOLSET toolset=msvc-14.1)
+  set(BOOST_COMPILER_STRING -vc141)
+
   set(BOOST_CONFIGURE_COMMAND bootstrap.bat)
   set(BOOST_BUILD_COMMAND bjam)
-  set(BOOST_BUILD_OPTIONS runtime-link=static )
+  set(BOOST_BUILD_OPTIONS runtime-link=shared )
   set(BOOST_HARVEST_CMD   ${CMAKE_COMMAND} -E copy_directory 
${LIBDIR}/boost/lib/ ${HARVEST_TARGET}/boost/lib/ )
   if(BUILD_MODE STREQUAL Release)
 set(BOOST_HARVEST_CMD ${BOOST_HARVEST_CMD} && ${CMAKE_COMMAND} -E 
copy_directory ${LIBDIR}/boost/include/boost-1_68/ 
${HARVEST_TARGET}/boost/include/)
diff --git a/build_files/build_environment/cmake/clang.cmake 
b/build_files/build_environment/cmake/clang.cmake
index f1f537baf1d..3231a339e17 100644
--- a/build_files/build_environment/cmake/clang.cmake
+++ b/build_files/build_environment/cmake/clang.cmake
@@ -19,8 +19,8 @@
 set(CLANG_EXTRA_ARGS
   -DCLANG_PATH_TO_LLVM_SOURCE=${BUILD_DIR}/ll/src/ll
   -DCLANG_PATH_TO_LLVM_BUILD=${LIBDIR}/llvm
-  -DLLVM_USE_CRT_RELEASE=MT
-  -DLLVM_USE_CRT_DEBUG=MTd
+  -DLLVM_USE_CRT_RELEASE=MD
+  -DLLVM_USE_CRT_DEBUG=MDd
   -DLLVM_CONFIG=${LIBDIR}/llvm/bin/llvm-config
 )
 
diff --git a/build_files/build_environment/cmake/harvest.cmake 
b/build_files/build_environment/cmake/harvest.cmake
index cc596b2c786..38820dfb673 100644
--- a/build_files/build_environment/cmake/harvest.cmake
+++ b/build_files/build_environment/cmake/harvest.cmake
@@ -53,8 +53,6 @@ if(BUILD_MODE STREQUAL Release)
 ${CMAKE_COMMAND} -E copy_directory ${LIBDIR}/tiff/include/ 
${HARVEST_TARGET}/tiff/include/ &&
 # hidapi
 ${CMAKE_COMMAND} -E copy_directory ${LIBDIR}/hidapi/ 
${HARVEST_TARGET}/hidapi/ &&
-# webp, straight up copy
-${CMAKE_COMMAND} -E copy_directory ${LIBDIR}/webp 
${HARVEST_TARGET}/webp &&
 DEPENDS
   )
 endif()
diff --git a/build_files/build_environment/cmake/llvm.cmake 
b/build_files/build_environment/cmake/llvm.cmake
index 8acf6b56e3d..dc1a5cf8a80 100644
--- a/build_files/build_environment/cmake/llvm.cmake
+++ 

[Bf-blender-cvs] [5e4517819c5] greasepencil-object: GPencil: Don't check mask in Draw mode

2019-11-08 Thread Antonio Vazquez
Commit: 5e4517819c5c7f2428734f09f4cc0a3affa30e8e
Author: Antonio Vazquez
Date:   Fri Nov 8 16:51:01 2019 +0100
Branches: greasepencil-object
https://developer.blender.org/rB5e4517819c5c7f2428734f09f4cc0a3affa30e8e

GPencil: Don't check mask in Draw mode

Also some code cleanup

===

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

===

diff --git a/source/blender/editors/gpencil/gpencil_tint.c 
b/source/blender/editors/gpencil/gpencil_tint.c
index e6751e8e299..571f2e9e1b7 100644
--- a/source/blender/editors/gpencil/gpencil_tint.c
+++ b/source/blender/editors/gpencil/gpencil_tint.c
@@ -59,10 +59,16 @@
 /*  */
 /* General Brush Editing Context */
 
+/* Temp Flags while Tinting. */
+typedef enum eGPDvertex_brush_Flag {
+  /* invert the effect of the brush */
+  GP_VERTEX_FLAG_INVERT = (1 << 0),
+  /* temporary invert action */
+  GP_VERTEX_FLAG_TMP_INVERT = (1 << 1),
+} eGPDvertex_brush_Flag;
+
 /* Context for brush operators */
 typedef struct tGP_BrushTintData {
-  /* Current editor/region/etc. */
-  /* NOTE: This stuff is mainly needed to handle 3D view projection stuff... */
   struct Main *bmain;
   Scene *scene;
   Object *object;
@@ -74,8 +80,7 @@ typedef struct tGP_BrushTintData {
   bGPdata *gpd;
 
   Brush *brush;
-  eGP_Sculpt_Flag flag;
-
+  eGPDvertex_brush_Flag flag;
   eGP_Vertex_SelectMaskFlag mask;
 
   /* Space Conversion Data */
@@ -102,9 +107,6 @@ typedef struct tGP_BrushTintData {
   /* - effect vector */
   float dvec[3];
 
-  /* rotation for evaluated data */
-  float rot_eval;
-
   /* - multiframe falloff factor */
   float mf_falloff;
 
@@ -117,12 +119,8 @@ typedef struct tGP_BrushTintData {
 } tGP_BrushTintData;
 
 /* Callback for performing some brush operation on a single point */
-typedef bool (*GP_TintApplyCb)(tGP_BrushTintData *gso,
-   bGPDstroke *gps,
-   float rotation,
-   int pt_index,
-   const int radius,
-   const int co[2]);
+typedef bool (*GP_TintApplyCb)(
+tGP_BrushTintData *gso, bGPDstroke *gps, int pt_index, const int radius, 
const int co[2]);
 
 /* Brush Operations --- */
 
@@ -133,7 +131,7 @@ static bool brush_invert_check(tGP_BrushTintData *gso)
   bool invert = false;
 
   /* During runtime, the user can hold down the Ctrl key to invert the basic 
behavior */
-  if (gso->flag & GP_SCULPT_FLAG_INVERT) {
+  if (gso->flag & GP_VERTEX_FLAG_INVERT) {
 invert ^= true;
   }
 
@@ -183,16 +181,6 @@ static void brush_grab_calc_dvec(tGP_BrushTintData *gso)
   mval_f[0] = (float)(gso->mval[0] - gso->mval_prev[0]);
   mval_f[1] = (float)(gso->mval[1] - gso->mval_prev[1]);
 
-  /* apply evaluated data transformation */
-  if (gso->rot_eval != 0.0f) {
-const float cval = cos(gso->rot_eval);
-const float sval = sin(gso->rot_eval);
-float r[2];
-r[0] = (mval_f[0] * cval) - (mval_f[1] * sval);
-r[1] = (mval_f[0] * sval) + (mval_f[1] * cval);
-copy_v2_v2(mval_f, r);
-  }
-
   ED_view3d_win_to_delta(gso->ar, mval_f, gso->dvec, zfac);
 }
 
@@ -230,12 +218,8 @@ static bool brush_fill_asspply(tGP_BrushTintData *gso,
 }
 
 /* Tint Brush */
-static bool brush_tint_apply(tGP_BrushTintData *gso,
- bGPDstroke *gps,
- float UNUSED(rot_eval),
- int pt_index,
- const int radius,
- const int co[2])
+static bool brush_tint_apply(
+tGP_BrushTintData *gso, bGPDstroke *gps, int pt_index, const int radius, 
const int co[2])
 {
   Brush *brush = gso->brush;
 
@@ -359,7 +343,7 @@ static void gptint_brush_exit(bContext *C, wmOperator *op)
   ED_gpencil_toggle_brush_cursor(C, false, NULL);
 
   /* disable temp invert flag */
-  gso->brush->flag &= ~GP_SCULPT_FLAG_TMP_INVERT;
+  gso->brush->flag &= ~GP_VERTEX_FLAG_TMP_INVERT;
 
   /* free operator data */
   MEM_freeN(gso);
@@ -375,63 +359,6 @@ static bool gptint_brush_poll(bContext *C)
 
 /* Apply --- */
 
-/* Get angle of the segment relative to the original segment before any 
transformation
- * For strokes with one point only this is impossible to calculate because 
there isn't a
- * valid reference point.
- */
-static float gptint_rotation_eval_get(tGP_BrushTintData *gso,
-  bGPDstroke *gps_eval,
-  bGPDspoint *pt_eval,
-  int idx_eval)
-{
-  /* If multiframe or no modifiers, return 0. */
-  if ((GPENCIL_MULTIEDIT_SESSIONS_ON(gso->gpd)) || (!gso->is_transformed)) {
-return 0.0f;
-  }
-
-  GP_SpaceConversion *gsc = >gsc;
-  bGPDstroke *gps_orig = gps_eval->runtime.gps_orig;
-  

[Bf-blender-cvs] [76be5b5bf5c] blender-v2.81-release: Fix T70789: Using Remove Single Override breaks file loading (crash).

2019-11-08 Thread Bastien Montagne
Commit: 76be5b5bf5c830f8a3a3640fcf439bdca3a9aa89
Author: Bastien Montagne
Date:   Fri Nov 8 14:52:07 2019 +0100
Branches: blender-v2.81-release
https://developer.blender.org/rB76be5b5bf5c830f8a3a3640fcf439bdca3a9aa89

Fix T70789: Using Remove Single Override breaks file loading (crash).

We only need to refine rna pointer for actual collection properties,
other arrays we handle directly the the appy callback.

===

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

===

diff --git a/source/blender/makesrna/intern/rna_access_compare_override.c 
b/source/blender/makesrna/intern/rna_access_compare_override.c
index 18fbe7886e9..7dae3cbf339 100644
--- a/source/blender/makesrna/intern/rna_access_compare_override.c
+++ b/source/blender/makesrna/intern/rna_access_compare_override.c
@@ -890,8 +890,11 @@ static void rna_property_override_apply_ex(Main *bmain,
  * Note that here, src is the local saved ID, and dst is a copy of the 
linked ID (since we use
  * local ID as storage to apply local changes on top of a clean copy of 
the linked data). */
 PointerRNA private_ptr_item_dst, private_ptr_item_src, 
private_ptr_item_storage;
-if (opop->subitem_local_name != NULL || opop->subitem_reference_name != 
NULL ||
-opop->subitem_local_index != -1 || opop->subitem_reference_index != 
-1) {
+if ((RNA_property_type(prop_dst) == PROP_COLLECTION &&
+ RNA_property_type(prop_src) == PROP_COLLECTION &&
+ (prop_storage == NULL || RNA_property_type(prop_storage) == 
PROP_COLLECTION)) &&
+(opop->subitem_local_name != NULL || opop->subitem_reference_name != 
NULL ||
+ opop->subitem_local_index != -1 || opop->subitem_reference_index != 
-1)) {
   RNA_POINTER_INVALIDATE(_ptr_item_dst);
   RNA_POINTER_INVALIDATE(_ptr_item_src);
   RNA_POINTER_INVALIDATE(_ptr_item_storage);

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


[Bf-blender-cvs] [e408a62c2a4] master: Merge branch 'blender-v2.81-release'

2019-11-08 Thread Bastien Montagne
Commit: e408a62c2a4b1bec44be06b533b20ce9822d92f2
Author: Bastien Montagne
Date:   Fri Nov 8 14:53:19 2019 +0100
Branches: master
https://developer.blender.org/rBe408a62c2a4b1bec44be06b533b20ce9822d92f2

Merge branch 'blender-v2.81-release'

===



===



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


[Bf-blender-cvs] [f47c469e900] master: Merge branch 'blender-v2.81-release'

2019-11-08 Thread Philipp Oeser
Commit: f47c469e900ba57a85397028e607eb54f0fc42a6
Author: Philipp Oeser
Date:   Fri Nov 8 14:38:43 2019 +0100
Branches: master
https://developer.blender.org/rBf47c469e900ba57a85397028e607eb54f0fc42a6

Merge branch 'blender-v2.81-release'

===



===



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


[Bf-blender-cvs] [3b66d2ed21a] blender-v2.81-release: Fix T71405: Trying to Ctrl-C on many buttons crashes Blender

2019-11-08 Thread Philipp Oeser
Commit: 3b66d2ed21a35036f8221d831f96556f85261db9
Author: Philipp Oeser
Date:   Thu Nov 7 17:53:05 2019 +0100
Branches: blender-v2.81-release
https://developer.blender.org/rB3b66d2ed21a35036f8221d831f96556f85261db9

Fix T71405: Trying to Ctrl-C on many buttons crashes Blender

Usually Ctrl+C copies the operator name to the clipboard
["bpy.ops.material.new()", "bpy.ops.object.material_slot_remove()"]
Crash happens for all buttons of UI_BTYPE_BUT without associated
operator [some are defined with callbacks only, often these are created
with e.g uiDefIconBut (instead of e.g. uiDefIconButO)]

Other examples that crash with Ctrl+C:
- animation decorators next to animatable properties
- button to show a modifier texture in the texture tab
- ...

2.79 survived here (result in the clipboard was just not changed hitting
Ctrl+C on these buttons), this is what happens with this patch as well.

Maniphest Tasks: T71405

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

===

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

===

diff --git a/source/blender/editors/interface/interface_handlers.c 
b/source/blender/editors/interface/interface_handlers.c
index 2d739899ae8..0b4adb33b1c 100644
--- a/source/blender/editors/interface/interface_handlers.c
+++ b/source/blender/editors/interface/interface_handlers.c
@@ -2528,6 +2528,9 @@ static void ui_but_copy(bContext *C, uiBut *but, const 
bool copy_array)
   break;
 
 case UI_BTYPE_BUT:
+  if (!but->optype) {
+break;
+  }
   ui_but_copy_operator(C, but, buf, buf_max_len);
   is_buf_set = true;
   break;

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


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

2019-11-08 Thread Stefan Werner
Commit: bc99c2bcebef09c30b2afdb4ab8433ee4baaa791
Author: Stefan Werner
Date:   Fri Nov 8 13:00:17 2019 +0100
Branches: cycles_texture_cache
https://developer.blender.org/rBbc99c2bcebef09c30b2afdb4ab8433ee4baaa791

Merge branch 'master' into cycles_texture_cache

===



===

diff --cc intern/cycles/device/device_cpu.cpp
index 39279259d92,c2843a61e6d..7386f3a9fb4
--- a/intern/cycles/device/device_cpu.cpp
+++ b/intern/cycles/device/device_cpu.cpp
@@@ -167,9 -171,8 +172,9 @@@ class CPUDevice : public Device 
bool need_texture_info;
  
  #ifdef WITH_OSL
-   OSLGlobals *osl_globals;
+   OSLGlobals osl_globals;
  #endif
 +  OIIOGlobals oiio_globals;
  
bool use_split_kernel;
  
@@@ -285,13 -288,8 +290,11 @@@
  }
  
  #ifdef WITH_OSL
- /* Must use aligned malloc due to concurrent hash map. */
- osl_globals = util_aligned_new();
- kernel_globals.osl = osl_globals;
+ kernel_globals.osl = _globals;
  #endif
 +oiio_globals.tex_sys = NULL;
 +kernel_globals.oiio = _globals;
 +
  use_split_kernel = DebugFlags().cpu.split_kernel;
  if (use_split_kernel) {
VLOG(1) << "Will be using split kernel.";
@@@ -325,17 -323,8 +328,14 @@@
  
~CPUDevice()
{
- #ifdef WITH_OSL
- util_aligned_delete(osl_globals);
- #endif
  task_pool.stop();
  texture_info.free();
 +if (oiio_globals.tex_sys) {
 +  VLOG(1) << oiio_globals.tex_sys->getstats();
 +  oiio_globals.tex_sys->reset_stats();
 +  TextureSystem::destroy(oiio_globals.tex_sys);
 +}
 +kernel_globals.oiio = NULL;
}
  
virtual bool show_samples() const
@@@ -1082,12 -1057,8 +1073,12 @@@
  kg.decoupled_volume_steps_index = 0;
  kg.coverage_asset = kg.coverage_object = kg.coverage_material = NULL;
  #ifdef WITH_OSL
- OSLShader::thread_init(, _globals, osl_globals);
+ OSLShader::thread_init(, _globals, _globals);
  #endif
 +if (kg.oiio && kg.oiio->tex_sys) {
 +  kg.oiio_tdata = kg.oiio->tex_sys->get_perthread_info();
 +}
 +
  return kg;
}
  
diff --cc intern/cycles/kernel/osl/osl_services.cpp
index 5e8389bcf66,1b161fbc8ee..975e65a963d
--- a/intern/cycles/kernel/osl/osl_services.cpp
+++ b/intern/cycles/kernel/osl/osl_services.cpp
@@@ -54,13 -54,8 +54,9 @@@
  
  #include "kernel/kernel_projection.h"
  #include "kernel/kernel_accumulate.h"
 +#include "kernel/kernel_light.h"
  #include "kernel/kernel_shader.h"
  
- #ifdef WITH_PTEX
- #  include 
- #endif
- 
  CCL_NAMESPACE_BEGIN
  
  /* RenderServices implementation */
diff --cc intern/cycles/kernel/shaders/node_image_texture.osl
index 9d0fe43f707,f78ca7ec0e8..eab2928262d
--- a/intern/cycles/kernel/shaders/node_image_texture.osl
+++ b/intern/cycles/kernel/shaders/node_image_texture.osl
@@@ -66,16 -67,19 +67,19 @@@ color image_texture_lookup(string filen
 string extension)
  {
color rgb = (color)texture(
 -  filename, u, 1.0 - v, "wrap", extension, "interp", interpolation, 
"alpha", Alpha);
 +  filename, u, v, "wrap", extension, "interp", interpolation, "alpha", 
Alpha);
  
-   if (use_alpha) {
+   if (ignore_alpha) {
+ Alpha = 1.0;
+   }
+   else if (unassociate_alpha) {
  rgb = color_unpremultiply(rgb, Alpha);
  
  if (!is_float)
rgb = min(rgb, 1.0);
}
  
-   if (color_space == "sRGB" && !endswith(filename, ".tx")) {
 -  if (compress_as_srgb) {
++  if (compress_as_srgb && !endswith(filename, ".tx")) {
  rgb = color_srgb_to_scene_linear(rgb);
}
  
diff --cc intern/cycles/kernel/svm/svm.h
index a3b73f7d0bf,4fc5e633e3b..aeff69e1148
--- a/intern/cycles/kernel/svm/svm.h
+++ b/intern/cycles/kernel/svm/svm.h
@@@ -295,13 -312,13 +312,13 @@@ ccl_device_noinline void svm_eval_nodes
  #  endif /* NODES_FEATURE(NODE_FEATURE_BUMP) */
  #  ifdef __TEXTURES__
case NODE_TEX_IMAGE:
 -svm_node_tex_image(kg, sd, stack, node);
 +svm_node_tex_image(kg, sd, path_flag, stack, node);
  break;
case NODE_TEX_IMAGE_BOX:
--svm_node_tex_image_box(kg, sd, stack, node);
++svm_node_tex_image_box(kg, sd, path_flag, stack, node);
  break;
case NODE_TEX_NOISE:
- svm_node_tex_noise(kg, sd, stack, node, );
+ svm_node_tex_noise(kg, sd, stack, node.y, node.z, node.w, );
  break;
  #  endif /* __TEXTURES__ */
  #  ifdef __EXTRA_NODES__
diff --cc intern/cycles/kernel/svm/svm_image.h
index cc48029f812,64abdd2d8b3..06e511a5bcf
--- a/intern/cycles/kernel/svm/svm_image.h
+++ b/intern/cycles/kernel/svm/svm_image.h
@@@ -14,80 -14,16 +14,82 @@@
   * limitations under the License.
   */
  
 +#ifdef __OIIO__
 +#  include "kernel/kernel_oiio_globals.h"
 +#  define NEAREST_LOOKUP_PATHS \
 +(PATH_RAY_DIFFUSE | PATH_RAY_SHADOW | PATH_RAY_DIFFUSE_ANCESTOR | 
PATH_RAY_VOLUME_SCATTER | \
 + PATH_RAY_GLOSSY | PATH_RAY_EMISSION)
 +#  define DIFFUSE_BLUR_PATHS 

[Bf-blender-cvs] [7ec3dff04d3] cycles_texture_cache: Cycles: Fixed OSL crashes from texture caching changes.

2019-11-08 Thread Stefan Werner
Commit: 7ec3dff04d3369df1623902f695ebbaddfe783f9
Author: Stefan Werner
Date:   Fri Nov 8 13:54:45 2019 +0100
Branches: cycles_texture_cache
https://developer.blender.org/rB7ec3dff04d3369df1623902f695ebbaddfe783f9

Cycles: Fixed OSL crashes from texture caching changes.

===

M   intern/cycles/render/osl.cpp
M   intern/cycles/render/shader.cpp
M   intern/cycles/render/shader.h

===

diff --git a/intern/cycles/render/osl.cpp b/intern/cycles/render/osl.cpp
index b2279c4d622..16825938a7b 100644
--- a/intern/cycles/render/osl.cpp
+++ b/intern/cycles/render/osl.cpp
@@ -187,7 +187,7 @@ void OSLShaderManager::shading_system_init()
 
   if (ss_shared_users == 0) {
 /* Must use aligned new due to concurrent hash map. */
-services_shared = util_aligned_new(ts_shared);
+services_shared = util_aligned_new(ts);
 
 string shader_path = path_get("shader");
 #  ifdef _WIN32
@@ -202,7 +202,7 @@ void OSLShaderManager::shading_system_init()
 shader_path = string_to_ansi(shader_path);
 #  endif
 
-ss_shared = new OSL::ShadingSystem(services_shared, ts_shared, 
);
+ss_shared = new OSL::ShadingSystem(services_shared, ts, );
 ss_shared->attribute("lockgeom", 1);
 ss_shared->attribute("commonspace", "world");
 ss_shared->attribute("searchpath:shader", shader_path);
diff --git a/intern/cycles/render/shader.cpp b/intern/cycles/render/shader.cpp
index 0f0c7724cc7..ed68711ea82 100644
--- a/intern/cycles/render/shader.cpp
+++ b/intern/cycles/render/shader.cpp
@@ -45,11 +45,6 @@ CCL_NAMESPACE_BEGIN
 
 thread_mutex ShaderManager::lookup_table_mutex;
 
-/* Shared Texture System */
-OIIO::TextureSystem *ShaderManager::ts_shared = NULL;
-int ShaderManager::ts_shared_users = 0;
-thread_mutex ShaderManager::ts_shared_mutex;
-
 vector ShaderManager::beckmann_table;
 bool ShaderManager::beckmann_table_ready = false;
 
diff --git a/intern/cycles/render/shader.h b/intern/cycles/render/shader.h
index 791eabfbec9..fa471df5c80 100644
--- a/intern/cycles/render/shader.h
+++ b/intern/cycles/render/shader.h
@@ -227,10 +227,7 @@ class ShaderManager {
   void texture_system_free();
 
   OIIO::TextureSystem *ts;
-  static OIIO::TextureSystem *ts_shared;
-  static thread_mutex ts_shared_mutex;
-  static int ts_shared_users;
-
+  
   float3 xyz_to_r;
   float3 xyz_to_g;
   float3 xyz_to_b;

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


[Bf-blender-cvs] [e8cd2269b40] blender-v2.81-release: Fix T71199: Child-parent relationships arent kept after you make instances real.

2019-11-08 Thread Bastien Montagne
Commit: e8cd2269b40ddd21a10fd1f745ebc131c74ca9a8
Author: Bastien Montagne
Date:   Fri Nov 8 14:27:48 2019 +0100
Branches: blender-v2.81-release
https://developer.blender.org/rBe8cd2269b40ddd21a10fd1f745ebc131c74ca9a8

Fix T71199: Child-parent relationships arent kept after you make instances real.

Comparison function of the of the parent ghash was not fully correct,
could lead to some false positives in some cases...

===

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

===

diff --git a/source/blender/editors/object/object_add.c 
b/source/blender/editors/object/object_add.c
index bdb23c5ce6f..b15a245c0f2 100644
--- a/source/blender/editors/object/object_add.c
+++ b/source/blender/editors/object/object_add.c
@@ -1714,7 +1714,11 @@ static bool dupliobject_cmp(const void *a_, const void 
*b_)
 return true;
   }
 
-  if (ELEM(a->type, b->type, OB_DUPLICOLLECTION)) {
+  if (a->type != b->type) {
+return true;
+  }
+
+  if (a->type == OB_DUPLICOLLECTION) {
 for (int i = 1; (i < MAX_DUPLI_RECUR); i++) {
   if (a->persistent_id[i] != b->persistent_id[i]) {
 return true;

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


[Bf-blender-cvs] [2e39f6b230f] master: Merge branch 'blender-v2.81-release'

2019-11-08 Thread Bastien Montagne
Commit: 2e39f6b230f9b1e087b14c3405d02745c26ea3b6
Author: Bastien Montagne
Date:   Fri Nov 8 14:30:22 2019 +0100
Branches: master
https://developer.blender.org/rB2e39f6b230f9b1e087b14c3405d02745c26ea3b6

Merge branch 'blender-v2.81-release'

===



===



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


[Bf-blender-cvs] [31f8c9159d1] master: Merge branch 'blender-v2.81-release'

2019-11-08 Thread Philipp Oeser
Commit: 31f8c9159d169652b3a5d0db91c2f0d80dbee658
Author: Philipp Oeser
Date:   Fri Nov 8 14:28:45 2019 +0100
Branches: master
https://developer.blender.org/rB31f8c9159d169652b3a5d0db91c2f0d80dbee658

Merge branch 'blender-v2.81-release'

===



===



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


[Bf-blender-cvs] [6900187092e] blender-v2.81-release: Fix T71372: view layer is not maintained when area is duplicated into new window

2019-11-08 Thread Philipp Oeser
Commit: 6900187092e9b51fcc33b21aaf411695263a4578
Author: Philipp Oeser
Date:   Thu Nov 7 11:00:56 2019 +0100
Branches: blender-v2.81-release
https://developer.blender.org/rB6900187092e9b51fcc33b21aaf411695263a4578

Fix T71372: view layer is not maintained when area is duplicated into new window

Maniphest Tasks: T71372

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

===

M   source/blender/editors/screen/screen_ops.c

===

diff --git a/source/blender/editors/screen/screen_ops.c 
b/source/blender/editors/screen/screen_ops.c
index cc1f53eabde..3c37b49002c 100644
--- a/source/blender/editors/screen/screen_ops.c
+++ b/source/blender/editors/screen/screen_ops.c
@@ -1353,6 +1353,8 @@ static int area_dupli_invoke(bContext *C, wmOperator *op, 
const wmEvent *event)
 
   newwin->scene = scene;
 
+  STRNCPY(newwin->view_layer_name, win->view_layer_name);
+
   BKE_workspace_active_set(newwin->workspace_hook, workspace);
   /* allocs new screen and adds to newly created window, using window size */
   layout_new = ED_workspace_layout_add(

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


[Bf-blender-cvs] [fb71bb991ba] master: Merge branch 'blender-v2.81-release'

2019-11-08 Thread Philipp Oeser
Commit: fb71bb991ba3423294ff3dc225d1ffc95096a330
Author: Philipp Oeser
Date:   Fri Nov 8 14:18:04 2019 +0100
Branches: master
https://developer.blender.org/rBfb71bb991ba3423294ff3dc225d1ffc95096a330

Merge branch 'blender-v2.81-release'

===



===



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


[Bf-blender-cvs] [fe2b92d7893] blender-v2.81-release: Fix T55632: USE_DRAG_MULTINUM and USE_ALLSELECT not working well together

2019-11-08 Thread Philipp Oeser
Commit: fe2b92d7893ea9d4bb4fabd68a30385a5260d80e
Author: Philipp Oeser
Date:   Wed Nov 6 16:01:08 2019 +0100
Branches: blender-v2.81-release
https://developer.blender.org/rBfe2b92d7893ea9d4bb4fabd68a30385a5260d80e

Fix T55632: USE_DRAG_MULTINUM and USE_ALLSELECT not working well together

'is_copy' was not set correctly on all uiButMultiState (it was done once
for uiHandleButtonData), resulting in 'delta' being used on some indices
of the array and not others in `ui_selectcontext_apply`.

Maniphest Tasks: T55632

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

===

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

===

diff --git a/source/blender/editors/interface/interface_handlers.c 
b/source/blender/editors/interface/interface_handlers.c
index e7d80306ecb..2d739899ae8 100644
--- a/source/blender/editors/interface/interface_handlers.c
+++ b/source/blender/editors/interface/interface_handlers.c
@@ -1086,6 +1086,9 @@ static void ui_multibut_add(uiHandleButtonData *data, 
uiBut *but)
   mbut_state = MEM_callocN(sizeof(*mbut_state), __func__);
   mbut_state->but = but;
   mbut_state->origvalue = ui_but_value_get(but);
+#  ifdef USE_ALLSELECT
+  mbut_state->select_others.is_copy = data->select_others.is_copy;
+#  endif
 
   BLI_linklist_prepend(>multi_data.mbuts, mbut_state);

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


[Bf-blender-cvs] [9b098e340be] fluid-mantaflow: Mantaflow: Reset all cache pause frames fields when data bake is freed

2019-11-08 Thread Sebastián Barschkis
Commit: 9b098e340bee20525ce2a806b33693c06d3cc2b5
Author: Sebastián Barschkis
Date:   Fri Nov 8 12:47:08 2019 +0100
Branches: fluid-mantaflow
https://developer.blender.org/rB9b098e340bee20525ce2a806b33693c06d3cc2b5

Mantaflow: Reset all cache pause frames fields when data bake is freed

Data Free was only resetting its own pause frame even though all bakes get 
deleted during this operation.

===

M   source/blender/editors/physics/physics_manta.c

===

diff --git a/source/blender/editors/physics/physics_manta.c 
b/source/blender/editors/physics/physics_manta.c
index 76c5c285572..bb4e93c5b44 100644
--- a/source/blender/editors/physics/physics_manta.c
+++ b/source/blender/editors/physics/physics_manta.c
@@ -451,8 +451,11 @@ static void manta_free_startjob(void *customdata,
 if (BLI_exists(tmpDir))
   BLI_delete(tmpDir, true, true);
 
-/* Reset pause frame */
+/* Reset pause frames */
 mds->cache_frame_pause_data = 0;
+mds->cache_frame_pause_noise = 0;
+mds->cache_frame_pause_mesh = 0;
+mds->cache_frame_pause_particles = 0;
   }
   else if (STREQ(job->type, "MANTA_OT_free_noise")) {
 mds->cache_flag &= ~(FLUID_DOMAIN_BAKING_NOISE | FLUID_DOMAIN_BAKED_NOISE);

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


[Bf-blender-cvs] [1cd70c4f090] fluid-mantaflow: Merge branch 'master' into fluid-mantaflow

2019-11-08 Thread Sebastián Barschkis
Commit: 1cd70c4f090e6814594818a39fe0aefccfd78e8a
Author: Sebastián Barschkis
Date:   Fri Nov 8 12:24:25 2019 +0100
Branches: fluid-mantaflow
https://developer.blender.org/rB1cd70c4f090e6814594818a39fe0aefccfd78e8a

Merge branch 'master' into fluid-mantaflow

===



===

diff --cc build_files/cmake/platform/platform_win32.cmake
index 3c17e5afda7,e2006be8fc2..617da7314a5
--- a/build_files/cmake/platform/platform_win32.cmake
+++ b/build_files/cmake/platform/platform_win32.cmake
@@@ -558,11 -569,19 +569,27 @@@ if(WITH_SYSTEM_AUDASPACE
set(AUDASPACE_PY_LIBRARIES ${LIBDIR}/audaspace/lib/audaspace-py.lib)
  endif()
  
- if(WITH_MOD_MANTA)
-   if(NOT WITH_OPENMP OR NOT WITH_MANTA_OMP)
- set(TBB_LIBRARIES optimized ${LIBDIR}/tbb/lib/tbb.lib debug 
${LIBDIR}/tbb/lib/tbb_debug.lib)
- set(TBB_INCLUDE_DIR ${LIBDIR}/tbb/include)
+ if(WITH_TBB)
+   set(TBB_LIBRARIES optimized ${LIBDIR}/tbb/lib/tbb.lib debug 
${LIBDIR}/tbb/lib/tbb_debug.lib)
+   set(TBB_INCLUDE_DIR ${LIBDIR}/tbb/include)
+   set(TBB_INCLUDE_DIRS ${TBB_INCLUDE_DIR})
+ else()
+   if(WITH_OPENIMAGEDENOISE)
+ message(STATUS "TBB disabled, also disabling OpenImageDenoise")
+ set(WITH_OPENIMAGEDENOISE OFF)
+   endif()
+   if(WITH_OPENVDB)
+ message(STATUS "TBB disabled, also disabling OpenVDB")
+ set(WITH_OPENVDB OFF)
+   endif()
++  if(WITH_MOD_MANTA)
++message(STATUS "TBB disabled, using OpenMP for Mantaflow")
++if(NOT WITH_OPENMP)
++  message(STATUS "OpenMP disabled, also disabling Mantaflow")
++else()
++  set(WITH_MANTA_OMP ON)
++endif()
 +  endif()
  endif()
  
  # used in many places so include globally, like OpenGL
diff --cc source/blender/draw/modes/object_mode.c
index 9fc025645d6,781c7e6a488..f8e623ffe01
--- a/source/blender/draw/modes/object_mode.c
+++ b/source/blender/draw/modes/object_mode.c
@@@ -2612,24 -2693,23 +2693,25 @@@ static void DRW_shgroup_volume_extra(OB
  
DRW_object_wire_theme_get(ob, view_layer, );
  
-   /* Small cube showing voxel size (adjusts with adaptive domain) */
-   float min[3], max[3], size[3];
+   /* Small cube showing voxel size. */
+   float min[3];
 -  madd_v3fl_v3fl_v3fl_v3i(min, sds->p0, sds->cell_size, sds->res_min);
 +  madd_v3fl_v3fl_v3fl_v3i(min, mds->p0, mds->cell_size, mds->res_min);
-   madd_v3fl_v3fl_v3fl_v3i(max, mds->p0, mds->cell_size, mds->res_max);
-   sub_v3_v3v3(size, max, min);
float voxel_cubemat[4][4] = {{0.0f}};
-   /* scale small cube */
-   voxel_cubemat[0][0] = (1.0f / (float)mds->res[0]) * size[0] * 0.5;
-   voxel_cubemat[1][1] = (1.0f / (float)mds->res[1]) * size[1] * 0.5;
-   voxel_cubemat[2][2] = (1.0f / (float)mds->res[2]) * size[2] * 0.5;
-   /* translate small cube */
+   /* scale small cube to voxel size */
 -  voxel_cubemat[0][0] = 1.0f / (float)sds->base_res[0];
 -  voxel_cubemat[1][1] = 1.0f / (float)sds->base_res[1];
 -  voxel_cubemat[2][2] = 1.0f / (float)sds->base_res[2];
++  voxel_cubemat[0][0] = 1.0f / (float)mds->base_res[0];
++  voxel_cubemat[1][1] = 1.0f / (float)mds->base_res[1];
++  voxel_cubemat[2][2] = 1.0f / (float)mds->base_res[2];
+   voxel_cubemat[3][0] = voxel_cubemat[3][1] = voxel_cubemat[3][2] = -1.0f;
+   voxel_cubemat[3][3] = 1.0f;
+   /* translate small cube to corner */
voxel_cubemat[3][0] = min[0];
voxel_cubemat[3][1] = min[1];
voxel_cubemat[3][2] = min[2];
voxel_cubemat[3][3] = 1.0f;
++
/* move small cube into the domain (otherwise its centered on vertex of 
domain object) */
translate_m4(voxel_cubemat, 1.0f, 1.0f, 1.0f);
 +  /* apply transformation matrix to voxel cube matrix */
mul_m4_m4m4(voxel_cubemat, ob->obmat, voxel_cubemat);
  
DRW_buffer_add_entry(sgl->empties.cube, color, , voxel_cubemat);
@@@ -2659,11 -2739,14 +2741,15 @@@
  
DRWShadingGroup *grp = 
DRW_shgroup_create(volume_velocity_shader_get(use_needle),
  sgl->non_meshes);
 -  DRW_shgroup_uniform_texture(grp, "velocityX", sds->tex_velocity_x);
 -  DRW_shgroup_uniform_texture(grp, "velocityY", sds->tex_velocity_y);
 -  DRW_shgroup_uniform_texture(grp, "velocityZ", sds->tex_velocity_z);
 -  DRW_shgroup_uniform_float_copy(grp, "displaySize", sds->vector_scale);
 -  DRW_shgroup_uniform_float_copy(grp, "slicePosition", sds->slice_depth);
 -  DRW_shgroup_uniform_vec3_copy(grp, "cellSize", sds->cell_size);
 -  DRW_shgroup_uniform_vec3_copy(grp, "domainOriginOffset", sds->p0);
 -  DRW_shgroup_uniform_ivec3_copy(grp, "adaptiveCellOffset", sds->res_min);
++
 +  DRW_shgroup_uniform_texture(grp, "velocityX", mds->tex_velocity_x);
 +  DRW_shgroup_uniform_texture(grp, "velocityY", mds->tex_velocity_y);
 +  DRW_shgroup_uniform_texture(grp, "velocityZ", mds->tex_velocity_z);
 +  DRW_shgroup_uniform_float_copy(grp, "displaySize", mds->vector_scale);
 +  DRW_shgroup_uniform_float_copy(grp, "slicePosition", mds->slice_depth);
++  

[Bf-blender-cvs] [7b9f4320cc8] master: Merge branch 'blender-v2.81-release'

2019-11-08 Thread Campbell Barton
Commit: 7b9f4320cc8c4fe6e0c6fa628d7c20fb119de79c
Author: Campbell Barton
Date:   Fri Nov 8 19:18:25 2019 +1100
Branches: master
https://developer.blender.org/rB7b9f4320cc8c4fe6e0c6fa628d7c20fb119de79c

Merge branch 'blender-v2.81-release'

===



===



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


[Bf-blender-cvs] [1e4dbc84a7e] master: Merge branch 'blender-v2.81-release'

2019-11-08 Thread Campbell Barton
Commit: 1e4dbc84a7e7e3401fab6fba499b53d378b73201
Author: Campbell Barton
Date:   Fri Nov 8 22:19:51 2019 +1100
Branches: master
https://developer.blender.org/rB1e4dbc84a7e7e3401fab6fba499b53d378b73201

Merge branch 'blender-v2.81-release'

===



===



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


[Bf-blender-cvs] [7f17ac71e12] master: Merge branch 'blender-v2.81-release'

2019-11-08 Thread Campbell Barton
Commit: 7f17ac71e12290c1f8e9ff0f469b26dbc9fa206e
Author: Campbell Barton
Date:   Fri Nov 8 19:18:51 2019 +1100
Branches: master
https://developer.blender.org/rB7f17ac71e12290c1f8e9ff0f469b26dbc9fa206e

Merge branch 'blender-v2.81-release'

===



===



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


[Bf-blender-cvs] [5cf5dfcfadf] blender-v2.81-release: Fix T71194: UV Face centers wrong location with sub-surface mesh

2019-11-08 Thread Campbell Barton
Commit: 5cf5dfcfadf5d276931ea4e5f634b92cccdba124
Author: Campbell Barton
Date:   Fri Nov 8 22:16:25 2019 +1100
Branches: blender-v2.81-release
https://developer.blender.org/rB5cf5dfcfadf5d276931ea4e5f634b92cccdba124

Fix T71194: UV Face centers wrong location with sub-surface mesh

===

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

===

diff --git a/source/blender/draw/intern/draw_cache_extract_mesh.c 
b/source/blender/draw/intern/draw_cache_extract_mesh.c
index c30cf9f6328..7bc5c0ca91e 100644
--- a/source/blender/draw/intern/draw_cache_extract_mesh.c
+++ b/source/blender/draw/intern/draw_cache_extract_mesh.c
@@ -3709,6 +3709,7 @@ static const MeshExtract extract_fdots_nor = {
 typedef struct MeshExtract_FdotUV_Data {
   float (*vbo_data)[2];
   MLoopUV *uv_data;
+  int cd_ofs;
 } MeshExtract_FdotUV_Data;
 
 static void *extract_fdots_uv_init(const MeshRenderData *mr, void *buf)
@@ -3728,22 +3729,27 @@ static void *extract_fdots_uv_init(const MeshRenderData 
*mr, void *buf)
 memset(vbo->data, 0x0, mr->poly_len * vbo->format.stride);
   }
 
-  CustomData *cd_ldata = >me->ldata;
-
   MeshExtract_FdotUV_Data *data = MEM_callocN(sizeof(*data), __func__);
   data->vbo_data = (float(*)[2])vbo->data;
-  data->uv_data = CustomData_get_layer(cd_ldata, CD_MLOOPUV);
+
+  if (mr->extract_type == MR_EXTRACT_BMESH) {
+data->cd_ofs = CustomData_get_offset(>bm->ldata, CD_MLOOPUV);
+  }
+  else {
+data->uv_data = CustomData_get_layer(>me->ldata, CD_MLOOPUV);
+  }
   return data;
 }
 
 static void extract_fdots_uv_loop_bmesh(const MeshRenderData *UNUSED(mr),
-int l,
+int UNUSED(l),
 BMLoop *loop,
 void *_data)
 {
   MeshExtract_FdotUV_Data *data = (MeshExtract_FdotUV_Data *)_data;
   float w = 1.0f / (float)loop->f->len;
-  madd_v2_v2fl(data->vbo_data[BM_elem_index_get(loop->f)], 
data->uv_data[l].uv, w);
+  const MLoopUV *luv = BM_ELEM_CD_GET_VOID_P(loop, data->cd_ofs);
+  madd_v2_v2fl(data->vbo_data[BM_elem_index_get(loop->f)], luv->uv, w);
 }
 
 static void extract_fdots_uv_loop_mesh(

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


[Bf-blender-cvs] [326b25ae8e5] blender-v2.81-release: Fix T66124: Gizmo orientation doesn't refresh when making face

2019-11-08 Thread Campbell Barton
Commit: 326b25ae8e54777cb666d6692850ff7443e7bedf
Author: Campbell Barton
Date:   Fri Nov 8 19:17:27 2019 +1100
Branches: blender-v2.81-release
https://developer.blender.org/rB326b25ae8e54777cb666d6692850ff7443e7bedf

Fix T66124: Gizmo orientation doesn't refresh when making face

===

M   source/blender/editors/space_view3d/space_view3d.c

===

diff --git a/source/blender/editors/space_view3d/space_view3d.c 
b/source/blender/editors/space_view3d/space_view3d.c
index b80d402aac3..5c7263d458d 100644
--- a/source/blender/editors/space_view3d/space_view3d.c
+++ b/source/blender/editors/space_view3d/space_view3d.c
@@ -795,6 +795,9 @@ static void view3d_main_region_listener(
   ATTR_FALLTHROUGH;
 }
 case ND_DATA:
+  ED_region_tag_redraw(ar);
+  WM_gizmomap_tag_refresh(gzmap);
+  break;
 case ND_VERTEX_GROUP:
   ED_region_tag_redraw(ar);
   break;

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


[Bf-blender-cvs] [73b9e86b499] blender-v2.81-release: EditMesh: avoid undo push on face creation if no action is made

2019-11-08 Thread Campbell Barton
Commit: 73b9e86b49907fcdb04f019ebf6644e8f70c04a1
Author: Campbell Barton
Date:   Fri Nov 8 19:16:27 2019 +1100
Branches: blender-v2.81-release
https://developer.blender.org/rB73b9e86b49907fcdb04f019ebf6644e8f70c04a1

EditMesh: avoid undo push on face creation if no action is made

===

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

===

diff --git a/source/blender/editors/mesh/editmesh_tools.c 
b/source/blender/editors/mesh/editmesh_tools.c
index a1232347516..eb50babf395 100644
--- a/source/blender/editors/mesh/editmesh_tools.c
+++ b/source/blender/editors/mesh/editmesh_tools.c
@@ -930,7 +930,7 @@ static void 
edbm_add_edge_face_exec__tricky_finalize_sel(BMesh *bm, BMElem *ele_
 static int edbm_add_edge_face_exec(bContext *C, wmOperator *op)
 {
   /* when this is used to dissolve we could avoid this, but checking isnt too 
slow */
-
+  bool changed_multi = false;
   ViewLayer *view_layer = CTX_data_view_layer(C);
   uint objects_len = 0;
   Object **objects = 
BKE_view_layer_array_from_objects_in_edit_mode_unique_data(
@@ -1005,9 +1005,14 @@ static int edbm_add_edge_face_exec(bContext *C, 
wmOperator *op)
 }
 
 EDBM_update_generic(em, true, true);
+changed_multi = true;
   }
   MEM_freeN(objects);
 
+  if (!changed_multi) {
+return OPERATOR_CANCELLED;
+  }
+
   return OPERATOR_FINISHED;
 }

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


[Bf-blender-cvs] [ea28ccc885f] greasepencil-object: GPencil: Fix poll for all select tools in Vertex Paint

2019-11-08 Thread Antonio Vazquez
Commit: ea28ccc885f09d3861248d2e95394037169da21b
Author: Antonio Vazquez
Date:   Fri Nov 8 11:46:15 2019 +0100
Branches: greasepencil-object
https://developer.blender.org/rBea28ccc885f09d3861248d2e95394037169da21b

GPencil: Fix poll for all select tools in Vertex Paint

===

M   source/blender/editors/gpencil/gpencil_select.c
M   source/blender/makesdna/DNA_gpencil_types.h

===

diff --git a/source/blender/editors/gpencil/gpencil_select.c 
b/source/blender/editors/gpencil/gpencil_select.c
index 2fe54af6750..f38961db07b 100644
--- a/source/blender/editors/gpencil/gpencil_select.c
+++ b/source/blender/editors/gpencil/gpencil_select.c
@@ -1013,7 +1013,7 @@ static int gpencil_circle_select_exec(bContext *C, 
wmOperator *op)
   const float scale = ts->gp_sculpt.isect_threshold;
 
   /* if not edit/sculpt mode, the event is catched but not processed */
-  if ((GPENCIL_NONE_EDIT_MODE(gpd)) && (!GPENCIL_VERTEX_MODE(gpd))) {
+  if (GPENCIL_NONE_EDIT_MODE(gpd)) {
 return OPERATOR_CANCELLED;
   }
 
diff --git a/source/blender/makesdna/DNA_gpencil_types.h 
b/source/blender/makesdna/DNA_gpencil_types.h
index 9ba448936f3..60c83b091b4 100644
--- a/source/blender/makesdna/DNA_gpencil_types.h
+++ b/source/blender/makesdna/DNA_gpencil_types.h
@@ -689,7 +689,7 @@ typedef enum eGP_DrawMode {
   ((gpd) && (gpd->flag & (GP_DATA_STROKE_SCULPTMODE | 
GP_DATA_STROKE_WEIGHTMODE)))
 #define GPENCIL_NONE_EDIT_MODE(gpd) \
   ((gpd) && ((gpd->flag & (GP_DATA_STROKE_EDITMODE | GP_DATA_STROKE_SCULPTMODE 
| \
-   GP_DATA_STROKE_WEIGHTMODE)) == 0))
+   GP_DATA_STROKE_WEIGHTMODE | 
GP_DATA_STROKE_VERTEXMODE)) == 0))
 #define GPENCIL_LAZY_MODE(brush, shift) \
   (((brush) && ((brush->gpencil_settings->flag & GP_BRUSH_STABILIZE_MOUSE) && 
(shift == 0))) || \
(((brush->gpencil_settings->flag & GP_BRUSH_STABILIZE_MOUSE) == 0) && 
(shift == 1)))

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


[Bf-blender-cvs] [6e5ed5c89ea] greasepencil-object: GPencil: Reformat RNA code to extend selection in all modes

2019-11-08 Thread Antonio Vazquez
Commit: 6e5ed5c89eaf5ed4da1eaa775f00fe9c77885eed
Author: Antonio Vazquez
Date:   Fri Nov 8 11:43:07 2019 +0100
Branches: greasepencil-object
https://developer.blender.org/rB6e5ed5c89eaf5ed4da1eaa775f00fe9c77885eed

GPencil: Reformat RNA code to extend selection in all modes

===

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

===

diff --git a/source/blender/makesrna/intern/rna_scene.c 
b/source/blender/makesrna/intern/rna_scene.c
index ef650c37892..282118be3f0 100644
--- a/source/blender/makesrna/intern/rna_scene.c
+++ b/source/blender/makesrna/intern/rna_scene.c
@@ -734,14 +734,8 @@ static void 
rna_GPencilInterpolateSettings_type_set(PointerRNA *ptr, int value)
   }
 }
 
-static void rna_Gpencil_selectmode_update(bContext *C, PointerRNA *ptr)
+static void rna_Gpencil_extend_selection(bContext *C, PointerRNA *ptr)
 {
-  ToolSettings *ts = (ToolSettings *)ptr->data;
-  /* If the mode is not Stroke, don't extend selection. */
-  if ((ts->gpencil_selectmode_edit & GP_SELECTMODE_STROKE) == 0) {
-return;
-  }
-
   /* Extend selection to all points in all selected strokes. */
   ViewLayer *view_layer = CTX_data_view_layer(C);
   Object *ob = OBACT(view_layer);
@@ -763,9 +757,18 @@ static void rna_Gpencil_selectmode_update(bContext *C, 
PointerRNA *ptr)
   }
 }
 
-static void rna_Gpencil_mask_point_update(Main *UNUSED(bmain),
-  Scene *UNUSED(scene),
-  PointerRNA *ptr)
+static void rna_Gpencil_selectmode_update(bContext *C, PointerRNA *ptr)
+{
+  ToolSettings *ts = (ToolSettings *)ptr->data;
+  /* If the mode is not Stroke, don't extend selection. */
+  if ((ts->gpencil_selectmode_edit & GP_SELECTMODE_STROKE) == 0) {
+return;
+  }
+
+  rna_Gpencil_extend_selection(C, ptr);
+}
+
+static void rna_Gpencil_mask_point_update(bContext *C, PointerRNA *ptr)
 {
   ToolSettings *ts = (ToolSettings *)ptr->data;
 
@@ -773,19 +776,17 @@ static void rna_Gpencil_mask_point_update(Main 
*UNUSED(bmain),
   ts->gpencil_selectmode_sculpt &= ~GP_SCULPT_MASK_SELECTMODE_SEGMENT;
 }
 
-static void rna_Gpencil_mask_stroke_update(Main *UNUSED(bmain),
-   Scene *UNUSED(scene),
-   PointerRNA *ptr)
+static void rna_Gpencil_mask_stroke_update(bContext *C, PointerRNA *ptr)
 {
   ToolSettings *ts = (ToolSettings *)ptr->data;
 
   ts->gpencil_selectmode_sculpt &= ~GP_SCULPT_MASK_SELECTMODE_POINT;
   ts->gpencil_selectmode_sculpt &= ~GP_SCULPT_MASK_SELECTMODE_SEGMENT;
+
+  rna_Gpencil_extend_selection(C, ptr);
 }
 
-static void rna_Gpencil_mask_segment_update(Main *UNUSED(bmain),
-Scene *UNUSED(scene),
-PointerRNA *ptr)
+static void rna_Gpencil_mask_segment_update(bContext *C, PointerRNA *ptr)
 {
   ToolSettings *ts = (ToolSettings *)ptr->data;
 
@@ -793,40 +794,36 @@ static void rna_Gpencil_mask_segment_update(Main 
*UNUSED(bmain),
   ts->gpencil_selectmode_sculpt &= ~GP_SCULPT_MASK_SELECTMODE_STROKE;
 }
 
-static void rna_Gpencil_vertex_mask_point_update(Main *UNUSED(bmain),
- Scene *scene,
- PointerRNA *ptr)
+static void rna_Gpencil_vertex_mask_point_update(bContext *C, PointerRNA *ptr)
 {
   ToolSettings *ts = (ToolSettings *)ptr->data;
 
   ts->gpencil_selectmode_vertex &= ~GP_VERTEX_MASK_SELECTMODE_STROKE;
   ts->gpencil_selectmode_vertex &= ~GP_VERTEX_MASK_SELECTMODE_SEGMENT;
 
-  ED_gpencil_tag_scene_gpencil(scene);
+  ED_gpencil_tag_scene_gpencil(CTX_data_scene(C));
 }
 
-static void rna_Gpencil_vertex_mask_stroke_update(Main *UNUSED(bmain),
-  Scene *scene,
-  PointerRNA *ptr)
+static void rna_Gpencil_vertex_mask_stroke_update(bContext *C, PointerRNA *ptr)
 {
   ToolSettings *ts = (ToolSettings *)ptr->data;
 
   ts->gpencil_selectmode_vertex &= ~GP_VERTEX_MASK_SELECTMODE_POINT;
   ts->gpencil_selectmode_vertex &= ~GP_VERTEX_MASK_SELECTMODE_SEGMENT;
 
-  ED_gpencil_tag_scene_gpencil(scene);
+  rna_Gpencil_extend_selection(C, ptr);
+
+  ED_gpencil_tag_scene_gpencil(CTX_data_scene(C));
 }
 
-static void rna_Gpencil_vertex_mask_segment_update(Main *UNUSED(bmain),
-   Scene *scene,
-   PointerRNA *ptr)
+static void rna_Gpencil_vertex_mask_segment_update(bContext *C, PointerRNA 
*ptr)
 {
   ToolSettings *ts = (ToolSettings *)ptr->data;
 
   ts->gpencil_selectmode_vertex &= ~GP_VERTEX_MASK_SELECTMODE_POINT;
   ts->gpencil_selectmode_vertex &= ~GP_VERTEX_MASK_SELECTMODE_STROKE;
 
-  ED_gpencil_tag_scene_gpencil(scene);
+  ED_gpencil_tag_scene_gpencil(CTX_data_scene(C));
 }
 

[Bf-blender-cvs] [32efa6a16a5] greasepencil-object: GPencil: Attenuate colors when use mask in Vertex Paint

2019-11-08 Thread Antonio Vazquez
Commit: 32efa6a16a59c2d8bc35707c6e82577c18304574
Author: Antonio Vazquez
Date:   Fri Nov 8 11:21:19 2019 +0100
Branches: greasepencil-object
https://developer.blender.org/rB32efa6a16a59c2d8bc35707c6e82577c18304574

GPencil: Attenuate colors when use mask in Vertex Paint

===

M   source/blender/blenkernel/BKE_gpencil.h
M   source/blender/draw/engines/gpencil/gpencil_draw_cache_impl.c
M   source/blender/draw/engines/gpencil/gpencil_draw_utils.c
M   source/blender/draw/engines/gpencil/gpencil_engine.c
M   source/blender/editors/gpencil/gpencil_intern.h
M   source/blender/makesdna/DNA_gpencil_types.h

===

diff --git a/source/blender/blenkernel/BKE_gpencil.h 
b/source/blender/blenkernel/BKE_gpencil.h
index d6a3ba279b9..4c1ea3a761e 100644
--- a/source/blender/blenkernel/BKE_gpencil.h
+++ b/source/blender/blenkernel/BKE_gpencil.h
@@ -156,6 +156,7 @@ struct bGPDstroke 
*BKE_gpencil_add_stroke_existing_style(struct bGPDframe *gpf,
 /* Stroke and Fill - Alpha Visibility Threshold */
 #define GPENCIL_ALPHA_OPACITY_THRESH 0.001f
 #define GPENCIL_STRENGTH_MIN 0.003f
+#define GP_VERTEX_MASK_ATTENUATE 0.3f
 
 bool gpencil_layer_is_editable(const struct bGPDlayer *gpl);
 
diff --git a/source/blender/draw/engines/gpencil/gpencil_draw_cache_impl.c 
b/source/blender/draw/engines/gpencil/gpencil_draw_cache_impl.c
index 5e5c1dc4682..005b471134b 100644
--- a/source/blender/draw/engines/gpencil/gpencil_draw_cache_impl.c
+++ b/source/blender/draw/engines/gpencil/gpencil_draw_cache_impl.c
@@ -50,10 +50,16 @@ static void gpencil_set_stroke_point(GPUVertBuf *vbo,
  uint thickness_id,
  uint uvdata_id,
  short thickness,
+ const bool attenuate,
  const float ink[4])
 {
-
   float alpha = ink[3] * pt->strength;
+
+  /* If using vertex paint mask, attenuate not selected. */
+  if ((attenuate) && ((pt->flag & GP_SPOINT_SELECT) == 0)) {
+alpha *= GP_VERTEX_MASK_ATTENUATE;
+  }
+
   CLAMP(alpha, GPENCIL_STRENGTH_MIN, 1.0f);
   float col[4];
   ARRAY_SET_ITEMS(col, ink[0], ink[1], ink[2], alpha);
@@ -145,8 +151,14 @@ void gpencil_get_point_geom(GpencilBatchCacheElem *be,
 const int alignment_mode,
 const bool onion)
 {
+  const DRWContextState *draw_ctx = DRW_context_state_get();
+  ToolSettings *ts = draw_ctx->scene->toolsettings;
+  Object *ob = draw_ctx->obact;
+  bGPdata *gpd = ob ? (bGPdata *)ob->data : NULL;
   int totvertex = gps->totpoints;
   float mix_color[4];
+  const bool attenuate = (GPENCIL_VERTEX_MODE(gpd) &&
+  
GPENCIL_ANY_VERTEX_MASK(ts->gpencil_selectmode_vertex));
 
   if (be->vbo == NULL) {
 gpencil_elem_format_ensure(be);
@@ -180,6 +192,10 @@ void gpencil_get_point_geom(GpencilBatchCacheElem *be,
   interp_v3_v3v3(mixtint, pt->mix_color, tintcolor, tintcolor[3]);
   interp_v3_v3v3(mix_color, ink, mixtint, pt->mix_color[3]);
 }
+/* If using vertex paint mask, attenuate not selected. */
+if ((attenuate) && ((pt->flag & GP_SPOINT_SELECT) == 0)) {
+  alpha *= GP_VERTEX_MASK_ATTENUATE;
+}
 
 ARRAY_SET_ITEMS(col, mix_color[0], mix_color[1], mix_color[2], alpha);
 
@@ -244,6 +260,14 @@ void gpencil_get_stroke_geom(struct GpencilBatchCacheElem 
*be,
   int totvertex = totpoints + cyclic_add + 2;
   float mix_color[4];
 
+  const DRWContextState *draw_ctx = DRW_context_state_get();
+  ToolSettings *ts = draw_ctx->scene->toolsettings;
+  Object *ob = draw_ctx->obact;
+  bGPdata *gpd = ob ? (bGPdata *)ob->data : NULL;
+
+  const bool attenuate = (GPENCIL_VERTEX_MODE(gpd) &&
+  
GPENCIL_ANY_VERTEX_MASK(ts->gpencil_selectmode_vertex));
+
   if (be->vbo == NULL) {
 gpencil_elem_format_ensure(be);
 be->pos_id = GPU_vertformat_attr_add(be->format, "pos", GPU_COMP_F32, 3, 
GPU_FETCH_FLOAT);
@@ -281,6 +305,7 @@ void gpencil_get_stroke_geom(struct GpencilBatchCacheElem 
*be,
  be->thickness_id,
  be->uvdata_id,
  thickness,
+ attenuate,
  mix_color);
 be->vbo_len++;
   }
@@ -293,6 +318,7 @@ void gpencil_get_stroke_geom(struct GpencilBatchCacheElem 
*be,
  be->thickness_id,
  be->uvdata_id,
  thickness,
+ attenuate,
  mix_color);
 be->vbo_len++;
   }
@@ -306,6 +332,7 @@ void gpencil_get_stroke_geom(struct GpencilBatchCacheElem 
*be,
  be->thickness_id,
  

[Bf-blender-cvs] [4cab8c06f89] greasepencil-object: GPencil: Fix error in Circle select for Vertex Paint

2019-11-08 Thread Antonio Vazquez
Commit: 4cab8c06f89353777c69328832d164f33cdd61be
Author: Antonio Vazquez
Date:   Fri Nov 8 11:21:39 2019 +0100
Branches: greasepencil-object
https://developer.blender.org/rB4cab8c06f89353777c69328832d164f33cdd61be

GPencil: Fix error in Circle select for Vertex Paint

===

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

===

diff --git a/source/blender/editors/gpencil/gpencil_select.c 
b/source/blender/editors/gpencil/gpencil_select.c
index c7d36c992fd..2fe54af6750 100644
--- a/source/blender/editors/gpencil/gpencil_select.c
+++ b/source/blender/editors/gpencil/gpencil_select.c
@@ -1013,7 +1013,7 @@ static int gpencil_circle_select_exec(bContext *C, 
wmOperator *op)
   const float scale = ts->gp_sculpt.isect_threshold;
 
   /* if not edit/sculpt mode, the event is catched but not processed */
-  if ((GPENCIL_NONE_EDIT_MODE(gpd)) && (GPENCIL_VERTEX_MODE(gpd))) {
+  if ((GPENCIL_NONE_EDIT_MODE(gpd)) && (!GPENCIL_VERTEX_MODE(gpd))) {
 return OPERATOR_CANCELLED;
   }

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


[Bf-blender-cvs] [4ce9962423d] sybren-usd: Merge remote-tracking branch 'origin/master' into sybren-usd

2019-11-08 Thread Sybren A. Stüvel
Commit: 4ce9962423db35e4ae92a362c22b2e249885b59d
Author: Sybren A. Stüvel
Date:   Fri Nov 8 10:51:34 2019 +0100
Branches: sybren-usd
https://developer.blender.org/rB4ce9962423db35e4ae92a362c22b2e249885b59d

Merge remote-tracking branch 'origin/master' into sybren-usd

===



===



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


[Bf-blender-cvs] [7f46d1947fa] sybren-usd: USD: Fix for `BASE_VISIBLE` being renamed

2019-11-08 Thread Sybren A. Stüvel
Commit: 7f46d1947fa8151ee65a2a5596b32c77cd4feb49
Author: Sybren A. Stüvel
Date:   Fri Nov 8 11:13:35 2019 +0100
Branches: sybren-usd
https://developer.blender.org/rB7f46d1947fa8151ee65a2a5596b32c77cd4feb49

USD: Fix for `BASE_VISIBLE` being renamed

The rename was done in rB0812949bbc3d.

===

M   source/blender/usd/intern/usd_hierarchy_iterator.cc

===

diff --git a/source/blender/usd/intern/usd_hierarchy_iterator.cc 
b/source/blender/usd/intern/usd_hierarchy_iterator.cc
index 2202d132293..351e605546f 100644
--- a/source/blender/usd/intern/usd_hierarchy_iterator.cc
+++ b/source/blender/usd/intern/usd_hierarchy_iterator.cc
@@ -36,7 +36,7 @@ bool USDHierarchyIterator::should_export_object(const Object 
*object) const
   if (params.selected_objects_only && (object->base_flag & BASE_SELECTED) == 
0) {
 return false;
   }
-  if (params.visible_objects_only && (object->base_flag & BASE_VISIBLE) == 0) {
+  if (params.visible_objects_only && (object->base_flag & 
BASE_VISIBLE_DEPSGRAPH) == 0) {
 return false;
   }
   return true;

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