[Bf-blender-cvs] [baa4b5e93c0] master: CLeanup: clang-format

2020-02-10 Thread Campbell Barton
Commit: baa4b5e93c0dee956a7e2386d4b62a3adeea1a34
Author: Campbell Barton
Date:   Tue Feb 11 18:45:08 2020 +1100
Branches: master
https://developer.blender.org/rBbaa4b5e93c0dee956a7e2386d4b62a3adeea1a34

CLeanup: clang-format

===

M   intern/cycles/kernel/geom/geom_curve.h
M   intern/cycles/kernel/geom/geom_subd_triangle.h
M   intern/cycles/kernel/geom/geom_triangle.h
M   intern/cycles/test/util_avxf_avx2_test.cpp
M   intern/cycles/test/util_avxf_test.h
M   source/blender/makesrna/intern/rna_access_compare_override.c
M   source/blender/makesrna/intern/rna_rna.c

===

diff --git a/intern/cycles/kernel/geom/geom_curve.h 
b/intern/cycles/kernel/geom/geom_curve.h
index f2b8408b0e0..928cad58452 100644
--- a/intern/cycles/kernel/geom/geom_curve.h
+++ b/intern/cycles/kernel/geom/geom_curve.h
@@ -83,7 +83,7 @@ ccl_device float curve_attribute_float(
 
 return (1.0f - sd->u) * f0 + sd->u * f1;
   }
-  else if(desc.element == ATTR_ELEMENT_OBJECT || desc.element == 
ATTR_ELEMENT_MESH) {
+  else if (desc.element == ATTR_ELEMENT_OBJECT || desc.element == 
ATTR_ELEMENT_MESH) {
 #  ifdef __RAY_DIFFERENTIALS__
 if (dx)
   *dx = 0.0f;
@@ -143,7 +143,7 @@ ccl_device float2 curve_attribute_float2(KernelGlobals *kg,
 
 return (1.0f - sd->u) * f0 + sd->u * f1;
   }
-  else if(desc.element == ATTR_ELEMENT_OBJECT || desc.element == 
ATTR_ELEMENT_MESH) {
+  else if (desc.element == ATTR_ELEMENT_OBJECT || desc.element == 
ATTR_ELEMENT_MESH) {
 #  ifdef __RAY_DIFFERENTIALS__
 if (dx)
   *dx = make_float2(0.0f, 0.0f);
@@ -203,7 +203,7 @@ ccl_device float3 curve_attribute_float3(KernelGlobals *kg,
 
 return (1.0f - sd->u) * f0 + sd->u * f1;
   }
-  else if(desc.element == ATTR_ELEMENT_OBJECT || desc.element == 
ATTR_ELEMENT_MESH) {
+  else if (desc.element == ATTR_ELEMENT_OBJECT || desc.element == 
ATTR_ELEMENT_MESH) {
 #  ifdef __RAY_DIFFERENTIALS__
 if (dx)
   *dx = make_float3(0.0f, 0.0f, 0.0f);
diff --git a/intern/cycles/kernel/geom/geom_subd_triangle.h 
b/intern/cycles/kernel/geom/geom_subd_triangle.h
index 62a66cfa0e9..3eef9857ae3 100644
--- a/intern/cycles/kernel/geom/geom_subd_triangle.h
+++ b/intern/cycles/kernel/geom/geom_subd_triangle.h
@@ -217,7 +217,7 @@ ccl_device_noinline float subd_triangle_attribute_float(
 
 return sd->u * a + sd->v * b + (1.0f - sd->u - sd->v) * c;
   }
-  else if(desc.element == ATTR_ELEMENT_OBJECT || desc.element == 
ATTR_ELEMENT_MESH) {
+  else if (desc.element == ATTR_ELEMENT_OBJECT || desc.element == 
ATTR_ELEMENT_MESH) {
 if (dx)
   *dx = 0.0f;
 if (dy)
@@ -360,7 +360,7 @@ ccl_device_noinline float2 
subd_triangle_attribute_float2(KernelGlobals *kg,
 
 return sd->u * a + sd->v * b + (1.0f - sd->u - sd->v) * c;
   }
-  else if(desc.element == ATTR_ELEMENT_OBJECT || desc.element == 
ATTR_ELEMENT_MESH) {
+  else if (desc.element == ATTR_ELEMENT_OBJECT || desc.element == 
ATTR_ELEMENT_MESH) {
 if (dx)
   *dx = make_float2(0.0f, 0.0f);
 if (dy)
@@ -502,7 +502,7 @@ ccl_device_noinline float3 
subd_triangle_attribute_float3(KernelGlobals *kg,
 
 return sd->u * a + sd->v * b + (1.0f - sd->u - sd->v) * c;
   }
-  else if(desc.element == ATTR_ELEMENT_OBJECT || desc.element == 
ATTR_ELEMENT_MESH) {
+  else if (desc.element == ATTR_ELEMENT_OBJECT || desc.element == 
ATTR_ELEMENT_MESH) {
 if (dx)
   *dx = make_float3(0.0f, 0.0f, 0.0f);
 if (dy)
@@ -608,7 +608,7 @@ ccl_device_noinline float4 
subd_triangle_attribute_float4(KernelGlobals *kg,
 
 return sd->u * a + sd->v * b + (1.0f - sd->u - sd->v) * c;
   }
-  else if(desc.element == ATTR_ELEMENT_OBJECT || desc.element == 
ATTR_ELEMENT_MESH) {
+  else if (desc.element == ATTR_ELEMENT_OBJECT || desc.element == 
ATTR_ELEMENT_MESH) {
 if (dx)
   *dx = make_float4(0.0f, 0.0f, 0.0f, 0.0f);
 if (dy)
diff --git a/intern/cycles/kernel/geom/geom_triangle.h 
b/intern/cycles/kernel/geom/geom_triangle.h
index 072c02bf0d3..a2731bf2bd0 100644
--- a/intern/cycles/kernel/geom/geom_triangle.h
+++ b/intern/cycles/kernel/geom/geom_triangle.h
@@ -153,7 +153,7 @@ ccl_device float triangle_attribute_float(
 
 return sd->u * f0 + sd->v * f1 + (1.0f - sd->u - sd->v) * f2;
   }
-  else if(desc.element == ATTR_ELEMENT_OBJECT || desc.element == 
ATTR_ELEMENT_MESH) {
+  else if (desc.element == ATTR_ELEMENT_OBJECT || desc.element == 
ATTR_ELEMENT_MESH) {
 if (dx)
   *dx = 0.0f;
 if (dy)
@@ -220,7 +220,7 @@ ccl_device float2 triangle_attribute_float2(KernelGlobals 
*kg,
 
 return sd->u * f0 + sd->v * f1 + (1.0f - sd->u - sd->v) * f2;
   }
-  else if(desc.element == ATTR_ELEMENT_OBJECT || desc.element == 
ATTR_ELEMENT_MESH) {
+  else if (desc.element == ATTR_ELEMENT_OBJECT || desc.element == 
ATTR_ELEMENT_MESH) {
 if (dx)
   *dx = make_float2(0.0f, 0.0f);
 if (dy)
@@ -288,7 +288,7 @@ ccl_device float3 

[Bf-blender-cvs] [452674db301] master: Cleanup: minor edit to last commit

2020-02-10 Thread Campbell Barton
Commit: 452674db301f06c1a653b87c14c984acc18c4d29
Author: Campbell Barton
Date:   Tue Feb 11 18:23:52 2020 +1100
Branches: master
https://developer.blender.org/rB452674db301f06c1a653b87c14c984acc18c4d29

Cleanup: minor edit to last commit

Avoid repeating the fallback return.

===

M   source/blender/blenlib/intern/math_geom.c

===

diff --git a/source/blender/blenlib/intern/math_geom.c 
b/source/blender/blenlib/intern/math_geom.c
index 1b428d7f054..e0e463615e5 100644
--- a/source/blender/blenlib/intern/math_geom.c
+++ b/source/blender/blenlib/intern/math_geom.c
@@ -4160,11 +4160,11 @@ static float mean_value_half_tan_v3(const struct 
Float3_Len *d_curr,
 const float dot = dot_v3v3(d_curr->dir, d_next->dir);
 const float len = d_curr->len * d_next->len;
 const float result = (len - dot) / area;
-return isfinite(result) ? result : 0.0f;
-  }
-  else {
-return 0.0f;
+if (isfinite(result)) {
+  return result;
+}
   }
+  return 0.0f;
 }
 
 static float mean_value_half_tan_v2(const struct Float2_Len *d_curr,
@@ -4177,11 +4177,11 @@ static float mean_value_half_tan_v2(const struct 
Float2_Len *d_curr,
 const float dot = dot_v2v2(d_curr->dir, d_next->dir);
 const float len = d_curr->len * d_next->len;
 const float result = (len - dot) / area;
-return isfinite(result) ? result : 0.0f;
-  }
-  else {
-return 0.0f;
+if (isfinite(result)) {
+  return result;
+}
   }
+  return 0.0f;
 }
 
 void interp_weights_poly_v3(float *w, float v[][3], const int n, const float 
co[3])

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


[Bf-blender-cvs] [c5d0a232049] master: Fix T73348: Surface Deform distortion on bind with small faces

2020-02-10 Thread Campbell Barton
Commit: c5d0a2320498d1feb7cc2c68fc6504bb187d5a8d
Author: Campbell Barton
Date:   Tue Feb 11 18:19:34 2020 +1100
Branches: master
https://developer.blender.org/rBc5d0a2320498d1feb7cc2c68fc6504bb187d5a8d

Fix T73348: Surface Deform distortion on bind with small faces

Thanks to @CodyWinch for finding the root cause

===

M   source/blender/blenlib/intern/math_geom.c

===

diff --git a/source/blender/blenlib/intern/math_geom.c 
b/source/blender/blenlib/intern/math_geom.c
index a17fecca303..1b428d7f054 100644
--- a/source/blender/blenlib/intern/math_geom.c
+++ b/source/blender/blenlib/intern/math_geom.c
@@ -4152,13 +4152,15 @@ struct Float2_Len {
 static float mean_value_half_tan_v3(const struct Float3_Len *d_curr,
 const struct Float3_Len *d_next)
 {
-  float cross[3], area;
+  float cross[3];
   cross_v3_v3v3(cross, d_curr->dir, d_next->dir);
-  area = len_v3(cross);
-  if (LIKELY(fabsf(area) > FLT_EPSILON)) {
+  const float area = len_v3(cross);
+  /* Compare against zero since 'FLT_EPSILON' can be too large, see: T73348. */
+  if (LIKELY(area != 0.0f)) {
 const float dot = dot_v3v3(d_curr->dir, d_next->dir);
 const float len = d_curr->len * d_next->len;
-return (len - dot) / area;
+const float result = (len - dot) / area;
+return isfinite(result) ? result : 0.0f;
   }
   else {
 return 0.0f;
@@ -4168,13 +4170,14 @@ static float mean_value_half_tan_v3(const struct 
Float3_Len *d_curr,
 static float mean_value_half_tan_v2(const struct Float2_Len *d_curr,
 const struct Float2_Len *d_next)
 {
-  float area;
   /* different from the 3d version but still correct */
-  area = cross_v2v2(d_curr->dir, d_next->dir);
-  if (LIKELY(fabsf(area) > FLT_EPSILON)) {
+  const float area = cross_v2v2(d_curr->dir, d_next->dir);
+  /* Compare against zero since 'FLT_EPSILON' can be too large, see: T73348. */
+  if (LIKELY(area != 0.0f)) {
 const float dot = dot_v2v2(d_curr->dir, d_next->dir);
 const float len = d_curr->len * d_next->len;
-return (len - dot) / area;
+const float result = (len - dot) / area;
+return isfinite(result) ? result : 0.0f;
   }
   else {
 return 0.0f;

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


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

2020-02-10 Thread Campbell Barton
Commit: e08c2128af86ea027bd1e4163753cd9130e4af3c
Author: Campbell Barton
Date:   Tue Feb 11 17:20:31 2020 +1100
Branches: master
https://developer.blender.org/rBe08c2128af86ea027bd1e4163753cd9130e4af3c

Merge branch 'blender-v2.82-release'

===



===



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


[Bf-blender-cvs] [3a1af7444c3] blender-v2.82-release: Fix T73682: Sampling color fails for float images

2020-02-10 Thread Campbell Barton
Commit: 3a1af7444c36df7a3bd0ffcd8566c52136b14629
Author: Campbell Barton
Date:   Tue Feb 11 17:13:33 2020 +1100
Branches: blender-v2.82-release
https://developer.blender.org/rB3a1af7444c36df7a3bd0ffcd8566c52136b14629

Fix T73682: Sampling color fails for float images

===

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

===

diff --git a/source/blender/editors/sculpt_paint/paint_utils.c 
b/source/blender/editors/sculpt_paint/paint_utils.c
index db22729e8b0..99ef4c9aeae 100644
--- a/source/blender/editors/sculpt_paint/paint_utils.c
+++ b/source/blender/editors/sculpt_paint/paint_utils.c
@@ -545,7 +545,7 @@ void paint_sample_color(
 }
 
 ImBuf *ibuf = BKE_image_acquire_ibuf(image, , NULL);
-if (ibuf && ibuf->rect) {
+if (ibuf && (ibuf->rect || ibuf->rect_float)) {
   sample_success = true;
 
   u = u * ibuf->x;

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


[Bf-blender-cvs] [5911b6b313c] master: Fix T73695: line highlight jitters with smooth scroll

2020-02-10 Thread Kai Jægersen
Commit: 5911b6b313c7ada6d58a634ec5ec5f07fe1652a9
Author: Kai Jægersen
Date:   Tue Feb 11 16:27:51 2020 +1100
Branches: master
https://developer.blender.org/rB5911b6b313c7ada6d58a634ec5ec5f07fe1652a9

Fix T73695: line highlight jitters with smooth scroll

===

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

===

diff --git a/source/blender/editors/space_text/text_draw.c 
b/source/blender/editors/space_text/text_draw.c
index 96fa9f87398..02914737229 100644
--- a/source/blender/editors/space_text/text_draw.c
+++ b/source/blender/editors/space_text/text_draw.c
@@ -1338,10 +1338,16 @@ static void draw_text_decoration(SpaceText *st, ARegion 
*ar)
   wrap_offset_in_line(st, ar, text->sell, text->selc, , );
 
   y1 = ar->winy - (vsell - offl) * lheight;
+  if (st->flags & ST_SCROLL_SELECT) {
+y1 += st->runtime.scroll_ofs_px[1];
+  }
   y2 = y1 - (lheight * visible_lines);
 }
 else {
   y1 = ar->winy - vsell * lheight;
+  if (st->flags & ST_SCROLL_SELECT) {
+y1 += st->runtime.scroll_ofs_px[1];
+  }
   y2 = y1 - (lheight);
 }

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


[Bf-blender-cvs] [50d5c03e2d1] master: UI: Use popup dialog for make single user from operator search

2020-02-10 Thread Campbell Barton
Commit: 50d5c03e2d14b852c6afd3046aa8428bede85efd
Author: Campbell Barton
Date:   Tue Feb 11 14:01:01 2020 +1100
Branches: master
https://developer.blender.org/rB50d5c03e2d14b852c6afd3046aa8428bede85efd

UI: Use popup dialog for make single user from operator search

Use a popup since the default action was to do nothing,
the user would always need to access the redo panel.

Resolves T73711.

===

M   release/scripts/startup/bl_ui/space_view3d.py
M   source/blender/editors/object/object_relations.c

===

diff --git a/release/scripts/startup/bl_ui/space_view3d.py 
b/release/scripts/startup/bl_ui/space_view3d.py
index 6ca6cb7b544..537a4a4761a 100644
--- a/release/scripts/startup/bl_ui/space_view3d.py
+++ b/release/scripts/startup/bl_ui/space_view3d.py
@@ -2713,6 +2713,7 @@ class VIEW3D_MT_make_single_user(Menu):
 
 def draw(self, _context):
 layout = self.layout
+layout.operator_context = 'EXEC_DEFAULT'
 
 props = layout.operator("object.make_single_user", text="Object")
 props.object = True
diff --git a/source/blender/editors/object/object_relations.c 
b/source/blender/editors/object/object_relations.c
index 687634801b3..8ee061efc08 100644
--- a/source/blender/editors/object/object_relations.c
+++ b/source/blender/editors/object/object_relations.c
@@ -2645,8 +2645,11 @@ void OBJECT_OT_make_single_user(wmOperatorType *ot)
   ot->description = "Make linked data local to each object";
   ot->idname = "OBJECT_OT_make_single_user";
 
+  /* Note that the invoke callback is only used from operator search,
+   * otherwise this does nothing by default. */
+
   /* api callbacks */
-  ot->invoke = WM_menu_invoke;
+  ot->invoke = WM_operator_props_popup_confirm;
   ot->exec = make_single_user_exec;
   ot->poll = ED_operator_objectmode;

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


[Bf-blender-cvs] [3e6e9ce01bf] master: Cleanup: extra semicolons, comma use, undeclared vars

2020-02-10 Thread Campbell Barton
Commit: 3e6e9ce01bf419ef6c777a711d3c7f428c23af1e
Author: Campbell Barton
Date:   Tue Feb 11 12:01:29 2020 +1100
Branches: master
https://developer.blender.org/rB3e6e9ce01bf419ef6c777a711d3c7f428c23af1e

Cleanup: extra semicolons, comma use, undeclared vars

===

M   intern/cycles/kernel/filter/filter_features_sse.h
M   intern/mantaflow/intern/MANTA_main.cpp
M   source/blender/blenkernel/intern/fluid.c
M   source/blender/blenkernel/intern/particle_system.c
M   source/blender/blenlib/intern/delaunay_2d.c
M   source/blender/draw/intern/draw_cache_impl_mesh.c
M   source/blender/freestyle/intern/view_map/ViewMap.cpp
M   source/blender/modifiers/intern/MOD_weld.c

===

diff --git a/intern/cycles/kernel/filter/filter_features_sse.h 
b/intern/cycles/kernel/filter/filter_features_sse.h
index 7bbd17066fd..59d4ace2bef 100644
--- a/intern/cycles/kernel/filter/filter_features_sse.h
+++ b/intern/cycles/kernel/filter/filter_features_sse.h
@@ -109,7 +109,6 @@ ccl_device_inline void filter_calculate_scale_sse(float4 
*scale, bool use_time)
   scale[2] = rcp(max(reduce_max(scale[2]), make_float4(0.01f)));
   if (use_time) {
 scale[10] = rcp(max(reduce_max(scale[6]), make_float4(0.01f)));
-;
   }
   scale[6] = rcp(max(reduce_max(scale[4]), make_float4(0.01f)));
   scale[7] = scale[8] = scale[9] = rcp(max(reduce_max(sqrt(scale[5])), 
make_float4(0.01f)));
diff --git a/intern/mantaflow/intern/MANTA_main.cpp 
b/intern/mantaflow/intern/MANTA_main.cpp
index 91853ca566b..d7c8f5491a9 100644
--- a/intern/mantaflow/intern/MANTA_main.cpp
+++ b/intern/mantaflow/intern/MANTA_main.cpp
@@ -1440,7 +1440,6 @@ int MANTA::writeConfiguration(FluidModifierData *mmd, int 
framenr)
   FluidDomainSettings *mds = mmd->domain;
   std::ostringstream ss;
   char cacheDir[FILE_MAX], targetFile[FILE_MAX];
-  ;
   cacheDir[0] = '\0';
   targetFile[0] = '\0';
 
diff --git a/source/blender/blenkernel/intern/fluid.c 
b/source/blender/blenkernel/intern/fluid.c
index c3db083810c..d38541c8bbe 100644
--- a/source/blender/blenkernel/intern/fluid.c
+++ b/source/blender/blenkernel/intern/fluid.c
@@ -3402,7 +3402,7 @@ static void 
BKE_fluid_modifier_processDomain(FluidModifierData *mmd,
   resume_guide = (!is_startframe) && (mds->cache_frame_pause_guide == 
scene_framenr);
 
   bool read_cache, bake_cache;
-  read_cache = false,
+  read_cache = false;
   bake_cache = baking_data || baking_noise || baking_mesh || baking_particles 
|| baking_guide;
 
   bool with_gdomain;
diff --git a/source/blender/blenkernel/intern/particle_system.c 
b/source/blender/blenkernel/intern/particle_system.c
index 4c4e88da6c7..2f6ffdfe607 100644
--- a/source/blender/blenkernel/intern/particle_system.c
+++ b/source/blender/blenkernel/intern/particle_system.c
@@ -4378,7 +4378,6 @@ static void particles_fluid_step(ParticleSimulationData 
*sim,
   1. / fabsf(ob->scale[0]), 1. / fabsf(ob->scale[1]), 1. / 
fabsf(ob->scale[2])};
   mul_v3_fl(scaleAbs, max_size);
   mul_v3_v3(pa->state.co, scaleAbs);
-  ;
 
   /* Match domain scale. */
   mul_m4_v3(ob->obmat, pa->state.co);
diff --git a/source/blender/blenlib/intern/delaunay_2d.c 
b/source/blender/blenlib/intern/delaunay_2d.c
index 06c72a4c3d6..7287bec0849 100644
--- a/source/blender/blenlib/intern/delaunay_2d.c
+++ b/source/blender/blenlib/intern/delaunay_2d.c
@@ -389,7 +389,6 @@ static CDTEdge *connect_separate_parts(CDT_state *cdt, 
SymEdge *se1, SymEdge *se
 {
   CDTEdge *e;
   SymEdge *se1_rot, *se1_rotsym, *se2_rot, *se2_rotsym, *new_se, *new_se_sym;
-  ;
 
   BLI_assert(se1->face == cdt->outer_face && se2->face == cdt->outer_face);
   se1_rot = se1->rot;
diff --git a/source/blender/draw/intern/draw_cache_impl_mesh.c 
b/source/blender/draw/intern/draw_cache_impl_mesh.c
index 7408c8d0e38..ed60e16c7cc 100644
--- a/source/blender/draw/intern/draw_cache_impl_mesh.c
+++ b/source/blender/draw/intern/draw_cache_impl_mesh.c
@@ -987,8 +987,9 @@ void DRW_mesh_batch_cache_create_requested(
   if (cache->batch_requested == 0) {
 #ifdef DEBUG
 goto check;
-#endif
+#else
 return;
+#endif
   }
 
   /* Sanity check. */
@@ -1127,8 +1128,9 @@ void DRW_mesh_batch_cache_create_requested(
   if ((batch_requested & ~cache->batch_ready) == 0) {
 #ifdef DEBUG
 goto check;
-#endif
+#else
 return;
+#endif
   }
 
   cache->batch_ready |= batch_requested;
diff --git a/source/blender/freestyle/intern/view_map/ViewMap.cpp 
b/source/blender/freestyle/intern/view_map/ViewMap.cpp
index 9acd730d062..c371eba4b94 100644
--- a/source/blender/freestyle/intern/view_map/ViewMap.cpp
+++ b/source/blender/freestyle/intern/view_map/ViewMap.cpp
@@ -386,7 +386,7 @@ void TVertex::setBackEdgeA(ViewEdge *iBackEdgeA, bool 
incoming)
   if (!_sortedEdges.empty()) {
 edge_pointers_container::iterator dve = _sortedEdges.begin(), dveend = 

[Bf-blender-cvs] [9f07c03d20b] master: Cleanup: unused headers

2020-02-10 Thread Campbell Barton
Commit: 9f07c03d20b8b420e28ca871f897388f46f396cf
Author: Campbell Barton
Date:   Tue Feb 11 11:51:12 2020 +1100
Branches: master
https://developer.blender.org/rB9f07c03d20b8b420e28ca871f897388f46f396cf

Cleanup: unused headers

===

M   source/blender/blenkernel/intern/lib_id.c
M   source/blender/blenkernel/intern/lib_id_delete.c
M   source/blender/blenkernel/intern/lib_override.c
M   source/blender/blenkernel/intern/lib_query.c
M   source/blender/blenkernel/intern/lib_remap.c

===

diff --git a/source/blender/blenkernel/intern/lib_id.c 
b/source/blender/blenkernel/intern/lib_id.c
index d1dd325a4df..18faf00d60f 100644
--- a/source/blender/blenkernel/intern/lib_id.c
+++ b/source/blender/blenkernel/intern/lib_id.c
@@ -51,13 +51,11 @@
 #include "DNA_material_types.h"
 #include "DNA_mesh_types.h"
 #include "DNA_meta_types.h"
-#include "DNA_modifier_types.h"
 #include "DNA_movieclip_types.h"
 #include "DNA_mask_types.h"
 #include "DNA_node_types.h"
 #include "DNA_object_types.h"
 #include "DNA_lightprobe_types.h"
-#include "DNA_rigidbody_types.h"
 #include "DNA_scene_types.h"
 #include "DNA_screen_types.h"
 #include "DNA_speaker_types.h"
@@ -70,7 +68,6 @@
 
 #include "BLI_utildefines.h"
 
-#include "BLI_bitmap.h"
 #include "BLI_blenlib.h"
 #include "BLI_ghash.h"
 #include "BLI_linklist.h"
@@ -103,7 +100,6 @@
 #include "BKE_lib_remap.h"
 #include "BKE_linestyle.h"
 #include "BKE_mesh.h"
-#include "BKE_mesh_runtime.h"
 #include "BKE_material.h"
 #include "BKE_main.h"
 #include "BKE_mball.h"
@@ -113,7 +109,6 @@
 #include "BKE_object.h"
 #include "BKE_paint.h"
 #include "BKE_particle.h"
-#include "BKE_packedFile.h"
 #include "BKE_lightprobe.h"
 #include "BKE_rigidbody.h"
 #include "BKE_sound.h"
@@ -127,9 +122,6 @@
 
 #include "RNA_access.h"
 
-#include "IMB_imbuf.h"
-#include "IMB_imbuf_types.h"
-
 #include "atomic_ops.h"
 
 //#define DEBUG_TIME
diff --git a/source/blender/blenkernel/intern/lib_id_delete.c 
b/source/blender/blenkernel/intern/lib_id_delete.c
index dd97a420ba6..f2fa6946d4b 100644
--- a/source/blender/blenkernel/intern/lib_id_delete.c
+++ b/source/blender/blenkernel/intern/lib_id_delete.c
@@ -20,12 +20,9 @@
  * Contains management of ID's for freeing & deletion.
  */
 
-#include "CLG_log.h"
-
 #include "MEM_guardedalloc.h"
 
 /* all types are needed here, in order to do memory operations */
-#include "DNA_anim_types.h"
 #include "DNA_armature_types.h"
 #include "DNA_brush_types.h"
 #include "DNA_camera_types.h"
@@ -66,7 +63,6 @@
 #include "BKE_cachefile.h"
 #include "BKE_collection.h"
 #include "BKE_curve.h"
-#include "BKE_fcurve.h"
 #include "BKE_font.h"
 #include "BKE_gpencil.h"
 #include "BKE_idprop.h"
diff --git a/source/blender/blenkernel/intern/lib_override.c 
b/source/blender/blenkernel/intern/lib_override.c
index 8fecad5a975..af861b5b0e9 100644
--- a/source/blender/blenkernel/intern/lib_override.c
+++ b/source/blender/blenkernel/intern/lib_override.c
@@ -45,9 +45,6 @@
 #include "RNA_access.h"
 #include "RNA_types.h"
 
-#include "PIL_time.h"
-#include "PIL_time_utildefines.h"
-
 #define OVERRIDE_AUTO_CHECK_DELAY 0.2 /* 200ms between auto-override checks. */
 
 static void lib_override_library_property_copy(IDOverrideLibraryProperty 
*op_dst,
diff --git a/source/blender/blenkernel/intern/lib_query.c 
b/source/blender/blenkernel/intern/lib_query.c
index 09e7be591cd..cf4c96a70e9 100644
--- a/source/blender/blenkernel/intern/lib_query.c
+++ b/source/blender/blenkernel/intern/lib_query.c
@@ -23,8 +23,6 @@
 
 #include 
 
-#include "MEM_guardedalloc.h"
-
 #include "DNA_anim_types.h"
 #include "DNA_armature_types.h"
 #include "DNA_brush_types.h"
@@ -38,7 +36,6 @@
 #include "DNA_linestyle_types.h"
 #include "DNA_material_types.h"
 #include "DNA_mesh_types.h"
-#include "DNA_meshdata_types.h"
 #include "DNA_meta_types.h"
 #include "DNA_movieclip_types.h"
 #include "DNA_mask_types.h"
@@ -76,7 +73,6 @@
 #include "BKE_rigidbody.h"
 #include "BKE_sequencer.h"
 #include "BKE_shader_fx.h"
-#include "BKE_tracking.h"
 #include "BKE_workspace.h"
 
 #define FOREACH_FINALIZE _finalize
diff --git a/source/blender/blenkernel/intern/lib_remap.c 
b/source/blender/blenkernel/intern/lib_remap.c
index e9cc0dfc972..9b6d62a87aa 100644
--- a/source/blender/blenkernel/intern/lib_remap.c
+++ b/source/blender/blenkernel/intern/lib_remap.c
@@ -22,15 +22,10 @@
 
 #include "CLG_log.h"
 
-#include "MEM_guardedalloc.h"
-
 #include "BLI_utildefines.h"
 
-#include "BLI_rect.h"
-
 #include "DNA_object_types.h"
 
-#include "BKE_animsys.h"
 #include "BKE_armature.h"
 #include "BKE_collection.h"
 #include "BKE_curve.h"
@@ -46,11 +41,11 @@
 #include "BKE_node.h"
 #include "BKE_object.h"
 
-#include "lib_intern.h"
-
 #include "DEG_depsgraph.h"
 #include "DEG_depsgraph_build.h"
 
+#include "lib_intern.h" /* own include */
+
 static CLG_LogRef LOG = {.identifier = "bke.lib_remap"};
 
 

[Bf-blender-cvs] [906b8a241a7] master: Cleanup: add license header, use header guards

2020-02-10 Thread Campbell Barton
Commit: 906b8a241a7884119982789e1ffded8a79c45219
Author: Campbell Barton
Date:   Tue Feb 11 11:37:35 2020 +1100
Branches: master
https://developer.blender.org/rB906b8a241a7884119982789e1ffded8a79c45219

Cleanup: add license header, use header guards

===

M   source/blender/blenlib/BLI_optional.h
M   source/blender/blenlib/BLI_utility_mixins.h

===

diff --git a/source/blender/blenlib/BLI_optional.h 
b/source/blender/blenlib/BLI_optional.h
index 8429cddc710..90bded604ea 100644
--- a/source/blender/blenlib/BLI_optional.h
+++ b/source/blender/blenlib/BLI_optional.h
@@ -20,7 +20,8 @@
  * Simple version of std::optional, which is only available since C++17.
  */
 
-#pragma once
+#ifndef __BLI_OPTIONAL_H__
+#define __BLI_OPTIONAL_H__
 
 #include "BLI_utildefines.h"
 #include "BLI_memory_utils_cxx.h"
@@ -194,3 +195,5 @@ template class Optional {
 };
 
 } /* namespace BLI */
+
+#endif /* __BLI_OPTIONAL_H__ */
diff --git a/source/blender/blenlib/BLI_utility_mixins.h 
b/source/blender/blenlib/BLI_utility_mixins.h
index 66164fdcd24..ce7a4ce094a 100644
--- a/source/blender/blenlib/BLI_utility_mixins.h
+++ b/source/blender/blenlib/BLI_utility_mixins.h
@@ -1,4 +1,25 @@
-#pragma once
+/*
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ */
+
+/** \file
+ * \ingroup bli
+ */
+
+#ifndef __BLI_UTILITY_MIXINS_H__
+#define __BLI_UTILITY_MIXINS_H__
 
 namespace BLI {
 
@@ -27,3 +48,5 @@ class NonMovable {
 };
 
 }  // namespace BLI
+
+#endif /* __BLI_UTILITY_MIXINS_H__ */

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


[Bf-blender-cvs] [a66b9490a10] master: Doc: update to T73699 fix

2020-02-10 Thread Campbell Barton
Commit: a66b9490a10b114b7d6b7350b06010f98887ca84
Author: Campbell Barton
Date:   Tue Feb 11 11:29:19 2020 +1100
Branches: master
https://developer.blender.org/rBa66b9490a10b114b7d6b7350b06010f98887ca84

Doc: update to T73699 fix

It's important to refer to "other selected objects" in this case.

===

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

===

diff --git a/source/blender/editors/mesh/editmesh_knife_project.c 
b/source/blender/editors/mesh/editmesh_knife_project.c
index ba760e07b72..2e175cb156c 100644
--- a/source/blender/editors/mesh/editmesh_knife_project.c
+++ b/source/blender/editors/mesh/editmesh_knife_project.c
@@ -153,7 +153,9 @@ static int knifeproject_exec(bContext *C, wmOperator *op)
 return OPERATOR_FINISHED;
   }
   else {
-BKE_report(op->reports, RPT_ERROR, "Projected object does not have any 
wire or boundary edges");
+BKE_report(op->reports,
+   RPT_ERROR,
+   "No other selected objects have wire or boundary edges to use 
for projection");
 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] [56a4ee3fdbc] master: Cleanup: remove duplicate, commented structs

2020-02-10 Thread Campbell Barton
Commit: 56a4ee3fdbc647d037a89128725e5988715c59ad
Author: Campbell Barton
Date:   Tue Feb 11 12:22:16 2020 +1100
Branches: master
https://developer.blender.org/rB56a4ee3fdbc647d037a89128725e5988715c59ad

Cleanup: remove duplicate, commented structs

===

M   source/blender/collada/ControllerExporter.cpp

===

diff --git a/source/blender/collada/ControllerExporter.cpp 
b/source/blender/collada/ControllerExporter.cpp
index 8712fc509e6..ef91fcfa62c 100644
--- a/source/blender/collada/ControllerExporter.cpp
+++ b/source/blender/collada/ControllerExporter.cpp
@@ -175,21 +175,6 @@ void ControllerExporter::export_skin_controller(Object 
*ob, Object *ob_arm)
* joint names: ob -> vertex group names
* vertex group weights: me->dvert -> groups -> index, weight */
 
-#if 0
-  me->dvert :
-
-  typedef struct MDeformVert {
-struct MDeformWeight *dw;
-int totweight;
-int flag;  // flag only in use for weightpaint now
-  } MDeformVert;
-
-  typedef struct MDeformWeight {
-int def_nr;
-float weight;
-  } MDeformWeight;
-#endif
-
   bool use_instantiation = 
this->export_settings.get_use_object_instantiation();
   Mesh *me;

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


[Bf-blender-cvs] [ad2a8400e9a] master: Fix T56108: Crash editing corrupted vertex groups

2020-02-10 Thread Campbell Barton
Commit: ad2a8400e9a263acf924311ce1fb050b0e1eb415
Author: Campbell Barton
Date:   Tue Feb 11 12:35:10 2020 +1100
Branches: master
https://developer.blender.org/rBad2a8400e9a263acf924311ce1fb050b0e1eb415

Fix T56108: Crash editing corrupted vertex groups

While the file in this report had corrupted values,
this is avoidable without adding any extra overhead.

Use unsigned vertex group indices since we don't need negative values,
this is an alternative to checking they aren't negative in many places.

Vertex group values over INT_MAX is still considered invalid,
so any accidental unsigned wrapping won't be silently ignored.

===

M   source/blender/blenkernel/BKE_deform.h
M   source/blender/blenkernel/intern/armature.c
M   source/blender/blenkernel/intern/deform.c
M   source/blender/blenkernel/intern/mesh_validate.c
M   source/blender/collada/ControllerExporter.cpp
M   source/blender/makesdna/DNA_meshdata_types.h
M   source/blender/modifiers/intern/MOD_mask.c

===

diff --git a/source/blender/blenkernel/BKE_deform.h 
b/source/blender/blenkernel/BKE_deform.h
index ca06716599c..2911002b9e9 100644
--- a/source/blender/blenkernel/BKE_deform.h
+++ b/source/blender/blenkernel/BKE_deform.h
@@ -106,7 +106,7 @@ void defvert_normalize_subset(struct MDeformVert *dvert,
 void defvert_normalize_lock_single(struct MDeformVert *dvert,
const bool *vgroup_subset,
const int vgroup_tot,
-   const int def_nr_lock);
+   const uint def_nr_lock);
 void defvert_normalize_lock_map(struct MDeformVert *dvert,
 const bool *vgroup_subset,
 const int vgroup_tot,
diff --git a/source/blender/blenkernel/intern/armature.c 
b/source/blender/blenkernel/intern/armature.c
index ed752986ddd..d4498017ffd 100644
--- a/source/blender/blenkernel/intern/armature.c
+++ b/source/blender/blenkernel/intern/armature.c
@@ -1562,8 +1562,8 @@ static void armature_vert_task(void *__restrict userdata,
 int deformed = 0;
 unsigned int j;
 for (j = dvert->totweight; j != 0; j--, dw++) {
-  const int index = dw->def_nr;
-  if (index >= 0 && index < data->defbase_tot && (pchan = 
data->defnrToPC[index])) {
+  const uint index = dw->def_nr;
+  if (index < data->defbase_tot && (pchan = data->defnrToPC[index])) {
 float weight = dw->weight;
 Bone *bone = pchan->bone;
 
diff --git a/source/blender/blenkernel/intern/deform.c 
b/source/blender/blenkernel/intern/deform.c
index 79dcdd15bf7..41ff9594cff 100644
--- a/source/blender/blenkernel/intern/deform.c
+++ b/source/blender/blenkernel/intern/deform.c
@@ -255,10 +255,9 @@ void defvert_remap(MDeformVert *dvert, int *map, const int 
map_len)
   unsigned int i;
   for (i = dvert->totweight; i != 0; i--, dw++) {
 if (dw->def_nr < map_len) {
-  dw->def_nr = map[dw->def_nr];
+  BLI_assert(map[dw->def_nr] >= 0);
 
-  /* just in case */
-  BLI_assert(dw->def_nr >= 0);
+  dw->def_nr = map[dw->def_nr];
 }
   }
 }
@@ -337,7 +336,7 @@ void defvert_normalize(MDeformVert *dvert)
 void defvert_normalize_lock_single(MDeformVert *dvert,
const bool *vgroup_subset,
const int vgroup_tot,
-   const int def_nr_lock)
+   const uint def_nr_lock)
 {
   if (dvert->totweight == 0) {
 /* nothing */
diff --git a/source/blender/blenkernel/intern/mesh_validate.c 
b/source/blender/blenkernel/intern/mesh_validate.c
index 4aa5bfa04ab..e4de75b923f 100644
--- a/source/blender/blenkernel/intern/mesh_validate.c
+++ b/source/blender/blenkernel/intern/mesh_validate.c
@@ -784,22 +784,24 @@ bool BKE_mesh_validate_arrays(Mesh *mesh,
   for (j = 0, dw = dv->dw; j < dv->totweight; j++, dw++) {
 /* note, greater than max defgroups is accounted for in our code, but 
not < 0 */
 if (!isfinite(dw->weight)) {
-  PRINT_ERR("\tVertex deform %u, group %d has weight: %f", i, 
dw->def_nr, dw->weight);
+  PRINT_ERR("\tVertex deform %u, group %u has weight: %f", i, 
dw->def_nr, dw->weight);
   if (do_fixes) {
 dw->weight = 0.0f;
 fix_flag.verts_weight = true;
   }
 }
 else if (dw->weight < 0.0f || dw->weight > 1.0f) {
-  PRINT_ERR("\tVertex deform %u, group %d has weight: %f", i, 
dw->def_nr, dw->weight);
+  PRINT_ERR("\tVertex deform %u, group %u has weight: %f", i, 
dw->def_nr, dw->weight);
   if (do_fixes) {
 CLAMP(dw->weight, 0.0f, 1.0f);
 fix_flag.verts_weight = true;
   }
 }
 
-if (dw->def_nr < 0) {
-  PRINT_ERR("\tVertex deform %u, has invalid 

[Bf-blender-cvs] [7d6c08beb8e] master: Doc: simplify T72883 fix

2020-02-10 Thread Campbell Barton
Commit: 7d6c08beb8e0c90ec95242fefde440834ac85488
Author: Campbell Barton
Date:   Tue Feb 11 11:27:01 2020 +1100
Branches: master
https://developer.blender.org/rB7d6c08beb8e0c90ec95242fefde440834ac85488

Doc: simplify T72883 fix

Code example made it seem setting the active object was more complex
than a single assignment.

===

M   doc/python_api/rst/info_quickstart.rst

===

diff --git a/doc/python_api/rst/info_quickstart.rst 
b/doc/python_api/rst/info_quickstart.rst
index 996169a5227..f4de6b955e5 100644
--- a/doc/python_api/rst/info_quickstart.rst
+++ b/doc/python_api/rst/info_quickstart.rst
@@ -230,11 +230,7 @@ though they may be changed by running API functions or by 
using the data API.
 
 So ``bpy.context.active_object = obj`` will raise an error.
 
-But the following will work as expected:
-
-   >>> obj = bpy.data.objects["Cube"]
-   >>> obj.select_set(state = True, view_layer = bpy.context.view_layer)
-   >>> bpy.context.view_layer.objects.active = obj
+But ``bpy.context.view_layer.objects.active = obj`` works as expected.
 
 The context attributes change depending on where they are accessed.
 The 3D Viewport has different context members than the Python Console,

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


[Bf-blender-cvs] [1c61f3e018d] master: RNA: Raise error assigning an active object which doesn't exist

2020-02-10 Thread Campbell Barton
Commit: 1c61f3e018d383bad52a179e1241e37b234b0b0d
Author: Campbell Barton
Date:   Mon Feb 10 21:58:52 2020 +1100
Branches: master
https://developer.blender.org/rB1c61f3e018d383bad52a179e1241e37b234b0b0d

RNA: Raise error assigning an active object which doesn't exist

Previously this silently cleared the view layers active object.

===

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

===

diff --git a/source/blender/makesrna/intern/rna_layer.c 
b/source/blender/makesrna/intern/rna_layer.c
index 40c6229f9b1..da882959ef2 100644
--- a/source/blender/makesrna/intern/rna_layer.c
+++ b/source/blender/makesrna/intern/rna_layer.c
@@ -88,11 +88,22 @@ static PointerRNA 
rna_LayerObjects_active_object_get(PointerRNA *ptr)
 
 static void rna_LayerObjects_active_object_set(PointerRNA *ptr,
PointerRNA value,
-   struct ReportList 
*UNUSED(reports))
+   struct ReportList *reports)
 {
   ViewLayer *view_layer = (ViewLayer *)ptr->data;
   if (value.data) {
-view_layer->basact = BKE_view_layer_base_find(view_layer, (Object 
*)value.data);
+Object *ob = value.data;
+Base *basact_test = BKE_view_layer_base_find(view_layer, ob);
+if (basact_test != NULL) {
+  view_layer->basact = basact_test;
+}
+else {
+  BKE_reportf(reports,
+  RPT_ERROR,
+  "ViewLayer '%s' does not contain object '%s'",
+  view_layer->name,
+  ob->id.name + 2);
+}
   }
   else {
 view_layer->basact = NULL;

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


[Bf-blender-cvs] [9ef18d8b36a] greasepencil-refactor: GPencil: Refactor: Add implementation of new mask list system

2020-02-10 Thread Clément Foucault
Commit: 9ef18d8b36a6b6f834be56f181af5fca9685b376
Author: Clément Foucault
Date:   Tue Feb 11 00:05:39 2020 +0100
Branches: greasepencil-refactor
https://developer.blender.org/rB9ef18d8b36a6b6f834be56f181af5fca9685b376

GPencil: Refactor: Add implementation of new mask list system

This system makes it possible to have up to 256 layers in a GPencil Object
that can be used as masks. User can use more than 256 layers and use mask
on them but the masking one must be from one of the first 256.

This commit does not include optimizations.

===

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

===

diff --git a/source/blender/draw/engines/gpencil/gpencil_cache_utils.c 
b/source/blender/draw/engines/gpencil/gpencil_cache_utils.c
index b05e3fe4ebd..3caaea0516b 100644
--- a/source/blender/draw/engines/gpencil/gpencil_cache_utils.c
+++ b/source/blender/draw/engines/gpencil/gpencil_cache_utils.c
@@ -115,6 +115,7 @@ GPENCIL_tLayer *gpencil_layer_cache_add(GPENCIL_PrivateData 
*pd, Object *ob, bGP
   const bool is_obact = ((pd->obact) && (pd->obact == ob));
   const bool is_fade = ((pd->fade_layer_opacity > -1.0f) && (is_obact) &&
 ((gpl->flag & GP_LAYER_ACTIVE) == 0));
+  const bool use_mask = (gpl->flag & GP_LAYER_USE_MASK) != 0;
   bool mask_invert = true; /* True because we invert the dummy texture red 
channel. */
 
   /* Defines layer opacity. For active object depends of layer opacity factor, 
and
@@ -132,17 +133,36 @@ GPENCIL_tLayer 
*gpencil_layer_cache_add(GPENCIL_PrivateData *pd, Object *ob, bGP
   bGPdata *gpd = (bGPdata *)ob->data;
   GPENCIL_tLayer *tgp_layer = BLI_memblock_alloc(pd->gp_layer_pool);
   tgp_layer->layer_id = BLI_findindex(>layers, gpl);
-  tgp_layer->mask_id = -1;
+  tgp_layer->mask_bits = NULL;
+
+  if (use_mask && !BLI_listbase_is_empty(>mask_layers)) {
+bool valid_mask = false;
+/* Warning: only GP_MAX_MASKBITS amount of bits.
+ * TODO(fclem) Find a better system without any limitation. */
+tgp_layer->mask_bits = BLI_memblock_alloc(pd->gp_maskbit_pool);
+BLI_bitmap_set_all(tgp_layer->mask_bits, false, GP_MAX_MASKBITS);
+
+LISTBASE_FOREACH (bGPDlayer_Mask *, mask, >mask_layers) {
+  bGPDlayer *gpl_mask = BKE_gpencil_layer_named_get(gpd, mask->name);
+  if (gpl_mask && (gpl_mask != gpl) && ((gpl_mask->flag & GP_LAYER_HIDE) 
== 0)) {
+int index = BLI_findindex(>layers, gpl_mask);
+if (index < GP_MAX_MASKBITS) {
+  BLI_BITMAP_SET(tgp_layer->mask_bits, index, true);
+  valid_mask = true;
+}
+  }
+}
 
-  // TODO GPXX (New masking)
-  // bGPDlayer *gpl_mask = BKE_gpencil_layer_named_get(gpd, gpl->mask_layer);
-  // if (gpl_mask && (gpl_mask != gpl) && ((gpl_mask->flag & GP_LAYER_HIDE) == 
0)) {
-  //  mask_invert = (gpl->flag & GP_LAYER_MASK_INVERT) != 0;
-  //  tgp_layer->mask_id = BLI_findindex(>layers, gpl_mask);
-  //  pd->use_mask_fb = true;
-  //}
+if (valid_mask) {
+  mask_invert = (gpl->flag & GP_LAYER_MASK_INVERT) != 0;
+  pd->use_mask_fb = true;
+}
+else {
+  tgp_layer->mask_bits = NULL;
+}
+  }
 
-  const bool is_masked = tgp_layer->mask_id != -1;
+  const bool is_masked = tgp_layer->mask_bits != NULL;
 
   {
 DRWState state = DRW_STATE_WRITE_COLOR | DRW_STATE_BLEND_ALPHA_PREMUL;
diff --git a/source/blender/draw/engines/gpencil/gpencil_draw_data.c 
b/source/blender/draw/engines/gpencil/gpencil_draw_data.c
index 97e5a44f0ab..58b1b72dd66 100644
--- a/source/blender/draw/engines/gpencil/gpencil_draw_data.c
+++ b/source/blender/draw/engines/gpencil/gpencil_draw_data.c
@@ -479,6 +479,7 @@ static void gpencil_view_layer_data_free(void *storage)
 
   BLI_memblock_destroy(vldata->gp_light_pool, gpencil_light_pool_free);
   BLI_memblock_destroy(vldata->gp_material_pool, gpencil_material_pool_free);
+  BLI_memblock_destroy(vldata->gp_maskbit_pool, NULL);
   BLI_memblock_destroy(vldata->gp_object_pool, NULL);
   BLI_memblock_destroy(vldata->gp_layer_pool, NULL);
   BLI_memblock_destroy(vldata->gp_vfx_pool, NULL);
@@ -497,6 +498,7 @@ GPENCIL_ViewLayerData *GPENCIL_view_layer_data_ensure(void)
 
 (*vldata)->gp_light_pool = BLI_memblock_create(sizeof(GPENCIL_LightPool));
 (*vldata)->gp_material_pool = 
BLI_memblock_create(sizeof(GPENCIL_MaterialPool));
+(*vldata)->gp_maskbit_pool = 
BLI_memblock_create(BLI_BITMAP_SIZE(GP_MAX_MASKBITS));
 (*vldata)->gp_object_pool = BLI_memblock_create(sizeof(GPENCIL_tObject));
 (*vldata)->gp_layer_pool = BLI_memblock_create(sizeof(GPENCIL_tLayer));
 (*vldata)->gp_vfx_pool = BLI_memblock_create(sizeof(GPENCIL_tVfx));
diff --git a/source/blender/draw/engines/gpencil/gpencil_engine.c 

[Bf-blender-cvs] [189e96ba687] master: Fix T72883: Correct Context Usage

2020-02-10 Thread Aaron Carlisle
Commit: 189e96ba687c88bf40f86ba64e5054c70ebde95b
Author: Aaron Carlisle
Date:   Mon Feb 10 14:08:34 2020 -0500
Branches: master
https://developer.blender.org/rB189e96ba687c88bf40f86ba64e5054c70ebde95b

Fix T72883: Correct Context Usage

===

M   doc/python_api/rst/info_quickstart.rst

===

diff --git a/doc/python_api/rst/info_quickstart.rst 
b/doc/python_api/rst/info_quickstart.rst
index 75aeb765f53..996169a5227 100644
--- a/doc/python_api/rst/info_quickstart.rst
+++ b/doc/python_api/rst/info_quickstart.rst
@@ -228,13 +228,16 @@ Note that the context is read-only.
 These values cannot be modified directly,
 though they may be changed by running API functions or by using the data API.
 
-So ``bpy.context.object = obj`` will raise an error.
+So ``bpy.context.active_object = obj`` will raise an error.
 
-But ``bpy.context.scene.objects.active = obj`` will work as expected.
+But the following will work as expected:
 
+   >>> obj = bpy.data.objects["Cube"]
+   >>> obj.select_set(state = True, view_layer = bpy.context.view_layer)
+   >>> bpy.context.view_layer.objects.active = obj
 
 The context attributes change depending on where they are accessed.
-The 3D view has different context members than the console,
+The 3D Viewport has different context members than the Python Console,
 so take care when accessing context attributes that the user state is known.
 
 See :mod:`bpy.context` API reference.

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


[Bf-blender-cvs] [974dc284761] master: Fix T73699: Unhelpful error message when trying to knife project a manifold object

2020-02-10 Thread Aaron Carlisle
Commit: 974dc284761338da477fc1e4e901b6ad1b82805f
Author: Aaron Carlisle
Date:   Mon Feb 10 13:38:16 2020 -0500
Branches: master
https://developer.blender.org/rB974dc284761338da477fc1e4e901b6ad1b82805f

Fix T73699: Unhelpful error message when trying to knife project a manifold 
object

===

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

===

diff --git a/source/blender/editors/mesh/editmesh_knife_project.c 
b/source/blender/editors/mesh/editmesh_knife_project.c
index ebd1e62e596..ba760e07b72 100644
--- a/source/blender/editors/mesh/editmesh_knife_project.c
+++ b/source/blender/editors/mesh/editmesh_knife_project.c
@@ -153,7 +153,7 @@ static int knifeproject_exec(bContext *C, wmOperator *op)
 return OPERATOR_FINISHED;
   }
   else {
-BKE_report(op->reports, RPT_ERROR, "No other selected objects found to use 
for projection");
+BKE_report(op->reports, RPT_ERROR, "Projected object does not have any 
wire or boundary edges");
 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] [51b67218ae7] master: Revert "Sculpt: Remove partial viewport updates from sculpt stroke code"

2020-02-10 Thread Pablo Dobarro
Commit: 51b67218ae797dc77b20c467aea3c4918af4cb4d
Author: Pablo Dobarro
Date:   Tue Jan 28 01:22:30 2020 +0100
Branches: master
https://developer.blender.org/rB51b67218ae797dc77b20c467aea3c4918af4cb4d

Revert "Sculpt: Remove partial viewport updates from sculpt stroke code"

This reverts commit 394b48029c5335381f774f83524ad6ee5cb986da.

Leaving this here does not affect performance in any significant way and it may 
be useful in the future.

Reviewed By: brecht

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

===

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

===

diff --git a/source/blender/editors/sculpt_paint/sculpt.c 
b/source/blender/editors/sculpt_paint/sculpt.c
index 00fb8abc06d..23521b8496c 100644
--- a/source/blender/editors/sculpt_paint/sculpt.c
+++ b/source/blender/editors/sculpt_paint/sculpt.c
@@ -7537,7 +7537,9 @@ static void sculpt_flush_update_step(bContext *C, 
SculptUpdateType update_flags)
 ED_region_tag_redraw(ar);
   }
   else {
-/* Fast path where we just update the BVH nodes that changed. */
+/* Fast path where we just update the BVH nodes that changed, and redraw
+ * only the part of the 3D viewport where changes happened. */
+rcti r;
 
 if (update_flags & SCULPT_UPDATE_COORDS) {
   BKE_pbvh_update_bounds(ss->pbvh, PBVH_UpdateBB);
@@ -7547,7 +7549,21 @@ static void sculpt_flush_update_step(bContext *C, 
SculptUpdateType update_flags)
   sculpt_update_object_bounding_box(ob);
 }
 
-ED_region_tag_redraw(ar);
+if (sculpt_get_redraw_rect(ar, CTX_wm_region_view3d(C), ob, )) {
+  if (ss->cache) {
+ss->cache->current_r = r;
+  }
+
+  /* previous is not set in the current cache else
+   * the partial rect will always grow */
+  sculpt_extend_redraw_rect_previous(ob, );
+
+  r.xmin += ar->winrct.xmin - 2;
+  r.xmax += ar->winrct.xmin + 2;
+  r.ymin += ar->winrct.ymin - 2;
+  r.ymax += ar->winrct.ymin + 2;
+  ED_region_tag_redraw_partial(ar, , true);
+}
   }
 }

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


[Bf-blender-cvs] [78cf61cc629] master: Fix T72690: Do not draw points behind the viewport camera in the paint cursor

2020-02-10 Thread Pablo Dobarro
Commit: 78cf61cc6292eb66c5835cf337ad8fb3e1c259b2
Author: Pablo Dobarro
Date:   Thu Jan 23 21:41:30 2020 +0100
Branches: master
https://developer.blender.org/rB78cf61cc6292eb66c5835cf337ad8fb3e1c259b2

Fix T72690: Do not draw points behind the viewport camera in the paint cursor

In some situations the symmetry point may be behind the camera, so the
projection is inverted and it looks wrong. This avoids drawing points in
screen space when they are behind the camera.

Reviewed By: jbakker

Maniphest Tasks: T72690

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

===

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

===

diff --git a/source/blender/editors/sculpt_paint/paint_cursor.c 
b/source/blender/editors/sculpt_paint/paint_cursor.c
index 19b4b9f569c..cf796c7dd3c 100644
--- a/source/blender/editors/sculpt_paint/paint_cursor.c
+++ b/source/blender/editors/sculpt_paint/paint_cursor.c
@@ -1103,8 +1103,11 @@ static void cursor_draw_point_screen_space(
   copy_v3_v3(location, true_location);
   mul_m4_v3(obmat, location);
   ED_view3d_project(ar, location, translation_vertex_cursor);
-  imm_draw_circle_fill_3d(
-  gpuattr, translation_vertex_cursor[0], translation_vertex_cursor[1], 
size, 10);
+  /* Do not draw points behind the view. Z [near, far] is mapped to [-1, 1]. */
+  if (translation_vertex_cursor[2] <= 1.0f) {
+imm_draw_circle_fill_3d(
+gpuattr, translation_vertex_cursor[0], translation_vertex_cursor[1], 
size, 10);
+  }
 }
 
 static void cursor_draw_tiling_preview(const uint gpuattr,

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


[Bf-blender-cvs] [08d1df4729b] master: Fix T66349: Add missing update for face orientation overlay

2020-02-10 Thread Pablo Dobarro
Commit: 08d1df4729b670962ce0d61b275f9c5efe05c761
Author: Pablo Dobarro
Date:   Thu Jan 23 21:36:58 2020 +0100
Branches: master
https://developer.blender.org/rB08d1df4729b670962ce0d61b275f9c5efe05c761

Fix T66349: Add missing update for face orientation overlay

This forces the full geometry when that overlay is enabled.
I would rather not support this and leave that bug as a know issues/
limitation because this is terrible for performance and people may not
be aware that by enabling the option they are disabling the
optimization.

Reviewed By: jbakker

Maniphest Tasks: T66349

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

===

M   source/blender/draw/engines/overlay/overlay_facing.c

===

diff --git a/source/blender/draw/engines/overlay/overlay_facing.c 
b/source/blender/draw/engines/overlay/overlay_facing.c
index fd974e9b8b8..74d82262019 100644
--- a/source/blender/draw/engines/overlay/overlay_facing.c
+++ b/source/blender/draw/engines/overlay/overlay_facing.c
@@ -21,6 +21,7 @@
  */
 
 #include "DRW_render.h"
+#include "BKE_paint.h"
 
 #include "overlay_private.h"
 
@@ -45,9 +46,17 @@ void OVERLAY_facing_cache_populate(OVERLAY_Data *vedata, 
Object *ob)
 {
   OVERLAY_PrivateData *pd = vedata->stl->pd;
 
-  struct GPUBatch *geom = DRW_cache_object_surface_get(ob);
-  if (geom) {
-DRW_shgroup_call(pd->facing_grp, geom, ob);
+  const DRWContextState *draw_ctx = DRW_context_state_get();
+  const bool use_sculpt_pbvh = BKE_sculptsession_use_pbvh_draw(ob, 
draw_ctx->v3d) &&
+   !DRW_state_is_image_render();
+  if (use_sculpt_pbvh) {
+DRW_shgroup_call_sculpt(pd->facing_grp, ob, false, false, false);
+  }
+  else {
+struct GPUBatch *geom = DRW_cache_object_surface_get(ob);
+if (geom) {
+  DRW_shgroup_call(pd->facing_grp, geom, ob);
+}
   }
 }

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


[Bf-blender-cvs] [a2248e2ec4b] master: Cleanup: Fix warning (unused variable)

2020-02-10 Thread Dalai Felinto
Commit: a2248e2ec4b4f0fcae58c821253a311c583f6649
Author: Dalai Felinto
Date:   Mon Feb 10 19:09:53 2020 +0100
Branches: master
https://developer.blender.org/rBa2248e2ec4b4f0fcae58c821253a311c583f6649

Cleanup: Fix warning (unused variable)

===

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

===

diff --git a/source/blender/editors/space_graph/graph_buttons.c 
b/source/blender/editors/space_graph/graph_buttons.c
index 02bf97495c1..f61eb15b3c2 100644
--- a/source/blender/editors/space_graph/graph_buttons.c
+++ b/source/blender/editors/space_graph/graph_buttons.c
@@ -136,13 +136,11 @@ static void graph_panel_cursor(const bContext *C, Panel 
*pa)
   PointerRNA spaceptr, sceneptr;
   uiLayout *layout = pa->layout;
   uiLayout *col, *sub;
-  uiBlock *block;
 
   /* get RNA pointers for use when creating the UI elements */
   RNA_id_pointer_create(>id, );
   RNA_pointer_create(>id, _SpaceGraphEditor, sipo, );
 
-  block = uiLayoutGetBlock(layout);
   uiLayoutSetPropSep(layout, true);
   uiLayoutSetPropDecorate(layout, false);

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


[Bf-blender-cvs] [377657b734d] greasepencil-refactor: GPencil: Add header checkbox in Mask Panel

2020-02-10 Thread Antonio Vazquez
Commit: 377657b734d792322b1bcb0640a46a9e81aa3273
Author: Antonio Vazquez
Date:   Mon Feb 10 19:11:53 2020 +0100
Branches: greasepencil-refactor
https://developer.blender.org/rB377657b734d792322b1bcb0640a46a9e81aa3273

GPencil: Add header checkbox in Mask Panel

===

M   release/scripts/startup/bl_ui/properties_grease_pencil_common.py

===

diff --git a/release/scripts/startup/bl_ui/properties_grease_pencil_common.py 
b/release/scripts/startup/bl_ui/properties_grease_pencil_common.py
index 52f9b50b503..e854c4cdbfe 100644
--- a/release/scripts/startup/bl_ui/properties_grease_pencil_common.py
+++ b/release/scripts/startup/bl_ui/properties_grease_pencil_common.py
@@ -781,11 +781,21 @@ class GPENCIL_UL_masks(UIList):
 
 class GreasePencilLayerMasksPanel:
 
+def draw_header(self, context):
+ob = context.active_object
+gpd = ob.data
+gpl = gpd.layers.active
+
+self.layout.prop(gpl, "use_mask_layer", text="")
+
 def draw(self, context):
-layout = self.layout
 ob = context.active_object
 gpd = ob.data
 gpl = gpd.layers.active
+
+layout = self.layout
+layout.enabled = gpl.use_mask_layer
+
 if gpl:
 row = layout.row(align=True)
 row.prop(gpd, "layer_list", text="Layer")

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


[Bf-blender-cvs] [c6da0351bd4] greasepencil-refactor: GPencil: Don't hide blend mode for mask layers

2020-02-10 Thread Antonio Vazquez
Commit: c6da0351bd40dac7a13bb2954d5bf004ef290a25
Author: Antonio Vazquez
Date:   Mon Feb 10 19:04:31 2020 +0100
Branches: greasepencil-refactor
https://developer.blender.org/rBc6da0351bd40dac7a13bb2954d5bf004ef290a25

GPencil: Don't hide blend mode for mask layers

===

M   release/scripts/startup/bl_ui/properties_data_gpencil.py

===

diff --git a/release/scripts/startup/bl_ui/properties_data_gpencil.py 
b/release/scripts/startup/bl_ui/properties_data_gpencil.py
index 32026f800cf..bb0db30ec72 100644
--- a/release/scripts/startup/bl_ui/properties_data_gpencil.py
+++ b/release/scripts/startup/bl_ui/properties_data_gpencil.py
@@ -172,9 +172,8 @@ class DATA_PT_gpencil_layers(DataButtonsPanel, Panel):
 layout.use_property_decorate = True
 col = layout.column(align=True)
 
-if not gpl.use_mask_layer:
-col = layout.row(align=True)
-col.prop(gpl, "blend_mode", text="Blend")
+col = layout.row(align=True)
+col.prop(gpl, "blend_mode", text="Blend")
 
 col = layout.row(align=True)
 col.prop(gpl, "opacity", text="Opacity", slider=True)

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


[Bf-blender-cvs] [11d7e5db6af] greasepencil-refactor: GPencil: Change Mask panel layout

2020-02-10 Thread Antonio Vazquez
Commit: 11d7e5db6af6880875b745d99435a85957c25e44
Author: Antonio Vazquez
Date:   Mon Feb 10 18:54:39 2020 +0100
Branches: greasepencil-refactor
https://developer.blender.org/rB11d7e5db6af6880875b745d99435a85957c25e44

GPencil: Change Mask panel layout

===

M   release/scripts/startup/bl_ui/properties_grease_pencil_common.py

===

diff --git a/release/scripts/startup/bl_ui/properties_grease_pencil_common.py 
b/release/scripts/startup/bl_ui/properties_grease_pencil_common.py
index ddb059e7cbf..52f9b50b503 100644
--- a/release/scripts/startup/bl_ui/properties_grease_pencil_common.py
+++ b/release/scripts/startup/bl_ui/properties_grease_pencil_common.py
@@ -787,8 +787,11 @@ class GreasePencilLayerMasksPanel:
 gpd = ob.data
 gpl = gpd.layers.active
 if gpl:
-row = layout.row()
-row.prop(gpl, "invert_mask")
+row = layout.row(align=True)
+row.prop(gpd, "layer_list", text="Layer")
+layer_name = gpd.layer_list
+row.operator("gpencil.layer_mask_add", icon="ADD", 
text="").name=layer_name
+
 rows = 4
 row = layout.row()
 col = row.column()
@@ -797,10 +800,8 @@ class GreasePencilLayerMasksPanel:
 col2 = row.column(align=True)
 col2.operator("gpencil.layer_mask_remove", icon='REMOVE', text="")
 
-subrow = col.row(align=True)
-subrow.prop(gpd, "layer_list", text="Layer")
-layer_name = gpd.layer_list
-subrow.operator("gpencil.layer_mask_add", icon="ADD", 
text="").name=layer_name
+row = layout.row()
+row.prop(gpl, "invert_mask")
 
 class GreasePencilLayerRelationsPanel:

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


[Bf-blender-cvs] [3b7d3d8b8ea] undo-experiments-swap-reread-datablocks: Merge branch 'undo-experiments' into undo-experiments-swap-reread-datablocks

2020-02-10 Thread Bastien Montagne
Commit: 3b7d3d8b8ea065461f60bc2fb417e223e824fe0c
Author: Bastien Montagne
Date:   Mon Feb 10 18:50:55 2020 +0100
Branches: undo-experiments-swap-reread-datablocks
https://developer.blender.org/rB3b7d3d8b8ea065461f60bc2fb417e223e824fe0c

Merge branch 'undo-experiments' into undo-experiments-swap-reread-datablocks

===



===



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


[Bf-blender-cvs] [9ae8f97fed1] libquery-handle-ui-pointers: Merge branch 'master' into libquery-handle-ui-pointers

2020-02-10 Thread Bastien Montagne
Commit: 9ae8f97fed1ca5a1b4572a0a4fff5be314f86e3e
Author: Bastien Montagne
Date:   Mon Feb 10 18:49:00 2020 +0100
Branches: libquery-handle-ui-pointers
https://developer.blender.org/rB9ae8f97fed1ca5a1b4572a0a4fff5be314f86e3e

Merge branch 'master' into libquery-handle-ui-pointers

===



===



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


[Bf-blender-cvs] [e11eedae89d] undo-experiments: Merge branch 'libquery-handle-ui-pointers' into undo-experiments

2020-02-10 Thread Bastien Montagne
Commit: e11eedae89dbc85c195b7083f064735cdf11920d
Author: Bastien Montagne
Date:   Mon Feb 10 18:49:43 2020 +0100
Branches: undo-experiments
https://developer.blender.org/rBe11eedae89dbc85c195b7083f064735cdf11920d

Merge branch 'libquery-handle-ui-pointers' into undo-experiments

===



===



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


[Bf-blender-cvs] [a544582c215] libquery-handle-ui-pointers: Merge commit 'ddad044cfe13' into libquery-handle-ui-pointers

2020-02-10 Thread Bastien Montagne
Commit: a544582c215d138011300338ff43cce993383018
Author: Bastien Montagne
Date:   Mon Feb 10 18:47:36 2020 +0100
Branches: libquery-handle-ui-pointers
https://developer.blender.org/rBa544582c215d138011300338ff43cce993383018

Merge commit 'ddad044cfe13' into libquery-handle-ui-pointers

===



===



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


[Bf-blender-cvs] [01c5a3c9da2] undo-experiments-swap-reread-datablocks: Merge commit '633951f9be06' into undo-experiments-swap-reread-datablocks

2020-02-10 Thread Bastien Montagne
Commit: 01c5a3c9da231449277eadfa5b14f5c5733f1810
Author: Bastien Montagne
Date:   Mon Feb 10 18:25:14 2020 +0100
Branches: undo-experiments-swap-reread-datablocks
https://developer.blender.org/rB01c5a3c9da231449277eadfa5b14f5c5733f1810

Merge commit '633951f9be06' into undo-experiments-swap-reread-datablocks

===



===



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


[Bf-blender-cvs] [d4054961cc1] undo-experiments-swap-reread-datablocks: Merge branch 'undo-experiments' into undo-experiments-swap-reread-datablocks

2020-02-10 Thread Bastien Montagne
Commit: d4054961cc1b5be7d463bdd6ef18f9891e3ce54f
Author: Bastien Montagne
Date:   Mon Feb 10 18:26:46 2020 +0100
Branches: undo-experiments-swap-reread-datablocks
https://developer.blender.org/rBd4054961cc1b5be7d463bdd6ef18f9891e3ce54f

Merge branch 'undo-experiments' into undo-experiments-swap-reread-datablocks

===



===



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


[Bf-blender-cvs] [ced38f814a9] undo-experiments-swap-reread-datablocks: Merge branch 'undo-experiments' into undo-experiments-swap-reread-datablocks

2020-02-10 Thread Bastien Montagne
Commit: ced38f814a9a7c6ad1565b8da6d40ecabb8ee350
Author: Bastien Montagne
Date:   Fri Feb 7 16:14:28 2020 +0100
Branches: undo-experiments-swap-reread-datablocks
https://developer.blender.org/rBced38f814a9a7c6ad1565b8da6d40ecabb8ee350

Merge branch 'undo-experiments' into undo-experiments-swap-reread-datablocks

===



===



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


[Bf-blender-cvs] [bbe3b57c72d] undo-experiments: Merge branch 'master' into undo-experiments

2020-02-10 Thread Bastien Montagne
Commit: bbe3b57c72d6239be143d420e3e13c9e8ca9ff80
Author: Bastien Montagne
Date:   Mon Feb 10 18:21:50 2020 +0100
Branches: undo-experiments
https://developer.blender.org/rBbbe3b57c72d6239be143d420e3e13c9e8ca9ff80

Merge branch 'master' into undo-experiments

===



===

diff --cc source/blender/blenloader/intern/writefile.c
index 8889b85e8a0,30ba20b97da..b08b3926bdc
--- a/source/blender/blenloader/intern/writefile.c
+++ b/source/blender/blenloader/intern/writefile.c
@@@ -3927,12 -3927,8 +3927,12 @@@ static bool write_file_handle(Main *mai
  }
  
  if (do_override) {
-   BKE_override_library_operations_store_end(override_storage, id);
+   BKE_lib_override_library_operations_store_end(override_storage, id);
  }
 +
 +if (wd->use_memfile) {
 +  mywrite_flush(wd);
 +}
}
  
mywrite_flush(wd);

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


[Bf-blender-cvs] [a8bc14bbc5c] undo-experiments: Fix after merge of master.

2020-02-10 Thread Bastien Montagne
Commit: a8bc14bbc5c02e08fb90181e675af2d487f73e46
Author: Bastien Montagne
Date:   Mon Feb 10 18:23:40 2020 +0100
Branches: undo-experiments
https://developer.blender.org/rBa8bc14bbc5c02e08fb90181e675af2d487f73e46

Fix after merge of  master.

===

M   source/blender/editors/undo/memfile_undo.c

===

diff --git a/source/blender/editors/undo/memfile_undo.c 
b/source/blender/editors/undo/memfile_undo.c
index 7d143864624..a492d6fb323 100644
--- a/source/blender/editors/undo/memfile_undo.c
+++ b/source/blender/editors/undo/memfile_undo.c
@@ -30,8 +30,8 @@
 
 #include "BKE_blender_undo.h"
 #include "BKE_context.h"
-#include "BKE_library.h"
-#include "BKE_library_query.h"
+#include "BKE_lib_id.h"
+#include "BKE_lib_query.h"
 #include "BKE_main.h"
 #include "BKE_scene.h"
 #include "BKE_undo_system.h"

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


[Bf-blender-cvs] [633951f9be0] undo-experiments: Merge commit 'ddad044cfe13' into undo-experiments

2020-02-10 Thread Bastien Montagne
Commit: 633951f9be06f1bb332c9b08d6ae7806ce722624
Author: Bastien Montagne
Date:   Mon Feb 10 18:13:44 2020 +0100
Branches: undo-experiments
https://developer.blender.org/rB633951f9be06f1bb332c9b08d6ae7806ce722624

Merge commit 'ddad044cfe13' into undo-experiments

===



===



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


[Bf-blender-cvs] [e75e29ee478] master: Cleanup: Rename `BKE_library_override_` functions to `BKE_lib_override_library_`

2020-02-10 Thread Bastien Montagne
Commit: e75e29ee478592742defb80d6d992173f4a635df
Author: Bastien Montagne
Date:   Mon Feb 10 18:05:19 2020 +0100
Branches: master
https://developer.blender.org/rBe75e29ee478592742defb80d6d992173f4a635df

Cleanup: Rename `BKE_library_override_` functions to `BKE_lib_override_library_`

pqrt of T72604.

===

M   source/blender/blenkernel/BKE_lib_override.h
M   source/blender/blenkernel/intern/lib_id_delete.c
M   source/blender/blenkernel/intern/lib_override.c
M   source/blender/blenkernel/intern/undo_system.c
M   source/blender/blenloader/intern/readfile.c
M   source/blender/blenloader/intern/writefile.c
M   source/blender/editors/interface/interface_ops.c
M   source/blender/editors/interface/interface_templates.c
M   source/blender/editors/object/object_relations.c
M   source/blender/editors/space_outliner/outliner_tools.c
M   source/blender/makesrna/intern/rna_ID.c
M   source/blender/makesrna/intern/rna_access_compare_override.c
M   source/blender/makesrna/intern/rna_rna.c
M   source/blender/python/intern/bpy_app.c
M   source/blender/windowmanager/intern/wm_files.c
M   source/creator/creator_args.c

===

diff --git a/source/blender/blenkernel/BKE_lib_override.h 
b/source/blender/blenkernel/BKE_lib_override.h
index 2c03fbcc550..29b19af7abf 100644
--- a/source/blender/blenkernel/BKE_lib_override.h
+++ b/source/blender/blenkernel/BKE_lib_override.h
@@ -45,27 +45,28 @@ struct IDOverrideLibraryProperty;
 struct IDOverrideLibraryPropertyOperation;
 struct Main;
 
-void BKE_override_library_enable(const bool do_enable);
-bool BKE_override_library_is_enabled(void);
+void BKE_lib_override_library_enable(const bool do_enable);
+bool BKE_lib_override_library_is_enabled(void);
 
-struct IDOverrideLibrary *BKE_override_library_init(struct ID *local_id, 
struct ID *reference_id);
-void BKE_override_library_copy(struct ID *dst_id, const struct ID *src_id);
-void BKE_override_library_clear(struct IDOverrideLibrary *override, const bool 
do_id_user);
-void BKE_override_library_free(struct IDOverrideLibrary **override, const bool 
do_id_user);
+struct IDOverrideLibrary *BKE_lib_override_library_init(struct ID *local_id,
+struct ID 
*reference_id);
+void BKE_lib_override_library_copy(struct ID *dst_id, const struct ID *src_id);
+void BKE_lib_override_library_clear(struct IDOverrideLibrary *override, const 
bool do_id_user);
+void BKE_lib_override_library_free(struct IDOverrideLibrary **override, const 
bool do_id_user);
 
-struct ID *BKE_override_library_create_from_id(struct Main *bmain,
-   struct ID *reference_id,
-   const bool do_tagged_remap);
-bool BKE_override_library_create_from_tag(struct Main *bmain);
+struct ID *BKE_lib_override_library_create_from_id(struct Main *bmain,
+   struct ID *reference_id,
+   const bool do_tagged_remap);
+bool BKE_lib_override_library_create_from_tag(struct Main *bmain);
 
-struct IDOverrideLibraryProperty *BKE_override_library_property_find(
+struct IDOverrideLibraryProperty *BKE_lib_override_library_property_find(
 struct IDOverrideLibrary *override, const char *rna_path);
-struct IDOverrideLibraryProperty *BKE_override_library_property_get(
+struct IDOverrideLibraryProperty *BKE_lib_override_library_property_get(
 struct IDOverrideLibrary *override, const char *rna_path, bool *r_created);
-void BKE_override_library_property_delete(struct IDOverrideLibrary *override,
-  struct IDOverrideLibraryProperty 
*override_property);
+void BKE_lib_override_library_property_delete(struct IDOverrideLibrary 
*override,
+  struct IDOverrideLibraryProperty 
*override_property);
 
-struct IDOverrideLibraryPropertyOperation 
*BKE_override_library_property_operation_find(
+struct IDOverrideLibraryPropertyOperation 
*BKE_lib_override_library_property_operation_find(
 struct IDOverrideLibraryProperty *override_property,
 const char *subitem_refname,
 const char *subitem_locname,
@@ -73,7 +74,7 @@ struct IDOverrideLibraryPropertyOperation 
*BKE_override_library_property_operati
 const int subitem_locindex,
 const bool strict,
 bool *r_strict);
-struct IDOverrideLibraryPropertyOperation 
*BKE_override_library_property_operation_get(
+struct IDOverrideLibraryPropertyOperation 
*BKE_lib_override_library_property_operation_get(
 struct IDOverrideLibraryProperty *override_property,
 const short operation,
 const char *subitem_refname,
@@ -83,32 +84,31 @@ struct IDOverrideLibraryPropertyOperation 
*BKE_override_library_property_operati
 const bool strict,
 

[Bf-blender-cvs] [c6e28f65139] master: Updated install_deps to latest required OSL/LLVM.

2020-02-10 Thread Bastien Montagne
Commit: c6e28f65139d6e7536789d9bf1895e7f7058ac92
Author: Bastien Montagne
Date:   Mon Feb 10 17:35:17 2020 +0100
Branches: master
https://developer.blender.org/rBc6e28f65139d6e7536789d9bf1895e7f7058ac92

Updated install_deps to latest required OSL/LLVM.

===

M   build_files/build_environment/install_deps.sh

===

diff --git a/build_files/build_environment/install_deps.sh 
b/build_files/build_environment/install_deps.sh
index 8e8aeda0893..2f27eab8e3f 100755
--- a/build_files/build_environment/install_deps.sh
+++ b/build_files/build_environment/install_deps.sh
@@ -392,7 +392,7 @@ OIIO_FORCE_BUILD=false
 OIIO_FORCE_REBUILD=false
 OIIO_SKIP=false
 
-LLVM_VERSION="6.0.1"
+LLVM_VERSION="9.0.1"
 LLVM_VERSION_MIN="6.0"
 LLVM_VERSION_FOUND=""
 LLVM_FORCE_BUILD=false
@@ -400,7 +400,7 @@ LLVM_FORCE_REBUILD=false
 LLVM_SKIP=false
 
 # OSL needs to be compiled for now!
-OSL_VERSION="1.9.9"
+OSL_VERSION="1.10.9"
 OSL_VERSION_MIN=$OSL_VERSION
 OSL_FORCE_BUILD=false
 OSL_FORCE_REBUILD=false
@@ -2081,7 +2081,7 @@ compile_OSL() {
 fi
 
 if [ -d $INST/oiio ]; then
-  cmake_d="$cmake_d -D OPENIMAGEIOHOME=$INST/oiio"
+  cmake_d="$cmake_d -D OPENIMAGEIO_ROOT_DIR=$INST/oiio"
 fi
 
 if [ ! -z $LLVM_VERSION_FOUND ]; then

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


[Bf-blender-cvs] [c92163b2b07] master: CTest: Disable the cross test from the avxf unit tests.

2020-02-10 Thread Ray Molenkamp
Commit: c92163b2b07e922b5fd07ec8c7981509940b103e
Author: Ray Molenkamp
Date:   Mon Feb 10 09:27:11 2020 -0700
Branches: master
https://developer.blender.org/rBc92163b2b07e922b5fd07ec8c7981509940b103e

CTest: Disable the cross test from the avxf unit tests.

Test fails on AVX2, I'll look into this but until the
cause is determined the test will be disabled

===

M   intern/cycles/test/util_avxf_test.h

===

diff --git a/intern/cycles/test/util_avxf_test.h 
b/intern/cycles/test/util_avxf_test.h
index 1460f23394a..91f5fe2070b 100644
--- a/intern/cycles/test/util_avxf_test.h
+++ b/intern/cycles/test/util_avxf_test.h
@@ -197,6 +197,8 @@ TEST(util_avx, avxf_shuffle)
  avxf(0.4f, 0.2f, 0.1f, 0.3f, 0.5f, 0.6f, 0.7f, 
0.8f));
 }
 
+/* XXX Test Fails on AVX2, needs further investigation before it can be 
enabled */
+#if 0
 TEST(util_avx, avxf_cross)
 {
VALIDATECPU
@@ -211,6 +213,7 @@ TEST(util_avx, avxf_cross)
   3.8146973e-06f,
   3.8146973e-06f));
 }
+#endif
 
 TEST(util_avx, avxf_dot3)
 {

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


[Bf-blender-cvs] [f3a3a976b7d] master: Refactor: move `Library`-specific functions into proper `BKE_library` file.

2020-02-10 Thread Bastien Montagne
Commit: f3a3a976b7ddaca77560040e9bea7e9303e4eead
Author: Bastien Montagne
Date:   Mon Feb 10 17:10:17 2020 +0100
Branches: master
https://developer.blender.org/rBf3a3a976b7ddaca77560040e9bea7e9303e4eead

Refactor: move `Library`-specific functions into proper `BKE_library` file.

Even though we do not have much of those, this might change in the
future, and in any case having specific functions for this ID type in
generic `BKE_lib` area was really confusing.

===

M   source/blender/blenkernel/BKE_lib_id.h
A   source/blender/blenkernel/BKE_library.h
M   source/blender/blenkernel/CMakeLists.txt
M   source/blender/blenkernel/intern/bpath.c
M   source/blender/blenkernel/intern/lib_id.c
M   source/blender/blenkernel/intern/lib_id_delete.c
A   source/blender/blenkernel/intern/library.c
M   source/blender/blenloader/intern/blend_validate.c
M   source/blender/editors/space_outliner/outliner_draw.c
M   source/blender/makesrna/intern/rna_ID.c

===

diff --git a/source/blender/blenkernel/BKE_lib_id.h 
b/source/blender/blenkernel/BKE_lib_id.h
index 2ff2644684a..7d00e98f239 100644
--- a/source/blender/blenkernel/BKE_lib_id.h
+++ b/source/blender/blenkernel/BKE_lib_id.h
@@ -182,7 +182,6 @@ void BKE_libblock_management_usercounts_clear(struct Main 
*bmain, void *idv);
 void BKE_id_lib_local_paths(struct Main *bmain, struct Library *lib, struct ID 
*id);
 void id_lib_extern(struct ID *id);
 void id_lib_indirect_weak_link(struct ID *id);
-void BKE_library_filepath_set(struct Main *bmain, struct Library *lib, const 
char *filepath);
 void id_us_ensure_real(struct ID *id);
 void id_us_clear_real(struct ID *id);
 void id_us_plus_no_lib(struct ID *id);
@@ -241,8 +240,6 @@ void BKE_id_full_name_ui_prefix_get(char 
name[MAX_ID_FULL_NAME_UI], const struct
 
 char *BKE_id_to_unique_string_key(const struct ID *id);
 
-void BKE_library_free(struct Library *lib);
-
 void BKE_library_make_local(struct Main *bmain,
 const struct Library *lib,
 struct GHash *old_to_new_ids,
diff --git a/source/blender/blenkernel/BKE_library.h 
b/source/blender/blenkernel/BKE_library.h
new file mode 100644
index 000..1324e4ebf90
--- /dev/null
+++ b/source/blender/blenkernel/BKE_library.h
@@ -0,0 +1,45 @@
+/*
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
+ * All rights reserved.
+ */
+#ifndef __BKE_LIBRARY_H__
+#define __BKE_LIBRARY_H__
+
+/** \file
+ * \ingroup bke
+ *
+ * API to manage `Library` data-blocks.
+ */
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#include "BLI_compiler_attrs.h"
+
+struct Library;
+struct Main;
+
+void BKE_library_free(struct Library *lib);
+
+void BKE_library_filepath_set(struct Main *bmain, struct Library *lib, const 
char *filepath);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* __BKE_LIBRARY_H__ */
diff --git a/source/blender/blenkernel/CMakeLists.txt 
b/source/blender/blenkernel/CMakeLists.txt
index e2be61269f9..f536b8d94fc 100644
--- a/source/blender/blenkernel/CMakeLists.txt
+++ b/source/blender/blenkernel/CMakeLists.txt
@@ -140,6 +140,7 @@ set(SRC
   intern/lib_override.c
   intern/lib_query.c
   intern/lib_remap.c
+  intern/library.c
   intern/light.c
   intern/lightprobe.c
   intern/linestyle.c
@@ -303,6 +304,7 @@ set(SRC
   BKE_lib_override.h
   BKE_lib_query.h
   BKE_lib_remap.h
+  BKE_library.h
   BKE_light.h
   BKE_lightprobe.h
   BKE_linestyle.h
diff --git a/source/blender/blenkernel/intern/bpath.c 
b/source/blender/blenkernel/intern/bpath.c
index 835fd645e25..3743a340a53 100644
--- a/source/blender/blenkernel/intern/bpath.c
+++ b/source/blender/blenkernel/intern/bpath.c
@@ -67,6 +67,7 @@
 
 #include "BKE_font.h"
 #include "BKE_lib_id.h"
+#include "BKE_library.h"
 #include "BKE_main.h"
 #include "BKE_node.h"
 #include "BKE_report.h"
diff --git a/source/blender/blenkernel/intern/lib_id.c 
b/source/blender/blenkernel/intern/lib_id.c
index 9a1ade90367..d1dd325a4df 100644
--- a/source/blender/blenkernel/intern/lib_id.c
+++ b/source/blender/blenkernel/intern/lib_id.c
@@ -1532,13 +1532,6 @@ void *BKE_libblock_copy_for_localize(const ID *id)
   

[Bf-blender-cvs] [ddad044cfe1] master: Fix mismatch in BKE headers' multi-include safeguards naming.

2020-02-10 Thread Bastien Montagne
Commit: ddad044cfe132f6d2367baead8d4bf2ecc68e399
Author: Bastien Montagne
Date:   Mon Feb 10 16:54:24 2020 +0100
Branches: master
https://developer.blender.org/rBddad044cfe132f6d2367baead8d4bf2ecc68e399

Fix mismatch in BKE headers' multi-include safeguards naming.

Forgot to update those in recent `BKE_lib_` files renames.

===

M   source/blender/blenkernel/BKE_lib_id.h
M   source/blender/blenkernel/BKE_lib_override.h
M   source/blender/blenkernel/BKE_lib_query.h
M   source/blender/blenkernel/BKE_lib_remap.h
M   source/blender/blenkernel/intern/lib_intern.h

===

diff --git a/source/blender/blenkernel/BKE_lib_id.h 
b/source/blender/blenkernel/BKE_lib_id.h
index f3a92fba1fb..2ff2644684a 100644
--- a/source/blender/blenkernel/BKE_lib_id.h
+++ b/source/blender/blenkernel/BKE_lib_id.h
@@ -16,8 +16,8 @@
  * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
  * All rights reserved.
  */
-#ifndef __BKE_LIBRARY_H__
-#define __BKE_LIBRARY_H__
+#ifndef __BKE_LIB_ID_H__
+#define __BKE_LIB_ID_H__
 
 /** \file
  * \ingroup bke
@@ -263,4 +263,4 @@ void BKE_id_reorder(const struct ListBase *lb, struct ID 
*id, struct ID *relativ
 }
 #endif
 
-#endif /* __BKE_LIBRARY_H__ */
+#endif /* __BKE_LIB_ID_H__ */
diff --git a/source/blender/blenkernel/BKE_lib_override.h 
b/source/blender/blenkernel/BKE_lib_override.h
index b6db93e1cf0..2c03fbcc550 100644
--- a/source/blender/blenkernel/BKE_lib_override.h
+++ b/source/blender/blenkernel/BKE_lib_override.h
@@ -17,8 +17,8 @@
  * All rights reserved.
  */
 
-#ifndef __BKE_LIBRARY_OVERRIDE_H__
-#define __BKE_LIBRARY_OVERRIDE_H__
+#ifndef __BKE_LIB_OVERRIDE_H__
+#define __BKE_LIB_OVERRIDE_H__
 
 /** \file
  * \ingroup bke
@@ -111,4 +111,4 @@ void 
BKE_override_library_operations_store_end(OverrideLibraryStorage *override_
struct ID *local);
 void BKE_override_library_operations_store_finalize(OverrideLibraryStorage 
*override_storage);
 
-#endif /* __BKE_LIBRARY_OVERRIDE_H__ */
+#endif /* __BKE_LIB_OVERRIDE_H__ */
diff --git a/source/blender/blenkernel/BKE_lib_query.h 
b/source/blender/blenkernel/BKE_lib_query.h
index a0abe4320ed..36aa69bf795 100644
--- a/source/blender/blenkernel/BKE_lib_query.h
+++ b/source/blender/blenkernel/BKE_lib_query.h
@@ -16,8 +16,8 @@
  * The Original Code is Copyright (C) 2014 by Blender Foundation.
  * All rights reserved.
  */
-#ifndef __BKE_LIBRARY_QUERY_H__
-#define __BKE_LIBRARY_QUERY_H__
+#ifndef __BKE_LIB_QUERY_H__
+#define __BKE_LIB_QUERY_H__
 
 /** \file
  * \ingroup bke
@@ -121,4 +121,4 @@ void BKE_library_ID_test_usages(struct Main *bmain,
 void BKE_library_unused_linked_data_set_tag(struct Main *bmain, const bool 
do_init_tag);
 void BKE_library_indirectly_used_data_tag_clear(struct Main *bmain);
 
-#endif /* __BKE_LIBRARY_QUERY_H__ */
+#endif /* __BKE_LIB_QUERY_H__ */
diff --git a/source/blender/blenkernel/BKE_lib_remap.h 
b/source/blender/blenkernel/BKE_lib_remap.h
index 0f39060f2f9..6105662c5d3 100644
--- a/source/blender/blenkernel/BKE_lib_remap.h
+++ b/source/blender/blenkernel/BKE_lib_remap.h
@@ -13,8 +13,8 @@
  * along with this program; if not, write to the Free Software Foundation,
  * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
  */
-#ifndef __BKE_LIBRARY_REMAP_H__
-#define __BKE_LIBRARY_REMAP_H__
+#ifndef __BKE_LIB_REMAP_H__
+#define __BKE_LIB_REMAP_H__
 
 /** \file
  * \ingroup bke
@@ -116,4 +116,4 @@ void BKE_library_callback_remap_editor_id_reference_set(
 }
 #endif
 
-#endif /* __BKE_LIBRARY_REMAP_H__ */
+#endif /* __BKE_LIB_REMAP_H__ */
diff --git a/source/blender/blenkernel/intern/lib_intern.h 
b/source/blender/blenkernel/intern/lib_intern.h
index c0568bca964..bd5e4a8dfe2 100644
--- a/source/blender/blenkernel/intern/lib_intern.h
+++ b/source/blender/blenkernel/intern/lib_intern.h
@@ -21,8 +21,8 @@
  * \ingroup bke
  */
 
-#ifndef __LIB_ID_INTERN_H__
-#define __LIB_ID_INTERN_H__
+#ifndef __LIB_INTERN_H__
+#define __LIB_INTERN_H__
 
 extern BKE_library_free_window_manager_cb free_windowmanager_cb;
 
@@ -30,4 +30,4 @@ extern BKE_library_free_notifier_reference_cb 
free_notifier_reference_cb;
 
 extern BKE_library_remap_editor_id_reference_cb remap_editor_id_reference_cb;
 
-#endif /* __LIB_ID_INTERN_H__ */
+#endif /* __LIB_INTERN_H__ */

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


[Bf-blender-cvs] [b4bf6b9cc97] functions: remove pad_up function

2020-02-10 Thread Jacques Lucke
Commit: b4bf6b9cc9705c2cb8f32e5a9986bf769e4158eb
Author: Jacques Lucke
Date:   Mon Feb 10 16:23:14 2020 +0100
Branches: functions
https://developer.blender.org/rBb4bf6b9cc9705c2cb8f32e5a9986bf769e4158eb

remove pad_up function

===

M   source/blender/blenlib/BLI_math_base.h
M   source/blender/blenlib/intern/math_base_inline.c
M   source/blender/functions/intern/generic_tuple.cc

===

diff --git a/source/blender/blenlib/BLI_math_base.h 
b/source/blender/blenlib/BLI_math_base.h
index cf806161e88..4f841f75d3a 100644
--- a/source/blender/blenlib/BLI_math_base.h
+++ b/source/blender/blenlib/BLI_math_base.h
@@ -161,8 +161,6 @@ MINLINE unsigned int power_of_2_min_u(unsigned int x);
 MINLINE unsigned int log2_floor_u(unsigned int x);
 MINLINE unsigned int log2_ceil_u(unsigned int x);
 
-MINLINE unsigned int pad_up(unsigned int x, unsigned int alignment);
-
 MINLINE int divide_round_i(int a, int b);
 MINLINE int mod_i(int i, int n);
 
diff --git a/source/blender/blenlib/intern/math_base_inline.c 
b/source/blender/blenlib/intern/math_base_inline.c
index 46c0550e42f..e2484c294b1 100644
--- a/source/blender/blenlib/intern/math_base_inline.c
+++ b/source/blender/blenlib/intern/math_base_inline.c
@@ -249,11 +249,6 @@ MINLINE unsigned int log2_ceil_u(unsigned int x)
   }
 }
 
-MINLINE unsigned int pad_up(unsigned int x, unsigned int alignment)
-{
-  BLI_assert(is_power_of_2_i((int)alignment));
-  return (x + alignment - 1) & ~(alignment - 1);
-}
 
 /* rounding and clamping */
 
diff --git a/source/blender/functions/intern/generic_tuple.cc 
b/source/blender/functions/intern/generic_tuple.cc
index b7216362f13..b58a05be9d4 100644
--- a/source/blender/functions/intern/generic_tuple.cc
+++ b/source/blender/functions/intern/generic_tuple.cc
@@ -10,10 +10,11 @@ GenericTupleInfo::GenericTupleInfo(Vector 
types) : m_types(std:
   for (const CPPType *type : m_types) {
 uint size = type->size();
 uint alignment = type->alignment();
+uint alignment_mask = alignment - 1;
 
 m_alignment = std::max(m_alignment, alignment);
 
-m_size__data = pad_up(m_size__data, alignment);
+m_size__data = (m_size__data + alignment_mask) & ~alignment_mask;
 m_offsets.append(m_size__data);
 m_size__data += size;

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


[Bf-blender-cvs] [872ac349adf] master: Cleanup CLOG identifiers in BKE_lib' implementation files.

2020-02-10 Thread Bastien Montagne
Commit: 872ac349adf7f5cb9eeca58d350a2595f7fdd066
Author: Bastien Montagne
Date:   Mon Feb 10 16:30:41 2020 +0100
Branches: master
https://developer.blender.org/rB872ac349adf7f5cb9eeca58d350a2595f7fdd066

Cleanup CLOG identifiers in BKE_lib' implementation files.

===

M   source/blender/blenkernel/intern/lib_id.c
M   source/blender/blenkernel/intern/lib_id_delete.c
M   source/blender/blenkernel/intern/lib_remap.c

===

diff --git a/source/blender/blenkernel/intern/lib_id.c 
b/source/blender/blenkernel/intern/lib_id.c
index 470de08b5f4..9a1ade90367 100644
--- a/source/blender/blenkernel/intern/lib_id.c
+++ b/source/blender/blenkernel/intern/lib_id.c
@@ -138,7 +138,7 @@
 #  include "PIL_time_utildefines.h"
 #endif
 
-static CLG_LogRef LOG = {"bke.library"};
+static CLG_LogRef LOG = {.identifier = "bke.lib_id"};
 
 /* GS reads the memory pointed at in a specific ordering.
  * only use this definition, makes little and big endian systems
diff --git a/source/blender/blenkernel/intern/lib_id_delete.c 
b/source/blender/blenkernel/intern/lib_id_delete.c
index 8f4ae18c29e..fcca12a564a 100644
--- a/source/blender/blenkernel/intern/lib_id_delete.c
+++ b/source/blender/blenkernel/intern/lib_id_delete.c
@@ -108,7 +108,7 @@
 #endif
 
 /* Not used currently. */
-// static CLG_LogRef LOG = {.identifier = "bke.lib.id.delete"};
+// static CLG_LogRef LOG = {.identifier = "bke.lib_id_delete"};
 
 void BKE_libblock_free_data(ID *id, const bool do_id_user)
 {
diff --git a/source/blender/blenkernel/intern/lib_remap.c 
b/source/blender/blenkernel/intern/lib_remap.c
index a3888ad7ad0..e9cc0dfc972 100644
--- a/source/blender/blenkernel/intern/lib_remap.c
+++ b/source/blender/blenkernel/intern/lib_remap.c
@@ -51,7 +51,7 @@
 #include "DEG_depsgraph.h"
 #include "DEG_depsgraph_build.h"
 
-static CLG_LogRef LOG = {.identifier = "bke.library_remap"};
+static CLG_LogRef LOG = {.identifier = "bke.lib_remap"};
 
 BKE_library_free_window_manager_cb free_windowmanager_cb = NULL;

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


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

2020-02-10 Thread Lukas Stockner
Commit: 810088bf9b180367fe034122b9827c4496a32b09
Author: Lukas Stockner
Date:   Mon Feb 10 16:26:44 2020 +0100
Branches: master
https://developer.blender.org/rB810088bf9b180367fe034122b9827c4496a32b09

Merge branch 'blender-v2.82-release'

===



===



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


[Bf-blender-cvs] [d08ccd526f3] blender-v2.82-release: Fix unreported: Packing/unpacking errors don't mention tiled images

2020-02-10 Thread Lukas Stockner
Commit: d08ccd526f3641d79467e5d8d85a32a29acd2ade
Author: Lukas Stockner
Date:   Mon Feb 10 16:19:30 2020 +0100
Branches: blender-v2.82-release
https://developer.blender.org/rBd08ccd526f3641d79467e5d8d85a32a29acd2ade

Fix unreported: Packing/unpacking errors don't mention tiled images

Thanks to @dfelinto for spotting this!

===

M   source/blender/editors/space_image/image_ops.c

===

diff --git a/source/blender/editors/space_image/image_ops.c 
b/source/blender/editors/space_image/image_ops.c
index 18e084729bd..99929a4a0b7 100644
--- a/source/blender/editors/space_image/image_ops.c
+++ b/source/blender/editors/space_image/image_ops.c
@@ -3148,7 +3148,8 @@ static bool image_pack_test(bContext *C, wmOperator *op)
   }
 
   if (ELEM(ima->source, IMA_SRC_SEQUENCE, IMA_SRC_MOVIE, IMA_SRC_TILED)) {
-BKE_report(op->reports, RPT_ERROR, "Packing movies or image sequences not 
supported");
+BKE_report(
+op->reports, RPT_ERROR, "Packing movies, image sequences or tiled 
images not supported");
 return 0;
   }
 
@@ -3216,7 +3217,8 @@ static int image_unpack_exec(bContext *C, wmOperator *op)
   }
 
   if (ELEM(ima->source, IMA_SRC_SEQUENCE, IMA_SRC_MOVIE, IMA_SRC_TILED)) {
-BKE_report(op->reports, RPT_ERROR, "Unpacking movies or image sequences 
not supported");
+BKE_report(
+op->reports, RPT_ERROR, "Unpacking movies, image sequences or tiled 
images not supported");
 return OPERATOR_CANCELLED;
   }
 
@@ -3249,7 +3251,8 @@ static int image_unpack_invoke(bContext *C, wmOperator 
*op, const wmEvent *UNUSE
   }
 
   if (ELEM(ima->source, IMA_SRC_SEQUENCE, IMA_SRC_MOVIE, IMA_SRC_TILED)) {
-BKE_report(op->reports, RPT_ERROR, "Unpacking movies or image sequences 
not supported");
+BKE_report(
+op->reports, RPT_ERROR, "Unpacking movies, image sequences or tiled 
images not supported");
 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] [77208a08718] blender-v2.82-release: GPencil: Fix unreported missing annotation popover menu

2020-02-10 Thread Antonio Vazquez
Commit: 77208a08718f52f14a84a30a0d385321327bbe8a
Author: Antonio Vazquez
Date:   Mon Feb 10 11:55:49 2020 +0100
Branches: blender-v2.82-release
https://developer.blender.org/rB77208a08718f52f14a84a30a0d385321327bbe8a

GPencil: Fix unreported missing annotation popover menu

This was introduced when annotations was splited.

===

M   release/scripts/startup/bl_ui/space_toolsystem_toolbar.py

===

diff --git a/release/scripts/startup/bl_ui/space_toolsystem_toolbar.py 
b/release/scripts/startup/bl_ui/space_toolsystem_toolbar.py
index 0759d37e2b8..74a34589a4b 100644
--- a/release/scripts/startup/bl_ui/space_toolsystem_toolbar.py
+++ b/release/scripts/startup/bl_ui/space_toolsystem_toolbar.py
@@ -143,11 +143,7 @@ class _defs_view3d_generic:
 class _defs_annotate:
 
 def draw_settings_common(context, layout, tool):
-if type(context.gpencil_data_owner) is bpy.types.Object:
-gpd = context.scene.grease_pencil
-else:
-gpd = context.gpencil_data
-
+gpd = context.annotation_data
 if gpd is not None:
 if gpd.layers.active_note is not None:
 text = gpd.layers.active_note
@@ -157,7 +153,7 @@ class _defs_annotate:
 else:
 text = ""
 
-gpl = context.active_gpencil_layer
+gpl = context.active_annotation_layer
 if gpl is not None:
 layout.label(text="Annotation:")
 sub = layout.row(align=True)

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


[Bf-blender-cvs] [36b7f5d27e7] blender-v2.82-release: Fix T73713: Tiled textures (UDIM) getting lost when saving the .blend but not the textures

2020-02-10 Thread Lukas Stockner
Commit: 36b7f5d27e7aec2300d0c9f44f724c479769eb98
Author: Lukas Stockner
Date:   Mon Feb 10 16:12:45 2020 +0100
Branches: blender-v2.82-release
https://developer.blender.org/rB36b7f5d27e7aec2300d0c9f44f724c479769eb98

Fix T73713: Tiled textures (UDIM) getting lost when saving the .blend but not 
the textures

The issue here is simple, IMA_SRC_TILED was missing from a check for whether 
the image should
be saved.

Note that tiled images won't be automatically saved if they have never been 
saved before.
For single images this is handled by packing them, but packing of tiled images 
isn't
supported yet.

However, in that case the file closing dialog will at least show a warning now 
instead of
completely ignoring tiled images.

===

M   source/blender/editors/space_image/image_ops.c

===

diff --git a/source/blender/editors/space_image/image_ops.c 
b/source/blender/editors/space_image/image_ops.c
index e6bd563b02f..18e084729bd 100644
--- a/source/blender/editors/space_image/image_ops.c
+++ b/source/blender/editors/space_image/image_ops.c
@@ -2510,7 +2510,7 @@ static bool image_should_be_saved_when_modified(Image 
*ima)
 static bool image_should_be_saved(Image *ima, bool *is_format_writable)
 {
   if (BKE_image_is_dirty_writable(ima, is_format_writable) &&
-  (ima->source == IMA_SRC_FILE || ima->source == IMA_SRC_GENERATED)) {
+  ELEM(ima->source, IMA_SRC_FILE, IMA_SRC_GENERATED, IMA_SRC_TILED)) {
 return image_should_be_saved_when_modified(ima);
   }
   else {

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


[Bf-blender-cvs] [ec6fcac6285] master: Cleanup/Refactor: Move ID deletion into its own .c file.

2020-02-10 Thread Bastien Montagne
Commit: ec6fcac62856d7008ddc0af6575ec5fbad4fc363
Author: Bastien Montagne
Date:   Mon Feb 10 15:55:43 2020 +0100
Branches: master
https://developer.blender.org/rBec6fcac62856d7008ddc0af6575ec5fbad4fc363

Cleanup/Refactor: Move ID deletion into its own .c file.

Having functions defined in `BKE_lib_id.h` implemented into
`lib_remap.c` was confusing at best.

Besides trivial code splitting and header includes cleanup, had to add a
new `lib_intern.h` header for callbacks used by both remapping and
deletion code.

===

M   source/blender/blenkernel/CMakeLists.txt
A   source/blender/blenkernel/intern/lib_id_delete.c
A   source/blender/blenkernel/intern/lib_intern.h
M   source/blender/blenkernel/intern/lib_remap.c

===

diff --git a/source/blender/blenkernel/CMakeLists.txt 
b/source/blender/blenkernel/CMakeLists.txt
index 4c3137fcbe5..e2be61269f9 100644
--- a/source/blender/blenkernel/CMakeLists.txt
+++ b/source/blender/blenkernel/CMakeLists.txt
@@ -136,6 +136,7 @@ set(SRC
   intern/layer.c
   intern/layer_utils.c
   intern/lib_id.c
+  intern/lib_id_delete.c
   intern/lib_override.c
   intern/lib_query.c
   intern/lib_remap.c
@@ -370,6 +371,7 @@ set(SRC
   intern/CCGSubSurf_inline.h
   intern/CCGSubSurf_intern.h
   intern/data_transfer_intern.h
+  intern/lib_intern.h
   intern/multires_inline.h
   intern/pbvh_intern.h
   intern/subdiv_converter.h
diff --git a/source/blender/blenkernel/intern/lib_id_delete.c 
b/source/blender/blenkernel/intern/lib_id_delete.c
new file mode 100644
index 000..8f4ae18c29e
--- /dev/null
+++ b/source/blender/blenkernel/intern/lib_id_delete.c
@@ -0,0 +1,541 @@
+/*
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ */
+
+/** \file
+ * \ingroup bke
+ *
+ * Contains management of ID's for freeing & deletion.
+ */
+
+#include "CLG_log.h"
+
+#include "MEM_guardedalloc.h"
+
+/* all types are needed here, in order to do memory operations */
+#include "DNA_anim_types.h"
+#include "DNA_armature_types.h"
+#include "DNA_brush_types.h"
+#include "DNA_camera_types.h"
+#include "DNA_cachefile_types.h"
+#include "DNA_collection_types.h"
+#include "DNA_gpencil_types.h"
+#include "DNA_ipo_types.h"
+#include "DNA_key_types.h"
+#include "DNA_light_types.h"
+#include "DNA_lattice_types.h"
+#include "DNA_linestyle_types.h"
+#include "DNA_material_types.h"
+#include "DNA_mesh_types.h"
+#include "DNA_meta_types.h"
+#include "DNA_movieclip_types.h"
+#include "DNA_mask_types.h"
+#include "DNA_node_types.h"
+#include "DNA_object_types.h"
+#include "DNA_lightprobe_types.h"
+#include "DNA_scene_types.h"
+#include "DNA_screen_types.h"
+#include "DNA_speaker_types.h"
+#include "DNA_sound_types.h"
+#include "DNA_text_types.h"
+#include "DNA_vfont_types.h"
+#include "DNA_windowmanager_types.h"
+#include "DNA_workspace_types.h"
+#include "DNA_world_types.h"
+
+#include "BLI_utildefines.h"
+
+#include "BLI_listbase.h"
+
+#include "BKE_action.h"
+#include "BKE_armature.h"
+#include "BKE_brush.h"
+#include "BKE_camera.h"
+#include "BKE_cachefile.h"
+#include "BKE_collection.h"
+#include "BKE_curve.h"
+#include "BKE_fcurve.h"
+#include "BKE_font.h"
+#include "BKE_gpencil.h"
+#include "BKE_idprop.h"
+#include "BKE_image.h"
+#include "BKE_ipo.h"
+#include "BKE_key.h"
+#include "BKE_light.h"
+#include "BKE_lattice.h"
+#include "BKE_lib_id.h"
+#include "BKE_lib_override.h"
+#include "BKE_lib_remap.h"
+#include "BKE_linestyle.h"
+#include "BKE_mesh.h"
+#include "BKE_material.h"
+#include "BKE_main.h"
+#include "BKE_mask.h"
+#include "BKE_mball.h"
+#include "BKE_movieclip.h"
+#include "BKE_node.h"
+#include "BKE_object.h"
+#include "BKE_paint.h"
+#include "BKE_particle.h"
+#include "BKE_lightprobe.h"
+#include "BKE_speaker.h"
+#include "BKE_sound.h"
+#include "BKE_screen.h"
+#include "BKE_scene.h"
+#include "BKE_text.h"
+#include "BKE_texture.h"
+#include "BKE_workspace.h"
+#include "BKE_world.h"
+
+#include "lib_intern.h"
+
+#include "DEG_depsgraph.h"
+
+#ifdef WITH_PYTHON
+#  include "BPY_extern.h"
+#endif
+
+/* Not used currently. */
+// static CLG_LogRef LOG = {.identifier = "bke.lib.id.delete"};
+
+void BKE_libblock_free_data(ID *id, const bool do_id_user)
+{
+  if (id->properties) {
+

[Bf-blender-cvs] [93516dd758a] greasepencil-refactor: Merge branch 'greasepencil-object' into greasepencil-refactor

2020-02-10 Thread Antonio Vazquez
Commit: 93516dd758ae0bf23a2a3073c36a34bb4defcfc8
Author: Antonio Vazquez
Date:   Mon Feb 10 15:53:47 2020 +0100
Branches: greasepencil-refactor
https://developer.blender.org/rB93516dd758ae0bf23a2a3073c36a34bb4defcfc8

Merge branch 'greasepencil-object' into greasepencil-refactor

===



===



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


[Bf-blender-cvs] [f75445c17eb] greasepencil-object: GPencil: Fix compiler error after merge

2020-02-10 Thread Antonio Vazquez
Commit: f75445c17eb40d9ff8e7656dc16d336ac2b0df0d
Author: Antonio Vazquez
Date:   Mon Feb 10 15:52:39 2020 +0100
Branches: greasepencil-object
https://developer.blender.org/rBf75445c17eb40d9ff8e7656dc16d336ac2b0df0d

GPencil: Fix compiler error after merge

===

M   source/blender/gpencil_modifiers/intern/MOD_gpencilvertexcolor.c

===

diff --git a/source/blender/gpencil_modifiers/intern/MOD_gpencilvertexcolor.c 
b/source/blender/gpencil_modifiers/intern/MOD_gpencilvertexcolor.c
index d33bc12144d..83bdc708d07 100644
--- a/source/blender/gpencil_modifiers/intern/MOD_gpencilvertexcolor.c
+++ b/source/blender/gpencil_modifiers/intern/MOD_gpencilvertexcolor.c
@@ -41,7 +41,7 @@
 #include "BKE_gpencil.h"
 #include "BKE_gpencil_modifier.h"
 #include "BKE_modifier.h"
-#include "BKE_library_query.h"
+#include "BKE_lib_query.h"
 #include "BKE_scene.h"
 #include "BKE_main.h"
 #include "BKE_layer.h"

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


[Bf-blender-cvs] [9cb9a69dcd0] greasepencil-refactor: Merge branch 'greasepencil-object' into greasepencil-refactor

2020-02-10 Thread Antonio Vazquez
Commit: 9cb9a69dcd07347f0f558b554591505fae2dfcb8
Author: Antonio Vazquez
Date:   Mon Feb 10 15:46:04 2020 +0100
Branches: greasepencil-refactor
https://developer.blender.org/rB9cb9a69dcd07347f0f558b554591505fae2dfcb8

Merge branch 'greasepencil-object' into greasepencil-refactor

===



===

diff --cc source/blender/blenloader/intern/versioning_280.c
index 3eb0479ca06,fb475b3e0b1..36993d95dc9
--- a/source/blender/blenloader/intern/versioning_280.c
+++ b/source/blender/blenloader/intern/versioning_280.c
@@@ -74,10 -73,9 +74,10 @@@
  #include "BKE_freestyle.h"
  #include "BKE_global.h"
  #include "BKE_gpencil.h"
 +#include "BKE_gpencil_modifier.h"
  #include "BKE_idprop.h"
  #include "BKE_key.h"
- #include "BKE_library.h"
+ #include "BKE_lib_id.h"
  #include "BKE_layer.h"
  #include "BKE_main.h"
  #include "BKE_mesh.h"
diff --cc source/blender/depsgraph/intern/eval/deg_eval_copy_on_write.cc
index 5873a5cd65f,cbfcbce..f7ab7351748
--- a/source/blender/depsgraph/intern/eval/deg_eval_copy_on_write.cc
+++ b/source/blender/depsgraph/intern/eval/deg_eval_copy_on_write.cc
@@@ -43,9 -43,8 +43,9 @@@
  #include "BKE_curve.h"
  #include "BKE_global.h"
  #include "BKE_idprop.h"
 +#include "BKE_gpencil.h"
  #include "BKE_layer.h"
- #include "BKE_library.h"
+ #include "BKE_lib_id.h"
  #include "BKE_scene.h"
  
  #include "DEG_depsgraph.h"

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


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

2020-02-10 Thread Antonio Vazquez
Commit: 6a37a83fc05b0dce1746a70da2ed58cbbea8d85c
Author: Antonio Vazquez
Date:   Mon Feb 10 15:43:57 2020 +0100
Branches: greasepencil-object
https://developer.blender.org/rB6a37a83fc05b0dce1746a70da2ed58cbbea8d85c

Merge branch 'master' into greasepencil-object

 Conflicts:
source/blender/blenkernel/intern/gpencil.c
source/blender/editors/sculpt_paint/paint_ops.c

===



===

diff --cc source/blender/blenkernel/intern/gpencil.c
index 8612973fd11,e3d6e73e8c9..8da97db5761
--- a/source/blender/blenkernel/intern/gpencil.c
+++ b/source/blender/blenkernel/intern/gpencil.c
@@@ -59,8 -55,7 +59,8 @@@
  #include "BKE_deform.h"
  #include "BKE_gpencil.h"
  #include "BKE_icons.h"
 +#include "BKE_image.h"
- #include "BKE_library.h"
+ #include "BKE_lib_id.h"
  #include "BKE_main.h"
  #include "BKE_material.h"
  #include "BKE_object.h"
diff --cc source/blender/blenloader/intern/versioning_280.c
index 78f2b87de24,cb12efd0ec2..fb475b3e0b1
--- a/source/blender/blenloader/intern/versioning_280.c
+++ b/source/blender/blenloader/intern/versioning_280.c
@@@ -72,10 -71,9 +72,10 @@@
  #include "BKE_fcurve.h"
  #include "BKE_freestyle.h"
  #include "BKE_global.h"
 +#include "BKE_gpencil.h"
  #include "BKE_idprop.h"
  #include "BKE_key.h"
- #include "BKE_library.h"
+ #include "BKE_lib_id.h"
  #include "BKE_layer.h"
  #include "BKE_main.h"
  #include "BKE_mesh.h"
diff --cc source/blender/blenloader/intern/versioning_defaults.c
index 8dc71dd314e,446cfa4163f..c03c5a7b335
--- a/source/blender/blenloader/intern/versioning_defaults.c
+++ b/source/blender/blenloader/intern/versioning_defaults.c
@@@ -44,12 -44,10 +44,12 @@@
  #include "BKE_appdir.h"
  #include "BKE_brush.h"
  #include "BKE_colortools.h"
 +#include "BKE_gpencil.h"
  #include "BKE_layer.h"
- #include "BKE_library.h"
+ #include "BKE_lib_id.h"
  #include "BKE_main.h"
  #include "BKE_mesh.h"
 +#include "BKE_material.h"
  #include "BKE_node.h"
  #include "BKE_paint.h"
  #include "BKE_screen.h"
diff --cc source/blender/editors/sculpt_paint/paint_ops.c
index 68d26cc5c74,8c8fc412663..689dfd97ae0
--- a/source/blender/editors/sculpt_paint/paint_ops.c
+++ b/source/blender/editors/sculpt_paint/paint_ops.c
@@@ -36,11 -33,9 +36,11 @@@
  
  #include "BKE_brush.h"
  #include "BKE_context.h"
 +#include "BKE_image.h"
- #include "BKE_library.h"
+ #include "BKE_lib_id.h"
  #include "BKE_main.h"
  #include "BKE_paint.h"
 +#include "BKE_report.h"
  
  #include "ED_paint.h"
  #include "ED_screen.h"

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


[Bf-blender-cvs] [f8df6286c2c] master: BLI: add utilities for defining non-movable and non-copyable classes

2020-02-10 Thread Jacques Lucke
Commit: f8df6286c2c05d8480f84d5e5640c4bcb46aa4ad
Author: Jacques Lucke
Date:   Mon Feb 10 15:29:17 2020 +0100
Branches: master
https://developer.blender.org/rBf8df6286c2c05d8480f84d5e5640c4bcb46aa4ad

BLI: add utilities for defining non-movable and non-copyable classes

Structs and classes can subclass these member-free classes privately.
Then they become non-movable, non-copyable or both.

===

A   source/blender/blenlib/BLI_utility_mixins.h
M   source/blender/blenlib/CMakeLists.txt

===

diff --git a/source/blender/blenlib/BLI_utility_mixins.h 
b/source/blender/blenlib/BLI_utility_mixins.h
new file mode 100644
index 000..66164fdcd24
--- /dev/null
+++ b/source/blender/blenlib/BLI_utility_mixins.h
@@ -0,0 +1,29 @@
+#pragma once
+
+namespace BLI {
+
+class NonCopyable {
+ public:
+  /* Disable copy construction and assignment. */
+  NonCopyable(const NonCopyable ) = delete;
+  NonCopyable =(const NonCopyable ) = delete;
+
+  /* Explicitly enable default construction, move construction and move 
assignment. */
+  NonCopyable() = default;
+  NonCopyable(NonCopyable &) = default;
+  NonCopyable =(NonCopyable &) = default;
+};
+
+class NonMovable {
+ public:
+  /* Disable move construction and assignment. */
+  NonMovable(NonMovable &) = delete;
+  NonMovable =(NonMovable &) = delete;
+
+  /* Explicitly enable default construction, copy construction and copy 
assignment. */
+  NonMovable() = default;
+  NonMovable(const NonMovable ) = default;
+  NonMovable =(const NonMovable ) = default;
+};
+
+}  // namespace BLI
diff --git a/source/blender/blenlib/CMakeLists.txt 
b/source/blender/blenlib/CMakeLists.txt
index 2780e2becf8..1e4e07d63b3 100644
--- a/source/blender/blenlib/CMakeLists.txt
+++ b/source/blender/blenlib/CMakeLists.txt
@@ -243,6 +243,7 @@ set(SRC
   BLI_utildefines_iter.h
   BLI_utildefines_stack.h
   BLI_utildefines_variadic.h
+  BLI_utility_mixins.h
   BLI_uvproject.h
   BLI_vector.h
   BLI_vector_set.h

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


[Bf-blender-cvs] [ec116e3d492] master: USD: Install USD library via install_deps.sh

2020-02-10 Thread Sybren A. Stüvel
Commit: ec116e3d492511298c9bf595c19e6c49e07c97f6
Author: Sybren A. Stüvel
Date:   Mon Feb 10 15:07:49 2020 +0100
Branches: master
https://developer.blender.org/rBec116e3d492511298c9bf595c19e6c49e07c97f6

USD: Install USD library via install_deps.sh

This commit adds the download, extract, patch, build, and install of the
Universal Scene Description (USD) library to the `install_deps.sh`
script.

Reviewed By: mont29, LazyDodo

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

===

M   build_files/build_environment/install_deps.sh
M   build_files/cmake/Modules/FindUSD.cmake
M   source/creator/CMakeLists.txt

===

diff --git a/build_files/build_environment/install_deps.sh 
b/build_files/build_environment/install_deps.sh
index bc9ee802810..8e8aeda0893 100755
--- a/build_files/build_environment/install_deps.sh
+++ b/build_files/build_environment/install_deps.sh
@@ -55,13 +55,13 @@ with-all,with-opencollada,with-jack,with-embree,with-oidn,\
 ver-ocio:,ver-oiio:,ver-llvm:,ver-osl:,ver-osd:,ver-openvdb:,\
 force-all,force-python,force-numpy,force-boost,\
 
force-ocio,force-openexr,force-oiio,force-llvm,force-osl,force-osd,force-openvdb,\
-force-ffmpeg,force-opencollada,force-alembic,force-embree,force-oidn,\
+force-ffmpeg,force-opencollada,force-alembic,force-embree,force-oidn,force-usd,\
 build-all,build-python,build-numpy,build-boost,\
 
build-ocio,build-openexr,build-oiio,build-llvm,build-osl,build-osd,build-openvdb,\
-build-ffmpeg,build-opencollada,build-alembic,build-embree,build-oidn,\
+build-ffmpeg,build-opencollada,build-alembic,build-embree,build-oidn,build-usd,\
 skip-python,skip-numpy,skip-boost,\
 skip-ocio,skip-openexr,skip-oiio,skip-llvm,skip-osl,skip-osd,skip-openvdb,\
-skip-ffmpeg,skip-opencollada,skip-alembic,skip-embree,skip-oidn \
+skip-ffmpeg,skip-opencollada,skip-alembic,skip-embree,skip-oidn,skip-usd \
 -- "$@" \
 )
 
@@ -221,6 +221,9 @@ ARGUMENTS_INFO="\"COMMAND LINE ARGUMENTS:
 --build-ffmpeg
 Force the build of FFMpeg.
 
+--build-usd
+Force the build of Universal Scene Description.
+
 Note about the --build-foo options:
 * They force the script to prefer building dependencies rather than 
using available packages.
   This may make things simpler and allow working around some 
distribution bugs, but on the other hand it will
@@ -279,6 +282,9 @@ ARGUMENTS_INFO="\"COMMAND LINE ARGUMENTS:
 --force-ffmpeg
 Force the rebuild of FFMpeg.
 
+--force-usd
+Force the rebuild of Universal Scene Description.
+
 Note about the --force-foo options:
 * They obviously only have an effect if those libraries are built by 
this script
   (i.e. if there is no available and satisfactory package)!
@@ -328,7 +334,10 @@ ARGUMENTS_INFO="\"COMMAND LINE ARGUMENTS:
 Unconditionally skip OpenImageDenoise installation/building.
 
 --skip-ffmpeg
-Unconditionally skip FFMpeg installation/building.\""
+Unconditionally skip FFMpeg installation/building.
+
+--skip-usd
+Unconditionally skip Universal Scene Description 
installation/building.\""
 
 # 
 # Main Vars
@@ -420,6 +429,11 @@ ALEMBIC_FORCE_BUILD=false
 ALEMBIC_FORCE_REBUILD=false
 ALEMBIC_SKIP=false
 
+USD_VERSION="19.11"
+USD_FORCE_BUILD=false
+USD_FORCE_REBUILD=false
+USD_SKIP=false
+
 OPENCOLLADA_VERSION="1.6.68"
 OPENCOLLADA_FORCE_BUILD=false
 OPENCOLLADA_FORCE_REBUILD=false
@@ -628,6 +642,7 @@ while true; do
   OIDN_FORCE_BUILD=true
   FFMPEG_FORCE_BUILD=true
   ALEMBIC_FORCE_BUILD=true
+  USD_FORCE_BUILD=true
   shift; continue
 ;;
 --build-python)
@@ -679,6 +694,9 @@ while true; do
 --build-alembic)
   ALEMBIC_FORCE_BUILD=true; shift; continue
 ;;
+--build-usd)
+  USD_FORCE_BUILD=true; shift; continue
+;;
 --force-all)
   PYTHON_FORCE_REBUILD=true
   NUMPY_FORCE_REBUILD=true
@@ -695,6 +713,7 @@ while true; do
   OIDN_FORCE_REBUILD=true
   FFMPEG_FORCE_REBUILD=true
   ALEMBIC_FORCE_REBUILD=true
+  USD_FORCE_REBUILD=true
   shift; continue
 ;;
 --force-python)
@@ -744,6 +763,9 @@ while true; do
 --force-alembic)
   ALEMBIC_FORCE_REBUILD=true; shift; continue
 ;;
+--force-usd)
+  USD_FORCE_REBUILD=true; shift; continue
+;;
 --skip-python)
   PYTHON_SKIP=true; shift; continue
 ;;
@@ -789,6 +811,9 @@ while true; do
 --skip-alembic)
   ALEMBIC_SKIP=true; shift; continue
 ;;
+--skip-usd)
+  USD_SKIP=true; shift; continue
+;;
 --)
   # no more arguments to parse
   break
@@ -895,6 +920,8 @@ ALEMBIC_SOURCE=( 
"https://github.com/alembic/alembic/archive/${ALEMBIC_VERSION}.
 # ALEMBIC_SOURCE_REPO_UID="e6c90d4faa32c4550adeaaf3f556dad4b73a92bb"
 # 

[Bf-blender-cvs] [2d368366166] functions: cleanup dot export

2020-02-10 Thread Jacques Lucke
Commit: 2d368366166f1be74920e99b4e771df243b852df
Author: Jacques Lucke
Date:   Mon Feb 10 14:46:44 2020 +0100
Branches: functions
https://developer.blender.org/rB2d368366166f1be74920e99b4e771df243b852df

cleanup dot export

===

M   source/blender/blenlib/BLI_dot_export.h
M   source/blender/blenlib/intern/dot_export.cc
M   source/blender/functions/intern/multi_function_network.cc
M   source/blender/functions/intern/node_tree.cc

===

diff --git a/source/blender/blenlib/BLI_dot_export.h 
b/source/blender/blenlib/BLI_dot_export.h
index cf081ec9763..74a31b8b42a 100644
--- a/source/blender/blenlib/BLI_dot_export.h
+++ b/source/blender/blenlib/BLI_dot_export.h
@@ -243,19 +243,17 @@ class UndirectedEdge : public Edge {
   void export__as_edge_statement(std::stringstream ) const;
 };
 
-namespace Utils {
-
 std::string color_attr_from_hsv(float h, float s, float v);
 
-class NodeWithSocketsWrapper {
+class NodeWithSocketsRef {
  private:
   Node *m_node;
 
  public:
-  NodeWithSocketsWrapper(Node ,
- StringRef name,
- ArrayRef input_names,
- ArrayRef output_names);
+  NodeWithSocketsRef(Node ,
+ StringRef name,
+ ArrayRef input_names,
+ ArrayRef output_names);
 
   NodePort input(uint index) const
   {
@@ -270,8 +268,6 @@ class NodeWithSocketsWrapper {
   }
 };
 
-}  // namespace Utils
-
 }  // namespace DotExport
 }  // namespace BLI
 
diff --git a/source/blender/blenlib/intern/dot_export.cc 
b/source/blender/blenlib/intern/dot_export.cc
index 372fc8d1950..67bd564af29 100644
--- a/source/blender/blenlib/intern/dot_export.cc
+++ b/source/blender/blenlib/intern/dot_export.cc
@@ -95,7 +95,7 @@ void Cluster::set_random_cluster_bgcolors()
   float hue = rand() / (float)RAND_MAX;
   float staturation = 0.3f;
   float value = 0.8f;
-  this->set_attribute("bgcolor", Utils::color_attr_from_hsv(hue, staturation, 
value));
+  this->set_attribute("bgcolor", color_attr_from_hsv(hue, staturation, value));
 
   for (Cluster *cluster : m_children) {
 cluster->set_random_cluster_bgcolors();
@@ -225,8 +225,6 @@ void NodePort::to_dot_string(std::stringstream ) const
   }
 }
 
-namespace Utils {
-
 std::string color_attr_from_hsv(float h, float s, float v)
 {
   std::stringstream ss;
@@ -234,10 +232,10 @@ std::string color_attr_from_hsv(float h, float s, float v)
   return ss.str();
 }
 
-NodeWithSocketsWrapper::NodeWithSocketsWrapper(Node ,
-   StringRef name,
-   ArrayRef 
input_names,
-   ArrayRef 
output_names)
+NodeWithSocketsRef::NodeWithSocketsRef(Node ,
+   StringRef name,
+   ArrayRef input_names,
+   ArrayRef output_names)
 : m_node()
 {
   std::stringstream ss;
@@ -287,7 +285,5 @@ NodeWithSocketsWrapper::NodeWithSocketsWrapper(Node ,
   m_node->set_shape(Attr_shape::Rectangle);
 }
 
-}  // namespace Utils
-
 }  // namespace DotExport
 }  // namespace BLI
diff --git a/source/blender/functions/intern/multi_function_network.cc 
b/source/blender/functions/intern/multi_function_network.cc
index fdf51afd062..ef22f435a66 100644
--- a/source/blender/functions/intern/multi_function_network.cc
+++ b/source/blender/functions/intern/multi_function_network.cc
@@ -318,11 +318,11 @@ Vector 
MFNetworkBuilder::find_nodes_not_to_the_left_of__exclusi
 
 std::string MFNetworkBuilder::to_dot(const Set _nodes)
 {
-  using BLI::DotExport::Utils::NodeWithSocketsWrapper;
+  using BLI::DotExport::NodeWithSocketsRef;
 
   BLI::DotExport::DirectedGraph digraph;
   digraph.set_rankdir(BLI::DotExport::Attr_rankdir::LeftToRight);
-  Map dot_nodes;
+  Map dot_nodes;
 
   Vector all_nodes;
   all_nodes.extend(m_function_nodes.as_ref());
@@ -347,8 +347,7 @@ std::string MFNetworkBuilder::to_dot(const 
Set _nodes)
   dot_node.set_background_color("#99EE99");
 }
 
-dot_nodes.add_new(node,
-  NodeWithSocketsWrapper(dot_node, node->name(), 
input_names, output_names));
+dot_nodes.add_new(node, NodeWithSocketsRef(dot_node, node->name(), 
input_names, output_names));
   }
 
   for (MFBuilderNode *to_node : all_nodes) {
diff --git a/source/blender/functions/intern/node_tree.cc 
b/source/blender/functions/intern/node_tree.cc
index 18f8f53c56e..d84acb5ad8a 100644
--- a/source/blender/functions/intern/node_tree.cc
+++ b/source/blender/functions/intern/node_tree.cc
@@ -388,8 +388,8 @@ std::string FunctionTree::to_dot() const
   BLI::DotExport::DirectedGraph digraph;
   digraph.set_rankdir(BLI::DotExport::Attr_rankdir::LeftToRight);
 
-  Map dot_nodes;
-  Map 
dot_group_inputs;
+  Map dot_nodes;
+  Map 

[Bf-blender-cvs] [cd48b132ffa] master: Cleanup: Add basic doc about each `BKE_main` and `BKE_lib` files.

2020-02-10 Thread Bastien Montagne
Commit: cd48b132ffafc80347a668b3c1cf295abf399f10
Author: Bastien Montagne
Date:   Mon Feb 10 15:05:54 2020 +0100
Branches: master
https://developer.blender.org/rBcd48b132ffafc80347a668b3c1cf295abf399f10

Cleanup: Add basic doc about each `BKE_main` and `BKE_lib` files.

Including expected prefixes for functions in those files.

Part of T72604.

===

M   source/blender/blenkernel/BKE_lib_id.h
M   source/blender/blenkernel/BKE_lib_override.h
M   source/blender/blenkernel/BKE_lib_query.h
M   source/blender/blenkernel/BKE_lib_remap.h
M   source/blender/blenkernel/BKE_main.h
M   source/blender/blenkernel/BKE_main_idmap.h

===

diff --git a/source/blender/blenkernel/BKE_lib_id.h 
b/source/blender/blenkernel/BKE_lib_id.h
index f3bf2db8f6f..f3a92fba1fb 100644
--- a/source/blender/blenkernel/BKE_lib_id.h
+++ b/source/blender/blenkernel/BKE_lib_id.h
@@ -21,31 +21,37 @@
 
 /** \file
  * \ingroup bke
+ *
+ * API to manage data-blocks inside of Blender's Main data-base, or as 
independant runtime-only
+ * data.
+ *
+ * \note `BKE_lib_` files are for operations over data-blocks themselves, 
although they might
+ * alter Main as well (when creating/renaming/deleting an ID e.g.).
+ *
+ * \section Function Names
+ *
+ * \warning Descriptions below is ideal goal, current status of naming does 
not yet fully follow it
+ * (this is WIP).
+ *
+ * - `BKE_lib_id_` should be used for rather high-level operations, that 
involve Main database and
+ *   relations with other IDs, and can be considered as 'safe' (as in, in 
themselves, they leave
+ *   affected IDs/Main in a consistent status).
+ * - `BKE_lib_libblock_` should be used for lower level operations, that 
perform some parts of
+ *   `BKE_lib_id_` ones, but will generally not ensure caller that affected 
data is in a consistent
+ *   state by their own execution alone.
+ * - `BKE_lib_main_` should be used for operations performed over all IDs of a 
given Main
+ *   data-base.
+ *
+ * \note External code should typically not use `BKE_lib_libblock_` functions, 
except in some
+ * specific cases requiring advanced (and potentially dangerous) handling.
  */
+
 #ifdef __cplusplus
 extern "C" {
 #endif
 
 #include "BLI_compiler_attrs.h"
 
-/**
- * Naming: BKE_id_ vs BKE_libblock_
- *
- * WARNING: description below is ideal goal, current status of naming does not 
yet
- * fully follow it (this is WIP).
- *
- * - BKE_id_ should be used for rather high-level operations, that involve 
Main database and
- *   relations with other IDs, and can be considered as 'safe'
- *   (as in, in themselves, they leave affected IDs/Main in a consistent 
status).
- *
- * - BKE_libblock_ should be used for lower level operations,
- *   that perform some parts of BKE_id_ ones, but will generally not ensure 
caller that affected
- *   data is in a consistent state by their own execution alone.
- *
- * Consequently, external code should not typically use BKE_libblock_ 
functions,
- * except in some specific cases requiring advanced (and potentially 
dangerous) handling.
- */
-
 struct GHash;
 struct ID;
 struct Library;
diff --git a/source/blender/blenkernel/BKE_lib_override.h 
b/source/blender/blenkernel/BKE_lib_override.h
index 5cffabd333f..b6db93e1cf0 100644
--- a/source/blender/blenkernel/BKE_lib_override.h
+++ b/source/blender/blenkernel/BKE_lib_override.h
@@ -22,6 +22,21 @@
 
 /** \file
  * \ingroup bke
+ *
+ * API to manage data-blocks inside of Blender's Main data-base, or as 
independant runtime-only
+ * data.
+ *
+ * \note `BKE_lib_` files are for operations over data-blocks themselves, 
although they might
+ * alter Main as well (when creating/renaming/deleting an ID e.g.).
+ *
+ * \section Function Names
+ *
+ * \warning Descriptions below is ideal goal, current status of naming does 
not yet fully follow it
+ * (this is WIP).
+ *
+ *  - `BKE_lib_override_library_` should be used for function affecting a 
single ID.
+ *  - `BKE_lib_override_library_main_` should be used for function affecting 
the whole collection
+ *of IDs in a given Main data-base.
  */
 
 struct ID;
diff --git a/source/blender/blenkernel/BKE_lib_query.h 
b/source/blender/blenkernel/BKE_lib_query.h
index b959b55b1d6..a0abe4320ed 100644
--- a/source/blender/blenkernel/BKE_lib_query.h
+++ b/source/blender/blenkernel/BKE_lib_query.h
@@ -21,6 +21,18 @@
 
 /** \file
  * \ingroup bke
+ *
+ * API to perform operations over all ID pointers used by a given data-block.
+ *
+ * \note `BKE_lib_` files are for operations over data-blocks themselves, 
although they might
+ * alter Main as well (when creating/renaming/deleting an ID e.g.).
+ *
+ * \section Function Names
+ *
+ * \warning Descriptions below is ideal goal, current status of naming does 
not yet fully follow it
+ * (this is WIP).
+ *
+ * - `BKE_lib_query_` should be used for functions in that file.
  */
 
 struct ID;

[Bf-blender-cvs] [0b9888d0383] functions: fix after merge

2020-02-10 Thread Jacques Lucke
Commit: 0b9888d0383709880d2c0e634328c1dd7af1
Author: Jacques Lucke
Date:   Mon Feb 10 14:40:04 2020 +0100
Branches: functions
https://developer.blender.org/rB0b9888d0383709880d2c0e634328c1dd7af1

fix after merge

===

M   source/blender/blenlib/CMakeLists.txt
M   source/blender/modifiers/intern/MOD_bparticles.c
M   source/blender/modifiers/intern/MOD_bparticles_output.c
M   source/blender/modifiers/intern/MOD_functiondeform.c
M   source/blender/modifiers/intern/MOD_functionpoints.c

===

diff --git a/source/blender/blenlib/CMakeLists.txt 
b/source/blender/blenlib/CMakeLists.txt
index e0da79b78cf..22c5f44536d 100644
--- a/source/blender/blenlib/CMakeLists.txt
+++ b/source/blender/blenlib/CMakeLists.txt
@@ -261,7 +261,6 @@ set(SRC
   intern/BLI_lazy_init.cc
   BLI_math_cxx.h
   BLI_linear_allocator.h
-  BLI_optional.h
   BLI_multi_map.h
   BLI_timeit.h
   BLI_vector_adaptor.h
diff --git a/source/blender/modifiers/intern/MOD_bparticles.c 
b/source/blender/modifiers/intern/MOD_bparticles.c
index d76eda15ca3..0512d4ecaaa 100644
--- a/source/blender/modifiers/intern/MOD_bparticles.c
+++ b/source/blender/modifiers/intern/MOD_bparticles.c
@@ -37,7 +37,7 @@
 #include "BKE_mesh.h"
 #include "BKE_modifier.h"
 #include "BKE_scene.h"
-#include "BKE_library_query.h"
+#include "BKE_lib_query.h"
 
 #include "BLI_math.h"
 
diff --git a/source/blender/modifiers/intern/MOD_bparticles_output.c 
b/source/blender/modifiers/intern/MOD_bparticles_output.c
index 9d52fcbb0ba..a2a056ba46e 100644
--- a/source/blender/modifiers/intern/MOD_bparticles_output.c
+++ b/source/blender/modifiers/intern/MOD_bparticles_output.c
@@ -37,7 +37,7 @@
 #include "BKE_mesh.h"
 #include "BKE_modifier.h"
 #include "BKE_scene.h"
-#include "BKE_library_query.h"
+#include "BKE_lib_query.h"
 
 #include "BLI_math.h"
 
diff --git a/source/blender/modifiers/intern/MOD_functiondeform.c 
b/source/blender/modifiers/intern/MOD_functiondeform.c
index 3f2d4f2b102..61bf98a7076 100644
--- a/source/blender/modifiers/intern/MOD_functiondeform.c
+++ b/source/blender/modifiers/intern/MOD_functiondeform.c
@@ -37,7 +37,7 @@
 #include "BKE_mesh.h"
 #include "BKE_modifier.h"
 #include "BKE_scene.h"
-#include "BKE_library_query.h"
+#include "BKE_lib_query.h"
 
 #include "BKE_global.h"
 #include "BKE_main.h"
diff --git a/source/blender/modifiers/intern/MOD_functionpoints.c 
b/source/blender/modifiers/intern/MOD_functionpoints.c
index aea034c137a..2362dbac585 100644
--- a/source/blender/modifiers/intern/MOD_functionpoints.c
+++ b/source/blender/modifiers/intern/MOD_functionpoints.c
@@ -37,7 +37,7 @@
 #include "BKE_mesh.h"
 #include "BKE_modifier.h"
 #include "BKE_scene.h"
-#include "BKE_library_query.h"
+#include "BKE_lib_query.h"
 
 #include "BKE_global.h"
 #include "BKE_main.h"

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


[Bf-blender-cvs] [8cda8bef1e3] functions: Merge branch 'master' into functions

2020-02-10 Thread Jacques Lucke
Commit: 8cda8bef1e302dfab7c4913f019e186879d07ff7
Author: Jacques Lucke
Date:   Mon Feb 10 14:14:16 2020 +0100
Branches: functions
https://developer.blender.org/rB8cda8bef1e302dfab7c4913f019e186879d07ff7

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] [43e2ca8fd1b] functions: Merge branch 'master' into functions

2020-02-10 Thread Jacques Lucke
Commit: 43e2ca8fd1bcd6cbc0756788e196c768ed09b6cc
Author: Jacques Lucke
Date:   Mon Feb 10 14:23:37 2020 +0100
Branches: functions
https://developer.blender.org/rB43e2ca8fd1bcd6cbc0756788e196c768ed09b6cc

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] [e018da98b9d] new-object-types: Volumes: fix memory leak in grids depsgraph backup

2020-02-10 Thread Brecht Van Lommel
Commit: e018da98b9d8ff85ec798f9c1a2d5e7704f4c731
Author: Brecht Van Lommel
Date:   Sun Feb 9 23:03:54 2020 +0100
Branches: new-object-types
https://developer.blender.org/rBe018da98b9d8ff85ec798f9c1a2d5e7704f4c731

Volumes: fix memory leak in grids depsgraph backup

===

M   source/blender/blenkernel/BKE_volume.h
M   source/blender/blenkernel/intern/volume.cc
M   source/blender/depsgraph/intern/eval/deg_eval_runtime_backup_volume.cc
M   source/blender/depsgraph/intern/eval/deg_eval_runtime_backup_volume.h

===

diff --git a/source/blender/blenkernel/BKE_volume.h 
b/source/blender/blenkernel/BKE_volume.h
index ad4db53b31a..a76996afe20 100644
--- a/source/blender/blenkernel/BKE_volume.h
+++ b/source/blender/blenkernel/BKE_volume.h
@@ -37,6 +37,7 @@ struct Main;
 struct Object;
 struct Scene;
 struct Volume;
+struct VolumeGridVector;
 
 /* Module */
 
@@ -67,6 +68,10 @@ void BKE_volume_data_update(struct Depsgraph *depsgraph,
 struct Scene *scene,
 struct Object *object);
 
+void BKE_volume_grids_backup_restore(struct Volume *volume,
+ struct VolumeGridVector *grids,
+ const char *filepath);
+
 /* Draw Cache */
 
 enum {
diff --git a/source/blender/blenkernel/intern/volume.cc 
b/source/blender/blenkernel/intern/volume.cc
index c820a0b7940..8d9efb01f50 100644
--- a/source/blender/blenkernel/intern/volume.cc
+++ b/source/blender/blenkernel/intern/volume.cc
@@ -79,7 +79,7 @@ static CLG_LogRef LOG = {"bke.volume"};
  * When the number of users drops to zero, the grid data is immediately 
deleted.
  *
  * TODO: also add a cache for OpenVDB files rather than individual grids,
- * so getting the list of grids is also cached?
+ * so getting the list of grids is also cached.
  * TODO: Further, we could cache openvdb::io::File so that loading a grid
  * does not re-open it every time. But then we have to take care not to run
  * out of file descriptors or prevent other applications from writing to it.
@@ -373,6 +373,11 @@ struct VolumeGridVector : public std::vector {
 memcpy(filepath, other.filepath, sizeof(filepath));
   }
 
+  bool is_loaded() const
+  {
+return filepath[0] != '\0';
+  }
+
   /* Absolute file path that grids have been loaded from. */
   char filepath[FILE_MAX];
   /* File loading error message. */
@@ -552,7 +557,7 @@ bool BKE_volume_is_loaded(const Volume *volume)
 {
 #ifdef WITH_OPENVDB
   /* Test if there is a file to load, or if already loaded. */
-  return (volume->filepath[0] == '\0' || volume->runtime.grids->filepath[0] != 
'\0');
+  return (volume->filepath[0] == '\0' || volume->runtime.grids->is_loaded());
 #else
   UNUSED_VARS(volume);
   return true;
@@ -778,15 +783,13 @@ static Volume *volume_evaluate_modifiers(struct Depsgraph 
*depsgraph,
 
 void BKE_volume_eval_geometry(struct Depsgraph *depsgraph, Volume *volume)
 {
+  /* TODO: can we avoid modifier re-evaluation when frame did not change? */
   int frame = volume_sequence_frame(depsgraph, volume);
-
   if (frame != volume->runtime.frame) {
 BKE_volume_unload(volume);
 volume->runtime.frame = frame;
   }
 
-  /* TODO: can we avoid modifier re-evaluation when frame did not change? */
-
   /* Flush back to original. */
   if (DEG_is_active(depsgraph)) {
 Volume *volume_orig = (Volume *)DEG_get_original_id(>id);
@@ -808,6 +811,33 @@ void BKE_volume_data_update(struct Depsgraph *depsgraph, 
struct Scene *scene, Ob
   BKE_object_eval_assign_data(object, _eval->id, is_owned);
 }
 
+void BKE_volume_grids_backup_restore(Volume *volume, VolumeGridVector *grids, 
const char *filepath)
+{
+#ifdef WITH_OPENVDB
+  /* Restore grids after datablock was re-copied from original by depsgraph,
+   * we don't want to load them again if possible. */
+  BLI_assert(volume->id.tag & LIB_TAG_COPIED_ON_WRITE);
+  BLI_assert(volume->runtime.grids != NULL && grids != NULL);
+
+  if (!grids->is_loaded()) {
+/* No grids loaded in CoW datablock, nothing lost by discarding. */
+OBJECT_GUARDED_DELETE(grids, VolumeGridVector);
+  }
+  else if (!STREQ(volume->filepath, filepath)) {
+/* Filepath changed, discard grids from CoW datablock. */
+OBJECT_GUARDED_DELETE(grids, VolumeGridVector);
+  }
+  else {
+/* Keep grids from CoW datablock. We might still unload them a little
+ * later in BKE_volume_eval_geometry if the frame changes. */
+OBJECT_GUARDED_DELETE(volume->runtime.grids, VolumeGridVector);
+volume->runtime.grids = grids;
+  }
+#else
+  UNUSED_VARS(volume, grids);
+#endif
+}
+
 /* Draw Cache */
 
 void (*BKE_volume_batch_cache_dirty_tag_cb)(Volume *volume, int mode) = NULL;
diff --git 
a/source/blender/depsgraph/intern/eval/deg_eval_runtime_backup_volume.cc 
b/source/blender/depsgraph/intern/eval/deg_eval_runtime_backup_volume.cc
index 

[Bf-blender-cvs] [b6f49ec208d] new-object-types: Volumes: API functions to modify grids in the modifiers stack

2020-02-10 Thread Brecht Van Lommel
Commit: b6f49ec208d91da29c6fb1e67b5f37308c10b666
Author: Brecht Van Lommel
Date:   Sun Feb 9 17:25:11 2020 +0100
Branches: new-object-types
https://developer.blender.org/rBb6f49ec208d91da29c6fb1e67b5f37308c10b666

Volumes: API functions to modify grids in the modifiers stack

===

M   source/blender/blenkernel/BKE_volume.h
M   source/blender/blenkernel/intern/volume.cc

===

diff --git a/source/blender/blenkernel/BKE_volume.h 
b/source/blender/blenkernel/BKE_volume.h
index a76996afe20..cf0260b417b 100644
--- a/source/blender/blenkernel/BKE_volume.h
+++ b/source/blender/blenkernel/BKE_volume.h
@@ -60,9 +60,6 @@ struct BoundBox *BKE_volume_boundbox_get(struct Object *ob);
 
 /* Depsgraph */
 
-struct Volume *BKE_volume_new_for_eval(const struct Volume *volume_src);
-struct Volume *BKE_volume_copy_for_eval(struct Volume *volume_src, bool 
reference);
-
 void BKE_volume_eval_geometry(struct Depsgraph *depsgraph, struct Volume 
*volume);
 void BKE_volume_data_update(struct Depsgraph *depsgraph,
 struct Scene *scene,
@@ -105,7 +102,7 @@ VolumeGrid *BKE_volume_grid_find(struct Volume *volume, 
const char *name);
 /* Grid
  *
  * By default only grid metadata is loaded, for access to the tree and voxels
- * the BKE_volume_grid_load must be called first. */
+ * BKE_volume_grid_load must be called first. */
 
 typedef enum VolumeGridType {
   VOLUME_GRID_UNKNOWN = 0,
@@ -146,8 +143,44 @@ void BKE_volume_grid_dense_voxels(const struct VolumeGrid 
*volume_grid,
   const size_t max[3],
   float *voxels);
 
+/* Volume Editing
+ *
+ * These are intended for modifiers to use on evaluated datablocks.
+ *
+ * new_for_eval creates a volume datablock with no grids or file path, but
+ * preserves other settings such as viewport display options.
+ *
+ * copy_for_eval creates a volume datablock preserving everything except the
+ * file path. Grids are shared with the source datablock, not copied.
+ *
+ * Before modifying grids after copy_for_eval, call ensure_writable first.
+ * It will duplicate (or clear) the grid if it is shared with any other
+ * datablocks, so that it can be safely modified. */
+
+struct Volume *BKE_volume_new_for_eval(const struct Volume *volume_src);
+struct Volume *BKE_volume_copy_for_eval(struct Volume *volume_src, bool 
reference);
+
+struct VolumeGrid *BKE_volume_grid_add(struct Volume *volume,
+   const char *name,
+   VolumeGridType type);
+void BKE_volume_grid_remove(struct Volume *volume, struct VolumeGrid *grid);
+void BKE_volume_grid_ensure_writable(struct Volume *volume,
+ struct VolumeGrid *grid,
+ const bool clear);
+
 #ifdef __cplusplus
 }
 #endif
 
+/* OpenVDB Grid
+ *
+ * Access to OpenVDB grid for C++. This will call BKE_volume_grid_load if the
+ * grid has not already been loaded into memory. */
+
+#if defined(__cplusplus) && defined(WITH_OPENVDB)
+#  include 
+openvdb::GridBase::Ptr BKE_volume_grid_ensure_openvdb(struct Volume *volume,
+  struct VolumeGrid *grid);
+#endif
+
 #endif
diff --git a/source/blender/blenkernel/intern/volume.cc 
b/source/blender/blenkernel/intern/volume.cc
index dfc485596a5..a5622323f68 100644
--- a/source/blender/blenkernel/intern/volume.cc
+++ b/source/blender/blenkernel/intern/volume.cc
@@ -58,6 +58,7 @@ static CLG_LogRef LOG = {"bke.volume"};
 
 #ifdef WITH_OPENVDB
 #  include 
+#  include 
 #  include 
 #  include 
 
@@ -328,6 +329,31 @@ struct VolumeGrid {
 is_loaded = false;
   }
 
+  void clear_reference(const char *UNUSED(volume_name))
+  {
+/* Clear any reference to a grid in the file cache. */
+vdb = vdb->copyGridWithNewTree();
+if (entry) {
+  GLOBAL_CACHE.remove_user(*entry, is_loaded);
+  entry = NULL;
+}
+is_loaded = true;
+  }
+
+  void duplicate_reference(const char *volume_name, const char *filepath)
+  {
+/* Make a deep copy of the grid and remove any reference to a grid in the
+ * file cache. Load file grid into memory first if needed. */
+load(volume_name, filepath);
+// TODO: avoid deep copy if we are the only user
+vdb = vdb->deepCopyGrid();
+if (entry) {
+  GLOBAL_CACHE.remove_user(*entry, is_loaded);
+  entry = NULL;
+}
+is_loaded = true;
+  }
+
   const char *name() const
   {
 /* Don't use vdb.getName() since it copies the string, we want a pointer 
to the
@@ -362,7 +388,7 @@ struct VolumeGrid {
  * List of grids contained in a volume datablock. This is runtime-only data,
  * the actual grids are always saved in a VDB file. */
 
-struct VolumeGridVector : public std::vector {
+struct VolumeGridVector : public std::list {
   VolumeGridVector()
 

[Bf-blender-cvs] [dc765b6301e] new-object-types: Volumes: avoid unnecessarily unloading volume in some corner cases

2020-02-10 Thread Brecht Van Lommel
Commit: dc765b6301e045047fff0f61737954865958a464
Author: Brecht Van Lommel
Date:   Sun Feb 9 14:21:35 2020 +0100
Branches: new-object-types
https://developer.blender.org/rBdc765b6301e045047fff0f61737954865958a464

Volumes: avoid unnecessarily unloading volume in some corner cases

===

M   source/blender/blenkernel/intern/volume.cc

===

diff --git a/source/blender/blenkernel/intern/volume.cc 
b/source/blender/blenkernel/intern/volume.cc
index 8d9efb01f50..dfc485596a5 100644
--- a/source/blender/blenkernel/intern/volume.cc
+++ b/source/blender/blenkernel/intern/volume.cc
@@ -479,6 +479,13 @@ static int volume_sequence_frame(const Depsgraph 
*depsgraph, const Volume *volum
 return 0;
   }
 
+  char filepath[FILE_MAX];
+  STRNCPY(filepath, volume->filepath);
+  int path_frame, path_digits;
+  if (!(volume->is_sequence && BLI_path_frame_get(filepath, _frame, 
_digits))) {
+return 0;
+  }
+
   const int scene_frame = DEG_get_ctime(depsgraph);
   const VolumeSequenceMode mode = (VolumeSequenceMode)volume->sequence_mode;
   const int frame_duration = volume->frame_duration;
@@ -539,14 +546,11 @@ static void volume_filepath_get(const Main *bmain, const 
Volume *volume, char r_
   BLI_strncpy(r_filepath, volume->filepath, FILE_MAX);
   BLI_path_abs(r_filepath, ID_BLEND_PATH(bmain, >id));
 
-  int fframe;
-  int frame_len;
-
-  /* TODO: check for filepath validity earlier, to avoid unnecessary 
computations. */
-  if (volume->is_sequence && BLI_path_frame_get(r_filepath, , 
_len)) {
+  int path_frame, path_digits;
+  if (volume->is_sequence && BLI_path_frame_get(r_filepath, _frame, 
_digits)) {
 char ext[32];
 BLI_path_frame_strip(r_filepath, ext);
-BLI_path_frame(r_filepath, volume->runtime.frame, frame_len);
+BLI_path_frame(r_filepath, volume->runtime.frame, path_digits);
 BLI_path_extension_ensure(r_filepath, FILE_MAX, ext);
   }
 }

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


[Bf-blender-cvs] [de09db6b4d1] master: Fix missed include update in recent BKE_library renaming.

2020-02-10 Thread Bastien Montagne
Commit: de09db6b4d132bddbd7c322c8853deeea38131a4
Author: Bastien Montagne
Date:   Mon Feb 10 14:21:34 2020 +0100
Branches: master
https://developer.blender.org/rBde09db6b4d132bddbd7c322c8853deeea38131a4

Fix missed include update in recent BKE_library renaming.

===

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

===

diff --git a/source/blender/usd/intern/usd_writer_mesh.cc 
b/source/blender/usd/intern/usd_writer_mesh.cc
index 6bdfed000a4..bc3bc06f8a6 100644
--- a/source/blender/usd/intern/usd_writer_mesh.cc
+++ b/source/blender/usd/intern/usd_writer_mesh.cc
@@ -29,7 +29,7 @@ extern "C" {
 
 #include "BKE_anim.h"
 #include "BKE_customdata.h"
-#include "BKE_library.h"
+#include "BKE_lib_id.h"
 #include "BKE_material.h"
 #include "BKE_mesh.h"
 #include "BKE_modifier.h"

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


[Bf-blender-cvs] [68cc982dcb7] master: BLI: improve various C++ data structures

2020-02-10 Thread Jacques Lucke
Commit: 68cc982dcb7c1063a96f7ec9b7ccb95da4919d6b
Author: Jacques Lucke
Date:   Mon Feb 10 13:54:57 2020 +0100
Branches: master
https://developer.blender.org/rB68cc982dcb7c1063a96f7ec9b7ccb95da4919d6b

BLI: improve various C++ data structures

The changes come from the `functions` branch, where I'm using
these structures a lot.

This also includes a new `BLI::Optional` type, which is similar
to `std::Optional` which can be used when Blender starts using
C++17.

===

M   source/blender/blenlib/BLI_allocator.h
M   source/blender/blenlib/BLI_array_cxx.h
M   source/blender/blenlib/BLI_array_ref.h
M   source/blender/blenlib/BLI_hash_cxx.h
M   source/blender/blenlib/BLI_index_range.h
M   source/blender/blenlib/BLI_kdtree.h
M   source/blender/blenlib/BLI_listbase_wrapper.h
M   source/blender/blenlib/BLI_map.h
M   source/blender/blenlib/BLI_memory_utils_cxx.h
M   source/blender/blenlib/BLI_open_addressing.h
A   source/blender/blenlib/BLI_optional.h
M   source/blender/blenlib/BLI_rand.h
M   source/blender/blenlib/BLI_stack_cxx.h
M   source/blender/blenlib/BLI_string_map.h
M   source/blender/blenlib/BLI_string_ref.h
D   source/blender/blenlib/BLI_temporary_allocator.h
D   source/blender/blenlib/BLI_temporary_allocator_cxx.h
M   source/blender/blenlib/BLI_vector.h
M   source/blender/blenlib/BLI_vector_set.h
M   source/blender/blenlib/CMakeLists.txt
M   source/blender/blenlib/intern/BLI_index_range.cc
D   source/blender/blenlib/intern/BLI_temporary_allocator.cc
M   tests/gtests/blenlib/BLI_array_ref_test.cc
M   tests/gtests/blenlib/BLI_index_range_test.cc
A   tests/gtests/blenlib/BLI_optional_test.cc
M   tests/gtests/blenlib/BLI_stack_cxx_test.cc
M   tests/gtests/blenlib/BLI_string_map_test.cc
M   tests/gtests/blenlib/BLI_string_ref_test.cc
M   tests/gtests/blenlib/BLI_vector_test.cc
M   tests/gtests/blenlib/CMakeLists.txt

===

diff --git a/source/blender/blenlib/BLI_allocator.h 
b/source/blender/blenlib/BLI_allocator.h
index 82cf76e425c..075c181833c 100644
--- a/source/blender/blenlib/BLI_allocator.h
+++ b/source/blender/blenlib/BLI_allocator.h
@@ -36,7 +36,6 @@
 
 #include "BLI_utildefines.h"
 #include "BLI_math_base.h"
-#include "BLI_temporary_allocator.h"
 
 namespace BLI {
 
@@ -53,7 +52,6 @@ class GuardedAllocator {
 
   void *allocate_aligned(uint size, uint alignment, const char *name)
   {
-alignment = std::max(alignment, 8);
 return MEM_mallocN_aligned(size, alignment, name);
   }
 
@@ -102,29 +100,6 @@ class RawAllocator {
   }
 };
 
-/**
- * Use this only under specific circumstances as described in 
BLI_temporary_allocator.h.
- */
-class TemporaryAllocator {
- public:
-  void *allocate(uint size, const char *UNUSED(name))
-  {
-return BLI_temporary_allocate(size);
-  }
-
-  void *allocate_aligned(uint size, uint alignment, const char *UNUSED(name))
-  {
-BLI_assert(alignment <= 64);
-UNUSED_VARS_NDEBUG(alignment);
-return BLI_temporary_allocate(size);
-  }
-
-  void deallocate(void *ptr)
-  {
-BLI_temporary_deallocate(ptr);
-  }
-};
-
 }  // namespace BLI
 
 #endif /* __BLI_ALLOCATOR_H__ */
diff --git a/source/blender/blenlib/BLI_array_cxx.h 
b/source/blender/blenlib/BLI_array_cxx.h
index e987121d68c..adb00c95f28 100644
--- a/source/blender/blenlib/BLI_array_cxx.h
+++ b/source/blender/blenlib/BLI_array_cxx.h
@@ -31,23 +31,24 @@
 
 namespace BLI {
 
-template class Array {
+template class 
Array {
  private:
   T *m_data;
   uint m_size;
   Allocator m_allocator;
+  AlignedBuffer m_inline_storage;
 
  public:
   Array()
   {
-m_data = nullptr;
+m_data = this->inline_storage();
 m_size = 0;
   }
 
   Array(ArrayRef values)
   {
 m_size = values.size();
-m_data = this->allocate(m_size);
+m_data = this->get_buffer_for_size(values.size());
 uninitialized_copy_n(values.begin(), m_size, m_data);
   }
 
@@ -57,8 +58,8 @@ template 
class Array {
 
   explicit Array(uint size)
   {
-m_data = this->allocate(size);
 m_size = size;
+m_data = this->get_buffer_for_size(size);
 
 for (uint i = 0; i < m_size; i++) {
   new (m_data + i) T();
@@ -67,8 +68,8 @@ template 
class Array {
 
   Array(uint size, const T )
   {
-m_data = this->allocate(size);
 m_size = size;
+m_data = this->get_buffer_for_size(size);
 uninitialized_fill_n(m_data, m_size, value);
   }
 
@@ -77,30 +78,31 @@ template 
class Array {
 m_size = other.size();
 m_allocator = other.m_allocator;
 
-if (m_size == 0) {
-  m_data = nullptr;
-  return;
-}
-else {
-  m_data = this->allocate(m_size);
-  copy_n(other.begin(), m_size, m_data);
-}
+m_data = this->get_buffer_for_size(other.size());
+copy_n(other.begin(), m_size, m_data);
   }
 
   Array(Array &) noexcept
   {
-

[Bf-blender-cvs] [76208a5670b] master: Cycles: internal support for constant object/mesh attribute values

2020-02-10 Thread Alex Fuller
Commit: 76208a5670bc9d70f99f22a3c49463959461b5c1
Author: Alex Fuller
Date:   Mon Feb 10 11:04:26 2020 +0100
Branches: master
https://developer.blender.org/rB76208a5670bc9d70f99f22a3c49463959461b5c1

Cycles: internal support for constant object/mesh attribute values

None are currently exported from Blender, this fixes the Cycles side
implementation.

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

===

M   intern/cycles/kernel/geom/geom_curve.h
M   intern/cycles/kernel/geom/geom_subd_triangle.h
M   intern/cycles/kernel/geom/geom_triangle.h

===

diff --git a/intern/cycles/kernel/geom/geom_curve.h 
b/intern/cycles/kernel/geom/geom_curve.h
index e0aacb434eb..f2b8408b0e0 100644
--- a/intern/cycles/kernel/geom/geom_curve.h
+++ b/intern/cycles/kernel/geom/geom_curve.h
@@ -83,6 +83,16 @@ ccl_device float curve_attribute_float(
 
 return (1.0f - sd->u) * f0 + sd->u * f1;
   }
+  else if(desc.element == ATTR_ELEMENT_OBJECT || desc.element == 
ATTR_ELEMENT_MESH) {
+#  ifdef __RAY_DIFFERENTIALS__
+if (dx)
+  *dx = 0.0f;
+if (dy)
+  *dy = 0.0f;
+#  endif
+
+return kernel_tex_fetch(__attributes_float, desc.offset);
+  }
   else {
 #  ifdef __RAY_DIFFERENTIALS__
 if (dx)
@@ -133,6 +143,16 @@ ccl_device float2 curve_attribute_float2(KernelGlobals *kg,
 
 return (1.0f - sd->u) * f0 + sd->u * f1;
   }
+  else if(desc.element == ATTR_ELEMENT_OBJECT || desc.element == 
ATTR_ELEMENT_MESH) {
+#  ifdef __RAY_DIFFERENTIALS__
+if (dx)
+  *dx = make_float2(0.0f, 0.0f);
+if (dy)
+  *dy = make_float2(0.0f, 0.0f);
+#  endif
+
+return kernel_tex_fetch(__attributes_float2, desc.offset);
+  }
   else {
 #  ifdef __RAY_DIFFERENTIALS__
 if (dx)
@@ -183,6 +203,16 @@ ccl_device float3 curve_attribute_float3(KernelGlobals *kg,
 
 return (1.0f - sd->u) * f0 + sd->u * f1;
   }
+  else if(desc.element == ATTR_ELEMENT_OBJECT || desc.element == 
ATTR_ELEMENT_MESH) {
+#  ifdef __RAY_DIFFERENTIALS__
+if (dx)
+  *dx = make_float3(0.0f, 0.0f, 0.0f);
+if (dy)
+  *dy = make_float3(0.0f, 0.0f, 0.0f);
+#  endif
+
+return float4_to_float3(kernel_tex_fetch(__attributes_float3, 
desc.offset));
+  }
   else {
 #  ifdef __RAY_DIFFERENTIALS__
 if (dx)
diff --git a/intern/cycles/kernel/geom/geom_subd_triangle.h 
b/intern/cycles/kernel/geom/geom_subd_triangle.h
index 81bac6e6ee1..62a66cfa0e9 100644
--- a/intern/cycles/kernel/geom/geom_subd_triangle.h
+++ b/intern/cycles/kernel/geom/geom_subd_triangle.h
@@ -217,6 +217,14 @@ ccl_device_noinline float subd_triangle_attribute_float(
 
 return sd->u * a + sd->v * b + (1.0f - sd->u - sd->v) * c;
   }
+  else if(desc.element == ATTR_ELEMENT_OBJECT || desc.element == 
ATTR_ELEMENT_MESH) {
+if (dx)
+  *dx = 0.0f;
+if (dy)
+  *dy = 0.0f;
+
+return kernel_tex_fetch(__attributes_float, desc.offset);
+  }
   else {
 if (dx)
   *dx = 0.0f;
@@ -352,6 +360,14 @@ ccl_device_noinline float2 
subd_triangle_attribute_float2(KernelGlobals *kg,
 
 return sd->u * a + sd->v * b + (1.0f - sd->u - sd->v) * c;
   }
+  else if(desc.element == ATTR_ELEMENT_OBJECT || desc.element == 
ATTR_ELEMENT_MESH) {
+if (dx)
+  *dx = make_float2(0.0f, 0.0f);
+if (dy)
+  *dy = make_float2(0.0f, 0.0f);
+
+return kernel_tex_fetch(__attributes_float2, desc.offset);
+  }
   else {
 if (dx)
   *dx = make_float2(0.0f, 0.0f);
@@ -486,6 +502,14 @@ ccl_device_noinline float3 
subd_triangle_attribute_float3(KernelGlobals *kg,
 
 return sd->u * a + sd->v * b + (1.0f - sd->u - sd->v) * c;
   }
+  else if(desc.element == ATTR_ELEMENT_OBJECT || desc.element == 
ATTR_ELEMENT_MESH) {
+if (dx)
+  *dx = make_float3(0.0f, 0.0f, 0.0f);
+if (dy)
+  *dy = make_float3(0.0f, 0.0f, 0.0f);
+
+return float4_to_float3(kernel_tex_fetch(__attributes_float3, 
desc.offset));
+  }
   else {
 if (dx)
   *dx = make_float3(0.0f, 0.0f, 0.0f);
@@ -584,6 +608,14 @@ ccl_device_noinline float4 
subd_triangle_attribute_float4(KernelGlobals *kg,
 
 return sd->u * a + sd->v * b + (1.0f - sd->u - sd->v) * c;
   }
+  else if(desc.element == ATTR_ELEMENT_OBJECT || desc.element == 
ATTR_ELEMENT_MESH) {
+if (dx)
+  *dx = make_float4(0.0f, 0.0f, 0.0f, 0.0f);
+if (dy)
+  *dy = make_float4(0.0f, 0.0f, 0.0f, 0.0f);
+
+return color_uchar4_to_float4(kernel_tex_fetch(__attributes_uchar4, 
desc.offset));
+  }
   else {
 if (dx)
   *dx = make_float4(0.0f, 0.0f, 0.0f, 0.0f);
diff --git a/intern/cycles/kernel/geom/geom_triangle.h 
b/intern/cycles/kernel/geom/geom_triangle.h
index fdb7f655f64..072c02bf0d3 100644
--- a/intern/cycles/kernel/geom/geom_triangle.h
+++ b/intern/cycles/kernel/geom/geom_triangle.h
@@ -153,6 +153,14 @@ ccl_device float triangle_attribute_float(
 
 return sd->u * f0 + sd->v * f1 + (1.0f - sd->u - sd->v) * f2;
   }
+  else 

[Bf-blender-cvs] [bae72c4b8e4] functions: remove unused classes

2020-02-10 Thread Jacques Lucke
Commit: bae72c4b8e494aae69a8b97a6e4d2badf9e9a69b
Author: Jacques Lucke
Date:   Mon Feb 10 13:27:30 2020 +0100
Branches: functions
https://developer.blender.org/rBbae72c4b8e494aae69a8b97a6e4d2badf9e9a69b

remove unused classes

===

D   source/blender/blenlib/BLI_refcount.h
M   source/blender/blenlib/CMakeLists.txt
D   tests/gtests/blenlib/BLI_refcount_test.cc
M   tests/gtests/blenlib/CMakeLists.txt

===

diff --git a/source/blender/blenlib/BLI_refcount.h 
b/source/blender/blenlib/BLI_refcount.h
deleted file mode 100644
index 3c5f53c8780..000
--- a/source/blender/blenlib/BLI_refcount.h
+++ /dev/null
@@ -1,242 +0,0 @@
-/*
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- */
-
-/** \file
- * \ingroup bli
- *
- * Objects with shared ownership require a reference counter, so that they can 
be freed when they
- * are not referenced anymore.
- *
- * Classes can subclass RefCounter to be extended with an intrusive reference 
count (the counter is
- * stored directly in the object). This is necessary, because the object might 
have to be used by
- * different languages (C, C++, Python).
- *
- * To avoid error-prone manual reference counting, there is an AutoRefCount 
class that works
- * similar to std::shared, but deals with objects of type RefCounter.
- */
-
-#pragma once
-
-#include 
-#include 
-#include "BLI_utildefines.h"
-#include "BLI_hash_cxx.h"
-
-namespace BLI {
-
-class RefCounter {
- private:
-  std::atomic m_refcount;
-
- protected:
-  virtual ~RefCounter(){};
-
-  RefCounter() : m_refcount(1)
-  {
-  }
-
- public:
-  /**
-   * Increment the reference counter atomically.
-   */
-  void incref()
-  {
-m_refcount.fetch_add(1);
-  }
-
-  /**
-   * Decrement the reference counter atomically. Deletes the instance if the 
reference counter
-   * becomes zero.
-   */
-  void decref()
-  {
-int new_value = m_refcount.fetch_sub(1) - 1;
-BLI_assert(new_value >= 0);
-if (new_value == 0) {
-  delete this;
-}
-  }
-
-  /**
-   * Get the current reference count.
-   */
-  int refcount() const
-  {
-return m_refcount;
-  }
-};
-
-template class AutoRefCount {
- private:
-  T *m_object;
-
-  void incref()
-  {
-if (m_object) {
-  m_object->incref();
-}
-  }
-
-  void decref()
-  {
-if (m_object) {
-  m_object->decref();
-}
-  }
-
- public:
-  AutoRefCount() : m_object(nullptr)
-  {
-  }
-
-  AutoRefCount(T *object) : m_object(object)
-  {
-  }
-
-  /**
-   * Similar to std::make_shared.
-   */
-  template static AutoRefCount New(Args &&... args)
-  {
-T *object = new T(std::forward(args)...);
-return AutoRefCount(object);
-  }
-
-  AutoRefCount(const AutoRefCount )
-  {
-m_object = other.m_object;
-this->incref();
-  }
-
-  AutoRefCount(AutoRefCount &)
-  {
-m_object = other.m_object;
-other.m_object = nullptr;
-  }
-
-  ~AutoRefCount()
-  {
-this->decref();
-  }
-
-  AutoRefCount =(const AutoRefCount )
-  {
-if (this == ) {
-  return *this;
-}
-else if (m_object == other.m_object) {
-  return *this;
-}
-else {
-  this->decref();
-  m_object = other.m_object;
-  this->incref();
-  return *this;
-}
-  }
-
-  AutoRefCount =(AutoRefCount &)
-  {
-if (this == ) {
-  return *this;
-}
-else if (m_object == other.m_object) {
-  other.m_object = nullptr;
-  return *this;
-}
-else {
-  this->decref();
-  m_object = other.m_object;
-  other.m_object = nullptr;
-  return *this;
-}
-  }
-
-  /**
-   * Get the pointer that is currently wrapped. This pointer can be null.
-   */
-  const T *ptr() const
-  {
-return m_object;
-  }
-
-  T *ptr()
-  {
-return m_object;
-  }
-
-  /**
-   * Get a reference to the object that is currently wrapped.
-   * Asserts when no object is wrapped.
-   */
-  const T () const
-  {
-BLI_assert(m_object);
-return *m_object;
-  }
-
-  T ()
-  {
-BLI_assert(m_object);
-return *m_object;
-  }
-
-  /**
-   * Get the pointer that is currently wrapped and remove it from this 
automatic reference counter,
-   * effectively taking over the ownership. Note that this can return null.
-   */
- 

[Bf-blender-cvs] [23b52a19589] functions: remove unused class

2020-02-10 Thread Jacques Lucke
Commit: 23b52a19589b4b2358bce6f1cc468748a6312f89
Author: Jacques Lucke
Date:   Mon Feb 10 13:24:46 2020 +0100
Branches: functions
https://developer.blender.org/rB23b52a19589b4b2358bce6f1cc468748a6312f89

remove unused class

===

D   source/blender/blenlib/BLI_multi_vector.h
M   source/blender/blenlib/CMakeLists.txt
D   tests/gtests/blenlib/BLI_multi_vector_test.cc
M   tests/gtests/blenlib/CMakeLists.txt

===

diff --git a/source/blender/blenlib/BLI_multi_vector.h 
b/source/blender/blenlib/BLI_multi_vector.h
deleted file mode 100644
index ef6e22601d3..000
--- a/source/blender/blenlib/BLI_multi_vector.h
+++ /dev/null
@@ -1,63 +0,0 @@
-/*
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- */
-
-/** \file
- * \ingroup bli
- *
- * A vector that can group consecutive elements. This is much more efficient 
than allocating many
- * vectors separately.
- *
- * Note: the number of elements per group cannot be changed cheaply afterwards.
- */
-
-#pragma once
-
-#include "BLI_array_ref.h"
-#include "BLI_vector.h"
-
-namespace BLI {
-
-template class MultiVector {
- private:
-  Vector m_elements;
-  Vector m_starts;
-
- public:
-  MultiVector() : m_starts({0})
-  {
-  }
-
-  void append(ArrayRef values)
-  {
-m_elements.extend(values);
-m_starts.append(m_elements.size());
-  }
-
-  uint size() const
-  {
-return m_starts.size() - 1;
-  }
-
-  ArrayRef operator[](uint index)
-  {
-uint start = m_starts[index];
-uint one_after_end = m_starts[index + 1];
-uint size = one_after_end - start;
-return ArrayRef(m_elements.begin() + start, size);
-  }
-};
-
-}  // namespace BLI
diff --git a/source/blender/blenlib/CMakeLists.txt 
b/source/blender/blenlib/CMakeLists.txt
index c0cca1ed213..753b35c0048 100644
--- a/source/blender/blenlib/CMakeLists.txt
+++ b/source/blender/blenlib/CMakeLists.txt
@@ -265,7 +265,6 @@ set(SRC
   BLI_multi_map.h
   BLI_timeit.h
   BLI_vector_adaptor.h
-  BLI_multi_vector.h
   BLI_utility_mixins.h
   BLI_static_class_ids.h
   BLI_index_mask.h
diff --git a/tests/gtests/blenlib/BLI_multi_vector_test.cc 
b/tests/gtests/blenlib/BLI_multi_vector_test.cc
deleted file mode 100644
index 98f5be08255..000
--- a/tests/gtests/blenlib/BLI_multi_vector_test.cc
+++ /dev/null
@@ -1,20 +0,0 @@
-#include "testing/testing.h"
-#include "BLI_multi_vector.h"
-
-using namespace BLI;
-
-using IntMultiVector = MultiVector;
-
-TEST(multi_vector, DefaultConstructor)
-{
-  IntMultiVector vec;
-  EXPECT_EQ(vec.size(), 0);
-}
-
-TEST(multi_vector, Append)
-{
-  IntMultiVector vec;
-  vec.append({4, 5, 6});
-  EXPECT_EQ(vec.size(), 1);
-  EXPECT_EQ(vec[0].size(), 3);
-}
diff --git a/tests/gtests/blenlib/CMakeLists.txt 
b/tests/gtests/blenlib/CMakeLists.txt
index 43ad74203eb..153613dc388 100644
--- a/tests/gtests/blenlib/CMakeLists.txt
+++ b/tests/gtests/blenlib/CMakeLists.txt
@@ -62,7 +62,6 @@ BLENDER_TEST(BLI_math_geom "bf_blenlib")
 BLENDER_TEST(BLI_memiter "bf_blenlib")
 BLENDER_TEST(BLI_linear_allocator "bf_blenlib")
 BLENDER_TEST(BLI_multi_map "bf_blenlib")
-BLENDER_TEST(BLI_multi_vector "bf_blenlib")
 BLENDER_TEST(BLI_optional "bf_blenlib")
 BLENDER_TEST(BLI_path_util "${BLI_path_util_extra_libs}")
 BLENDER_TEST(BLI_polyfill_2d "bf_blenlib")

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


[Bf-blender-cvs] [ff21d33bfe3] functions: Don't allow getting mutable reference to vector set

2020-02-10 Thread Jacques Lucke
Commit: ff21d33bfe364258006a42fabd9188a23bdd4d9a
Author: Jacques Lucke
Date:   Mon Feb 10 13:32:02 2020 +0100
Branches: functions
https://developer.blender.org/rBff21d33bfe364258006a42fabd9188a23bdd4d9a

Don't allow getting mutable reference to vector set

===

M   source/blender/blenlib/BLI_vector_set.h

===

diff --git a/source/blender/blenlib/BLI_vector_set.h 
b/source/blender/blenlib/BLI_vector_set.h
index 4ab746d9c2a..99d955c60d8 100644
--- a/source/blender/blenlib/BLI_vector_set.h
+++ b/source/blender/blenlib/BLI_vector_set.h
@@ -302,11 +302,6 @@ template class VectorSet {
 return m_elements;
   }
 
-  operator MutableArrayRef()
-  {
-return m_elements;
-  }
-
   void print_stats() const
   {
 std::cout << "VectorSet at " << (void *)this << ":\n";

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


[Bf-blender-cvs] [6218f315bba] functions: remove unused class

2020-02-10 Thread Jacques Lucke
Commit: 6218f315bba7761cea8c72ef29d59e3eab718881
Author: Jacques Lucke
Date:   Mon Feb 10 12:58:20 2020 +0100
Branches: functions
https://developer.blender.org/rB6218f315bba7761cea8c72ef29d59e3eab718881

remove unused class

===

D   source/blender/blenlib/BLI_chunked_range.h
M   source/blender/blenlib/CMakeLists.txt
D   tests/gtests/blenlib/BLI_chunked_range_test.cc
M   tests/gtests/blenlib/CMakeLists.txt

===

diff --git a/source/blender/blenlib/BLI_chunked_range.h 
b/source/blender/blenlib/BLI_chunked_range.h
deleted file mode 100644
index d99d3e1b7b5..000
--- a/source/blender/blenlib/BLI_chunked_range.h
+++ /dev/null
@@ -1,57 +0,0 @@
-/*
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- */
-
-/** \file
- * \ingroup bli
- *
- * Utility class that represents a range that has been split up into chunks.
- */
-
-#pragma once
-
-#include "BLI_index_range.h"
-
-namespace BLI {
-
-class ChunkedIndexRange {
- private:
-  IndexRange m_total_range;
-  uint m_chunk_size;
-  uint m_chunk_amount;
-
- public:
-  ChunkedIndexRange(IndexRange total_range, uint chunk_size)
-  : m_total_range(total_range),
-m_chunk_size(chunk_size),
-m_chunk_amount(std::ceil(m_total_range.size() / (float)m_chunk_size))
-  {
-  }
-
-  uint chunks() const
-  {
-return m_chunk_amount;
-  }
-
-  IndexRange chunk_range(uint index) const
-  {
-BLI_assert(index < m_chunk_amount);
-uint start = m_total_range[index * m_chunk_size];
-uint size = std::min(m_chunk_size, m_total_range.one_after_last() - 
start);
-return IndexRange(start, size);
-  }
-};
-
-}  // namespace BLI
diff --git a/source/blender/blenlib/CMakeLists.txt 
b/source/blender/blenlib/CMakeLists.txt
index 61c6090ccac..c0cca1ed213 100644
--- a/source/blender/blenlib/CMakeLists.txt
+++ b/source/blender/blenlib/CMakeLists.txt
@@ -263,7 +263,6 @@ set(SRC
   BLI_optional.h
   BLI_refcount.h
   BLI_multi_map.h
-  BLI_chunked_range.h
   BLI_timeit.h
   BLI_vector_adaptor.h
   BLI_multi_vector.h
diff --git a/tests/gtests/blenlib/BLI_chunked_range_test.cc 
b/tests/gtests/blenlib/BLI_chunked_range_test.cc
deleted file mode 100644
index 5e648fca645..000
--- a/tests/gtests/blenlib/BLI_chunked_range_test.cc
+++ /dev/null
@@ -1,36 +0,0 @@
-#include "testing/testing.h"
-#include "BLI_index_range.h"
-#include "BLI_chunked_range.h"
-#include "BLI_vector.h"
-
-using BLI::ChunkedIndexRange;
-using BLI::IndexRange;
-
-TEST(chunked_range, ChunksExact)
-{
-  IndexRange range = IndexRange(10, 40);
-  ChunkedIndexRange chunked_range(range, 10);
-  EXPECT_EQ(chunked_range.chunks(), 4);
-
-  EXPECT_EQ(chunked_range.chunk_range(0), IndexRange(10, 10));
-  EXPECT_EQ(chunked_range.chunk_range(1), IndexRange(20, 10));
-  EXPECT_EQ(chunked_range.chunk_range(2), IndexRange(30, 10));
-  EXPECT_EQ(chunked_range.chunk_range(3), IndexRange(40, 10));
-}
-
-TEST(chunked_range, ChunksMore)
-{
-  IndexRange range = IndexRange(25, 15);
-  ChunkedIndexRange chunked_range(range, 10);
-  EXPECT_EQ(chunked_range.chunks(), 2);
-
-  EXPECT_EQ(chunked_range.chunk_range(0), IndexRange(25, 10));
-  EXPECT_EQ(chunked_range.chunk_range(1), IndexRange(35, 5));
-}
-
-TEST(chunked_range, ChunksZero)
-{
-  IndexRange range = IndexRange(20, 0);
-  ChunkedIndexRange chunked_range(range, 10);
-  EXPECT_EQ(chunked_range.chunks(), 0);
-}
diff --git a/tests/gtests/blenlib/CMakeLists.txt 
b/tests/gtests/blenlib/CMakeLists.txt
index 730963e5ffb..43ad74203eb 100644
--- a/tests/gtests/blenlib/CMakeLists.txt
+++ b/tests/gtests/blenlib/CMakeLists.txt
@@ -43,7 +43,6 @@ BLENDER_TEST(BLI_array "bf_blenlib")
 BLENDER_TEST(BLI_array_ref "bf_blenlib")
 BLENDER_TEST(BLI_array_store "bf_blenlib")
 BLENDER_TEST(BLI_array_utils "bf_blenlib")
-BLENDER_TEST(BLI_chunked_range "bf_blenlib")
 BLENDER_TEST(BLI_delaunay_2d "bf_blenlib")
 BLENDER_TEST(BLI_edgehash "bf_blenlib")
 BLENDER_TEST(BLI_expr_pylike_eval "bf_blenlib")

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


[Bf-blender-cvs] [11e9ad412ea] master: UI: Graph Editor Show Cursor panel

2020-02-10 Thread William Reynish
Commit: 11e9ad412ea9321a3719a9deed3642c11cb528e3
Author: William Reynish
Date:   Mon Feb 10 13:26:08 2020 +0100
Branches: master
https://developer.blender.org/rB11e9ad412ea9321a3719a9deed3642c11cb528e3

UI: Graph Editor Show Cursor panel

Make the Graph Editor Cursor panel fit in and use the split layout.

Also removed the snap buttons, since they were only a subset of the snapping 
possibilities, all of which are in Key > Snap anyway, and also in the context 
menu.

Update the theme to use correct hierarchy progression like in other editors.

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

Reviewed by Brecht van Lommel

===

M   release/datafiles/userdef/userdef_default_theme.c
M   source/blender/editors/space_graph/graph_buttons.c
M   source/blender/makesrna/intern/rna_pose.c

===

diff --git a/release/datafiles/userdef/userdef_default_theme.c 
b/release/datafiles/userdef/userdef_default_theme.c
index 1eff85b6129..df8fde40f3c 100644
--- a/release/datafiles/userdef/userdef_default_theme.c
+++ b/release/datafiles/userdef/userdef_default_theme.c
@@ -413,7 +413,7 @@ const bTheme U_theme_default = {
 .tab_inactive = RGBA(0x2b2b2bff),
 .tab_back = RGBA(0x232323ff),
 .tab_outline = RGBA(0x232323ff),
-.button = RGBA(0x282828ff),
+.button = RGBA(0x424242ff),
 .button_title = RGBA(0x),
 .button_text = RGBA(0xe5e5e5ff),
 .button_text_hi = RGBA(0x),
diff --git a/source/blender/editors/space_graph/graph_buttons.c 
b/source/blender/editors/space_graph/graph_buttons.c
index 0a3663372be..02bf97495c1 100644
--- a/source/blender/editors/space_graph/graph_buttons.c
+++ b/source/blender/editors/space_graph/graph_buttons.c
@@ -111,14 +111,13 @@ static bool graph_panel_poll(const bContext *C, PanelType 
*UNUSED(pt))
 
 /* -- */
 
-/* Graph Editor View Settings */
-static void graph_panel_view(const bContext *C, Panel *pa)
+static void graph_panel_cursor_header(const bContext *C, Panel *pa)
 {
   bScreen *sc = CTX_wm_screen(C);
   SpaceGraph *sipo = CTX_wm_space_graph(C);
   Scene *scene = CTX_data_scene(C);
   PointerRNA spaceptr, sceneptr;
-  uiLayout *col, *sub, *row;
+  uiLayout *col;
 
   /* get RNA pointers for use when creating the UI elements */
   RNA_id_pointer_create(>id, );
@@ -126,26 +125,43 @@ static void graph_panel_view(const bContext *C, Panel *pa)
 
   /* 2D-Cursor */
   col = uiLayoutColumn(pa->layout, false);
-  uiItemR(col, , "show_cursor", 0, NULL, ICON_NONE);
+  uiItemR(col, , "show_cursor", 0, "", ICON_NONE);
+}
 
-  sub = uiLayoutColumn(col, true);
-  uiLayoutSetActive(sub, RNA_boolean_get(, "show_cursor"));
-  uiItemO(sub, IFACE_("Cursor from Selection"), ICON_NONE, 
"GRAPH_OT_frame_jump");
+static void graph_panel_cursor(const bContext *C, Panel *pa)
+{
+  bScreen *sc = CTX_wm_screen(C);
+  SpaceGraph *sipo = CTX_wm_space_graph(C);
+  Scene *scene = CTX_data_scene(C);
+  PointerRNA spaceptr, sceneptr;
+  uiLayout *layout = pa->layout;
+  uiLayout *col, *sub;
+  uiBlock *block;
+
+  /* get RNA pointers for use when creating the UI elements */
+  RNA_id_pointer_create(>id, );
+  RNA_pointer_create(>id, _SpaceGraphEditor, sipo, );
+
+  block = uiLayoutGetBlock(layout);
+  uiLayoutSetPropSep(layout, true);
+  uiLayoutSetPropDecorate(layout, false);
+
+  /* 2D-Cursor */
+  col = uiLayoutColumn(layout, false);
+  uiLayoutSetActive(col, RNA_boolean_get(, "show_cursor"));
 
   sub = uiLayoutColumn(col, true);
-  uiLayoutSetActive(sub, RNA_boolean_get(, "show_cursor"));
-  row = uiLayoutSplit(sub, 0.7f, true);
   if (sipo->mode == SIPO_MODE_DRIVERS) {
-uiItemR(row, , "cursor_position_x", 0, IFACE_("Cursor X"), 
ICON_NONE);
+uiItemR(sub, , "cursor_position_x", 0, IFACE_("Cursor X"), 
ICON_NONE);
   }
   else {
-uiItemR(row, , "frame_current", 0, IFACE_("Cursor X"), ICON_NONE);
+uiItemR(sub, , "frame_current", 0, IFACE_("Cursor X"), ICON_NONE);
   }
-  uiItemEnumO(row, "GRAPH_OT_snap", IFACE_("To Keys"), 0, "type", 
GRAPHKEYS_SNAP_CFRA);
 
-  row = uiLayoutSplit(sub, 0.7f, true);
-  uiItemR(row, , "cursor_position_y", 0, IFACE_("Cursor Y"), 
ICON_NONE);
-  uiItemEnumO(row, "GRAPH_OT_snap", IFACE_("To Keys"), 0, "type", 
GRAPHKEYS_SNAP_VALUE);
+  uiItemR(sub, , "cursor_position_y", 0, IFACE_("Y"), ICON_NONE);
+
+  sub = uiLayoutColumn(col, true);
+  uiItemO(sub, IFACE_("Cursor to Selection"), ICON_NONE, 
"GRAPH_OT_frame_jump");
 }
 
 /* *** active F-Curve ** */
@@ -1429,9 +1445,10 @@ void graph_buttons_register(ARegionType *art)
 
   pt = MEM_callocN(sizeof(PanelType), "spacetype graph panel view");
   strcpy(pt->idname, "GRAPH_PT_view");
-  strcpy(pt->label, N_("View Properties"));
+  strcpy(pt->label, N_("Show Cursor"));
   strcpy(pt->category, "View");
   strcpy(pt->translation_context, BLT_I18NCONTEXT_DEFAULT_BPYRNA);
-  pt->draw = graph_panel_view;
+  

[Bf-blender-cvs] [56116bbdf43] master: Cleanup/refactor: Rename `BKE_library` files to `BKE_lib`.

2020-02-10 Thread Bastien Montagne
Commit: 56116bbdf434b57e4d74b1112b4b8111a7c8fa9a
Author: Bastien Montagne
Date:   Mon Feb 10 12:58:59 2020 +0100
Branches: master
https://developer.blender.org/rB56116bbdf434b57e4d74b1112b4b8111a7c8fa9a

Cleanup/refactor: Rename `BKE_library` files to `BKE_lib`.

Note that `BKE_library.h`/`library.c` were renamed to
`BKE_lib_id.h`/`lib_id.c` to avoid having a too generic name here.

Part of T72604.

===

M   source/blender/alembic/intern/abc_mball.cc
M   source/blender/alembic/intern/abc_mesh.cc
M   source/blender/alembic/intern/abc_object.cc
M   source/blender/alembic/intern/alembic_capi.cc
R099source/blender/blenkernel/BKE_library.h 
source/blender/blenkernel/BKE_lib_id.h
R100source/blender/blenkernel/BKE_library_override.h
source/blender/blenkernel/BKE_lib_override.h
R100source/blender/blenkernel/BKE_library_query.h   
source/blender/blenkernel/BKE_lib_query.h
R098source/blender/blenkernel/BKE_library_remap.h   
source/blender/blenkernel/BKE_lib_remap.h
M   source/blender/blenkernel/BKE_main.h
M   source/blender/blenkernel/BKE_modifier.h
M   source/blender/blenkernel/CMakeLists.txt
M   source/blender/blenkernel/intern/DerivedMesh.c
M   source/blender/blenkernel/intern/action.c
M   source/blender/blenkernel/intern/anim_sys.c
M   source/blender/blenkernel/intern/armature.c
M   source/blender/blenkernel/intern/blender_copybuffer.c
M   source/blender/blenkernel/intern/blendfile.c
M   source/blender/blenkernel/intern/bpath.c
M   source/blender/blenkernel/intern/brush.c
M   source/blender/blenkernel/intern/cachefile.c
M   source/blender/blenkernel/intern/camera.c
M   source/blender/blenkernel/intern/collection.c
M   source/blender/blenkernel/intern/constraint.c
M   source/blender/blenkernel/intern/crazyspace.c
M   source/blender/blenkernel/intern/curve.c
M   source/blender/blenkernel/intern/displist.c
M   source/blender/blenkernel/intern/dynamicpaint.c
M   source/blender/blenkernel/intern/editmesh.c
M   source/blender/blenkernel/intern/fluid.c
M   source/blender/blenkernel/intern/font.c
M   source/blender/blenkernel/intern/freestyle.c
M   source/blender/blenkernel/intern/gpencil.c
M   source/blender/blenkernel/intern/gpencil_modifier.c
M   source/blender/blenkernel/intern/idprop.c
M   source/blender/blenkernel/intern/image.c
M   source/blender/blenkernel/intern/ipo.c
M   source/blender/blenkernel/intern/key.c
M   source/blender/blenkernel/intern/lattice.c
M   source/blender/blenkernel/intern/layer.c
R099source/blender/blenkernel/intern/library.c  
source/blender/blenkernel/intern/lib_id.c
R099source/blender/blenkernel/intern/library_override.c 
source/blender/blenkernel/intern/lib_override.c
R099source/blender/blenkernel/intern/library_query.c
source/blender/blenkernel/intern/lib_query.c
R099source/blender/blenkernel/intern/library_remap.c
source/blender/blenkernel/intern/lib_remap.c
M   source/blender/blenkernel/intern/light.c
M   source/blender/blenkernel/intern/lightprobe.c
M   source/blender/blenkernel/intern/linestyle.c
M   source/blender/blenkernel/intern/main.c
M   source/blender/blenkernel/intern/mask.c
M   source/blender/blenkernel/intern/material.c
M   source/blender/blenkernel/intern/mball.c
M   source/blender/blenkernel/intern/mesh.c
M   source/blender/blenkernel/intern/mesh_convert.c
M   source/blender/blenkernel/intern/mesh_merge.c
M   source/blender/blenkernel/intern/mesh_mirror.c
M   source/blender/blenkernel/intern/mesh_remesh_voxel.c
M   source/blender/blenkernel/intern/mesh_runtime.c
M   source/blender/blenkernel/intern/modifier.c
M   source/blender/blenkernel/intern/movieclip.c
M   source/blender/blenkernel/intern/multires_reshape.c
M   source/blender/blenkernel/intern/nla.c
M   source/blender/blenkernel/intern/node.c
M   source/blender/blenkernel/intern/object.c
M   source/blender/blenkernel/intern/paint.c
M   source/blender/blenkernel/intern/paint_toolslots.c
M   source/blender/blenkernel/intern/particle.c
M   source/blender/blenkernel/intern/particle_distribute.c
M   source/blender/blenkernel/intern/particle_system.c
M   source/blender/blenkernel/intern/pointcache.c
M   source/blender/blenkernel/intern/rigidbody.c
M   source/blender/blenkernel/intern/scene.c
M   source/blender/blenkernel/intern/seqeffects.c
M   source/blender/blenkernel/intern/seqprefetch.c
M   source/blender/blenkernel/intern/sequencer.c
M   source/blender/blenkernel/intern/shader_fx.c
M   source/blender/blenkernel/intern/shrinkwrap.c
M   source/blender/blenkernel/intern/sound.c
M   source/blender/blenkernel/intern/speaker.c
M   source/blender/blenkernel/intern/text.c
M   source/blender/blenkernel/intern/texture.c

[Bf-blender-cvs] [3f650503543] functions: remove unused classes

2020-02-10 Thread Jacques Lucke
Commit: 3f6505035439a44751a400b34a00b6e923813562
Author: Jacques Lucke
Date:   Mon Feb 10 12:53:44 2020 +0100
Branches: functions
https://developer.blender.org/rB3f6505035439a44751a400b34a00b6e923813562

remove unused classes

===

D   source/blender/blenlib/BLI_bit_array_ref.h
D   tests/gtests/blenlib/BLI_bit_array_ref_test.cc
M   tests/gtests/blenlib/CMakeLists.txt

===

diff --git a/source/blender/blenlib/BLI_bit_array_ref.h 
b/source/blender/blenlib/BLI_bit_array_ref.h
deleted file mode 100644
index 8149fa0a0e7..000
--- a/source/blender/blenlib/BLI_bit_array_ref.h
+++ /dev/null
@@ -1,100 +0,0 @@
-#pragma once
-
-#include "BLI_utildefines.h"
-#include "BLI_math_base.h"
-
-namespace BLI {
-
-class BitReference {
- private:
-  uint8_t *m_ptr;
-  uint8_t m_bit_mask;
-
- public:
-  BitReference(uint8_t *ptr, uint8_t bit_mask) : m_ptr(ptr), 
m_bit_mask(bit_mask)
-  {
-BLI_assert(is_power_of_2_i(bit_mask));
-  }
-
-  bool is_set() const
-  {
-return *m_ptr & m_bit_mask;
-  }
-
-  void set()
-  {
-*m_ptr |= m_bit_mask;
-  }
-
-  void unset()
-  {
-*m_ptr &= ~m_bit_mask;
-  }
-};
-
-class MutableBitArrayRef {
- private:
-  uint8_t *m_data = nullptr;
-  uint m_offset = 0;
-  uint m_size = 0;
-
- public:
-  MutableBitArrayRef() = default;
-
-  MutableBitArrayRef(uint8_t *data, uint size) : m_data(data), m_offset(0), 
m_size(size)
-  {
-  }
-
-  MutableBitArrayRef(uint8_t *data, uint offset, uint size)
-  : m_data(data), m_offset(offset), m_size(size)
-  {
-  }
-
-  explicit MutableBitArrayRef(uint8_t )
-  : m_data(), m_offset(0), m_size(sizeof(uint8_t) * 8)
-  {
-  }
-
-  MutableBitArrayRef slice(uint start, uint size) const
-  {
-BLI_assert(start + size <= m_size || size == 0);
-return MutableBitArrayRef(m_data, m_offset + start, size);
-  }
-
-  uint size() const
-  {
-return m_size;
-  }
-
-  BitReference operator[](uint index)
-  {
-BLI_assert(index < m_size);
-uint bit_index = m_offset + index;
-uint8_t *ptr = m_data + bit_index / 8;
-uint8_t offset = bit_index % 8;
-uint8_t bit_mask = 1 << offset;
-return BitReference(ptr, bit_mask);
-  }
-
-  const BitReference operator[](uint index) const
-  {
-return (*const_cast(this))[index];
-  }
-
-  bool is_set(uint index) const
-  {
-return (*this)[index].is_set();
-  }
-
-  void set(uint index)
-  {
-return (*this)[index].set();
-  }
-
-  void unset(uint index)
-  {
-return (*this)[index].unset();
-  }
-};
-
-};  // namespace BLI
diff --git a/tests/gtests/blenlib/BLI_bit_array_ref_test.cc 
b/tests/gtests/blenlib/BLI_bit_array_ref_test.cc
deleted file mode 100644
index b649de2e2e8..000
--- a/tests/gtests/blenlib/BLI_bit_array_ref_test.cc
+++ /dev/null
@@ -1,100 +0,0 @@
-#include "testing/testing.h"
-#include "BLI_bit_array_ref.h"
-
-using namespace BLI;
-
-TEST(mutable_bit_array_ref, Constructor)
-{
-  uint8_t value = 0;
-  MutableBitArrayRef ref(value);
-
-  EXPECT_EQ(ref.size(), 8);
-  EXPECT_FALSE(ref[0].is_set());
-  EXPECT_FALSE(ref[1].is_set());
-  EXPECT_FALSE(ref[2].is_set());
-  EXPECT_FALSE(ref[3].is_set());
-  EXPECT_FALSE(ref[4].is_set());
-  EXPECT_FALSE(ref[5].is_set());
-  EXPECT_FALSE(ref[6].is_set());
-  EXPECT_FALSE(ref[7].is_set());
-}
-
-TEST(mutable_bit_array_ref, Constructor2)
-{
-  uint8_t value = 130;
-  MutableBitArrayRef ref(value);
-  EXPECT_EQ(ref.size(), 8);
-
-  EXPECT_FALSE(ref[0].is_set());
-  EXPECT_TRUE(ref[1].is_set());
-  EXPECT_FALSE(ref[2].is_set());
-  EXPECT_FALSE(ref[3].is_set());
-  EXPECT_FALSE(ref[4].is_set());
-  EXPECT_FALSE(ref[5].is_set());
-  EXPECT_FALSE(ref[6].is_set());
-  EXPECT_TRUE(ref[7].is_set());
-}
-
-TEST(mutable_bit_array_ref, SetBitInByte)
-{
-  uint8_t value = 0;
-  MutableBitArrayRef ref(value);
-
-  ref[0].set();
-  EXPECT_EQ(value, 1);
-  ref[4].set();
-  EXPECT_EQ(value, 17);
-  ref[2].set();
-  EXPECT_EQ(value, 21);
-}
-
-TEST(mutable_bit_array_ref, UnsetBitInByte)
-{
-  uint8_t value = 0xFF;
-  MutableBitArrayRef ref(value);
-
-  ref[7].unset();
-  EXPECT_EQ(value, 127);
-  ref[2].unset();
-  EXPECT_EQ(value, 123);
-  ref[0].unset();
-  EXPECT_EQ(value, 122);
-}
-
-TEST(mutable_bit_array_ref, Slice)
-{
-  uint8_t value[4] = {0};
-  MutableBitArrayRef ref(value, 32);
-
-  EXPECT_EQ(ref.size(), 32);
-  auto sliced_ref = ref.slice(10, 5);
-  EXPECT_EQ(sliced_ref.size(), 5);
-  sliced_ref[2].set();
-  EXPECT_EQ(value[1], 16);
-}
-
-TEST(mutable_bit_array_ref, IsSet)
-{
-  uint8_t value[2] = {0};
-  value[0] = 0b00100110;
-  value[1] = 0b1100;
-  MutableBitArrayRef ref(value, 16);
-
-  EXPECT_FALSE(ref.is_set(0));
-  EXPECT_FALSE(ref.is_set(3));
-  EXPECT_FALSE(ref.is_set(4));
-  EXPECT_FALSE(ref.is_set(6));
-  EXPECT_FALSE(ref.is_set(7));
-  EXPECT_FALSE(ref.is_set(8));
-  EXPECT_FALSE(ref.is_set(9));
-  EXPECT_FALSE(ref.is_set(11));
-  EXPECT_FALSE(ref.is_set(12));
-  

[Bf-blender-cvs] [ae863f34df8] master: Tracking: Clarify calculation of camera matrix for object solver

2020-02-10 Thread Sergey Sharybin
Commit: ae863f34df870af416b4728e65d4b6eef93a4d30
Author: Sergey Sharybin
Date:   Mon Feb 10 12:46:01 2020 +0100
Branches: master
https://developer.blender.org/rBae863f34df870af416b4728e65d4b6eef93a4d30

Tracking: Clarify calculation of camera matrix for object solver

It might be confusing why matrix is constructed from scratch rather
than using already calculated one.

===

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

===

diff --git a/source/blender/blenkernel/intern/tracking.c 
b/source/blender/blenkernel/intern/tracking.c
index 58f58417084..d2038c34056 100644
--- a/source/blender/blenkernel/intern/tracking.c
+++ b/source/blender/blenkernel/intern/tracking.c
@@ -398,6 +398,16 @@ MovieTrackingReconstruction 
*BKE_tracking_get_active_reconstruction(MovieTrackin
 void BKE_tracking_get_camera_object_matrix(Object *camera_object, float 
mat[4][4])
 {
   BLI_assert(camera_object != NULL);
+  /* NOTE: Construct matrix from scratch rather than using obmat because the 
camera object here
+   * will have camera solver constraint taken into account. But here we do not 
want or need it:
+   * object is solved in camera space (as in, camera is stationary and object 
is moving).
+   *
+   * This will include animation applied on the camera, but not possible 
camera rig. This isn't
+   * an issue in practice due to the way how VFX is constructed.
+   *
+   * If we ever need to support crazy setups like that one possible solution 
would be to use
+   * final camera matrix and multiple it by an inverse of solved camera matrix 
at the current
+   * frame. */
   BKE_object_where_is_calc_mat4(camera_object, mat);
 }

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


[Bf-blender-cvs] [a605775298f] master: Tracking: Fix usage PLACEHOLDER function

2020-02-10 Thread Sergey Sharybin
Commit: a605775298f3f335b33270be7686c52ada10a45d
Author: Sergey Sharybin
Date:   Mon Feb 10 12:36:49 2020 +0100
Branches: master
https://developer.blender.org/rBa605775298f3f335b33270be7686c52ada10a45d

Tracking: Fix usage PLACEHOLDER function

Don't use BKE_view_layer_context_active_PLACEHOLDER which is marked
as "never use this".

In fact, it isn't needed to lookup for camera in the tracking function
at all: camera object is always explicitly passed to it.

===

M   source/blender/blenkernel/BKE_tracking.h
M   source/blender/blenkernel/intern/constraint.c
M   source/blender/blenkernel/intern/tracking.c
M   source/blender/draw/engines/overlay/overlay_extra.c
M   source/blender/editors/space_clip/tracking_ops_orient.c
M   source/blender/editors/space_view3d/view3d_snap.c
M   source/blender/editors/transform/transform_snap_object.c

===

diff --git a/source/blender/blenkernel/BKE_tracking.h 
b/source/blender/blenkernel/BKE_tracking.h
index c64d684de5a..2091078fd30 100644
--- a/source/blender/blenkernel/BKE_tracking.h
+++ b/source/blender/blenkernel/BKE_tracking.h
@@ -56,9 +56,7 @@ struct MovieTrackingReconstruction 
*BKE_tracking_get_active_reconstruction(
 struct MovieTracking *tracking);
 
 /* matrices for constraints and drawing */
-void BKE_tracking_get_camera_object_matrix(struct Scene *scene,
-   struct Object *ob,
-   float mat[4][4]);
+void BKE_tracking_get_camera_object_matrix(struct Object *ob, float mat[4][4]);
 void BKE_tracking_get_projection_matrix(struct MovieTracking *tracking,
 struct MovieTrackingObject *object,
 int framenr,
diff --git a/source/blender/blenkernel/intern/constraint.c 
b/source/blender/blenkernel/intern/constraint.c
index 708d0600e91..229578a38b7 100644
--- a/source/blender/blenkernel/intern/constraint.c
+++ b/source/blender/blenkernel/intern/constraint.c
@@ -4611,7 +4611,7 @@ static void followtrack_evaluate(bConstraint *con, 
bConstraintOb *cob, ListBase
 cob->matrix, track->bundle_pos[0], track->bundle_pos[1], 
track->bundle_pos[2]);
   }
   else {
-BKE_tracking_get_camera_object_matrix(cob->scene, camob, mat);
+BKE_tracking_get_camera_object_matrix(camob, mat);
 
 mul_m4_m4m4(cob->matrix, obmat, mat);
 translate_m4(
diff --git a/source/blender/blenkernel/intern/tracking.c 
b/source/blender/blenkernel/intern/tracking.c
index 86fb2ab58bc..731051f2f34 100644
--- a/source/blender/blenkernel/intern/tracking.c
+++ b/source/blender/blenkernel/intern/tracking.c
@@ -395,23 +395,10 @@ MovieTrackingReconstruction 
*BKE_tracking_get_active_reconstruction(MovieTrackin
 /* Get transformation matrix for a given object which is used
  * for parenting motion tracker reconstruction to 3D world.
  */
-void BKE_tracking_get_camera_object_matrix(Scene *scene, Object *ob, float 
mat[4][4])
+void BKE_tracking_get_camera_object_matrix(Object *ob, float mat[4][4])
 {
-  if (!ob) {
-if (scene->camera) {
-  ob = scene->camera;
-}
-else {
-  ob = 
BKE_view_layer_camera_find(BKE_view_layer_context_active_PLACEHOLDER(scene));
-}
-  }
-
-  if (ob) {
-BKE_object_where_is_calc_mat4(ob, mat);
-  }
-  else {
-unit_m4(mat);
-  }
+  BLI_assert(ob != NULL);
+  BKE_object_where_is_calc_mat4(ob, mat);
 }
 
 /* Get projection matrix for camera specified by given tracking object
diff --git a/source/blender/draw/engines/overlay/overlay_extra.c 
b/source/blender/draw/engines/overlay/overlay_extra.c
index 688ecaf3946..7db55ee9b34 100644
--- a/source/blender/draw/engines/overlay/overlay_extra.c
+++ b/source/blender/draw/engines/overlay/overlay_extra.c
@@ -876,7 +876,7 @@ static void 
camera_view3d_reconstruction(OVERLAY_ExtraCallBuffers *cb,
   UI_GetThemeColor4fv(TH_BUNDLE_SOLID, bundle_color_solid);
 
   float camera_mat[4][4], normal_mat[4][4];
-  BKE_tracking_get_camera_object_matrix(scene, ob, camera_mat);
+  BKE_tracking_get_camera_object_matrix(ob, camera_mat);
 
   normalize_m4_m4(normal_mat, ob->obmat);
 
diff --git a/source/blender/editors/space_clip/tracking_ops_orient.c 
b/source/blender/editors/space_clip/tracking_ops_orient.c
index de0025a53d2..8bc77cf82cb 100644
--- a/source/blender/editors/space_clip/tracking_ops_orient.c
+++ b/source/blender/editors/space_clip/tracking_ops_orient.c
@@ -210,7 +210,7 @@ static int set_origin_exec(bContext *C, wmOperator *op)
   mul_v3_fl(median, 1.0f / selected_count);
 
   float mat[4][4], vec[3];
-  BKE_tracking_get_camera_object_matrix(scene, camera, mat);
+  BKE_tracking_get_camera_object_matrix(camera, mat);
   mul_v3_m4v3(vec, mat, median);
 
   if (tracking_object->flag & TRACKING_OBJECT_CAMERA) {
@@ -267,7 +267,7 @@ static void set_axis(Scene *scene,
 
   

[Bf-blender-cvs] [0f07848efe6] master: Tracking: Cleanup, more clear variable name

2020-02-10 Thread Sergey Sharybin
Commit: 0f07848efe631544d93b9c151bf2532645b5aac9
Author: Sergey Sharybin
Date:   Mon Feb 10 12:40:54 2020 +0100
Branches: master
https://developer.blender.org/rB0f07848efe631544d93b9c151bf2532645b5aac9

Tracking: Cleanup, more clear variable name

===

M   source/blender/blenkernel/BKE_tracking.h
M   source/blender/blenkernel/intern/tracking.c

===

diff --git a/source/blender/blenkernel/BKE_tracking.h 
b/source/blender/blenkernel/BKE_tracking.h
index 2091078fd30..11eb98054d5 100644
--- a/source/blender/blenkernel/BKE_tracking.h
+++ b/source/blender/blenkernel/BKE_tracking.h
@@ -56,7 +56,7 @@ struct MovieTrackingReconstruction 
*BKE_tracking_get_active_reconstruction(
 struct MovieTracking *tracking);
 
 /* matrices for constraints and drawing */
-void BKE_tracking_get_camera_object_matrix(struct Object *ob, float mat[4][4]);
+void BKE_tracking_get_camera_object_matrix(struct Object *camera_object, float 
mat[4][4]);
 void BKE_tracking_get_projection_matrix(struct MovieTracking *tracking,
 struct MovieTrackingObject *object,
 int framenr,
diff --git a/source/blender/blenkernel/intern/tracking.c 
b/source/blender/blenkernel/intern/tracking.c
index 731051f2f34..58f58417084 100644
--- a/source/blender/blenkernel/intern/tracking.c
+++ b/source/blender/blenkernel/intern/tracking.c
@@ -395,10 +395,10 @@ MovieTrackingReconstruction 
*BKE_tracking_get_active_reconstruction(MovieTrackin
 /* Get transformation matrix for a given object which is used
  * for parenting motion tracker reconstruction to 3D world.
  */
-void BKE_tracking_get_camera_object_matrix(Object *ob, float mat[4][4])
+void BKE_tracking_get_camera_object_matrix(Object *camera_object, float 
mat[4][4])
 {
-  BLI_assert(ob != NULL);
-  BKE_object_where_is_calc_mat4(ob, mat);
+  BLI_assert(camera_object != NULL);
+  BKE_object_where_is_calc_mat4(camera_object, mat);
 }
 
 /* Get projection matrix for camera specified by given tracking object

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


[Bf-blender-cvs] [f363ff348c2] functions: remove temporary allocator

2020-02-10 Thread Jacques Lucke
Commit: f363ff348c21802549b5138119b6142f84284707
Author: Jacques Lucke
Date:   Mon Feb 10 12:42:24 2020 +0100
Branches: functions
https://developer.blender.org/rBf363ff348c21802549b5138119b6142f84284707

remove temporary allocator

===

M   source/blender/blenlib/BLI_allocator.h
M   source/blender/blenlib/BLI_array_cxx.h
D   source/blender/blenlib/BLI_temporary_allocator.h
D   source/blender/blenlib/BLI_temporary_allocator_cxx.h
M   source/blender/blenlib/BLI_vector.h
M   source/blender/blenlib/CMakeLists.txt
D   source/blender/blenlib/intern/BLI_temporary_allocator.cc
M   source/blender/functions/intern/multi_functions/mixed.cc
M   source/blender/functions/intern/multi_functions/surface_hook.cc
M   source/blender/functions/intern/multi_functions/util.h
M   source/blender/functions/intern/node_tree.cc
M   source/blender/modifiers/intern/MOD_functiondeform_cxx.cc
M   source/blender/simulations/bparticles/actions.cpp
M   source/blender/simulations/bparticles/emitters.cpp
M   source/blender/simulations/bparticles/events.cpp
M   source/blender/simulations/bparticles/integrator.cpp
M   source/blender/simulations/bparticles/particle_action.cpp
M   source/blender/simulations/bparticles/particle_function.cpp
M   source/blender/simulations/bparticles/particle_function.hpp
M   source/blender/simulations/bparticles/simulate.cpp

===

diff --git a/source/blender/blenlib/BLI_allocator.h 
b/source/blender/blenlib/BLI_allocator.h
index a9fbba63ee3..075c181833c 100644
--- a/source/blender/blenlib/BLI_allocator.h
+++ b/source/blender/blenlib/BLI_allocator.h
@@ -36,7 +36,6 @@
 
 #include "BLI_utildefines.h"
 #include "BLI_math_base.h"
-#include "BLI_temporary_allocator.h"
 
 namespace BLI {
 
@@ -60,11 +59,6 @@ class GuardedAllocator {
   {
 MEM_freeN(ptr);
   }
-
-  uint min_allocated_size() const
-  {
-return 0;
-  }
 };
 
 /**
@@ -104,109 +98,6 @@ class RawAllocator {
 void *actual_pointer = POINTER_OFFSET(ptr, offset);
 free(actual_pointer);
   }
-
-  uint min_allocated_size() const
-  {
-return 0;
-  }
-};
-
-/**
- * Use this only under specific circumstances as described in 
BLI_temporary_allocator.h.
- */
-class TemporaryAllocator {
- public:
-  void *allocate(uint size, const char *UNUSED(name))
-  {
-return BLI_temporary_allocate(size);
-  }
-
-  void *allocate_aligned(uint size, uint alignment, const char *UNUSED(name))
-  {
-BLI_assert(alignment <= 64);
-UNUSED_VARS_NDEBUG(alignment);
-return BLI_temporary_allocate(size);
-  }
-
-  void deallocate(void *ptr)
-  {
-BLI_temporary_deallocate(ptr);
-  }
-
-  uint min_allocated_size() const
-  {
-return BLI_TEMPORARY_MINIMUM_SIZE;
-  }
-};
-
-class AnyAllocator {
- public:
-  class VirtualBase {
-   public:
-virtual void *allocate(uint size, const char *name) = 0;
-
-virtual void *allocate_aligned(uint size, uint alignment, const char 
*name) = 0;
-
-virtual void deallocate(void *ptr) = 0;
-
-virtual uint min_allocated_size() const = 0;
-  };
-
-  /**
-   * Only take a reference to the underlying allocator. No ownership is 
transferred.
-   */
-  AnyAllocator(VirtualBase ) : m_base()
-  {
-  }
-
-  void *allocate(uint size, const char *name)
-  {
-return m_base->allocate(size, name);
-  }
-
-  void *allocate_aligned(uint size, uint alignment, const char *name)
-  {
-return m_base->allocate_aligned(size, alignment, name);
-  }
-
-  void deallocate(void *ptr)
-  {
-m_base->deallocate(ptr);
-  }
-
-  uint min_allocated_size() const
-  {
-return m_base->min_allocated_size();
-  }
-
- private:
-  VirtualBase *m_base;
-};
-
-template class AnyAllocatorBase : public 
AnyAllocator::VirtualBase {
- private:
-  Allocator m_allocator;
-
- public:
-  void *allocate(uint size, const char *name) final override
-  {
-return m_allocator.allocate(size, name);
-  }
-
-  void *allocate_aligned(uint size, uint alignment, const char *name) final 
override
-  {
-return m_allocator.allocate_aligned(size, alignment, name);
-  }
-
-  void deallocate(void *ptr) final override
-  {
-m_allocator.deallocate(ptr);
-  }
-
-  uint min_allocated_size() const final override
-  {
-return m_allocator.min_allocated_size();
-  }
 };
 
 }  // namespace BLI
diff --git a/source/blender/blenlib/BLI_array_cxx.h 
b/source/blender/blenlib/BLI_array_cxx.h
index 3c14b5c8e81..adb00c95f28 100644
--- a/source/blender/blenlib/BLI_array_cxx.h
+++ b/source/blender/blenlib/BLI_array_cxx.h
@@ -229,15 +229,6 @@ template class Ar
   }
 };
 
-/**
- * Use this when the following assumptions hold:
- *   - The number of elements in the array is known.
- *   - The array is usually relatively large (so that it does not fit in 
inline storage).
- *   - Is used in the scope of some function. So it will be freed soon.
- *   - The scope 

[Bf-blender-cvs] [379ee3e5277] master: PY API doc generation: Add option for multi-tasking sphinx.

2020-02-10 Thread Bastien Montagne
Commit: 379ee3e52779050c63f531454c9c60e310601e77
Author: Bastien Montagne
Date:   Mon Feb 10 12:37:15 2020 +0100
Branches: master
https://developer.blender.org/rB379ee3e52779050c63f531454c9c60e310601e77

PY API doc generation: Add option for multi-tasking sphinx.

===

M   doc/python_api/sphinx_doc_update.py

===

diff --git a/doc/python_api/sphinx_doc_update.py 
b/doc/python_api/sphinx_doc_update.py
index 78bfd3c85b8..d3f42b1d26f 100755
--- a/doc/python_api/sphinx_doc_update.py
+++ b/doc/python_api/sphinx_doc_update.py
@@ -27,7 +27,7 @@ You'll need to specify your user login and password, 
obviously.
 
 Example usage:
 
-   ./sphinx_doc_update.py --mirror ../../../docs/remote_api_backup/ --source 
../.. --blender ../../../build_cmake/bin/blender --user foobar --password barfoo
+   ./sphinx_doc_update.py --jobs 16 --mirror ../../../docs/remote_api_backup/ 
--source ../.. --blender ../../../build_cmake/bin/blender --user foobar 
--password barfoo
 
 """
 
@@ -82,6 +82,10 @@ def argparse_create():
 "--password", dest="password",
 metavar='PASSWORD', type=str, required=True,
 help=("Password to login on rsync server"))
+parser.add_argument(
+"--jobs", dest="jobs_nr",
+metavar='NR', type=int, required=False, default=1,
+help="Number of sphinx building jobs to launch in parallel")
 
 return parser
 
@@ -141,7 +145,7 @@ def main():
 # IV) Build doc.
 curr_dir = os.getcwd()
 os.chdir(tmp_dir)
-sphinx_cmd = ("sphinx-build", "-b", "html", "sphinx-in", "sphinx-out")
+sphinx_cmd = ("sphinx-build", "-j", str(args.jobs_nr), "-b", "html", 
"sphinx-in", "sphinx-out")
 subprocess.run(sphinx_cmd)
 shutil.rmtree(os.path.join("sphinx-out", ".doctrees"))
 os.chdir(curr_dir)

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


[Bf-blender-cvs] [9880bebd1a9] functions: improve linear allocator

2020-02-10 Thread Jacques Lucke
Commit: 9880bebd1a9a6262b16635bfeb7b003ea3ec0a9b
Author: Jacques Lucke
Date:   Mon Feb 10 11:47:17 2020 +0100
Branches: functions
https://developer.blender.org/rB9880bebd1a9a6262b16635bfeb7b003ea3ec0a9b

improve linear allocator

===

M   source/blender/blenlib/BLI_linear_allocator.h
M   source/blender/blenlib/BLI_multi_map.h
M   source/blender/functions/FN_attributes_ref.h
M   source/blender/functions/intern/multi_functions/network.cc
M   tests/gtests/blenlib/BLI_linear_allocator_test.cc

===

diff --git a/source/blender/blenlib/BLI_linear_allocator.h 
b/source/blender/blenlib/BLI_linear_allocator.h
index 60d19591855..e276afbbb68 100644
--- a/source/blender/blenlib/BLI_linear_allocator.h
+++ b/source/blender/blenlib/BLI_linear_allocator.h
@@ -27,39 +27,51 @@
 #include "BLI_vector.h"
 #include "BLI_utility_mixins.h"
 #include "BLI_timeit.h"
+#include "BLI_stack_cxx.h"
 #include "BLI_string_ref.h"
 
 namespace BLI {
 
-template
-class LinearAllocator : NonCopyable, NonMovable {
+template class LinearAllocator : 
NonCopyable, NonMovable {
  private:
   Allocator m_allocator;
-  Vector m_pointers;
+  Vector m_owned_buffers;
+  Vector> m_unused_borrowed_buffers;
 
-  void *m_current_buffer;
-  uint m_remaining_capacity;
+  uintptr_t m_current_begin;
+  uintptr_t m_current_end;
   uint m_next_min_alloc_size;
 
-  AlignedBuffer m_inline_buffer;
-
 #ifdef DEBUG
   uint m_debug_allocated_amount = 0;
 #endif
 
  public:
-  LinearAllocator() : m_remaining_capacity(N), 
m_next_min_alloc_size(std::max(N * 2, 16))
+  LinearAllocator()
   {
-m_current_buffer = m_inline_buffer.ptr();
+m_current_begin = 0;
+m_current_end = 0;
+m_next_min_alloc_size = 64;
   }
 
   ~LinearAllocator()
   {
-for (void *ptr : m_pointers) {
+for (void *ptr : m_owned_buffers) {
   m_allocator.deallocate(ptr);
 }
   }
 
+  void provide_buffer(void *buffer, uint size)
+  {
+m_unused_borrowed_buffers.append(ArrayRef((char *)buffer, size));
+  }
+
+  template
+  void provide_buffer(AlignedBuffer _buffer)
+  {
+this->provide_buffer(aligned_buffer.ptr(), Size);
+  }
+
   template T *allocate()
   {
 return (T *)this->allocate(sizeof(T), alignof(T));
@@ -80,15 +92,11 @@ class LinearAllocator : NonCopyable, NonMovable {
 #endif
 
 uintptr_t alignment_mask = alignment - 1;
-
-uintptr_t current_buffer = (uintptr_t)m_current_buffer;
-uintptr_t potential_allocation_begin = (current_buffer + alignment - 1) & 
~alignment_mask;
+uintptr_t potential_allocation_begin = (m_current_begin + alignment_mask) 
& ~alignment_mask;
 uintptr_t potential_allocation_end = potential_allocation_begin + size;
-uintptr_t required_size = potential_allocation_end - current_buffer;
 
-if (required_size <= m_remaining_capacity) {
-  m_remaining_capacity -= required_size;
-  m_current_buffer = (void *)potential_allocation_end;
+if (potential_allocation_end <= m_current_end) {
+  m_current_begin = potential_allocation_end;
   return (void *)potential_allocation_begin;
 }
 else {
@@ -140,13 +148,23 @@ class LinearAllocator : NonCopyable, NonMovable {
  private:
   void allocate_new_buffer(uint min_allocation_size)
   {
+for (uint i : m_unused_borrowed_buffers.index_range()) {
+  ArrayRef buffer = m_unused_borrowed_buffers[i];
+  if (buffer.size() >= min_allocation_size) {
+m_unused_borrowed_buffers.remove_and_reorder(i);
+m_current_begin = (uintptr_t)buffer.begin();
+m_current_end = (uintptr_t)buffer.end();
+return;
+  }
+}
+
 uint size_in_bytes = power_of_2_min_u(std::max(min_allocation_size, 
m_next_min_alloc_size));
 m_next_min_alloc_size = size_in_bytes * 2;
 
 void *buffer = m_allocator.allocate(size_in_bytes, __func__);
-m_pointers.append(buffer);
-m_remaining_capacity = size_in_bytes;
-m_current_buffer = buffer;
+m_owned_buffers.append(buffer);
+m_current_begin = (uintptr_t)buffer;
+m_current_end = m_current_begin + size_in_bytes;
   }
 };
 
diff --git a/source/blender/blenlib/BLI_multi_map.h 
b/source/blender/blenlib/BLI_multi_map.h
index bb98da6d3d4..b770dfbab6c 100644
--- a/source/blender/blenlib/BLI_multi_map.h
+++ b/source/blender/blenlib/BLI_multi_map.h
@@ -37,7 +37,7 @@ template class 
MultiMap {
 uint capacity = 0;
   };
 
-  LinearAllocator m_allocator;
+  LinearAllocator<> m_allocator;
   Map m_map;
 
  public:
diff --git a/source/blender/functions/FN_attributes_ref.h 
b/source/blender/functions/FN_attributes_ref.h
index 6c9d992798f..4a51ea3fec9 100644
--- a/source/blender/functions/FN_attributes_ref.h
+++ b/source/blender/functions/FN_attributes_ref.h
@@ -27,7 +27,7 @@ class AttributesInfo;
 
 class AttributesInfoBuilder : BLI::NonCopyable, BLI::NonMovable {
  private:
-  LinearAllocator<32> m_allocator;
+  LinearAllocator<> 

[Bf-blender-cvs] [003dc7ffc9e] functions: fix after merge

2020-02-10 Thread Jacques Lucke
Commit: 003dc7ffc9e9eed43a02ec7662117df21c80356c
Author: Jacques Lucke
Date:   Mon Feb 10 12:26:14 2020 +0100
Branches: functions
https://developer.blender.org/rB003dc7ffc9e9eed43a02ec7662117df21c80356c

fix after merge

===

M   source/blender/blenkernel/BKE_deform.h

===

diff --git a/source/blender/blenkernel/BKE_deform.h 
b/source/blender/blenkernel/BKE_deform.h
index b5468587fa2..ca06716599c 100644
--- a/source/blender/blenkernel/BKE_deform.h
+++ b/source/blender/blenkernel/BKE_deform.h
@@ -29,10 +29,6 @@ extern "C" {
  * \brief support for deformation groups and hooks.
  */
 
-#ifdef __cplusplus
-extern "C" {
-#endif
-
 struct ListBase;
 struct MDeformVert;
 struct MEdge;

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


[Bf-blender-cvs] [605928c15b0] functions: Merge branch 'master' into functions

2020-02-10 Thread Jacques Lucke
Commit: 605928c15b0748068137c620e1894112b838baf2
Author: Jacques Lucke
Date:   Mon Feb 10 12:01:07 2020 +0100
Branches: functions
https://developer.blender.org/rB605928c15b0748068137c620e1894112b838baf2

Merge branch 'master' into functions

===



===

diff --cc source/blender/makesdna/DNA_modifier_types.h
index fb09a608b6e,2c0d34fdccf..0510f03fa4c
--- a/source/blender/makesdna/DNA_modifier_types.h
+++ b/source/blender/makesdna/DNA_modifier_types.h
@@@ -2033,66 -2046,8 +2050,70 @@@ enum 
  #define MOD_MESHSEQ_READ_ALL \
(MOD_MESHSEQ_READ_VERT | MOD_MESHSEQ_READ_POLY | MOD_MESHSEQ_READ_UV | 
MOD_MESHSEQ_READ_COLOR)
  
 +typedef struct FunctionDeformModifierData {
 +  ModifierData modifier;
 +  float control1;
 +  int control2;
 +  struct bNodeTree *function_tree;
 +} FunctionDeformModifierData;
 +
 +typedef struct FunctionPointsModifierData {
 +  ModifierData modifier;
 +  float control1;
 +  int control2;
 +  struct bNodeTree *function_tree;
 +} FunctionPointsModifierData;
 +
 +typedef struct BParticlesAttributeCacheFloat {
 +  char name[64];
 +  unsigned int floats_per_particle;
 +  char _pad[4];
 +  float *values;
 +} BParticlesAttributeCacheFloat;
 +
 +typedef struct BParticlesTypeCache {
 +  char name[64];
 +  unsigned int particle_amount;
 +
 +  unsigned int num_attributes_float;
 +  BParticlesAttributeCacheFloat *attributes_float;
 +} BParticlesTypeCache;
 +
 +typedef struct BParticlesFrameCache {
 +  unsigned int num_particle_types;
 +  float frame;
 +  BParticlesTypeCache *particle_types;
 +} BParticlesFrameCache;
 +
 +typedef enum eBParticlesOutputType {
 +  MOD_BPARTICLES_OUTPUT_POINTS,
 +  MOD_BPARTICLES_OUTPUT_TETRAHEDONS,
 +  MOD_BPARTICLES_OUTPUT_NONE,
 +} eBParticlesOutputType;
 +
 +typedef struct BParticlesModifierData {
 +  ModifierData modifier;
 +
 +  /* eBParticlesOutputType */
 +  unsigned int output_type;
 +
 +  unsigned int num_cached_frames;
 +  struct bNodeTree *node_tree;
 +  BParticlesFrameCache *cached_frames;
 +} BParticlesModifierData;
 +
 +typedef struct BParticlesOutputModifierData {
 +  ModifierData modifier;
 +  struct Object *source_object;
 +  char source_particle_system[64];
 +
 +  /* eBParticlesOutputType */
 +  unsigned int output_type;
 +  char _pad[4];
 +} BParticlesOutputModifierData;
 +
+ #ifdef __cplusplus
+ }
+ #endif
+ 
  #endif /* __DNA_MODIFIER_TYPES_H__ */

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


[Bf-blender-cvs] [9677fbe0292] functions: rename MonotonicAllocator to LinearAllocator

2020-02-10 Thread Jacques Lucke
Commit: 9677fbe029283377e04b6168f0e3186802039e62
Author: Jacques Lucke
Date:   Mon Feb 10 10:51:18 2020 +0100
Branches: functions
https://developer.blender.org/rB9677fbe029283377e04b6168f0e3186802039e62

rename MonotonicAllocator to LinearAllocator

===

M   source/blender/blenkernel/BKE_virtual_node_tree.h
R094source/blender/blenlib/BLI_monotonic_allocator.h
source/blender/blenlib/BLI_linear_allocator.h
M   source/blender/blenlib/BLI_multi_map.h
M   source/blender/blenlib/BLI_resource_collector.h
M   source/blender/blenlib/CMakeLists.txt
M   source/blender/functions/FN_attributes_ref.h
M   source/blender/functions/FN_generic_vector_array.h
M   source/blender/functions/FN_multi_function_network.h
M   source/blender/functions/FN_node_tree.h
M   source/blender/functions/intern/multi_functions/network.cc
R094tests/gtests/blenlib/BLI_monotonic_allocator_test.cc
tests/gtests/blenlib/BLI_linear_allocator_test.cc
M   tests/gtests/blenlib/CMakeLists.txt

===

diff --git a/source/blender/blenkernel/BKE_virtual_node_tree.h 
b/source/blender/blenkernel/BKE_virtual_node_tree.h
index 51c826b963b..d253e149cb8 100644
--- a/source/blender/blenkernel/BKE_virtual_node_tree.h
+++ b/source/blender/blenkernel/BKE_virtual_node_tree.h
@@ -121,7 +121,7 @@ class VNode : BLI::NonCopyable, BLI::NonMovable {
 
 class VirtualNodeTree : BLI::NonCopyable, BLI::NonMovable {
  private:
-  BLI::MonotonicAllocator<> m_allocator;
+  BLI::LinearAllocator<> m_allocator;
   bNodeTree *m_btree;
   Vector m_nodes_by_id;
   Vector m_sockets_by_id;
diff --git a/source/blender/blenlib/BLI_monotonic_allocator.h 
b/source/blender/blenlib/BLI_linear_allocator.h
similarity index 94%
rename from source/blender/blenlib/BLI_monotonic_allocator.h
rename to source/blender/blenlib/BLI_linear_allocator.h
index 838342678ec..60d19591855 100644
--- a/source/blender/blenlib/BLI_monotonic_allocator.h
+++ b/source/blender/blenlib/BLI_linear_allocator.h
@@ -17,7 +17,7 @@
 /** \file
  * \ingroup bli
  *
- * A monotonic allocator is the simplest form of an allocator. It never reuses 
any memory, and
+ * A linear allocator is the simplest form of an allocator. It never reuses 
any memory, and
  * therefore does not need a deallocation method. It simply hands out 
consecutive buffers of
  * memory. When the current buffer is full, it reallocates a new larger buffer 
and continues.
  */
@@ -32,7 +32,7 @@
 namespace BLI {
 
 template
-class MonotonicAllocator : NonCopyable, NonMovable {
+class LinearAllocator : NonCopyable, NonMovable {
  private:
   Allocator m_allocator;
   Vector m_pointers;
@@ -48,12 +48,12 @@ class MonotonicAllocator : NonCopyable, NonMovable {
 #endif
 
  public:
-  MonotonicAllocator() : m_remaining_capacity(N), 
m_next_min_alloc_size(std::max(N * 2, 16))
+  LinearAllocator() : m_remaining_capacity(N), 
m_next_min_alloc_size(std::max(N * 2, 16))
   {
 m_current_buffer = m_inline_buffer.ptr();
   }
 
-  ~MonotonicAllocator()
+  ~LinearAllocator()
   {
 for (void *ptr : m_pointers) {
   m_allocator.deallocate(ptr);
diff --git a/source/blender/blenlib/BLI_multi_map.h 
b/source/blender/blenlib/BLI_multi_map.h
index dcd1665519e..bb98da6d3d4 100644
--- a/source/blender/blenlib/BLI_multi_map.h
+++ b/source/blender/blenlib/BLI_multi_map.h
@@ -25,7 +25,7 @@
 #include "BLI_map.h"
 #include "BLI_array_ref.h"
 #include "BLI_vector.h"
-#include "BLI_monotonic_allocator.h"
+#include "BLI_linear_allocator.h"
 
 namespace BLI {
 
@@ -37,7 +37,7 @@ template class 
MultiMap {
 uint capacity = 0;
   };
 
-  MonotonicAllocator m_allocator;
+  LinearAllocator m_allocator;
   Map m_map;
 
  public:
diff --git a/source/blender/blenlib/BLI_resource_collector.h 
b/source/blender/blenlib/BLI_resource_collector.h
index b2e3bd3d225..aaae164bb4b 100644
--- a/source/blender/blenlib/BLI_resource_collector.h
+++ b/source/blender/blenlib/BLI_resource_collector.h
@@ -4,7 +4,7 @@
 #include "BLI_vector.h"
 #include "BLI_utility_mixins.h"
 #include "BLI_string_ref.h"
-#include "BLI_monotonic_allocator.h"
+#include "BLI_linear_allocator.h"
 
 namespace BLI {
 
@@ -16,7 +16,7 @@ class ResourceCollector : NonCopyable {
 const char *name;
   };
 
-  MonotonicAllocator<> m_allocator;
+  LinearAllocator<> m_allocator;
   Vector m_resources;
 
  public:
@@ -64,7 +64,7 @@ class ResourceCollector : NonCopyable {
 return m_allocator.allocate(size, alignment);
   }
 
-  MonotonicAllocator<> ()
+  LinearAllocator<> ()
   {
 return m_allocator;
   }
diff --git a/source/blender/blenlib/CMakeLists.txt 
b/source/blender/blenlib/CMakeLists.txt
index 83b86d265ea..ec4a2f0e8c8 100644
--- a/source/blender/blenlib/CMakeLists.txt
+++ b/source/blender/blenlib/CMakeLists.txt
@@ -262,7 +262,7 @@ set(SRC
   BLI_lazy_init_cxx.h
   intern/BLI_lazy_init.cc
   BLI_math_cxx.h
-  BLI_monotonic_allocator.h

[Bf-blender-cvs] [6989f9be3d0] functions: add StringRef.substr method

2020-02-10 Thread Jacques Lucke
Commit: 6989f9be3d0fdb0d3071c60bfb04927976576e52
Author: Jacques Lucke
Date:   Mon Feb 10 09:53:33 2020 +0100
Branches: functions
https://developer.blender.org/rB6989f9be3d0fdb0d3071c60bfb04927976576e52

add StringRef.substr method

===

M   source/blender/blenlib/BLI_string_ref.h
M   tests/gtests/blenlib/BLI_string_ref_test.cc

===

diff --git a/source/blender/blenlib/BLI_string_ref.h 
b/source/blender/blenlib/BLI_string_ref.h
index 76163a2754c..54c2f0e7209 100644
--- a/source/blender/blenlib/BLI_string_ref.h
+++ b/source/blender/blenlib/BLI_string_ref.h
@@ -109,6 +109,8 @@ class StringRefBase {
* Returns true when the string ends with the given suffix. Otherwise false.
*/
   bool endswith(StringRef suffix) const;
+
+  StringRef substr(uint start, uint size) const;
 };
 
 /**
@@ -242,6 +244,12 @@ inline bool StringRefBase::endswith(StringRef suffix) const
   return true;
 }
 
+inline StringRef StringRefBase::substr(uint start, uint size) const
+{
+  BLI_assert(start + size <= m_size);
+  return StringRef(m_data + start, size);
+}
+
 }  // namespace BLI
 
 #endif /* __BLI_STRING_REF_H__ */
diff --git a/tests/gtests/blenlib/BLI_string_ref_test.cc 
b/tests/gtests/blenlib/BLI_string_ref_test.cc
index 5605e10ac86..38a970455c0 100644
--- a/tests/gtests/blenlib/BLI_string_ref_test.cc
+++ b/tests/gtests/blenlib/BLI_string_ref_test.cc
@@ -228,3 +228,12 @@ TEST(string_ref, DropPrefix)
   EXPECT_EQ(ref2.size(), 1);
   EXPECT_EQ(ref2, "t");
 }
+
+TEST(string_ref, Substr)
+{
+  StringRef ref("hello world");
+  EXPECT_EQ(ref.substr(0, 5), "hello");
+  EXPECT_EQ(ref.substr(4, 0), "");
+  EXPECT_EQ(ref.substr(3, 4), "lo w");
+  EXPECT_EQ(ref.substr(6, 5), "world");
+}

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


[Bf-blender-cvs] [af389e89f20] temp-sybren-anim-cleanup: Feedback from @Sergey: use `EXPECT_NEAR` instead of `EXPECT_FLOAT_EQ`.

2020-02-10 Thread Sybren A. Stüvel
Commit: af389e89f204a658d7c5d86b752d7107c85f61e4
Author: Sybren A. Stüvel
Date:   Mon Feb 10 12:21:43 2020 +0100
Branches: temp-sybren-anim-cleanup
https://developer.blender.org/rBaf389e89f204a658d7c5d86b752d7107c85f61e4

Feedback from @Sergey: use `EXPECT_NEAR` instead of `EXPECT_FLOAT_EQ`.

===

M   tests/gtests/blenkernel/BKE_fcurve_test.cc

===

diff --git a/tests/gtests/blenkernel/BKE_fcurve_test.cc 
b/tests/gtests/blenkernel/BKE_fcurve_test.cc
index ac9ba5191dd..d5a78d5cfbc 100644
--- a/tests/gtests/blenkernel/BKE_fcurve_test.cc
+++ b/tests/gtests/blenkernel/BKE_fcurve_test.cc
@@ -26,6 +26,9 @@ extern "C" {
 #include "DNA_anim_types.h"
 }
 
+// Epsilon for floating point comparisons.
+static const float eps = 1e-7;
+
 TEST(evaluate_fcurve, EmptyFCurve)
 {
   FCurve *fcu = static_cast(MEM_callocN(sizeof(FCurve), "FCurve"));
@@ -41,16 +44,16 @@ TEST(evaluate_fcurve, OnKeys)
   insert_vert_fcurve(fcu, 2.0f, 13.0f, BEZT_KEYTYPE_KEYFRAME, 
INSERTKEY_NO_USERPREF);
   insert_vert_fcurve(fcu, 3.0f, 19.0f, BEZT_KEYTYPE_KEYFRAME, 
INSERTKEY_NO_USERPREF);
 
-  EXPECT_FLOAT_EQ(evaluate_fcurve(fcu, 1.0f), 7.0f);   // hits 'on or before 
first' function
-  EXPECT_FLOAT_EQ(evaluate_fcurve(fcu, 2.0f), 13.0f);  // hits 'between' 
function
-  EXPECT_FLOAT_EQ(evaluate_fcurve(fcu, 3.0f), 19.0f);  // hits 'on or after 
last' function
+  EXPECT_NEAR(evaluate_fcurve(fcu, 1.0f), 7.0f, eps);   // hits 'on or before 
first' function
+  EXPECT_NEAR(evaluate_fcurve(fcu, 2.0f), 13.0f, eps);  // hits 'between' 
function
+  EXPECT_NEAR(evaluate_fcurve(fcu, 3.0f), 19.0f, eps);  // hits 'on or after 
last' function
 
   /* Also test within an epsilon of the keys, as this was an issue in T39207.
* This epsilon is just slightly smaller than the epsilon given to 
binarysearch_bezt_index_ex()
* in fcurve_eval_between_keyframes(), so it should hit the "exact" code 
path. */
   float epsilon = 0.8f;
-  EXPECT_FLOAT_EQ(evaluate_fcurve(fcu, 2.0f - epsilon), 13.0f);
-  EXPECT_FLOAT_EQ(evaluate_fcurve(fcu, 2.0f + epsilon), 13.0f);
+  EXPECT_NEAR(evaluate_fcurve(fcu, 2.0f - epsilon), 13.0f, eps);
+  EXPECT_NEAR(evaluate_fcurve(fcu, 2.0f + epsilon), 13.0f, eps);
 
   free_fcurve(fcu);
 }
@@ -65,8 +68,8 @@ TEST(evaluate_fcurve, InterpolationConstant)
   fcu->bezt[0].ipo = BEZT_IPO_CONST;
   fcu->bezt[1].ipo = BEZT_IPO_CONST;
 
-  EXPECT_FLOAT_EQ(evaluate_fcurve(fcu, 1.25f), 7.0f);
-  EXPECT_FLOAT_EQ(evaluate_fcurve(fcu, 1.50f), 7.0f);
+  EXPECT_NEAR(evaluate_fcurve(fcu, 1.25f), 7.0f, eps);
+  EXPECT_NEAR(evaluate_fcurve(fcu, 1.50f), 7.0f, eps);
 
   free_fcurve(fcu);
 }
@@ -81,9 +84,9 @@ TEST(evaluate_fcurve, InterpolationLinear)
   fcu->bezt[0].ipo = BEZT_IPO_LIN;
   fcu->bezt[1].ipo = BEZT_IPO_LIN;
 
-  EXPECT_FLOAT_EQ(evaluate_fcurve(fcu, 1.25f), 8.5f);
-  EXPECT_FLOAT_EQ(evaluate_fcurve(fcu, 1.50f), 10.0f);
-  EXPECT_FLOAT_EQ(evaluate_fcurve(fcu, 1.75f), 11.5f);
+  EXPECT_NEAR(evaluate_fcurve(fcu, 1.25f), 8.5f, eps);
+  EXPECT_NEAR(evaluate_fcurve(fcu, 1.50f), 10.0f, eps);
+  EXPECT_NEAR(evaluate_fcurve(fcu, 1.75f), 11.5f, eps);
 
   free_fcurve(fcu);
 }
@@ -99,9 +102,9 @@ TEST(evaluate_fcurve, InterpolationBezier)
   EXPECT_EQ(fcu->bezt[1].ipo, BEZT_IPO_BEZ);
 
   // Test with default handles.
-  EXPECT_FLOAT_EQ(evaluate_fcurve(fcu, 1.25f), 7.8297067f);
-  EXPECT_FLOAT_EQ(evaluate_fcurve(fcu, 1.50f), 10.0f);
-  EXPECT_FLOAT_EQ(evaluate_fcurve(fcu, 1.75f), 12.170294f);
+  EXPECT_NEAR(evaluate_fcurve(fcu, 1.25f), 7.8297067f, eps);
+  EXPECT_NEAR(evaluate_fcurve(fcu, 1.50f), 10.0f, eps);
+  EXPECT_NEAR(evaluate_fcurve(fcu, 1.75f), 12.170294f, eps);
 
   // Test with modified handles.
   fcu->bezt[0].vec[0][0] = 0.71855f;  // left handle X
@@ -114,9 +117,9 @@ TEST(evaluate_fcurve, InterpolationBezier)
   fcu->bezt[1].vec[2][0] = 2.3f;  // right handle X
   fcu->bezt[1].vec[2][1] = 15.5864f;  // right handle Y
 
-  EXPECT_FLOAT_EQ(evaluate_fcurve(fcu, 1.25f), 7.945497f);
-  EXPECT_FLOAT_EQ(evaluate_fcurve(fcu, 1.50f), 9.3495407f);
-  EXPECT_FLOAT_EQ(evaluate_fcurve(fcu, 1.75f), 11.088551f);
+  EXPECT_NEAR(evaluate_fcurve(fcu, 1.25f), 7.945497f, eps);
+  EXPECT_NEAR(evaluate_fcurve(fcu, 1.50f), 9.3495407f, eps);
+  EXPECT_NEAR(evaluate_fcurve(fcu, 1.75f), 11.088551f, eps);
 
   free_fcurve(fcu);
 }
@@ -134,9 +137,9 @@ TEST(evaluate_fcurve, InterpolationBounce)
   fcu->bezt[0].easing = BEZT_IPO_EASE_IN;
   fcu->bezt[1].easing = BEZT_IPO_EASE_AUTO;
 
-  EXPECT_FLOAT_EQ(evaluate_fcurve(fcu, 1.4f), 8.3649998f);
-  EXPECT_FLOAT_EQ(evaluate_fcurve(fcu, 1.5f), 8.4062500f);
-  EXPECT_FLOAT_EQ(evaluate_fcurve(fcu, 1.8f), 11.184999f);
+  EXPECT_NEAR(evaluate_fcurve(fcu, 1.4f), 8.3649998f, eps);
+  EXPECT_NEAR(evaluate_fcurve(fcu, 1.5f), 8.4062500f, eps);
+  EXPECT_NEAR(evaluate_fcurve(fcu, 1.8f), 11.184999f, eps);
 
   free_fcurve(fcu);
 }
@@ -152,20 +155,20 @@ TEST(evaluate_fcurve, ExtrapolationLinearKeys)
 
 

[Bf-blender-cvs] [b0e56c3da55] temp-sybren-anim-cleanup: Merge remote-tracking branch 'origin/master' into temp-sybren-anim-cleanup

2020-02-10 Thread Sybren A. Stüvel
Commit: b0e56c3da557dfe08109bc8ce9aa90c266103090
Author: Sybren A. Stüvel
Date:   Mon Feb 10 11:48:36 2020 +0100
Branches: temp-sybren-anim-cleanup
https://developer.blender.org/rBb0e56c3da557dfe08109bc8ce9aa90c266103090

Merge remote-tracking branch 'origin/master' into temp-sybren-anim-cleanup

===



===



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


[Bf-blender-cvs] [14d1dc5df56] master: Fix T61138: Difficulty in aligning handles of Stroke of type Curve

2020-02-10 Thread mano-wii
Commit: 14d1dc5df565bdd3970579b31da9b2a26c306448
Author: mano-wii
Date:   Mon Feb 10 08:17:26 2020 -0300
Branches: master
https://developer.blender.org/rB14d1dc5df565bdd3970579b31da9b2a26c306448

Fix T61138: Difficulty in aligning handles of Stroke of type Curve

The user has preference to select the center point for alignment.
But in this case, it was not available for selection.

Also prioritizes selection of the middle point over the handles.

Reviewed By: #user_interface, brecht

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

===

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

===

diff --git a/source/blender/editors/sculpt_paint/paint_curve.c 
b/source/blender/editors/sculpt_paint/paint_curve.c
index 62c31c91f8d..8a98b15088f 100644
--- a/source/blender/editors/sculpt_paint/paint_curve.c
+++ b/source/blender/editors/sculpt_paint/paint_curve.c
@@ -87,39 +87,35 @@ static PaintCurvePoint *paintcurve_point_get_closest(
 {
   PaintCurvePoint *pcp, *closest = NULL;
   int i;
-  float dist, closest_dist = FLT_MAX;
+  float closest_dist = threshold;
 
   for (i = 0, pcp = pc->points; i < pc->tot_points; i++, pcp++) {
-dist = len_manhattan_v2v2(pos, pcp->bez.vec[0]);
-if (dist < threshold) {
-  if (dist < closest_dist) {
-closest = pcp;
-closest_dist = dist;
-if (point) {
-  *point = SEL_F1;
-}
-  }
+float dist[3];
+char point_sel = 0;
+
+dist[0] = len_manhattan_v2v2(pos, pcp->bez.vec[0]);
+dist[1] = len_manhattan_v2v2(pos, pcp->bez.vec[1]);
+dist[2] = len_manhattan_v2v2(pos, pcp->bez.vec[2]);
+
+if (dist[1] < closest_dist) {
+  closest_dist = dist[1];
+  point_sel = SEL_F2;
 }
-if (!ignore_pivot) {
-  dist = len_manhattan_v2v2(pos, pcp->bez.vec[1]);
-  if (dist < threshold) {
-if (dist < closest_dist) {
-  closest = pcp;
-  closest_dist = dist;
-  if (point) {
-*point = SEL_F2;
-  }
-}
-  }
+if (dist[0] < closest_dist) {
+  closest_dist = dist[0];
+  point_sel = SEL_F1;
+}
+if (dist[2] < closest_dist) {
+  closest_dist = dist[2];
+  point_sel = SEL_F3;
 }
-dist = len_manhattan_v2v2(pos, pcp->bez.vec[2]);
-if (dist < threshold) {
-  if (dist < closest_dist) {
-closest = pcp;
-closest_dist = dist;
-if (point) {
-  *point = SEL_F3;
+if (point_sel) {
+  closest = pcp;
+  if (point) {
+if (ignore_pivot && point_sel == SEL_F2) {
+  point_sel = (dist[0] < dist[2]) ? SEL_F1 : SEL_F3;
 }
+*point = point_sel;
   }
 }
   }

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


[Bf-blender-cvs] [795c4a34625] master: GPencil: Fix unreported missing annotation popover menu

2020-02-10 Thread Antonio Vazquez
Commit: 795c4a3462536d1e780b227d6877a8693f656cf9
Author: Antonio Vazquez
Date:   Mon Feb 10 11:55:49 2020 +0100
Branches: master
https://developer.blender.org/rB795c4a3462536d1e780b227d6877a8693f656cf9

GPencil: Fix unreported missing annotation popover menu

This was introduced when annotations was splited.

===

M   release/scripts/startup/bl_ui/space_toolsystem_toolbar.py

===

diff --git a/release/scripts/startup/bl_ui/space_toolsystem_toolbar.py 
b/release/scripts/startup/bl_ui/space_toolsystem_toolbar.py
index c1ad196b555..13b8dced08c 100644
--- a/release/scripts/startup/bl_ui/space_toolsystem_toolbar.py
+++ b/release/scripts/startup/bl_ui/space_toolsystem_toolbar.py
@@ -144,11 +144,7 @@ class _defs_view3d_generic:
 class _defs_annotate:
 
 def draw_settings_common(context, layout, tool):
-if type(context.gpencil_data_owner) is bpy.types.Object:
-gpd = context.scene.grease_pencil
-else:
-gpd = context.gpencil_data
-
+gpd = context.annotation_data
 if gpd is not None:
 if gpd.layers.active_note is not None:
 text = gpd.layers.active_note
@@ -158,7 +154,7 @@ class _defs_annotate:
 else:
 text = ""
 
-gpl = context.active_gpencil_layer
+gpl = context.active_annotation_layer
 if gpl is not None:
 layout.label(text="Annotation:")
 sub = layout.row(align=True)

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


[Bf-blender-cvs] [ade92dc98d4] greasepencil-refactor: GPencil: Add option to add mask layer one by one

2020-02-10 Thread Antonio Vazquez
Commit: ade92dc98d4326d2e00153c3d378d793d22d7b5d
Author: Antonio Vazquez
Date:   Mon Feb 10 11:29:32 2020 +0100
Branches: greasepencil-refactor
https://developer.blender.org/rBade92dc98d4326d2e00153c3d378d793d22d7b5d

GPencil: Add option to add mask layer one by one

Now it uses a list of layer using a pure dynamic enum list.

===

M   release/scripts/startup/bl_ui/properties_data_gpencil.py
M   release/scripts/startup/bl_ui/properties_grease_pencil_common.py
M   release/scripts/startup/bl_ui/space_dopesheet.py
M   source/blender/editors/gpencil/gpencil_data.c
M   source/blender/makesdna/DNA_gpencil_types.h
M   source/blender/makesrna/intern/rna_gpencil.c

===

diff --git a/release/scripts/startup/bl_ui/properties_data_gpencil.py 
b/release/scripts/startup/bl_ui/properties_data_gpencil.py
index cb15a843533..32026f800cf 100644
--- a/release/scripts/startup/bl_ui/properties_data_gpencil.py
+++ b/release/scripts/startup/bl_ui/properties_data_gpencil.py
@@ -22,6 +22,7 @@ from bpy.types import Menu, Panel, UIList
 from rna_prop_ui import PropertyPanel
 
 from bl_ui.properties_grease_pencil_common import (
+GreasePencilLayerMasksPanel,
 GreasePencilLayerAdjustmentsPanel,
 GreasePencilLayerRelationsPanel,
 GreasePencilLayerDisplayPanel,
@@ -182,6 +183,12 @@ class DATA_PT_gpencil_layers(DataButtonsPanel, Panel):
 col.prop(gpl, "use_lights")
 
 
+class DATA_PT_gpencil_layer_masks(LayerDataButtonsPanel, 
GreasePencilLayerMasksPanel, Panel):
+bl_label = "Masks"
+bl_parent_id = 'DATA_PT_gpencil_layers'
+bl_options = {'DEFAULT_CLOSED'}
+
+
 class DATA_PT_gpencil_layer_adjustments(LayerDataButtonsPanel, 
GreasePencilLayerAdjustmentsPanel, Panel):
 bl_label = "Adjustments"
 bl_parent_id = 'DATA_PT_gpencil_layers'
@@ -308,38 +315,6 @@ class GPENCIL_UL_vgroups(UIList):
 layout.label(text="", icon_value=icon)
 
 
-class GPENCIL_UL_masks(UIList):
-def draw_item(self, _context, layout, _data, item, icon, _active_data, 
_active_propname, _index):
-mask = item
-if self.layout_type in {'DEFAULT', 'COMPACT'}:
-layout.prop(mask, "name", text="", emboss=False, icon_value=icon)
-elif self.layout_type == 'GRID':
-layout.alignment = 'CENTER'
-layout.prop(mask, "name", text="", emboss=False, icon_value=icon)
-
-
-class DATA_PT_gpencil_layer_masks(ObjectButtonsPanel, Panel):
-bl_label = "Masks"
-bl_parent_id = 'DATA_PT_gpencil_layers'
-bl_options = {'DEFAULT_CLOSED'}
-
-def draw(self, context):
-layout = self.layout
-ob = context.active_object
-gpd = ob.data
-gpl = gpd.layers.active
-if gpl:
-row = layout.row()
-row.prop(gpl, "invert_mask")
-
-rows = 4
-row = layout.row()
-row.template_list("GPENCIL_UL_masks", "", gpl, "mask_layers", 
gpl.mask_layers, "active_mask_index", rows=rows)
-col = row.column(align=True)
-col.operator("gpencil.layer_mask_add", icon="ADD", text="")
-col.operator("gpencil.layer_mask_remove", icon='REMOVE', text="")
-
-
 class DATA_PT_gpencil_vertex_groups(ObjectButtonsPanel, Panel):
 bl_label = "Vertex Groups"
 bl_options = {'DEFAULT_CLOSED'}
@@ -448,10 +423,10 @@ class DATA_PT_custom_props_gpencil(DataButtonsPanel, 
PropertyPanel, Panel):
 classes = (
 DATA_PT_context_gpencil,
 DATA_PT_gpencil_layers,
-DATA_PT_gpencil_layer_masks,
 DATA_PT_gpencil_onion_skinning,
 DATA_PT_gpencil_onion_skinning_custom_colors,
 DATA_PT_gpencil_onion_skinning_display,
+DATA_PT_gpencil_layer_masks,
 DATA_PT_gpencil_layer_adjustments,
 DATA_PT_gpencil_layer_relations,
 DATA_PT_gpencil_layer_display,
@@ -462,7 +437,6 @@ classes = (
 DATA_PT_custom_props_gpencil,
 
 GPENCIL_UL_vgroups,
-GPENCIL_UL_masks,
 
 GPENCIL_MT_layer_context_menu,
 GPENCIL_MT_gpencil_vertex_group,
diff --git a/release/scripts/startup/bl_ui/properties_grease_pencil_common.py 
b/release/scripts/startup/bl_ui/properties_grease_pencil_common.py
index 76f498ed195..ddb059e7cbf 100644
--- a/release/scripts/startup/bl_ui/properties_grease_pencil_common.py
+++ b/release/scripts/startup/bl_ui/properties_grease_pencil_common.py
@@ -769,6 +769,38 @@ class GreasePencilLayerAdjustmentsPanel:
 col = layout.row(align=True)
 col.prop(gpl, "lock_material")
 
+class GPENCIL_UL_masks(UIList):
+def draw_item(self, _context, layout, _data, item, icon, _active_data, 
_active_propname, _index):
+mask = item
+if self.layout_type in {'DEFAULT', 'COMPACT'}:
+layout.prop(mask, "name", text="", emboss=False, icon_value=icon)
+elif self.layout_type == 'GRID':
+layout.alignment = 'CENTER'
+layout.prop(mask, "name", text="", 

[Bf-blender-cvs] [956fd64653b] master: Cycles: Fix linking error of new avxf unit tests

2020-02-10 Thread Sergey Sharybin
Commit: 956fd64653b0e894eeecf99d48ba7c3bd9f3cb16
Author: Sergey Sharybin
Date:   Mon Feb 10 11:13:08 2020 +0100
Branches: master
https://developer.blender.org/rB956fd64653b0e894eeecf99d48ba7c3bd9f3cb16

Cycles: Fix linking error of new avxf unit tests

Was happening on macOS. The reason of this is because OpenImageIO
depends on boost, so it is to be passed to the linker after the
OpenImageIO libraries.

===

M   intern/cycles/test/CMakeLists.txt

===

diff --git a/intern/cycles/test/CMakeLists.txt 
b/intern/cycles/test/CMakeLists.txt
index 3233e545287..dc7e40c0039 100644
--- a/intern/cycles/test/CMakeLists.txt
+++ b/intern/cycles/test/CMakeLists.txt
@@ -100,11 +100,11 @@ set(CMAKE_EXE_LINKER_FLAGS_DEBUG 
"${CMAKE_EXE_LINKER_FLAGS_DEBUG} ${PLATFORM_LIN
 
 CYCLES_TEST(render_graph_finalize "${ALL_CYCLES_LIBRARIES};bf_intern_numaapi")
 CYCLES_TEST(util_aligned_malloc "cycles_util")
-CYCLES_TEST(util_path 
"cycles_util;${BOOST_LIBRARIES};${OPENIMAGEIO_LIBRARIES}")
-CYCLES_TEST(util_string 
"cycles_util;${BOOST_LIBRARIES};${OPENIMAGEIO_LIBRARIES}")
-CYCLES_TEST(util_task 
"cycles_util;${BOOST_LIBRARIES};${OPENIMAGEIO_LIBRARIES};bf_intern_numaapi")
-CYCLES_TEST(util_time 
"cycles_util;${BOOST_LIBRARIES};${OPENIMAGEIO_LIBRARIES}")
+CYCLES_TEST(util_path 
"cycles_util;${OPENIMAGEIO_LIBRARIES};${BOOST_LIBRARIES}")
+CYCLES_TEST(util_string 
"cycles_util;${OPENIMAGEIO_LIBRARIES};${BOOST_LIBRARIES}")
+CYCLES_TEST(util_task 
"cycles_util;${OPENIMAGEIO_LIBRARIES};${BOOST_LIBRARIES};bf_intern_numaapi")
+CYCLES_TEST(util_time 
"cycles_util;${OPENIMAGEIO_LIBRARIES};${BOOST_LIBRARIES}")
 set_source_files_properties(util_avxf_avx_test.cpp PROPERTIES COMPILE_FLAGS 
"${CYCLES_AVX_KERNEL_FLAGS}")
-CYCLES_TEST(util_avxf_avx 
"cycles_util;bf_intern_numaapi;${OPENIMAGEIO_LIBRARIES}")
+CYCLES_TEST(util_avxf_avx 
"cycles_util;bf_intern_numaapi;${OPENIMAGEIO_LIBRARIES};${BOOST_LIBRARIES}")
 set_source_files_properties(util_avxf_avx2_test.cpp PROPERTIES COMPILE_FLAGS 
"${CYCLES_AVX2_KERNEL_FLAGS}")
-CYCLES_TEST(util_avxf_avx2 
"cycles_util;bf_intern_numaapi;${OPENIMAGEIO_LIBRARIES}")
+CYCLES_TEST(util_avxf_avx2 
"cycles_util;bf_intern_numaapi;${OPENIMAGEIO_LIBRARIES};${BOOST_LIBRARIES}")

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


[Bf-blender-cvs] [39b3327490c] master: Fix: Missed this line in last commit

2020-02-10 Thread William Reynish
Commit: 39b3327490c6f1b34ac516dce86a4148cad61ef1
Author: William Reynish
Date:   Mon Feb 10 11:04:34 2020 +0100
Branches: master
https://developer.blender.org/rB39b3327490c6f1b34ac516dce86a4148cad61ef1

Fix: Missed this line in last commit

===

M   release/scripts/startup/bl_ui/properties_data_bone.py

===

diff --git a/release/scripts/startup/bl_ui/properties_data_bone.py 
b/release/scripts/startup/bl_ui/properties_data_bone.py
index 4eb93f0f93c..aca358870c8 100644
--- a/release/scripts/startup/bl_ui/properties_data_bone.py
+++ b/release/scripts/startup/bl_ui/properties_data_bone.py
@@ -456,6 +456,7 @@ classes = (
 BONE_PT_inverse_kinematics,
 BONE_PT_deform,
 BONE_PT_display,
+BONE_PT_display_custom_shape,
 BONE_PT_custom_props,
 )

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


[Bf-blender-cvs] [6a841acab63] master: UI: Bone Custom Shape layout

2020-02-10 Thread William Reynish
Commit: 6a841acab637c6e614bfcf17de8452bebd3f6c20
Author: William Reynish
Date:   Mon Feb 10 10:53:59 2020 +0100
Branches: master
https://developer.blender.org/rB6a841acab637c6e614bfcf17de8452bebd3f6c20

UI: Bone Custom Shape layout

The layout was somewhat poor - hard to see what relates to the custom object, 
and also weirdly we show the Wireframe toggle above the Custom Object control, 
even though it can only be active if a bone has a custom object set.

Instead, I grouped everything in a Custom Shape sub-panel and used greying out.

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

Reviewed by Brecht van Lommel

===

M   release/scripts/startup/bl_ui/properties_data_bone.py

===

diff --git a/release/scripts/startup/bl_ui/properties_data_bone.py 
b/release/scripts/startup/bl_ui/properties_data_bone.py
index c50b9414667..4eb93f0f93c 100644
--- a/release/scripts/startup/bl_ui/properties_data_bone.py
+++ b/release/scripts/startup/bl_ui/properties_data_bone.py
@@ -268,18 +268,43 @@ class BONE_PT_display(BoneButtonsPanel, Panel):
 
 col = layout.column()
 col.prop(bone, "hide", text="Hide")
+
+
+class BONE_PT_display_custom_shape(BoneButtonsPanel, Panel):
+bl_label = "Custom Shape"
+bl_parent_id = "BONE_PT_display"
+
+@classmethod
+def poll(cls, context):
+return context.bone
+
+def draw(self, context):
+layout = self.layout
+layout.use_property_split = True
+
+ob = context.object
+bone = context.bone
+pchan = None
+
+if ob and bone:
+pchan = ob.pose.bones[bone.name]
+elif bone is None:
+bone = context.edit_bone
+
+if bone and pchan:
+col = layout.column()
+col.prop(pchan, "custom_shape")
+
 sub = col.column()
 sub.active = bool(pchan and pchan.custom_shape)
+sub.separator()
+sub.prop(pchan, "custom_shape_scale", text="Scale")
+sub.prop_search(pchan, "custom_shape_transform",
+ob.pose, "bones", text="Override Transform")
+sub.prop(pchan, "use_custom_shape_bone_size")
+sub.separator()
 sub.prop(bone, "show_wire", text="Wireframe")
 
-if pchan:
-col = layout.column()
-col.prop(pchan, "custom_shape")
-if pchan.custom_shape:
-col.prop(pchan, "use_custom_shape_bone_size", text="Bone 
Size")
-col.prop(pchan, "custom_shape_scale", text="Scale")
-col.prop_search(pchan, "custom_shape_transform", ob.pose, 
"bones")
-
 
 class BONE_PT_inverse_kinematics(BoneButtonsPanel, Panel):
 bl_label = "Inverse Kinematics"

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


[Bf-blender-cvs] [dbf48758d95] master: Fix T73681: Python exception adding Empty objects via `object_data_add` with "Enter Edit Mode" enabled

2020-02-10 Thread Philipp Oeser
Commit: dbf48758d956bb23ad6b07ab16c3d0dacb657ccd
Author: Philipp Oeser
Date:   Mon Feb 10 10:26:34 2020 +0100
Branches: master
https://developer.blender.org/rBdbf48758d956bb23ad6b07ab16c3d0dacb657ccd

Fix T73681: Python exception adding Empty objects via `object_data_add`
with "Enter Edit Mode" enabled

It is valild to add Empties this way, but we cannot enter editmode on
those.

===

M   release/scripts/modules/bpy_extras/object_utils.py

===

diff --git a/release/scripts/modules/bpy_extras/object_utils.py 
b/release/scripts/modules/bpy_extras/object_utils.py
index 8c009a77d3d..540bc75cece 100644
--- a/release/scripts/modules/bpy_extras/object_utils.py
+++ b/release/scripts/modules/bpy_extras/object_utils.py
@@ -161,7 +161,7 @@ def object_data_add(context, obdata, operator=None, 
name=None):
 bpy.ops.object.mode_set(mode='EDIT')
 else:
 layer.objects.active = obj_new
-if context.preferences.edit.use_enter_edit_mode:
+if obdata and context.preferences.edit.use_enter_edit_mode:
 bpy.ops.object.mode_set(mode='EDIT')
 
 return obj_new

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


[Bf-blender-cvs] [9918b6c453b] greasepencil-refactor: Merge branch 'greasepencil-object' into greasepencil-refactor

2020-02-10 Thread Antonio Vazquez
Commit: 9918b6c453b38d8d0667675ab4a425a4087f4632
Author: Antonio Vazquez
Date:   Mon Feb 10 10:08:07 2020 +0100
Branches: greasepencil-refactor
https://developer.blender.org/rB9918b6c453b38d8d0667675ab4a425a4087f4632

Merge branch 'greasepencil-object' into greasepencil-refactor

 Conflicts:
source/blender/blenloader/intern/versioning_280.c

===



===

diff --cc source/blender/blenloader/intern/versioning_280.c
index ff5b98d13a4,78f2b87de24..3eb0479ca06
--- a/source/blender/blenloader/intern/versioning_280.c
+++ b/source/blender/blenloader/intern/versioning_280.c
@@@ -907,732 -905,732 +907,732 @@@ static void do_version_curvemapping_fla
  }
  
  /* Util version to walk over all CurveMappings in the given `bmain` */
 -static void do_version_curvemapping_walker(Main *bmain, void 
(*callback)(CurveMapping *cumap))
 +static void do_version_curvemapping_walker(Main* bmain, void 
(*callback)(CurveMapping* cumap))
  {
 -  LISTBASE_FOREACH (Scene *, scene, >scenes) {
 -callback(>r.mblur_shutter_curve);
 -
 -if (scene->view_settings.curve_mapping) {
 -  callback(scene->view_settings.curve_mapping);
 -}
 -
 -if (scene->ed != NULL) {
 -  LISTBASE_FOREACH (Sequence *, seq, >ed->seqbase) {
 -LISTBASE_FOREACH (SequenceModifierData *, smd, >modifiers) {
 -  const SequenceModifierTypeInfo *smti = 
BKE_sequence_modifier_type_info_get(smd->type);
 -
 -  if (smti) {
 -if (smd->type == seqModifierType_Curves) {
 -  CurvesModifierData *cmd = (CurvesModifierData *)smd;
 -  callback(>curve_mapping);
 -}
 -else if (smd->type == seqModifierType_HueCorrect) {
 -  HueCorrectModifierData *hcmd = (HueCorrectModifierData *)smd;
 -  callback(>curve_mapping);
 -}
 -  }
 -}
 -  }
 -}
 -
 -// toolsettings
 -ToolSettings *ts = scene->toolsettings;
 -if (ts->vpaint) {
 -  callback(ts->vpaint->paint.cavity_curve);
 -}
 -if (ts->wpaint) {
 -  callback(ts->wpaint->paint.cavity_curve);
 -}
 -if (ts->sculpt) {
 -  callback(ts->sculpt->paint.cavity_curve);
 -}
 -if (ts->uvsculpt) {
 -  callback(ts->uvsculpt->paint.cavity_curve);
 -}
 -if (ts->gp_paint) {
 -  callback(ts->gp_paint->paint.cavity_curve);
 -}
 -if (ts->gp_interpolate.custom_ipo) {
 -  callback(ts->gp_interpolate.custom_ipo);
 -}
 -if (ts->gp_sculpt.cur_falloff) {
 -  callback(ts->gp_sculpt.cur_falloff);
 -}
 -if (ts->gp_sculpt.cur_primitive) {
 -  callback(ts->gp_sculpt.cur_primitive);
 -}
 -callback(ts->imapaint.paint.cavity_curve);
 -  }
 -
 -  FOREACH_NODETREE_BEGIN (bmain, node_tree, id) {
 -LISTBASE_FOREACH (bNode *, node, _tree->nodes) {
 -  if (ELEM(node->type,
 -   SH_NODE_CURVE_VEC,
 -   SH_NODE_CURVE_RGB,
 -   CMP_NODE_CURVE_VEC,
 -   CMP_NODE_CURVE_RGB,
 -   CMP_NODE_TIME,
 -   CMP_NODE_HUECORRECT,
 -   TEX_NODE_CURVE_RGB,
 -   TEX_NODE_CURVE_TIME)) {
 -callback((CurveMapping *)node->storage);
 -  }
 -}
 -  }
 -  FOREACH_NODETREE_END;
 -
 -  LISTBASE_FOREACH (Light *, light, >lights) {
 -if (light->curfalloff) {
 -  callback(light->curfalloff);
 -}
 -  }
 -
 -  LISTBASE_FOREACH (Brush *, brush, >brushes) {
 -if (brush->curve) {
 -  callback(brush->curve);
 -}
 -if (brush->gpencil_settings) {
 -  if (brush->gpencil_settings->curve_sensitivity) {
 -callback(brush->gpencil_settings->curve_sensitivity);
 -  }
 -  if (brush->gpencil_settings->curve_strength) {
 -callback(brush->gpencil_settings->curve_strength);
 -  }
 -  if (brush->gpencil_settings->curve_jitter) {
 -callback(brush->gpencil_settings->curve_jitter);
 -  }
 -}
 -  }
 -
 -  LISTBASE_FOREACH (ParticleSettings *, part, >particles) {
 -if (part->clumpcurve) {
 -  callback(part->clumpcurve);
 -}
 -if (part->roughcurve) {
 -  callback(part->roughcurve);
 -}
 -if (part->twistcurve) {
 -  callback(part->twistcurve);
 -}
 -  }
 -
 -  /* Object */
 -  LISTBASE_FOREACH (Object *, ob, >objects) {
 -/* Object modifiers */
 -LISTBASE_FOREACH (ModifierData *, md, >modifiers) {
 -  if (md->type == eModifierType_Hook) {
 -HookModifierData *hmd = (HookModifierData *)md;
 -
 -if (hmd->curfalloff) {
 -  callback(hmd->curfalloff);
 -}
 -  }
 -  else if (md->type == eModifierType_Warp) {
 -WarpModifierData *tmd = (WarpModifierData *)md;
 -if (tmd->curfalloff) {
 -  callback(tmd->curfalloff);
 -}
 -  }
 -  else if (md->type == eModifierType_WeightVGEdit) {
 -WeightVGEditModifierData *wmd = 

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

2020-02-10 Thread Antonio Vazquez
Commit: a1b0c4ab9d95327bf3a665fe95eec225e9f2cbe1
Author: Antonio Vazquez
Date:   Mon Feb 10 10:06:39 2020 +0100
Branches: greasepencil-object
https://developer.blender.org/rBa1b0c4ab9d95327bf3a665fe95eec225e9f2cbe1

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] [b1059489b4e] greasepencil-refactor: GPencil: Add invert mask option to Mask subpanel

2020-02-10 Thread Antonio Vazquez
Commit: b1059489b4e8ea3f878145b5374ab564532b9c82
Author: Antonio Vazquez
Date:   Mon Feb 10 08:56:03 2020 +0100
Branches: greasepencil-refactor
https://developer.blender.org/rBb1059489b4e8ea3f878145b5374ab564532b9c82

GPencil: Add invert mask option to Mask subpanel

===

M   release/scripts/startup/bl_ui/properties_data_gpencil.py

===

diff --git a/release/scripts/startup/bl_ui/properties_data_gpencil.py 
b/release/scripts/startup/bl_ui/properties_data_gpencil.py
index 2a5862107f9..cb15a843533 100644
--- a/release/scripts/startup/bl_ui/properties_data_gpencil.py
+++ b/release/scripts/startup/bl_ui/properties_data_gpencil.py
@@ -329,6 +329,9 @@ class DATA_PT_gpencil_layer_masks(ObjectButtonsPanel, 
Panel):
 gpd = ob.data
 gpl = gpd.layers.active
 if gpl:
+row = layout.row()
+row.prop(gpl, "invert_mask")
+
 rows = 4
 row = layout.row()
 row.template_list("GPENCIL_UL_masks", "", gpl, "mask_layers", 
gpl.mask_layers, "active_mask_index", rows=rows)

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