[Bf-blender-cvs] [0c8fb534cf4] temp-lanpr-staging: LANPR: Fixing double precision paths.

2019-08-14 Thread YimingWu
Commit: 0c8fb534cf425f8b74cd002d1bff2a4c1dbb2e56
Author: YimingWu
Date:   Thu Aug 15 11:35:45 2019 +0800
Branches: temp-lanpr-staging
https://developer.blender.org/rB0c8fb534cf425f8b74cd002d1bff2a4c1dbb2e56

LANPR: Fixing double precision paths.

===

M   source/blender/blenlib/BLI_math_matrix.h
M   source/blender/blenlib/intern/math_matrix.c
M   source/blender/editors/include/ED_lanpr.h
M   source/blender/editors/lanpr/lanpr_chain.c
M   source/blender/editors/lanpr/lanpr_cpu.c
M   source/blender/editors/lanpr/lanpr_util.c

===

diff --git a/source/blender/blenlib/BLI_math_matrix.h 
b/source/blender/blenlib/BLI_math_matrix.h
index 52d976daa2d..83f318c9184 100644
--- a/source/blender/blenlib/BLI_math_matrix.h
+++ b/source/blender/blenlib/BLI_math_matrix.h
@@ -178,6 +178,7 @@ void mul_v2_m2v2(float r[2], const float M[2][2], const 
float v[2]);
 void mul_m2v2(const float M[2][2], float v[2]);
 void mul_mat3_m4_v3(const float M[4][4], float r[3]);
 void mul_v3_mat3_m4v3(float r[3], const float M[4][4], const float v[3]);
+void mul_v3db_mat3_m4v3(double r[3], const float M[4][4], const float v[3]);
 void mul_m4_v4(const float M[4][4], float r[4]);
 void mul_v4_m4v4(float r[4], const float M[4][4], const float v[4]);
 void mul_v4_m4v3(float r[4], const float M[4][4], const float v[3]); /* v has 
implicit w = 1.0f */
diff --git a/source/blender/blenlib/intern/math_matrix.c 
b/source/blender/blenlib/intern/math_matrix.c
index 7c64206134b..6f36d695fcf 100644
--- a/source/blender/blenlib/intern/math_matrix.c
+++ b/source/blender/blenlib/intern/math_matrix.c
@@ -646,6 +646,16 @@ void mul_v3_mat3_m4v3(float r[3], const float mat[4][4], 
const float vec[3])
   r[2] = x * mat[0][2] + y * mat[1][2] + mat[2][2] * vec[2];
 }
 
+void mul_v3db_mat3_m4v3(double r[3], const float mat[4][4], const float vec[3])
+{
+  const float x = vec[0];
+  const float y = vec[1];
+
+  r[0] = x * mat[0][0] + y * mat[1][0] + mat[2][0] * vec[2];
+  r[1] = x * mat[0][1] + y * mat[1][1] + mat[2][1] * vec[2];
+  r[2] = x * mat[0][2] + y * mat[1][2] + mat[2][2] * vec[2];
+}
+
 void mul_project_m4_v3(const float mat[4][4], float vec[3])
 {
   /* absolute value to not flip the frustum upside down behind the camera */
diff --git a/source/blender/editors/include/ED_lanpr.h 
b/source/blender/editors/include/ED_lanpr.h
index 496d463726a..279b3bc7160 100644
--- a/source/blender/editors/include/ED_lanpr.h
+++ b/source/blender/editors/include/ED_lanpr.h
@@ -91,8 +91,8 @@ typedef struct LANPR_RenderTriangle {
   struct LANPR_RenderTriangle *next, *prev;
   struct LANPR_RenderVert *v[3];
   struct LANPR_RenderLine *rl[3];
-  float gn[3];
-  real gc[3];
+  double gn[3];
+  double gc[3];
   /*  struct BMFace *F; */
   short material_id;
   ListBase intersecting_verts;
diff --git a/source/blender/editors/lanpr/lanpr_chain.c 
b/source/blender/editors/lanpr/lanpr_chain.c
index ebd8b3d28cc..b3c264ae071 100644
--- a/source/blender/editors/lanpr/lanpr_chain.c
+++ b/source/blender/editors/lanpr/lanpr_chain.c
@@ -81,7 +81,7 @@ static LANPR_RenderLineChainItem 
*lanpr_append_render_line_chain_point(LANPR_Ren
float 
gx,
float 
gy,
float 
gz,
-   float 
*normal,
+   double 
*normal,
char 
type,
int 
level)
 {
@@ -93,7 +93,7 @@ static LANPR_RenderLineChainItem 
*lanpr_append_render_line_chain_point(LANPR_Ren
   rlci->gpos[0] = gx;
   rlci->gpos[1] = gy;
   rlci->gpos[2] = gz;
-  copy_v3_v3(rlci->normal, normal);
+  copy_v3fl_v3db(rlci->normal, normal);
   rlci->line_type = type & LANPR_EDGE_FLAG_ALL_TYPE;
   rlci->occlusion = level;
   BLI_addtail(>chain, rlci);
@@ -206,20 +206,16 @@ void 
ED_lanpr_NO_THREAD_chain_feature_lines(LANPR_RenderBuffer *rb)
 
 LANPR_RenderLine *new_rl = rl;
 LANPR_RenderVert *new_rv;
-float N[3] = {0};
+double N[3] = {0};
 
 if (rl->tl) {
-  N[0] += rl->tl->gn[0];
-  N[1] += rl->tl->gn[1];
-  N[2] += rl->tl->gn[2];
+  add_v3_v3_db(N,rl->tl->gn);
 }
 if (rl->tr) {
-  N[0] += rl->tr->gn[0];
-  N[1] += rl->tr->gn[1];
-  N[2] += rl->tr->gn[2];
+  add_v3_v3_db(N,rl->tr->gn);
 }
 if (rl->tl || rl->tr) {
-  normalize_v3(N);
+  normalize_v3_d(N);
 }
 
 /*  step 1: grow left */
@@ -242,12 +238,12 @@ void 
ED_lanpr_NO_THREAD_chain_feature_lines(LANPR_RenderBuffer *rb)
   if (new_rl->tl || new_rl->tr) {
 zero_v3(N);

[Bf-blender-cvs] [28ee7e60c5c] soc-2019-outliner: Outliner: increase contrast of selected and active highlights

2019-08-14 Thread Nathan Craddock
Commit: 28ee7e60c5cdc5a123b6aed9fc2367d3c5815a8d
Author: Nathan Craddock
Date:   Wed Aug 14 21:06:47 2019 -0600
Branches: soc-2019-outliner
https://developer.blender.org/rB28ee7e60c5cdc5a123b6aed9fc2367d3c5815a8d

Outliner: increase contrast of selected and active highlights

===

M   release/datafiles/userdef/userdef_default_theme.c
M   source/blender/blenloader/intern/versioning_userdef.c

===

diff --git a/release/datafiles/userdef/userdef_default_theme.c 
b/release/datafiles/userdef/userdef_default_theme.c
index fa3f865b5b9..9f037fa4793 100644
--- a/release/datafiles/userdef/userdef_default_theme.c
+++ b/release/datafiles/userdef/userdef_default_theme.c
@@ -748,8 +748,8 @@ const bTheme U_theme_default = {
 .outline_width = 1,
 .facedot_size = 4,
 .match = RGBA(0x337f334c),
-.selected_highlight = RGBA(0x314e784c),
-.active = RGBA(0x59749d4c),
+.selected_highlight = RGBA(0x223a5bff),
+.active = RGBA(0x3b5689ff),
 .selected_object = RGBA(0xe96a00ff),
 .active_object = RGBA(0xffaf29ff),
 .edited_object = RGBA(0x00806266),
diff --git a/source/blender/blenloader/intern/versioning_userdef.c 
b/source/blender/blenloader/intern/versioning_userdef.c
index ce2fa1b7852..b01d2765963 100644
--- a/source/blender/blenloader/intern/versioning_userdef.c
+++ b/source/blender/blenloader/intern/versioning_userdef.c
@@ -141,6 +141,7 @@ static void do_versions_theme(const UserDef *userdef, 
bTheme *btheme)
 FROM_DEFAULT_V4_UCHAR(space_outliner.row_alternate);
   }
 
+  FROM_DEFAULT_V4_UCHAR(space_outliner.selected_highlight);
   FROM_DEFAULT_V4_UCHAR(space_outliner.active);
 
   /**

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


[Bf-blender-cvs] [8c3b3a982b1] soc-2019-outliner: Outliner: Don't allow duplicates for merge search

2019-08-14 Thread Nathan Craddock
Commit: 8c3b3a982b1fef6c9b618bdce7a0df124449ca0e
Author: Nathan Craddock
Date:   Wed Aug 14 20:26:22 2019 -0600
Branches: soc-2019-outliner
https://developer.blender.org/rB8c3b3a982b1fef6c9b618bdce7a0df124449ca0e

Outliner: Don't allow duplicates for merge search

Only show one item for each subtree element in a merge search popup.
Selecting an element from the popup that has multiple instances in the
subtree will select the first instance in the tree.

===

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

===

diff --git a/source/blender/editors/space_outliner/outliner_tools.c 
b/source/blender/editors/space_outliner/outliner_tools.c
index 190e859e189..582a9cad312 100644
--- a/source/blender/editors/space_outliner/outliner_tools.c
+++ b/source/blender/editors/space_outliner/outliner_tools.c
@@ -63,6 +63,7 @@
 
 #include "ED_armature.h"
 #include "ED_object.h"
+#include "ED_outliner.h"
 #include "ED_scene.h"
 #include "ED_screen.h"
 #include "ED_sequencer.h"
@@ -493,14 +494,19 @@ static void merged_element_search_cb_recursive(
   int iconid;
 
   for (TreeElement *te = tree->first; te; te = te->next) {
-if (tree_element_id_type_to_index(te) == type && tselem_type == 
TREESTORE(te)->type) {
+TreeStoreElem *tselem = TREESTORE(te);
+
+if (tree_element_id_type_to_index(te) == type && tselem_type == 
tselem->type) {
   if (BLI_strcasestr(te->name, str)) {
 BLI_strncpy(name, te->name, 64);
 
-iconid = tree_element_get_icon(TREESTORE(te), te).icon;
+iconid = tree_element_get_icon(tselem, te).icon;
 
-if (!UI_search_item_add(items, name, te, iconid)) {
-  break;
+/* Don't allow duplicate named items */
+if (UI_search_items_find_index(items, name) == -1) {
+  if (!UI_search_item_add(items, name, te, iconid)) {
+break;
+  }
 }
   }
 }
@@ -527,9 +533,15 @@ static void merged_element_search_cb(const bContext 
*UNUSED(C),
 /* Activate an element from the merged element search menu */
 static void merged_element_search_call_cb(struct bContext *C, void 
*UNUSED(arg1), void *element)
 {
+  SpaceOutliner *soops = CTX_wm_space_outliner(C);
   TreeElement *te = (TreeElement *)element;
 
+  outliner_item_select(soops, te, false, false);
   outliner_item_do_activate_from_tree_element(C, te, te->store_elem, false, 
false);
+
+  if (soops->flag & SO_SYNC_SELECT) {
+ED_outliner_select_sync_from_outliner(C, soops);
+  }
 }
 
 /** Merged element search menu

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


[Bf-blender-cvs] [316e6ee7616] temp-lanpr-staging: Cleanup: comments.

2019-08-14 Thread YimingWu
Commit: 316e6ee7616a7a626fa345c24582ded59ba91edb
Author: YimingWu
Date:   Thu Aug 15 09:37:59 2019 +0800
Branches: temp-lanpr-staging
https://developer.blender.org/rB316e6ee7616a7a626fa345c24582ded59ba91edb

Cleanup: comments.

===

M   source/blender/editors/include/ED_lanpr.h
M   source/blender/editors/lanpr/lanpr_chain.c
M   source/blender/editors/lanpr/lanpr_cpu.c
M   source/blender/editors/lanpr/lanpr_util.c

===

diff --git a/source/blender/editors/include/ED_lanpr.h 
b/source/blender/editors/include/ED_lanpr.h
index dffbd5b7eee..496d463726a 100644
--- a/source/blender/editors/include/ED_lanpr.h
+++ b/source/blender/editors/include/ED_lanpr.h
@@ -456,26 +456,6 @@ typedef struct LANPR_BoundingArea {
 #define TNS_IN_TILE(RenderTile, Fx, Fy) \
   (TNS_IN_TILE_X(RenderTile, Fx) && TNS_IN_TILE_Y(RenderTile, Fy))
 
-BLI_INLINE void tMatConvert44df(tnsMatrix44d from, tnsMatrix44f to)
-{
-  to[0] = from[0];
-  to[1] = from[1];
-  to[2] = from[2];
-  to[3] = from[3];
-  to[4] = from[4];
-  to[5] = from[5];
-  to[6] = from[6];
-  to[7] = from[7];
-  to[8] = from[8];
-  to[9] = from[9];
-  to[10] = from[10];
-  to[11] = from[11];
-  to[12] = from[12];
-  to[13] = from[13];
-  to[14] = from[14];
-  to[15] = from[15];
-}
-
 BLI_INLINE int lanpr_TrangleLineBoundBoxTest(LANPR_RenderTriangle *rt, 
LANPR_RenderLine *rl)
 {
   if (MAX3(rt->v[0]->fbcoord[2], rt->v[1]->fbcoord[2], rt->v[2]->fbcoord[2]) >
@@ -581,44 +561,14 @@ void *list_push_pointer_static_sized(ListBase *h, 
LANPR_StaticMemPool *smp, void
 
 void *list_append_pointer_static_pool(LANPR_StaticMemPool *mph, ListBase *h, 
void *p);
 void *list_pop_pointer_no_free(ListBase *h);
-void list_remove_pointer_item_no_free(ListBase *h, LinkData *lip);
 
 LANPR_StaticMemPoolNode *mem_new_static_pool(LANPR_StaticMemPool *smp);
 void *mem_static_aquire(LANPR_StaticMemPool *smp, int size);
 void *mem_static_aquire_thread(LANPR_StaticMemPool *smp, int size);
 void *mem_static_destroy(LANPR_StaticMemPool *smp);
 
-void tmat_obmat_to_16d(float obmat[4][4], tnsMatrix44d out);
-
-real tmat_vector_cross_3d(tnsVector3d result, tnsVector3d l, tnsVector3d r);
-void tmat_vector_cross_only_3d(tnsVector3d result, tnsVector3d l, tnsVector3d 
r);
-real tmat_angle_rad_3d(tnsVector3d from, tnsVector3d to, tnsVector3d 
PositiveReference);
-void tmat_apply_rotation_33d(tnsVector3d result, tnsMatrix44d mat, tnsVector3d 
v);
-void tmat_apply_rotation_43d(tnsVector3d result, tnsMatrix44d mat, tnsVector3d 
v);
-void tmat_apply_transform_43d(tnsVector3d result, tnsMatrix44d mat, 
tnsVector3d v);
-void tmat_apply_transform_43dfND(tnsVector4d result, tnsMatrix44d mat, 
tnsVector3f v);
-void tmat_apply_normal_transform_43d(tnsVector3d result, tnsMatrix44d mat, 
tnsVector3d v);
-void tmat_apply_normal_transform_43df(tnsVector3d result, tnsMatrix44d mat, 
tnsVector3f v);
-void tmat_apply_transform_44d(tnsVector4d result, tnsMatrix44d mat, 
tnsVector4d v);
-void tmat_apply_transform_43df(tnsVector4d result, tnsMatrix44d mat, 
tnsVector3f v);
-void tmat_apply_transform_44dTrue(tnsVector4d result, tnsMatrix44d mat, 
tnsVector4d v);
-
-void tmat_load_identity_44d(tnsMatrix44d m);
-void tmat_make_ortho_matrix_44d(
-tnsMatrix44d mProjection, real xMin, real xMax, real yMin, real yMax, real 
zMin, real zMax);
 void tmat_make_perspective_matrix_44f(
 float (*mProjection)[4], float fFov_rad, float fAspect, float zMin, float 
zMax);
-void tmat_make_translation_matrix_44d(tnsMatrix44d mTrans, real x, real y, 
real z);
-void tmat_make_rotation_matrix_44d(tnsMatrix44d m, real angle_rad, real x, 
real y, real z);
-void tmat_make_scale_matrix_44d(tnsMatrix44d m, real x, real y, real z);
-void tmat_make_viewport_matrix_44d(tnsMatrix44d m, real w, real h, real Far, 
real Near);
-void tmat_multiply_44d(tnsMatrix44d result, tnsMatrix44d l, tnsMatrix44d r);
-void tmat_inverse_44d(tnsMatrix44d inverse, tnsMatrix44d mat);
-void tmat_make_rotation_x_matrix_44d(tnsMatrix44d m, real angle_rad);
-void tmat_make_rotation_y_matrix_44d(tnsMatrix44d m, real angle_rad);
-void tmat_make_rotation_z_matrix_44d(tnsMatrix44d m, real angle_rad);
-void tmat_remove_translation_44d(tnsMatrix44d result, tnsMatrix44d mat);
-void tmat_clear_translation_44d(tnsMatrix44d mat);
 
 int lanpr_count_this_line(LANPR_RenderLine *rl, LANPR_LineLayer *ll);
 long lanpr_count_leveled_edge_segment_count(ListBase *LineList, 
LANPR_LineLayer *ll);
diff --git a/source/blender/editors/lanpr/lanpr_chain.c 
b/source/blender/editors/lanpr/lanpr_chain.c
index 66c621283c7..ebd8b3d28cc 100644
--- a/source/blender/editors/lanpr/lanpr_chain.c
+++ b/source/blender/editors/lanpr/lanpr_chain.c
@@ -40,7 +40,6 @@ static LANPR_RenderLine 
*lanpr_get_connected_render_line(LANPR_BoundingArea *ba,
 
 /*  always chain connected lines for now. */
 /*  simplification will take care of the sharp points. */
-/*  

[Bf-blender-cvs] [242ddba1180] temp-lanpr-staging: Merge remote-tracking branch 'origin/master' into temp-lanpr-staging

2019-08-14 Thread YimingWu
Commit: 242ddba1180a5d06cb7d1da5cf77c60a06fdb6b2
Author: YimingWu
Date:   Thu Aug 15 08:56:40 2019 +0800
Branches: temp-lanpr-staging
https://developer.blender.org/rB242ddba1180a5d06cb7d1da5cf77c60a06fdb6b2

Merge remote-tracking branch 'origin/master' into temp-lanpr-staging

===



===

diff --cc source/blender/draw/CMakeLists.txt
index 0ac2bec1f16,1112a7a87db..46a46bc55b6
--- a/source/blender/draw/CMakeLists.txt
+++ b/source/blender/draw/CMakeLists.txt
@@@ -128,13 -129,8 +129,14 @@@ set(SR
engines/gpencil/gpencil_engine.h
engines/gpencil/gpencil_render.c
engines/gpencil/gpencil_shader_fx.c
 +  engines/lanpr/lanpr_dpix.c
 +  engines/lanpr/lanpr_engine.c
 +  # engines/lanpr/lanpr_snake.c  deprecated for now.
 +  engines/lanpr/lanpr_cpu.c
 +  engines/lanpr/lanpr_chain_draw.c
 +  engines/select/select_engine.c
engines/select/select_draw_utils.c
+   engines/select/select_engine.c
  
DRW_engine.h
DRW_select_buffer.h

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


[Bf-blender-cvs] [852e4f24a58] temp-lanpr-staging: Cleanup: Fix merge error.

2019-08-14 Thread YimingWu
Commit: 852e4f24a588a47615a6db034d92643037c4fd2e
Author: YimingWu
Date:   Thu Aug 15 08:57:01 2019 +0800
Branches: temp-lanpr-staging
https://developer.blender.org/rB852e4f24a588a47615a6db034d92643037c4fd2e

Cleanup: Fix merge error.

===

M   source/blender/draw/CMakeLists.txt

===

diff --git a/source/blender/draw/CMakeLists.txt 
b/source/blender/draw/CMakeLists.txt
index 46a46bc55b6..fc91ac371cb 100644
--- a/source/blender/draw/CMakeLists.txt
+++ b/source/blender/draw/CMakeLists.txt
@@ -134,7 +134,6 @@ set(SRC
# engines/lanpr/lanpr_snake.c  deprecated for now.
engines/lanpr/lanpr_cpu.c
   engines/lanpr/lanpr_chain_draw.c
-  engines/select/select_engine.c
   engines/select/select_draw_utils.c
   engines/select/select_engine.c

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


[Bf-blender-cvs] [f4d548d384e] master: msvc: Enable /bigobj on all object files.

2019-08-14 Thread Lazydodo
Commit: f4d548d384e20ef377b2573a6c54a2434c3f9134
Author: Lazydodo
Date:   Wed Aug 14 17:57:01 2019 -0600
Branches: master
https://developer.blender.org/rBf4d548d384e20ef377b2573a6c54a2434c3f9134

msvc: Enable /bigobj on all object files.

bf_intern_openvdb makes a significant number of template instantiations
causing it go over the maximum number of sections (int16) in a coff file
when doing a debug build.

This change switches the compiler to use the extended coff format which
has this field extended (int32) all linkers post msvc2005 can process
this format so there's no reason not to turn this on globally.

Clang on windows does not need this change since clang switches implicitly
to the extended format when required. [1]

[1] https://reviews.llvm.org/rL217812

===

M   build_files/cmake/platform/platform_win32.cmake

===

diff --git a/build_files/cmake/platform/platform_win32.cmake 
b/build_files/cmake/platform/platform_win32.cmake
index 208521a9e65..80097e6c84f 100644
--- a/build_files/cmake/platform/platform_win32.cmake
+++ b/build_files/cmake/platform/platform_win32.cmake
@@ -131,8 +131,8 @@ if(MSVC_CLANG) # Clangs version of cl doesn't support all 
flags
   set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${CXX_WARN_FLAGS} /nologo /J /Gd 
/EHsc -Wno-unused-command-line-argument -Wno-microsoft-enum-forward-reference ")
   set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /nologo /J /Gd 
-Wno-unused-command-line-argument -Wno-microsoft-enum-forward-reference")
 else()
-  set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /nologo /J /Gd /MP /EHsc")
-  set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /nologo /J /Gd /MP")
+  set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /nologo /J /Gd /MP /EHsc /bigobj")
+  set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /nologo /J /Gd /MP /bigobj")
 endif()
 
 set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} /MTd")
@@ -349,7 +349,7 @@ if(WITH_PYTHON)
   string(REPLACE "." "" _PYTHON_VERSION_NO_DOTS ${PYTHON_VERSION})
   set(PYTHON_LIBRARY 
${LIBDIR}/python/${_PYTHON_VERSION_NO_DOTS}/libs/python${_PYTHON_VERSION_NO_DOTS}.lib)
   set(PYTHON_LIBRARY_DEBUG 
${LIBDIR}/python/${_PYTHON_VERSION_NO_DOTS}/libs/python${_PYTHON_VERSION_NO_DOTS}_d.lib)
-  
+
   set(PYTHON_INCLUDE_DIR ${LIBDIR}/python/${_PYTHON_VERSION_NO_DOTS}/include)
   set(PYTHON_NUMPY_INCLUDE_DIRS 
${LIBDIR}/python/${_PYTHON_VERSION_NO_DOTS}/lib/site-packages/numpy/core/include)
   set(NUMPY_FOUND On)
@@ -490,7 +490,7 @@ if(WITH_OPENIMAGEDENOISE)
   set(OPENIMAGEDENOISE ${LIBDIR}/OpenImageDenoise)
   set(OPENIMAGEDENOISE_LIBPATH ${LIBDIR}/OpenImageDenoise/lib)
   set(OPENIMAGEDENOISE_INCLUDE_DIRS ${OPENIMAGEDENOISE}/include 
${TBB_INCLUDE_DIR})
-  set(OPENIMAGEDENOISE_LIBRARIES 
+  set(OPENIMAGEDENOISE_LIBRARIES
 optimized ${OPENIMAGEDENOISE_LIBPATH}/OpenImageDenoise.lib 
${OPENIMAGEDENOISE_LIBPATH}/common.lib ${OPENIMAGEDENOISE_LIBPATH}/mkldnn.lib
 debug ${OPENIMAGEDENOISE_LIBPATH}/OpenImageDenoise_d.lib 
${OPENIMAGEDENOISE_LIBPATH}/common_d.lib 
${OPENIMAGEDENOISE_LIBPATH}/mkldnn_d.lib
 ${TBB_LIBRARIES})

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


[Bf-blender-cvs] [cb7ead2e3b6] master: Fix T68658: Text offset makes scale to fit not to work

2019-08-14 Thread Dalai Felinto
Commit: cb7ead2e3b62b9f1df85c985801db7918204dd2a
Author: Dalai Felinto
Date:   Wed Aug 14 15:08:25 2019 -0300
Branches: master
https://developer.blender.org/rBcb7ead2e3b62b9f1df85c985801db7918204dd2a

Fix T68658: Text offset makes scale to fit not to work

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

===

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

===

diff --git a/source/blender/blenkernel/intern/font.c 
b/source/blender/blenkernel/intern/font.c
index 78117a4f615..b55635560be 100644
--- a/source/blender/blenkernel/intern/font.c
+++ b/source/blender/blenkernel/intern/font.c
@@ -955,7 +955,7 @@ static bool vfont_to_curve(Object *ob,
 }
   }
 
-  current_line_length += xof;
+  current_line_length += xof - MARGIN_X_MIN;
   if (ct->dobreak) {
 current_line_length += twidth;
   }
@@ -1026,7 +1026,7 @@ static bool vfont_to_curve(Object *ob,
 }
 ct++;
   }
-  current_line_length += xof + twidth;
+  current_line_length += xof + twidth - MARGIN_X_MIN;
   longest_line_length = MAX2(current_line_length, longest_line_length);
 
   cu->lines = 1;

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


[Bf-blender-cvs] [80e9eb66d56] master: Mesh Batch Cache: Split UV an tangent into 2 distinct VBOs

2019-08-14 Thread Clément Foucault
Commit: 80e9eb66d568311f4acddf5dfe5bbf8f8618f18d
Author: Clément Foucault
Date:   Wed Aug 14 22:43:44 2019 +0200
Branches: master
https://developer.blender.org/rB80e9eb66d568311f4acddf5dfe5bbf8f8618f18d

Mesh Batch Cache: Split UV an tangent into 2 distinct VBOs

This is done because they don't have the same update frequency. UV can be
persistent even on geometry update (ex: skinned object) but tangents
can change if the normals change.

Also the name buffer per vbo was too small to contain all names.

===

M   source/blender/draw/intern/draw_cache_extract.h
M   source/blender/draw/intern/draw_cache_extract_mesh.c
M   source/blender/draw/intern/draw_cache_impl_mesh.c
M   source/blender/gpu/GPU_batch.h

===

diff --git a/source/blender/draw/intern/draw_cache_extract.h 
b/source/blender/draw/intern/draw_cache_extract.h
index 5a06210fe8e..9305dc6eef7 100644
--- a/source/blender/draw/intern/draw_cache_extract.h
+++ b/source/blender/draw/intern/draw_cache_extract.h
@@ -86,7 +86,8 @@ typedef struct MeshBufferCache {
 GPUVertBuf *lnor; /* extend */
 GPUVertBuf *edge_fac; /* extend */
 GPUVertBuf *weights;  /* extend */
-GPUVertBuf *uv_tan;
+GPUVertBuf *uv;
+GPUVertBuf *tan;
 GPUVertBuf *vcol;
 GPUVertBuf *orco;
 /* Only for edit mode. */
diff --git a/source/blender/draw/intern/draw_cache_extract_mesh.c 
b/source/blender/draw/intern/draw_cache_extract_mesh.c
index ea1813464c3..95b984747bd 100644
--- a/source/blender/draw/intern/draw_cache_extract_mesh.c
+++ b/source/blender/draw/intern/draw_cache_extract_mesh.c
@@ -1554,21 +1554,16 @@ const MeshExtract extract_lnor = {extract_lnor_init,
 /** \} */
 
 /* -- */
-/** \name Extract UV / Tangent layers
+/** \name Extract UV  layers
  * \{ */
 
-static void *extract_uv_tan_init(const MeshRenderData *mr, void *buf)
+static void *extract_uv_init(const MeshRenderData *mr, void *buf)
 {
   GPUVertFormat format = {0};
   GPU_vertformat_deinterleave();
 
   CustomData *cd_ldata = (mr->extract_type == MR_EXTRACT_BMESH) ? 
>bm->ldata : >me->ldata;
-  CustomData *cd_vdata = (mr->extract_type == MR_EXTRACT_BMESH) ? 
>bm->vdata : >me->vdata;
   uint32_t uv_layers = mr->cache->cd_used.uv;
-  uint32_t tan_layers = mr->cache->cd_used.tan;
-  float(*orco)[3] = CustomData_get_layer(cd_vdata, CD_ORCO);
-  bool orco_allocated = false;
-  const bool use_orco_tan = mr->cache->cd_used.tan_orco != 0;
 
   for (int i = 0; i < MAX_MTFACE; i++) {
 if (uv_layers & (1 << i)) {
@@ -1599,6 +1594,65 @@ static void *extract_uv_tan_init(const MeshRenderData 
*mr, void *buf)
 }
   }
 
+  int v_len = mr->loop_len;
+  if (format.attr_len == 0) {
+GPU_vertformat_attr_add(, "dummy", GPU_COMP_F32, 1, 
GPU_FETCH_FLOAT);
+/* VBO will not be used, only allocate minimum of memory. */
+v_len = 1;
+  }
+
+  GPUVertBuf *vbo = buf;
+  GPU_vertbuf_init_with_format(vbo, );
+  GPU_vertbuf_data_alloc(vbo, v_len);
+
+  float(*uv_data)[2] = (float(*)[2])vbo->data;
+  for (int i = 0; i < MAX_MTFACE; i++) {
+if (uv_layers & (1 << i)) {
+  if (mr->extract_type == MR_EXTRACT_BMESH) {
+int cd_ofs = CustomData_get_n_offset(cd_ldata, CD_MLOOPUV, i);
+BMIter f_iter, l_iter;
+BMFace *efa;
+BMLoop *loop;
+BM_ITER_MESH (efa, _iter, mr->bm, BM_FACES_OF_MESH) {
+  BM_ITER_ELEM (loop, _iter, efa, BM_LOOPS_OF_FACE) {
+MLoopUV *luv = BM_ELEM_CD_GET_VOID_P(loop, cd_ofs);
+memcpy(uv_data, luv->uv, sizeof(*uv_data));
+uv_data++;
+  }
+}
+  }
+  else {
+MLoopUV *layer_data = CustomData_get_layer_n(cd_ldata, CD_MLOOPUV, i);
+for (int l = 0; l < mr->loop_len; l++, uv_data++, layer_data++) {
+  memcpy(uv_data, layer_data->uv, sizeof(*uv_data));
+}
+  }
+}
+  }
+
+  return NULL;
+}
+
+const MeshExtract extract_uv = {
+extract_uv_init, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0, 
false};
+/** \} */
+
+/* -- */
+/** \name Extract Tangent layers
+ * \{ */
+
+static void *extract_tan_init(const MeshRenderData *mr, void *buf)
+{
+  GPUVertFormat format = {0};
+  GPU_vertformat_deinterleave();
+
+  CustomData *cd_ldata = (mr->extract_type == MR_EXTRACT_BMESH) ? 
>bm->ldata : >me->ldata;
+  CustomData *cd_vdata = (mr->extract_type == MR_EXTRACT_BMESH) ? 
>bm->vdata : >me->vdata;
+  uint32_t tan_layers = mr->cache->cd_used.tan;
+  float(*orco)[3] = CustomData_get_layer(cd_vdata, CD_ORCO);
+  bool orco_allocated = false;
+  const bool use_orco_tan = mr->cache->cd_used.tan_orco != 0;
+
   int tan_len = 0;
   char tangent_names[MAX_MTFACE][MAX_CUSTOMDATA_LAYER_NAME];
 
@@ -1705,32 +1759,7 @@ static void *extract_uv_tan_init(const MeshRenderData 
*mr, 

[Bf-blender-cvs] [6fcd071c7bc] master: GPU: Vertex Format: Increase number of byte per attribute name

2019-08-14 Thread Clément Foucault
Commit: 6fcd071c7bcb8c9a5e0a7d0e7a6ef6363e43627e
Author: Clément Foucault
Date:   Wed Aug 14 23:43:03 2019 +0200
Branches: master
https://developer.blender.org/rB6fcd071c7bcb8c9a5e0a7d0e7a6ef6363e43627e

GPU: Vertex Format: Increase number of byte per attribute name

This reduces the risks of hash collision while maintaining a small number
of character per attrib.

===

M   source/blender/gpu/GPU_vertex_format.h
M   source/blender/gpu/intern/gpu_vertex_format.c

===

diff --git a/source/blender/gpu/GPU_vertex_format.h 
b/source/blender/gpu/GPU_vertex_format.h
index 97c1828b593..8c22e3e1104 100644
--- a/source/blender/gpu/GPU_vertex_format.h
+++ b/source/blender/gpu/GPU_vertex_format.h
@@ -35,7 +35,7 @@
 #define GPU_VERT_ATTR_NAMES_BUF_LEN 256
 #define GPU_VERT_FORMAT_MAX_NAMES 63 /* More than enough, actual max is ~30. */
 /* Computed as GPU_VERT_ATTR_NAMES_BUF_LEN / 30 (actual max format name). */
-#define GPU_MAX_SAFE_ATTRIB_NAME 8
+#define GPU_MAX_SAFE_ATTRIB_NAME 12
 
 typedef enum {
   GPU_COMP_I8,
diff --git a/source/blender/gpu/intern/gpu_vertex_format.c 
b/source/blender/gpu/intern/gpu_vertex_format.c
index 2cfb17b1568..11df86c0b3a 100644
--- a/source/blender/gpu/intern/gpu_vertex_format.c
+++ b/source/blender/gpu/intern/gpu_vertex_format.c
@@ -220,20 +220,6 @@ int GPU_vertformat_attr_id_get(const GPUVertFormat 
*format, const char *name)
   return -1;
 }
 
-/* Encode 4 original bytes into 6 safe bytes. */
-static void safe_bytes(char out[6], const char data[4])
-{
-  char safe_chars[63] = 
"abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789_";
-
-  uint32_t in = *(uint32_t *)data;
-  for (int i = 0; i < 6; i++) {
-/* Encoding in base63 */
-out[i] = safe_chars[in % 63u];
-in /= 63u;
-  }
-}
-
-#if 0 /* For when we can use 11chars names. */
 /* Encode 8 original bytes into 11 safe bytes. */
 static void safe_bytes(char out[11], const char data[8])
 {
@@ -246,7 +232,6 @@ static void safe_bytes(char out[11], const char data[8])
 in /= 63lu;
   }
 }
-#endif
 
 /* Warning: Always add a prefix to the result of this function as
  * the generated string can start with a number and not be a valid attribute 
name. */
@@ -254,22 +239,34 @@ void GPU_vertformat_safe_attrib_name(const char 
*attrib_name,
  char *r_safe_name,
  uint UNUSED(max_len))
 {
-  char data[4] = {0};
-  /* We use a hash to identify each data layer based on its name.
-   * NOTE: This is still prone to hash collision but the risks are very low.*/
-  *(uint *)data = BLI_ghashutil_strhash_p_murmur(attrib_name);
+  char data[8] = {0};
+  uint len = strlen(attrib_name);
+
+  if (len > 8) {
+/* Start with the first 4 chars of the name; */
+for (int i = 0; i < 4; i++) {
+  data[i] = attrib_name[i];
+}
+/* We use a hash to identify each data layer based on its name.
+ * NOTE: This is still prone to hash collision but the risks are very 
low.*/
+/* Start hashing after the first 2 chars. */
+*(uint *)[4] = BLI_ghashutil_strhash_p_murmur(attrib_name + 4);
+  }
+  else {
+/* Copy the whole name. Collision is barelly possible
+ * (hash would have to be equal to the last 4 bytes). */
+for (int i = 0; i < 8 && attrib_name[i] != '\0'; i++) {
+  data[i] = attrib_name[i];
+}
+  }
   /* Convert to safe bytes characters. */
   safe_bytes(r_safe_name, data);
   /* End the string */
-  r_safe_name[6] = '\0';
-
-  /* TOOD(fclem) When UV and Tangent buffers will be separated, name buffer 
will have plenty more
-   * space. In this case, we can think of having ~13 chars for each name which 
would be enough to
-   * encode some of the input string along with the hash to reduce colision 
possibility. */
+  r_safe_name[11] = '\0';
 
-  BLI_assert(GPU_MAX_SAFE_ATTRIB_NAME >= 7);
+  BLI_assert(GPU_MAX_SAFE_ATTRIB_NAME >= 12);
 #if 0 /* For debugging */
-  printf("%s > %x > %s\n", attrib_name, *(uint32_t *)data, r_safe_name);
+  printf("%s > %lx > %s\n", attrib_name, *(uint64_t *)data, r_safe_name);
 #endif
 }

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


[Bf-blender-cvs] [5ff8fcfa724] master: Eevee: Fix tangent map node not using the right UVMap

2019-08-14 Thread Clément Foucault
Commit: 5ff8fcfa7241e2b15c6ac110538f40e277db3f37
Author: Clément Foucault
Date:   Wed Aug 14 23:43:33 2019 +0200
Branches: master
https://developer.blender.org/rB5ff8fcfa7241e2b15c6ac110538f40e277db3f37

Eevee: Fix tangent map node not using the right UVMap

===

M   source/blender/nodes/shader/nodes/node_shader_tangent.c

===

diff --git a/source/blender/nodes/shader/nodes/node_shader_tangent.c 
b/source/blender/nodes/shader/nodes/node_shader_tangent.c
index 6795f48edb3..478b9524737 100644
--- a/source/blender/nodes/shader/nodes/node_shader_tangent.c
+++ b/source/blender/nodes/shader/nodes/node_shader_tangent.c
@@ -42,7 +42,8 @@ static int node_shader_gpu_tangent(GPUMaterial *mat,
   NodeShaderTangent *attr = node->storage;
 
   if (attr->direction_type == SHD_TANGENT_UVMAP) {
-return GPU_stack_link(mat, node, "node_tangentmap", in, out, 
GPU_attribute(CD_TANGENT, ""));
+return GPU_stack_link(
+mat, node, "node_tangentmap", in, out, GPU_attribute(CD_TANGENT, 
attr->uv_map));
   }
   else {
 GPUNodeLink *orco = GPU_attribute(CD_ORCO, "");

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


[Bf-blender-cvs] [deb5416a1a5] master: GPU: Vertex Format: ADd function for safe GLSL attrib name

2019-08-14 Thread Clément Foucault
Commit: deb5416a1a50e153cf2f9e3809755a5e82bd8f85
Author: Clément Foucault
Date:   Wed Aug 14 22:18:47 2019 +0200
Branches: master
https://developer.blender.org/rBdeb5416a1a50e153cf2f9e3809755a5e82bd8f85

GPU: Vertex Format: ADd function for safe GLSL attrib name

This remove code duplication and use base63 encoding of the hash.
Use mumur hash to have more randomness.

===

M   source/blender/draw/intern/draw_cache_extract_mesh.c
M   source/blender/draw/intern/draw_cache_impl_mesh.c
M   source/blender/gpu/GPU_shader.h
M   source/blender/gpu/GPU_vertex_format.h
M   source/blender/gpu/intern/gpu_codegen.c
M   source/blender/gpu/intern/gpu_vertex_format.c

===

diff --git a/source/blender/draw/intern/draw_cache_extract_mesh.c 
b/source/blender/draw/intern/draw_cache_extract_mesh.c
index f9d6c9ed582..ea1813464c3 100644
--- a/source/blender/draw/intern/draw_cache_extract_mesh.c
+++ b/source/blender/draw/intern/draw_cache_extract_mesh.c
@@ -1570,23 +1570,17 @@ static void *extract_uv_tan_init(const MeshRenderData 
*mr, void *buf)
   bool orco_allocated = false;
   const bool use_orco_tan = mr->cache->cd_used.tan_orco != 0;
 
-  /* XXX FIXME XXX */
-  /* We use a hash to identify each data layer based on its name.
-   * Gawain then search for this name in the current shader and bind if it 
exists.
-   * NOTE : This is prone to hash collision.
-   * One solution to hash collision would be to format the cd layer name
-   * to a safe glsl var name, but without name clash.
-   * NOTE 2 : Replicate changes to code_generate_vertex_new() in gpu_codegen.c 
*/
   for (int i = 0; i < MAX_MTFACE; i++) {
 if (uv_layers & (1 << i)) {
-  char attr_name[32];
+  char attr_name[32], attr_safe_name[GPU_MAX_SAFE_ATTRIB_NAME];
   const char *layer_name = CustomData_get_layer_name(cd_ldata, CD_MLOOPUV, 
i);
-  uint hash = BLI_ghashutil_strhash_p(layer_name);
+
+  GPU_vertformat_safe_attrib_name(layer_name, attr_safe_name, 
GPU_MAX_SAFE_ATTRIB_NAME);
   /* UV layer name. */
-  BLI_snprintf(attr_name, sizeof(attr_name), "u%u", hash);
+  BLI_snprintf(attr_name, sizeof(attr_name), "u%s", attr_safe_name);
   GPU_vertformat_attr_add(, attr_name, GPU_COMP_F32, 2, 
GPU_FETCH_FLOAT);
   /* Auto layer name. */
-  BLI_snprintf(attr_name, sizeof(attr_name), "a%u", hash);
+  BLI_snprintf(attr_name, sizeof(attr_name), "a%s", attr_safe_name);
   GPU_vertformat_alias_add(, attr_name);
   /* Active render layer name. */
   if (i == CustomData_get_render_layer(cd_ldata, CD_MLOOPUV)) {
@@ -1610,11 +1604,11 @@ static void *extract_uv_tan_init(const MeshRenderData 
*mr, void *buf)
 
   for (int i = 0; i < MAX_MTFACE; i++) {
 if (tan_layers & (1 << i)) {
-  char attr_name[32];
+  char attr_name[32], attr_safe_name[GPU_MAX_SAFE_ATTRIB_NAME];
   const char *layer_name = CustomData_get_layer_name(cd_ldata, CD_MLOOPUV, 
i);
-  uint hash = BLI_ghashutil_strhash_p(layer_name);
+  GPU_vertformat_safe_attrib_name(layer_name, attr_safe_name, 
GPU_MAX_SAFE_ATTRIB_NAME);
   /* Tangent layer name. */
-  BLI_snprintf(attr_name, sizeof(attr_name), "t%u", hash);
+  BLI_snprintf(attr_name, sizeof(attr_name), "t%s", attr_safe_name);
   GPU_vertformat_attr_add(, attr_name, GPU_COMP_F32, 4, 
GPU_FETCH_FLOAT);
   /* Active render layer name. */
   if (i == CustomData_get_render_layer(cd_ldata, CD_MLOOPUV)) {
@@ -1687,10 +1681,10 @@ static void *extract_uv_tan_init(const MeshRenderData 
*mr, void *buf)
   }
 
   if (use_orco_tan) {
-char attr_name[32];
+char attr_name[32], attr_safe_name[GPU_MAX_SAFE_ATTRIB_NAME];
 const char *layer_name = CustomData_get_layer_name(cd_ldata, CD_TANGENT, 
0);
-uint hash = BLI_ghashutil_strhash_p(layer_name);
-BLI_snprintf(attr_name, sizeof(*attr_name), "t%u", hash);
+GPU_vertformat_safe_attrib_name(layer_name, attr_safe_name, 
GPU_MAX_SAFE_ATTRIB_NAME);
+BLI_snprintf(attr_name, sizeof(*attr_name), "t%s", attr_safe_name);
 GPU_vertformat_attr_add(, attr_name, GPU_COMP_F32, 4, 
GPU_FETCH_FLOAT);
 GPU_vertformat_alias_add(, "t");
 GPU_vertformat_alias_add(, "at");
@@ -1779,20 +1773,13 @@ static void *extract_vcol_init(const MeshRenderData 
*mr, void *buf)
   CustomData *cd_ldata = >me->ldata;
   uint32_t vcol_layers = mr->cache->cd_used.vcol;
 
-  /* XXX FIXME XXX */
-  /* We use a hash to identify each data layer based on its name.
-   * Gawain then search for this name in the current shader and bind if it 
exists.
-   * NOTE : This is prone to hash collision.
-   * One solution to hash collision would be to format the cd layer name
-   * to a safe glsl var name, but without name clash.
-   * NOTE 2 : Replicate changes to code_generate_vertex_new() in gpu_codegen.c 
*/
   for (int i = 0; i < 8; i++) {
 if (vcol_layers & (1 << i)) {
-  char 

[Bf-blender-cvs] [67f49f9c03c] master: Cleanup: fix compiler warnings

2019-08-14 Thread Brecht Van Lommel
Commit: 67f49f9c03c95eb3a62ece38db0ae8feafd4992e
Author: Brecht Van Lommel
Date:   Wed Aug 14 23:26:26 2019 +0200
Branches: master
https://developer.blender.org/rB67f49f9c03c95eb3a62ece38db0ae8feafd4992e

Cleanup: fix compiler warnings

===

M   source/blender/blenkernel/intern/mesh_convert.c
M   source/blender/editors/space_text/text_undo.c

===

diff --git a/source/blender/blenkernel/intern/mesh_convert.c 
b/source/blender/blenkernel/intern/mesh_convert.c
index ee060a117dc..3a2ba078dce 100644
--- a/source/blender/blenkernel/intern/mesh_convert.c
+++ b/source/blender/blenkernel/intern/mesh_convert.c
@@ -978,7 +978,7 @@ static void curve_to_mesh_eval_ensure(Object *object)
*
* So we create temporary copy of the object which will use same data as the 
original bevel, but
* will have no modifiers. */
-  Object bevel_object = {NULL};
+  Object bevel_object = {{NULL}};
   if (remapped_curve.bevobj != NULL) {
 bevel_object = *remapped_curve.bevobj;
 BLI_listbase_clear(_object.modifiers);
@@ -986,7 +986,7 @@ static void curve_to_mesh_eval_ensure(Object *object)
   }
 
   /* Same thing for taper. */
-  Object taper_object = {NULL};
+  Object taper_object = {{NULL}};
   if (remapped_curve.taperobj != NULL) {
 taper_object = *remapped_curve.taperobj;
 BLI_listbase_clear(_object.modifiers);
diff --git a/source/blender/editors/space_text/text_undo.c 
b/source/blender/editors/space_text/text_undo.c
index a6393291f9a..4a628cf70e4 100644
--- a/source/blender/editors/space_text/text_undo.c
+++ b/source/blender/editors/space_text/text_undo.c
@@ -187,6 +187,7 @@ static bool text_undosys_step_encode(struct bContext *C,
 
   Text *text = us->text_ref.ptr;
   BLI_assert(text == CTX_data_edit_text(C));
+  UNUSED_VARS_NDEBUG(C);
 
   us->step.data_size += text_undosys_step_encode_to_state(>states[1], 
text);

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


[Bf-blender-cvs] [51ff1f39f67] soc-2019-bevel-profiles: Bevel Modifier: Separate Inner and Outer Miter Types

2019-08-14 Thread Hans Goudey
Commit: 51ff1f39f673421349b9d15c82c3b51783f9c73b
Author: Hans Goudey
Date:   Wed Aug 14 17:13:01 2019 -0400
Branches: soc-2019-bevel-profiles
https://developer.blender.org/rB51ff1f39f673421349b9d15c82c3b51783f9c73b

Bevel Modifier: Separate Inner and Outer Miter Types

The inner miter shouldn't have a patch option so there are now two
separate enums for inner and outer. The bevel tool's RNA is already
like this.

===

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

===

diff --git a/source/blender/makesrna/intern/rna_modifier.c 
b/source/blender/makesrna/intern/rna_modifier.c
index aa5d748f7cf..c3036f0a742 100644
--- a/source/blender/makesrna/intern/rna_modifier.c
+++ b/source/blender/makesrna/intern/rna_modifier.c
@@ -3505,10 +3505,16 @@ static void rna_def_modifier_bevel(BlenderRNA *brna)
   {0, NULL, 0, NULL, NULL},
   };
 
-  static EnumPropertyItem prop_miter_items[] = {
-  {MOD_BEVEL_MITER_SHARP, "MITER_SHARP", 0, "Sharp", "Default sharp 
miter"},
-  {MOD_BEVEL_MITER_PATCH, "MITER_PATCH", 0, "Patch", "Miter with extra 
corner"},
-  {MOD_BEVEL_MITER_ARC, "MITER_ARC", 0, "Arc", "Miter with curved arc"},
+  static const EnumPropertyItem prop_miter_outer_items[] = {
+  {MOD_BEVEL_MITER_SHARP, "MITER_SHARP", 0, "Sharp", "Outside of miter is 
sharp"},
+  {MOD_BEVEL_MITER_PATCH, "MITER_PATCH", 0, "Patch", "Outside of miter is 
squared-off patch"},
+  {MOD_BEVEL_MITER_ARC, "MITER_ARC", 0, "Arc", "Outside of miter is arc"},
+  {0, NULL, 0, NULL, NULL},
+  };
+
+  static const EnumPropertyItem prop_miter_inner_items[] = {
+  {MOD_BEVEL_MITER_SHARP, "MITER_SHARP", 0, "Sharp", "Inside of miter is 
sharp"},
+  {MOD_BEVEL_MITER_ARC, "MITER_ARC", 0, "Arc", "Inside of miter is arc"},
   {0, NULL, 0, NULL, NULL},
   };
 
@@ -3622,13 +3628,13 @@ static void rna_def_modifier_bevel(BlenderRNA *brna)
 
   prop = RNA_def_property(srna, "miter_outer", PROP_ENUM, PROP_NONE);
   RNA_def_property_enum_sdna(prop, NULL, "miter_outer");
-  RNA_def_property_enum_items(prop, prop_miter_items);
+  RNA_def_property_enum_items(prop, prop_miter_outer_items);
   RNA_def_property_ui_text(prop, "Outer Miter", "Pattern to use for outside of 
miters");
   RNA_def_property_update(prop, 0, "rna_Modifier_update");
 
   prop = RNA_def_property(srna, "miter_inner", PROP_ENUM, PROP_NONE);
   RNA_def_property_enum_sdna(prop, NULL, "miter_inner");
-  RNA_def_property_enum_items(prop, prop_miter_items);
+  RNA_def_property_enum_items(prop, prop_miter_inner_items);
   RNA_def_property_ui_text(prop, "Inner Miter", "Pattern to use for inside of 
miters");
   RNA_def_property_update(prop, 0, "rna_Modifier_update");

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


[Bf-blender-cvs] [9e12fe36aa4] soc-2019-bevel-profiles: Bevel Tool UI: Offset field label uses offset type

2019-08-14 Thread Hans Goudey
Commit: 9e12fe36aa4617e71148cb5a01f23559fc6ce92b
Author: Hans Goudey
Date:   Wed Aug 14 13:26:44 2019 -0400
Branches: soc-2019-bevel-profiles
https://developer.blender.org/rB9e12fe36aa4617e71148cb5a01f23559fc6ce92b

Bevel Tool UI: Offset field label uses offset type

===

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

===

diff --git a/source/blender/editors/mesh/editmesh_bevel.c 
b/source/blender/editors/mesh/editmesh_bevel.c
index fe68ff47c88..cdd88d838e6 100644
--- a/source/blender/editors/mesh/editmesh_bevel.c
+++ b/source/blender/editors/mesh/editmesh_bevel.c
@@ -857,6 +857,9 @@ static void edbm_bevel_ui(bContext *C, wmOperator *op)
   uiLayout *layout = op->layout;
   uiLayout *row, *col, *split;
   PointerRNA ptr, toolsettings_ptr;
+  const char *offset_name;
+
+
 
   RNA_pointer_create(NULL, op->type->srna, op->properties, );
 
@@ -864,7 +867,18 @@ static void edbm_bevel_ui(bContext *C, wmOperator *op)
 uiItemR(layout, , "offset_pct", 0, NULL, ICON_NONE);
   }
   else {
-uiItemR(layout, , "offset", 0, NULL, ICON_NONE);
+switch (RNA_enum_get(, "offset_type")) {
+  case BEVEL_AMT_DEPTH:
+offset_name = "Depth";
+break;
+  case BEVEL_AMT_WIDTH:
+offset_name = "Width";
+break;
+  case BEVEL_AMT_OFFSET:
+offset_name = "Offset";
+break;
+}
+uiItemR(layout, , "offset", 0, offset_name, ICON_NONE);
   }
   row = uiLayoutRow(layout, true);
   uiItemR(row, , "offset_type", UI_ITEM_R_EXPAND, NULL, ICON_NONE);

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


[Bf-blender-cvs] [06f3847ee4a] soc-2019-bevel-profiles: Profile Widget: New presets: Two mouldings, steps

2019-08-14 Thread Hans Goudey
Commit: 06f3847ee4ab94b0b308355fc279497c2ef3db79
Author: Hans Goudey
Date:   Wed Aug 14 13:25:14 2019 -0400
Branches: soc-2019-bevel-profiles
https://developer.blender.org/rB06f3847ee4ab94b0b308355fc279497c2ef3db79

Profile Widget: New presets: Two mouldings, steps

===

M   source/blender/blenkernel/intern/profile_widget.c
M   source/blender/editors/interface/interface_templates.c
M   source/blender/makesdna/DNA_profilewidget_types.h
M   source/blender/makesrna/intern/rna_profile.c

===

diff --git a/source/blender/blenkernel/intern/profile_widget.c 
b/source/blender/blenkernel/intern/profile_widget.c
index 0818011257e..cfe0dec94a8 100644
--- a/source/blender/blenkernel/intern/profile_widget.c
+++ b/source/blender/blenkernel/intern/profile_widget.c
@@ -316,14 +316,33 @@ void BKE_profilewidget_reverse(ProfileWidget *prwdgt)
   prwdgt->path = new_pts;
 }
 
+/** Puts the widget's control points in a step pattern, setting vector 
interpolation */
+static void profilewidget_build_steps(ProfileWidget *prwdgt)
+{
+  int n, step_x, step_y;
+  float n_steps_x, n_steps_y;
+
+  n = prwdgt->totpoint;
+
+  n_steps_x = (n % 2 == 0) ? n : (n - 1);
+  n_steps_y = (n % 2 == 0) ? (n - 2) : (n - 1);
+
+  for (int i = 0; i < n; i++) {
+step_x = (i + 1) / 2;
+step_y = i / 2;
+prwdgt->path[i].x = 1.0f - ((float)(2 * step_x) / n_steps_x);
+prwdgt->path[i].y = (float)(2 * step_y) / n_steps_y;
+prwdgt->path[i].flag = PROF_HANDLE_VECTOR;
+  }
+}
+
 /** Resets the profile to the current preset.
- * \note: Requiress profilewidget_changed call after */
+ * \note: Requires profilewidget_changed call after */
 void BKE_profilewidget_reset(ProfileWidget *prwdgt)
 {
 #if DEBUG_PRWDGT
   printf("PROFILEPATH RESET\n");
 #endif
-
   if (prwdgt->path) {
 MEM_freeN(prwdgt->path);
   }
@@ -336,8 +355,21 @@ void BKE_profilewidget_reset(ProfileWidget *prwdgt)
 case PROF_PRESET_SUPPORTS:
   prwdgt->totpoint = 12;
   break;
-case PROF_PRESET_EXAMPLE1:
-  prwdgt->totpoint = 23;
+case PROF_PRESET_CORNICE:
+  prwdgt->totpoint = 13;
+  break;
+case PROF_PRESET_CROWN:
+  prwdgt->totpoint = 11;
+  break;
+case PROF_PRESET_STEPS:
+  /* Use dynamic number of control points based on the set number of 
segments. */
+  if (prwdgt->totsegments == 0) {
+/* If totsegments hasn't been set, use the number of control points 
for 8 steps. */
+prwdgt->totpoint = 17;
+  }
+  else {
+prwdgt->totpoint = prwdgt->totsegments + 1;
+  }
   break;
   }
 
@@ -356,63 +388,86 @@ void BKE_profilewidget_reset(ProfileWidget *prwdgt)
   prwdgt->path[0].flag = PROF_HANDLE_VECTOR;
   prwdgt->path[1].x = 1.0;
   prwdgt->path[1].y = 0.5;
+  prwdgt->path[1].flag = PROF_HANDLE_VECTOR;
   for (int i = 1; i < 10; i++) {
 prwdgt->path[i + 1].x = 1.0f - (0.5f * (1.0f - cosf((float)((i / 9.0) 
* M_PI_2;
 prwdgt->path[i + 1].y = 0.5f + 0.5f * sinf((float)((i / 9.0) * 
M_PI_2));
   }
   prwdgt->path[10].x = 0.5;
   prwdgt->path[10].y = 1.0;
+  prwdgt->path[10].flag = PROF_HANDLE_VECTOR;
   prwdgt->path[11].x = 0.0;
   prwdgt->path[11].y = 1.0;
   prwdgt->path[11].flag = PROF_HANDLE_VECTOR;
   break;
-case PROF_PRESET_EXAMPLE1: /* HANS-TODO: Don't worry, this is just 
temporary */
+case PROF_PRESET_CORNICE:
+  prwdgt->path[0].x = 1.0f;
+  prwdgt->path[0].y = 0.0f;
+  prwdgt->path[0].flag = PROF_HANDLE_VECTOR;
+  prwdgt->path[1].x = 1.0f;
+  prwdgt->path[1].y = 0.125f;
+  prwdgt->path[1].flag = PROF_HANDLE_VECTOR;
+  prwdgt->path[2].x = 0.92f;
+  prwdgt->path[2].y = 0.16f;
+  prwdgt->path[3].x = 0.875f;
+  prwdgt->path[3].y = 0.25f;
+  prwdgt->path[3].flag = PROF_HANDLE_VECTOR;
+  prwdgt->path[4].x = 0.8f;
+  prwdgt->path[4].y = 0.25f;
+  prwdgt->path[4].flag = PROF_HANDLE_VECTOR;
+  prwdgt->path[5].x = 0.733f;
+  prwdgt->path[5].y = 0.433f;
+  prwdgt->path[6].x = 0.582f;
+  prwdgt->path[6].y = 0.522f;
+  prwdgt->path[7].x = 0.4f;
+  prwdgt->path[7].y = 0.6f;
+  prwdgt->path[8].x = 0.289f;
+  prwdgt->path[8].y = 0.727f;
+  prwdgt->path[9].x = 0.25f;
+  prwdgt->path[9].y = 0.925f;
+  prwdgt->path[9].flag = PROF_HANDLE_VECTOR;
+  prwdgt->path[10].x = 0.175f;
+  prwdgt->path[10].y = 0.925f;
+  prwdgt->path[10].flag = PROF_HANDLE_VECTOR;
+  prwdgt->path[11].x = 0.175f;
+  prwdgt->path[11].y = 1.0f;
+  prwdgt->path[11].flag = PROF_HANDLE_VECTOR;
+  prwdgt->path[12].x = 0.0f;
+  prwdgt->path[12].y = 1.0f;
+  prwdgt->path[12].flag = PROF_HANDLE_VECTOR;
+  break;
+case PROF_PRESET_CROWN:
   prwdgt->path[0].x = 1.0f;
   prwdgt->path[0].y = 0.0f;
+  prwdgt->path[0].flag = PROF_HANDLE_VECTOR;
   

[Bf-blender-cvs] [6e11d5f6fc4] soc-2019-outliner: Outliner: Activate on range select with no active element

2019-08-14 Thread Nathan Craddock
Commit: 6e11d5f6fc4b43451092251d47181b515650cd6b
Author: Nathan Craddock
Date:   Wed Aug 14 15:04:37 2019 -0600
Branches: soc-2019-outliner
https://developer.blender.org/rB6e11d5f6fc4b43451092251d47181b515650cd6b

Outliner: Activate on range select with no active element

If no active element exists in the outliner, activate the cursor
element instead of only selecting.

===

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

===

diff --git a/source/blender/editors/space_outliner/outliner_select.c 
b/source/blender/editors/space_outliner/outliner_select.c
index b0f8d7d6408..19fd4511e50 100644
--- a/source/blender/editors/space_outliner/outliner_select.c
+++ b/source/blender/editors/space_outliner/outliner_select.c
@@ -1269,13 +1269,14 @@ static void do_outliner_range_select_recursive(ListBase 
*lb,
 }
 
 /* Select a range of items between cursor and active element */
-static void do_outliner_range_select(SpaceOutliner *soops, TreeElement *cursor)
+static void do_outliner_range_select(bContext *C, SpaceOutliner *soops, 
TreeElement *cursor)
 {
   TreeElement *active = outliner_find_element_with_flag(>tree, 
TSE_ACTIVE);
   outliner_flag_set(>tree, TSE_ACTIVE_WALK, false);
 
   if (!active) {
-TREESTORE(cursor)->flag |= TSE_SELECTED | TSE_ACTIVE | TSE_ACTIVE_WALK;
+outliner_item_select(soops, cursor, false, false);
+outliner_item_do_activate_from_tree_element(C, cursor, TREESTORE(cursor), 
false, false);
 return;
   }
 
@@ -1292,8 +1293,8 @@ static void do_outliner_range_select(SpaceOutliner 
*soops, TreeElement *cursor)
 
   /* If active is not selected, just select the element under the cursor */
   if (!active_selected || !outliner_is_element_visible(active)) {
-tselem->flag &= ~TSE_ACTIVE;
-TREESTORE(cursor)->flag |= TSE_SELECTED | TSE_ACTIVE | TSE_ACTIVE_WALK;
+outliner_item_select(soops, cursor, false, false);
+outliner_item_do_activate_from_tree_element(C, cursor, TREESTORE(cursor), 
false, false);
 return;
   }
 
@@ -1311,7 +1312,7 @@ static bool outliner_is_co_within_restrict_columns(const 
SpaceOutliner *soops,
 }
 
 /**
- * A version of #outliner_item_do_acticate_from_cursor that takes the tree 
element directly.
+ * A version of #outliner_item_do_activate_from_cursor that takes the tree 
element directly.
  * and doesn't depend on the pointer position.
  *
  * This allows us to simulate clicking on an item without dealing with the 
mouse cursor.
@@ -1379,7 +1380,7 @@ static int outliner_item_do_activate_from_cursor(bContext 
*C,
 TreeStoreElem *activate_tselem = TREESTORE(activate_te);
 
 if (use_range) {
-  do_outliner_range_select(soops, activate_te);
+  do_outliner_range_select(C, soops, activate_te);
 }
 else {
   outliner_item_select(soops, activate_te, extend, extend);

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


[Bf-blender-cvs] [90e07364ac7] soc-2019-outliner: Outliner: Clear dirty flag after sync from outliner

2019-08-14 Thread Nathan Craddock
Commit: 90e07364ac70ed8f2f33f2b07f1f81388ad8667e
Author: Nathan Craddock
Date:   Wed Aug 14 15:05:42 2019 -0600
Branches: soc-2019-outliner
https://developer.blender.org/rB90e07364ac70ed8f2f33f2b07f1f81388ad8667e

Outliner: Clear dirty flag after sync from outliner

This prevents syncing to the outliner on draw which deselects
non-syncable data like mesh data and collections.

===

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

===

diff --git a/source/blender/editors/space_outliner/outliner_sync.c 
b/source/blender/editors/space_outliner/outliner_sync.c
index 48421f2a641..63c7b7fe4a0 100644
--- a/source/blender/editors/space_outliner/outliner_sync.c
+++ b/source/blender/editors/space_outliner/outliner_sync.c
@@ -362,22 +362,17 @@ void ED_outliner_select_sync_from_outliner(bContext *C, 
SpaceOutliner *soops)
 
   selected_items_free(_items);
 
-  /* Clear sync select dirty state from current selection type */
+  /* Tag for updates */
   if (sync_types.object) {
 DEG_id_tag_update(>id, ID_RECALC_SELECT);
 WM_event_add_notifier(C, NC_SCENE | ND_OB_SELECT, scene);
-soops->sync_select_dirty &= ~WM_OUTLINER_SYNC_SELECT_FROM_OBJECT;
-  }
-  if (sync_types.edit_bone) {
-soops->sync_select_dirty &= ~WM_OUTLINER_SYNC_SELECT_FROM_EDIT_BONE;
-  }
-  if (sync_types.pose_bone) {
-soops->sync_select_dirty &= ~WM_OUTLINER_SYNC_SELECT_FROM_POSE_BONE;
   }
   if (sync_types.sequence) {
 WM_event_add_notifier(C, NC_SCENE | ND_SEQUENCER | NA_SELECTED, scene);
-soops->sync_select_dirty &= ~WM_OUTLINER_SYNC_SELECT_FROM_SEQUENCE;
   }
+
+  /* Clear outliner sync select dirty flag to prevent a sync to the outliner 
on draw */
+  soops->sync_select_dirty &= ~WM_OUTLINER_SYNC_SELECT_FROM_ALL;
 }
 
 static void outliner_select_sync_from_object(ViewLayer *view_layer,

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


[Bf-blender-cvs] [5d52524b961] soc-2019-outliner: Outliner: Remove parent set popup menu for specific types

2019-08-14 Thread Nathan Craddock
Commit: 5d52524b961f14da32a9813f33d3a7d41135fc98
Author: Nathan Craddock
Date:   Wed Aug 14 14:28:22 2019 -0600
Branches: soc-2019-outliner
https://developer.blender.org/rB5d52524b961f14da32a9813f33d3a7d41135fc98

Outliner: Remove parent set popup menu for specific types

Removes the popup for setting the parent to curves, lattices, and
armatures. It makes more sense from an outliner perspective to set
the parent to objects only.

===

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

===

diff --git a/source/blender/editors/space_outliner/outliner_dragdrop.c 
b/source/blender/editors/space_outliner/outliner_dragdrop.c
index b58a0f34703..6031ba5cffc 100644
--- a/source/blender/editors/space_outliner/outliner_dragdrop.c
+++ b/source/blender/editors/space_outliner/outliner_dragdrop.c
@@ -336,7 +336,7 @@ static void parent_drop_set_parents(
   Scene *scene = (Scene *)outliner_search_back(soops, te, ID_SCE);
 
   if (scene == NULL) {
-/* currently outlier organized in a way, that if there's no parent scene
+/* currently outliner organized in a way, that if there's no parent scene
  * element for object it means that all displayed objects belong to
  * active scene and parenting them is allowed (sergey)
  */
@@ -345,13 +345,15 @@ static void parent_drop_set_parents(
   }
 
   bool parent_set = false;
+  bool linked_objects = false;
+
   for (wmDragID *drag_id = drag; drag_id; drag_id = drag_id->next) {
 if (GS(drag_id->id->name) == ID_OB) {
   Object *object = (Object *)drag_id->id;
 
   /* Do nothing to linked data */
   if (ID_IS_LINKED(object)) {
-BKE_report(reports, RPT_INFO, "Can't edit library linked object");
+linked_objects = true;
 continue;
   }
 
@@ -362,6 +364,10 @@ static void parent_drop_set_parents(
 }
   }
 
+  if (linked_objects) {
+BKE_report(reports, RPT_INFO, "Can't edit library linked object(s)");
+  }
+
   if (parent_set) {
 DEG_relations_tag_update(bmain);
 WM_event_add_notifier(C, NC_OBJECT | ND_TRANSFORM, NULL);
@@ -369,210 +375,6 @@ static void parent_drop_set_parents(
   }
 }
 
-typedef struct ParentDropData {
-  Object *parent;
-  ListBase *drag_items;
-  short type;
-} ParentDropData;
-
-static void parent_drop_menu_callback(bContext *C, void *data, int event)
-{
-  ParentDropData *drag_data = (ParentDropData *)data;
-
-  wmDragID *drag = drag_data->drag_items->first;
-  parent_drop_set_parents(C, NULL, drag, drag_data->parent, event);
-
-  BLI_freelistN(drag_data->drag_items);
-  MEM_freeN(drag_data->drag_items);
-  MEM_freeN(drag_data);
-}
-
-static uiBlock *parent_drop_menu(bContext *C, ARegion *ar, void *data)
-{
-  uiBlock *block;
-  ParentDropData *drag_data = (ParentDropData *)data;
-
-  block = UI_block_begin(C, ar, __func__, UI_EMBOSS);
-  UI_block_flag_enable(block, UI_BLOCK_MOVEMOUSE_QUIT);
-  UI_block_func_butmenu_set(block, parent_drop_menu_callback, drag_data);
-
-  short menu_width = 10 * UI_UNIT_X;
-  short y_position = 0;
-
-  uiDefBut(block,
-   UI_BTYPE_LABEL,
-   0,
-   IFACE_("Set Parent To"),
-   0,
-   y_position,
-   menu_width,
-   UI_UNIT_Y,
-   NULL,
-   0.0,
-   0.0,
-   0,
-   0,
-   "");
-
-  uiDefBut(block,
-   UI_BTYPE_BUT_MENU,
-   0,
-   IFACE_("Object"),
-   0,
-   y_position -= UI_UNIT_Y,
-   menu_width,
-   UI_UNIT_Y,
-   NULL,
-   0.0,
-   0.0,
-   0,
-   PAR_OBJECT,
-   "");
-
-  if (drag_data->type == OB_ARMATURE) {
-uiDefBut(block,
- UI_BTYPE_BUT_MENU,
- 0,
- IFACE_("Armature Deform"),
- 0,
- y_position -= UI_UNIT_Y,
- menu_width,
- UI_UNIT_Y,
- NULL,
- 0.0,
- 0.0,
- 0,
- PAR_ARMATURE,
- "");
-
-uiDefBut(block,
- UI_BTYPE_BUT_MENU,
- 0,
- IFACE_("   With Empty Groups"),
- 0,
- y_position -= UI_UNIT_Y,
- menu_width,
- UI_UNIT_Y,
- NULL,
- 0.0,
- 0.0,
- 0,
- PAR_ARMATURE_NAME,
- "");
-
-uiDefBut(block,
- UI_BTYPE_BUT_MENU,
- 0,
- IFACE_("   With Envelope Weights"),
- 0,
- y_position -= UI_UNIT_Y,
- menu_width,
- UI_UNIT_Y,
- NULL,
- 0.0,
- 0.0,
- 0,
- PAR_ARMATURE_ENVELOPE,
- "");
-
-uiDefBut(block,
- UI_BTYPE_BUT_MENU,
- 0,
- IFACE_("   With Automatic Weights"),
- 0,
- y_position -= 

[Bf-blender-cvs] [9e7c48575a3] soc-2019-openxr: Linux: Add OpenXR-SDK to install_deps.sh

2019-08-14 Thread Julian Eisel
Commit: 9e7c48575a3c39044779a595ff66481bcff80931
Author: Julian Eisel
Date:   Wed Aug 14 22:59:33 2019 +0200
Branches: soc-2019-openxr
https://developer.blender.org/rB9e7c48575a3c39044779a595ff66481bcff80931

Linux: Add OpenXR-SDK to install_deps.sh

===

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 e4f03480385..f1d69be4db6 100755
--- a/build_files/build_environment/install_deps.sh
+++ b/build_files/build_environment/install_deps.sh
@@ -27,16 +27,16 @@ getopt \
 -o s:i:t:h \
 --long 
source:,install:,tmp:,info:,threads:,help,show-deps,no-sudo,no-build,no-confirm,\
 with-all,with-opencollada,with-jack,with-embree,\
-ver-ocio:,ver-oiio:,ver-llvm:,ver-osl:,ver-osd:,ver-openvdb:,\
+ver-ocio:,ver-oiio:,ver-llvm:,ver-osl:,ver-osd:,ver-openvdb:,ver-openxr\
 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-ffmpeg,force-opencollada,force-alembic,force-embree,force-openxr,\
 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-ffmpeg,build-opencollada,build-alembic,build-embree,build-openxr,\
 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-ffmpeg,skip-opencollada,skip-alembic,skip-embree,skip-openxr \
 -- "$@" \
 )
 
@@ -139,6 +139,9 @@ ARGUMENTS_INFO="\"COMMAND LINE ARGUMENTS:
 --ver-openvdb=
 Force version of OpenVDB library.
 
+--ver-openxr=
+Force version of OpenXR-SDK.
+
 Note about the --ver-foo options:
 It may not always work as expected (some libs are actually checked out 
from a git rev...), yet it might help
 to fix some build issues (like LLVM mismatch with the version used by 
your graphic system).
@@ -188,6 +191,9 @@ ARGUMENTS_INFO="\"COMMAND LINE ARGUMENTS:
 --build-ffmpeg
 Force the build of FFMpeg.
 
+--build-openxr
+Force the build of OpenXR-SDK.
+
 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
@@ -243,6 +249,9 @@ ARGUMENTS_INFO="\"COMMAND LINE ARGUMENTS:
 --force-ffmpeg
 Force the rebuild of FFMpeg.
 
+--force-openxr
+Force the rebuild of OpenXR-SDK.
+
 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)!
@@ -289,7 +298,10 @@ ARGUMENTS_INFO="\"COMMAND LINE ARGUMENTS:
 Unconditionally skip Embree installation/building.
 
 --skip-ffmpeg
-Unconditionally skip FFMpeg installation/building.\""
+Unconditionally skip FFMpeg installation/building.
+
+--skip-openxr
+Unconditionally skip OpenXR-SDK installation/building.\""
 
 # Main Vars #
 
@@ -397,6 +409,11 @@ FFMPEG_FORCE_REBUILD=false
 FFMPEG_SKIP=false
 _ffmpeg_list_sep=";"
 
+OPENXR_VERSION="1.0.0"
+OPENXR_FORCE_BUILD=false
+OPENXR_FORCE_REBUILD=false
+OPENXR_SKIP=false
+
 # FFMPEG optional libs.
 VORBIS_USE=false
 VORBIS_DEV=""
@@ -559,6 +576,11 @@ while true; do
   OPENVDB_VERSION_MIN=$OPENVDB_VERSION
   shift; shift; continue
 ;;
+--ver-openxr)
+  OPENXR_VERSION="$2"
+  OPENXR_VERSION_MIN=$OPENXR_VERSION
+  shift; shift; continue
+;;
 --build-all)
   PYTHON_FORCE_BUILD=true
   NUMPY_FORCE_BUILD=true
@@ -574,6 +596,7 @@ while true; do
   EMBREE_FORCE_BUILD=true
   FFMPEG_FORCE_BUILD=true
   ALEMBIC_FORCE_BUILD=true
+  OPENXR_FORCE_BUILD=true
   shift; continue
 ;;
 --build-python)
@@ -622,6 +645,9 @@ while true; do
 --build-alembic)
   ALEMBIC_FORCE_BUILD=true; shift; continue
 ;;
+--build-openxr)
+  OPENXR_FORCE_BUILD=true; shift; continue
+;;
 --force-all)
   PYTHON_FORCE_REBUILD=true
   NUMPY_FORCE_REBUILD=true
@@ -637,6 +663,7 @@ while true; do
   EMBREE_FORCE_REBUILD=true
   FFMPEG_FORCE_REBUILD=true
   ALEMBIC_FORCE_REBUILD=true
+  OPENXR_FORCE_REBUILD=true
   shift; continue
 ;;
 --force-python)
@@ -683,6 +710,9 @@ while true; do
 --force-alembic)
   ALEMBIC_FORCE_REBUILD=true; shift; continue
 ;;
+--force-openxr)
+  OPENXR_FORCE_REBUILD=true; shift; continue
+;;
 --skip-python)
   PYTHON_SKIP=true; shift; 

[Bf-blender-cvs] [037cf920b42] master: Sculpt: mesh abstraction API

2019-08-14 Thread Pablo Dobarro
Commit: 037cf920b42d9b3404687235c524516e50a31561
Author: Pablo Dobarro
Date:   Wed Aug 14 22:54:23 2019 +0200
Branches: master
https://developer.blender.org/rB037cf920b42d9b3404687235c524516e50a31561

Sculpt: mesh abstraction API

These functions make possible porting the tools from the sculpt branch, making 
them compatible with PBVH_FACES and PBVH_BMESH without duplicating the code. 
They can also help to simplify some existing code.

These functions should not be used when working with PBVH_GRIDS data in 
SculptSession. PBVH_GRIDS needs to be removed from the sculpt code and 
converted to PBVH_FACES to be compatible with this API.

Reviewed By: brecht

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

===

M   source/blender/blenkernel/BKE_paint.h
M   source/blender/blenkernel/BKE_pbvh.h
M   source/blender/editors/sculpt_paint/sculpt.c

===

diff --git a/source/blender/blenkernel/BKE_paint.h 
b/source/blender/blenkernel/BKE_paint.h
index cbe250d0ac8..37667599488 100644
--- a/source/blender/blenkernel/BKE_paint.h
+++ b/source/blender/blenkernel/BKE_paint.h
@@ -259,6 +259,8 @@ typedef struct SculptSession {
 
   struct StrokeCache *cache;
 
+  int active_vertex_index;
+
   union {
 struct {
   struct SculptVertexPaintGeomMap gmap;
diff --git a/source/blender/blenkernel/BKE_pbvh.h 
b/source/blender/blenkernel/BKE_pbvh.h
index 3806868e060..62544efad2c 100644
--- a/source/blender/blenkernel/BKE_pbvh.h
+++ b/source/blender/blenkernel/BKE_pbvh.h
@@ -301,6 +301,7 @@ typedef struct PBVHVertexIter {
   int gx;
   int gy;
   int i;
+  int index;
 
   /* grid */
   struct CCGElem **grids;
@@ -369,6 +370,7 @@ void pbvh_vertex_iter_init(PBVH *bvh, PBVHNode *node, 
PBVHVertexIter *vi, int mo
 continue; \
   vi.co = vi.mvert->co; \
   vi.no = vi.mvert->no; \
+  vi.index = vi.vert_indices[vi.i]; \
   if (vi.vmask) \
 vi.mask = [vi.vert_indices[vi.gx]]; \
 } \
@@ -385,6 +387,7 @@ void pbvh_vertex_iter_init(PBVH *bvh, PBVHNode *node, 
PBVHVertexIter *vi, int mo
 continue; \
   vi.co = vi.bm_vert->co; \
   vi.fno = vi.bm_vert->no; \
+  vi.index = BM_elem_index_get(vi.bm_vert); \
   vi.mask = BM_ELEM_CD_GET_VOID_P(vi.bm_vert, vi.cd_vert_mask_offset); 
\
 }
 
diff --git a/source/blender/editors/sculpt_paint/sculpt.c 
b/source/blender/editors/sculpt_paint/sculpt.c
index efaac6e97cf..cdd82b8ced3 100644
--- a/source/blender/editors/sculpt_paint/sculpt.c
+++ b/source/blender/editors/sculpt_paint/sculpt.c
@@ -92,6 +92,235 @@
 #include 
 #include 
 
+/* Sculpt PBVH abstraction API */
+
+/* Do not use these functions while working with PBVH_GRIDS data in 
SculptSession */
+
+static int sculpt_active_vertex_get(SculptSession *ss)
+{
+  switch (BKE_pbvh_type(ss->pbvh)) {
+case PBVH_FACES:
+  return ss->active_vertex_index;
+case PBVH_BMESH:
+  return ss->active_vertex_index;
+default:
+  return 0;
+  }
+}
+
+static int sculpt_vertex_count_get(SculptSession *ss)
+{
+  switch (BKE_pbvh_type(ss->pbvh)) {
+case PBVH_FACES:
+  return ss->totvert;
+case PBVH_BMESH:
+  return BM_mesh_elem_count(BKE_pbvh_get_bmesh(ss->pbvh), BM_VERT);
+default:
+  return 0;
+  }
+}
+
+static void sculpt_vertex_normal_get(SculptSession *ss, int index, float no[3])
+{
+  switch (BKE_pbvh_type(ss->pbvh)) {
+case PBVH_FACES:
+  normal_short_to_float_v3(no, ss->mvert[index].no);
+  return;
+case PBVH_BMESH:
+  copy_v3_v3(no, BM_vert_at_index(BKE_pbvh_get_bmesh(ss->pbvh), 
index)->no);
+default:
+  return;
+  }
+}
+
+static float *sculpt_vertex_co_get(SculptSession *ss, int index)
+{
+  switch (BKE_pbvh_type(ss->pbvh)) {
+case PBVH_FACES:
+  return ss->mvert[index].co;
+case PBVH_BMESH:
+  return BM_vert_at_index(BKE_pbvh_get_bmesh(ss->pbvh), index)->co;
+default:
+  return NULL;
+  }
+}
+
+static void sculpt_vertex_co_set(SculptSession *ss, int index, float co[3])
+{
+  switch (BKE_pbvh_type(ss->pbvh)) {
+case PBVH_FACES:
+  copy_v3_v3(ss->mvert[index].co, co);
+  return;
+case PBVH_BMESH:
+  copy_v3_v3(BM_vert_at_index(BKE_pbvh_get_bmesh(ss->pbvh), index)->co, 
co);
+  return;
+default:
+  return;
+  }
+}
+
+static void sculpt_vertex_mask_set(SculptSession *ss, int index, float mask)
+{
+  BMVert *v;
+  float *mask_p;
+  switch (BKE_pbvh_type(ss->pbvh)) {
+case PBVH_FACES:
+  ss->vmask[index] = mask;
+  return;
+case PBVH_BMESH:
+  v = BM_vert_at_index(BKE_pbvh_get_bmesh(ss->pbvh), index);
+  mask_p = BM_ELEM_CD_GET_VOID_P(v, CustomData_get_offset(>bm->vdata, 
CD_PAINT_MASK));
+  *(mask_p) = mask;
+  return;
+default:
+  return;
+  }
+}
+
+static float sculpt_vertex_mask_get(SculptSession *ss, int index)
+{
+  BMVert *v;
+  

[Bf-blender-cvs] [99bf3d275cd] soc-2019-outliner: Outliner: Openclose fixes

2019-08-14 Thread Nathan Craddock
Commit: 99bf3d275cdcdb69ab8046355d370482876de278
Author: Nathan Craddock
Date:   Wed Aug 14 14:16:26 2019 -0600
Branches: soc-2019-outliner
https://developer.blender.org/rB99bf3d275cdcdb69ab8046355d370482876de278

Outliner: Openclose fixes

Remove walk in / walk out support for walk navigation. Now left
and right arrow keys only close and open outliner element subtrees.

Fix click+drag on disclosure triangles not behaving as expected.
Now the dragged elements will be either opened or closed, using the
state of the first click+dragged element.

===

M   source/blender/editors/space_outliner/outliner_edit.c
M   source/blender/editors/space_outliner/outliner_intern.h
M   source/blender/editors/space_outliner/outliner_select.c

===

diff --git a/source/blender/editors/space_outliner/outliner_edit.c 
b/source/blender/editors/space_outliner/outliner_edit.c
index 1fe2b4f0fce..318d90d0dca 100644
--- a/source/blender/editors/space_outliner/outliner_edit.c
+++ b/source/blender/editors/space_outliner/outliner_edit.c
@@ -141,42 +141,25 @@ void OUTLINER_OT_highlight_update(wmOperatorType *ot)
 /* Toggle Open/Closed --- */
 
 /* Open or close a tree element, optionally toggling all children recursively 
*/
-bool outliner_item_openclose(TreeElement *te, bool toggle_all)
+void outliner_item_openclose(TreeElement *te, bool open, bool toggle_all)
 {
   TreeStoreElem *tselem = TREESTORE(te);
 
-  if (toggle_all) {
-/* Open all children if this element is closed, or if any children are 
closed */
-const bool open = (tselem->flag & TSE_CLOSED) ||
-  (outliner_flag_is_any_test(>subtree, TSE_CLOSED, 1));
-
-if (open) {
-  tselem->flag &= ~TSE_CLOSED;
-}
-else {
-  tselem->flag |= TSE_CLOSED;
-}
-
-outliner_flag_set(>subtree, TSE_CLOSED, !open);
-
-return true;
+  if (open) {
+tselem->flag &= ~TSE_CLOSED;
   }
   else {
-if (tselem->flag & TSE_CLOSED) {
-  tselem->flag &= ~TSE_CLOSED;
-}
-else {
-  tselem->flag |= TSE_CLOSED;
-}
-
-return true;
+tselem->flag |= TSE_CLOSED;
   }
 
-  return false;
+  if (toggle_all) {
+outliner_flag_set(>subtree, TSE_CLOSED, !open);
+  }
 }
 
 typedef struct OpenCloseData {
   TreeStoreElem *prev_tselem;
+  bool open;
   int x_location;
 } OpenCloseData;
 
@@ -198,9 +181,8 @@ static int outliner_item_openclose_modal(bContext *C, 
wmOperator *op, const wmEv
 
   /* Only toggle openclose on the same level as the first clicked element 
*/
   if (te->xs == data->x_location) {
-if (outliner_item_openclose(te, false)) {
-  ED_region_tag_redraw(ar);
-}
+outliner_item_openclose(te, data->open, false);
+ED_region_tag_redraw(ar);
   }
 }
 
@@ -233,7 +215,12 @@ static int outliner_item_openclose_invoke(bContext *C, 
wmOperator *op, const wmE
   TreeElement *te = outliner_find_item_at_y(soops, >tree, view_mval[1]);
 
   if (te && outliner_item_is_co_within_close_toggle(te, view_mval[0])) {
-outliner_item_openclose(te, toggle_all);
+TreeStoreElem *tselem = TREESTORE(te);
+
+const bool open = (tselem->flag & TSE_CLOSED) ||
+  (toggle_all && (outliner_flag_is_any_test(>subtree, 
TSE_CLOSED, 1)));
+
+outliner_item_openclose(te, open, toggle_all);
 ED_region_tag_redraw(ar);
 
 /* Only toggle once for single click toggling */
@@ -243,7 +230,8 @@ static int outliner_item_openclose_invoke(bContext *C, 
wmOperator *op, const wmE
 
 /* Store last expanded tselem and x coordinate of disclosure triangle */
 OpenCloseData *toggle_data = MEM_callocN(sizeof(OpenCloseData), 
"open_close_data");
-toggle_data->prev_tselem = TREESTORE(te);
+toggle_data->prev_tselem = tselem;
+toggle_data->open = open;
 toggle_data->x_location = te->xs;
 
 /* Store the first clicked on element */
diff --git a/source/blender/editors/space_outliner/outliner_intern.h 
b/source/blender/editors/space_outliner/outliner_intern.h
index 2dc0276e9a3..e37f3519653 100644
--- a/source/blender/editors/space_outliner/outliner_intern.h
+++ b/source/blender/editors/space_outliner/outliner_intern.h
@@ -354,7 +354,7 @@ void item_object_mode_exit_cb(struct bContext *C,
 
 void outliner_set_coordinates(struct ARegion *ar, struct SpaceOutliner *soops);
 
-bool outliner_item_openclose(TreeElement *te, bool toggle_all);
+void outliner_item_openclose(TreeElement *te, bool open, bool toggle_all);
 
 /* outliner_dragdrop.c */
 void outliner_dropboxes(void);
diff --git a/source/blender/editors/space_outliner/outliner_select.c 
b/source/blender/editors/space_outliner/outliner_select.c
index 6f5a5de0da7..b0f8d7d6408 100644
--- a/source/blender/editors/space_outliner/outliner_select.c
+++ b/source/blender/editors/space_outliner/outliner_select.c
@@ -1623,46 +1623,6 @@ static 

[Bf-blender-cvs] [d934a78d103] soc-2019-outliner: Outliner: Sync select toggle tweaks

2019-08-14 Thread Nathan Craddock
Commit: d934a78d1035916b6e4e02d305f886c14b9c2c6a
Author: Nathan Craddock
Date:   Wed Aug 14 13:43:02 2019 -0600
Branches: soc-2019-outliner
https://developer.blender.org/rBd934a78d1035916b6e4e02d305f886c14b9c2c6a

Outliner: Sync select toggle tweaks

Move the toggle lower in the popover as this toggle is not as
important. Also use a checkbox rather than button.

The toggle is still drawn as a button with an icon when the outliner
is in sequence display mode, as the filter popover is not drawn
in that mode.

===

M   release/scripts/startup/bl_ui/space_outliner.py
M   source/blender/makesrna/intern/rna_space.c

===

diff --git a/release/scripts/startup/bl_ui/space_outliner.py 
b/release/scripts/startup/bl_ui/space_outliner.py
index f3e8d322a7b..7bf203d8e39 100644
--- a/release/scripts/startup/bl_ui/space_outliner.py
+++ b/release/scripts/startup/bl_ui/space_outliner.py
@@ -48,7 +48,7 @@ class OUTLINER_HT_header(Header):
 
 if display_mode == 'SEQUENCE':
 row = layout.row(align=True)
-row.prop(space, "use_sync_select", text="")
+row.prop(space, "use_sync_select", icon="UV_SYNC_SELECT", text="")
 
 row = layout.row(align=True)
 if display_mode in {'SCENES', 'VIEW_LAYER'}:
@@ -307,10 +307,6 @@ class OUTLINER_PT_filter(Panel):
 space = context.space_data
 display_mode = space.display_mode
 
-row = layout.row(align=True)
-row.prop(space, "use_sync_select", text="Sync Selection")
-layout.separator()
-
 if display_mode == 'VIEW_LAYER':
 layout.label(text="Restriction Toggles:")
 row = layout.row(align=True)
@@ -336,6 +332,10 @@ class OUTLINER_PT_filter(Panel):
 col.prop(space, "use_sort_alpha")
 layout.separator()
 
+row = layout.row(align=True)
+row.prop(space, "use_sync_select", text="Sync Selection")
+layout.separator()
+
 col = layout.column(align=True)
 col.label(text="Search:")
 col.prop(space, "use_filter_complete", text="Exact Match")
diff --git a/source/blender/makesrna/intern/rna_space.c 
b/source/blender/makesrna/intern/rna_space.c
index 3aeaf0ba397..ef4406db84d 100644
--- a/source/blender/makesrna/intern/rna_space.c
+++ b/source/blender/makesrna/intern/rna_space.c
@@ -2820,7 +2820,6 @@ static void rna_def_space_outliner(BlenderRNA *brna)
   RNA_def_property_boolean_sdna(prop, NULL, "flag", SO_SYNC_SELECT);
   RNA_def_property_ui_text(
   prop, "Sync Outliner Selection", "Sync outliner selection with other 
editors");
-  RNA_def_property_ui_icon(prop, ICON_UV_SYNC_SELECT, 0);
   RNA_def_property_update(prop, NC_SPACE | ND_SPACE_OUTLINER, NULL);
 
   /* Granular restriction column option. */

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


[Bf-blender-cvs] [705b4f2ef0a] soc-2019-outliner: Outliner: Don't sync outliner selection to other outliners

2019-08-14 Thread Nathan Craddock
Commit: 705b4f2ef0aa906bf0b55991c28b0300eaef8b2c
Author: Nathan Craddock
Date:   Wed Aug 14 14:13:25 2019 -0600
Branches: soc-2019-outliner
https://developer.blender.org/rB705b4f2ef0aa906bf0b55991c28b0300eaef8b2c

Outliner: Don't sync outliner selection to other outliners

===

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

===

diff --git a/source/blender/editors/space_outliner/outliner_sync.c 
b/source/blender/editors/space_outliner/outliner_sync.c
index 08f8c25bcb8..48421f2a641 100644
--- a/source/blender/editors/space_outliner/outliner_sync.c
+++ b/source/blender/editors/space_outliner/outliner_sync.c
@@ -362,26 +362,22 @@ void ED_outliner_select_sync_from_outliner(bContext *C, 
SpaceOutliner *soops)
 
   selected_items_free(_items);
 
-  /* Set global sync select flag based on outliner selection type */
+  /* Clear sync select dirty state from current selection type */
   if (sync_types.object) {
 DEG_id_tag_update(>id, ID_RECALC_SELECT);
 WM_event_add_notifier(C, NC_SCENE | ND_OB_SELECT, scene);
-ED_outliner_select_sync_from_object_tag(C);
+soops->sync_select_dirty &= ~WM_OUTLINER_SYNC_SELECT_FROM_OBJECT;
   }
   if (sync_types.edit_bone) {
-ED_outliner_select_sync_from_edit_bone_tag(C);
+soops->sync_select_dirty &= ~WM_OUTLINER_SYNC_SELECT_FROM_EDIT_BONE;
   }
   if (sync_types.pose_bone) {
-ED_outliner_select_sync_from_pose_bone_tag(C);
+soops->sync_select_dirty &= ~WM_OUTLINER_SYNC_SELECT_FROM_POSE_BONE;
   }
   if (sync_types.sequence) {
 WM_event_add_notifier(C, NC_SCENE | ND_SEQUENCER | NA_SELECTED, scene);
-ED_outliner_select_sync_from_sequence_tag(C);
+soops->sync_select_dirty &= ~WM_OUTLINER_SYNC_SELECT_FROM_SEQUENCE;
   }
-
-  /* Flag all outliners as dirty except for self */
-  ED_outliner_select_sync_flag_outliners(C);
-  soops->sync_select_dirty &= ~WM_OUTLINER_SYNC_SELECT_FROM_ALL;
 }
 
 static void outliner_select_sync_from_object(ViewLayer *view_layer,

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


[Bf-blender-cvs] [5489611e531] master: Compositor: Added denoising node

2019-08-14 Thread Brecht Van Lommel
Commit: 5489611e53176ad4c1d5ac626db6377b27624cce
Author: Brecht Van Lommel
Date:   Wed Aug 14 15:30:26 2019 +0200
Branches: master
https://developer.blender.org/rB5489611e53176ad4c1d5ac626db6377b27624cce

Compositor: Added denoising node

This node is built on Intel's OpenImageDenoise library.
Other denoisers could be integrated, for example Lukas' Cycles denoiser.

Compositor: Made OpenImageDenoise optional, added CMake and build_env files to 
find OIDN

Compositor: Fixed some warnings in the denoising operator

build_environment: Updated OpenImageDenoise to 0.8.1

build_environment: Updated OpenImageDenoise in `make deps` for macOS

Reviewers: sergey, jbakker, brecht

Reviewed By: brecht

Subscribers: YAFU, LazyDodo, Zen_YS, slumber, samgreen, tjvoll, yeus, 
ponomarovmax, getrad, coder.kalyan, vitos1k, Yegor, DeepBlender, kumaran7, 
Darkfie9825, aliasguru, aafra, ace_dragon, juang3d, pandrodor, cdog, lordodin, 
jtheninja, mavek, marcog, 5k1n2, Atair, rawalanche, 0o00o0oo, filibis, poor, 
lukasstockner97

Tags: #compositing

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

===

M   CMakeLists.txt
M   build_files/build_environment/CMakeLists.txt
M   build_files/build_environment/cmake/harvest.cmake
A   build_files/build_environment/cmake/openimagedenoise.cmake
M   build_files/build_environment/cmake/tbb.cmake
M   build_files/build_environment/cmake/versions.cmake
A   build_files/build_environment/patches/openimagedenoise.diff
A   build_files/cmake/Modules/FindOpenImageDenoise.cmake
M   build_files/cmake/config/blender_full.cmake
M   build_files/cmake/config/blender_lite.cmake
M   build_files/cmake/config/blender_release.cmake
M   build_files/cmake/macros.cmake
M   build_files/cmake/platform/platform_apple.cmake
M   build_files/cmake/platform/platform_unix.cmake
M   build_files/cmake/platform/platform_win32.cmake
M   release/scripts/startup/nodeitems_builtins.py
M   source/blender/blenkernel/BKE_node.h
M   source/blender/blenkernel/intern/node.c
M   source/blender/compositor/CMakeLists.txt
M   source/blender/compositor/intern/COM_Converter.cpp
A   source/blender/compositor/nodes/COM_DenoiseNode.cpp
A   source/blender/compositor/nodes/COM_DenoiseNode.h
A   source/blender/compositor/operations/COM_DenoiseOperation.cpp
A   source/blender/compositor/operations/COM_DenoiseOperation.h
M   source/blender/editors/space_node/CMakeLists.txt
M   source/blender/editors/space_node/drawnode.c
M   source/blender/makesdna/DNA_node_types.h
M   source/blender/makesrna/intern/rna_nodetree.c
M   source/blender/nodes/CMakeLists.txt
M   source/blender/nodes/NOD_composite.h
M   source/blender/nodes/NOD_static_types.h
A   source/blender/nodes/composite/nodes/node_composite_denoise.c

===

diff --git a/CMakeLists.txt b/CMakeLists.txt
index 6ced6e1d76d..2a7a020c428 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -237,6 +237,7 @@ option(WITH_OPENCOLORIO   "Enable OpenColorIO color 
management" ${_init_OPENCOLO
 
 # Compositor
 option(WITH_COMPOSITOR "Enable the tile based nodal compositor" ON)
+option(WITH_OPENIMAGEDENOISE   "Enable the OpenImageDenoise compositing node" 
OFF)
 
 option(WITH_OPENSUBDIV"Enable OpenSubdiv for surface subdivision" 
${_init_OPENSUBDIV})
 
@@ -1760,6 +1761,7 @@ if(FIRST_RUN)
   info_cfg_option(WITH_CYCLES)
   info_cfg_option(WITH_FREESTYLE)
   info_cfg_option(WITH_OPENCOLORIO)
+  info_cfg_option(WITH_OPENIMAGEDENOISE)
   info_cfg_option(WITH_OPENVDB)
   info_cfg_option(WITH_ALEMBIC)
 
diff --git a/build_files/build_environment/CMakeLists.txt 
b/build_files/build_environment/CMakeLists.txt
index 0dbd3b572cf..1b387cb86a2 100644
--- a/build_files/build_environment/CMakeLists.txt
+++ b/build_files/build_environment/CMakeLists.txt
@@ -97,6 +97,7 @@ if(UNIX AND NOT APPLE)
 else()
   include(cmake/pugixml.cmake)
 endif()
+include(cmake/openimagedenoise.cmake)
 
 if(WITH_WEBP)
   include(cmake/webp.cmake)
diff --git a/build_files/build_environment/cmake/harvest.cmake 
b/build_files/build_environment/cmake/harvest.cmake
index 27bcd184c44..97e4a6b69d4 100644
--- a/build_files/build_environment/cmake/harvest.cmake
+++ b/build_files/build_environment/cmake/harvest.cmake
@@ -166,6 +166,8 @@ harvest(openimageio/bin openimageio/bin "maketx")
 harvest(openimageio/bin openimageio/bin "oiiotool")
 harvest(openimageio/include openimageio/include "*")
 harvest(openimageio/lib openimageio/lib "*.a")
+harvest(openimagedenoise/include openimagedenoise/include "*")
+harvest(openimagedenoise/lib openimagedenoise/lib "*.a")
 harvest(openjpeg/include/openjpeg-2.3 openjpeg/include "*.h")
 harvest(openjpeg/lib openjpeg/lib "*.a")
 harvest(opensubdiv/include opensubdiv/include "*.h")
diff --git a/build_files/build_environment/cmake/openimagedenoise.cmake 

[Bf-blender-cvs] [1845f0ee8b3] master: Cleanup: Fix build error with MSVC

2019-08-14 Thread Lazydodo
Commit: 1845f0ee8b33698ddd48c2204ad4084a77ab
Author: Lazydodo
Date:   Wed Aug 14 12:52:17 2019 -0600
Branches: master
https://developer.blender.org/rB1845f0ee8b33698ddd48c2204ad4084a77ab

Cleanup: Fix build error with MSVC

C99 style initializers are C++20 feature and should not be used.

Reported by @deadpin on chat.

===

M   source/blender/gpu/GPU_vertex_format.h

===

diff --git a/source/blender/gpu/GPU_vertex_format.h 
b/source/blender/gpu/GPU_vertex_format.h
index dc60c52122c..fc468436499 100644
--- a/source/blender/gpu/GPU_vertex_format.h
+++ b/source/blender/gpu/GPU_vertex_format.h
@@ -164,9 +164,9 @@ BLI_INLINE int gpu_convert_i16_to_i10(short x)
 BLI_INLINE GPUPackedNormal GPU_normal_convert_i10_v3(const float data[3])
 {
   GPUPackedNormal n = {
-  .x = gpu_convert_normalized_f32_to_i10(data[0]),
-  .y = gpu_convert_normalized_f32_to_i10(data[1]),
-  .z = gpu_convert_normalized_f32_to_i10(data[2]),
+  gpu_convert_normalized_f32_to_i10(data[0]),
+  gpu_convert_normalized_f32_to_i10(data[1]),
+  gpu_convert_normalized_f32_to_i10(data[2]),
   };
   return n;
 }
@@ -174,9 +174,9 @@ BLI_INLINE GPUPackedNormal GPU_normal_convert_i10_v3(const 
float data[3])
 BLI_INLINE GPUPackedNormal GPU_normal_convert_i10_s3(const short data[3])
 {
   GPUPackedNormal n = {
-  .x = gpu_convert_i16_to_i10(data[0]),
-  .y = gpu_convert_i16_to_i10(data[1]),
-  .z = gpu_convert_i16_to_i10(data[2]),
+  gpu_convert_i16_to_i10(data[0]),
+  gpu_convert_i16_to_i10(data[1]),
+  gpu_convert_i16_to_i10(data[2]),
   };
   return n;
 }

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


[Bf-blender-cvs] [655f5818a58] master: Cleanup: use BKE_mesh_ prefix for the remesh API

2019-08-14 Thread Campbell Barton
Commit: 655f5818a589539b286641450c00d27a5cac2bff
Author: Campbell Barton
Date:   Thu Aug 15 04:46:10 2019 +1000
Branches: master
https://developer.blender.org/rB655f5818a589539b286641450c00d27a5cac2bff

Cleanup: use BKE_mesh_ prefix for the remesh API

These functions deal with voxel remeshing of Mesh data,
and aren't related to MOD_remesh.c for e.g.

Name so other kinds of remeshing wont cause confusion.

===

R070source/blender/blenkernel/BKE_remesh.h  
source/blender/blenkernel/BKE_mesh_remesh_voxel.h
M   source/blender/blenkernel/CMakeLists.txt
R089source/blender/blenkernel/intern/remesh.c   
source/blender/blenkernel/intern/mesh_remesh_voxel.c
M   source/blender/editors/object/object_remesh.c

===

diff --git a/source/blender/blenkernel/BKE_remesh.h 
b/source/blender/blenkernel/BKE_mesh_remesh_voxel.h
similarity index 70%
rename from source/blender/blenkernel/BKE_remesh.h
rename to source/blender/blenkernel/BKE_mesh_remesh_voxel.h
index 996e88e0ea0..089e4de4709 100644
--- a/source/blender/blenkernel/BKE_remesh.h
+++ b/source/blender/blenkernel/BKE_mesh_remesh_voxel.h
@@ -31,14 +31,14 @@ struct Mesh;
 
 /* OpenVDB Voxel Remesher */
 #ifdef WITH_OPENVDB
-struct OpenVDBLevelSet *BKE_remesh_voxel_ovdb_mesh_to_level_set_create(
+struct OpenVDBLevelSet *BKE_mesh_remesh_voxel_ovdb_mesh_to_level_set_create(
 struct Mesh *mesh, struct OpenVDBTransform *transform);
-struct Mesh *BKE_remesh_voxel_ovdb_volume_to_mesh_nomain(struct 
OpenVDBLevelSet *level_set,
- double isovalue,
- double adaptivity,
- bool 
relax_disoriented_triangles);
+struct Mesh *BKE_mesh_remesh_voxel_ovdb_volume_to_mesh_nomain(struct 
OpenVDBLevelSet *level_set,
+  double isovalue,
+  double 
adaptivity,
+  bool 
relax_disoriented_triangles);
 #endif
-struct Mesh *BKE_remesh_voxel_to_mesh_nomain(struct Mesh *mesh, float 
voxel_size);
+struct Mesh *BKE_mesh_remesh_voxel_to_mesh_nomain(struct Mesh *mesh, float 
voxel_size);
 
 /* Data reprojection functions */
 void BKE_remesh_reproject_paint_mask(struct Mesh *target, struct Mesh *source);
diff --git a/source/blender/blenkernel/CMakeLists.txt 
b/source/blender/blenkernel/CMakeLists.txt
index 1f125b93b3f..669abff6599 100644
--- a/source/blender/blenkernel/CMakeLists.txt
+++ b/source/blender/blenkernel/CMakeLists.txt
@@ -151,6 +151,7 @@ set(SRC
   intern/mesh_mapping.c
   intern/mesh_merge.c
   intern/mesh_remap.c
+  intern/mesh_remesh_voxel.c
   intern/mesh_runtime.c
   intern/mesh_tangent.c
   intern/mesh_validate.c
@@ -178,7 +179,6 @@ set(SRC
   intern/pbvh.c
   intern/pbvh_bmesh.c
   intern/pointcache.c
-  intern/remesh.c
   intern/report.c
   intern/rigidbody.c
   intern/scene.c
@@ -301,6 +301,7 @@ set(SRC
   BKE_mesh_iterators.h
   BKE_mesh_mapping.h
   BKE_mesh_remap.h
+  BKE_mesh_remesh_voxel.h
   BKE_mesh_runtime.h
   BKE_mesh_tangent.h
   BKE_modifier.h
@@ -318,7 +319,6 @@ set(SRC
   BKE_particle.h
   BKE_pbvh.h
   BKE_pointcache.h
-  BKE_remesh.h
   BKE_report.h
   BKE_rigidbody.h
   BKE_scene.h
diff --git a/source/blender/blenkernel/intern/remesh.c 
b/source/blender/blenkernel/intern/mesh_remesh_voxel.c
similarity index 89%
rename from source/blender/blenkernel/intern/remesh.c
rename to source/blender/blenkernel/intern/mesh_remesh_voxel.c
index 36e92689f1a..17347842216 100644
--- a/source/blender/blenkernel/intern/remesh.c
+++ b/source/blender/blenkernel/intern/mesh_remesh_voxel.c
@@ -43,14 +43,14 @@
 #include "BKE_library.h"
 #include "BKE_customdata.h"
 #include "BKE_bvhutils.h"
-#include "BKE_remesh.h"
+#include "BKE_mesh_remesh_voxel.h" /* own include */
 
 #ifdef WITH_OPENVDB
 #  include "openvdb_capi.h"
 #endif
 
 #ifdef WITH_OPENVDB
-struct OpenVDBLevelSet *BKE_remesh_voxel_ovdb_mesh_to_level_set_create(
+struct OpenVDBLevelSet *BKE_mesh_remesh_voxel_ovdb_mesh_to_level_set_create(
 Mesh *mesh, struct OpenVDBTransform *transform)
 {
   BKE_mesh_runtime_looptri_recalc(mesh);
@@ -90,10 +90,10 @@ struct OpenVDBLevelSet 
*BKE_remesh_voxel_ovdb_mesh_to_level_set_create(
   return level_set;
 }
 
-Mesh *BKE_remesh_voxel_ovdb_volume_to_mesh_nomain(struct OpenVDBLevelSet 
*level_set,
-  double isovalue,
-  double adaptivity,
-  bool 
relax_disoriented_triangles)
+Mesh *BKE_mesh_remesh_voxel_ovdb_volume_to_mesh_nomain(struct OpenVDBLevelSet 
*level_set,
+   double isovalue,
+  

[Bf-blender-cvs] [9494c3df539] soc-2019-outliner: Merge branch 'master' into soc-2019-outliner

2019-08-14 Thread Nathan Craddock
Commit: 9494c3df5398bbc98ef5d8c4cdb39fe936079c86
Author: Nathan Craddock
Date:   Wed Aug 14 11:58:22 2019 -0600
Branches: soc-2019-outliner
https://developer.blender.org/rB9494c3df5398bbc98ef5d8c4cdb39fe936079c86

Merge branch 'master' into soc-2019-outliner

===



===



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


[Bf-blender-cvs] [e088ee55f72] soc-2019-outliner: Outliner: Use GSet for select sync from outliner

2019-08-14 Thread Nathan Craddock
Commit: e088ee55f7257747edb36f3a91819e2c6c0bf035
Author: Nathan Craddock
Date:   Wed Aug 14 11:56:09 2019 -0600
Branches: soc-2019-outliner
https://developer.blender.org/rBe088ee55f7257747edb36f3a91819e2c6c0bf035

Outliner: Use GSet for select sync from outliner

===

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

===

diff --git a/source/blender/editors/space_outliner/outliner_sync.c 
b/source/blender/editors/space_outliner/outliner_sync.c
index bae19aa751c..08f8c25bcb8 100644
--- a/source/blender/editors/space_outliner/outliner_sync.c
+++ b/source/blender/editors/space_outliner/outliner_sync.c
@@ -27,13 +27,13 @@
 
 #include "DNA_armature_types.h"
 #include "DNA_layer_types.h"
-#include "DNA_listBase.h"
 #include "DNA_outliner_types.h"
 #include "DNA_screen_types.h"
 #include "DNA_sequence_types.h"
 #include "DNA_space_types.h"
 
-#include "BLI_listbase.h"
+#include "BLI_compiler_compat.h"
+#include "BLI_ghash.h"
 
 #include "BKE_armature.h"
 #include "BKE_context.h"
@@ -164,83 +164,53 @@ static void 
outliner_sync_select_to_outliner_set_types(const bContext *C,
  * state of the last instance of an object linked in multiple collections.
  */
 typedef struct SelectedItems {
-  ListBase *objects;
-  ListBase *edit_bones;
-  ListBase *pose_bones;
+  GSet *objects;
+  GSet *edit_bones;
+  GSet *pose_bones;
 } SelectedItems;
 
 static void selected_items_init(SelectedItems *selected_items)
 {
-  selected_items->objects = MEM_callocN(sizeof(ListBase), "selected_objects");
-  selected_items->edit_bones = MEM_callocN(sizeof(ListBase), 
"selected_ebones");
-  selected_items->pose_bones = MEM_callocN(sizeof(ListBase), 
"selected_pbones");
+  selected_items->objects = BLI_gset_new(BLI_ghashutil_ptrhash, 
BLI_ghashutil_ptrcmp, __func__);
+  selected_items->edit_bones = BLI_gset_new(BLI_ghashutil_ptrhash, 
BLI_ghashutil_ptrcmp, __func__);
+  selected_items->pose_bones = BLI_gset_new(BLI_ghashutil_ptrhash, 
BLI_ghashutil_ptrcmp, __func__);
 }
 
 static void selected_items_free(SelectedItems *selected_items)
 {
-  BLI_freelistN(selected_items->objects);
-  MEM_freeN(selected_items->objects);
-  BLI_freelistN(selected_items->edit_bones);
-  MEM_freeN(selected_items->edit_bones);
-  BLI_freelistN(selected_items->pose_bones);
-  MEM_freeN(selected_items->pose_bones);
+  BLI_gset_free(selected_items->objects, NULL);
+  BLI_gset_free(selected_items->edit_bones, NULL);
+  BLI_gset_free(selected_items->pose_bones, NULL);
 }
 
 /* Check if an instance of this object been selected by the sync */
-static bool is_object_selected(ListBase *selected_objects, Base *base)
+static bool is_object_selected(GSet *selected_objects, Base *base)
 {
-  for (LinkData *item = selected_objects->first; item; item = item->next) {
-Base *selected_base = (Base *)item->data;
-
-if (base == selected_base) {
-  return true;
-}
-  }
-
-  return false;
+  return BLI_gset_haskey(selected_objects, base);
 }
 
 /* Check if an instance of this edit bone been selected by the sync */
-static bool is_edit_bone_selected(ListBase *selected_ebones, EditBone *ebone)
+static bool is_edit_bone_selected(GSet *selected_ebones, EditBone *ebone)
 {
-  for (LinkData *item = selected_ebones->first; item; item = item->next) {
-EditBone *selected_ebone = (EditBone *)item->data;
-
-if (ebone == selected_ebone) {
-  return true;
-}
-  }
-
-  return false;
+  return BLI_gset_haskey(selected_ebones, ebone);
 }
 
 /* Check if an instance of this pose bone been selected by the sync */
-static bool is_pose_bone_selected(ListBase *selected_pbones, bPoseChannel 
*pchan)
+static bool is_pose_bone_selected(GSet *selected_pbones, bPoseChannel *pchan)
 {
-  for (LinkData *item = selected_pbones->first; item; item = item->next) {
-bPoseChannel *selected_pchan = (bPoseChannel *)item->data;
-
-if (pchan == selected_pchan) {
-  return true;
-}
-  }
-
-  return false;
+  return BLI_gset_haskey(selected_pbones, pchan);
 }
 
-/* Add element's data to selected item list */
-static void add_selected_item(ListBase *selected_list, void *data)
+/* Add element's data to selected item set */
+static void add_selected_item(GSet *selected, void *data)
 {
-  LinkData *link = MEM_callocN(sizeof(LinkData), "selected_item");
-  link->data = data;
-
-  BLI_addtail(selected_list, link);
+  BLI_gset_add(selected, data);
 }
 
 static void outliner_select_sync_to_object(ViewLayer *view_layer,
TreeElement *te,
TreeStoreElem *tselem,
-   ListBase *selected_objects)
+   GSet *selected_objects)
 {
   Object *ob = (Object *)tselem->id;
   Base *base = (te->directdata) ? (Base *)te->directdata :
@@ -261,7 +231,7 @@ static void 

[Bf-blender-cvs] [76e5b4bee4e] master: Fix T68657: Voxel remesh crash

2019-08-14 Thread Campbell Barton
Commit: 76e5b4bee4ed4b7bce5ffb7f9cbf0b5615c7473b
Author: Campbell Barton
Date:   Thu Aug 15 03:51:06 2019 +1000
Branches: master
https://developer.blender.org/rB76e5b4bee4ed4b7bce5ffb7f9cbf0b5615c7473b

Fix T68657: Voxel remesh crash

Mesh was being double freed.

===

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

===

diff --git a/source/blender/editors/object/object_remesh.c 
b/source/blender/editors/object/object_remesh.c
index a7e7256757d..2234b3875b7 100644
--- a/source/blender/editors/object/object_remesh.c
+++ b/source/blender/editors/object/object_remesh.c
@@ -119,7 +119,6 @@ static int voxel_remesh_exec(bContext *C, wmOperator *op)
   }
 
   BKE_mesh_nomain_to_mesh(new_mesh, mesh, ob, _MASK_MESH, true);
-  BKE_mesh_free(new_mesh);
 
   if (mesh->flag & ME_REMESH_REPROJECT_PAINT_MASK) {
 BKE_remesh_reproject_paint_mask(mesh, obj_mesh_copy);

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


[Bf-blender-cvs] [8ee3e7da28d] master: Cleanup: use doxy sections for wm_operators.c

2019-08-14 Thread Campbell Barton
Commit: 8ee3e7da28dfea237aa41bcd3a4c24ad01e1837c
Author: Campbell Barton
Date:   Thu Aug 15 03:26:39 2019 +1000
Branches: master
https://developer.blender.org/rB8ee3e7da28dfea237aa41bcd3a4c24ad01e1837c

Cleanup: use doxy sections for wm_operators.c

===

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

===

diff --git a/source/blender/windowmanager/intern/wm_operators.c 
b/source/blender/windowmanager/intern/wm_operators.c
index 4dfcae1d969..29ecf798b3c 100644
--- a/source/blender/windowmanager/intern/wm_operators.c
+++ b/source/blender/windowmanager/intern/wm_operators.c
@@ -107,7 +107,11 @@
 
 #define UNDOCUMENTED_OPERATOR_TIP N_("(undocumented operator)")
 
-/*  operator API, exported ** */
+/** \} */
+
+/*  */
+/** \name Operator API
+ * \{ */
 
 /* SOME_OT_op -> some.op */
 void WM_operator_py_idname(char *to, const char *from)
@@ -688,7 +692,11 @@ void WM_operator_properties_free(PointerRNA *ptr)
   }
 }
 
-/*  default op callbacks, exported *** */
+/** \} */
+
+/*  */
+/** \name Default Operator Callbacks
+ * \{ */
 
 void WM_operator_view3d_unit_defaults(struct bContext *C, struct wmOperator 
*op)
 {
@@ -1388,7 +1396,13 @@ int WM_operator_redo_popup(bContext *C, wmOperator *op)
   return OPERATOR_CANCELLED;
 }
 
-/* * Debug menu * */
+/** \} */
+
+/*  */
+/** \name Debug Menu Operator
+ *
+ * Set internal debug value, mainly for developers.
+ * \{ */
 
 static int wm_debug_menu_exec(bContext *C, wmOperator *op)
 {
@@ -1418,7 +1432,12 @@ static void WM_OT_debug_menu(wmOperatorType *ot)
   RNA_def_int(ot->srna, "debug_value", 0, SHRT_MIN, SHRT_MAX, "Debug Value", 
"", -1, 1);
 }
 
-/* * Operator defaults * */
+/** \} */
+
+/*  */
+/** \name Reset Defaults Operator
+ * \{ */
+
 static int wm_operator_defaults_exec(bContext *C, wmOperator *op)
 {
   PointerRNA ptr = CTX_data_pointer_get_type(C, "active_operator", 
_Operator);
@@ -1444,7 +1463,11 @@ static void WM_OT_operator_defaults(wmOperatorType *ot)
   ot->flag = OPTYPE_INTERNAL;
 }
 
-/* * Search menu * */
+/** \} */
+
+/*  */
+/** \name Operator Search Menu
+ * \{ */
 
 struct SearchPopupInit_Data {
   int size[2];
@@ -1653,7 +1676,11 @@ static void WM_OT_call_panel(wmOperatorType *ot)
   RNA_def_property_flag(prop, PROP_SKIP_SAVE);
 }
 
-/*  window / screen operator definitions ** */
+/** \} */
+
+/*  */
+/** \name Window/Screen Operators
+ * \{ */
 
 /* this poll functions is needed in place of WM_operator_winactive
  * while it crashes on full screen */
@@ -1742,7 +1769,11 @@ static void WM_OT_quit_blender(wmOperatorType *ot)
   ot->exec = wm_exit_blender_exec;
 }
 
-/* *** */
+/** \} */
+
+/*  */
+/** \name Console Toggle Operator (WIN32 only)
+ * \{ */
 
 #if defined(WIN32)
 
@@ -1765,12 +1796,16 @@ static void WM_OT_console_toggle(wmOperatorType *ot)
 
 #endif
 
-/*  default paint cursors, draw always around cursor *** */
-/*
- * - returns handler to free
- * - poll(bContext): returns 1 if draw should happen
- * - draw(bContext): drawing callback for paint cursor
- */
+/** \} */
+
+/*  */
+/** \name default paint cursors, draw always around cursor
+ *
+ * - Returns handler to free.
+ * - `poll(bContext)`: returns 1 if draw should happen.
+ * - `draw(bContext)`: drawing callback for paint cursor.
+ *
+ * \{ */
 
 wmPaintCursor *WM_paint_cursor_activate(wmWindowManager *wm,
 short space_type,
@@ -1807,7 +1842,11 @@ bool WM_paint_cursor_end(wmWindowManager *wm, 
wmPaintCursor *handle)
   return false;
 }
 
-/* *** radial control ** */
+/** \} */
+
+/*  */
+/** \name Radial Control Operator
+ * \{ */
 
 #define WM_RADIAL_CONTROL_DISPLAY_SIZE (200 * UI_DPI_FAC)
 #define WM_RADIAL_CONTROL_DISPLAY_MIN_SIZE (35 * UI_DPI_FAC)
@@ -2771,7 +2810,13 @@ static void WM_OT_radial_control(wmOperatorType *ot)
   RNA_def_property_flag(prop, PROP_SKIP_SAVE);
 }
 
-/* ** timer for testing * */
+/** \} */
+
+/*  */

[Bf-blender-cvs] [966f4a162be] master: Cleanup: warnings, unnecessary nested header

2019-08-14 Thread Campbell Barton
Commit: 966f4a162be5ad594c6d8ed5cd742c3c0bf56c46
Author: Campbell Barton
Date:   Thu Aug 15 03:41:36 2019 +1000
Branches: master
https://developer.blender.org/rB966f4a162be5ad594c6d8ed5cd742c3c0bf56c46

Cleanup: warnings, unnecessary nested header

===

M   source/blender/blenkernel/BKE_remesh.h
M   source/blender/blenkernel/intern/remesh.c

===

diff --git a/source/blender/blenkernel/BKE_remesh.h 
b/source/blender/blenkernel/BKE_remesh.h
index fd99af36bdc..996e88e0ea0 100644
--- a/source/blender/blenkernel/BKE_remesh.h
+++ b/source/blender/blenkernel/BKE_remesh.h
@@ -23,24 +23,24 @@
  * \ingroup bke
  */
 
-#include "DNA_mesh_types.h"
-
 #ifdef WITH_OPENVDB
 #  include "openvdb_capi.h"
 #endif
 
+struct Mesh;
+
 /* OpenVDB Voxel Remesher */
 #ifdef WITH_OPENVDB
 struct OpenVDBLevelSet *BKE_remesh_voxel_ovdb_mesh_to_level_set_create(
-Mesh *mesh, struct OpenVDBTransform *transform);
-Mesh *BKE_remesh_voxel_ovdb_volume_to_mesh_nomain(struct OpenVDBLevelSet 
*level_set,
-  double isovalue,
-  double adaptivity,
-  bool 
relax_disoriented_triangles);
+struct Mesh *mesh, struct OpenVDBTransform *transform);
+struct Mesh *BKE_remesh_voxel_ovdb_volume_to_mesh_nomain(struct 
OpenVDBLevelSet *level_set,
+ double isovalue,
+ double adaptivity,
+ bool 
relax_disoriented_triangles);
 #endif
-Mesh *BKE_remesh_voxel_to_mesh_nomain(Mesh *mesh, float voxel_size);
+struct Mesh *BKE_remesh_voxel_to_mesh_nomain(struct Mesh *mesh, float 
voxel_size);
 
 /* Data reprojection functions */
-void BKE_remesh_reproject_paint_mask(Mesh *target, Mesh *source);
+void BKE_remesh_reproject_paint_mask(struct Mesh *target, struct Mesh *source);
 
 #endif /* __BKE_REMESH_H__ */
diff --git a/source/blender/blenkernel/intern/remesh.c 
b/source/blender/blenkernel/intern/remesh.c
index 4dd38c900c0..36e92689f1a 100644
--- a/source/blender/blenkernel/intern/remesh.c
+++ b/source/blender/blenkernel/intern/remesh.c
@@ -153,6 +153,8 @@ Mesh *BKE_remesh_voxel_to_mesh_nomain(Mesh *mesh, float 
voxel_size)
   new_mesh = BKE_remesh_voxel_ovdb_volume_to_mesh_nomain(level_set, 0.0, 0.0, 
false);
   OpenVDBLevelSet_free(level_set);
   OpenVDBTransform_free(xform);
+#else
+  UNUSED_VARS(mesh, voxel_size);
 #endif
   return new_mesh;
 }

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


[Bf-blender-cvs] [9c010c44f42] master: Mesh Batch Cache: Refactor + Multithread

2019-08-14 Thread Clément Foucault
Commit: 9c010c44f4201ab114b3facc69d0343525a1779f
Author: Clément Foucault
Date:   Sun Jul 14 16:49:44 2019 +0200
Branches: master
https://developer.blender.org/rB9c010c44f4201ab114b3facc69d0343525a1779f

Mesh Batch Cache: Refactor + Multithread

For clarity sake, the batch cache now uses exclusively per Loop attributes.
While this is a bit of a waste of VRAM (for the few case where per vert
attribs are enough) it reduces the complexity and amount of overall VBO
to update in general situations.

This patch also makes the VertexBuffers filling multithreaded. This make
the update of dense meshes a bit faster. The main bottleneck is the
IndexBuffers update which cannot be multithreaded efficiently (have to
increment a counter and/or do a final sorting pass).

We introduce the concept of "extract" functions/step.
All extract functions are executed in one thread each and if possible,
using multiple thread for looping over all elements.

Reviewed By: brecht

Differential Revision: http://developer.blender.org/D5424

===

M   source/blender/blenkernel/BKE_mesh.h
M   source/blender/blenkernel/intern/mesh_evaluate.c
M   source/blender/blenlib/BLI_math_geom.h
M   source/blender/blenlib/intern/math_geom.c
M   source/blender/draw/CMakeLists.txt
M   source/blender/draw/intern/draw_cache.c
A   source/blender/draw/intern/draw_cache_extract.h
A   source/blender/draw/intern/draw_cache_extract_mesh.c
M   source/blender/draw/intern/draw_cache_impl.h
M   source/blender/draw/intern/draw_cache_impl_mesh.c
M   source/blender/draw/modes/edit_mesh_mode.c
M   
source/blender/draw/modes/shaders/edit_mesh_overlay_mesh_analysis_frag.glsl
M   
source/blender/draw/modes/shaders/edit_mesh_overlay_mesh_analysis_vert.glsl
M   source/blender/editors/uvedit/uvedit_draw.c
M   source/blender/gpu/GPU_batch.h
M   source/blender/gpu/GPU_element.h
M   source/blender/gpu/GPU_vertex_format.h
M   source/blender/gpu/intern/gpu_batch.c
M   source/blender/gpu/intern/gpu_element.c
M   source/blender/gpu/intern/gpu_vertex_format.c
M   source/blender/gpu/intern/gpu_vertex_format_private.h
M   source/blender/gpu/shaders/gpu_shader_2D_edituvs_stretch_vert.glsl
M   source/blender/makesrna/intern/rna_scene.c

===

diff --git a/source/blender/blenkernel/BKE_mesh.h 
b/source/blender/blenkernel/BKE_mesh.h
index 924cfad37d6..94d118bde36 100644
--- a/source/blender/blenkernel/BKE_mesh.h
+++ b/source/blender/blenkernel/BKE_mesh.h
@@ -486,6 +486,7 @@ void BKE_mesh_calc_poly_center(const struct MPoly *mpoly,
 float BKE_mesh_calc_poly_area(const struct MPoly *mpoly,
   const struct MLoop *loopstart,
   const struct MVert *mvarray);
+float BKE_mesh_calc_poly_uv_area(const struct MPoly *mpoly, const struct 
MLoopUV *uv_array);
 void BKE_mesh_calc_poly_angles(const struct MPoly *mpoly,
const struct MLoop *loopstart,
const struct MVert *mvarray,
diff --git a/source/blender/blenkernel/intern/mesh_evaluate.c 
b/source/blender/blenkernel/intern/mesh_evaluate.c
index e28d50cbde4..2ea275cdfb0 100644
--- a/source/blender/blenkernel/intern/mesh_evaluate.c
+++ b/source/blender/blenkernel/intern/mesh_evaluate.c
@@ -2378,6 +2378,24 @@ float BKE_mesh_calc_poly_area(const MPoly *mpoly, const 
MLoop *loopstart, const
   }
 }
 
+float BKE_mesh_calc_poly_uv_area(const MPoly *mpoly, const MLoopUV *uv_array)
+{
+
+  int i, l_iter = mpoly->loopstart;
+  float area;
+  float(*vertexcos)[2] = BLI_array_alloca(vertexcos, (size_t)mpoly->totloop);
+
+  /* pack vertex cos into an array for area_poly_v2 */
+  for (i = 0; i < mpoly->totloop; i++, l_iter++) {
+copy_v2_v2(vertexcos[i], uv_array[l_iter].uv);
+  }
+
+  /* finally calculate the area */
+  area = area_poly_v2((const float(*)[2])vertexcos, (unsigned 
int)mpoly->totloop);
+
+  return area;
+}
+
 /**
  * Calculate the volume and volume-weighted centroid of the volume
  * formed by the polygon and the origin.
diff --git a/source/blender/blenlib/BLI_math_geom.h 
b/source/blender/blenlib/BLI_math_geom.h
index b1437dbe140..39b1b96d009 100644
--- a/source/blender/blenlib/BLI_math_geom.h
+++ b/source/blender/blenlib/BLI_math_geom.h
@@ -92,6 +92,7 @@ float volume_tetrahedron_signed_v3(const float v1[3],
const float v3[3],
const float v4[3]);
 
+bool is_edge_convex_v3(const float v1[3], const float v2[3], const float 
v3[3], const float v4[3]);
 bool is_quad_convex_v3(const float v1[3], const float v2[3], const float 
v3[3], const float v4[3]);
 bool is_quad_convex_v2(const float v1[2], const float v2[2], const float 
v3[2], const float v4[2]);
 bool is_poly_convex_v2(const float verts[][2], unsigned int nr);
diff --git 

[Bf-blender-cvs] [45a45f7d662] master: OpenVDB: Voxel Remesher

2019-08-14 Thread Pablo Dobarro
Commit: 45a45f7d66211e82a3a3288782ad9523e8fdc516
Author: Pablo Dobarro
Date:   Wed Aug 14 18:37:46 2019 +0200
Branches: master
https://developer.blender.org/rB45a45f7d66211e82a3a3288782ad9523e8fdc516

OpenVDB: Voxel Remesher

The voxel remesher introduces a new workflow for sculpting without any of the 
limitations of Dyntopo (no geometry errors or performance penalty when blocking 
shapes). It is also useful for simulations and 3D printing.

This commit includes:
- Voxel remesh operator, voxel size mesh property and general remesh flags.
- Paint mask reprojection.
- Geometry undo/redo for sculpt mode. This should support remesh operations as 
well as future tools that modify the topology of the sculpt in a single step, 
like trimming tools or mesh insert brushes.
- UI changes in the sculpt topbar and the mesh properties pannel.

Reviewed By: brecht

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

===

M   release/scripts/startup/bl_ui/properties_data_mesh.py
M   release/scripts/startup/bl_ui/space_view3d_toolbar.py
A   source/blender/blenkernel/BKE_remesh.h
M   source/blender/blenkernel/CMakeLists.txt
M   source/blender/blenkernel/intern/mesh.c
A   source/blender/blenkernel/intern/remesh.c
M   source/blender/blenloader/intern/versioning_280.c
M   source/blender/editors/include/ED_sculpt.h
M   source/blender/editors/object/CMakeLists.txt
M   source/blender/editors/object/object_intern.h
M   source/blender/editors/object/object_ops.c
A   source/blender/editors/object/object_remesh.c
M   source/blender/editors/sculpt_paint/sculpt.c
M   source/blender/editors/sculpt_paint/sculpt_intern.h
M   source/blender/editors/sculpt_paint/sculpt_undo.c
M   source/blender/makesdna/DNA_mesh_types.h
M   source/blender/makesrna/intern/rna_mesh.c

===

diff --git a/release/scripts/startup/bl_ui/properties_data_mesh.py 
b/release/scripts/startup/bl_ui/properties_data_mesh.py
index 63e4d44eada..47c90199031 100644
--- a/release/scripts/startup/bl_ui/properties_data_mesh.py
+++ b/release/scripts/startup/bl_ui/properties_data_mesh.py
@@ -459,6 +459,22 @@ class DATA_PT_vertex_colors(MeshButtonsPanel, Panel):
 col.operator("mesh.vertex_color_add", icon='ADD', text="")
 col.operator("mesh.vertex_color_remove", icon='REMOVE', text="")
 
+class DATA_PT_remesh(MeshButtonsPanel, Panel):
+bl_label = "Remesh"
+bl_options = {'DEFAULT_CLOSED'}
+COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_EEVEE', 'BLENDER_WORKBENCH'}
+
+def draw(self, context):
+layout = self.layout
+layout.use_property_split = True
+col = layout.column()
+
+mesh = context.mesh
+col.prop(mesh, "remesh_voxel_size")
+col.prop(mesh, "remesh_smooth_normals")
+col.prop(mesh, "remesh_preserve_paint_mask")
+col.operator("object.voxel_remesh", text="Voxel Remesh")
+
 
 class DATA_PT_customdata(MeshButtonsPanel, Panel):
 bl_label = "Geometry Data"
@@ -512,6 +528,7 @@ classes = (
 DATA_PT_normals,
 DATA_PT_normals_auto_smooth,
 DATA_PT_texture_space,
+DATA_PT_remesh,
 DATA_PT_customdata,
 DATA_PT_custom_props_mesh,
 )
diff --git a/release/scripts/startup/bl_ui/space_view3d_toolbar.py 
b/release/scripts/startup/bl_ui/space_view3d_toolbar.py
index cd18d857242..5246d8fa864 100644
--- a/release/scripts/startup/bl_ui/space_view3d_toolbar.py
+++ b/release/scripts/startup/bl_ui/space_view3d_toolbar.py
@@ -1139,8 +1139,38 @@ class VIEW3D_PT_sculpt_dyntopo_remesh(Panel, 
View3DPaintPanel):
 col = flow.column()
 col.operator("sculpt.detail_flood_fill")
 
-# TODO, move to space_view3d.py
+class VIEW3D_PT_sculpt_voxel_remesh(Panel, View3DPaintPanel):
+bl_context = ".sculpt_mode"  # dot on purpose (access from topbar)
+bl_label = "Remesh"
+bl_options = {'DEFAULT_CLOSED'}
+bl_ui_units_x = 12
 
+@classmethod
+def poll(cls, context):
+return (context.sculpt_object and context.tool_settings.sculpt)
+
+def draw_header(self, context):
+is_popover = self.is_popover
+layout = self.layout
+layout.operator(
+"object.voxel_remesh",
+text="",
+emboss=is_popover,
+)
+
+def draw(self, context):
+layout = self.layout
+layout.use_property_split = True
+layout.use_property_decorate = False
+
+col = layout.column()
+mesh = context.active_object.data
+col.prop(mesh, "remesh_voxel_size")
+col.prop(mesh, "remesh_smooth_normals")
+col.prop(mesh, "remesh_preserve_paint_mask")
+col.operator("object.voxel_remesh", text="Remesh")
+
+# TODO, move to space_view3d.py
 
 class VIEW3D_PT_sculpt_options(Panel, View3DPaintPanel):
 bl_context = ".sculpt_mode"  # dot on purpose (access from topbar)
@@ 

[Bf-blender-cvs] [16c28b5a678] master: UI: suppress Copy/Paste/Edit Driver options on whole array property fields.

2019-08-14 Thread Alexander Gavrilov
Commit: 16c28b5a6784dfdc22535cef14961a9a95136a44
Author: Alexander Gavrilov
Date:   Wed Aug 14 19:17:52 2019 +0300
Branches: master
https://developer.blender.org/rB16c28b5a6784dfdc22535cef14961a9a95136a44

UI: suppress Copy/Paste/Edit Driver options on whole array property fields.

When a button represents the whole array (e.g. color picker buttons),
these context menu options were available, but didn't really work
correctly. Since it's not clear how they could reasonably work without
a valid index, it's better to hide them.

===

M   source/blender/editors/interface/interface_context_menu.c
M   source/blender/editors/interface/interface_ops.c

===

diff --git a/source/blender/editors/interface/interface_context_menu.c 
b/source/blender/editors/interface/interface_context_menu.c
index 88fe8704082..22b75da4968 100644
--- a/source/blender/editors/interface/interface_context_menu.c
+++ b/source/blender/editors/interface/interface_context_menu.c
@@ -523,6 +523,7 @@ bool ui_popup_context_menu_for_button(bContext *C, uiBut 
*but)
 /* determine if we can key a single component of an array */
 const bool is_array = RNA_property_array_length(>rnapoin, 
but->rnaprop) != 0;
 const bool is_array_component = (is_array && but->rnaindex != -1);
+const bool is_whole_array = (is_array && but->rnaindex == -1);
 
 const int override_status = RNA_property_override_library_status(ptr, 
prop, -1);
 const bool is_overridable = (override_status & 
RNA_OVERRIDE_STATUS_OVERRIDABLE) != 0;
@@ -658,21 +659,23 @@ bool ui_popup_context_menu_for_button(bContext *C, uiBut 
*but)
1);
   }
 
-  uiItemO(layout,
-  CTX_IFACE_(BLT_I18NCONTEXT_OPERATOR_DEFAULT, "Copy Driver"),
-  ICON_NONE,
-  "ANIM_OT_copy_driver_button");
-  if (ANIM_driver_can_paste()) {
+  if (!is_whole_array) {
 uiItemO(layout,
-CTX_IFACE_(BLT_I18NCONTEXT_OPERATOR_DEFAULT, "Paste Driver"),
+CTX_IFACE_(BLT_I18NCONTEXT_OPERATOR_DEFAULT, "Copy Driver"),
 ICON_NONE,
-"ANIM_OT_paste_driver_button");
-  }
+"ANIM_OT_copy_driver_button");
+if (ANIM_driver_can_paste()) {
+  uiItemO(layout,
+  CTX_IFACE_(BLT_I18NCONTEXT_OPERATOR_DEFAULT, "Paste Driver"),
+  ICON_NONE,
+  "ANIM_OT_paste_driver_button");
+}
 
-  uiItemO(layout,
-  CTX_IFACE_(BLT_I18NCONTEXT_OPERATOR_DEFAULT, "Edit Driver"),
-  ICON_DRIVER,
-  "ANIM_OT_driver_button_edit");
+uiItemO(layout,
+CTX_IFACE_(BLT_I18NCONTEXT_OPERATOR_DEFAULT, "Edit Driver"),
+ICON_DRIVER,
+"ANIM_OT_driver_button_edit");
+  }
 
   uiItemO(layout,
   CTX_IFACE_(BLT_I18NCONTEXT_OPERATOR_DEFAULT, "Open Drivers 
Editor"),
@@ -690,11 +693,13 @@ bool ui_popup_context_menu_for_button(bContext *C, uiBut 
*but)
   ICON_DRIVER,
   "ANIM_OT_driver_button_add");
 
-  if (ANIM_driver_can_paste()) {
-uiItemO(layout,
-CTX_IFACE_(BLT_I18NCONTEXT_OPERATOR_DEFAULT, "Paste Driver"),
-ICON_NONE,
-"ANIM_OT_paste_driver_button");
+  if (!is_whole_array) {
+if (ANIM_driver_can_paste()) {
+  uiItemO(layout,
+  CTX_IFACE_(BLT_I18NCONTEXT_OPERATOR_DEFAULT, "Paste Driver"),
+  ICON_NONE,
+  "ANIM_OT_paste_driver_button");
+}
   }
 
   uiItemO(layout,
@@ -862,7 +867,7 @@ bool ui_popup_context_menu_for_button(bContext *C, uiBut 
*but)
   "UI_OT_unset_property_button");
 }
 
-if (is_idprop && !is_array_component && ELEM(type, PROP_INT, PROP_FLOAT)) {
+if (is_idprop && !is_array && ELEM(type, PROP_INT, PROP_FLOAT)) {
   uiItemO(layout,
   CTX_IFACE_(BLT_I18NCONTEXT_OPERATOR_DEFAULT, "Assign Value as 
Default"),
   ICON_NONE,
@@ -899,7 +904,8 @@ bool ui_popup_context_menu_for_button(bContext *C, uiBut 
*but)
 ICON_NONE,
 "UI_OT_copy_data_path_button");
 
-if (ptr->id.data && ELEM(type, PROP_BOOLEAN, PROP_INT, PROP_FLOAT, 
PROP_ENUM)) {
+if (ptr->id.data && !is_whole_array &&
+ELEM(type, PROP_BOOLEAN, PROP_INT, PROP_FLOAT, PROP_ENUM)) {
   uiItemO(layout,
   CTX_IFACE_(BLT_I18NCONTEXT_OPERATOR_DEFAULT, "Copy As New 
Driver"),
   ICON_NONE,
diff --git a/source/blender/editors/interface/interface_ops.c 
b/source/blender/editors/interface/interface_ops.c
index f5a894d7620..6051bf5ca40 100644
--- a/source/blender/editors/interface/interface_ops.c
+++ b/source/blender/editors/interface/interface_ops.c
@@ -172,7 +172,8 @@ static bool copy_as_driver_button_poll(bContext *C)
   

[Bf-blender-cvs] [9ac3964be19] master: OpenVDB: mesh/level set conversion, filters and CSG operations

2019-08-14 Thread Pablo Dobarro
Commit: 9ac3964be198a9bcbbcf2cda2ecd99047eae560f
Author: Pablo Dobarro
Date:   Wed Aug 14 17:46:20 2019 +0200
Branches: master
https://developer.blender.org/rB9ac3964be198a9bcbbcf2cda2ecd99047eae560f

OpenVDB: mesh/level set conversion, filters and CSG operations

This code is needed to implement the Voxel Remesher as well as other features 
like a better remesh modifier with filters and CSG operations.

Done by Martin Felke and Pablo Dobarro

Reviewed By: brecht

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

===

M   intern/openvdb/CMakeLists.txt
A   intern/openvdb/intern/openvdb_level_set.cc
A   intern/openvdb/intern/openvdb_level_set.h
A   intern/openvdb/intern/openvdb_transform.cc
A   intern/openvdb/intern/openvdb_transform.h
M   intern/openvdb/openvdb_capi.cc
M   intern/openvdb/openvdb_capi.h

===

diff --git a/intern/openvdb/CMakeLists.txt b/intern/openvdb/CMakeLists.txt
index bcb1d545c94..412dade0f1a 100644
--- a/intern/openvdb/CMakeLists.txt
+++ b/intern/openvdb/CMakeLists.txt
@@ -21,6 +21,7 @@
 set(INC
   .
   intern
+  ../guardedalloc
 )
 
 set(INC_SYS
@@ -56,12 +57,16 @@ if(WITH_OPENVDB)
 intern/openvdb_dense_convert.cc
 intern/openvdb_reader.cc
 intern/openvdb_writer.cc
+intern/openvdb_level_set.cc
+intern/openvdb_transform.cc
 openvdb_capi.cc
 openvdb_util.cc
 
 intern/openvdb_dense_convert.h
 intern/openvdb_reader.h
 intern/openvdb_writer.h
+intern/openvdb_level_set.h
+intern/openvdb_transform.h
 openvdb_util.h
   )
 
diff --git a/intern/openvdb/intern/openvdb_level_set.cc 
b/intern/openvdb/intern/openvdb_level_set.cc
new file mode 100644
index 000..a850aae2be5
--- /dev/null
+++ b/intern/openvdb/intern/openvdb_level_set.cc
@@ -0,0 +1,176 @@
+/*
+ * 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) 2015 Blender Foundation.
+ * All rights reserved.
+ */
+
+#include "openvdb_level_set.h"
+#include "openvdb_util.h"
+#include "openvdb_capi.h"
+#include "MEM_guardedalloc.h"
+#include "openvdb/tools/Composite.h"
+
+OpenVDBLevelSet::OpenVDBLevelSet()
+{
+  openvdb::initialize();
+}
+
+OpenVDBLevelSet::~OpenVDBLevelSet()
+{
+}
+
+void OpenVDBLevelSet::mesh_to_level_set(const float *vertices,
+const unsigned int *faces,
+const unsigned int totvertices,
+const unsigned int totfaces,
+const openvdb::math::Transform::Ptr 
)
+{
+  std::vector points(totvertices);
+  std::vector triangles(totfaces);
+  std::vector quads;
+
+  for (unsigned int i = 0; i < totvertices; i++) {
+points[i] = openvdb::Vec3s(vertices[i * 3], vertices[i * 3 + 1], 
vertices[i * 3 + 2]);
+  }
+
+  for (unsigned int i = 0; i < totfaces; i++) {
+triangles[i] = openvdb::Vec3I(faces[i * 3], faces[i * 3 + 1], faces[i * 3 
+ 2]);
+  }
+
+  this->grid = openvdb::tools::meshToLevelSet(
+  *xform, points, triangles, quads, 1);
+}
+
+void OpenVDBLevelSet::volume_to_mesh(OpenVDBVolumeToMeshData *mesh,
+ const double isovalue,
+ const double adaptivity,
+ const bool relax_disoriented_triangles)
+{
+  std::vector out_points;
+  std::vector out_quads;
+  std::vector out_tris;
+  openvdb::tools::volumeToMesh(*this->grid,
+   out_points,
+   out_tris,
+   out_quads,
+   isovalue,
+   adaptivity,
+   
relax_disoriented_triangles);
+  mesh->vertices = (float *)MEM_malloc_arrayN(
+  out_points.size(), 3 * sizeof(float), "openvdb remesher out verts");
+  mesh->quads = (unsigned int *)MEM_malloc_arrayN(
+  out_quads.size(), 4 * sizeof(unsigned int), "openvdb remesh out quads");
+  mesh->triangles = NULL;
+  if (out_tris.size() > 0) {
+mesh->triangles = 

[Bf-blender-cvs] [5ca5357e08f] master: Install_deps: bump official numpy version to 1.17.0

2019-08-14 Thread Bastien Montagne
Commit: 5ca5357e08f25b1fcda95c084ac24722c5177b5e
Author: Bastien Montagne
Date:   Wed Aug 14 17:48:06 2019 +0200
Branches: master
https://developer.blender.org/rB5ca5357e08f25b1fcda95c084ac24722c5177b5e

Install_deps: bump official numpy version to 1.17.0

Following recent ;ails re python version bump (looks like py version
itself had already been bumped in that script).

===

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 e4f03480385..1324616ca35 100755
--- a/build_files/build_environment/install_deps.sh
+++ b/build_files/build_environment/install_deps.sh
@@ -309,7 +309,7 @@ PYTHON_FORCE_BUILD=false
 PYTHON_FORCE_REBUILD=false
 PYTHON_SKIP=false
 
-NUMPY_VERSION="1.15.0"
+NUMPY_VERSION="1.17.0"
 NUMPY_VERSION_MIN="1.8"
 NUMPY_FORCE_BUILD=false
 NUMPY_FORCE_REBUILD=false

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


[Bf-blender-cvs] [8138099fa95] soc-2019-openxr: Silence warnings in OpenXR SDK API layer files

2019-08-14 Thread Julian Eisel
Commit: 8138099fa95f3bd26f77a0024653c79a5a51a4af
Author: Julian Eisel
Date:   Wed Aug 14 17:43:19 2019 +0200
Branches: soc-2019-openxr
https://developer.blender.org/rB8138099fa95f3bd26f77a0024653c79a5a51a4af

Silence warnings in OpenXR SDK API layer files

===

M   extern/openxr/src/api_layers/CMakeLists.txt

===

diff --git a/extern/openxr/src/api_layers/CMakeLists.txt 
b/extern/openxr/src/api_layers/CMakeLists.txt
index 0a73a5c1206..1b8c9599443 100644
--- a/extern/openxr/src/api_layers/CMakeLists.txt
+++ b/extern/openxr/src/api_layers/CMakeLists.txt
@@ -52,8 +52,8 @@ add_dependencies(XrApiLayer_core_validation
 target_include_directories(XrApiLayer_core_validation
 PRIVATE ${OPENXR_ROOT_DIR}/src/common
 PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}
-PRIVATE ${CMAKE_BINARY_DIR}/include
-PRIVATE ${CMAKE_BINARY_DIR}/src
+PRIVATE ${OPENXR_ROOT_DIR}/include
+PRIVATE ${OPENXR_ROOT_DIR}/src
 PRIVATE ${CMAKE_CURRENT_BINARY_DIR}
 )
 if(VulkanHeaders_FOUND)
@@ -88,7 +88,7 @@ elseif(APPLE)
 
 else()
 # Linux core_validation-specific information
-target_compile_options(XrApiLayer_core_validation PRIVATE -Wpointer-arith 
-Wno-unused-function -Wno-sign-compare)
+target_compile_options(XrApiLayer_core_validation PRIVATE -Wpointer-arith 
-Wno-unused-function -Wno-sign-compare -Wno-unused-variable 
-Wno-unused-but-set-variable)
 set_target_properties(XrApiLayer_core_validation PROPERTIES LINK_FLAGS 
"-Wl,-Bsymbolic,--exclude-libs,ALL")
 endif()

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


[Bf-blender-cvs] [02de1b98601] soc-2019-openxr: Quiet warning

2019-08-14 Thread Julian Eisel
Commit: 02de1b98601919ec3ef909644099652458642dfa
Author: Julian Eisel
Date:   Wed Aug 14 16:11:14 2019 +0200
Branches: soc-2019-openxr
https://developer.blender.org/rB02de1b98601919ec3ef909644099652458642dfa

Quiet warning

===

M   intern/ghost/intern/GHOST_XrSession.cpp

===

diff --git a/intern/ghost/intern/GHOST_XrSession.cpp 
b/intern/ghost/intern/GHOST_XrSession.cpp
index e8bd4eac917..3a3e2f0c795 100644
--- a/intern/ghost/intern/GHOST_XrSession.cpp
+++ b/intern/ghost/intern/GHOST_XrSession.cpp
@@ -424,7 +424,7 @@ static void ghost_xr_draw_view_info_from_view(const XrView 
, GHOST_XrDrawVi
   r_info.fov.angle_down = view.fov.angleDown;
 }
 
-bool ghost_xr_draw_view_expects_srgb_buffer(const GHOST_XrContext *context)
+static bool ghost_xr_draw_view_expects_srgb_buffer(const GHOST_XrContext 
*context)
 {
   /* WMR seems to be faulty and doesn't do OETF transform correctly. So expect 
a SRGB buffer to
* compensate. */

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


[Bf-blender-cvs] [c5c4012b107] master: Cleanup: split out splash screen into own file

2019-08-14 Thread Campbell Barton
Commit: c5c4012b107c03dac2ebff321fd36c57c2c7d051
Author: Campbell Barton
Date:   Thu Aug 15 01:12:58 2019 +1000
Branches: master
https://developer.blender.org/rBc5c4012b107c03dac2ebff321fd36c57c2c7d051

Cleanup: split out splash screen into own file

`wm_operators.c` is mainly for generic operator logic
where as the splash screen is one of a kind.

===

M   source/blender/windowmanager/CMakeLists.txt
M   source/blender/windowmanager/intern/wm_operators.c
A   source/blender/windowmanager/intern/wm_splash_screen.c
M   source/blender/windowmanager/wm.h

===

diff --git a/source/blender/windowmanager/CMakeLists.txt 
b/source/blender/windowmanager/CMakeLists.txt
index 64f506f03a8..ddd0ddb46da 100644
--- a/source/blender/windowmanager/CMakeLists.txt
+++ b/source/blender/windowmanager/CMakeLists.txt
@@ -69,6 +69,7 @@ set(SRC
   intern/wm_operators.c
   intern/wm_panel_type.c
   intern/wm_playanim.c
+  intern/wm_splash_screen.c
   intern/wm_stereo.c
   intern/wm_subwindow.c
   intern/wm_toolsystem.c
diff --git a/source/blender/windowmanager/intern/wm_operators.c 
b/source/blender/windowmanager/intern/wm_operators.c
index 089f57c122e..3ce7425f03d 100644
--- a/source/blender/windowmanager/intern/wm_operators.c
+++ b/source/blender/windowmanager/intern/wm_operators.c
@@ -1451,260 +1451,6 @@ static void WM_OT_operator_defaults(wmOperatorType *ot)
   ot->flag = OPTYPE_INTERNAL;
 }
 
-/* * Splash Screen * */
-
-static void wm_block_splash_close(bContext *C, void *arg_block, void 
*UNUSED(arg))
-{
-  wmWindow *win = CTX_wm_window(C);
-  UI_popup_block_close(C, win, arg_block);
-}
-
-static uiBlock *wm_block_create_splash(bContext *C, ARegion *ar, void 
*arg_unused);
-
-static void wm_block_splash_refreshmenu(bContext *C, void *UNUSED(arg_block), 
void *UNUSED(arg))
-{
-  ARegion *ar_menu = CTX_wm_menu(C);
-  ED_region_tag_refresh_ui(ar_menu);
-}
-
-static void wm_block_splash_add_label(uiBlock *block, const char *label, int 
x, int *y)
-{
-  if (!(label && label[0])) {
-return;
-  }
-
-  uiStyle *style = UI_style_get();
-
-  BLF_size(style->widgetlabel.uifont_id, style->widgetlabel.points, 
U.pixelsize * U.dpi);
-  int label_width = BLF_width(style->widgetlabel.uifont_id, label, 
strlen(label));
-  label_width = label_width + U.widget_unit;
-
-  UI_block_emboss_set(block, UI_EMBOSS_NONE);
-
-  uiBut *but = uiDefBut(block,
-UI_BTYPE_LABEL,
-0,
-label,
-x - label_width,
-*y,
-label_width,
-UI_UNIT_Y,
-NULL,
-0,
-0,
-0,
-0,
-NULL);
-
-  /* 1 = UI_SELECT, internal flag to draw in white. */
-  UI_but_flag_enable(but, 1);
-  UI_block_emboss_set(block, UI_EMBOSS);
-  *y -= 12 * U.dpi_fac;
-}
-
-static void wm_block_splash_add_labels(uiBlock *block, int x, int y)
-{
-  /* Version number. */
-  const char *version_suffix = NULL;
-  bool show_build_info = true;
-
-  if (STREQ(STRINGIFY(BLENDER_VERSION_CYCLE), "alpha")) {
-version_suffix = " Alpha";
-  }
-  else if (STREQ(STRINGIFY(BLENDER_VERSION_CYCLE), "beta")) {
-version_suffix = " Beta";
-  }
-  else if (STREQ(STRINGIFY(BLENDER_VERSION_CYCLE), "rc")) {
-version_suffix = " Release Candidate";
-show_build_info = false;
-  }
-  else if (STREQ(STRINGIFY(BLENDER_VERSION_CYCLE), "release")) {
-version_suffix = STRINGIFY(BLENDER_VERSION_CHAR);
-show_build_info = false;
-  }
-
-  char version_buf[256] = "\0";
-  BLI_snprintf(version_buf,
-   sizeof(version_buf),
-   "v %d.%d%s",
-   BLENDER_VERSION / 100,
-   BLENDER_VERSION % 100,
-   version_suffix);
-
-  wm_block_splash_add_label(block, version_buf, x, );
-
-#ifdef WITH_BUILDINFO
-  if (show_build_info) {
-extern unsigned long build_commit_timestamp;
-extern char build_hash[], build_commit_date[], build_commit_time[], 
build_branch[];
-
-/* Date, hidden for builds made from tag. */
-if (build_commit_timestamp != 0) {
-  char date_buf[256] = "\0";
-  BLI_snprintf(
-  date_buf, sizeof(date_buf), "Date: %s %s", build_commit_date, 
build_commit_time);
-  wm_block_splash_add_label(block, date_buf, x, );
-}
-
-/* Hash. */
-char hash_buf[256] = "\0";
-BLI_snprintf(hash_buf, sizeof(hash_buf), "Hash: %s", build_hash);
-wm_block_splash_add_label(block, hash_buf, x, );
-
-/* Branch. */
-if (!STREQ(build_branch, "master")) {
-  char branch_buf[256] = "\0";
-  BLI_snprintf(branch_buf, sizeof(branch_buf), "Branch: %s", build_branch);
-
-  wm_block_splash_add_label(block, branch_buf, x, );
-}
- 

[Bf-blender-cvs] [4b9e05b4289] master: Cleanup: clang-format, sort structs & cmake files

2019-08-14 Thread Campbell Barton
Commit: 4b9e05b42898073c65d97e20295a773f6ce7e78b
Author: Campbell Barton
Date:   Thu Aug 15 01:34:58 2019 +1000
Branches: master
https://developer.blender.org/rB4b9e05b42898073c65d97e20295a773f6ce7e78b

Cleanup: clang-format, sort structs & cmake files

===

M   intern/cycles/kernel/shaders/node_clamp.osl
M   intern/cycles/kernel/shaders/node_map_range.osl
M   source/blender/alembic/intern/abc_customdata.h
M   source/blender/blenkernel/BKE_material.h
M   source/blender/blenlib/intern/delaunay_2d.c
M   source/blender/draw/CMakeLists.txt
M   source/blender/editors/include/ED_anim_api.h
M   source/blender/editors/include/ED_text.h
M   source/blender/editors/space_sequencer/CMakeLists.txt
M   tests/gtests/blenlib/BLI_path_util_test.cc
M   tests/gtests/blenlib/BLI_string_test.cc

===

diff --git a/intern/cycles/kernel/shaders/node_clamp.osl 
b/intern/cycles/kernel/shaders/node_clamp.osl
index 43b0fe88172..87dc1ccdb12 100644
--- a/intern/cycles/kernel/shaders/node_clamp.osl
+++ b/intern/cycles/kernel/shaders/node_clamp.osl
@@ -16,8 +16,7 @@
 
 #include "stdosl.h"
 
-shader node_clamp(float Value = 1.0, float Min = 0.0, float Max = 1.0,
-  output float Result = 0.0)
+shader node_clamp(float Value = 1.0, float Min = 0.0, float Max = 1.0, output 
float Result = 0.0)
 {
-Result = clamp(Value, Min, Max);
+  Result = clamp(Value, Min, Max);
 }
diff --git a/intern/cycles/kernel/shaders/node_map_range.osl 
b/intern/cycles/kernel/shaders/node_map_range.osl
index 417d2ae50a8..8a28edf5f35 100644
--- a/intern/cycles/kernel/shaders/node_map_range.osl
+++ b/intern/cycles/kernel/shaders/node_map_range.osl
@@ -16,8 +16,12 @@
 
 #include "stdosl.h"
 
-shader node_map_range(float Value = 1.0, float FromMin = 0.0, float FromMax = 
1.0,
-  float ToMin = 0.0, float ToMax = 1.0, output float 
Result = 0.0)
+shader node_map_range(float Value = 1.0,
+  float FromMin = 0.0,
+  float FromMax = 1.0,
+  float ToMin = 0.0,
+  float ToMax = 1.0,
+  output float Result = 0.0)
 {
   if (FromMax != FromMin) {
 Result = ToMin + ((Value - FromMin) / (FromMax - FromMin)) * (ToMax - 
ToMin);
diff --git a/source/blender/alembic/intern/abc_customdata.h 
b/source/blender/alembic/intern/abc_customdata.h
index 0ffafa8848e..52f55a41628 100644
--- a/source/blender/alembic/intern/abc_customdata.h
+++ b/source/blender/alembic/intern/abc_customdata.h
@@ -28,11 +28,11 @@
 #include 
 
 struct CustomData;
-struct Mesh;
 struct MLoop;
 struct MLoopUV;
 struct MPoly;
 struct MVert;
+struct Mesh;
 
 using Alembic::Abc::ICompoundProperty;
 using Alembic::Abc::OCompoundProperty;
diff --git a/source/blender/blenkernel/BKE_material.h 
b/source/blender/blenkernel/BKE_material.h
index c7d9a8350b3..5bb69c7166e 100644
--- a/source/blender/blenkernel/BKE_material.h
+++ b/source/blender/blenkernel/BKE_material.h
@@ -28,12 +28,12 @@
 extern "C" {
 #endif
 
-struct bNode;
 struct ID;
 struct Main;
 struct Material;
 struct Object;
 struct Scene;
+struct bNode;
 
 /* materials */
 
diff --git a/source/blender/blenlib/intern/delaunay_2d.c 
b/source/blender/blenlib/intern/delaunay_2d.c
index bb5bd6860c9..8e2687a6b2f 100644
--- a/source/blender/blenlib/intern/delaunay_2d.c
+++ b/source/blender/blenlib/intern/delaunay_2d.c
@@ -36,9 +36,9 @@
 /* Uncomment this define to get helpful debugging functions etc. defined. */
 // #define DEBUG_CDT
 
-struct CDTVert;
 struct CDTEdge;
 struct CDTFace;
+struct CDTVert;
 
 typedef struct SymEdge {
   struct SymEdge *next; /* In face, doing CCW traversal of face. */
diff --git a/source/blender/draw/CMakeLists.txt 
b/source/blender/draw/CMakeLists.txt
index 84302e3cf44..e34ad155f21 100644
--- a/source/blender/draw/CMakeLists.txt
+++ b/source/blender/draw/CMakeLists.txt
@@ -128,8 +128,8 @@ set(SRC
   engines/gpencil/gpencil_engine.h
   engines/gpencil/gpencil_render.c
   engines/gpencil/gpencil_shader_fx.c
-  engines/select/select_engine.c
   engines/select/select_draw_utils.c
+  engines/select/select_engine.c
 
   DRW_engine.h
   DRW_select_buffer.h
diff --git a/source/blender/editors/include/ED_anim_api.h 
b/source/blender/editors/include/ED_anim_api.h
index a232e1376d3..cb6c66ed795 100644
--- a/source/blender/editors/include/ED_anim_api.h
+++ b/source/blender/editors/include/ED_anim_api.h
@@ -25,9 +25,9 @@
 #define __ED_ANIM_API_H__
 
 struct AnimData;
+struct Depsgraph;
 struct ID;
 struct ListBase;
-struct Depsgraph;
 
 struct ARegion;
 struct Main;
diff --git a/source/blender/editors/include/ED_text.h 
b/source/blender/editors/include/ED_text.h
index 40af82acdaf..ade1dde6c33 100644
--- a/source/blender/editors/include/ED_text.h
+++ b/source/blender/editors/include/ED_text.h
@@ -25,11 +25,11 @@
 #define __ED_TEXT_H__
 
 struct 

[Bf-blender-cvs] [8cbe9f1b9ad] master: Cleanup: headers

2019-08-14 Thread Campbell Barton
Commit: 8cbe9f1b9ad8ba63eadbd15270338c24005e0e9c
Author: Campbell Barton
Date:   Thu Aug 15 01:20:27 2019 +1000
Branches: master
https://developer.blender.org/rB8cbe9f1b9ad8ba63eadbd15270338c24005e0e9c

Cleanup: headers

===

M   source/blender/windowmanager/intern/wm_operators.c
M   source/blender/windowmanager/intern/wm_splash_screen.c

===

diff --git a/source/blender/windowmanager/intern/wm_operators.c 
b/source/blender/windowmanager/intern/wm_operators.c
index 3ce7425f03d..4dfcae1d969 100644
--- a/source/blender/windowmanager/intern/wm_operators.c
+++ b/source/blender/windowmanager/intern/wm_operators.c
@@ -46,7 +46,6 @@
 #include "DNA_scene_types.h"
 #include "DNA_userdef_types.h"
 #include "DNA_windowmanager_types.h"
-#include "DNA_workspace_types.h"
 
 #include "BLT_translation.h"
 
@@ -58,10 +57,6 @@
 #include "BLI_math.h"
 #include "BLI_utildefines.h"
 
-#include "BLO_readfile.h"
-
-#include "BKE_appdir.h"
-#include "BKE_blender_version.h"
 #include "BKE_brush.h"
 #include "BKE_context.h"
 #include "BKE_global.h"
@@ -87,7 +82,6 @@
 #include "GPU_state.h"
 
 #include "IMB_imbuf_types.h"
-#include "IMB_imbuf.h"
 
 #include "ED_numinput.h"
 #include "ED_screen.h"
@@ -107,7 +101,6 @@
 
 #include "wm.h"
 #include "wm_draw.h"
-#include "wm_event_system.h"
 #include "wm_event_types.h"
 #include "wm_files.h"
 #include "wm_window.h"
diff --git a/source/blender/windowmanager/intern/wm_splash_screen.c 
b/source/blender/windowmanager/intern/wm_splash_screen.c
index 5b065f1f325..8629997030f 100644
--- a/source/blender/windowmanager/intern/wm_splash_screen.c
+++ b/source/blender/windowmanager/intern/wm_splash_screen.c
@@ -29,93 +29,37 @@
  * - Links to web sites.
  */
 
-#include 
 #include 
-#include 
-#include 
-#include 
-#include 
-#include 
-
-#ifdef WIN32
-#  include "GHOST_C-api.h"
-#endif
-
-#include "MEM_guardedalloc.h"
 
 #include "CLG_log.h"
 
 #include "DNA_ID.h"
-#include "DNA_object_types.h"
 #include "DNA_screen_types.h"
 #include "DNA_scene_types.h"
 #include "DNA_userdef_types.h"
 #include "DNA_windowmanager_types.h"
-#include "DNA_workspace_types.h"
-
-#include "BLT_translation.h"
-
-#include "PIL_time.h"
 
 #include "BLI_blenlib.h"
-#include "BLI_dial_2d.h"
-#include "BLI_dynstr.h" /*for WM_operator_pystring */
-#include "BLI_math.h"
 #include "BLI_utildefines.h"
 
-#include "BLO_readfile.h"
-
 #include "BKE_appdir.h"
 #include "BKE_blender_version.h"
-#include "BKE_brush.h"
 #include "BKE_context.h"
-#include "BKE_global.h"
-#include "BKE_icons.h"
-#include "BKE_idprop.h"
-#include "BKE_image.h"
-#include "BKE_library.h"
-#include "BKE_library_query.h"
-#include "BKE_main.h"
-#include "BKE_material.h"
-#include "BKE_report.h"
-#include "BKE_scene.h"
-#include "BKE_screen.h" /* BKE_ST_MAXNAME */
-#include "BKE_unit.h"
-
-#include "BKE_idcode.h"
+#include "BKE_screen.h"
 
 #include "BLF_api.h"
 
-#include "GPU_immediate.h"
-#include "GPU_immediate_util.h"
-#include "GPU_matrix.h"
-#include "GPU_state.h"
-
 #include "IMB_imbuf_types.h"
 #include "IMB_imbuf.h"
 
-#include "ED_numinput.h"
 #include "ED_screen.h"
-#include "ED_undo.h"
-#include "ED_view3d.h"
-
-#include "RNA_access.h"
-#include "RNA_define.h"
-#include "RNA_enum_types.h"
 
 #include "UI_interface.h"
-#include "UI_interface_icons.h"
-#include "UI_resources.h"
 
 #include "WM_api.h"
 #include "WM_types.h"
 
 #include "wm.h"
-#include "wm_draw.h"
-#include "wm_event_system.h"
-#include "wm_event_types.h"
-#include "wm_files.h"
-#include "wm_window.h"
 
 static void wm_block_splash_close(bContext *C, void *arg_block, void 
*UNUSED(arg))
 {

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


[Bf-blender-cvs] [9bc10c1f542] master: Cleanup: remove comment to workaround weak code parsing

2019-08-14 Thread Campbell Barton
Commit: 9bc10c1f542d3fee601ea35536a3375367cf3652
Author: Campbell Barton
Date:   Thu Aug 15 01:05:15 2019 +1000
Branches: master
https://developer.blender.org/rB9bc10c1f542d3fee601ea35536a3375367cf3652

Cleanup: remove comment to workaround weak code parsing

This is quite an old comment, recent IDE's/editors
should be able to handle escaped quotes in strings.

If kludges like this are needed, developers should note exactly why.

===

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

===

diff --git a/source/blender/blenkernel/intern/action.c 
b/source/blender/blenkernel/intern/action.c
index 57a7379eeae..d072a0aa599 100644
--- a/source/blender/blenkernel/intern/action.c
+++ b/source/blender/blenkernel/intern/action.c
@@ -1420,9 +1420,7 @@ short action_get_item_transforms(bAction *act, Object 
*ob, bPoseChannel *pchan,
 
   if ((curves) || (flags & ACT_TRANS_PROP) == 0) {
 /* custom properties only */
-pPtr = strstr(
-bPtr,
-"[\""); /* extra '"' comment here to keep my texteditor 
functionlist working :) */
+pPtr = strstr(bPtr, "[\"");
 if (pPtr) {
   flags |= ACT_TRANS_PROP;

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


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

2019-08-14 Thread Antonio Vazquez
Commit: 6cb1a5514115eadff3686669c2044c6ff33229e1
Author: Antonio Vazquez
Date:   Wed Aug 14 17:34:06 2019 +0200
Branches: greasepencil-object
https://developer.blender.org/rB6cb1a5514115eadff3686669c2044c6ff33229e1

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] [2623e68c3b0] master: GPencil: Revert commit d727f4f22340 (Interpolate menu)

2019-08-14 Thread Antonioya
Commit: 2623e68c3b0e43134027dda33cd5ec1fc45b3bdc
Author: Antonioya
Date:   Wed Aug 14 17:32:00 2019 +0200
Branches: master
https://developer.blender.org/rB2623e68c3b0e43134027dda33cd5ec1fc45b3bdc

GPencil: Revert commit d727f4f22340 (Interpolate menu)

The menu is not redundant,  it is just another way to reach the tool and also 
give more discoverability of the operator shortcut (Many tools in Blender are 
also on menus, toolbar or header, just think of Move, Rotate, Scale).

There is also no reason to force the user/artist to change to edit mode for 
interpolate strokes, when the tool works perfectly in drawing mode too. It 
would only slow down the 2D animation workflow.

Reviewers: @mendio

===

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

===

diff --git a/release/scripts/startup/bl_ui/space_view3d.py 
b/release/scripts/startup/bl_ui/space_view3d.py
index 85b55378f1d..80865b8f86d 100644
--- a/release/scripts/startup/bl_ui/space_view3d.py
+++ b/release/scripts/startup/bl_ui/space_view3d.py
@@ -4392,6 +4392,7 @@ class VIEW3D_MT_paint_gpencil(Menu):
 layout = self.layout
 
 layout.menu("VIEW3D_MT_gpencil_animation")
+layout.menu("VIEW3D_MT_edit_gpencil_interpolate")
 
 layout.separator()
 
@@ -4447,6 +4448,7 @@ class VIEW3D_MT_edit_gpencil(Menu):
 layout.separator()
 
 layout.menu("VIEW3D_MT_gpencil_animation")
+layout.menu("VIEW3D_MT_edit_gpencil_interpolate")
 
 layout.separator()
 
@@ -4602,6 +4604,16 @@ class VIEW3D_MT_edit_gpencil_showhide(Menu):
 layout.operator("gpencil.reveal", text="Show All Layers")
 
 
+class VIEW3D_MT_edit_gpencil_interpolate(Menu):
+bl_label = "Interpolate"
+
+def draw(self, _context):
+layout = self.layout
+
+layout.operator("gpencil.interpolate", text="Interpolate")
+layout.operator("gpencil.interpolate_sequence", text="Sequence")
+
+
 class VIEW3D_MT_object_mode_pie(Menu):
 bl_label = "Mode"
 
@@ -6634,6 +6646,7 @@ classes = (
 VIEW3D_MT_edit_armature_names,
 VIEW3D_MT_edit_armature_delete,
 VIEW3D_MT_edit_gpencil_transform,
+VIEW3D_MT_edit_gpencil_interpolate,
 VIEW3D_MT_object_mode_pie,
 VIEW3D_MT_view_pie,
 VIEW3D_MT_transform_gizmo_pie,

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


[Bf-blender-cvs] [63bf2ddc5dc] master: Fix main part of T68646: Library overrides: Broken parenting (parent inverse matrix gets reset) after reload.

2019-08-14 Thread Bastien Montagne
Commit: 63bf2ddc5dcf698f30230c326d55a28088e9a8ee
Author: Bastien Montagne
Date:   Wed Aug 14 17:25:40 2019 +0200
Branches: master
https://developer.blender.org/rB63bf2ddc5dcf698f30230c326d55a28088e9a8ee

Fix main part of T68646: Library overrides: Broken parenting (parent inverse 
matrix gets reset) after reload.

We need a custom 'apply override' callback here to prevent resetting
the inverse parent matrix.

Things are now working for basic cases, but complex ones (in production
rigs e.g.) are still partially broken...

===

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

===

diff --git a/source/blender/makesrna/intern/rna_object.c 
b/source/blender/makesrna/intern/rna_object.c
index 6069e78d874..d546c8d7147 100644
--- a/source/blender/makesrna/intern/rna_object.c
+++ b/source/blender/makesrna/intern/rna_object.c
@@ -546,6 +546,46 @@ static void rna_Object_parent_set(PointerRNA *ptr,
   }
 }
 
+bool rna_Object_parent_override_apply(Main *UNUSED(bmain),
+  PointerRNA *ptr_dst,
+  PointerRNA *ptr_src,
+  PointerRNA *ptr_storage,
+  PropertyRNA *prop_dst,
+  PropertyRNA *prop_src,
+  PropertyRNA *UNUSED(prop_storage),
+  const int len_dst,
+  const int len_src,
+  const int len_storage,
+  PointerRNA *UNUSED(ptr_item_dst),
+  PointerRNA *UNUSED(ptr_item_src),
+  PointerRNA *UNUSED(ptr_item_storage),
+  IDOverrideLibraryPropertyOperation *opop)
+{
+  BLI_assert(len_dst == len_src && (!ptr_storage || len_dst == len_storage) && 
len_dst == 0);
+  BLI_assert(opop->operation == IDOVERRIDE_LIBRARY_OP_REPLACE &&
+ "Unsupported RNA override operation on animdata pointer");
+  UNUSED_VARS_NDEBUG(ptr_storage, len_dst, len_src, len_storage, opop);
+
+  /* We need a special handling here because setting parent resets pinvert 
parent matrix,
+   * which is evil in our case. */
+  Object *ob = (Object *)ptr_dst->data;
+  Object *parent_dst = RNA_property_pointer_get(ptr_dst, prop_dst).data;
+  Object *parent_src = RNA_property_pointer_get(ptr_src, prop_src).data;
+
+  if (parent_src == parent_dst) {
+return false;
+  }
+
+  if (parent_src == NULL) {
+/* The only case where we do want default behavior (with matrix reset). */
+ED_object_parent(ob, parent_src, ob->partype, ob->parsubstr);
+  }
+  else {
+ob->parent = parent_src;
+  }
+  return true;
+}
+
 static void rna_Object_parent_type_set(PointerRNA *ptr, int value)
 {
   Object *ob = (Object *)ptr->data;
@@ -2389,6 +2429,7 @@ static void rna_def_object(BlenderRNA *brna)
   RNA_def_property_pointer_funcs(prop, NULL, "rna_Object_parent_set", NULL, 
NULL);
   RNA_def_property_flag(prop, PROP_EDITABLE | PROP_ID_SELF_CHECK);
   RNA_def_property_override_flag(prop, PROPOVERRIDE_OVERRIDABLE_LIBRARY);
+  RNA_def_property_override_funcs(prop, NULL, NULL, 
"rna_Object_parent_override_apply");
   RNA_def_property_ui_text(prop, "Parent", "Parent Object");
   RNA_def_property_update(prop, NC_OBJECT | ND_DRAW, 
"rna_Object_dependency_update");

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


[Bf-blender-cvs] [72eb70f9332] master: Added missing forward declaration

2019-08-14 Thread Sybren A. Stüvel
Commit: 72eb70f93328e4e19a319aa199f6c46a0c8ab420
Author: Sybren A. Stüvel
Date:   Wed Aug 14 16:45:45 2019 +0200
Branches: master
https://developer.blender.org/rB72eb70f93328e4e19a319aa199f6c46a0c8ab420

Added missing forward declaration

===

M   source/blender/editors/include/ED_text.h

===

diff --git a/source/blender/editors/include/ED_text.h 
b/source/blender/editors/include/ED_text.h
index ed71439bd37..39d0b8b26cb 100644
--- a/source/blender/editors/include/ED_text.h
+++ b/source/blender/editors/include/ED_text.h
@@ -25,6 +25,7 @@
 #define __ED_TEXT_H__
 
 struct ARegion;
+struct bContext;
 struct SpaceText;
 struct UndoStep;
 struct UndoType;

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


[Bf-blender-cvs] [05417b22206] master: Text editor: syntax highlighting + line numbers on by default

2019-08-14 Thread Sybren A. Stüvel
Commit: 05417b22206c479b5ebe8ac8e7dd73ae154c8c96
Author: Sybren A. Stüvel
Date:   Tue Aug 13 15:35:48 2019 +0200
Branches: master
https://developer.blender.org/rB05417b22206c479b5ebe8ac8e7dd73ae154c8c96

Text editor: syntax highlighting + line numbers on by default

The most common use of the text editor seems to be for scripting. Having
line numbers and syntax highlighting enabled by default seems sensible.

Syntax highlighting is now enabled by default, but is automatically
disabled when the datablock has a non-highlighted extension.
Highlighting is enabled for filenames like:
- Text
- Text.001
- somefile.py
and is automatically disabled when the datablock has an extension for
which Blender has no syntax highlighter registered.

Reviewers: billreynish, campbellbarton

Subscribers: brecht, billreynish

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

===

M   release/scripts/startup/bl_ui/space_text.py
M   source/blender/blenlib/BLI_path_util.h
M   source/blender/blenlib/BLI_string_utils.h
M   source/blender/blenlib/intern/path_util.c
M   source/blender/blenlib/intern/string_utils.c
M   source/blender/editors/include/ED_text.h
M   source/blender/editors/space_text/space_text.c
M   source/blender/editors/space_text/text_draw.c
M   source/blender/editors/space_text/text_format.c
M   source/blender/makesrna/intern/rna_space.c
M   source/blender/makesrna/intern/rna_text.c
M   source/blender/makesrna/intern/rna_text_api.c
M   tests/gtests/blenlib/BLI_path_util_test.cc
M   tests/gtests/blenlib/BLI_string_test.cc

===

diff --git a/release/scripts/startup/bl_ui/space_text.py 
b/release/scripts/startup/bl_ui/space_text.py
index 1ffb181b219..e82c6bc5dc7 100644
--- a/release/scripts/startup/bl_ui/space_text.py
+++ b/release/scripts/startup/bl_ui/space_text.py
@@ -50,7 +50,11 @@ class TEXT_HT_header(Header):
 row = layout.row(align=True)
 row.prop(st, "show_line_numbers", text="")
 row.prop(st, "show_word_wrap", text="")
-row.prop(st, "show_syntax_highlight", text="")
+
+is_syntax_highlight_supported = st.is_syntax_highlight_supported()
+syntax = row.row(align=True)
+syntax.active = is_syntax_highlight_supported
+syntax.prop(st, "show_syntax_highlight", text="")
 
 if text:
 is_osl = text.name.endswith((".osl", ".osl"))
@@ -65,6 +69,7 @@ class TEXT_HT_header(Header):
 row.prop(text, "use_module")
 
 row = layout.row()
+row.active = is_syntax_highlight_supported
 row.operator("text.run_script")
 
 
@@ -226,7 +231,9 @@ class TEXT_MT_view(Menu):
 
 layout.prop(st, "show_line_numbers")
 layout.prop(st, "show_word_wrap")
-layout.prop(st, "show_syntax_highlight")
+syntax = layout.column()
+syntax.active = st.is_syntax_highlight_supported()
+syntax.prop(st, "show_syntax_highlight")
 layout.prop(st, "show_line_highlight")
 
 layout.separator()
diff --git a/source/blender/blenlib/BLI_path_util.h 
b/source/blender/blenlib/BLI_path_util.h
index 31b68204c51..99e86615e50 100644
--- a/source/blender/blenlib/BLI_path_util.h
+++ b/source/blender/blenlib/BLI_path_util.h
@@ -42,6 +42,8 @@ void BLI_split_dirfile(
 const char *string, char *dir, char *file, const size_t dirlen, const 
size_t filelen);
 void BLI_split_dir_part(const char *string, char *dir, const size_t dirlen);
 void BLI_split_file_part(const char *string, char *file, const size_t filelen);
+const char *BLI_path_extension(const char *filepath) ATTR_NONNULL();
+
 void BLI_path_append(char *__restrict dst, const size_t maxlen, const char 
*__restrict file)
 ATTR_NONNULL();
 void BLI_join_dirfile(char *__restrict string,
diff --git a/source/blender/blenlib/BLI_string_utils.h 
b/source/blender/blenlib/BLI_string_utils.h
index 9740629276d..13dbb2de659 100644
--- a/source/blender/blenlib/BLI_string_utils.h
+++ b/source/blender/blenlib/BLI_string_utils.h
@@ -38,6 +38,7 @@ struct ListBase;
 typedef bool (*UniquenameCheckCallback)(void *arg, const char *name);
 
 size_t BLI_split_name_num(char *left, int *nr, const char *name, const char 
delim);
+bool BLI_string_is_decimal(const char *string) ATTR_NONNULL();
 
 void BLI_string_split_suffix(const char *string, char *r_body, char *r_suf, 
const size_t str_len);
 void BLI_string_split_prefix(const char *string, char *r_pre, char *r_body, 
const size_t str_len);
diff --git a/source/blender/blenlib/intern/path_util.c 
b/source/blender/blenlib/intern/path_util.c
index 111b530a527..18acbca00a1 100644
--- a/source/blender/blenlib/intern/path_util.c
+++ b/source/blender/blenlib/intern/path_util.c
@@ -1684,6 +1684,24 @@ void BLI_split_file_part(const char *string, char *file, 
const size_t filelen)
   

[Bf-blender-cvs] [f0f5e11b33e] master: Eevee: Fix: Regression when using ssr and default shader

2019-08-14 Thread Clément Foucault
Commit: f0f5e11b33ed15de47ba87d2d86295fcfb030fe0
Author: Clément Foucault
Date:   Wed Aug 14 15:56:45 2019 +0200
Branches: master
https://developer.blender.org/rBf0f5e11b33ed15de47ba87d2d86295fcfb030fe0

Eevee: Fix: Regression when using ssr and default shader

===

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

===

diff --git a/source/blender/draw/engines/eevee/shaders/default_frag.glsl 
b/source/blender/draw/engines/eevee/shaders/default_frag.glsl
index 561f1335cb8..1f60661d234 100644
--- a/source/blender/draw/engines/eevee/shaders/default_frag.glsl
+++ b/source/blender/draw/engines/eevee/shaders/default_frag.glsl
@@ -35,7 +35,7 @@ Closure nodetree_exec(void)
 
   Closure cl = CLOSURE_DEFAULT;
   cl.radiance = out_spec + out_diff * albedo;
-  closure_load_ssr_data(ssr_spec, roughness, N, viewCameraVec, 0, cl);
+  closure_load_ssr_data(ssr_spec, roughness, N, viewCameraVec, 1, cl);
 
 #ifdef LOOKDEV
   gl_FragDepth = 0.0;

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


[Bf-blender-cvs] [0dcd442c1f2] master: Fix T68487: double free when inserting keyframe outside of action clip range

2019-08-14 Thread Jacques Lucke
Commit: 0dcd442c1f23e0210363cb6c2ec0c2a6e39c35af
Author: Jacques Lucke
Date:   Wed Aug 14 16:12:16 2019 +0200
Branches: master
https://developer.blender.org/rB0dcd442c1f23e0210363cb6c2ec0c2a6e39c35af

Fix T68487: double free when inserting keyframe outside of action clip range

===

M   source/blender/editors/animation/keyframing.c

===

diff --git a/source/blender/editors/animation/keyframing.c 
b/source/blender/editors/animation/keyframing.c
index de6e4c2fd0d..dcc596e67e1 100644
--- a/source/blender/editors/animation/keyframing.c
+++ b/source/blender/editors/animation/keyframing.c
@@ -1484,10 +1484,10 @@ short insert_keyframe(Main *bmain,
 flag);
   }
 }
-  }
 
-  if (values != value_buffer) {
-MEM_freeN(values);
+if (values != value_buffer) {
+  MEM_freeN(values);
+}
   }
 
   BKE_animsys_free_nla_keyframing_context_cache(_nla_cache);

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


[Bf-blender-cvs] [57712625f2b] soc-2019-openxr: Merge branch 'master' into soc-2019-openxr

2019-08-14 Thread Julian Eisel
Commit: 57712625f2bdcf6d35f7c1f91c21516ea854caf7
Author: Julian Eisel
Date:   Wed Aug 14 16:01:30 2019 +0200
Branches: soc-2019-openxr
https://developer.blender.org/rB57712625f2bdcf6d35f7c1f91c21516ea854caf7

Merge branch 'master' into soc-2019-openxr

===



===



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


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

2019-08-14 Thread Antonio Vazquez
Commit: 1c22d8818a43544a7e91af396758df20aad8b0f4
Author: Antonio Vazquez
Date:   Wed Aug 14 16:00:38 2019 +0200
Branches: greasepencil-object
https://developer.blender.org/rB1c22d8818a43544a7e91af396758df20aad8b0f4

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] [b7f86ff7227] master: Fix Area.ui_type invalid during area change

2019-08-14 Thread Julian Eisel
Commit: b7f86ff72273ffa546c7b06bcebfed85fe67951d
Author: Julian Eisel
Date:   Wed Aug 14 15:51:54 2019 +0200
Branches: master
https://developer.blender.org/rBb7f86ff72273ffa546c7b06bcebfed85fe67951d

Fix Area.ui_type invalid during area change

To reproduce:
* Split 3D View to show Info Editor
* Change 3D View a few times to various subtypes (Timeline, UV Editor
  etc).
Every now and then, the Info Editor should show `UNKNOWN ENUM`. Other
prints may also be lagging behind.

Reviewed By: campbellbarton, brecht
Differential Revision: https://developer.blender.org/D5325

===

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

===

diff --git a/source/blender/makesrna/intern/rna_screen.c 
b/source/blender/makesrna/intern/rna_screen.c
index 853017e6daf..c868c79e968 100644
--- a/source/blender/makesrna/intern/rna_screen.c
+++ b/source/blender/makesrna/intern/rna_screen.c
@@ -225,12 +225,15 @@ static const EnumPropertyItem 
*rna_Area_ui_type_itemf(bContext *C,
 
 static int rna_Area_ui_type_get(PointerRNA *ptr)
 {
-  int value = rna_Area_type_get(ptr) << 16;
   ScrArea *sa = ptr->data;
+  const int area_type = rna_Area_type_get(ptr);
+  const bool area_changing = sa->butspacetype != SPACE_EMPTY;
+  int value = area_type << 16;
+
   /* sa->type can be NULL (when not yet initialized), try to do it now. */
   /* Copied from `ED_area_initialize()`.*/
-  if (sa->type == NULL) {
-sa->type = BKE_spacetype_from_id(sa->spacetype);
+  if (sa->type == NULL || area_changing) {
+sa->type = BKE_spacetype_from_id(area_type);
 if (sa->type == NULL) {
   sa->spacetype = SPACE_VIEW3D;
   sa->type = BKE_spacetype_from_id(sa->spacetype);
@@ -238,7 +241,7 @@ static int rna_Area_ui_type_get(PointerRNA *ptr)
 BLI_assert(sa->type != NULL);
   }
   if (sa->type->space_subtype_item_extend != NULL) {
-value |= sa->type->space_subtype_get(sa);
+value |= area_changing ? sa->butspacetype_subtype : 
sa->type->space_subtype_get(sa);
   }
   return value;
 }

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


[Bf-blender-cvs] [a0d9f387bbc] functions: free types when Blender exits

2019-08-14 Thread Jacques Lucke
Commit: a0d9f387bbc854488f71bb8e5b3feeea697833c9
Author: Jacques Lucke
Date:   Wed Aug 14 15:20:33 2019 +0200
Branches: functions
https://developer.blender.org/rBa0d9f387bbc854488f71bb8e5b3feeea697833c9

free types when Blender exits

===

M   source/blender/blenlib/BLI_vector.hpp
M   source/blender/functions/FN_all-c.h
M   source/blender/functions/initialize.cpp
M   source/blender/functions/types/boolean.cpp
M   source/blender/functions/types/boolean.hpp
M   source/blender/functions/types/external.cpp
M   source/blender/functions/types/external.hpp
M   source/blender/functions/types/initialization.cpp
M   source/blender/functions/types/initialization.hpp
M   source/blender/functions/types/numeric.cpp
M   source/blender/functions/types/numeric.hpp
M   source/blender/windowmanager/CMakeLists.txt
M   source/blender/windowmanager/intern/wm_init_exit.c

===

diff --git a/source/blender/blenlib/BLI_vector.hpp 
b/source/blender/blenlib/BLI_vector.hpp
index 45d01fe28ff..1037a18a5c7 100644
--- a/source/blender/blenlib/BLI_vector.hpp
+++ b/source/blender/blenlib/BLI_vector.hpp
@@ -281,13 +281,8 @@ template class Vector {
   }
 
   /**
-   * Copy the elements of another vector to the end of this vector.
+   * Copy the elements of another array to the end of this vector.
*/
-  void extend(const Vector )
-  {
-this->extend(other.begin(), other.size());
-  }
-
   void extend(ArrayRef array)
   {
 this->extend(array.begin(), array.size());
diff --git a/source/blender/functions/FN_all-c.h 
b/source/blender/functions/FN_all-c.h
index 2b4f3390a81..b970d8be2d5 100644
--- a/source/blender/functions/FN_all-c.h
+++ b/source/blender/functions/FN_all-c.h
@@ -12,6 +12,7 @@ extern "C" {
 #endif
 
 void FN_initialize(void);
+void FN_exit(void);
 
 #ifdef __cplusplus
 }
diff --git a/source/blender/functions/initialize.cpp 
b/source/blender/functions/initialize.cpp
index ee465cd0c04..a7a17469c89 100644
--- a/source/blender/functions/initialize.cpp
+++ b/source/blender/functions/initialize.cpp
@@ -5,3 +5,8 @@ void FN_initialize()
   FN::initialize_llvm();
   FN::Types::initialize_types();
 }
+
+void FN_exit()
+{
+  FN::Types::uninitialize_types();
+}
diff --git a/source/blender/functions/types/boolean.cpp 
b/source/blender/functions/types/boolean.cpp
index 39d47f227ac..c2fe06bb1ef 100644
--- a/source/blender/functions/types/boolean.cpp
+++ b/source/blender/functions/types/boolean.cpp
@@ -33,13 +33,15 @@ class LLVMBool : public TrivialLLVMTypeInfo {
 Type *TYPE_bool = nullptr;
 Type *TYPE_bool_list = nullptr;
 
-void INIT_bool()
+void INIT_bool(Vector _to_free)
 {
   TYPE_bool = new Type("Bool");
   TYPE_bool->add_extension>();
   TYPE_bool->add_extension();
 
   TYPE_bool_list = new_list_type(TYPE_bool);
+
+  types_to_free.extend({TYPE_bool, TYPE_bool_list});
 }
 
 }  // namespace Types
diff --git a/source/blender/functions/types/boolean.hpp 
b/source/blender/functions/types/boolean.hpp
index 622812eb524..c2a396139ab 100644
--- a/source/blender/functions/types/boolean.hpp
+++ b/source/blender/functions/types/boolean.hpp
@@ -5,7 +5,7 @@
 namespace FN {
 namespace Types {
 
-void INIT_bool();
+void INIT_bool(Vector _to_free);
 
 extern Type *TYPE_bool;
 extern Type *TYPE_bool_list;
diff --git a/source/blender/functions/types/external.cpp 
b/source/blender/functions/types/external.cpp
index 1754d84673b..b316f11a048 100644
--- a/source/blender/functions/types/external.cpp
+++ b/source/blender/functions/types/external.cpp
@@ -11,7 +11,7 @@ namespace Types {
 Type *TYPE_object = nullptr;
 Type *TYPE_object_list = nullptr;
 
-void INIT_external()
+void INIT_external(Vector _to_free)
 {
   TYPE_object = new Type("Object");
   TYPE_object->add_extension>();
@@ -19,6 +19,8 @@ void INIT_external()
   [](void *value) { return value; }, [](void *UNUSED(value)) {}, []() { 
return nullptr; });
 
   TYPE_object_list = new_list_type(TYPE_object);
+
+  types_to_free.extend({TYPE_object, TYPE_object_list});
 }
 
 }  // namespace Types
diff --git a/source/blender/functions/types/external.hpp 
b/source/blender/functions/types/external.hpp
index a6149083377..c848cfd1d0c 100644
--- a/source/blender/functions/types/external.hpp
+++ b/source/blender/functions/types/external.hpp
@@ -5,7 +5,8 @@
 namespace FN {
 namespace Types {
 
-void INIT_external();
+void INIT_external(Vector _to_free);
+
 extern Type *TYPE_object;
 extern Type *TYPE_object_list;
 
diff --git a/source/blender/functions/types/initialization.cpp 
b/source/blender/functions/types/initialization.cpp
index 75b3c427fce..5ccd06c7dbe 100644
--- a/source/blender/functions/types/initialization.cpp
+++ b/source/blender/functions/types/initialization.cpp
@@ -3,16 +3,21 @@
 namespace FN {
 namespace Types {
 
+Vector types_to_free;
+
 void initialize_types(void)
 {
-  INIT_bool();
-  INIT_external();
-  

[Bf-blender-cvs] [f52b66c7ece] functions: cleanup type usage

2019-08-14 Thread Jacques Lucke
Commit: f52b66c7ece8455bad2ccbe8bb6c83506d2287ef
Author: Jacques Lucke
Date:   Wed Aug 14 15:32:26 2019 +0200
Branches: functions
https://developer.blender.org/rBf52b66c7ece8455bad2ccbe8bb6c83506d2287ef

cleanup type usage

===

M   
source/blender/functions/frontends/data_flow_nodes/unlinked_input_inserters.cpp
M   source/blender/simulations/bparticles/emitters.cpp

===

diff --git 
a/source/blender/functions/frontends/data_flow_nodes/unlinked_input_inserters.cpp
 
b/source/blender/functions/frontends/data_flow_nodes/unlinked_input_inserters.cpp
index 947c911763a..0a9f6dfdfe1 100644
--- 
a/source/blender/functions/frontends/data_flow_nodes/unlinked_input_inserters.cpp
+++ 
b/source/blender/functions/frontends/data_flow_nodes/unlinked_input_inserters.cpp
@@ -129,20 +129,17 @@ class ConstantOutputGen : public LLVMBuildIRBody {
 const BuildIRSettings (settings)) const override
   {
 TupleMeta  = m_tuple->meta();
-Type *float_type = Types::TYPE_float;
-Type *int32_type = Types::TYPE_int32;
-Type *float3_type = Types::TYPE_float3;
 
 for (uint i = 0; i < m_tuple->size(); i++) {
   Type *type = meta.types()[i];
   llvm::Value *value = nullptr;
-  if (type == float_type) {
+  if (type == Types::TYPE_float) {
 value = builder.getFloat(m_tuple->get(i));
   }
-  else if (type == int32_type) {
+  else if (type == Types::TYPE_int32) {
 value = builder.getInt32(m_tuple->get(i));
   }
-  else if (type == float3_type) {
+  else if (type == Types::TYPE_float3) {
 value = builder.getFloat3(m_tuple->get(i));
   }
   else {
diff --git a/source/blender/simulations/bparticles/emitters.cpp 
b/source/blender/simulations/bparticles/emitters.cpp
index 0745506ae33..fc539597b86 100644
--- a/source/blender/simulations/bparticles/emitters.cpp
+++ b/source/blender/simulations/bparticles/emitters.cpp
@@ -15,6 +15,7 @@
 namespace BParticles {
 
 using FN::SharedList;
+using namespace FN::Types;
 
 static float random_float()
 {
@@ -137,19 +138,10 @@ void CustomFunctionEmitter::emit(EmitterInterface 
)
   body.set_input(fn_in, 1, "Time Step", 
interface.time_span().duration());
   body.call__setup_execution_context(fn_in, fn_out);
 
-  FN::Type *float_list_type = FN::Types::TYPE_float_list;
-  FN::Type *float3_list_type = FN::Types::TYPE_float3_list;
-  FN::Type *int32_list_type = FN::Types::TYPE_int32_list;
-  FN::Type *rgba_f_list_type = FN::Types::TYPE_rgba_f_list;
-  FN::Type *float_type = FN::Types::TYPE_float;
-  FN::Type *float3_type = FN::Types::TYPE_float3;
-  FN::Type *int32_type = FN::Types::TYPE_int32;
-  FN::Type *rgba_f_type = FN::Types::TYPE_rgba_f;
-
   uint new_particle_amount = 0;
   for (uint i = 0; i < m_function->output_amount(); i++) {
 FN::Type *type = m_function->output_type(i);
-if (ELEM(type, float_list_type, float3_list_type, int32_list_type, 
rgba_f_list_type)) {
+if (ELEM(type, TYPE_float_list, TYPE_float3_list, TYPE_int32_list, 
TYPE_rgba_f_list)) {
   uint length = fn_out.get_ref(i)->size();
   new_particle_amount = std::max(new_particle_amount, length);
 }
@@ -168,32 +160,32 @@ void CustomFunctionEmitter::emit(EmitterInterface 
)
   continue;
 }
 
-if (type == float_list_type) {
+if (type == TYPE_float_list) {
   auto list = fn_out.relocate_out(i);
   new_particles.set_repeated(attribute_index, 
list->as_array_ref());
 }
-else if (type == float3_list_type) {
+else if (type == TYPE_float3_list) {
   auto list = fn_out.relocate_out(i);
   new_particles.set_repeated(attribute_index, 
list->as_array_ref());
 }
-else if (type == int32_list_type) {
+else if (type == TYPE_int32_list) {
   auto list = fn_out.relocate_out(i);
   new_particles.set_repeated(attribute_index, 
list->as_array_ref());
 }
-else if (type == rgba_f_list_type) {
+else if (type == TYPE_rgba_f_list) {
   auto list = fn_out.relocate_out(i);
   new_particles.set_repeated(attribute_index, 
list->as_array_ref());
 }
-else if (type == float_type) {
+else if (type == TYPE_float) {
   new_particles.fill(attribute_index, fn_out.get(i));
 }
-else if (type == float3_type) {
+else if (type == TYPE_float3) {
   new_particles.fill(attribute_index, fn_out.get(i));
 }
-else if (type == int32_type) {
+else if (type == TYPE_int32) {
   new_particles.fill(attribute_index, fn_out.get(i));
 }
-else if (type == rgba_f_type) {
+else if (type == TYPE_rgba_f) {
   new_particles.fill(attribute_index, fn_out.get(i));
 }
   }

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


[Bf-blender-cvs] [e16afbe4f50] functions: use guarded allocator for some core types

2019-08-14 Thread Jacques Lucke
Commit: e16afbe4f50dc6a38cedf8a66c9f382188cd7825
Author: Jacques Lucke
Date:   Wed Aug 14 14:59:24 2019 +0200
Branches: functions
https://developer.blender.org/rBe16afbe4f50dc6a38cedf8a66c9f382188cd7825

use guarded allocator for some core types

===

M   source/blender/functions/core/data_graph.hpp
M   source/blender/functions/core/function.hpp
M   source/blender/functions/core/type.hpp

===

diff --git a/source/blender/functions/core/data_graph.hpp 
b/source/blender/functions/core/data_graph.hpp
index 33518c89f7f..f79d4b9137b 100644
--- a/source/blender/functions/core/data_graph.hpp
+++ b/source/blender/functions/core/data_graph.hpp
@@ -213,6 +213,10 @@ class DataGraph : public RefCounter {
   DataGraph(DataGraph ) = delete;
   ~DataGraph();
 
+#ifdef WITH_CXX_GUARDEDALLOC
+  MEM_CXX_CLASS_ALLOC_FUNCS("FN:DataGraph")
+#endif
+
   Range node_ids() const
   {
 return Range(0, m_nodes.size());
diff --git a/source/blender/functions/core/function.hpp 
b/source/blender/functions/core/function.hpp
index 942017fa390..21e39c5ba1b 100644
--- a/source/blender/functions/core/function.hpp
+++ b/source/blender/functions/core/function.hpp
@@ -66,6 +66,10 @@ class Function final : public RefCounter {
 
   ~Function();
 
+#ifdef WITH_CXX_GUARDEDALLOC
+  MEM_CXX_CLASS_ALLOC_FUNCS("FN:Function")
+#endif
+
   /**
* Get the name of the function.
*/
diff --git a/source/blender/functions/core/type.hpp 
b/source/blender/functions/core/type.hpp
index adc5370b52d..c0f84e14aa1 100644
--- a/source/blender/functions/core/type.hpp
+++ b/source/blender/functions/core/type.hpp
@@ -23,6 +23,7 @@
 #include 
 #include "BLI_refcount.hpp"
 #include "BLI_string_ref.hpp"
+#include "MEM_guardedalloc.h"
 
 namespace FN {
 
@@ -55,6 +56,10 @@ class Type final {
   Type(StringRef name);
   ~Type();
 
+#ifdef WITH_CXX_GUARDEDALLOC
+  MEM_CXX_CLASS_ALLOC_FUNCS("FN:Types")
+#endif
+
   /**
* Get the name of the type.
*/

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


[Bf-blender-cvs] [7921c6cb7e3] functions: store types in global variables

2019-08-14 Thread Jacques Lucke
Commit: 7921c6cb7e3bcda06918c984780773670ce760ce
Author: Jacques Lucke
Date:   Wed Aug 14 14:39:39 2019 +0200
Branches: functions
https://developer.blender.org/rB7921c6cb7e3bcda06918c984780773670ce760ce

store types in global variables

===

M   source/blender/functions/CMakeLists.txt
M   source/blender/functions/FN_types.hpp
M   
source/blender/functions/frontends/data_flow_nodes/mappings/socket_loaders.cpp
M   
source/blender/functions/frontends/data_flow_nodes/mappings/type_mappings.cpp
M   
source/blender/functions/frontends/data_flow_nodes/unlinked_input_inserters.cpp
M   source/blender/functions/functions/color.cpp
M   source/blender/functions/functions/comparisons.cpp
M   source/blender/functions/functions/constants.cpp
M   source/blender/functions/functions/lists.cpp
M   source/blender/functions/functions/object_input.cpp
M   source/blender/functions/functions/random.cpp
M   source/blender/functions/functions/ranges.cpp
M   source/blender/functions/functions/scalar_math.cpp
M   source/blender/functions/functions/simple_conversions.cpp
M   source/blender/functions/functions/switch.cpp
M   source/blender/functions/functions/vectors.cpp
M   source/blender/functions/initialize.cpp
M   source/blender/functions/types/boolean.cpp
M   source/blender/functions/types/boolean.hpp
M   source/blender/functions/types/external.cpp
M   source/blender/functions/types/external.hpp
A   source/blender/functions/types/initialization.cpp
A   source/blender/functions/types/initialization.hpp
M   source/blender/functions/types/lists.cpp
M   source/blender/functions/types/lists.hpp
M   source/blender/functions/types/numeric.cpp
M   source/blender/functions/types/numeric.hpp
M   source/blender/functions/types/types-c.cpp
M   source/blender/functions/types/types-c.h
M   source/blender/simulations/bparticles/emitters.cpp
M   source/blender/simulations/bparticles/inserters.cpp

===

diff --git a/source/blender/functions/CMakeLists.txt 
b/source/blender/functions/CMakeLists.txt
index 842a0388716..1142db625d1 100644
--- a/source/blender/functions/CMakeLists.txt
+++ b/source/blender/functions/CMakeLists.txt
@@ -100,6 +100,8 @@ set(SRC
   backends/llvm/context_pool.hpp
   backends/llvm/context_pool.cpp
 
+  types/initialization.hpp
+  types/initialization.cpp
   types/lists.hpp
   types/lists.cpp
   types/numeric.hpp
diff --git a/source/blender/functions/FN_types.hpp 
b/source/blender/functions/FN_types.hpp
index 39c99ef598d..f9e5229c7b0 100644
--- a/source/blender/functions/FN_types.hpp
+++ b/source/blender/functions/FN_types.hpp
@@ -5,3 +5,4 @@
 #include "types/numeric.hpp"
 #include "types/boolean.hpp"
 #include "types/external.hpp"
+#include "types/initialization.hpp"
diff --git 
a/source/blender/functions/frontends/data_flow_nodes/mappings/socket_loaders.cpp
 
b/source/blender/functions/frontends/data_flow_nodes/mappings/socket_loaders.cpp
index 61c2a71195b..30b6bf0c80b 100644
--- 
a/source/blender/functions/frontends/data_flow_nodes/mappings/socket_loaders.cpp
+++ 
b/source/blender/functions/frontends/data_flow_nodes/mappings/socket_loaders.cpp
@@ -52,7 +52,7 @@ static void LOAD_color(PointerRNA *rna, Tuple , uint 
index)
 
 static SocketLoader GET_empty_list_loader(Type *type)
 {
-  return [](PointerRNA *UNUSED(rna), Tuple , uint index) {
+  return [type](PointerRNA *UNUSED(rna), Tuple , uint index) {
 auto list = SharedList::New(type);
 tuple.move_in(index, list);
   };
@@ -60,17 +60,17 @@ static SocketLoader GET_empty_list_loader(Type *type)
 
 void REGISTER_socket_loaders(std::unique_ptr )
 {
-  loaders->register_loader("Boolean List", 
GET_empty_list_loader(GET_TYPE_bool()));
+  loaders->register_loader("Boolean List", GET_empty_list_loader(TYPE_bool));
   loaders->register_loader("Boolean", LOAD_boolean);
-  loaders->register_loader("Color List", 
GET_empty_list_loader(GET_TYPE_rgba_f()));
+  loaders->register_loader("Color List", GET_empty_list_loader(TYPE_rgba_f));
   loaders->register_loader("Color", LOAD_color);
-  loaders->register_loader("Float List", 
GET_empty_list_loader(GET_TYPE_float()));
+  loaders->register_loader("Float List", GET_empty_list_loader(TYPE_float));
   loaders->register_loader("Float", LOAD_float);
-  loaders->register_loader("Integer List", 
GET_empty_list_loader(GET_TYPE_int32()));
+  loaders->register_loader("Integer List", GET_empty_list_loader(TYPE_int32));
   loaders->register_loader("Integer", LOAD_integer);
-  loaders->register_loader("Object List", 
GET_empty_list_loader(GET_TYPE_object()));
+  loaders->register_loader("Object List", GET_empty_list_loader(TYPE_object));
   loaders->register_loader("Object", LOAD_object);
-  loaders->register_loader("Vector List", 
GET_empty_list_loader(GET_TYPE_float3()));
+  

[Bf-blender-cvs] [def527c9b03] functions: Do not use a reference counter for Types

2019-08-14 Thread Jacques Lucke
Commit: def527c9b03aa0b6f035fa0065a32adb6bd4e044
Author: Jacques Lucke
Date:   Wed Aug 14 13:59:05 2019 +0200
Branches: functions
https://developer.blender.org/rBdef527c9b03aa0b6f035fa0065a32adb6bd4e044

Do not use a reference counter for Types

Types can be expected to stay alive until Blender exists.
This also works well with the fact that they are identified
by their pointer.

Furthermore, the number of types is fairly low, but they
are passed around a lot. Maintaining a thread-safe reference
count seems to be unnecessary overhead.

===

M   source/blender/blenkernel/intern/fcurve.c
M   source/blender/functions/backends/cpp/list.hpp
M   source/blender/functions/backends/cpp/tuple.cpp
M   source/blender/functions/backends/cpp/tuple.hpp
M   source/blender/functions/backends/llvm/fgraph_ir_generation.cpp
M   source/blender/functions/backends/llvm/llvm_type_info.hpp
M   source/blender/functions/core/core-c.cpp
M   source/blender/functions/core/core-c.h
M   source/blender/functions/core/data_graph.hpp
M   source/blender/functions/core/data_graph_builder.hpp
M   source/blender/functions/core/function.cpp
M   source/blender/functions/core/function.hpp
M   source/blender/functions/core/function_builder.cpp
M   source/blender/functions/core/function_builder.hpp
M   source/blender/functions/core/type.hpp
M   source/blender/functions/frontends/data_flow_nodes/mappings.cpp
M   source/blender/functions/frontends/data_flow_nodes/mappings.hpp
M   
source/blender/functions/frontends/data_flow_nodes/mappings/conversion_inserters.cpp
M   
source/blender/functions/frontends/data_flow_nodes/mappings/node_inserters.cpp
M   
source/blender/functions/frontends/data_flow_nodes/mappings/socket_loaders.cpp
M   
source/blender/functions/frontends/data_flow_nodes/unlinked_input_inserters.cpp
M   
source/blender/functions/frontends/data_flow_nodes/unlinked_input_inserters.hpp
M   
source/blender/functions/frontends/data_flow_nodes/vtree_data_graph_builder.cpp
M   
source/blender/functions/frontends/data_flow_nodes/vtree_data_graph_builder.hpp
M   source/blender/functions/functions/array_execution.cpp
M   source/blender/functions/functions/auto_vectorization.cpp
M   source/blender/functions/functions/lists.cpp
M   source/blender/functions/functions/lists.hpp
M   source/blender/functions/functions/simple_conversions.cpp
M   source/blender/functions/functions/switch.cpp
M   source/blender/functions/functions/switch.hpp
M   source/blender/functions/types/boolean.cpp
M   source/blender/functions/types/boolean.hpp
M   source/blender/functions/types/external.cpp
M   source/blender/functions/types/external.hpp
M   source/blender/functions/types/lists.cpp
M   source/blender/functions/types/lists.hpp
M   source/blender/functions/types/numeric.cpp
M   source/blender/functions/types/numeric.hpp
M   source/blender/functions/types/types-c.cpp
M   source/blender/functions/types/types-c.h
M   source/blender/modifiers/intern/MOD_functiondeform.c
M   source/blender/modifiers/intern/MOD_functionpoints.c
M   source/blender/simulations/bparticles/emitters.cpp
M   source/blender/simulations/bparticles/inserters.cpp
M   source/blender/simulations/bparticles/particle_function.hpp
M   source/blender/simulations/bparticles/particle_function_builder.cpp

===

diff --git a/source/blender/blenkernel/intern/fcurve.c 
b/source/blender/blenkernel/intern/fcurve.c
index 8b43fafc1f1..39265277b62 100644
--- a/source/blender/blenkernel/intern/fcurve.c
+++ b/source/blender/blenkernel/intern/fcurve.c
@@ -1770,8 +1770,8 @@ static float dvar_eval_function(ChannelDriver 
*UNUSED(driver), DriverVar *dvar)
 struct bNodeTree;
 void *get_driver_variable_function(DriverVar *dvar)
 {
-  FnType float_ty = FN_type_borrow_float();
-  FnType int32_ty = FN_type_borrow_int32();
+  FnType float_ty = FN_type_get_float();
+  FnType int32_ty = FN_type_get_int32();
   FnType inputs[] = {int32_ty, NULL};
   FnType outputs[] = {float_ty, NULL};
 
diff --git a/source/blender/functions/backends/cpp/list.hpp 
b/source/blender/functions/backends/cpp/list.hpp
index 357cc35164b..a38662b5a58 100644
--- a/source/blender/functions/backends/cpp/list.hpp
+++ b/source/blender/functions/backends/cpp/list.hpp
@@ -10,7 +10,7 @@ using SharedList = AutoRefCount;
 
 class List : public RefCounter {
  private:
-  SharedType m_type;
+  Type *m_type;
   CPPTypeInfo *m_type_info;
   void *m_storage;
   uint m_size;
@@ -18,7 +18,7 @@ class List : public RefCounter {
 
  public:
   List() = delete;
-  List(SharedType type) : m_type(std::move(type))
+  List(Type *type) : m_type(std::move(type))
   {
 m_type_info = _type->extension();
 m_storage = nullptr;
@@ -120,7 +120,7 @@ class List : public 

[Bf-blender-cvs] [03b2371387d] master: Cleanup: move trailing comments to avoid wrapping code

2019-08-14 Thread Campbell Barton
Commit: 03b2371387dcae9f801cabbc1819b1d7e3350829
Author: Campbell Barton
Date:   Wed Aug 14 23:29:46 2019 +1000
Branches: master
https://developer.blender.org/rB03b2371387dcae9f801cabbc1819b1d7e3350829

Cleanup: move trailing comments to avoid wrapping code

Some statements were split across multiple lines because of their
trailing comments.

In most cases it's clearer to put the comments above.

===

M   source/blender/alembic/intern/abc_exporter.cc
M   source/blender/blenfont/intern/blf_font.c
M   source/blender/blenfont/intern/blf_glyph.c
M   source/blender/blenkernel/BKE_material.h
M   source/blender/blenkernel/BKE_node.h
M   source/blender/blenkernel/BKE_writeavi.h
M   source/blender/blenkernel/intern/armature.c
M   source/blender/blenkernel/intern/collection.c
M   source/blender/blenkernel/intern/curve.c
M   source/blender/blenkernel/intern/dynamicpaint.c
M   source/blender/blenkernel/intern/effect.c
M   source/blender/blenkernel/intern/fcurve.c
M   source/blender/blenkernel/intern/fmodifier.c
M   source/blender/blenkernel/intern/gpencil.c
M   source/blender/blenkernel/intern/library_override.c
M   source/blender/blenkernel/intern/library_query.c
M   source/blender/blenkernel/intern/main.c
M   source/blender/blenkernel/intern/mask.c
M   source/blender/blenkernel/intern/nla.c
M   source/blender/blenkernel/intern/object_dupli.c
M   source/blender/blenkernel/intern/particle.c
M   source/blender/blenkernel/intern/pointcache.c
M   source/blender/blenkernel/intern/softbody.c
M   source/blender/blenkernel/intern/unit.c
M   source/blender/blenloader/intern/readfile.c
M   source/blender/blenloader/intern/versioning_280.c
M   source/blender/bmesh/operators/bmo_primitive.c
M   source/blender/bmesh/operators/bmo_removedoubles.c
M   source/blender/collada/MeshImporter.cpp
M   source/blender/draw/engines/eevee/eevee_lights.c
M   source/blender/draw/engines/eevee/eevee_mist.c
M   source/blender/draw/engines/eevee/eevee_occlusion.c
M   source/blender/draw/engines/eevee/shaders/lights_lib.glsl
M   source/blender/draw/engines/workbench/workbench_studiolight.c
M   source/blender/editors/curve/editcurve.c
M   source/blender/editors/gpencil/gpencil_edit.c
M   source/blender/editors/interface/interface_utils.c
M   source/blender/editors/object/object_shader_fx.c
M   source/blender/editors/space_view3d/view3d_select.c
M   source/blender/gpu/GPU_batch.h
M   source/blender/gpu/GPU_matrix.h
M   source/blender/gpu/GPU_vertex_buffer.h
M   source/blender/gpu/intern/gpu_context.cpp
M   source/blender/gpu/intern/gpu_immediate.c
M   source/blender/gpu/intern/gpu_vertex_format.c
M   source/blender/imbuf/intern/imageprocess.c
M   source/blender/imbuf/intern/openexr/openexr_api.cpp
M   source/blender/makesrna/RNA_access.h
M   source/blender/makesrna/intern/rna_access.c
M   source/blender/makesrna/intern/rna_curve.c
M   source/blender/makesrna/intern/rna_define.c
M   source/blender/makesrna/intern/rna_rna.c
M   source/blender/makesrna/intern/rna_ui_api.c
M   source/blender/makesrna/intern/rna_wm.c
M   source/blender/makesrna/intern/rna_wm_gizmo.c
M   source/blender/modifiers/intern/MOD_bevel.c
M   source/blender/modifiers/intern/MOD_boolean.c
M   source/blender/modifiers/intern/MOD_simpledeform.c
M   source/blender/physics/intern/implicit_blender.c
M   source/blender/python/bmesh/bmesh_py_types.h
M   source/blender/python/bmesh/bmesh_py_types_customdata.c
M   source/blender/python/generic/idprop_py_api.c
M   source/blender/python/intern/bpy_operator.c
M   source/blender/python/intern/bpy_props.c
M   source/blender/python/intern/bpy_rna_anim.c
M   source/blender/python/intern/bpy_rna_array.c
M   source/blender/python/mathutils/mathutils.h
M   source/blender/windowmanager/WM_api.h
M   source/blender/windowmanager/intern/wm_event_system.c
M   source/blender/windowmanager/intern/wm_operator_props.c
M   source/blender/windowmanager/intern/wm_operators.c
M   tests/gtests/blenlib/BLI_string_test.cc

===

diff --git a/source/blender/alembic/intern/abc_exporter.cc 
b/source/blender/alembic/intern/abc_exporter.cc
index 56fb5a68402..f19e0257b1b 100644
--- a/source/blender/alembic/intern/abc_exporter.cc
+++ b/source/blender/alembic/intern/abc_exporter.cc
@@ -241,9 +241,9 @@ Alembic::Abc::TimeSamplingPtr 
AbcExporter::createTimeSampling(double step)
 
   getShutterSamples(step, true, samples);
 
-  Alembic::Abc::TimeSamplingType ts(
-  static_cast(samples.size()),
-  1.0 / m_settings.scene->r.frs_sec); /* TODO(Sybren): shouldn't we use 
the FPS macro here? */
+  /* TODO(Sybren): shouldn't we use the FPS macro here? */
+  

[Bf-blender-cvs] [bc4fe45aef7] master: Cleanup: pep8, prefix unused arg

2019-08-14 Thread Campbell Barton
Commit: bc4fe45aef7e52f9e7a2bd5e370c6791c58af832
Author: Campbell Barton
Date:   Wed Aug 14 23:25:30 2019 +1000
Branches: master
https://developer.blender.org/rBbc4fe45aef7e52f9e7a2bd5e370c6791c58af832

Cleanup: pep8, prefix unused arg

===

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

===

diff --git a/release/scripts/startup/bl_operators/wm.py 
b/release/scripts/startup/bl_operators/wm.py
index 3f25c35973d..d59ad0694db 100644
--- a/release/scripts/startup/bl_operators/wm.py
+++ b/release/scripts/startup/bl_operators/wm.py
@@ -1115,12 +1115,12 @@ class WM_OT_properties_edit(Operator):
 )
 subtype: EnumProperty(
 name="Subtype",
-items=lambda self,ctx: WM_OT_properties_edit.subtype_items,
+items=lambda self, _context: WM_OT_properties_edit.subtype_items,
 )
 
 subtype_items = rna_vector_subtype_items
 
-def init_subtype(self, prop_type, is_array, subtype):
+def _init_subtype(self, prop_type, is_array, subtype):
 subtype = subtype or 'NONE'
 subtype_items = rna_vector_subtype_items
 
@@ -1314,7 +1314,7 @@ class WM_OT_properties_edit(Operator):
 else:
 subtype = None
 
-self.init_subtype(prop_type, is_array, subtype)
+self._init_subtype(prop_type, is_array, subtype)
 
 # store for comparison
 self._cmp_props = self._cmp_props_get()

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


[Bf-blender-cvs] [e6425aa2bf3] master: Manage GPU_matrix stacks per GPUContext

2019-08-14 Thread Julian Eisel
Commit: e6425aa2bf3e6a9bba2f10066dc3f09cea11086f
Author: Julian Eisel
Date:   Wed Aug 14 15:27:10 2019 +0200
Branches: master
https://developer.blender.org/rBe6425aa2bf3e6a9bba2f10066dc3f09cea11086f

Manage GPU_matrix stacks per GPUContext

Previously, we had one global `GPU_matrix` stack, so the API was not
thread safe. This patch makes the stack be per `GPUContext`, effectively
making it local per thread (`GPUContext` is located in thread local
storage).

Reviewed By: brecht
Differential Revision: https://developer.blender.org/D5405

===

M   source/blender/gpu/CMakeLists.txt
M   source/blender/gpu/intern/gpu_context.cpp
M   source/blender/gpu/intern/gpu_context_private.h
M   source/blender/gpu/intern/gpu_matrix.c
A   source/blender/gpu/intern/gpu_matrix_private.h

===

diff --git a/source/blender/gpu/CMakeLists.txt 
b/source/blender/gpu/CMakeLists.txt
index c620644a5f8..fb7d3c1ace8 100644
--- a/source/blender/gpu/CMakeLists.txt
+++ b/source/blender/gpu/CMakeLists.txt
@@ -116,6 +116,7 @@ set(SRC
   intern/gpu_batch_private.h
   intern/gpu_codegen.h
   intern/gpu_context_private.h
+  intern/gpu_matrix_private.h
   intern/gpu_primitive_private.h
   intern/gpu_private.h
   intern/gpu_select_private.h
diff --git a/source/blender/gpu/intern/gpu_context.cpp 
b/source/blender/gpu/intern/gpu_context.cpp
index 97f9e52f944..93df65006ff 100644
--- a/source/blender/gpu/intern/gpu_context.cpp
+++ b/source/blender/gpu/intern/gpu_context.cpp
@@ -36,6 +36,7 @@
 
 #include "gpu_batch_private.h"
 #include "gpu_context_private.h"
+#include "gpu_matrix_private.h"
 
 #include 
 #include 
@@ -71,6 +72,7 @@ struct GPUContext {
   std::unordered_set
   framebuffers; /* Framebuffers that have FBO from this context */
 #endif
+  struct GPUMatrixState *matrix_state;
   std::vector orphaned_vertarray_ids;
   std::vector orphaned_framebuffer_ids;
   std::mutex orphans_mutex; /* todo: try spinlock instead */
@@ -139,6 +141,7 @@ GPUContext *GPU_context_create(GLuint default_framebuffer)
   GPUContext *ctx = new GPUContext;
   glGenVertexArrays(1, >default_vao);
   ctx->default_framebuffer = default_framebuffer;
+  ctx->matrix_state = GPU_matrix_state_create();
   GPU_context_active_set(ctx);
   return ctx;
 }
@@ -159,6 +162,7 @@ void GPU_context_discard(GPUContext *ctx)
 /* this removes the array entry */
 GPU_batch_vao_cache_clear(*ctx->batches.begin());
   }
+  GPU_matrix_state_discard(ctx->matrix_state);
   glDeleteVertexArrays(1, >default_vao);
   delete ctx;
   active_ctx = NULL;
@@ -333,3 +337,9 @@ GPUFrameBuffer 
*gpu_context_active_framebuffer_get(GPUContext *ctx)
 {
   return ctx->current_fbo;
 }
+
+struct GPUMatrixState *gpu_context_active_matrix_state_get()
+{
+  BLI_assert(active_ctx);
+  return active_ctx->matrix_state;
+}
diff --git a/source/blender/gpu/intern/gpu_context_private.h 
b/source/blender/gpu/intern/gpu_context_private.h
index 6825b67d2c8..c9379e5433f 100644
--- a/source/blender/gpu/intern/gpu_context_private.h
+++ b/source/blender/gpu/intern/gpu_context_private.h
@@ -59,6 +59,8 @@ void gpu_context_remove_framebuffer(GPUContext *ctx, struct 
GPUFrameBuffer *fb);
 void gpu_context_active_framebuffer_set(GPUContext *ctx, struct GPUFrameBuffer 
*fb);
 struct GPUFrameBuffer *gpu_context_active_framebuffer_get(GPUContext *ctx);
 
+struct GPUMatrixState *gpu_context_active_matrix_state_get(void);
+
 #ifdef __cplusplus
 }
 #endif
diff --git a/source/blender/gpu/intern/gpu_matrix.c 
b/source/blender/gpu/intern/gpu_matrix.c
index 58ca800a92c..fb0dffb58d1 100644
--- a/source/blender/gpu/intern/gpu_matrix.c
+++ b/source/blender/gpu/intern/gpu_matrix.c
@@ -23,6 +23,9 @@
 
 #include "GPU_shader_interface.h"
 
+#include "gpu_context_private.h"
+#include "gpu_matrix_private.h"
+
 #define SUPPRESS_GENERIC_MATRIX_API
 #define USE_GPU_PY_MATRIX_API /* only so values are declared */
 #include "GPU_matrix.h"
@@ -32,6 +35,8 @@
 #include "BLI_math_rotation.h"
 #include "BLI_math_vector.h"
 
+#include "MEM_guardedalloc.h"
+
 #define DEBUG_MATRIX_BIND 0
 
 #define MATRIX_STACK_DEPTH 32
@@ -44,7 +49,7 @@ typedef struct MatrixStack {
   uint top;
 } MatrixStack;
 
-typedef struct {
+typedef struct GPUMatrixState {
   MatrixStack model_view_stack;
   MatrixStack projection_stack;
 
@@ -56,8 +61,16 @@ typedef struct {
* TODO: separate Model from View transform? Batches/objects have model,
* camera/eye has view & projection
*/
-} MatrixState;
+} GPUMatrixState;
+
+#define ModelViewStack gpu_context_active_matrix_state_get()->model_view_stack
+#define ModelView ModelViewStack.stack[ModelViewStack.top]
 
+#define ProjectionStack gpu_context_active_matrix_state_get()->projection_stack
+#define Projection ProjectionStack.stack[ProjectionStack.top]
+
+GPUMatrixState *GPU_matrix_state_create(void)
+{
 #define MATRIX_4X4_IDENTITY \
   { \
 {1.0f, 0.0f, 0.0f, 0.0f}, {0.0f, 

[Bf-blender-cvs] [3d50e475f87] newboolean: Initial files for start of new Boolean immplentation.

2019-08-14 Thread Howard Trickey
Commit: 3d50e475f874f1f37d2eb36f5e2ac5cdc23bedd2
Author: Howard Trickey
Date:   Wed Aug 14 09:01:23 2019 -0400
Branches: newboolean
https://developer.blender.org/rB3d50e475f874f1f37d2eb36f5e2ac5cdc23bedd2

Initial files for start of new Boolean immplentation.

For development, will keep old code around bmesh_intersect.c,
and put new code in bmesh_boolean.c. Eventually, former can be
deleted. But for now, have the intersect/boolean tools pick
new code vs old via an 'experimental' flag in user options.

Nothing works yet, but have started on code for doing intersects
on coplanar faces.

===

M   source/blender/bmesh/CMakeLists.txt
A   source/blender/bmesh/tools/bmesh_boolean.c
A   source/blender/bmesh/tools/bmesh_boolean.h
M   source/blender/editors/mesh/editmesh_intersect.c

===

diff --git a/source/blender/bmesh/CMakeLists.txt 
b/source/blender/bmesh/CMakeLists.txt
index f5095ca2b5f..2d728a4b985 100644
--- a/source/blender/bmesh/CMakeLists.txt
+++ b/source/blender/bmesh/CMakeLists.txt
@@ -133,6 +133,8 @@ set(SRC
   tools/bmesh_bevel.h
   tools/bmesh_bisect_plane.c
   tools/bmesh_bisect_plane.h
+  tools/bmesh_boolean.c
+  tools/bmesh_boolean.h
   tools/bmesh_decimate.h
   tools/bmesh_decimate_collapse.c
   tools/bmesh_decimate_dissolve.c
diff --git a/source/blender/bmesh/tools/bmesh_boolean.c 
b/source/blender/bmesh/tools/bmesh_boolean.c
new file mode 100644
index 000..9286184360f
--- /dev/null
+++ b/source/blender/bmesh/tools/bmesh_boolean.c
@@ -0,0 +1,404 @@
+/*
+ * 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 bmesh
+ *
+ * Cut meshes along intersections.
+ *
+ * Boolean-like modeling operation (without calculating inside/outside).
+ *
+ * Supported:
+ * - Concave faces.
+ * - Non-planar faces.
+ * - Custom-data (UV's etc).
+ *
+ * Unsupported:
+ * - Intersecting between different meshes.
+ * - No support for holes (cutting a hole into a single face).
+ */
+
+#include "MEM_guardedalloc.h"
+
+#include "BLI_math.h"
+#include "BLI_delaunay_2d.h"
+#include "BLI_utildefines.h"
+#include "BLI_memarena.h"
+#include "BLI_alloca.h"
+
+#include "BLI_linklist.h"
+
+#include "bmesh.h"
+#include "intern/bmesh_private.h"
+
+#include "bmesh_boolean.h" /* own include */
+
+#include "BLI_strict_flags.h"
+
+/* A cluster is a set of coplanar faces (within eps) */
+typedef struct Cluster {
+  float plane[4];  /* first 3 are normal, 4th is signed distance to plane */
+  LinkNode *faces; /* list where links are BMFace* */
+} Cluster;
+
+/* A cluster set is a set of Clusters.
+ * For any two distinct elements of the set, either they are not
+ * coplanar or if they are, they are known not to intersect.
+ * TODO: faster structure for looking up by plane.
+ */
+typedef struct ClusterSet {
+  LinkNode *clusters; /* list where links are Cluster* */
+} ClusterSet;
+
+typedef struct BoolState {
+  MemArena *mem_arena;
+  BLI_mempool *listpool;
+  BMesh *bm;
+  int boolean_mode;
+  float eps;
+  int (*test_fn)(BMFace *f, void *user_data);
+  void *test_fn_user_data;
+} BoolState;
+
+#define BOOLDEBUG
+#ifdef BOOLDEBUG
+/* For Debugging. */
+#  define CO3(v) (v)->co[0], (v)->co[1], (v)->co[2]
+#  define F2(v) (v)[0], (v)[1]
+#  define F3(v) (v)[0], (v)[1], (v)[2]
+#  define F4(v) (v)[0], (v)[1], (v)[2], (v)[3]
+#  define BMI(e) BM_elem_index_get(e)
+
+static void dump_cluster(Cluster *cl, const char *label);
+static void dump_clusterset(ClusterSet *clset, const char *label);
+#endif
+
+/* Make clusterset by empty. */
+static void init_clusterset(ClusterSet *clusterset)
+{
+  clusterset->clusters = NULL;
+}
+
+/* Fill r_plane with the 4d representation of f's plane. */
+static inline void fill_face_plane(float r_plane[4], BMFace *f)
+{
+  plane_from_point_normal_v3(r_plane, f->l_first->v->co, f->no);
+}
+
+/* Return true if a_plane and b_plane are the same plane, to within eps. */
+static bool planes_are_coplanar(const float a_plane[4], const float 
b_plane[4], float eps)
+{
+  if (fabsf(a_plane[3] - b_plane[3]) > eps) {
+return false;
+  }
+  return fabsf(dot_v3v3(a_plane, b_plane) - 1.0f) <= eps;
+}
+
+/* Return the cluster in clusterset for plane face_plane, if it exists, else 

[Bf-blender-cvs] [4074ab361e1] master: Eevee: Fix background alpha regression

2019-08-14 Thread Clément Foucault
Commit: 4074ab361e13444ae9a5d6b8bdf973fce2302021
Author: Clément Foucault
Date:   Wed Aug 14 14:28:57 2019 +0200
Branches: master
https://developer.blender.org/rB4074ab361e13444ae9a5d6b8bdf973fce2302021

Eevee: Fix background alpha regression

===

M   source/blender/gpu/intern/gpu_codegen.c
M   source/blender/gpu/shaders/gpu_shader_material.glsl

===

diff --git a/source/blender/gpu/intern/gpu_codegen.c 
b/source/blender/gpu/intern/gpu_codegen.c
index 6d9fda1c695..3e635b3198a 100644
--- a/source/blender/gpu/intern/gpu_codegen.c
+++ b/source/blender/gpu/intern/gpu_codegen.c
@@ -929,12 +929,15 @@ static char *code_generate_fragment(GPUMaterial *material,
   /* XXX This cannot go into gpu_shader_material.glsl because main()
* would be parsed and generate error */
   /* Old glsl mode compat. */
+  /* TODO(fclem) This is only used by world shader now. get rid of it? */
   BLI_dynstr_append(ds, "#ifndef NODETREE_EXEC\n");
   BLI_dynstr_append(ds, "out vec4 fragColor;\n");
   BLI_dynstr_append(ds, "void main()\n");
   BLI_dynstr_append(ds, "{\n");
   BLI_dynstr_append(ds, "\tClosure cl = nodetree_exec();\n");
-  BLI_dynstr_append(ds, "\tfragColor = vec4(cl.radiance, 
saturate(avg(cl.transmittance)));\n");
+  BLI_dynstr_append(ds,
+"\tfragColor = vec4(cl.radiance, "
+"saturate(1.0 - avg(cl.transmittance)));\n");
   BLI_dynstr_append(ds, "}\n");
   BLI_dynstr_append(ds, "#endif\n\n");
 
diff --git a/source/blender/gpu/shaders/gpu_shader_material.glsl 
b/source/blender/gpu/shaders/gpu_shader_material.glsl
index 7cb38503039..f077ae55d8f 100644
--- a/source/blender/gpu/shaders/gpu_shader_material.glsl
+++ b/source/blender/gpu/shaders/gpu_shader_material.glsl
@@ -3515,7 +3515,7 @@ void node_output_world(Closure surface, Closure volume, 
out Closure result)
 {
 #ifndef VOLUMETRICS
   result.radiance = surface.radiance * backgroundAlpha;
-  result.transmittance = vec3(0.0);
+  result.transmittance = vec3(1.0 - backgroundAlpha);
 #else
   result = volume;
 #endif /* VOLUMETRICS */

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


[Bf-blender-cvs] [7ae3aa7b631] master: Cleanup: don't unnecessarily use ustring in IES file parsing

2019-08-14 Thread Brecht Van Lommel
Commit: 7ae3aa7b63136ea590004ae2ca765697bf0756bc
Author: Brecht Van Lommel
Date:   Wed Aug 14 14:04:23 2019 +0200
Branches: master
https://developer.blender.org/rB7ae3aa7b63136ea590004ae2ca765697bf0756bc

Cleanup: don't unnecessarily use ustring in IES file parsing

===

M   intern/cycles/render/light.cpp
M   intern/cycles/render/light.h
M   intern/cycles/render/nodes.cpp
M   intern/cycles/util/util_ies.cpp
M   intern/cycles/util/util_ies.h

===

diff --git a/intern/cycles/render/light.cpp b/intern/cycles/render/light.cpp
index 5c3f1c35bdc..8c7a21da561 100644
--- a/intern/cycles/render/light.cpp
+++ b/intern/cycles/render/light.cpp
@@ -944,7 +944,7 @@ void LightManager::tag_update(Scene * /*scene*/)
   need_update = true;
 }
 
-int LightManager::add_ies_from_file(ustring filename)
+int LightManager::add_ies_from_file(const string )
 {
   string content;
 
@@ -953,10 +953,10 @@ int LightManager::add_ies_from_file(ustring filename)
 content = "\n";
   }
 
-  return add_ies(ustring(content));
+  return add_ies(content);
 }
 
-int LightManager::add_ies(ustring content)
+int LightManager::add_ies(const string )
 {
   uint hash = hash_string(content.c_str());
 
diff --git a/intern/cycles/render/light.h b/intern/cycles/render/light.h
index 79450ea5f8d..6dd23374818 100644
--- a/intern/cycles/render/light.h
+++ b/intern/cycles/render/light.h
@@ -92,8 +92,8 @@ class LightManager {
   ~LightManager();
 
   /* IES texture management */
-  int add_ies(ustring ies);
-  int add_ies_from_file(ustring filename);
+  int add_ies(const string );
+  int add_ies_from_file(const string );
   void remove_ies(int slot);
 
   void device_update(Device *device, DeviceScene *dscene, Scene *scene, 
Progress );
diff --git a/intern/cycles/render/nodes.cpp b/intern/cycles/render/nodes.cpp
index 1a0225e19a8..9255181b421 100644
--- a/intern/cycles/render/nodes.cpp
+++ b/intern/cycles/render/nodes.cpp
@@ -1067,10 +1067,10 @@ void IESLightNode::get_slot()
 
   if (slot == -1) {
 if (ies.empty()) {
-  slot = light_manager->add_ies_from_file(filename);
+  slot = light_manager->add_ies_from_file(filename.string());
 }
 else {
-  slot = light_manager->add_ies(ies);
+  slot = light_manager->add_ies(ies.string());
 }
   }
 }
diff --git a/intern/cycles/util/util_ies.cpp b/intern/cycles/util/util_ies.cpp
index 7c24a4ec28c..62d3d42186d 100644
--- a/intern/cycles/util/util_ies.cpp
+++ b/intern/cycles/util/util_ies.cpp
@@ -14,6 +14,8 @@
  * limitations under the License.
  */
 
+#include 
+
 #include "util/util_foreach.h"
 #include "util/util_ies.h"
 #include "util/util_math.h"
@@ -28,7 +30,7 @@ CCL_NAMESPACE_BEGIN
 // issue.
 template class GuardedAllocator;
 
-bool IESFile::load(ustring ies)
+bool IESFile::load(const string )
 {
   clear();
   if (!parse(ies) || !process()) {
@@ -76,7 +78,7 @@ class IESTextParser {
   vector text;
   char *data;
 
-  IESTextParser(ustring str) : text(str.begin(), str.end())
+  IESTextParser(const string ) : text(str.begin(), str.end())
   {
 std::replace(text.begin(), text.end(), ',', ' ');
 data = strstr([0], "\nTILT=");
@@ -116,7 +118,7 @@ class IESTextParser {
   }
 };
 
-bool IESFile::parse(ustring ies)
+bool IESFile::parse(const string )
 {
   if (ies.empty()) {
 return false;
diff --git a/intern/cycles/util/util_ies.h b/intern/cycles/util/util_ies.h
index ab1b9ea57cf..95473103614 100644
--- a/intern/cycles/util/util_ies.h
+++ b/intern/cycles/util/util_ies.h
@@ -17,7 +17,7 @@
 #ifndef __UTIL_IES_H__
 #define __UTIL_IES_H__
 
-#include "util/util_param.h"
+#include "util/util_string.h"
 #include "util/util_vector.h"
 
 CCL_NAMESPACE_BEGIN
@@ -32,11 +32,11 @@ class IESFile {
   int packed_size();
   void pack(float *data);
 
-  bool load(ustring ies);
+  bool load(const string );
   void clear();
 
  protected:
-  bool parse(ustring ies);
+  bool parse(const string );
   bool process();
   bool process_type_b();
   bool process_type_c();

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


[Bf-blender-cvs] [d2195d9ef24] master: Fix T68637: Crash assigning caps-lock shortcut

2019-08-14 Thread Campbell Barton
Commit: d2195d9ef24a0c8f9098e4791cf18468ba805dba
Author: Campbell Barton
Date:   Wed Aug 14 21:31:41 2019 +1000
Branches: master
https://developer.blender.org/rBd2195d9ef24a0c8f9098e4791cf18468ba805dba

Fix T68637: Crash assigning caps-lock shortcut

Report that this isn't supported instead, also for unknown key.

===

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

===

diff --git a/source/blender/editors/interface/interface_handlers.c 
b/source/blender/editors/interface/interface_handlers.c
index 52933a89045..6ae7793509d 100644
--- a/source/blender/editors/interface/interface_handlers.c
+++ b/source/blender/editors/interface/interface_handlers.c
@@ -4001,6 +4001,11 @@ static int ui_do_but_HOTKEYEVT(bContext *C,
   return WM_UI_HANDLER_CONTINUE;
 }
 else if (event->type == UNKNOWNKEY) {
+  WM_report(RPT_WARNING, "Unsupported key: Unknown");
+  return WM_UI_HANDLER_CONTINUE;
+}
+else if (event->type == CAPSLOCKKEY) {
+  WM_report(RPT_WARNING, "Unsupported key: CapsLock");
   return WM_UI_HANDLER_CONTINUE;
 }

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


[Bf-blender-cvs] [d5002f007e8] master: Eevee: Improve Transparent BSDF behavior

2019-08-14 Thread Clément Foucault
Commit: d5002f007e8d770dea15f0881cd9d0a4f3aaf824
Author: Clément Foucault
Date:   Mon Aug 12 01:47:30 2019 +0200
Branches: master
https://developer.blender.org/rBd5002f007e8d770dea15f0881cd9d0a4f3aaf824

Eevee: Improve Transparent BSDF behavior

Alpha blended Transparency is now using dual source blending making it
fully compatible with cycles Transparent BSDF.

Multiply and additive blend mode can be achieved using some nodes and are
going to be removed.

===

M   source/blender/draw/engines/eevee/eevee_engine.c
M   source/blender/draw/engines/eevee/eevee_materials.c
M   source/blender/draw/engines/eevee/eevee_private.h
M   source/blender/draw/engines/eevee/eevee_render.c
M   source/blender/draw/engines/eevee/shaders/bsdf_common_lib.glsl
M   source/blender/draw/engines/eevee/shaders/default_frag.glsl
M   source/blender/draw/engines/eevee/shaders/prepass_frag.glsl
M   source/blender/gpu/intern/gpu_codegen.c
M   source/blender/gpu/shaders/gpu_shader_material.glsl
M   source/blender/nodes/shader/nodes/node_shader_bsdf_principled.c
M   source/blender/nodes/shader/nodes/node_shader_subsurface_scattering.c

===

diff --git a/source/blender/draw/engines/eevee/eevee_engine.c 
b/source/blender/draw/engines/eevee/eevee_engine.c
index b36ad540ef9..ab4eb7b8532 100644
--- a/source/blender/draw/engines/eevee/eevee_engine.c
+++ b/source/blender/draw/engines/eevee/eevee_engine.c
@@ -295,7 +295,13 @@ static void eevee_draw_background(void *vedata)
 EEVEE_volumes_resolve(sldata, vedata);
 
 /* Transparent */
+/* TODO(fclem): should be its own Framebuffer.
+ * This is needed because dualsource blending only works with 1 color 
buffer. */
+GPU_framebuffer_texture_attach(fbl->main_color_fb, dtxl->depth, 0, 0);
+GPU_framebuffer_bind(fbl->main_color_fb);
 DRW_draw_pass(psl->transparent_pass);
+GPU_framebuffer_bind(fbl->main_fb);
+GPU_framebuffer_texture_detach(fbl->main_color_fb, dtxl->depth);
 
 /* Post Process */
 DRW_stats_group_start("Post FX");
diff --git a/source/blender/draw/engines/eevee/eevee_materials.c 
b/source/blender/draw/engines/eevee/eevee_materials.c
index 61da9e21cc8..ccc2d6ba020 100644
--- a/source/blender/draw/engines/eevee/eevee_materials.c
+++ b/source/blender/draw/engines/eevee/eevee_materials.c
@@ -382,11 +382,6 @@ static void add_standard_uniforms(DRWShadingGroup *shgrp,
   LightCache *lcache = vedata->stl->g_data->light_cache;
   EEVEE_EffectsInfo *effects = vedata->stl->effects;
 
-  if (ssr_id == NULL) {
-static int no_ssr = -1.0f;
-ssr_id = _ssr;
-  }
-
   DRW_shgroup_uniform_block(shgrp, "probe_block", sldata->probe_ubo);
   DRW_shgroup_uniform_block(shgrp, "grid_block", sldata->grid_ubo);
   DRW_shgroup_uniform_block(shgrp, "planar_block", sldata->planar_ubo);
@@ -394,6 +389,8 @@ static void add_standard_uniforms(DRWShadingGroup *shgrp,
   DRW_shgroup_uniform_block(shgrp, "shadow_block", sldata->shadow_ubo);
   DRW_shgroup_uniform_block(shgrp, "common_block", sldata->common_ubo);
 
+  DRW_shgroup_uniform_int_copy(shgrp, "outputSssId", 1);
+
   if (use_diffuse || use_glossy || use_refract) {
 DRW_shgroup_uniform_texture(shgrp, "utilTex", e_data.util_tex);
 DRW_shgroup_uniform_texture_ref(shgrp, "shadowCubeTexture", 
>shadow_cube_pool);
@@ -411,7 +408,7 @@ static void add_standard_uniforms(DRWShadingGroup *shgrp,
   }
   if (use_glossy) {
 DRW_shgroup_uniform_texture_ref(shgrp, "probePlanars", 
>txl->planar_pool);
-DRW_shgroup_uniform_int(shgrp, "outputSsrId", ssr_id, 1);
+DRW_shgroup_uniform_int_copy(shgrp, "outputSsrId", ssr_id ? *ssr_id : 0);
   }
   if (use_refract) {
 DRW_shgroup_uniform_float_copy(
@@ -736,7 +733,6 @@ struct GPUMaterial *EEVEE_material_mesh_get(struct Scene 
*scene,
 Material *ma,
 EEVEE_Data *vedata,
 bool use_blend,
-bool use_multiply,
 bool use_refract,
 bool use_translucency,
 int shadow_method)
@@ -746,7 +742,6 @@ struct GPUMaterial *EEVEE_material_mesh_get(struct Scene 
*scene,
   int options = VAR_MAT_MESH;
 
   SET_FLAG_FROM_TEST(options, use_blend, VAR_MAT_BLEND);
-  SET_FLAG_FROM_TEST(options, use_multiply, VAR_MAT_MULT);
   SET_FLAG_FROM_TEST(options, use_refract, VAR_MAT_REFRACT);
   SET_FLAG_FROM_TEST(options, effects->sss_separate_albedo, VAR_MAT_SSSALBED);
   SET_FLAG_FROM_TEST(options, use_translucency, VAR_MAT_TRANSLUC);
@@ -1191,15 +1186,11 @@ static void material_opaque(Material *ma,
 *shgrp_depth_clip = emsg->depth_clip_grp;
 
 /* This will have been created already, just perform a lookup. */
-

[Bf-blender-cvs] [67c10dbf132] master: Eevee: Add support for the holdout node

2019-08-14 Thread Clément Foucault
Commit: 67c10dbf1322bd09945c82354d5d3a9004e06bcd
Author: Clément Foucault
Date:   Mon Aug 12 18:40:52 2019 +0200
Branches: master
https://developer.blender.org/rB67c10dbf1322bd09945c82354d5d3a9004e06bcd

Eevee: Add support for the holdout node

Support should be full when using Alpha Blend mode and partial if using
any other blend mode (opaque / alpha clip / alpha hashed).

===

M   release/scripts/startup/nodeitems_builtins.py
M   source/blender/draw/engines/eevee/shaders/bsdf_common_lib.glsl
M   source/blender/gpu/shaders/gpu_shader_material.glsl
M   source/blender/nodes/shader/nodes/node_shader_holdout.c

===

diff --git a/release/scripts/startup/nodeitems_builtins.py 
b/release/scripts/startup/nodeitems_builtins.py
index da2359bedd8..a626984cfa7 100644
--- a/release/scripts/startup/nodeitems_builtins.py
+++ b/release/scripts/startup/nodeitems_builtins.py
@@ -216,7 +216,7 @@ shader_node_categories = [
 NodeItem("ShaderNodeEmission", poll=eevee_cycles_shader_nodes_poll),
 NodeItem("ShaderNodeBsdfHair", poll=object_cycles_shader_nodes_poll),
 NodeItem("ShaderNodeBackground", poll=world_shader_nodes_poll),
-NodeItem("ShaderNodeHoldout", poll=object_cycles_shader_nodes_poll),
+NodeItem("ShaderNodeHoldout", 
poll=object_eevee_cycles_shader_nodes_poll),
 NodeItem("ShaderNodeVolumeAbsorption", 
poll=eevee_cycles_shader_nodes_poll),
 NodeItem("ShaderNodeVolumeScatter", 
poll=eevee_cycles_shader_nodes_poll),
 NodeItem("ShaderNodeVolumePrincipled"),
diff --git a/source/blender/draw/engines/eevee/shaders/bsdf_common_lib.glsl 
b/source/blender/draw/engines/eevee/shaders/bsdf_common_lib.glsl
index 412fa47dbec..7f795eaac2b 100644
--- a/source/blender/draw/engines/eevee/shaders/bsdf_common_lib.glsl
+++ b/source/blender/draw/engines/eevee/shaders/bsdf_common_lib.glsl
@@ -775,6 +775,7 @@ Closure closure_emission(vec3 rgb)
 struct Closure {
   vec3 radiance;
   vec3 transmittance;
+  float holdout;
 #  ifdef USE_SSS
   vec4 sss_data;
 #ifdef USE_SSS_ALBEDO
@@ -792,16 +793,18 @@ Closure nodetree_exec(void); /* Prototype */
 
 #  define CLOSURE_SSR_FLAG 1
 #  define CLOSURE_SSS_FLAG 2
+#  define CLOSURE_HOLDOUT_FLAG 4
 
 #  ifdef USE_SSS
 #ifdef USE_SSS_ALBEDO
 #  define CLOSURE_DEFAULT \
-Closure(vec3(0.0), vec3(0.0), vec4(0.0), vec3(0.0), vec4(0.0), 
vec2(0.0), 0)
+Closure(vec3(0.0), vec3(0.0), 0.0, vec4(0.0), vec3(0.0), vec4(0.0), 
vec2(0.0), 0)
 #else
-#  define CLOSURE_DEFAULT Closure(vec3(0.0), vec3(0.0), vec4(0.0), 
vec4(0.0), vec2(0.0), 0)
+#  define CLOSURE_DEFAULT \
+Closure(vec3(0.0), vec3(0.0), 0.0, vec4(0.0), vec4(0.0), vec2(0.0), 0)
 #endif
 #  else
-#define CLOSURE_DEFAULT Closure(vec3(0.0), vec3(0.0), vec4(0.0), 
vec2(0.0), 0)
+#define CLOSURE_DEFAULT Closure(vec3(0.0), vec3(0.0), 0.0, vec4(0.0), 
vec2(0.0), 0)
 #  endif
 
 uniform int outputSsrId = 1;
@@ -848,6 +851,7 @@ void closure_load_sss_data(float radius,
 Closure closure_mix(Closure cl1, Closure cl2, float fac)
 {
   Closure cl;
+  cl.holdout = mix(cl1.holdout, cl2.holdout, fac);
   cl.transmittance = mix(cl1.transmittance, cl2.transmittance, fac);
   cl.radiance = mix(cl1.radiance, cl2.radiance, fac);
   cl.flag = cl1.flag | cl2.flag;
@@ -874,6 +878,7 @@ Closure closure_add(Closure cl1, Closure cl2)
   Closure cl;
   cl.transmittance = cl1.transmittance + cl2.transmittance;
   cl.radiance = cl1.radiance + cl2.radiance;
+  cl.holdout = cl1.holdout + cl2.holdout;
   cl.flag = cl1.flag | cl2.flag;
   cl.ssr_data = cl1.ssr_data + cl2.ssr_data;
   bool use_cl1_ssr = FLAG_TEST(cl1.flag, CLOSURE_SSR_FLAG);
@@ -933,16 +938,18 @@ void main()
 {
   Closure cl = nodetree_exec();
 
+  float holdout = 1.0 - saturate(cl.holdout);
+
 #ifdef USE_ALPHA_BLEND
   vec2 uvs = gl_FragCoord.xy * volCoordScale.zw;
   vec3 vol_transmit, vol_scatter;
   volumetric_resolve(uvs, gl_FragCoord.z, vol_transmit, vol_scatter);
 
   float transmit = saturate(avg(cl.transmittance));
-  outRadiance = vec4(cl.radiance * vol_transmit + vol_scatter, (1.0 - 
transmit));
-  outTransmittance = vec4(cl.transmittance, transmit);
+  outRadiance = vec4(cl.radiance * vol_transmit + vol_scatter, (1.0 - 
transmit) * holdout);
+  outTransmittance = vec4(cl.transmittance, transmit * holdout);
 #else
-  outRadiance = vec4(cl.radiance, 1.0);
+  outRadiance = vec4(cl.radiance, holdout);
   ssrNormals = cl.ssr_normal;
   ssrData = cl.ssr_data;
 #  ifdef USE_SSS
diff --git a/source/blender/gpu/shaders/gpu_shader_material.glsl 
b/source/blender/gpu/shaders/gpu_shader_material.glsl
index 798d19b6b9d..7cb38503039 100644
--- a/source/blender/gpu/shaders/gpu_shader_material.glsl
+++ b/source/blender/gpu/shaders/gpu_shader_material.glsl
@@ -1964,6 +1964,15 @@ void node_volume_principled(vec4 color,
 #endif
 }
 
+void node_holdout(out 

[Bf-blender-cvs] [8a338950c6d] master: Fix T68537 Eevee: Modulo node behaves unexpectedly/inconsistently

2019-08-14 Thread Clément Foucault
Commit: 8a338950c6ddde37ddefadd75c39d4d2efc7aee3
Author: Clément Foucault
Date:   Sat Aug 10 23:29:50 2019 +0200
Branches: master
https://developer.blender.org/rB8a338950c6ddde37ddefadd75c39d4d2efc7aee3

Fix T68537 Eevee: Modulo node behaves unexpectedly/inconsistently

There was still some float imprecision when both input values are equal.

===

M   source/blender/gpu/shaders/gpu_shader_material.glsl

===

diff --git a/source/blender/gpu/shaders/gpu_shader_material.glsl 
b/source/blender/gpu/shaders/gpu_shader_material.glsl
index 66d8bf996ba..83d008c3441 100644
--- a/source/blender/gpu/shaders/gpu_shader_material.glsl
+++ b/source/blender/gpu/shaders/gpu_shader_material.glsl
@@ -379,7 +379,7 @@ void math_greater_than(float val1, float val2, out float 
outval)
 
 void math_modulo(float val1, float val2, out float outval)
 {
-  if (val2 == 0.0) {
+  if (val2 == 0.0 || val1 == val2) {
 outval = 0.0;
   }
   else {

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


[Bf-blender-cvs] [13d469e6f0c] master: Eevee: Remove Additive & Multiply Blend mode

2019-08-14 Thread Clément Foucault
Commit: 13d469e6f0c554399629febeb1fd8d680b873a90
Author: Clément Foucault
Date:   Tue Aug 13 00:11:36 2019 +0200
Branches: master
https://developer.blender.org/rB13d469e6f0c554399629febeb1fd8d680b873a90

Eevee: Remove Additive & Multiply Blend mode

This commit also provide a compatibility code that will convert old
materials using Additive or Multiply Blend mode to their node equivalent.

This conversion is only done on outputs that are enabled for eevee.

===

M   source/blender/blenkernel/BKE_blender_version.h
M   source/blender/blenloader/intern/readfile.c
M   source/blender/blenloader/intern/readfile.h
M   source/blender/blenloader/intern/versioning_280.c
M   source/blender/draw/engines/eevee/eevee_materials.c
M   source/blender/makesdna/DNA_material_types.h
M   source/blender/makesrna/intern/rna_material.c

===

diff --git a/source/blender/blenkernel/BKE_blender_version.h 
b/source/blender/blenkernel/BKE_blender_version.h
index ced9f4a3153..0c55ae8ee83 100644
--- a/source/blender/blenkernel/BKE_blender_version.h
+++ b/source/blender/blenkernel/BKE_blender_version.h
@@ -27,7 +27,7 @@
  * \note Use #STRINGIFY() rather than defining with quotes.
  */
 #define BLENDER_VERSION 281
-#define BLENDER_SUBVERSION 1
+#define BLENDER_SUBVERSION 2
 /** Several breakages with 280, e.g. collections vs layers. */
 #define BLENDER_MINVERSION 280
 #define BLENDER_MINSUBVERSION 0
diff --git a/source/blender/blenloader/intern/readfile.c 
b/source/blender/blenloader/intern/readfile.c
index 65120fc4c10..bcee606ea7b 100644
--- a/source/blender/blenloader/intern/readfile.c
+++ b/source/blender/blenloader/intern/readfile.c
@@ -9487,7 +9487,7 @@ static void do_versions(FileData *fd, Library *lib, Main 
*main)
   /* don't forget to set version number in BKE_blender_version.h! */
 }
 
-static void do_versions_after_linking(Main *main)
+static void do_versions_after_linking(Main *main, ReportList *reports)
 {
   //  printf("%s for %s (%s), %d.%d\n", __func__, main->curlib ? 
main->curlib->name : main->name,
   // main->curlib ? "LIB" : "MAIN", main->versionfile, 
main->subversionfile);
@@ -9495,7 +9495,7 @@ static void do_versions_after_linking(Main *main)
   do_versions_after_linking_250(main);
   do_versions_after_linking_260(main);
   do_versions_after_linking_270(main);
-  do_versions_after_linking_280(main);
+  do_versions_after_linking_280(main, reports);
   do_versions_after_linking_cycles(main);
 }
 
@@ -9798,7 +9798,7 @@ BlendFileData *blo_read_file_internal(FileData *fd, const 
char *filepath)
   blo_split_main(, bfd->main);
   for (Main *mainvar = mainlist.first; mainvar; mainvar = mainvar->next) {
 BLI_assert(mainvar->versionfile != 0);
-do_versions_after_linking(mainvar);
+do_versions_after_linking(mainvar, fd->reports);
   }
   blo_join_main();
 
@@ -11569,7 +11569,7 @@ static void library_link_end(Main *mainl,
  * or they will go again through do_versions - bad, very bad! */
 split_main_newid(mainvar, main_newid);
 
-do_versions_after_linking(main_newid);
+do_versions_after_linking(main_newid, (*fd)->reports);
 
 add_main_to_main(mainvar, main_newid);
   }
diff --git a/source/blender/blenloader/intern/readfile.h 
b/source/blender/blenloader/intern/readfile.h
index 7cd5bb7ac93..10ee3d52a74 100644
--- a/source/blender/blenloader/intern/readfile.h
+++ b/source/blender/blenloader/intern/readfile.h
@@ -187,7 +187,7 @@ void blo_do_versions_cycles(struct FileData *fd, struct 
Library *lib, struct Mai
 void do_versions_after_linking_250(struct Main *bmain);
 void do_versions_after_linking_260(struct Main *bmain);
 void do_versions_after_linking_270(struct Main *bmain);
-void do_versions_after_linking_280(struct Main *bmain);
+void do_versions_after_linking_280(struct Main *bmain, ReportList *reports);
 void do_versions_after_linking_cycles(struct Main *bmain);
 
 #endif
diff --git a/source/blender/blenloader/intern/versioning_280.c 
b/source/blender/blenloader/intern/versioning_280.c
index 15b4f513050..254259b1542 100644
--- a/source/blender/blenloader/intern/versioning_280.c
+++ b/source/blender/blenloader/intern/versioning_280.c
@@ -734,7 +734,128 @@ static void 
do_versions_seq_alloc_transform_and_crop(ListBase *seqbase)
   }
 }
 
-void do_versions_after_linking_280(Main *bmain)
+/* Return true if there is something to convert. */
+static bool do_versions_material_convert_legacy_blend_mode(bNodeTree *ntree,
+   char blend_method,
+   GSet 
*nodegrp_tree_set)
+{
+  bool need_update = false;
+  bool do_conversion = false;
+
+  /* Iterate backwards from end so we don't encounter newly added links. */
+  bNodeLink *prevlink;
+  for (bNodeLink *link = ntree->links.last; link; link = prevlink) 

[Bf-blender-cvs] [8a07ab71bc9] temp-lanpr-staging: LANPR: Fix intersection transformation.

2019-08-14 Thread YimingWu
Commit: 8a07ab71bc9e76ff562127725131cb604fbd86aa
Author: YimingWu
Date:   Wed Aug 14 18:48:43 2019 +0800
Branches: temp-lanpr-staging
https://developer.blender.org/rB8a07ab71bc9e76ff562127725131cb604fbd86aa

LANPR: Fix intersection transformation.

===

M   source/blender/editors/lanpr/lanpr_cpu.c

===

diff --git a/source/blender/editors/lanpr/lanpr_cpu.c 
b/source/blender/editors/lanpr/lanpr_cpu.c
index ac9bb5ec3ba..c624da73fdf 100644
--- a/source/blender/editors/lanpr/lanpr_cpu.c
+++ b/source/blender/editors/lanpr/lanpr_cpu.c
@@ -1894,7 +1894,7 @@ static int 
lanpr_triangle_line_imagespace_intersection_v2(SpinLock *UNUSED(spl),
   real Cv[3];
   real DotL, DotR, DotLA, DotRA;
   real DotF;
-  tnsVector4d gloc, Trans;
+  tnsVector4d gloc={0,0,0,1}, Trans={0,0,0,1};
   real Cut = -1;
 
   double *LFBC = rl->l->fbcoord, *RFBC = rl->r->fbcoord, *FBC0 = 
rt->v[0]->fbcoord,
@@ -2254,6 +2254,7 @@ static LANPR_RenderVert 
*lanpr_triangle_line_intersection_test(LANPR_RenderBuffe
   Result->v = (void *)r; /*  Caution! */
  /*  Result->intersecting_with = rt; */
   copy_v3_v3_db(Result->gloc, gloc);
+  Result->gloc[3] = 1.0f;
 
   BLI_addtail(>intersecting_verts, Result);

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


[Bf-blender-cvs] [55c38f476e6] master: Custom Properties: allow changing the property UI to color picker.

2019-08-14 Thread Alexander Gavrilov
Commit: 55c38f476e6d599eb5377334976ab71b97fe359a
Author: Alexander Gavrilov
Date:   Tue Aug 13 19:45:20 2019 +0300
Branches: master
https://developer.blender.org/rB55c38f476e6d599eb5377334976ab71b97fe359a

Custom Properties: allow changing the property UI to color picker.

To fully support storing colors as a custom property, it is necessary
to allow switching the property UI to the standard color picker button.
That means in effect supporting custom property subtype values.

Change RNA_property_subtype to look for a 'subtype' string field
in _RNA_UI and parse it as an enum value. To minimize performance
impact, only do it if the property is an array; also, don't use
the custom subtype during RNA path parsing.

On the python side, allow setting some most useful seeming values
from the custom property settings editor.

Also, since some color picker code seems to run into a risk of
buffer overruns if the array size is wrong, check the size in
the UI layout code to be safe.

Reviewers: campbellbarton

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

===

M   release/scripts/modules/rna_prop_ui.py
M   release/scripts/startup/bl_operators/wm.py
M   source/blender/editors/interface/interface_layout.c
M   source/blender/makesrna/RNA_types.h
M   source/blender/makesrna/intern/rna_access.c

===

diff --git a/release/scripts/modules/rna_prop_ui.py 
b/release/scripts/modules/rna_prop_ui.py
index b568f9835a0..2ff6c3fc1b0 100644
--- a/release/scripts/modules/rna_prop_ui.py
+++ b/release/scripts/modules/rna_prop_ui.py
@@ -159,6 +159,7 @@ def rna_idprop_ui_create(
 soft_min=None, soft_max=None,
 description=None,
 overridable=False,
+subtype=None,
 ):
 """Create and initialize a custom property with limits, defaults and other 
settings."""
 
@@ -195,6 +196,9 @@ def rna_idprop_ui_create(
 if default and (not is_array or any(default)):
 rna_ui["default"] = default
 
+if is_array and subtype and subtype != 'NONE':
+rna_ui["subtype"] = subtype
+
 # Assign other settings
 if description is not None:
 rna_ui["description"] = description
diff --git a/release/scripts/startup/bl_operators/wm.py 
b/release/scripts/startup/bl_operators/wm.py
index 97a242772a4..3f25c35973d 100644
--- a/release/scripts/startup/bl_operators/wm.py
+++ b/release/scripts/startup/bl_operators/wm.py
@@ -1085,6 +1085,14 @@ rna_is_overridable_library = BoolProperty(
 default=False,
 )
 
+# Most useful entries of rna_enum_property_subtype_items for number arrays:
+rna_vector_subtype_items = (
+('NONE', "Plain Data", "Data values without special behavior"),
+('COLOR', "Linear Color", "Color in the linear space"),
+('COLOR_GAMMA', "Gamma-Corrected Color", "Color in the gamma corrected 
space"),
+('EULER', "Euler Angles", "Euler rotation angles in radians"),
+('QUATERNION', "Quaternion Rotation", "Quaternion rotation (affects NLA 
blending)"),
+)
 
 class WM_OT_properties_edit(Operator):
 bl_idname = "wm.properties_edit"
@@ -1105,6 +1113,23 @@ class WM_OT_properties_edit(Operator):
 description: StringProperty(
 name="Tooltip",
 )
+subtype: EnumProperty(
+name="Subtype",
+items=lambda self,ctx: WM_OT_properties_edit.subtype_items,
+)
+
+subtype_items = rna_vector_subtype_items
+
+def init_subtype(self, prop_type, is_array, subtype):
+subtype = subtype or 'NONE'
+subtype_items = rna_vector_subtype_items
+
+# Add a temporary enum entry to preserve unknown subtypes
+if not any(subtype == item[0] for item in subtype_items):
+subtype_items += ((subtype, subtype, ""),)
+
+WM_OT_properties_edit.subtype_items = subtype_items
+self.subtype = subtype
 
 def _cmp_props_get(self):
 # Changing these properties will refresh the UI
@@ -1193,6 +1218,11 @@ class WM_OT_properties_edit(Operator):
 prop_ui["soft_min"] = prop_type(self.min)
 prop_ui["soft_max"] = prop_type(self.max)
 
+if prop_type == float and is_array and self.subtype != 'NONE':
+prop_ui["subtype"] = self.subtype
+else:
+prop_ui.pop("subtype", None)
+
 prop_ui["description"] = self.description
 
 rna_idprop_ui_prop_default_set(item, prop, default_eval)
@@ -1235,7 +1265,11 @@ class WM_OT_properties_edit(Operator):
 return {'FINISHED'}
 
 def invoke(self, context, _event):
-from rna_prop_ui import rna_idprop_ui_prop_get, 
rna_idprop_value_to_python
+from rna_prop_ui import (
+rna_idprop_ui_prop_get,
+rna_idprop_value_to_python,
+rna_idprop_value_item_type
+)
 
 data_path = self.data_path
 
@@ -1252,7 +1286,7 @@ class WM_OT_properties_edit(Operator):
 

[Bf-blender-cvs] [ccc113deba8] temp-lanpr-staging: Merge remote-tracking branch 'origin/master' into temp-lanpr-staging

2019-08-14 Thread YimingWu
Commit: ccc113deba817e17ad63ecd2169a4ae1cb05e17a
Author: YimingWu
Date:   Wed Aug 14 15:46:31 2019 +0800
Branches: temp-lanpr-staging
https://developer.blender.org/rBccc113deba817e17ad63ecd2169a4ae1cb05e17a

Merge remote-tracking branch 'origin/master' into temp-lanpr-staging

===



===

diff --cc source/blender/draw/CMakeLists.txt
index 8bb309d72d9,84302e3cf44..0ac2bec1f16
--- a/source/blender/draw/CMakeLists.txt
+++ b/source/blender/draw/CMakeLists.txt
@@@ -127,14 -128,8 +128,13 @@@ set(SR
engines/gpencil/gpencil_engine.h
engines/gpencil/gpencil_render.c
engines/gpencil/gpencil_shader_fx.c
 +  engines/lanpr/lanpr_dpix.c
 +  engines/lanpr/lanpr_engine.c
 +  # engines/lanpr/lanpr_snake.c  deprecated for now.
 +  engines/lanpr/lanpr_cpu.c
 +  engines/lanpr/lanpr_chain_draw.c
engines/select/select_engine.c
engines/select/select_draw_utils.c
-   engines/select/select_buffer.c
  
DRW_engine.h
DRW_select_buffer.h

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


[Bf-blender-cvs] [a10eda79550] temp-lanpr-staging: LANPR: Use built-in math functions.

2019-08-14 Thread YimingWu
Commit: a10eda79550cfb83aa05fc69231715872f9ec5ca
Author: YimingWu
Date:   Wed Aug 14 18:26:07 2019 +0800
Branches: temp-lanpr-staging
https://developer.blender.org/rBa10eda79550cfb83aa05fc69231715872f9ec5ca

LANPR: Use built-in math functions.

===

M   source/blender/blenlib/BLI_math_vector.h
M   source/blender/blenlib/intern/math_vector_inline.c
M   source/blender/editors/include/ED_lanpr.h
M   source/blender/editors/lanpr/lanpr_cpu.c
M   source/blender/editors/lanpr/lanpr_util.c

===

diff --git a/source/blender/blenlib/BLI_math_vector.h 
b/source/blender/blenlib/BLI_math_vector.h
index 7f526585e3b..ccb42683d5a 100644
--- a/source/blender/blenlib/BLI_math_vector.h
+++ b/source/blender/blenlib/BLI_math_vector.h
@@ -197,6 +197,7 @@ MINLINE double dot_v3v3_db(const double a[3], const double 
b[3]) ATTR_WARN_UNUSE
 MINLINE float cross_v2v2(const float a[2], const float b[2]) 
ATTR_WARN_UNUSED_RESULT;
 MINLINE void cross_v3_v3v3(float r[3], const float a[3], const float b[3]);
 MINLINE void cross_v3_v3v3_hi_prec(float r[3], const float a[3], const float 
b[3]);
+MINLINE void cross_v3_v3v3_db(double r[3], const double a[3], const double 
b[3]);
 
 MINLINE void add_newell_cross_v3_v3v3(float n[3], const float v_prev[3], const 
float v_curr[3]);
 
diff --git a/source/blender/blenlib/intern/math_vector_inline.c 
b/source/blender/blenlib/intern/math_vector_inline.c
index f646907797c..8cb618ae14e 100644
--- a/source/blender/blenlib/intern/math_vector_inline.c
+++ b/source/blender/blenlib/intern/math_vector_inline.c
@@ -885,6 +885,14 @@ MINLINE void cross_v3_v3v3_hi_prec(float r[3], const float 
a[3], const float b[3
   r[2] = (float)((double)a[0] * (double)b[1] - (double)a[1] * (double)b[0]);
 }
 
+MINLINE void cross_v3_v3v3_db(double r[3], const double a[3], const double 
b[3])
+{
+  BLI_assert(r != a && r != b);
+  r[0] = a[1] * b[2] - a[2] * b[1];
+  r[1] = a[2] * b[0] - a[0] * b[2];
+  r[2] = a[0] * b[1] - a[1] * b[0];
+}
+
 /* Newell's Method */
 /* excuse this fairly specific function,
  * its used for polygon normals all over the place
diff --git a/source/blender/editors/include/ED_lanpr.h 
b/source/blender/editors/include/ED_lanpr.h
index 73edfa0ca55..dffbd5b7eee 100644
--- a/source/blender/editors/include/ED_lanpr.h
+++ b/source/blender/editors/include/ED_lanpr.h
@@ -91,7 +91,7 @@ typedef struct LANPR_RenderTriangle {
   struct LANPR_RenderTriangle *next, *prev;
   struct LANPR_RenderVert *v[3];
   struct LANPR_RenderLine *rl[3];
-  real gn[3];
+  float gn[3];
   real gc[3];
   /*  struct BMFace *F; */
   short material_id;
@@ -225,8 +225,8 @@ typedef struct LANPR_RenderBuffer {
   int tile_size_w, tile_size_h;
   int tile_count_x, tile_count_y;
   real width_per_tile, height_per_tile;
-  tnsMatrix44d view_projection;
-  tnsMatrix44d vp_inverse;
+  float view_projection[4][4];
+  float vp_inverse[4][4];
 
   int output_mode;
   int output_aa_level;
@@ -253,7 +253,7 @@ typedef struct LANPR_RenderBuffer {
 
   int cached_for_frame;
 
-  real view_vector[3];
+  double view_vector[3];
 
   int triangle_size;
 
@@ -606,8 +606,8 @@ void tmat_apply_transform_44dTrue(tnsVector4d result, 
tnsMatrix44d mat, tnsVecto
 void tmat_load_identity_44d(tnsMatrix44d m);
 void tmat_make_ortho_matrix_44d(
 tnsMatrix44d mProjection, real xMin, real xMax, real yMin, real yMax, real 
zMin, real zMax);
-void tmat_make_perspective_matrix_44d(
-tnsMatrix44d mProjection, real fFov_rad, real fAspect, real zMin, real 
zMax);
+void tmat_make_perspective_matrix_44f(
+float (*mProjection)[4], float fFov_rad, float fAspect, float zMin, float 
zMax);
 void tmat_make_translation_matrix_44d(tnsMatrix44d mTrans, real x, real y, 
real z);
 void tmat_make_rotation_matrix_44d(tnsMatrix44d m, real angle_rad, real x, 
real y, real z);
 void tmat_make_scale_matrix_44d(tnsMatrix44d m, real x, real y, real z);
diff --git a/source/blender/editors/lanpr/lanpr_cpu.c 
b/source/blender/editors/lanpr/lanpr_cpu.c
index c1a98ac5c21..ac9bb5ec3ba 100644
--- a/source/blender/editors/lanpr/lanpr_cpu.c
+++ b/source/blender/editors/lanpr/lanpr_cpu.c
@@ -92,7 +92,7 @@ static int 
lanpr_triangle_line_imagespace_intersection_v2(SpinLock *spl,
   LANPR_RenderTriangle 
*rt,
   LANPR_RenderLine *rl,
   Object *cam,
-  tnsMatrix44d vp,
+  float (*vp)[4],
   real *CameraDir,
   double *From,
   double *To);
@@ -579,7 +579,7 @@ static int 

[Bf-blender-cvs] [33d3dcdb00c] temp-lanpr-staging: View3D: Circle Select optimization

2019-08-14 Thread mano-wii
Commit: 33d3dcdb00c99217333d8919565830807199d23f
Author: mano-wii
Date:   Sun Aug 11 22:12:11 2019 -0300
Branches: temp-lanpr-staging
https://developer.blender.org/rB33d3dcdb00c99217333d8919565830807199d23f

View3D: Circle Select optimization

Don't recreate `select_bitmap` for each edited object.

===

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

===

diff --git a/source/blender/editors/space_view3d/view3d_select.c 
b/source/blender/editors/space_view3d/view3d_select.c
index d20a854c022..3e2d387bcec 100644
--- a/source/blender/editors/space_view3d/view3d_select.c
+++ b/source/blender/editors/space_view3d/view3d_select.c
@@ -3392,7 +3392,9 @@ static bool mesh_circle_select(ViewContext *vc,
   struct EditSelectBuf_Cache *esel = wm_userdata->data;
 
   if (use_zbuf) {
-esel->select_bitmap = DRW_select_buffer_bitmap_from_circle(mval, (int)(rad 
+ 1.0f), NULL);
+if (esel->select_bitmap == NULL) {
+  esel->select_bitmap = DRW_select_buffer_bitmap_from_circle(mval, 
(int)(rad + 1.0f), NULL);
+}
   }
 
   if (ts->selectmode & SCE_SELECT_VERTEX) {
@@ -3432,13 +3434,6 @@ static bool mesh_circle_select(ViewContext *vc,
 }
   }
 
-  if (use_zbuf) {
-if (esel->select_bitmap != NULL) {
-  MEM_freeN(esel->select_bitmap);
-  esel->select_bitmap = NULL;
-}
-  }
-
   changed |= data.is_changed;
 
   if (changed) {
@@ -4020,6 +4015,13 @@ static int view3d_circle_select_exec(bContext *C, 
wmOperator *op)
   if (wm_userdata == _userdata_buf) {
 WM_generic_user_data_free(wm_userdata);
   }
+  else {
+struct EditSelectBuf_Cache *esel = wm_userdata->data;
+if (esel && esel->select_bitmap) {
+  MEM_freeN(esel->select_bitmap);
+  esel->select_bitmap = NULL;
+}
+  }
 
   return OPERATOR_FINISHED;
 }

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


[Bf-blender-cvs] [d39f5109cce] functions: add license header to blenlib files

2019-08-14 Thread Jacques Lucke
Commit: d39f5109ccebbc4baeaf1e0e57edc86f7b12e3ce
Author: Jacques Lucke
Date:   Wed Aug 14 11:44:11 2019 +0200
Branches: functions
https://developer.blender.org/rBd39f5109ccebbc4baeaf1e0e57edc86f7b12e3ce

add license header to blenlib files

===

M   source/blender/blenlib/BLI_array_lookup.hpp
M   source/blender/blenlib/BLI_chained_strings.hpp
M   source/blender/blenlib/BLI_lazy_init.hpp
M   source/blender/blenlib/BLI_listbase_wrapper.hpp
M   source/blender/blenlib/BLI_math.hpp
M   source/blender/blenlib/BLI_mempool.hpp
M   source/blender/blenlib/BLI_monotonic_allocator.hpp
M   source/blender/blenlib/BLI_multi_map.hpp
M   source/blender/blenlib/BLI_multi_vector.hpp
M   source/blender/blenlib/BLI_object_pool.hpp
M   source/blender/blenlib/BLI_optional.hpp
M   source/blender/blenlib/BLI_range.hpp
M   source/blender/blenlib/BLI_refcount.hpp
M   source/blender/blenlib/BLI_stack.hpp
M   source/blender/blenlib/BLI_string_ref.hpp
M   source/blender/blenlib/BLI_task.hpp
M   source/blender/blenlib/BLI_temporary_allocator.hpp
M   source/blender/blenlib/BLI_value_or_error.hpp
M   tests/gtests/blenlib/BLI_temporary_allocator_test.cc

===

diff --git a/source/blender/blenlib/BLI_array_lookup.hpp 
b/source/blender/blenlib/BLI_array_lookup.hpp
index a0d861148a8..6093d4b7e04 100644
--- a/source/blender/blenlib/BLI_array_lookup.hpp
+++ b/source/blender/blenlib/BLI_array_lookup.hpp
@@ -1,6 +1,23 @@
-#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.
+ */
 
-/* The ArrayLookup allows sharing code between a
+/** \file
+ * \ingroup bli
+ *
+ * The ArrayLookup allows sharing code between a
  * map and set implementation without hacks
  * (like using an empty value when a set is needed).
  *
@@ -8,6 +25,8 @@
  * it allows fast `contains` and `find` calls on that array.
  */
 
+#pragma once
+
 #include 
 
 #include "BLI_utildefines.h"
diff --git a/source/blender/blenlib/BLI_chained_strings.hpp 
b/source/blender/blenlib/BLI_chained_strings.hpp
index bd3372f2242..1ee50d87905 100644
--- a/source/blender/blenlib/BLI_chained_strings.hpp
+++ b/source/blender/blenlib/BLI_chained_strings.hpp
@@ -1,11 +1,30 @@
-#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.
+ */
 
-/* These classes help storing multiple strings more compactly.
+/** \file
+ * \ingroup bli
+ *
+ * These classes help storing multiple strings more compactly.
  * This should only be used when:
  *   - All strings are freed at the same time.
  *   - The length of individual strings does not change.
  *   - All string lengths are known in the beginning. */
 
+#pragma once
+
 #include "BLI_string_ref.hpp"
 #include "BLI_vector.hpp"
 
diff --git a/source/blender/blenlib/BLI_lazy_init.hpp 
b/source/blender/blenlib/BLI_lazy_init.hpp
index fae51f824e5..6f0541fda23 100644
--- a/source/blender/blenlib/BLI_lazy_init.hpp
+++ b/source/blender/blenlib/BLI_lazy_init.hpp
@@ -1,6 +1,23 @@
-#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 

[Bf-blender-cvs] [f073f232cfe] functions: improve map method names

2019-08-14 Thread Jacques Lucke
Commit: f073f232cfef405eb278c83fd1d713dc3204aafe
Author: Jacques Lucke
Date:   Wed Aug 14 11:53:08 2019 +0200
Branches: functions
https://developer.blender.org/rBf073f232cfef405eb278c83fd1d713dc3204aafe

improve map method names

===

M   source/blender/blenlib/BLI_map.hpp
M   source/blender/functions/functions/auto_vectorization.cpp
M   tests/gtests/blenlib/BLI_map_test.cc

===

diff --git a/source/blender/blenlib/BLI_map.hpp 
b/source/blender/blenlib/BLI_map.hpp
index c24f694ddbe..a1852d613d6 100644
--- a/source/blender/blenlib/BLI_map.hpp
+++ b/source/blender/blenlib/BLI_map.hpp
@@ -167,7 +167,7 @@ template class Map {
* Return a reference to the value corresponding to the key.
* If the key does not exist yet, insert the given key-value-pair first.
*/
-  V _ref_or_insert(const K , V initial_value)
+  V _or_add(const K , V initial_value)
   {
 V *ptr = this->lookup_ptr(key);
 if (ptr != nullptr) {
@@ -183,7 +183,7 @@ template class Map {
* key-value pair.
*/
   template
-  V _ref_or_insert_func(const K , const CreateValueFunc 
_value)
+  V _or_add_func(const K , const CreateValueFunc _value)
   {
 V *ptr = this->lookup_ptr(key);
 if (ptr != nullptr) {
diff --git a/source/blender/functions/functions/auto_vectorization.cpp 
b/source/blender/functions/functions/auto_vectorization.cpp
index aaf5f1de988..a55a6a070e5 100644
--- a/source/blender/functions/functions/auto_vectorization.cpp
+++ b/source/blender/functions/functions/auto_vectorization.cpp
@@ -506,7 +506,7 @@ SharedFunction to_vectorized_function__with_cache(
   static VectorizeCacheMap  = get_vectorized_function_cache();
 
   AutoVectorizationInput cache_key(original_fn, vectorized_inputs_mask, 
empty_list_value_builders);
-  return cache.lookup_ref_or_insert_func(cache_key, [&]() {
+  return cache.lookup_or_add_func(cache_key, [&]() {
 return to_vectorized_function_internal(
 original_fn, vectorized_inputs_mask, empty_list_value_builders);
   });
diff --git a/tests/gtests/blenlib/BLI_map_test.cc 
b/tests/gtests/blenlib/BLI_map_test.cc
index c61372fe41d..12206109275 100644
--- a/tests/gtests/blenlib/BLI_map_test.cc
+++ b/tests/gtests/blenlib/BLI_map_test.cc
@@ -87,13 +87,13 @@ TEST(map, PopItemMany)
   }
 }
 
-TEST(map, LookupRefOrInsert)
+TEST(map, LookupOrAdd)
 {
   IntFloatMap map;
-  float  = map.lookup_ref_or_insert(3, 5.0f);
+  float  = map.lookup_or_add(3, 5.0f);
   EXPECT_EQ(value, 5.0f);
   value += 1;
-  value = map.lookup_ref_or_insert(3, 5.0f);
+  value = map.lookup_or_add(3, 5.0f);
   EXPECT_EQ(value, 6.0f);
 }
 
@@ -170,23 +170,23 @@ float return_42()
   return 42.0f;
 }
 
-TEST(map, LookupOrInsertFunc_SeparateFunction)
+TEST(map, LookupOrAddFunc_SeparateFunction)
 {
   IntFloatMap map;
-  EXPECT_EQ(map.lookup_ref_or_insert_func(0, return_42), 42.0f);
+  EXPECT_EQ(map.lookup_or_add_func(0, return_42), 42.0f);
   EXPECT_EQ(map.lookup(0), 42);
 }
 
-TEST(map, LookupOrInsertFunc_Lambdas)
+TEST(map, LookupOrAddFunc_Lambdas)
 {
   IntFloatMap map;
   auto lambda1 = []() { return 11.0f; };
-  EXPECT_EQ(map.lookup_ref_or_insert_func(0, lambda1), 11.0f);
+  EXPECT_EQ(map.lookup_or_add_func(0, lambda1), 11.0f);
   auto lambda2 = []() { return 20.0f; };
-  EXPECT_EQ(map.lookup_ref_or_insert_func(1, lambda2), 20.0f);
+  EXPECT_EQ(map.lookup_or_add_func(1, lambda2), 20.0f);
 
-  EXPECT_EQ(map.lookup_ref_or_insert_func(0, lambda2), 11.0f);
-  EXPECT_EQ(map.lookup_ref_or_insert_func(1, lambda1), 20.0f);
+  EXPECT_EQ(map.lookup_or_add_func(0, lambda2), 11.0f);
+  EXPECT_EQ(map.lookup_or_add_func(1, lambda1), 20.0f);
 }
 
 TEST(map, InsertOrModify)

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


[Bf-blender-cvs] [b7bc639d00b] functions: add more license headers

2019-08-14 Thread Jacques Lucke
Commit: b7bc639d00bfe6184d626ac23cdc30eb6d537c49
Author: Jacques Lucke
Date:   Wed Aug 14 11:46:29 2019 +0200
Branches: functions
https://developer.blender.org/rBb7bc639d00bfe6184d626ac23cdc30eb6d537c49

add more license headers

===

M   source/blender/blenlib/intern/BLI_lazy_init.cpp
M   source/blender/blenlib/intern/BLI_range.cpp
M   source/blender/blenlib/intern/BLI_temporary_allocator.cpp

===

diff --git a/source/blender/blenlib/intern/BLI_lazy_init.cpp 
b/source/blender/blenlib/intern/BLI_lazy_init.cpp
index 01b3b6138d1..f0e8fae3b12 100644
--- a/source/blender/blenlib/intern/BLI_lazy_init.cpp
+++ b/source/blender/blenlib/intern/BLI_lazy_init.cpp
@@ -1,3 +1,19 @@
+/*
+ * 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.
+ */
+
 #include 
 
 #include "BLI_lazy_init.hpp"
diff --git a/source/blender/blenlib/intern/BLI_range.cpp 
b/source/blender/blenlib/intern/BLI_range.cpp
index cbf26f344c1..d71814cc39c 100644
--- a/source/blender/blenlib/intern/BLI_range.cpp
+++ b/source/blender/blenlib/intern/BLI_range.cpp
@@ -1,3 +1,19 @@
+/*
+ * 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.
+ */
+
 #include "BLI_range.hpp"
 
 namespace BLI {
diff --git a/source/blender/blenlib/intern/BLI_temporary_allocator.cpp 
b/source/blender/blenlib/intern/BLI_temporary_allocator.cpp
index 5fce452acbc..2fb59250a22 100644
--- a/source/blender/blenlib/intern/BLI_temporary_allocator.cpp
+++ b/source/blender/blenlib/intern/BLI_temporary_allocator.cpp
@@ -1,3 +1,19 @@
+/*
+ * 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.
+ */
+
 #include 
 
 #include "BLI_temporary_allocator.h"

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


[Bf-blender-cvs] [c47c7a44b20] master: Fix T68623: bpy.types.UI_UL_list.filter_items_by_name is case sensitive.

2019-08-14 Thread Bastien Montagne
Commit: c47c7a44b202dd6abd635d8809fbbcce7994b7fd
Author: Bastien Montagne
Date:   Wed Aug 14 11:42:22 2019 +0200
Branches: master
https://developer.blender.org/rBc47c7a44b202dd6abd635d8809fbbcce7994b7fd

Fix T68623: bpy.types.UI_UL_list.filter_items_by_name is case sensitive.

Was a mismatch with default behavior from C-defined basic UI list...

===

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

===

diff --git a/release/scripts/startup/bl_ui/__init__.py 
b/release/scripts/startup/bl_ui/__init__.py
index 44229b2afdf..690a922b0d5 100644
--- a/release/scripts/startup/bl_ui/__init__.py
+++ b/release/scripts/startup/bl_ui/__init__.py
@@ -201,7 +201,7 @@ class UI_UL_list(bpy.types.UIList):
 for i, item in enumerate(items):
 name = getattr(item, propname, None)
 # This is similar to a logical xor
-if bool(name and fnmatch.fnmatchcase(name, pattern)) is not 
bool(reverse):
+if bool(name and fnmatch.fnmatch(name, pattern)) is not 
bool(reverse):
 flags[i] |= bitflag
 return flags

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


[Bf-blender-cvs] [1ca951cb6f2] functions: Merge branch 'master' into functions

2019-08-14 Thread Jacques Lucke
Commit: 1ca951cb6f2faaea1658b21642e426f0f4874da5
Author: Jacques Lucke
Date:   Wed Aug 14 09:57:15 2019 +0200
Branches: functions
https://developer.blender.org/rB1ca951cb6f2faaea1658b21642e426f0f4874da5

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] [b4051db4fc3] master: Fix cycles crash when voxel attributes changed

2019-08-14 Thread Philipp Oeser
Commit: b4051db4fc3ae509aa65f96af348f8241ceb726f
Author: Philipp Oeser
Date:   Wed Aug 14 10:48:25 2019 +0200
Branches: master
https://developer.blender.org/rBb4051db4fc3ae509aa65f96af348f8241ceb726f

Fix cycles crash when voxel attributes changed

This could happen e.g. when changing smoke type from flow to domain or
connecting a volume shader with to a domain without an actual flow type
around.

Fixes T58569, T68359

Reviewers: brecht

Maniphest Tasks: T58569, T68359

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

===

M   intern/cycles/blender/blender_mesh.cpp
M   intern/cycles/render/mesh.cpp
M   intern/cycles/render/mesh.h

===

diff --git a/intern/cycles/blender/blender_mesh.cpp 
b/intern/cycles/blender/blender_mesh.cpp
index c672bc9f3e2..551866f7fce 100644
--- a/intern/cycles/blender/blender_mesh.cpp
+++ b/intern/cycles/blender/blender_mesh.cpp
@@ -1002,6 +1002,9 @@ Mesh *BlenderSync::sync_mesh(BL::Depsgraph _depsgraph,
   oldcurve_keys.steal_data(mesh->curve_keys);
   oldcurve_radius.steal_data(mesh->curve_radius);
 
+  /* ensure bvh rebuild (instead of refit) if has_voxel_attributes() changed */
+  bool oldhas_voxel_attributes = mesh->has_voxel_attributes();
+
   mesh->clear();
   mesh->used_shaders = used_shaders;
   mesh->name = ustring(b_ob_data.name().c_str());
@@ -1050,7 +1053,8 @@ Mesh *BlenderSync::sync_mesh(BL::Depsgraph _depsgraph,
   /* tag update */
   bool rebuild = (oldtriangles != mesh->triangles) || (oldsubd_faces != 
mesh->subd_faces) ||
  (oldsubd_face_corners != mesh->subd_face_corners) ||
- (oldcurve_keys != mesh->curve_keys) || (oldcurve_radius != 
mesh->curve_radius);
+ (oldcurve_keys != mesh->curve_keys) || (oldcurve_radius != 
mesh->curve_radius) ||
+ (oldhas_voxel_attributes != mesh->has_voxel_attributes());
 
   mesh->tag_update(scene, rebuild);
 
diff --git a/intern/cycles/render/mesh.cpp b/intern/cycles/render/mesh.cpp
index 91c3a772537..6ac1859 100644
--- a/intern/cycles/render/mesh.cpp
+++ b/intern/cycles/render/mesh.cpp
@@ -1091,6 +1091,17 @@ bool Mesh::has_true_displacement() const
   return false;
 }
 
+bool Mesh::has_voxel_attributes() const
+{
+  foreach (const Attribute , attributes.attributes) {
+if (attr.element == ATTR_ELEMENT_VOXEL) {
+  return true;
+}
+  }
+
+  return false;
+}
+
 float Mesh::motion_time(int step) const
 {
   return (motion_steps > 1) ? 2.0f * step / (motion_steps - 1) - 1.0f : 0.0f;
@@ -2020,15 +2031,7 @@ void MeshManager::device_update_preprocess(Device 
*device, Scene *scene, Progres
 
 if (need_update && mesh->has_volume) {
   /* Create volume meshes if there is voxel data. */
-  bool has_voxel_attributes = false;
-
-  foreach (Attribute , mesh->attributes.attributes) {
-if (attr.element == ATTR_ELEMENT_VOXEL) {
-  has_voxel_attributes = true;
-}
-  }
-
-  if (has_voxel_attributes) {
+  if (mesh->has_voxel_attributes()) {
 if (!volume_images_updated) {
   progress.set_status("Updating Meshes Volume Bounds");
   device_update_volume_images(device, scene, progress);
diff --git a/intern/cycles/render/mesh.h b/intern/cycles/render/mesh.h
index 05c67ccb3b7..5bb6ab328b7 100644
--- a/intern/cycles/render/mesh.h
+++ b/intern/cycles/render/mesh.h
@@ -318,6 +318,7 @@ class Mesh : public Node {
 
   bool has_motion_blur() const;
   bool has_true_displacement() const;
+  bool has_voxel_attributes() const;
 
   /* Convert between normalized -1..1 motion time and index
* in the VERTEX_MOTION attribute. */

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


[Bf-blender-cvs] [7a7eadaf7f6] master: Shading: Add a clamp option to the Map Range node.

2019-08-14 Thread OmarSquircleArt
Commit: 7a7eadaf7f6be4008f49a83d76c5a6d5a6294f14
Author: OmarSquircleArt
Date:   Wed Aug 14 10:53:19 2019 +0200
Branches: master
https://developer.blender.org/rB7a7eadaf7f6be4008f49a83d76c5a6d5a6294f14

Shading: Add a clamp option to the Map Range node.

If the option is enabled, the output is clamped to the target range.
The target range is [To Min, To Max]. The option is enabled by default.

The clamp option is implemented in EEVEE by linking to the `clamp_value`
GLSL function. And it is implemented in Cycles using a graph expand
function.

Reviewers: brecht, JacquesLucke

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

===

M   intern/cycles/blender/blender_shader.cpp
M   intern/cycles/render/nodes.cpp
M   intern/cycles/render/nodes.h
M   source/blender/editors/space_node/drawnode.c
M   source/blender/makesrna/intern/rna_nodetree.c
M   source/blender/nodes/NOD_static_types.h
M   source/blender/nodes/shader/nodes/node_shader_map_range.c

===

diff --git a/intern/cycles/blender/blender_shader.cpp 
b/intern/cycles/blender/blender_shader.cpp
index b1c61c2fa8c..b95e88573fa 100644
--- a/intern/cycles/blender/blender_shader.cpp
+++ b/intern/cycles/blender/blender_shader.cpp
@@ -316,7 +316,10 @@ static ShaderNode *add_node(Scene *scene,
 node = new RGBToBWNode();
   }
   else if (b_node.is_a(_ShaderNodeMapRange)) {
-node = new MapRangeNode();
+BL::ShaderNodeMapRange b_map_range_node(b_node);
+MapRangeNode *map_range_node = new MapRangeNode();
+map_range_node->clamp = b_map_range_node.clamp();
+node = map_range_node;
   }
   else if (b_node.is_a(_ShaderNodeClamp)) {
 node = new ClampNode();
diff --git a/intern/cycles/render/nodes.cpp b/intern/cycles/render/nodes.cpp
index 18a7180c446..1a0225e19a8 100644
--- a/intern/cycles/render/nodes.cpp
+++ b/intern/cycles/render/nodes.cpp
@@ -5280,6 +5280,21 @@ MapRangeNode::MapRangeNode() : ShaderNode(node_type)
 {
 }
 
+void MapRangeNode::expand(ShaderGraph *graph)
+{
+  if (clamp) {
+ShaderOutput *result_out = output("Result");
+if (!result_out->links.empty()) {
+  ClampNode *clamp_node = new ClampNode();
+  clamp_node->min = to_min;
+  clamp_node->max = to_max;
+  graph->add(clamp_node);
+  graph->relink(result_out, clamp_node->output("Result"));
+  graph->connect(result_out, clamp_node->input("Value"));
+}
+  }
+}
+
 void MapRangeNode::constant_fold(const ConstantFolder )
 {
   if (folder.all_inputs_constant()) {
diff --git a/intern/cycles/render/nodes.h b/intern/cycles/render/nodes.h
index 9ac42ffc76c..d4708adf9af 100644
--- a/intern/cycles/render/nodes.h
+++ b/intern/cycles/render/nodes.h
@@ -1236,7 +1236,10 @@ class MapRangeNode : public ShaderNode {
   {
 return NODE_GROUP_LEVEL_3;
   }
+  void expand(ShaderGraph *graph);
+
   float value, from_min, from_max, to_min, to_max;
+  bool clamp;
 };
 
 class ClampNode : public ShaderNode {
diff --git a/source/blender/editors/space_node/drawnode.c 
b/source/blender/editors/space_node/drawnode.c
index b63f0daaa0d..704d878e620 100644
--- a/source/blender/editors/space_node/drawnode.c
+++ b/source/blender/editors/space_node/drawnode.c
@@ -249,6 +249,11 @@ static void node_buts_texture(uiLayout *layout, bContext 
*UNUSED(C), PointerRNA
   }
 }
 
+static void node_buts_map_range(uiLayout *layout, bContext *UNUSED(C), 
PointerRNA *ptr)
+{
+  uiItemR(layout, ptr, "clamp", 0, NULL, ICON_NONE);
+}
+
 static void node_buts_math(uiLayout *layout, bContext *UNUSED(C), PointerRNA 
*ptr)
 {
   uiItemR(layout, ptr, "operation", 0, "", ICON_NONE);
@@ -1209,6 +1214,9 @@ static void node_shader_set_butfunc(bNodeType *ntype)
 case SH_NODE_VALTORGB:
   ntype->draw_buttons = node_buts_colorramp;
   break;
+case SH_NODE_MAP_RANGE:
+  ntype->draw_buttons = node_buts_map_range;
+  break;
 case SH_NODE_MATH:
   ntype->draw_buttons = node_buts_math;
   break;
diff --git a/source/blender/makesrna/intern/rna_nodetree.c 
b/source/blender/makesrna/intern/rna_nodetree.c
index b28403bf28c..347be6b8a72 100644
--- a/source/blender/makesrna/intern/rna_nodetree.c
+++ b/source/blender/makesrna/intern/rna_nodetree.c
@@ -3834,6 +3834,16 @@ static void def_frame(StructRNA *srna)
   RNA_def_property_update(prop, NC_NODE | ND_DISPLAY, NULL);
 }
 
+static void def_map_range(StructRNA *srna)
+{
+  PropertyRNA *prop;
+
+  prop = RNA_def_property(srna, "clamp", PROP_BOOLEAN, PROP_NONE);
+  RNA_def_property_boolean_sdna(prop, NULL, "custom1", 1);
+  RNA_def_property_ui_text(prop, "Clamp", "Clamp the result to the target 
range [To Min, To Max]");
+  RNA_def_property_update(prop, NC_NODE | NA_EDITED, "rna_Node_update");
+}
+
 static void def_math(StructRNA *srna)
 {
   PropertyRNA *prop;
diff --git a/source/blender/nodes/NOD_static_types.h 
b/source/blender/nodes/NOD_static_types.h
index 

[Bf-blender-cvs] [c9acc5faad0] master: Fix T68597: GPencil Dope Sheet can fail to display active GP object

2019-08-14 Thread Antonioya
Commit: c9acc5faad08422e07be59fc160a028a45b7440c
Author: Antonioya
Date:   Wed Aug 14 10:29:21 2019 +0200
Branches: master
https://developer.blender.org/rBc9acc5faad08422e07be59fc160a028a45b7440c

Fix T68597: GPencil Dope Sheet can fail to display active GP object

Now, the dopesheet is activated if the object is in any Edition mode.

===

M   source/blender/editors/animation/anim_filter.c

===

diff --git a/source/blender/editors/animation/anim_filter.c 
b/source/blender/editors/animation/anim_filter.c
index 625a52fc800..a78a63f1347 100644
--- a/source/blender/editors/animation/anim_filter.c
+++ b/source/blender/editors/animation/anim_filter.c
@@ -1829,13 +1829,13 @@ static size_t animdata_filter_gpencil(bAnimContext *ac,
   }
 }
 
-/* check selection and object type filters */
-if ((ads->filterflag & ADS_FILTER_ONLYSEL) &&
-!((base->flag & BASE_SELECTED) /*|| (base == scene->basact)*/)) {
-  /* only selected should be shown */
-  continue;
+/* check selection and object type filters only for Object mode */
+if (ob->mode == OB_MODE_OBJECT) {
+  if ((ads->filterflag & ADS_FILTER_ONLYSEL) && !((base->flag & 
BASE_SELECTED))) {
+/* only selected should be shown */
+continue;
+  }
 }
-
 /* check if object belongs to the filtering group if option to filter
  * objects by the grouped status is on
  * - used to ease the process of doing multiple-character 
choreographies

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


[Bf-blender-cvs] [90183d7d5ca] greasepencil-object: GPencil: Smooth pressure in Active Smooth

2019-08-14 Thread Antonio Vazquez
Commit: 90183d7d5ca731b50b31e9940f39e6b758886a15
Author: Antonio Vazquez
Date:   Wed Aug 14 10:23:35 2019 +0200
Branches: greasepencil-object
https://developer.blender.org/rB90183d7d5ca731b50b31e9940f39e6b758886a15

GPencil: Smooth pressure in Active Smooth

This smooth is applied while drawing.

===

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

===

diff --git a/source/blender/editors/gpencil/gpencil_paint.c 
b/source/blender/editors/gpencil/gpencil_paint.c
index 60c104dd4e5..d0fd3770950 100644
--- a/source/blender/editors/gpencil/gpencil_paint.c
+++ b/source/blender/editors/gpencil/gpencil_paint.c
@@ -563,7 +563,7 @@ static void gp_brush_angle(bGPdata *gpd, Brush *brush, 
tGPspoint *pt, const floa
 static void gp_smooth_buffer(tGPsdata *p, float inf, int idx)
 {
   bGPdata *gpd = p->gpd;
-  short num_points = gpd->runtime.sbuffer_used;
+  const short num_points = gpd->runtime.sbuffer_used;
 
   /* Do nothing if not enough points to smooth out */
   if ((num_points < 3) || (idx < 3) || (inf == 0.0f)) {
@@ -571,10 +571,7 @@ static void gp_smooth_buffer(tGPsdata *p, float inf, int 
idx)
   }
 
   tGPspoint *points = (tGPspoint *)gpd->runtime.sbuffer;
-  float steps = 4.0f;
-  if (idx < 4) {
-steps--;
-  }
+  const float steps = (idx < 4) ? 3.0f : 4.0f;
 
   tGPspoint *pta = idx >= 4 ? [idx - 4] : NULL;
   tGPspoint *ptb = idx >= 3 ? [idx - 3] : NULL;
@@ -583,29 +580,36 @@ static void gp_smooth_buffer(tGPsdata *p, float inf, int 
idx)
 
   float sco[2] = {0.0f};
   float a[2], b[2], c[2], d[2];
+  float pressure = 0.0f;
   const float average_fac = 1.0f / steps;
 
   /* Compute smoothed coordinate by taking the ones nearby */
   if (pta) {
 copy_v2_v2(a, >x);
 madd_v2_v2fl(sco, a, average_fac);
+pressure += pta->pressure * average_fac;
   }
   if (ptb) {
 copy_v2_v2(b, >x);
 madd_v2_v2fl(sco, b, average_fac);
+pressure += ptb->pressure * average_fac;
   }
   if (ptc) {
 copy_v2_v2(c, >x);
 madd_v2_v2fl(sco, c, average_fac);
+pressure += ptc->pressure * average_fac;
   }
   if (ptd) {
 copy_v2_v2(d, >x);
 madd_v2_v2fl(sco, d, average_fac);
+pressure += ptd->pressure * average_fac;
   }
 
   /* Based on influence factor, blend between original and optimal smoothed 
coordinate */
   interp_v2_v2v2(c, c, sco, inf);
   copy_v2_v2(>x, c);
+  /* Interpolate pressure */
+  ptc->pressure = interpf(ptc->pressure, pressure, inf);
 }
 
 /* add current stroke-point to buffer (returns whether point was successfully 
added) */

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


[Bf-blender-cvs] [8826ecc2a8a] greasepencil-object: GPencil: Run Simplify Adaptive before Smooth Thickness

2019-08-14 Thread Antonio Vazquez
Commit: 8826ecc2a8a968e3c8880f60b027e05fdc868c36
Author: Antonio Vazquez
Date:   Wed Aug 14 08:44:44 2019 +0200
Branches: greasepencil-object
https://developer.blender.org/rB8826ecc2a8a968e3c8880f60b027e05fdc868c36

GPencil: Run Simplify Adaptive before Smooth Thickness

===

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

===

diff --git a/source/blender/editors/gpencil/gpencil_paint.c 
b/source/blender/editors/gpencil/gpencil_paint.c
index b386a1ca751..60c104dd4e5 100644
--- a/source/blender/editors/gpencil/gpencil_paint.c
+++ b/source/blender/editors/gpencil/gpencil_paint.c
@@ -1214,6 +1214,13 @@ static void gp_stroke_newfrombuffer(tGPsdata *p)
 reduce += 0.25f; /* reduce the factor */
   }
 }
+
+/* Simplify adaptive */
+if ((brush->gpencil_settings->flag & GP_BRUSH_GROUP_SETTINGS) &&
+(brush->gpencil_settings->simplify_f > 0.0f)) {
+  BKE_gpencil_simplify_stroke(gps, brush->gpencil_settings->simplify_f);
+}
+
 /* smooth thickness */
 if ((brush->gpencil_settings->flag & GP_BRUSH_GROUP_SETTINGS) &&
 (brush->gpencil_settings->thick_smoothfac > 0.0f)) {
@@ -1224,12 +1231,6 @@ static void gp_stroke_newfrombuffer(tGPsdata *p)
   }
 }
 
-/* Simplify adaptive */
-if ((brush->gpencil_settings->flag & GP_BRUSH_GROUP_SETTINGS) &&
-(brush->gpencil_settings->simplify_f > 0.0f)) {
-  BKE_gpencil_simplify_stroke(gps, brush->gpencil_settings->simplify_f);
-}
-
 /* reproject to plane (only in 3d space) */
 gp_reproject_toplane(p, gps);
 /* change position relative to parent object */

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