[Bf-blender-cvs] [dbfbd6b9043] master: Fix T62555 Viewport borders flicker when splitting said viewport

2019-03-15 Thread Clément Foucault
Commit: dbfbd6b9043d325456225aaf4c8af7bba7cc4aa0
Author: Clément Foucault
Date:   Sat Mar 16 03:57:51 2019 +0100
Branches: master
https://developer.blender.org/rBdbfbd6b9043d325456225aaf4c8af7bba7cc4aa0

Fix T62555 Viewport borders flicker when splitting said viewport

===

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

===

diff --git a/source/blender/editors/screen/screen_draw.c 
b/source/blender/editors/screen/screen_draw.c
index a5d0bbacd91..6a0332731b4 100644
--- a/source/blender/editors/screen/screen_draw.c
+++ b/source/blender/editors/screen/screen_draw.c
@@ -412,6 +412,7 @@ void ED_screen_draw_edges(wmWindow *win)
edge_thickness = corner_scale * 0.21f;
 
GPU_blend(true);
+   GPU_blend_set_func_separate(GPU_SRC_ALPHA, GPU_ONE_MINUS_SRC_ALPHA, 
GPU_ONE, GPU_ONE_MINUS_SRC_ALPHA);
 
GPUBatch *batch = batch_screen_edges_get(_per_corner);
GPU_batch_program_set_builtin(batch, GPU_SHADER_2D_AREA_EDGES);
@@ -484,6 +485,8 @@ void ED_screen_draw_split_preview(ScrArea *sa, const int 
dir, const float fac)
 
/* splitpoint */
GPU_blend(true);
+   GPU_blend_set_func_separate(GPU_SRC_ALPHA, GPU_ONE_MINUS_SRC_ALPHA, 
GPU_ONE, GPU_ONE_MINUS_SRC_ALPHA);
+
immUniformColor4ub(255, 255, 255, 100);
 
immBegin(GPU_PRIM_LINES, 2);

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


[Bf-blender-cvs] [0c10374faf1] master: CMake: disable jemalloc when building as a Python module

2019-03-15 Thread Campbell Barton
Commit: 0c10374faf133083602aa54ded2450feff347a7d
Author: Campbell Barton
Date:   Sat Mar 16 13:05:54 2019 +1100
Branches: master
https://developer.blender.org/rB0c10374faf133083602aa54ded2450feff347a7d

CMake: disable jemalloc when building as a Python module

===

M   build_files/cmake/config/bpy_module.cmake

===

diff --git a/build_files/cmake/config/bpy_module.cmake 
b/build_files/cmake/config/bpy_module.cmake
index 64f7f78a286..1637bbf9506 100644
--- a/build_files/cmake/config/bpy_module.cmake
+++ b/build_files/cmake/config/bpy_module.cmake
@@ -30,3 +30,8 @@ set(WITH_INTERNATIONAL   OFF CACHE BOOL "" FORCE)
 set(WITH_BULLET  OFF CACHE BOOL "" FORCE)
 set(WITH_OPENVDB OFF CACHE BOOL "" FORCE)
 set(WITH_ALEMBIC OFF CACHE BOOL "" FORCE)
+
+if(CMAKE_SYSTEM_NAME MATCHES "Linux")
+   # jemalloc causes linking error on import, disable.
+   set(WITH_MEM_JEMALLOCOFF CACHE BOOL "" FORCE)
+endif()

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


[Bf-blender-cvs] [b88ba401830] sculpt-mode-features: Brush cursor: Fix bug in tiling preview

2019-03-15 Thread Pablo Dobarro
Commit: b88ba401830f506bb5d526c7ddbbada94185d7fd
Author: Pablo Dobarro
Date:   Sat Mar 16 03:05:03 2019 +0100
Branches: sculpt-mode-features
https://developer.blender.org/rBb88ba401830f506bb5d526c7ddbbada94185d7fd

Brush cursor: Fix bug in tiling preview

===

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

===

diff --git a/source/blender/editors/sculpt_paint/paint_cursor.c 
b/source/blender/editors/sculpt_paint/paint_cursor.c
index b4633a0a3fd..317e037ad95 100644
--- a/source/blender/editors/sculpt_paint/paint_cursor.c
+++ b/source/blender/editors/sculpt_paint/paint_cursor.c
@@ -1045,12 +1045,13 @@ static bool ommit_cursor_drawing(Paint *paint, 
ePaintMode mode, Brush *brush)
return true;
 }
 
-void cursor_draw_point_screen_space(const uint gpuattr, const ARegion *ar, 
float location[3],
+void cursor_draw_point_screen_space(const uint gpuattr, const ARegion *ar, 
float true_location[3],
 float obmat[4][4], float persmat[4][4])
 {
float ar_width = ar->winrct.xmax - ar->winrct.xmin;
float ar_height = ar->winrct.ymax - ar->winrct.ymin;
-   float pv4[4], translation_vertex_cursor[2];
+   float pv4[4], translation_vertex_cursor[2], location[3];
+   copy_v3_v3(location, true_location);
mul_m4_v3(obmat, location);
copy_v3_v3(pv4, location);
pv4[3] = 1.0f;
@@ -1107,7 +1108,6 @@ void cursor_draw_point_with_symmetry(const uint gpuattr, 
const ARegion *ar,const
const char symm = sd->paint.symmetry_flags & PAINT_SYMM_AXIS_ALL;
float location[3], pv4[4], translation_vertex_cursor[2], 
symm_rot_mat[4][4];
 
-   copy_v3_v3(location, true_location);
for (int i = 0; i <= symm; ++i) {
if (i == 0 || (symm & i && (symm != 5 || i != 3) && (symm != 6 
|| (i != 3 && i != 5 {
 
@@ -1116,7 +1116,6 @@ void cursor_draw_point_with_symmetry(const uint gpuattr, 
const ARegion *ar,const
cursor_draw_point_screen_space(gpuattr, ar, location, 
ob->obmat, persmat);
 
/* Tiling */
-   copy_v3_v3(location, true_location);
cursor_draw_tiling_preview(gpuattr, ar, location, sd, 
ob, persmat, radius);
 
/* Radial Symmetry */

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


[Bf-blender-cvs] [d438120fe3f] master: Fix T61526 hair doesn't render in workbench but does with openGL

2019-03-15 Thread Clément Foucault
Commit: d438120fe3ff564d8b3184aca82060f76b4829c0
Author: Clément Foucault
Date:   Sat Mar 16 02:47:03 2019 +0100
Branches: master
https://developer.blender.org/rBd438120fe3ff564d8b3184aca82060f76b4829c0

Fix T61526 hair doesn't render in workbench but does with openGL

===

M   source/blender/draw/engines/workbench/workbench_render.c

===

diff --git a/source/blender/draw/engines/workbench/workbench_render.c 
b/source/blender/draw/engines/workbench/workbench_render.c
index 423134f5d6c..7a0e4150d28 100644
--- a/source/blender/draw/engines/workbench/workbench_render.c
+++ b/source/blender/draw/engines/workbench/workbench_render.c
@@ -124,6 +124,7 @@ static void workbench_render_framebuffers_finish(void)
 
 void workbench_render(WORKBENCH_Data *data, RenderEngine *engine, RenderLayer 
*render_layer, const rcti *rect)
 {
+   DefaultFramebufferList *dfbl = DRW_viewport_framebuffer_list_get();
const DRWContextState *draw_ctx = DRW_context_state_get();
const Scene *scene = draw_ctx->scene;
Depsgraph *depsgraph = draw_ctx->depsgraph;
@@ -146,6 +147,10 @@ void workbench_render(WORKBENCH_Data *data, RenderEngine 
*engine, RenderLayer *r
workbench_deferred_cache_finish(data);
DRW_render_instance_buffer_finish();
 
+   /* Also we weed to have a correct fbo bound for DRW_hair_update 
*/
+   GPU_framebuffer_bind(dfbl->color_only_fb);
+   DRW_hair_update();
+
/* Draw. */
int num_samples = workbench_taa_calculate_num_iterations(data);
for (int sample = 0; sample < num_samples; sample++) {
@@ -171,6 +176,10 @@ void workbench_render(WORKBENCH_Data *data, RenderEngine 
*engine, RenderLayer *r
workbench_forward_cache_finish(data);
DRW_render_instance_buffer_finish();
 
+   /* Also we weed to have a correct fbo bound for DRW_hair_update 
*/
+   GPU_framebuffer_bind(dfbl->color_only_fb);
+   DRW_hair_update();
+
/* Draw. */
int num_samples = workbench_taa_calculate_num_iterations(data);
for (int sample = 0; sample < num_samples; sample++) {
@@ -189,7 +198,6 @@ void workbench_render(WORKBENCH_Data *data, RenderEngine 
*engine, RenderLayer *r
const char *viewname = RE_GetActiveRenderView(engine->re);
RenderPass *rp = RE_pass_find_by_name(render_layer, 
RE_PASSNAME_COMBINED, viewname);
 
-   DefaultFramebufferList *dfbl = DRW_viewport_framebuffer_list_get();
GPU_framebuffer_bind(dfbl->color_only_fb);
GPU_framebuffer_read_color(dfbl->color_only_fb,
   rect->xmin, rect->ymin,

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


[Bf-blender-cvs] [dc1a17501d6] sculpt-mode-features: Brush cursor: Radial symmetry and tiling preview support

2019-03-15 Thread Pablo Dobarro
Commit: dc1a17501d6be4a74a9ac49b5c25960861ccfe94
Author: Pablo Dobarro
Date:   Sat Mar 16 02:09:04 2019 +0100
Branches: sculpt-mode-features
https://developer.blender.org/rBdc1a17501d6be4a74a9ac49b5c25960861ccfe94

Brush cursor: Radial symmetry and tiling preview support

===

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

===

diff --git a/source/blender/editors/sculpt_paint/paint_cursor.c 
b/source/blender/editors/sculpt_paint/paint_cursor.c
index c9880ae3af1..b4633a0a3fd 100644
--- a/source/blender/editors/sculpt_paint/paint_cursor.c
+++ b/source/blender/editors/sculpt_paint/paint_cursor.c
@@ -45,6 +45,7 @@
 #include "BKE_node.h"
 #include "BKE_paint.h"
 #include "BKE_colortools.h"
+#include "BKE_object.h"
 
 #include "WM_api.h"
 #include "wm_cursors.h"
@@ -1044,37 +1045,93 @@ static bool ommit_cursor_drawing(Paint *paint, 
ePaintMode mode, Brush *brush)
return true;
 }
 
-void cursor_draw_point_with_symmetry(const uint gpuatrr, const ARegion 
*ar,const float pos[3], const char symm, const float obmat[4][4], const float 
persmat[4][4]){
+void cursor_draw_point_screen_space(const uint gpuattr, const ARegion *ar, 
float location[3],
+float obmat[4][4], float persmat[4][4])
+{
float ar_width = ar->winrct.xmax - ar->winrct.xmin;
float ar_height = ar->winrct.ymax - ar->winrct.ymin;
-   int  i = 0;
-   for (i = 0; i <= symm; ++i) {
-   if (i == 0 || (symm & i && (symm != 5 || i != 3) && (symm != 6 
|| (i != 3 && i != 5 {
-   float vertex_pos[3] = {
-   pos[0],
-   pos[1],
-   pos[2],
-   };
-   flip_v3_v3(vertex_pos, vertex_pos, (char)i);
-
-   float translation_vertex_cursor[2];
-   mul_m4_v3(obmat, vertex_pos);
-   float pv4[4] = {
-   vertex_pos[0],
-   vertex_pos[1],
-   vertex_pos[2],
-   1.0f,
-   };
-   mul_m4_v4(persmat, pv4);
-
-   if (pv4[3] > 0.0f) {
-   float width_half = ar_width * 0.5f;
-   float height_half = ar_height * 0.5f;
-   translation_vertex_cursor[0] = width_half + 
width_half * (pv4[0] / pv4[3]);
-   translation_vertex_cursor[1] = height_half + 
height_half * (pv4[1] / pv4[3]);
+   float pv4[4], translation_vertex_cursor[2];
+   mul_m4_v3(obmat, location);
+   copy_v3_v3(pv4, location);
+   pv4[3] = 1.0f;
+   mul_m4_v4(persmat, pv4);
+   if (pv4[3] > 0.0f) {
+   float width_half = ar_width * 0.5f;
+   float height_half = ar_height * 0.5f;
+   translation_vertex_cursor[0] = width_half + width_half * 
(pv4[0] / pv4[3]);
+   translation_vertex_cursor[1] = height_half + height_half * 
(pv4[1] / pv4[3]);
+   }
+   imm_draw_circle_fill_3d(gpuattr, translation_vertex_cursor[0], 
translation_vertex_cursor[1], 3, 10);
+}
+
+void cursor_draw_tiling_preview(const uint gpuattr, const ARegion *ar, float 
true_location[3],
+ Sculpt *sd, Object *ob, float 
persmat[4][4], float radius)
+{
+   BoundBox *bb = BKE_object_boundbox_get(ob);
+   float orgLoc[3], location[3], pv4[4], translation_vertex_cursor[2];
+   int  dim, tile_pass = 0;
+   int start[3];
+   int end[3];
+   int cur[3];
+   const float *bbMin = bb->vec[0];
+   const float *bbMax = bb->vec[6];
+   const float *step = sd->paint.tile_offset;
+
+   copy_v3_v3(orgLoc, true_location);
+   for (dim = 0; dim < 3; ++dim) {
+   if ((sd->paint.symmetry_flags & (PAINT_TILE_X << dim)) && 
step[dim] > 0) {
+   start[dim] = (bbMin[dim] - orgLoc[dim] - radius) / 
step[dim];
+   end[dim] = (bbMax[dim] - orgLoc[dim] + radius) / 
step[dim];
+   }
+   else
+   start[dim] = end[dim] = 0;
+   }
+   copy_v3_v3_int(cur, start);
+   for (cur[0] = start[0]; cur[0] <= end[0]; ++cur[0]) {
+   for (cur[1] = start[1]; cur[1] <= end[1]; ++cur[1]) {
+   for (cur[2] = start[2]; cur[2] <= end[2]; ++cur[2]) {
+   if (!cur[0] && !cur[1] && !cur[2])
+   continue; /* skip tile at orgLoc, this 
was already handled before all others */
+   ++tile_pass;
+   for (dim = 0; dim < 3; ++dim) {
+   location[dim] = cur[dim] * step[dim] 

[Bf-blender-cvs] [bd1d80d0cf9] master: Cleanup: use return args last

2019-03-15 Thread Campbell Barton
Commit: bd1d80d0cf9c8aa856b37a91750c94a0048528f5
Author: Campbell Barton
Date:   Sat Mar 16 11:38:55 2019 +1100
Branches: master
https://developer.blender.org/rBbd1d80d0cf9c8aa856b37a91750c94a0048528f5

Cleanup: use return args last

===

M   source/blender/editors/include/ED_mesh.h
M   source/blender/editors/mesh/editface.c
M   source/blender/editors/mesh/meshtools.c
M   source/blender/editors/sculpt_paint/paint_vertex_weight_ops.c
M   source/blender/editors/space_view3d/space_view3d.c
M   source/blender/editors/space_view3d/view3d_select.c

===

diff --git a/source/blender/editors/include/ED_mesh.h 
b/source/blender/editors/include/ED_mesh.h
index 9fcd0c985ca..b912cf88102 100644
--- a/source/blender/editors/include/ED_mesh.h
+++ b/source/blender/editors/include/ED_mesh.h
@@ -365,9 +365,15 @@ int *mesh_get_x_mirror_faces(struct Object *ob, struct 
BMEditMesh *em, struct Me
 
 int ED_mesh_mirror_get_vert(struct Object *ob, int index);
 
-bool ED_mesh_pick_vert(struct bContext *C,  struct Object *ob, const int 
mval[2], uint *r_index, uint dist_px, bool use_zbuf);
-bool ED_mesh_pick_face(struct bContext *C,  struct Object *ob, const int 
mval[2], uint *r_index, uint dist_px);
-bool ED_mesh_pick_face_vert(struct bContext *C, struct Object *ob, const int 
mval[2], uint *r_index, uint dist_px);
+bool ED_mesh_pick_vert(
+struct bContext *C, struct Object *ob, const int mval[2], uint 
dist_px, bool use_zbuf,
+uint *r_index);
+bool ED_mesh_pick_face(
+struct bContext *C, struct Object *ob, const int mval[2], uint dist_px,
+uint *r_index);
+bool ED_mesh_pick_face_vert(
+struct bContext *C, struct Object *ob, const int mval[2], uint dist_px,
+uint *r_index);
 
 
 struct MDeformVert *ED_mesh_active_dvert_get_em(struct Object *ob, struct 
BMVert **r_eve);
diff --git a/source/blender/editors/mesh/editface.c 
b/source/blender/editors/mesh/editface.c
index e226985300c..12a96d41711 100644
--- a/source/blender/editors/mesh/editface.c
+++ b/source/blender/editors/mesh/editface.c
@@ -272,7 +272,7 @@ void paintface_select_linked(bContext *C, Object *ob, const 
int mval[2], const b
if (me == NULL || me->totpoly == 0) return;
 
if (mval) {
-   if (!ED_mesh_pick_face(C, ob, mval, , 
ED_MESH_PICK_DEFAULT_FACE_DIST)) {
+   if (!ED_mesh_pick_face(C, ob, mval, 
ED_MESH_PICK_DEFAULT_FACE_DIST, )) {
return;
}
}
@@ -374,11 +374,13 @@ bool paintface_mouse_select(struct bContext *C, Object 
*ob, const int mval[2], b
/* Get the face under the cursor */
me = BKE_mesh_from_object(ob);
 
-   if (!ED_mesh_pick_face(C, ob, mval, , 
ED_MESH_PICK_DEFAULT_FACE_DIST))
+   if (!ED_mesh_pick_face(C, ob, mval, ED_MESH_PICK_DEFAULT_FACE_DIST, 
)) {
return false;
+   }
 
-   if (index >= me->totpoly)
+   if (index >= me->totpoly) {
return false;
+   }
 
mpoly_sel = me->mpoly + index;
if (mpoly_sel->flag & ME_HIDE) return false;
diff --git a/source/blender/editors/mesh/meshtools.c 
b/source/blender/editors/mesh/meshtools.c
index 0b2b9355a8a..5339c83d158 100644
--- a/source/blender/editors/mesh/meshtools.c
+++ b/source/blender/editors/mesh/meshtools.c
@@ -1014,7 +1014,9 @@ int *mesh_get_x_mirror_faces(Object *ob, BMEditMesh *em, 
Mesh *me_eval)
  *
  * \return boolean true == Found
  */
-bool ED_mesh_pick_face(bContext *C, Object *ob, const int mval[2], unsigned 
int *index, uint dist_px)
+bool ED_mesh_pick_face(
+bContext *C, Object *ob, const int mval[2], uint dist_px,
+uint *r_index)
 {
ViewContext vc;
Mesh *me = ob->data;
@@ -1032,18 +1034,19 @@ bool ED_mesh_pick_face(bContext *C, Object *ob, const 
int mval[2], unsigned int
 
ED_view3d_select_id_validate();
 
-   *index = ED_view3d_select_id_read_nearest(
+   *r_index = ED_view3d_select_id_read_nearest(
, mval, 1, me->totpoly + 1, _px);
}
else {
/* sample only on the exact position */
-   *index = ED_view3d_select_id_sample(, mval[0], mval[1]);
+   *r_index = ED_view3d_select_id_sample(, mval[0], mval[1]);
}
 
-   if ((*index) == 0 || (*index) > (unsigned int)me->totpoly)
+   if ((*r_index) == 0 || (*r_index) > (unsigned int)me->totpoly) {
return false;
+   }
 
-   (*index)--;
+   (*r_index)--;
 
return true;
 }
@@ -1076,7 +1079,9 @@ static void ed_mesh_pick_face_vert__mpoly_find(
  * Use when the back buffer stores face index values. but we want a vert.
  * This gets the face then finds the closest vertex to mval.
  */
-bool ED_mesh_pick_face_vert(bContext *C, Object *ob, const int mval[2], uint 
*r_index, uint dist_px)

[Bf-blender-cvs] [3600bb79d05] master: Fix T60803 Artifacts with SSR + Reflection Plane + 0 roughness

2019-03-15 Thread Clément Foucault
Commit: 3600bb79d05d9a115ca036f1dcb864205ef3c0ce
Author: Clément Foucault
Date:   Sat Mar 16 00:50:50 2019 +0100
Branches: master
https://developer.blender.org/rB3600bb79d05d9a115ca036f1dcb864205ef3c0ce

Fix T60803 Artifacts with SSR + Reflection Plane + 0 roughness

Tweaked the tracing parameters again to avoid rays terminated before first
iteration.

===

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

===

diff --git a/source/blender/draw/engines/eevee/shaders/raytrace_lib.glsl 
b/source/blender/draw/engines/eevee/shaders/raytrace_lib.glsl
index 80389402129..85c4a02bc1e 100644
--- a/source/blender/draw/engines/eevee/shaders/raytrace_lib.glsl
+++ b/source/blender/draw/engines/eevee/shaders/raytrace_lib.glsl
@@ -91,7 +91,7 @@ void prepare_raycast(
 
/* If the line is degenerate, make it cover at least one pixel
 * to not have to handle zero-pixel extent as a special case later */
-   ss_step.xy += vec2((dot(ss_step.xy, ss_step.xy) < 0.03) ? 0.001 : 
0.0);
+   ss_step.xy += vec2((dot(ss_step.xy, ss_step.xy) < 0.1) ? 0.001 : 
0.0);
 
/* Make ss_step cover one pixel. */
ss_step /= max(abs(ss_step.x), abs(ss_step.y));
@@ -135,7 +135,7 @@ vec3 raycast(
float max_time;
prepare_raycast(ray_origin, ray_dir, thickness, index, ss_step, 
ss_start, max_time);
 
-   float max_trace_time = max(0.001, max_time - 0.01);
+   float max_trace_time = max(0.01, max_time - 0.01);
 
 #ifdef GROUPED_FETCHES
ray_jitter *= 0.25;

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


[Bf-blender-cvs] [44301175bbc] master: Fix __func__ being passed as an output string, also warnings

2019-03-15 Thread Campbell Barton
Commit: 44301175bbc81669bc0ec413baf1c14a281fc10a
Author: Campbell Barton
Date:   Sat Mar 16 10:12:47 2019 +1100
Branches: master
https://developer.blender.org/rB44301175bbc81669bc0ec413baf1c14a281fc10a

Fix __func__ being passed as an output string, also warnings

===

M   source/blender/draw/intern/draw_manager.c
M   source/blender/editors/include/ED_mesh.h
M   source/blender/editors/mesh/meshtools.c

===

diff --git a/source/blender/draw/intern/draw_manager.c 
b/source/blender/draw/intern/draw_manager.c
index fb30e4391e7..34217b83241 100644
--- a/source/blender/draw/intern/draw_manager.c
+++ b/source/blender/draw/intern/draw_manager.c
@@ -2053,10 +2053,9 @@ static void 
draw_select_framebuffer_depth_only_setup(const rcti *rect)
g_select_buffer.texture_depth, 0, 0);
 
GPU_framebuffer_check_valid(
-   g_select_buffer.framebuffer_depth_only, __func__);
-
+   g_select_buffer.framebuffer_depth_only, NULL);
GPU_framebuffer_check_valid(
-   g_select_buffer.framebuffer_select_id, __func__);
+   g_select_buffer.framebuffer_select_id, NULL);
}
 }
 
@@ -2085,7 +2084,7 @@ static void draw_select_framebuffer_select_id_setup(const 
rcti *rect)
g_select_buffer.texture_u32, 0, 0);
 
GPU_framebuffer_check_valid(
-   g_select_buffer.framebuffer_select_id, __func__);
+   g_select_buffer.framebuffer_select_id, NULL);
}
 }
 
diff --git a/source/blender/editors/include/ED_mesh.h 
b/source/blender/editors/include/ED_mesh.h
index e8c5e0dd789..9fcd0c985ca 100644
--- a/source/blender/editors/include/ED_mesh.h
+++ b/source/blender/editors/include/ED_mesh.h
@@ -365,9 +365,9 @@ int *mesh_get_x_mirror_faces(struct Object *ob, struct 
BMEditMesh *em, struct Me
 
 int ED_mesh_mirror_get_vert(struct Object *ob, int index);
 
-bool ED_mesh_pick_vert(struct bContext *C,  struct Object *ob, const int 
mval[2], unsigned int *index, int dist_px, bool use_zbuf);
-bool ED_mesh_pick_face(struct bContext *C,  struct Object *ob, const int 
mval[2], unsigned int *index, int dist_px);
-bool ED_mesh_pick_face_vert(struct bContext *C, struct Object *ob, const int 
mval[2], unsigned int *index, int dist_px);
+bool ED_mesh_pick_vert(struct bContext *C,  struct Object *ob, const int 
mval[2], uint *r_index, uint dist_px, bool use_zbuf);
+bool ED_mesh_pick_face(struct bContext *C,  struct Object *ob, const int 
mval[2], uint *r_index, uint dist_px);
+bool ED_mesh_pick_face_vert(struct bContext *C, struct Object *ob, const int 
mval[2], uint *r_index, uint dist_px);
 
 
 struct MDeformVert *ED_mesh_active_dvert_get_em(struct Object *ob, struct 
BMVert **r_eve);
diff --git a/source/blender/editors/mesh/meshtools.c 
b/source/blender/editors/mesh/meshtools.c
index 952690775b7..0b2b9355a8a 100644
--- a/source/blender/editors/mesh/meshtools.c
+++ b/source/blender/editors/mesh/meshtools.c
@@ -1014,7 +1014,7 @@ int *mesh_get_x_mirror_faces(Object *ob, BMEditMesh *em, 
Mesh *me_eval)
  *
  * \return boolean true == Found
  */
-bool ED_mesh_pick_face(bContext *C, Object *ob, const int mval[2], unsigned 
int *index, int dist_px)
+bool ED_mesh_pick_face(bContext *C, Object *ob, const int mval[2], unsigned 
int *index, uint dist_px)
 {
ViewContext vc;
Mesh *me = ob->data;
@@ -1076,7 +1076,7 @@ static void ed_mesh_pick_face_vert__mpoly_find(
  * Use when the back buffer stores face index values. but we want a vert.
  * This gets the face then finds the closest vertex to mval.
  */
-bool ED_mesh_pick_face_vert(bContext *C, Object *ob, const int mval[2], 
unsigned int *index, int dist_px)
+bool ED_mesh_pick_face_vert(bContext *C, Object *ob, const int mval[2], uint 
*r_index, uint dist_px)
 {
Depsgraph *depsgraph = CTX_data_depsgraph(C);
unsigned int poly_index;
@@ -1134,7 +1134,7 @@ bool ED_mesh_pick_face_vert(bContext *C, Object *ob, 
const int mval[2], unsigned
}
}
 
-   /* map 'dm -> me' index if possible */
+   /* map 'dm -> me' r_index if possible */
if (v_idx_best != ORIGINDEX_NONE) {
const int *index_mv_to_orig;
index_mv_to_orig = 
CustomData_get_layer(_eval->vdata, CD_ORIGINDEX);
@@ -1144,7 +1144,7 @@ bool ED_mesh_pick_face_vert(bContext *C, Object *ob, 
const int mval[2], unsigned
}
 
if ((v_idx_best != ORIGINDEX_NONE) && (v_idx_best < 
me->totvert)) {
-   *index = v_idx_best;
+   *r_index = v_idx_best;
return true;
}
}
@@ -1184,7 +1184,7 @@ static void ed_mesh_pick_vert__mapFunc(void *userData, 
int 

[Bf-blender-cvs] [795bddf2bda] master: Fix T55620 Artifacts with SSR and planar reflection

2019-03-15 Thread Clément Foucault
Commit: 795bddf2bda4708996228d368dd410203b737b63
Author: Clément Foucault
Date:   Fri Mar 15 23:31:41 2019 +0100
Branches: master
https://developer.blender.org/rB795bddf2bda4708996228d368dd410203b737b63

Fix T55620 Artifacts with SSR and planar reflection

Was caused by 0 pixel extent rays which did not trace at all. Bumping the
threshold for degenerate rays fixes it.

===

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

===

diff --git a/source/blender/draw/engines/eevee/shaders/raytrace_lib.glsl 
b/source/blender/draw/engines/eevee/shaders/raytrace_lib.glsl
index d5a51f89e81..80389402129 100644
--- a/source/blender/draw/engines/eevee/shaders/raytrace_lib.glsl
+++ b/source/blender/draw/engines/eevee/shaders/raytrace_lib.glsl
@@ -91,7 +91,7 @@ void prepare_raycast(
 
/* If the line is degenerate, make it cover at least one pixel
 * to not have to handle zero-pixel extent as a special case later */
-   ss_step.xy += vec2((dot(ss_step.xy, ss_step.xy) < 0.01) ? 0.001 : 
0.0);
+   ss_step.xy += vec2((dot(ss_step.xy, ss_step.xy) < 0.03) ? 0.001 : 
0.0);
 
/* Make ss_step cover one pixel. */
ss_step /= max(abs(ss_step.x), abs(ss_step.y));

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


[Bf-blender-cvs] [efdde88dfc9] master: Particle: Remove Billboard Particle code

2019-03-15 Thread Clément Foucault
Commit: efdde88dfc9501764d96cf5b33e2141a86ba44c9
Author: Clément Foucault
Date:   Fri Mar 15 20:56:29 2019 +0100
Branches: master
https://developer.blender.org/rBefdde88dfc9501764d96cf5b33e2141a86ba44c9

Particle: Remove Billboard Particle code

The billboard particles were only used by Blender Internal. So until it is
supported by Cycles of Eevee there is no reason to keep it in the code and
UI.

Fix T61695 Billboard particles not displaying in Eevee viewport, render

===

M   release/scripts/startup/bl_ui/properties_particle.py
M   source/blender/blenkernel/BKE_particle.h
M   source/blender/blenkernel/intern/particle.c
M   source/blender/blenloader/intern/versioning_280.c
M   source/blender/makesdna/DNA_particle_types.h
M   source/blender/makesrna/intern/rna_particle.c

===

diff --git a/release/scripts/startup/bl_ui/properties_particle.py 
b/release/scripts/startup/bl_ui/properties_particle.py
index c85b8004808..3d25829c3d2 100644
--- a/release/scripts/startup/bl_ui/properties_particle.py
+++ b/release/scripts/startup/bl_ui/properties_particle.py
@@ -1480,98 +1480,6 @@ class 
PARTICLE_PT_render_collection_use_count(ParticleButtonsPanel, Panel):
 row.prop(weight, "count")
 
 
-class PARTICLE_PT_render_billboards_alignment(ParticleButtonsPanel, Panel):
-bl_label = "Billboard Alignment"
-bl_parent_id = "PARTICLE_PT_render"
-bl_options = {'DEFAULT_CLOSED'}
-COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_EEVEE', 'BLENDER_WORKBENCH'}
-
-@classmethod
-def poll(cls, context):
-part = particle_get_settings(context)
-return part.render_type == 'BILLBOARD'
-
-def draw(self, context):
-layout = self.layout
-layout.use_property_split = True
-
-part = particle_get_settings(context)
-
-col = layout.column()
-
-col.prop(part, "billboard_align", text="Align To")
-col.prop(part, "lock_billboard", text="Lock Axis")
-col.prop(part, "billboard_object")
-
-
-class PARTICLE_PT_render_billboards_tilt(ParticleButtonsPanel, Panel):
-bl_label = "Billboard Tilt"
-bl_parent_id = "PARTICLE_PT_render"
-bl_options = {'DEFAULT_CLOSED'}
-COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_EEVEE', 'BLENDER_WORKBENCH'}
-
-@classmethod
-def poll(cls, context):
-part = particle_get_settings(context)
-return part.render_type == 'BILLBOARD'
-
-def draw(self, context):
-layout = self.layout
-layout.use_property_split = True
-
-part = particle_get_settings(context)
-
-col = layout.column()
-
-sub = col.column(align=True)
-sub.prop(part, "billboard_tilt", text="Angle", slider=True)
-sub.prop(part, "billboard_tilt_random", text="Random", slider=True)
-
-sub = col.column(align=True)
-sub.prop(part, "billboard_offset")
-col.prop(part, "billboard_size", text="Scale")
-if part.billboard_align == 'VEL':
-col = col.column(align=True)
-col.prop(part, "billboard_velocity_head", text="Velocity 
ScaleHead")
-col.prop(part, "billboard_velocity_tail", text="Tail")
-
-
-class PARTICLE_PT_render_billboards_uv(ParticleButtonsPanel, Panel):
-bl_label = "Billboard UVs"
-bl_parent_id = "PARTICLE_PT_render"
-bl_options = {'DEFAULT_CLOSED'}
-COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_EEVEE', 'BLENDER_WORKBENCH'}
-
-@classmethod
-def poll(cls, context):
-part = particle_get_settings(context)
-return part.render_type == 'BILLBOARD'
-
-def draw(self, context):
-layout = self.layout
-layout.use_property_split = True
-
-psys = context.particle_system
-ob = context.object
-part = particle_get_settings(context)
-
-col = layout.column()
-
-if psys:
-col.prop_search(psys, "billboard_normal_uv", ob.data, "uv_layers")
-col.prop_search(psys, "billboard_time_index_uv", ob.data, 
"uv_layers")
-
-col.prop(part, "billboard_uv_split", text="Split UVs")
-
-if psys:
-sub = col.column()
-sub.active = part.billboard_uv_split > 1
-sub.prop_search(psys, "billboard_split_uv", ob.data, "uv_layers")
-
-sub.prop(part, "billboard_animation")
-sub.prop(part, "billboard_offset_split")
-
-
 class PARTICLE_PT_render_trails(ParticleButtonsPanel, Panel):
 bl_label = "Trails"
 bl_parent_id = "PARTICLE_PT_render"
@@ -2186,8 +2094,6 @@ classes = (
 PARTICLE_PT_render_object,
 PARTICLE_PT_render_collection,
 PARTICLE_PT_render_collection_use_count,
-PARTICLE_PT_render_billboards_tilt,
-PARTICLE_PT_render_billboards_uv,
 PARTICLE_PT_render_trails,
 PARTICLE_PT_render_extra,
 PARTICLE_PT_draw,
diff --git a/source/blender/blenkernel/BKE_particle.h 

[Bf-blender-cvs] [66225e84cfe] master: Eevee: DOF: Optimization: Move some operations out of the shader

2019-03-15 Thread Clément Foucault
Commit: 66225e84cfeb6d05ae25cc60c6c467b29afb190b
Author: Clément Foucault
Date:   Fri Mar 15 22:17:07 2019 +0100
Branches: master
https://developer.blender.org/rB66225e84cfeb6d05ae25cc60c6c467b29afb190b

Eevee: DOF: Optimization: Move some operations out of the shader

===

M   source/blender/draw/engines/eevee/eevee_depth_of_field.c
M   source/blender/draw/engines/eevee/eevee_private.h
M   source/blender/draw/engines/eevee/shaders/effect_dof_frag.glsl

===

diff --git a/source/blender/draw/engines/eevee/eevee_depth_of_field.c 
b/source/blender/draw/engines/eevee/eevee_depth_of_field.c
index 597cb830afb..7f754a5a466 100644
--- a/source/blender/draw/engines/eevee/eevee_depth_of_field.c
+++ b/source/blender/draw/engines/eevee/eevee_depth_of_field.c
@@ -153,9 +153,10 @@ int EEVEE_depth_of_field_init(EEVEE_ViewLayerData 
*UNUSED(sldata), EEVEE_Data *v
sensor_scaled *= rv3d->viewcamtexcofac[0];
}
 
-   effects->dof_params[0] = aperture * 
fabsf(focal_len_scaled / (focus_dist - focal_len_scaled));
-   effects->dof_params[1] = -focus_dist;
-   effects->dof_params[2] = viewport_size[0] / 
sensor_scaled;
+   effects->dof_params[1] = aperture * 
fabsf(focal_len_scaled / (focus_dist - focal_len_scaled));
+   effects->dof_params[1] *= viewport_size[0] / 
sensor_scaled;
+   effects->dof_params[0] = -focus_dist * 
effects->dof_params[1];
+
effects->dof_bokeh[0] = rotation;
effects->dof_bokeh[1] = ratio;
effects->dof_bokeh[2] = 
scene_eval->eevee.bokeh_max_size;
@@ -204,7 +205,7 @@ void EEVEE_depth_of_field_cache_init(EEVEE_ViewLayerData 
*UNUSED(sldata), EEVEE_
DRW_shgroup_uniform_texture_ref(grp, "colorBuffer", 
>source_buffer);
DRW_shgroup_uniform_texture_ref(grp, "depthBuffer", 
>depth);
DRW_shgroup_uniform_vec2(grp, "nearFar", effects->dof_near_far, 
1);
-   DRW_shgroup_uniform_vec3(grp, "dofParams", effects->dof_params, 
1);
+   DRW_shgroup_uniform_vec2(grp, "dofParams", effects->dof_params, 
1);
DRW_shgroup_call_add(grp, quad, NULL);
 
psl->dof_scatter = DRW_pass_create("DoF Scatter", 
DRW_STATE_WRITE_COLOR | DRW_STATE_ADDITIVE_FULL);
@@ -226,7 +227,7 @@ void EEVEE_depth_of_field_cache_init(EEVEE_ViewLayerData 
*UNUSED(sldata), EEVEE_
DRW_shgroup_uniform_texture_ref(grp, "colorBuffer", 
>source_buffer);
DRW_shgroup_uniform_texture_ref(grp, "depthBuffer", 
>depth);
DRW_shgroup_uniform_vec2(grp, "nearFar", effects->dof_near_far, 
1);
-   DRW_shgroup_uniform_vec3(grp, "dofParams", effects->dof_params, 
1);
+   DRW_shgroup_uniform_vec2(grp, "dofParams", effects->dof_params, 
1);
DRW_shgroup_call_add(grp, quad, NULL);
 
if (use_alpha) {
diff --git a/source/blender/draw/engines/eevee/eevee_private.h 
b/source/blender/draw/engines/eevee/eevee_private.h
index 7ffe7f46811..e0ee689f5df 100644
--- a/source/blender/draw/engines/eevee/eevee_private.h
+++ b/source/blender/draw/engines/eevee/eevee_private.h
@@ -574,7 +574,7 @@ typedef struct EEVEE_EffectsInfo {
struct GPUTexture *velocity_tx; /* Texture from pool */
/* Depth Of Field */
float dof_near_far[2];
-   float dof_params[3];
+   float dof_params[2];
float dof_bokeh[4];
float dof_bokeh_sides[4];
int dof_target_size[2];
diff --git a/source/blender/draw/engines/eevee/shaders/effect_dof_frag.glsl 
b/source/blender/draw/engines/eevee/shaders/effect_dof_frag.glsl
index 6aa771bcbd5..91a4ca99f7e 100644
--- a/source/blender/draw/engines/eevee/shaders/effect_dof_frag.glsl
+++ b/source/blender/draw/engines/eevee/shaders/effect_dof_frag.glsl
@@ -4,11 +4,10 @@ uniform mat4 ProjectionMatrix;
 uniform sampler2D colorBuffer;
 uniform sampler2D depthBuffer;
 
-uniform vec3 dofParams;
+uniform vec2 dofParams;
 
-#define dof_aperturesizedofParams.x
-#define dof_distancedofParams.y
-#define dof_invsensorsize   dofParams.z
+#define dof_muldofParams.x /* distance * aperturesize * invsensorsize */
+#define dof_bias   dofParams.y /* aperturesize * invsensorsize */
 
 uniform vec4 bokehParams[2];
 
@@ -25,7 +24,7 @@ uniform vec2 nearFar; /* Near & far view depths values */
 /* -- Utils - */
 
 /* divide by sensor size to get the normalized size */
-#define calculate_coc(zdepth) (dof_aperturesize * (dof_distance / zdepth - 
1.0) * dof_invsensorsize)
+#define calculate_coc(zdepth) (dof_mul / zdepth - dof_bias)
 
 #define linear_depth(z) ((ProjectionMatrix[3][3] == 0.0) \
? (nearFar.x  * nearFar.y) / 

[Bf-blender-cvs] [86646dab7c4] master: Fix T62621 object scale changes tangent node output in Eevee

2019-03-15 Thread Clément Foucault
Commit: 86646dab7c455e739e5d648d0857bf30fd81afb9
Author: Clément Foucault
Date:   Fri Mar 15 22:28:18 2019 +0100
Branches: master
https://developer.blender.org/rB86646dab7c455e739e5d648d0857bf30fd81afb9

Fix T62621 object scale changes tangent node output in Eevee

Normal Matrices were not normalized, leading to non-normalized vector
rotations results.

===

M   source/blender/draw/engines/eevee/shaders/lit_surface_vert.glsl
M   source/blender/draw/engines/eevee/shaders/shadow_vert.glsl
M   source/blender/draw/intern/draw_manager_exec.c

===

diff --git a/source/blender/draw/engines/eevee/shaders/lit_surface_vert.glsl 
b/source/blender/draw/engines/eevee/shaders/lit_surface_vert.glsl
index ef7213cd21e..5438da1c007 100644
--- a/source/blender/draw/engines/eevee/shaders/lit_surface_vert.glsl
+++ b/source/blender/draw/engines/eevee/shaders/lit_surface_vert.glsl
@@ -66,8 +66,8 @@ void main()
gl_Position = ModelViewProjectionMatrix * vec4(pos, 1.0);
viewPosition = (ModelViewMatrix * vec4(pos, 1.0)).xyz;
worldPosition = (ModelMatrix * vec4(pos, 1.0)).xyz;
-   worldNormal = normalize(WorldNormalMatrix * nor);
-   viewNormal = normalize(NormalMatrix * nor);
+   worldNormal = WorldNormalMatrix * nor;
+   viewNormal = NormalMatrix * nor;
 #endif
 
/* Used for planar reflections */
diff --git a/source/blender/draw/engines/eevee/shaders/shadow_vert.glsl 
b/source/blender/draw/engines/eevee/shaders/shadow_vert.glsl
index 2583c7c8765..a014135742f 100644
--- a/source/blender/draw/engines/eevee/shaders/shadow_vert.glsl
+++ b/source/blender/draw/engines/eevee/shaders/shadow_vert.glsl
@@ -24,8 +24,8 @@ void main() {
 #ifdef MESH_SHADER
viewPosition = (ModelViewMatrix * vec4(pos, 1.0)).xyz;
worldPosition = (ModelMatrix * vec4(pos, 1.0)).xyz;
-   viewNormal = normalize(NormalMatrix * nor);
-   worldNormal = normalize(WorldNormalMatrix * nor);
+   viewNormal = NormalMatrix * nor;
+   worldNormal = WorldNormalMatrix * nor;
 #ifdef USE_ATTR
pass_attr(pos);
 #endif
diff --git a/source/blender/draw/intern/draw_manager_exec.c 
b/source/blender/draw/intern/draw_manager_exec.c
index 2e8ba259a31..8e04b9eddfd 100644
--- a/source/blender/draw/intern/draw_manager_exec.c
+++ b/source/blender/draw/intern/draw_manager_exec.c
@@ -803,6 +803,7 @@ static void draw_matrices_model_prepare(DRWCallState *st)
copy_m3_m4(st->normalview, st->modelview);
invert_m3(st->normalview);
transpose_m3(st->normalview);
+   normalize_m3(st->normalview);
}
if (st->matflag & DRW_CALL_EYEVEC) {
/* Used by orthographic wires */
@@ -821,6 +822,7 @@ static void draw_matrices_model_prepare(DRWCallState *st)
copy_m3_m4(st->normalworld, st->model);
invert_m3(st->normalworld);
transpose_m3(st->normalworld);
+   normalize_m3(st->normalworld);
st->matflag &= ~DRW_CALL_NORMALWORLD;
}
 }

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


[Bf-blender-cvs] [1d6009d7aab] master: Eevee: Fix tangent being renormalized after interpolation

2019-03-15 Thread Clément Foucault
Commit: 1d6009d7aab8a29a084abaee3ed37fac1f3e800c
Author: Clément Foucault
Date:   Fri Mar 15 22:24:46 2019 +0100
Branches: master
https://developer.blender.org/rB1d6009d7aab8a29a084abaee3ed37fac1f3e800c

Eevee: Fix tangent being renormalized after interpolation

===

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 b4f88b3a7bc..377795b7e44 100644
--- a/source/blender/gpu/shaders/gpu_shader_material.glsl
+++ b/source/blender/gpu/shaders/gpu_shader_material.glsl
@@ -2971,9 +2971,8 @@ void node_normal_map(vec4 tangent, vec3 normal, vec3 
texnormal, out vec3 outnorm
outnormal = normal;
return;
}
-   float fsign = (gl_FrontFacing ? 1.0 : -1.0);
-   tangent.xyz = normalize(tangent.xyz) * fsign;
-   vec3 B = tangent.w * cross(normal, tangent.xyz) * fsign;
+   tangent *= (gl_FrontFacing ? 1.0 : -1.0);
+   vec3 B = tangent.w * cross(normal, tangent.xyz);
 
outnormal = texnormal.x * tangent.xyz + texnormal.y * B + texnormal.z * 
normal;
outnormal = normalize(outnormal);

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


[Bf-blender-cvs] [fe40e184a69] master: Fix T61857 Eevee DOF not working if the camera is in orthographic mode

2019-03-15 Thread Clément Foucault
Commit: fe40e184a697c1235a696356b24e8c45dc06185a
Author: Clément Foucault
Date:   Fri Mar 15 22:14:42 2019 +0100
Branches: master
https://developer.blender.org/rBfe40e184a697c1235a696356b24e8c45dc06185a

Fix T61857 Eevee DOF not working if the camera is in orthographic mode

It was just a bad mapping of the ogl depth to scene linear depth.

===

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

===

diff --git a/source/blender/draw/engines/eevee/shaders/effect_dof_frag.glsl 
b/source/blender/draw/engines/eevee/shaders/effect_dof_frag.glsl
index 067b0786e34..6aa771bcbd5 100644
--- a/source/blender/draw/engines/eevee/shaders/effect_dof_frag.glsl
+++ b/source/blender/draw/engines/eevee/shaders/effect_dof_frag.glsl
@@ -29,7 +29,7 @@ uniform vec2 nearFar; /* Near & far view depths values */
 
 #define linear_depth(z) ((ProjectionMatrix[3][3] == 0.0) \
? (nearFar.x  * nearFar.y) / (z * (nearFar.x - nearFar.y) + 
nearFar.y) \
-   : (z * 2.0 - 1.0) * nearFar.y)
+   : z * (nearFar.y - nearFar.x) + nearFar.x) /* Only true for 
camera view! */
 
 #define weighted_sum(a, b, c, d, e) (a * e.x + b * e.y + c * e.z + d * e.w) / 
max(1e-6, dot(e, vec4(1.0)));

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


[Bf-blender-cvs] [aaa35d10924] master: Silence warning from recent GPU simplify commit

2019-03-15 Thread Dalai Felinto
Commit: aaa35d10924c9a6258ecb916f8b7c819041a8085
Author: Dalai Felinto
Date:   Fri Mar 15 18:14:24 2019 -0300
Branches: master
https://developer.blender.org/rBaaa35d10924c9a6258ecb916f8b7c819041a8085

Silence warning from recent GPU simplify commit

Said commit introduced warnings and build problens. Let's be more
careful in the future. Warnings are not to be treated lightly either.

===

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

===

diff --git a/source/blender/editors/space_view3d/view3d_draw_legacy.c 
b/source/blender/editors/space_view3d/view3d_draw_legacy.c
index 1f13f308005..4660220fe27 100644
--- a/source/blender/editors/space_view3d/view3d_draw_legacy.c
+++ b/source/blender/editors/space_view3d/view3d_draw_legacy.c
@@ -346,7 +346,7 @@ uint *ED_view3d_select_id_read(
 
 /* smart function to sample a rect spiralling outside, nice for backbuf 
selection */
 uint ED_view3d_select_id_read_nearest(
-struct ViewContext *vc, const int mval[2],
+struct ViewContext *UNUSED(vc), const int mval[2],
 const uint min, const uint max, uint *r_dist)
 {
uint index = 0;

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


[Bf-blender-cvs] [ddd28bad90b] master: Fix compiling after last commit

2019-03-15 Thread Jens Verwiebe
Commit: ddd28bad90bdcb06ab5a351e416e3d5c6209fa61
Author: Jens Verwiebe
Date:   Fri Mar 15 22:07:09 2019 +0100
Branches: master
https://developer.blender.org/rBddd28bad90bdcb06ab5a351e416e3d5c6209fa61

Fix compiling after last commit

===

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

===

diff --git a/source/blender/editors/space_view3d/view3d_draw_legacy.c 
b/source/blender/editors/space_view3d/view3d_draw_legacy.c
index eed6fc31235..1f13f308005 100644
--- a/source/blender/editors/space_view3d/view3d_draw_legacy.c
+++ b/source/blender/editors/space_view3d/view3d_draw_legacy.c
@@ -267,7 +267,7 @@ void ED_view3d_backbuf_depth_validate(ViewContext *vc)
draw_object_depth(rv3d, obact_eval);
 
if (rv3d->rflag & RV3D_CLIPPING) {
-   ED_view3d_clipping_disable(rv3d);
+   ED_view3d_clipping_disable();
}
 
GPU_depth_test(false);

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


[Bf-blender-cvs] [681661dbed1] master: GPU: Simplify select shaders.

2019-03-15 Thread mano-wii
Commit: 681661dbed121c7b81e9129c57df5eadb03c1009
Author: mano-wii
Date:   Fri Mar 15 16:02:55 2019 -0300
Branches: master
https://developer.blender.org/rB681661dbed121c7b81e9129c57df5eadb03c1009

GPU: Simplify select shaders.

The shaders are: `GPU_SHADER_3D_FLAT_SELECT_ID` and 
`GPU_SHADER_3D_UNIFORM_SELECT_ID`.
This commit allows the drawing of the mesh select ids to be done on a 32UI 
format texture.
This simplifies the shader that previously acted on the backbuffer and had to 
do an uint to rgba conversion.

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

===

M   source/blender/blenloader/intern/readfile.c
M   source/blender/draw/DRW_engine.h
M   source/blender/draw/intern/draw_manager.c
M   source/blender/editors/include/ED_mesh.h
M   source/blender/editors/include/ED_view3d.h
M   source/blender/editors/mesh/editface.c
M   source/blender/editors/mesh/editmesh_select.c
M   source/blender/editors/mesh/meshtools.c
M   source/blender/editors/physics/particle_edit.c
M   source/blender/editors/sculpt_paint/paint_utils.c
M   source/blender/editors/sculpt_paint/paint_vertex_weight_ops.c
M   source/blender/editors/space_view3d/drawobject.c
M   source/blender/editors/space_view3d/space_view3d.c
M   source/blender/editors/space_view3d/view3d_draw_legacy.c
M   source/blender/editors/space_view3d/view3d_intern.h
M   source/blender/editors/space_view3d/view3d_select.c
M   source/blender/gpu/GPU_draw.h
M   source/blender/gpu/GPU_extensions.h
M   source/blender/gpu/intern/gpu_draw.c
M   source/blender/gpu/intern/gpu_extensions.c
M   source/blender/gpu/shaders/gpu_shader_3D_selection_id_vert.glsl
M   source/blender/gpu/shaders/gpu_shader_selection_id_frag.glsl
M   source/blender/makesdna/DNA_view3d_types.h

===

diff --git a/source/blender/blenloader/intern/readfile.c 
b/source/blender/blenloader/intern/readfile.c
index 655b1772130..e9bd8821d30 100644
--- a/source/blender/blenloader/intern/readfile.c
+++ b/source/blender/blenloader/intern/readfile.c
@@ -7085,7 +7085,6 @@ static void direct_link_region(FileData *fd, ARegion *ar, 
int spacetype)
rv3d->clipbb = newdataadr(fd, rv3d->clipbb);
 
rv3d->depths = NULL;
-   rv3d->gpuoffscreen = NULL;
rv3d->render_engine = NULL;
rv3d->sms = NULL;
rv3d->smooth_timer = NULL;
diff --git a/source/blender/draw/DRW_engine.h b/source/blender/draw/DRW_engine.h
index e261de3c900..68d4ef04f95 100644
--- a/source/blender/draw/DRW_engine.h
+++ b/source/blender/draw/DRW_engine.h
@@ -123,6 +123,10 @@ void DRW_draw_depth_loop(
 struct Depsgraph *depsgraph,
 struct ARegion *ar, struct View3D *v3d);
 
+void DRW_framebuffer_select_id_setup(struct ARegion *ar, const bool clear);
+void DRW_framebuffer_select_id_release(struct ARegion *ar);
+void DRW_framebuffer_select_id_read(const struct rcti *rect, uint *r_buf);
+
 /* grease pencil render */
 bool DRW_render_check_grease_pencil(struct Depsgraph *depsgraph);
 void DRW_render_gpencil(struct RenderEngine *engine, struct Depsgraph 
*depsgraph);
diff --git a/source/blender/draw/intern/draw_manager.c 
b/source/blender/draw/intern/draw_manager.c
index a34d2532bb5..fb30e4391e7 100644
--- a/source/blender/draw/intern/draw_manager.c
+++ b/source/blender/draw/intern/draw_manager.c
@@ -2015,20 +2015,26 @@ void DRW_custom_pipeline(
 }
 
 static struct DRWSelectBuffer {
-   struct GPUFrameBuffer *framebuffer;
+   struct GPUFrameBuffer *framebuffer_depth_only;
+   struct GPUFrameBuffer *framebuffer_select_id;
struct GPUTexture *texture_depth;
+   struct GPUTexture *texture_u32;
 } g_select_buffer = {NULL};
 
-static void draw_select_framebuffer_setup(const rcti *rect)
+static void draw_select_framebuffer_depth_only_setup(const rcti *rect)
 {
-   if (g_select_buffer.framebuffer == NULL) {
-   g_select_buffer.framebuffer = GPU_framebuffer_create();
+   float size[2];
+   size[0] = BLI_rcti_size_x(rect);
+   size[1] = BLI_rcti_size_y(rect);
+
+   if (g_select_buffer.framebuffer_depth_only == NULL) {
+   g_select_buffer.framebuffer_depth_only = 
GPU_framebuffer_create();
+   g_select_buffer.framebuffer_select_id = 
GPU_framebuffer_create();
}
 
-   /* If size mismatch recreate the texture. */
if ((g_select_buffer.texture_depth != NULL) &&
-   ((GPU_texture_width(g_select_buffer.texture_depth) != 
BLI_rcti_size_x(rect)) ||
-(GPU_texture_height(g_select_buffer.texture_depth) != 
BLI_rcti_size_y(rect
+   ((GPU_texture_width(g_select_buffer.texture_depth) != size[0]) ||
+

[Bf-blender-cvs] [4510f88d00a] master: Remove object hide_* operators from outliner keymap

2019-03-15 Thread Dalai Felinto
Commit: 4510f88d00a721a3d4ad3aa675050723eec2292c
Author: Dalai Felinto
Date:   Fri Mar 15 16:19:35 2019 -0300
Branches: master
https://developer.blender.org/rB4510f88d00a721a3d4ad3aa675050723eec2292c

Remove object hide_* operators from outliner keymap

We already have dedicated outliner visibility operators that not only
take precedent over those ones, but also unhide collections as well.

No change for the end user. That said, since I added the outliner
hide/unhide operators I assumed that newly visible objects are to be
selected. That can change in a separate commit, but it should be done
by changing OUTLINER_OT_unhide_all.

Reviewers: brecht

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

===

M   release/scripts/presets/keyconfig/keymap_data/blender_default.py

===

diff --git a/release/scripts/presets/keyconfig/keymap_data/blender_default.py 
b/release/scripts/presets/keyconfig/keymap_data/blender_default.py
index 596c1d2afb0..f9455639b86 100644
--- a/release/scripts/presets/keyconfig/keymap_data/blender_default.py
+++ b/release/scripts/presets/keyconfig/keymap_data/blender_default.py
@@ -698,12 +698,6 @@ def km_outliner(params):
 ("outliner.collection_exclude_clear", {"type": 'E', "value": 'PRESS', 
"alt": True}, None),
 ("outliner.hide", {"type": 'H', "value": 'PRESS'}, None),
 ("outliner.unhide_all", {"type": 'H', "value": 'PRESS', "alt": True}, 
None),
-("object.hide_view_clear", {"type": 'H', "value": 'PRESS', "alt": 
True},
- {"properties": [("select", False)]}),
-("object.hide_view_set", {"type": 'H', "value": 'PRESS'},
- {"properties": [("unselected", False)]}),
-("object.hide_view_set", {"type": 'H', "value": 'PRESS', "shift": 
True},
- {"properties": [("unselected", True)]}),
 ])
 
 return keymap

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


[Bf-blender-cvs] [b7d942446f8] master: Fix T62438: Unhide all doesn't set newly visible objects to selected

2019-03-15 Thread Dalai Felinto
Commit: b7d942446f8abbe98830fa8bb0e4e9d3bf22a4d8
Author: Dalai Felinto
Date:   Fri Mar 15 16:14:21 2019 -0300
Branches: master
https://developer.blender.org/rBb7d942446f8abbe98830fa8bb0e4e9d3bf22a4d8

Fix T62438: Unhide all doesn't set newly visible objects to selected

The select option in the operator was never working because we were
trying to select an object considered unselectable (since it was hidden).

Reviewers: brecht

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

===

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

===

diff --git a/source/blender/editors/object/object_edit.c 
b/source/blender/editors/object/object_edit.c
index 977f5f30d94..1964cd53cc7 100644
--- a/source/blender/editors/object/object_edit.c
+++ b/source/blender/editors/object/object_edit.c
@@ -77,6 +77,7 @@
 #include "BKE_softbody.h"
 #include "BKE_editmesh.h"
 #include "BKE_report.h"
+#include "BKE_scene.h"
 #include "BKE_workspace.h"
 
 #include "DEG_depsgraph.h"
@@ -162,7 +163,10 @@ static int object_hide_view_clear_exec(bContext *C, 
wmOperator *op)
changed = true;
 
if (select) {
-   ED_object_base_select(base, BA_SELECT);
+   /* We cannot call `ED_object_base_select` 
because
+* base is not selectable while it is hidden. */
+   base->flag |= BASE_SELECTED;
+   BKE_scene_object_base_flag_sync_from_base(base);
}
}
}

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


[Bf-blender-cvs] [713010bd779] master: Fix T62313 - No way to remove object from master collection in 3d view

2019-03-15 Thread Dalai Felinto
Commit: 713010bd7795c539c1c18afc3df9f25ab8ba6c12
Author: Dalai Felinto
Date:   Tue Mar 12 19:55:33 2019 -0300
Branches: master
https://developer.blender.org/rB713010bd7795c539c1c18afc3df9f25ab8ba6c12

Fix T62313 - No way to remove object from master collection in 3d view

This introduces a new iterator, FOREACH_COLLECTION, that unlike the
FOREACH_SCENE_COLLECTION it iterates over all the Blender file
collections, including the scene master collection, as well the database
ones (bmain).

Reviewers: brecht

===

M   source/blender/blenkernel/BKE_collection.h
M   source/blender/blenkernel/BKE_object.h
M   source/blender/blenkernel/intern/collection.c
M   source/blender/blenkernel/intern/object.c
M   source/blender/editors/object/object_collection.c
M   source/blender/editors/object/object_relations.c

===

diff --git a/source/blender/blenkernel/BKE_collection.h 
b/source/blender/blenkernel/BKE_collection.h
index a4b68a8cba2..f46405dceab 100644
--- a/source/blender/blenkernel/BKE_collection.h
+++ b/source/blender/blenkernel/BKE_collection.h
@@ -72,7 +72,7 @@ struct Scene *BKE_collection_master_scene_search(const struct 
Main *bmain, const
 
 bool   BKE_collection_has_object(struct Collection *collection, 
struct Object *ob);
 bool   BKE_collection_has_object_recursive(struct Collection 
*collection, struct Object *ob);
-struct Collection *BKE_collection_object_find(struct Main *bmain, struct 
Collection *collection, struct Object *ob);
+struct Collection *BKE_collection_object_find(struct Main *bmain, struct Scene 
*scene, struct Collection *collection, struct Object *ob);
 bool   BKE_collection_is_empty(struct Collection *collection);
 
 bool BKE_collection_object_add(struct Main *bmain, struct Collection 
*collection, struct Object *ob);
@@ -179,6 +179,32 @@ void BKE_scene_objects_iterator_end(struct BLI_Iterator 
*iter);
 #define FOREACH_SCENE_COLLECTION_END  \
ITER_END
 
+#define FOREACH_COLLECTION_BEGIN(_bmain, _scene, Type, _instance) \
+{ \
+   Type _instance; 
  \
+   Collection *_instance_next; 
  \
+   bool is_scene_collection = (_scene) != NULL;
  \
+  \
+   if (_scene) {   
  \
+   _instance_next = BKE_collection_master(_scene); 
  \
+   }   
  \
+   else {  
  \
+   _instance_next = (_bmain)->collections.first;   
  \
+   }   
  \
+  \
+   while ((_instance = _instance_next)) {  
  \
+   if (is_scene_collection) {  
  \
+   _instance_next = (_bmain)->collections.first;   
  \
+   is_scene_collection = false;
  \
+   }   
  \
+   else {  
  \
+   _instance_next = _instance->id.next;
  \
+   }
+
+#define FOREACH_COLLECTION_END\
+   }   
  \
+}
+
 #define FOREACH_SCENE_OBJECT_BEGIN(scene, _instance)  \
ITER_BEGIN(BKE_scene_objects_iterator_begin,
  \
   BKE_scene_objects_iterator_next, 
  \
diff --git a/source/blender/blenkernel/BKE_object.h 
b/source/blender/blenkernel/BKE_object.h
index 9cd98232375..9e6366f9992 100644
--- a/source/blender/blenkernel/BKE_object.h
+++ b/source/blender/blenkernel/BKE_object.h
@@ -336,8 +336,8 @@ typedef enum eObjectSet {
 
 struct LinkNode *BKE_object_relational_superset(
 struct ViewLayer *view_layer, eObjectSet objectSet, eObRelationTypes 
includeFilter);
-struct LinkNode *BKE_object_groups(struct Main *bmain, struct Object *ob);
-void BKE_object_groups_clear(struct Main *bmain, struct Object 
*object);
+struct LinkNode *BKE_object_groups(struct Main *bmain, struct Scene *scene, 
struct Object *ob);
+void

[Bf-blender-cvs] [c2fa4d18a02] greasepencil-object: GPencil: Fix compiler warning

2019-03-15 Thread Antonioya
Commit: c2fa4d18a025851c9e4006c0989d24bc34f1300c
Author: Antonioya
Date:   Fri Mar 15 19:44:41 2019 +0100
Branches: greasepencil-object
https://developer.blender.org/rBc2fa4d18a025851c9e4006c0989d24bc34f1300c

GPencil: Fix compiler warning

===

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

===

diff --git a/source/blender/editors/gpencil/gpencil_brush.c 
b/source/blender/editors/gpencil/gpencil_brush.c
index af7fc804d80..2df0edd3bf7 100644
--- a/source/blender/editors/gpencil/gpencil_brush.c
+++ b/source/blender/editors/gpencil/gpencil_brush.c
@@ -202,7 +202,7 @@ static void gpsculpt_compute_lock_axis(tGP_BrushEditData 
*gso, bGPDspoint *pt, c
/* compute a plane with cursor normal and position of 
the point
   before do the sculpt */
const float scale[3] = { 1.0f, 1.0f, 1.0f };
-   const float plane_normal[3] = { 0.0f, 0.0f, 1.0f };
+   float plane_normal[3] = { 0.0f, 0.0f, 1.0f };
float plane[4];
float mat[4][4];
float r_close[3];

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


[Bf-blender-cvs] [52a7636c292] blender2.7: Tests: remove unnecessary _test postfix on test names.

2019-03-15 Thread Brecht Van Lommel
Commit: 52a7636c2921c8a165a783c00821692b0c84fd46
Author: Brecht Van Lommel
Date:   Fri Mar 15 19:11:33 2019 +0100
Branches: blender2.7
https://developer.blender.org/rB52a7636c2921c8a165a783c00821692b0c84fd46

Tests: remove unnecessary _test postfix on test names.

===

M   tests/python/CMakeLists.txt

===

diff --git a/tests/python/CMakeLists.txt b/tests/python/CMakeLists.txt
index 23d32821c5b..d34c9f70f82 100644
--- a/tests/python/CMakeLists.txt
+++ b/tests/python/CMakeLists.txt
@@ -535,7 +535,7 @@ if(WITH_CYCLES)
if(OPENIMAGEIO_IDIFF AND EXISTS "${TEST_SRC_DIR}/render/ctests/shader")
macro(add_cycles_render_test subject)
add_python_test(
-   cycles_${subject}_test
+   cycles_${subject}
${CMAKE_CURRENT_LIST_DIR}/cycles_render_tests.py
-blender "$"
-testdir 
"${TEST_SRC_DIR}/render/ctests/${subject}"
@@ -581,7 +581,7 @@ if(WITH_OPENGL_DRAW_TESTS)
file(GLOB_RECURSE blends 
"${child_path}/*.blend")
if(blends)
add_python_test(
-   opengl_draw_${child}_test
+   opengl_draw_${child}

${CMAKE_CURRENT_LIST_DIR}/opengl_draw_tests.py
-blender 
"$"
-testdir "${child_path}"
@@ -625,7 +625,7 @@ endif()
 
 if(WITH_CODEC_FFMPEG)
add_python_test(
-   ffmpeg_tests
+   ffmpeg
${CMAKE_CURRENT_LIST_DIR}/ffmpeg_tests.py
--blender "$"
--testdir "${TEST_DATA_SRC_DIR}/ffmpeg"

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


[Bf-blender-cvs] [fcffbe1d1b3] master: Fix T62320: Outliner collection disable not propagating to other view layers

2019-03-15 Thread Dalai Felinto
Commit: fcffbe1d1b31ed518b7a710c09d5fda389d8182e
Author: Dalai Felinto
Date:   Fri Mar 15 15:35:17 2019 -0300
Branches: master
https://developer.blender.org/rBfcffbe1d1b31ed518b7a710c09d5fda389d8182e

Fix T62320: Outliner collection disable not propagating to other view layers

The moment you switched to another view layer the visibility was still
outdated.

===

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

===

diff --git a/source/blender/editors/space_outliner/outliner_draw.c 
b/source/blender/editors/space_outliner/outliner_draw.c
index 044ab8f1b7b..929c179a62f 100644
--- a/source/blender/editors/space_outliner/outliner_draw.c
+++ b/source/blender/editors/space_outliner/outliner_draw.c
@@ -355,6 +355,7 @@ static int layer_collection_pushed_state_cb(bContext 
*UNUSED(C), void *poin)
 
 static void hidebutton_layer_collection_flag_cb(bContext *C, void *poin, void 
*poin2)
 {
+   Main *bmain = CTX_data_main(C);
wmWindow *win = CTX_wm_window(C);
Scene *scene = CTX_data_scene(C);
ViewLayer *view_layer = poin;
@@ -384,7 +385,8 @@ static void hidebutton_layer_collection_flag_cb(bContext 
*C, void *poin, void *p
DEG_id_tag_update(>id, ID_RECALC_BASE_FLAGS);
 
if (depsgraph_changed) {
-   DEG_relations_tag_update(CTX_data_main(C));
+   BKE_main_collection_sync_remap(bmain);
+   DEG_relations_tag_update(bmain);
}
WM_main_add_notifier(NC_SCENE | ND_LAYER_CONTENT, NULL);
 }

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


[Bf-blender-cvs] [3632e925c23] greasepencil-object: GPencil: Use the cursor lock in Sculpt mode

2019-03-15 Thread Antonioya
Commit: 3632e925c233c7a27d5dd6fd6282ddfdc87d156d
Author: Antonioya
Date:   Fri Mar 15 19:36:34 2019 +0100
Branches: greasepencil-object
https://developer.blender.org/rB3632e925c233c7a27d5dd6fd6282ddfdc87d156d

GPencil: Use the cursor lock in Sculpt mode

The point is locked to a plane with the last point and the normal of the cursor 
orientation.

The moved point is projected over the cursor/point plane and the closet point 
is used as result of the sculpt operation.

===

M   source/blender/draw/engines/gpencil/gpencil_engine.c
M   source/blender/editors/gpencil/gpencil_brush.c

===

diff --git a/source/blender/draw/engines/gpencil/gpencil_engine.c 
b/source/blender/draw/engines/gpencil/gpencil_engine.c
index c119e917253..d67cca415fc 100644
--- a/source/blender/draw/engines/gpencil/gpencil_engine.c
+++ b/source/blender/draw/engines/gpencil/gpencil_engine.c
@@ -663,7 +663,9 @@ void GPENCIL_cache_populate(void *vedata, Object *ob)
}
 
/* now move the origin to Object or Cursor */
-   if (ts->gpencil_v3d_align & GP_PROJECT_CURSOR) {
+   if ((ob->mode == OB_MODE_PAINT_GPENCIL) &&
+   (ts->gpencil_v3d_align & GP_PROJECT_CURSOR))
+   {
copy_v3_v3(stl->storage->grid_matrix[3], 
cursor->location);
}
else {
diff --git a/source/blender/editors/gpencil/gpencil_brush.c 
b/source/blender/editors/gpencil/gpencil_brush.c
index 0403a42a2c9..af7fc804d80 100644
--- a/source/blender/editors/gpencil/gpencil_brush.c
+++ b/source/blender/editors/gpencil/gpencil_brush.c
@@ -176,18 +176,54 @@ static void gpsculpt_compute_lock_axis(tGP_BrushEditData 
*gso, bGPDspoint *pt, c
return;
}
 
-   ToolSettings *ts = gso->scene->toolsettings;
-   int axis = ts->gp_sculpt.lock_axis;
+   const ToolSettings *ts = gso->scene->toolsettings;
+   const View3DCursor *cursor = >scene->cursor;
+   const int axis = ts->gp_sculpt.lock_axis;
 
/* lock axis control */
-   if (axis == 1) {
-   pt->x = save_pt[0];
-   }
-   if (axis == 2) {
-   pt->y = save_pt[1];
-   }
-   if (axis == 3) {
-   pt->z = save_pt[2];
+   switch (axis) {
+   case GP_LOCKAXIS_X:
+   {
+   pt->x = save_pt[0];
+   break;
+   }
+   case GP_LOCKAXIS_Y:
+   {
+   pt->y = save_pt[1];
+   break;
+   }
+   case GP_LOCKAXIS_Z:
+   {
+   pt->z = save_pt[2];
+   break;
+   }
+   case GP_LOCKAXIS_CURSOR:
+   {
+   /* compute a plane with cursor normal and position of 
the point
+  before do the sculpt */
+   const float scale[3] = { 1.0f, 1.0f, 1.0f };
+   const float plane_normal[3] = { 0.0f, 0.0f, 1.0f };
+   float plane[4];
+   float mat[4][4];
+   float r_close[3];
+   
+   loc_eul_size_to_mat4(mat,
+   cursor->location,
+   cursor->rotation_euler,
+   scale);
+
+   mul_mat3_m4_v3(mat, plane_normal);
+   plane_from_point_normal_v3(plane, save_pt, 
plane_normal);
+
+   /* find closest point to the plane with the new 
position */
+   closest_to_plane_v3(r_close, plane, >x);
+   copy_v3_v3(>x, r_close);
+   break;
+   }
+   default:
+   {
+   break;
+   }
}
 }

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


[Bf-blender-cvs] [fb4bb611559] master: Fix T62608: many tools in the toolbar not working.

2019-03-15 Thread Brecht Van Lommel
Commit: fb4bb611559bdb9d7f7b5206a812965c9223c0a9
Author: Brecht Van Lommel
Date:   Fri Mar 15 19:29:20 2019 +0100
Branches: master
https://developer.blender.org/rBfb4bb611559bdb9d7f7b5206a812965c9223c0a9

Fix T62608: many tools in the toolbar not working.

The keymap names still use the label, so use that again for looking up the
keymap so things work again after recent changes.

===

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

===

diff --git a/release/scripts/startup/bl_ui/space_toolsystem_common.py 
b/release/scripts/startup/bl_ui/space_toolsystem_common.py
index e893ee89e52..4e3cecf2631 100644
--- a/release/scripts/startup/bl_ui/space_toolsystem_common.py
+++ b/release/scripts/startup/bl_ui/space_toolsystem_common.py
@@ -309,8 +309,8 @@ class ToolSelectPanelHelper:
 return context.button_operator.name
 
 @classmethod
-def _km_action_simple(cls, kc, context_descr, idname, keymap_fn):
-km_idname = f"{cls.keymap_prefix:s} {context_descr:s}, {idname:s}"
+def _km_action_simple(cls, kc, context_descr, label, keymap_fn):
+km_idname = f"{cls.keymap_prefix:s} {context_descr:s}, {label:s}"
 km = kc.keymaps.get(km_idname)
 if km is None:
 km = kc.keymaps.new(km_idname, space_type=cls.bl_space_type, 
region_type='WINDOW', tool=True)
@@ -355,7 +355,7 @@ class ToolSelectPanelHelper:
 for item in cls._tools_flatten_with_keymap(tools):
 keymap_data = item.keymap
 if callable(keymap_data[0]):
-cls._km_action_simple(kc, context_descr, item.idname, 
keymap_data)
+cls._km_action_simple(kc, context_descr, item.label, 
keymap_data)
 
 @classmethod
 def keymap_ui_hierarchy(cls, context_mode):

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


[Bf-blender-cvs] [99fe7742987] master: Fix T59943 Color banding present in Workbench render but not in viewport

2019-03-15 Thread Clément Foucault
Commit: 99fe7742987202035031727d9cd181d574d7e810
Author: Clément Foucault
Date:   Fri Mar 15 19:27:54 2019 +0100
Branches: master
https://developer.blender.org/rB99fe7742987202035031727d9cd181d574d7e810

Fix T59943 Color banding present in Workbench render but not in viewport

I don't really like forcing RGBA16F for Albedo render but that's ok since
the texture is shared with the effect_fb.

===

M   source/blender/draw/engines/workbench/workbench_deferred.c
M   source/blender/draw/engines/workbench/workbench_render.c

===

diff --git a/source/blender/draw/engines/workbench/workbench_deferred.c 
b/source/blender/draw/engines/workbench/workbench_deferred.c
index 7baea8b9e39..fb8a3b47c54 100644
--- a/source/blender/draw/engines/workbench/workbench_deferred.c
+++ b/source/blender/draw/engines/workbench/workbench_deferred.c
@@ -445,6 +445,7 @@ void workbench_deferred_engine_init(WORKBENCH_Data *vedata)
const int size[2] = {(int)viewport_size[0], 
(int)viewport_size[1]};
const eGPUTextureFormat nor_tex_format = 
NORMAL_ENCODING_ENABLED() ? GPU_RG16 : GPU_RGBA32F;
const eGPUTextureFormat comp_tex_format = 
DRW_state_is_image_render() ? GPU_RGBA16F : GPU_R11F_G11F_B10F;
+   const eGPUTextureFormat col_tex_format = 
DRW_state_is_image_render() ? GPU_RGBA16F : GPU_RGBA8;
const eGPUTextureFormat id_tex_format = 
OBJECT_ID_PASS_ENABLED(wpd) ? GPU_R32UI : GPU_R8;
 
e_data.object_id_tx = NULL;
@@ -456,7 +457,7 @@ void workbench_deferred_engine_init(WORKBENCH_Data *vedata)
e_data.composite_buffer_tx = DRW_texture_pool_query_2D(size[0], 
size[1], comp_tex_format, _engine_workbench_solid);
 
if (MATDATA_PASS_ENABLED(wpd) || 
GPU_unused_fb_slot_workaround()) {
-   e_data.color_buffer_tx = 
DRW_texture_pool_query_2D(size[0], size[1], GPU_RGBA8, 
_engine_workbench_solid);
+   e_data.color_buffer_tx = 
DRW_texture_pool_query_2D(size[0], size[1], col_tex_format, 
_engine_workbench_solid);
}
if (OBJECT_ID_PASS_ENABLED(wpd) || 
GPU_unused_fb_slot_workaround()) {
e_data.object_id_tx = 
DRW_texture_pool_query_2D(size[0], size[1], id_tex_format, 
_engine_workbench_solid);
@@ -488,7 +489,7 @@ void workbench_deferred_engine_init(WORKBENCH_Data *vedata)
});
 
if (!MATDATA_PASS_ENABLED(wpd) && 
!GPU_unused_fb_slot_workaround()) {
-   e_data.color_buffer_tx = 
DRW_texture_pool_query_2D(size[0], size[1], GPU_RGBA8, 
_engine_workbench_solid);
+   e_data.color_buffer_tx = 
DRW_texture_pool_query_2D(size[0], size[1], col_tex_format, 
_engine_workbench_solid);
}
 
GPU_framebuffer_ensure_config(>effect_fb, {
diff --git a/source/blender/draw/engines/workbench/workbench_render.c 
b/source/blender/draw/engines/workbench/workbench_render.c
index 528b4b6b815..423134f5d6c 100644
--- a/source/blender/draw/engines/workbench/workbench_render.c
+++ b/source/blender/draw/engines/workbench/workbench_render.c
@@ -86,7 +86,7 @@ static bool workbench_render_framebuffers_init(void)
const int size[2] = {(int)viewport_size[0], (int)viewport_size[1]};
 
DefaultTextureList *dtxl = DRW_viewport_texture_list_get();
-   dtxl->color = GPU_texture_create_2D(size[0], size[1], GPU_RGBA8, NULL, 
NULL);
+   dtxl->color = GPU_texture_create_2D(size[0], size[1], GPU_RGBA16F, 
NULL, NULL);
dtxl->depth = GPU_texture_create_2D(size[0], size[1], 
GPU_DEPTH24_STENCIL8, NULL, NULL);
 
if (!(dtxl->depth && dtxl->color)) {

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


[Bf-blender-cvs] [9ad9d38786c] master: Fix T62601: parenting to curve (follow path) causes offset

2019-03-15 Thread Philipp Oeser
Commit: 9ad9d38786c5d9f3e7f288f2e8255f3e7722da1f
Author: Philipp Oeser
Date:   Fri Mar 15 16:15:37 2019 +0100
Branches: master
https://developer.blender.org/rB9ad9d38786c5d9f3e7f288f2e8255f3e7722da1f

Fix T62601: parenting to curve (follow path) causes offset

Similar to T60623 / rB2894e75121d7.
Issue (when parenting with 'Follow Curve') is that the curves
CU_FOLLOW flag is set on the original, but not the
evaluated curve (yet), leading to misbehaviour in 'ob_parcurve()'.
Setting this on both now.

Reviewers: sergey

Maniphest Tasks: T62601

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

===

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

===

diff --git a/source/blender/editors/object/object_relations.c 
b/source/blender/editors/object/object_relations.c
index dbd90628136..95d1ddea7f3 100644
--- a/source/blender/editors/object/object_relations.c
+++ b/source/blender/editors/object/object_relations.c
@@ -628,14 +628,16 @@ bool ED_object_parent_set(ReportList *reports, const 
bContext *C, Scene *scene,
return 0;
else {
Curve *cu = par->data;
-
+   Curve *cu_eval = parent_eval->data;
if ((cu->flag & CU_PATH) == 0) {
cu->flag |= CU_PATH | CU_FOLLOW;
+   cu_eval->flag |= CU_PATH | CU_FOLLOW;
/* force creation of path data */
BKE_displist_make_curveTypes(depsgraph, scene, 
par, false, false, NULL);
}
else {
cu->flag |= CU_FOLLOW;
+   cu_eval->flag |= CU_FOLLOW;
}
 
/* if follow, add F-Curve for ctime (i.e. "eval_time") 
so that path-follow works */

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


[Bf-blender-cvs] [bc8bd87dfff] master: Merge branch 'blender2.7'

2019-03-15 Thread Brecht Van Lommel
Commit: bc8bd87dfffe44cd5b9053800f086704ff880f6a
Author: Brecht Van Lommel
Date:   Fri Mar 15 18:31:48 2019 +0100
Branches: master
https://developer.blender.org/rBbc8bd87dfffe44cd5b9053800f086704ff880f6a

Merge branch 'blender2.7'

===



===

diff --cc build_files/cmake/config/blender_release.cmake
index 74417ea3151,adffea0b99d..5c19aaa5ad4
--- a/build_files/cmake/config/blender_release.cmake
+++ b/build_files/cmake/config/blender_release.cmake
@@@ -50,8 -51,10 +50,9 @@@ set(WITH_SDL ON  CACHE 
  set(WITH_X11_XINPUT  ON  CACHE BOOL "" FORCE)
  set(WITH_X11_XF86VMODE   ON  CACHE BOOL "" FORCE)
  
- set(WITH_MEM_JEMALLOCON  CACHE BOOL "" FORCE)
- set(WITH_CYCLES_CUDA_BINARIES ON  CACHE BOOL "" FORCE)
 -set(WITH_PLAYERON  CACHE BOOL "" FORCE)
+ set(WITH_MEM_JEMALLOC  ON  CACHE BOOL "" FORCE)
+ set(WITH_CYCLES_CUDA_BINARIES  ON  CACHE BOOL "" FORCE)
+ set(WITH_CYCLES_CUBIN_COMPILER OFF CACHE BOOL "" FORCE)
  set(CYCLES_CUDA_BINARIES_ARCH 
sm_30;sm_35;sm_37;sm_50;sm_52;sm_60;sm_61;sm_70;sm_75 CACHE STRING "" FORCE)
  
  # platform dependent options

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


[Bf-blender-cvs] [d4982f19116] greasepencil-object: GPencil: Canvas grid must be invisible for Stroke and Surface modes

2019-03-15 Thread Antonioya
Commit: d4982f19116a7f57345342d221240b0ec4a585f5
Author: Antonioya
Date:   Fri Mar 15 17:24:49 2019 +0100
Branches: greasepencil-object
https://developer.blender.org/rBd4982f19116a7f57345342d221240b0ec4a585f5

GPencil: Canvas grid must be invisible for Stroke and Surface modes

In these modes, the grid is not used, so it's not logic show somthing that is 
not used.

===

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

===

diff --git a/source/blender/draw/engines/gpencil/gpencil_engine.c 
b/source/blender/draw/engines/gpencil/gpencil_engine.c
index d5ede897467..c119e917253 100644
--- a/source/blender/draw/engines/gpencil/gpencil_engine.c
+++ b/source/blender/draw/engines/gpencil/gpencil_engine.c
@@ -627,7 +627,9 @@ void GPENCIL_cache_populate(void *vedata, Object *ob)
if ((v3d) &&
((v3d->flag2 & V3D_HIDE_OVERLAYS) == 0) &&
(v3d->gp_flag & V3D_GP_SHOW_GRID) &&
-   (ob->type == OB_GPENCIL) && (ob == draw_ctx->obact))
+   (ob->type == OB_GPENCIL) && (ob == draw_ctx->obact) &&
+   ((ts->gpencil_v3d_align & GP_PROJECT_DEPTH_VIEW) == 0) 
&&
+   ((ts->gpencil_v3d_align & GP_PROJECT_DEPTH_STROKE) == 
0))
{
GPU_BATCH_DISCARD_SAFE(e_data.batch_grid);
MEM_SAFE_FREE(e_data.batch_grid);

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


[Bf-blender-cvs] [0402db47b18] greasepencil-object: GPencil: Change cursor orientation Tooltip

2019-03-15 Thread Antonioya
Commit: 0402db47b1850c32339eac87aa5c6401f7fdde6c
Author: Antonioya
Date:   Fri Mar 15 17:08:14 2019 +0100
Branches: greasepencil-object
https://developer.blender.org/rB0402db47b1850c32339eac87aa5c6401f7fdde6c

GPencil: Change cursor orientation Tooltip

===

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

===

diff --git a/source/blender/makesrna/intern/rna_sculpt_paint.c 
b/source/blender/makesrna/intern/rna_sculpt_paint.c
index ebcfb37a4fa..b66363f45ae 100644
--- a/source/blender/makesrna/intern/rna_sculpt_paint.c
+++ b/source/blender/makesrna/intern/rna_sculpt_paint.c
@@ -82,7 +82,7 @@ static const EnumPropertyItem 
rna_enum_gpencil_lock_axis_items[] = {
{GP_LOCKAXIS_Y, "AXIS_Y", ICON_AXIS_FRONT, "Front (X-Z)", "Project 
strokes to plane locked to Y"},
{GP_LOCKAXIS_X, "AXIS_X", ICON_AXIS_SIDE, "Side (Y-Z)", "Project 
strokes to plane locked to X"},
{GP_LOCKAXIS_Z, "AXIS_Z", ICON_AXIS_TOP, "Top (X-Y)", "Project strokes 
to plane locked to Z"},
-   {GP_LOCKAXIS_CURSOR, "CURSOR", ICON_PIVOT_CURSOR, "Cursor", "Align 
strokes to current 3D cursor location and orientation"},
+   {GP_LOCKAXIS_CURSOR, "CURSOR", ICON_PIVOT_CURSOR, "Cursor", "Align 
strokes to current 3D cursor orientation"},
{0, NULL, 0, NULL, NULL},
 };
 #endif

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


[Bf-blender-cvs] [65d95879f73] blender2.7: Cycles: upgrade to CUDA 10.1 as the one officially supported version.

2019-03-15 Thread Brecht Van Lommel
Commit: 65d95879f73951861a90efe1c3ac5d1d03530fd6
Author: Brecht Van Lommel
Date:   Fri Mar 15 14:18:22 2019 +0100
Branches: blender2.7
https://developer.blender.org/rB65d95879f73951861a90efe1c3ac5d1d03530fd6

Cycles: upgrade to CUDA 10.1 as the one officially supported version.

This version fixes various bugs, and there is no need anymore to use both
9.1 and 10.0 for different cards.

There is a bug related to WITH_CYCLES_CUBIN_COMPILER and bump mapping in the
regression tests, so that remains disabled same as it was for CUDA 10.0.

Fix T59286: CUDA bake failing on some cards.
Fix T56858: CUDA 9.2 and 10 issues.

===

M   build_files/buildbot/slave_compile.py
M   build_files/cmake/config/blender_release.cmake
M   intern/cycles/CMakeLists.txt
M   intern/cycles/device/device_cuda.cpp
M   intern/cycles/kernel/CMakeLists.txt

===

diff --git a/build_files/buildbot/slave_compile.py 
b/build_files/buildbot/slave_compile.py
index c282e3624c2..2a71b69ed53 100644
--- a/build_files/buildbot/slave_compile.py
+++ b/build_files/buildbot/slave_compile.py
@@ -118,23 +118,6 @@ if 'cmake' in builder:
 cmake_extra_options.extend(["-DCMAKE_C_COMPILER=/usr/bin/gcc-7",
 "-DCMAKE_CXX_COMPILER=/usr/bin/g++-7"])
 
-# Workaround to build only sm_7x kernels with CUDA 10, until
-# older kernels work well with this version.
-if builder.startswith('win'):
-cmake_extra_options.append('-DCUDA_VERSION=9.1')
-cmake_extra_options.append('-DCUDA_TOOLKIT_INCLUDE:PATH=C:/Program 
Files/NVIDIA GPU Computing Toolkit/CUDA/v9.1/include')
-cmake_extra_options.append('-DCUDA_TOOLKIT_ROOT_DIR:PATH=C:/Program 
Files/NVIDIA GPU Computing Toolkit/CUDA/v9.1')
-cmake_extra_options.append('-DCUDA_NVCC_EXECUTABLE:FILEPATH=C:/Program 
Files/NVIDIA GPU Computing Toolkit/CUDA/v9.1/bin/nvcc.exe')
-
cmake_extra_options.append('-DCUDA10_NVCC_EXECUTABLE:FILEPATH=C:/Program 
Files/NVIDIA GPU Computing Toolkit/CUDA/v10.0/bin/nvcc.exe')
-cmake_extra_options.append('-DCUDA10_TOOLKIT_ROOT_DIR:PATH=C:/Program 
Files/NVIDIA GPU Computing Toolkit/CUDA/v10.0')
-elif builder.startswith('linux'):
-cmake_extra_options.append('-DCUDA_VERSION=9.1')
-
cmake_extra_options.append('-DCUDA_TOOLKIT_INCLDUE:PATH=/usr/local/cuda-9.1/include')
-
cmake_extra_options.append('-DCUDA_TOOLKIT_ROOT_DIR:PATH=/usr/local/cuda-9.1')
-
cmake_extra_options.append('-DCUDA_NVCC_EXECUTABLE:FILEPATH=/usr/local/cuda-9.1/bin/nvcc')
-
cmake_extra_options.append('-DCUDA10_NVCC_EXECUTABLE:FILEPATH=/usr/local/cuda-10.0/bin/nvcc')
-
cmake_extra_options.append('-DCUDA10_TOOLKIT_ROOT_DIR:PATH=/usr/local/cuda-10.0')
-
 cmake_options.append("-C" + os.path.join(blender_dir, cmake_config_file))
 
 # Prepare CMake options needed to configure cuda binaries compilation, 
64bit only.
diff --git a/build_files/cmake/config/blender_release.cmake 
b/build_files/cmake/config/blender_release.cmake
index 4257d3df9b0..adffea0b99d 100644
--- a/build_files/cmake/config/blender_release.cmake
+++ b/build_files/cmake/config/blender_release.cmake
@@ -51,9 +51,10 @@ set(WITH_SDL ON  CACHE BOOL "" FORCE)
 set(WITH_X11_XINPUT  ON  CACHE BOOL "" FORCE)
 set(WITH_X11_XF86VMODE   ON  CACHE BOOL "" FORCE)
 
-set(WITH_PLAYER  ON  CACHE BOOL "" FORCE)
-set(WITH_MEM_JEMALLOCON  CACHE BOOL "" FORCE)
-set(WITH_CYCLES_CUDA_BINARIES ON  CACHE BOOL "" FORCE)
+set(WITH_PLAYERON  CACHE BOOL "" FORCE)
+set(WITH_MEM_JEMALLOC  ON  CACHE BOOL "" FORCE)
+set(WITH_CYCLES_CUDA_BINARIES  ON  CACHE BOOL "" FORCE)
+set(WITH_CYCLES_CUBIN_COMPILER OFF CACHE BOOL "" FORCE)
 set(CYCLES_CUDA_BINARIES_ARCH 
sm_30;sm_35;sm_37;sm_50;sm_52;sm_60;sm_61;sm_70;sm_75 CACHE STRING "" FORCE)
 
 # platform dependent options
diff --git a/intern/cycles/CMakeLists.txt b/intern/cycles/CMakeLists.txt
index 6fe4546ae8c..d4a613a78c7 100644
--- a/intern/cycles/CMakeLists.txt
+++ b/intern/cycles/CMakeLists.txt
@@ -301,6 +301,8 @@ if(WITH_CYCLES_CUDA_BINARIES AND (NOT 
WITH_CYCLES_CUBIN_COMPILER))
set(MAX_MSVC 1911)
elseif(${CUDA_VERSION} EQUAL "10.0")
set(MAX_MSVC 1999)
+   elseif(${CUDA_VERSION} EQUAL "10.1")
+   set(MAX_MSVC 1999)
endif()
if(NOT MSVC_VERSION LESS ${MAX_MSVC} OR CMAKE_C_COMPILER_ID 
MATCHES "Clang")
message(STATUS "nvcc not supported for this compiler 
version, using cycles_cubin_cc instead.")
diff --git a/intern/cycles/device/device_cuda.cpp 
b/intern/cycles/device/device_cuda.cpp
index e21d974ebbe..a7539d2ac31 100644
--- a/intern/cycles/device/device_cuda.cpp
+++ b/intern/cycles/device/device_cuda.cpp
@@ -400,9 +400,9 @@ 

[Bf-blender-cvs] [56a8c2a3203] blender2.7: Fix cycles preferences.get_devices() not returning all devices as before.

2019-03-15 Thread Brecht Van Lommel
Commit: 56a8c2a3203482f0fc7437b0cefe2160e27f7fe3
Author: Brecht Van Lommel
Date:   Fri Mar 15 15:26:18 2019 +0100
Branches: blender2.7
https://developer.blender.org/rB56a8c2a3203482f0fc7437b0cefe2160e27f7fe3

Fix cycles preferences.get_devices() not returning all devices as before.

It only returned those for the active device type. For backwards compatibility
return them all again, but still avoid enumerating them from our own code on
startup or opening preferences.

===

M   intern/cycles/blender/addon/properties.py
M   intern/cycles/blender/addon/version_update.py

===

diff --git a/intern/cycles/blender/addon/properties.py 
b/intern/cycles/blender/addon/properties.py
index 950a0b5f08f..8cecddbc711 100644
--- a/intern/cycles/blender/addon/properties.py
+++ b/intern/cycles/blender/addon/properties.py
@@ -1475,10 +1475,11 @@ class CyclesPreferences(bpy.types.AddonPreferences):
 # Update name in case it changed
 entry.name = device[0]
 
-def get_devices(self):
+# Gets all devices types by default.
+def get_devices(self, compute_device_type=''):
 import _cycles
 # Layout of the device tuples: (Name, Type, Persistent ID)
-device_list = _cycles.available_devices(self.compute_device_type)
+device_list = _cycles.available_devices(compute_device_type)
 # Make sure device entries are up to date and not referenced before
 # we know we don't add new devices. This way we guarantee to not
 # hold pointers to a resized array.
@@ -1535,7 +1536,7 @@ class CyclesPreferences(bpy.types.AddonPreferences):
 row = layout.row()
 row.prop(self, "compute_device_type", expand=True)
 
-cuda_devices, opencl_devices = self.get_devices()
+cuda_devices, opencl_devices = 
self.get_devices(self.compute_device_type)
 row = layout.row()
 if self.compute_device_type == 'CUDA':
 self._draw_devices(row, 'CUDA', cuda_devices)
diff --git a/intern/cycles/blender/addon/version_update.py 
b/intern/cycles/blender/addon/version_update.py
index f3d60d62e02..7fb43af8b7c 100644
--- a/intern/cycles/blender/addon/version_update.py
+++ b/intern/cycles/blender/addon/version_update.py
@@ -254,7 +254,7 @@ def do_versions(self):
 pass
 
 # Init device list for UI
-prop.get_devices()
+prop.get_devices(prop.compute_device_type)
 
 # We don't modify startup file because it assumes to
 # have all the default values only.

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


[Bf-blender-cvs] [6e8ac50dde9] greasepencil-object: GPencil: Improve origin location of new strokes

2019-03-15 Thread Antonioya
Commit: 6e8ac50dde9fe1929fe9bba3f15b5108647be7de
Author: Antonioya
Date:   Fri Mar 15 16:48:30 2019 +0100
Branches: greasepencil-object
https://developer.blender.org/rB6e8ac50dde9fe1929fe9bba3f15b5108647be7de

GPencil: Improve origin location of new strokes

Before there was a mix between cursor and object origin. Now the origin is 
defined with one parameter and the lock defines the orientation.

===

M   source/blender/draw/engines/gpencil/gpencil_engine.c
M   source/blender/editors/gpencil/gpencil_utils.c

===

diff --git a/source/blender/draw/engines/gpencil/gpencil_engine.c 
b/source/blender/draw/engines/gpencil/gpencil_engine.c
index c2c79a757e3..d5ede897467 100644
--- a/source/blender/draw/engines/gpencil/gpencil_engine.c
+++ b/source/blender/draw/engines/gpencil/gpencil_engine.c
@@ -582,6 +582,7 @@ void GPENCIL_cache_populate(void *vedata, Object *ob)
Scene *scene = draw_ctx->scene;
ToolSettings *ts = scene->toolsettings;
View3D *v3d = draw_ctx->v3d;
+   const View3DCursor *cursor = >cursor;
 
if (ob->type == OB_GPENCIL && ob->data) {
bGPdata *gpd = (bGPdata *)ob->data;
@@ -645,7 +646,6 @@ void GPENCIL_cache_populate(void *vedata, Object *ob)
}
case GP_LOCKAXIS_CURSOR:
{
-   const View3DCursor *cursor = 
>cursor;
float scale[3] = { 1.0f, 1.0f, 1.0f };

loc_eul_size_to_mat4(stl->storage->grid_matrix,

cursor->location,
@@ -660,6 +660,14 @@ void GPENCIL_cache_populate(void *vedata, Object *ob)
}
}
 
+   /* now move the origin to Object or Cursor */
+   if (ts->gpencil_v3d_align & GP_PROJECT_CURSOR) {
+   copy_v3_v3(stl->storage->grid_matrix[3], 
cursor->location);
+   }
+   else {
+   copy_v3_v3(stl->storage->grid_matrix[3], 
ob->obmat[3]);
+   }
+
DRW_shgroup_call_add(
stl->g_data->shgrps_grid,
e_data.batch_grid,
diff --git a/source/blender/editors/gpencil/gpencil_utils.c 
b/source/blender/editors/gpencil/gpencil_utils.c
index b6137c790e4..1605353a156 100644
--- a/source/blender/editors/gpencil/gpencil_utils.c
+++ b/source/blender/editors/gpencil/gpencil_utils.c
@@ -877,11 +877,9 @@ void ED_gp_get_drawing_reference(
 char align_flag, float r_vec[3])
 {
const float *fp = scene->cursor.location;
-   ToolSettings *ts = scene->toolsettings;
-   const int axis = ts->gp_sculpt.lock_axis;
 
/* if using a gpencil object at cursor mode, can use the location of 
the object */
-   if ((align_flag & GP_PROJECT_VIEWSPACE) && (axis != 
GP_LOCKAXIS_CURSOR)) {
+   if (align_flag & GP_PROJECT_VIEWSPACE) {
if (ob && (ob->type == OB_GPENCIL)) {
/* fallback (no strokes) - use cursor or object 
location */
if (align_flag & GP_PROJECT_CURSOR) {
@@ -943,6 +941,8 @@ void ED_gp_project_stroke_to_plane(
const RegionView3D *rv3d, bGPDstroke *gps,
const float origin[3], const int axis)
 {
+   const ToolSettings *ts = scene->toolsettings;
+   const View3DCursor *cursor = >cursor;
float plane_normal[3];
float vn[3];
 
@@ -961,11 +961,18 @@ void ED_gp_project_stroke_to_plane(
plane_normal[axis] = 1.0f;
/* if object, apply object rotation */
if (ob && (ob->type == OB_GPENCIL)) {
-   mul_mat3_m4_v3(ob->obmat, plane_normal);
+   float mat[4][4];
+   copy_m4_m4(mat, ob->obmat);
+
+   /* move origin to cursor */
+   if (ts->gpencil_v3d_align & GP_PROJECT_CURSOR) {
+   copy_v3_v3(mat[3], cursor->location);
+   }
+
+   mul_mat3_m4_v3(mat, plane_normal);
}
}
else {
-   const View3DCursor *cursor = >cursor;
float scale[3] = { 1.0f, 1.0f, 1.0f };
plane_normal[2] = 1.0f;
float mat[4][4];
@@ -973,6 +980,12 @@ void ED_gp_project_stroke_to_plane(
cursor->location,
cursor->rotation_euler,
scale);
+
+   /* move origin to object */
+   if ((ts->gpencil_v3d_align & GP_PROJECT_CURSOR) == 0) {
+   

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

2019-03-15 Thread Antonioya
Commit: fec90e08f71e59b3f217f104dfb1b5ed565696c3
Author: Antonioya
Date:   Fri Mar 15 16:49:02 2019 +0100
Branches: greasepencil-object
https://developer.blender.org/rBfec90e08f71e59b3f217f104dfb1b5ed565696c3

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] SVN commit: /data/svn/repos/bf-blender [62215] trunk/lib/benchmarks/cycles/classroom/ReadMe.txt: Add new line to the readme

2019-03-15 Thread Sergey Sharybin
Revision: 62215
  https://developer.blender.org/rBL62215
Author:   sergey
Date: 2019-03-15 16:38:13 +0100 (Fri, 15 Mar 2019)
Log Message:
---
Add new line to the readme

Mainly to see whether SVN still works.

Modified Paths:
--
trunk/lib/benchmarks/cycles/classroom/ReadMe.txt

Modified: trunk/lib/benchmarks/cycles/classroom/ReadMe.txt
===
--- trunk/lib/benchmarks/cycles/classroom/ReadMe.txt2019-03-15 13:06:51 UTC 
(rev 62214)
+++ trunk/lib/benchmarks/cycles/classroom/ReadMe.txt2019-03-15 15:38:13 UTC 
(rev 62215)
@@ -26,4 +26,4 @@
 
 Christophe SEUX :
 
-christophes...@free.fr
\ No newline at end of file
+christophes...@free.fr

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


[Bf-blender-cvs] [5051e580e40] master: Merge branch 'blender2.7'

2019-03-15 Thread Jeroen Bakker
Commit: 5051e580e4028e0a741e6519e469321a7e1f2a71
Author: Jeroen Bakker
Date:   Fri Mar 15 16:28:33 2019 +0100
Branches: master
https://developer.blender.org/rB5051e580e4028e0a741e6519e469321a7e1f2a71

Merge branch 'blender2.7'

===



===

diff --cc intern/cycles/blender/blender_session.cpp
index 501e4fec13f,27541800804..f1cdda5cb13
--- a/intern/cycles/blender/blender_session.cpp
+++ b/intern/cycles/blender/blender_session.cpp
@@@ -1005,8 -956,8 +1010,8 @@@ void BlenderSession::update_bake_progre
  
  void BlenderSession::update_status_progress()
  {
-   string timestatus, status, substatus;
+   string timestatus, status, substatus, kernel_status;
 -  string scene = "";
 +  string scene_status = "";
float progress;
double total_time, remaining_time = 0, render_time;
char time_str[128];
@@@ -1020,25 -972,31 +1026,27 @@@
remaining_time = (1.0 - (double)progress) * (render_time / 
(double)progress);
  
if(background) {
 -  scene += " | " + b_scene.name();
 +  scene_status += " | " + scene->name;
if(b_rlay_name != "")
 -  scene += ", "  + b_rlay_name;
 +  scene_status += ", "  + b_rlay_name;
  
if(b_rview_name != "")
 -  scene += ", " + b_rview_name;
 -  }
 -  else {
 -  BLI_timecode_string_from_time_simple(time_str, 
sizeof(time_str), total_time);
 -  timestatus = "Time:" + string(time_str) + " | ";
 -  }
 +  scene_status += ", " + b_rview_name;
  
 -  if(remaining_time > 0) {
 -  BLI_timecode_string_from_time_simple(time_str, 
sizeof(time_str), remaining_time);
 -  timestatus += "Remaining:" + string(time_str) + " | ";
 -  }
 +  if(remaining_time > 0) {
 +  BLI_timecode_string_from_time_simple(time_str, 
sizeof(time_str), remaining_time);
 +  timestatus += "Remaining:" + string(time_str) + " | ";
 +  }
  
 -  timestatus += string_printf("Mem:%.2fM, Peak:%.2fM", (double)mem_used, 
(double)mem_peak);
 +  timestatus += string_printf("Mem:%.2fM, Peak:%.2fM", 
(double)mem_used, (double)mem_peak);
  
 -  if(status.size() > 0)
 -  status = " | " + status;
 -  if(substatus.size() > 0)
 -  status += " | " + substatus;
 -  if(kernel_status.size() > 0)
 -  status += " | " + kernel_status;
 +  if(status.size() > 0)
 +  status = " | " + status;
 +  if(substatus.size() > 0)
 +  status += " | " + substatus;
++  if(kernel_status.size() > 0)
++  status += " | " + kernel_status;
 +  }
  
double current_time = time_dt();
/* When rendering in a window, redraw the status at least once per 
second to keep the elapsed and remaining time up-to-date.

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


[Bf-blender-cvs] [2f6257fd7fe] blender2.7: Cycles/OpenCL: Compile Kernels During Scene Update

2019-03-15 Thread Jeroen Bakker
Commit: 2f6257fd7fe305e3b226a8b505eb614bbeaf762a
Author: Jeroen Bakker
Date:   Wed Mar 13 12:31:48 2019 +0100
Branches: blender2.7
https://developer.blender.org/rB2f6257fd7fe305e3b226a8b505eb614bbeaf762a

Cycles/OpenCL: Compile Kernels During Scene Update

The main goals of this change is faster starting when using foreground
rendering.

This patch will build kernels in parallel to the update process of
the scene. When these optimized kernels are not available (yet) an AO
kernel will be used.

These AO kernels are fast to compile (3-7 seconds) and can be
reused by all scenes. When the final kernels become available we
will switch to these kernels.

In background mode the AO kernels will not be used.
Some kernels are being used during Scene update (displace, background
light). When these kernels are being used the process can halt until
these become available.

Reviewed By: brecht, #cycles

Maniphest Tasks: T61752

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

===

M   intern/cycles/blender/blender_session.cpp
M   intern/cycles/blender/blender_session.h
M   intern/cycles/device/device.h
M   intern/cycles/device/device_multi.cpp
M   intern/cycles/device/opencl/opencl.h
M   intern/cycles/device/opencl/opencl_split.cpp
M   intern/cycles/device/opencl/opencl_util.cpp
M   intern/cycles/kernel/kernel_types.h
M   intern/cycles/render/session.cpp
M   intern/cycles/render/session.h
M   intern/cycles/util/util_progress.h
M   intern/cycles/util/util_task.cpp
M   intern/cycles/util/util_task.h

===

diff --git a/intern/cycles/blender/blender_session.cpp 
b/intern/cycles/blender/blender_session.cpp
index ab08b9e146d..27541800804 100644
--- a/intern/cycles/blender/blender_session.cpp
+++ b/intern/cycles/blender/blender_session.cpp
@@ -933,6 +933,11 @@ void BlenderSession::get_status(string& status, string& 
substatus)
session->progress.get_status(status, substatus);
 }
 
+void BlenderSession::get_kernel_status(string& kernel_status)
+{
+   session->progress.get_kernel_status(kernel_status);
+}
+
 void BlenderSession::get_progress(float& progress, double& total_time, double& 
render_time)
 {
session->progress.get_time(total_time, render_time);
@@ -951,7 +956,7 @@ void BlenderSession::update_bake_progress()
 
 void BlenderSession::update_status_progress()
 {
-   string timestatus, status, substatus;
+   string timestatus, status, substatus, kernel_status;
string scene = "";
float progress;
double total_time, remaining_time = 0, render_time;
@@ -960,6 +965,7 @@ void BlenderSession::update_status_progress()
float mem_peak = (float)session->stats.mem_peak / 1024.0f / 1024.0f;
 
get_status(status, substatus);
+   get_kernel_status(kernel_status);
get_progress(progress, total_time, render_time);
 
if(progress > 0)
@@ -989,6 +995,8 @@ void BlenderSession::update_status_progress()
status = " | " + status;
if(substatus.size() > 0)
status += " | " + substatus;
+   if(kernel_status.size() > 0)
+   status += " | " + kernel_status;
 
double current_time = time_dt();
/* When rendering in a window, redraw the status at least once per 
second to keep the elapsed and remaining time up-to-date.
diff --git a/intern/cycles/blender/blender_session.h 
b/intern/cycles/blender/blender_session.h
index 2aa3c77c37d..2c0a83cf6e7 100644
--- a/intern/cycles/blender/blender_session.h
+++ b/intern/cycles/blender/blender_session.h
@@ -90,6 +90,7 @@ public:
void tag_redraw();
void tag_update();
void get_status(string& status, string& substatus);
+   void get_kernel_status(string& kernel_status);
void get_progress(float& progress, double& total_time, double& 
render_time);
void test_cancel();
void update_status_progress();
diff --git a/intern/cycles/device/device.h b/intern/cycles/device/device.h
index 3bf978600d5..6f3208e955f 100644
--- a/intern/cycles/device/device.h
+++ b/intern/cycles/device/device.h
@@ -56,6 +56,14 @@ enum DeviceTypeMask {
DEVICE_MASK_ALL = ~0
 };
 
+enum DeviceKernelStatus {
+   DEVICE_KERNEL_WAITING_FOR_FEATURE_KERNEL = 0,
+   DEVICE_KERNEL_FEATURE_KERNEL_AVAILABLE,
+   DEVICE_KERNEL_USING_FEATURE_KERNEL,
+   DEVICE_KERNEL_FEATURE_KERNEL_INVALID,
+   DEVICE_KERNEL_UNKNOWN,
+};
+
 #define DEVICE_MASK(type) (DeviceTypeMask)(1 << type)
 
 class DeviceInfo {
@@ -321,6 +329,20 @@ public:
const DeviceRequestedFeatures& /*requested_features*/)
{ return true; }
 
+   /* Wait for device to become available to upload data and receive tasks
+* This method is used by the OpenCL device to load the
+* optimized kernels or when not (yet) available load the
+* generic 

[Bf-blender-cvs] [86ea76254d3] master: Fix T62614: Copy eevee settings when scene is copied

2019-03-15 Thread Jacques Lucke
Commit: 86ea76254d3f625bf3d9e15dade5d5b3544c06a3
Author: Jacques Lucke
Date:   Fri Mar 15 16:06:30 2019 +0100
Branches: master
https://developer.blender.org/rB86ea76254d3f625bf3d9e15dade5d5b3544c06a3

Fix T62614: Copy eevee settings when scene is copied

Reviewers: brecht, fclem

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

===

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

===

diff --git a/source/blender/blenkernel/intern/scene.c 
b/source/blender/blenkernel/intern/scene.c
index 83df851f0d1..9c174c8025f 100644
--- a/source/blender/blenkernel/intern/scene.c
+++ b/source/blender/blenkernel/intern/scene.c
@@ -318,6 +318,7 @@ void BKE_scene_copy_data(Main *bmain, Scene *sce_dst, const 
Scene *sce_src, cons
}
 
sce_dst->eevee.light_cache = NULL;
+   sce_dst->eevee.light_cache_info[0] = '\0';
/* TODO Copy the cache. */
 }
 
@@ -339,6 +340,9 @@ Scene *BKE_scene_copy(Main *bmain, Scene *sce, int type)
sce_copy->unit = sce->unit;
sce_copy->physics_settings = sce->physics_settings;
sce_copy->audio = sce->audio;
+   sce_copy->eevee = sce->eevee;
+   sce_copy->eevee.light_cache = NULL;
+   sce_copy->eevee.light_cache_info[0] = '\0';
 
if (sce->id.properties)
sce_copy->id.properties = 
IDP_CopyProperty(sce->id.properties);

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


[Bf-blender-cvs] [ac147872cca] master: Fix T62594: Truncated text in UI

2019-03-15 Thread Jacques Lucke
Commit: ac147872cca748e33bd84da5dbb34ab22f02ffca
Author: Jacques Lucke
Date:   Fri Mar 15 15:12:42 2019 +0100
Branches: master
https://developer.blender.org/rBac147872cca748e33bd84da5dbb34ab22f02ffca

Fix T62594: Truncated text in UI

Reviewers: brecht, billreynish

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

===

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

===

diff --git a/source/blender/editors/interface/interface_style.c 
b/source/blender/editors/interface/interface_style.c
index 4aea1fad89f..f59bc5759e1 100644
--- a/source/blender/editors/interface/interface_style.c
+++ b/source/blender/editors/interface/interface_style.c
@@ -182,17 +182,15 @@ void UI_fontstyle_draw_ex(
 
if (fs_params->align == UI_STYLE_TEXT_CENTER) {
xofs = floor(0.5f * (BLI_rcti_size_x(rect) - 
BLF_width(fs->uifont_id, str, len)));
-   /* don't center text if it chops off the start of the text, 2 
gives some margin */
-   if (xofs < 2) {
-   xofs = 2;
-   }
}
else if (fs_params->align == UI_STYLE_TEXT_RIGHT) {
-   xofs = BLI_rcti_size_x(rect) - BLF_width(fs->uifont_id, str, 
len) - 0.1f * U.widget_unit;
+   xofs = BLI_rcti_size_x(rect) - BLF_width(fs->uifont_id, str, 
len);
}
 
-   /* clip is very strict, so we give it some space */
-   BLF_clipping(fs->uifont_id, rect->xmin - 2, rect->ymin - 4, rect->xmax 
+ 1, rect->ymax + 4);
+   yofs = MAX2(0, yofs);
+   xofs = MAX2(0, xofs);
+
+   BLF_clipping(fs->uifont_id, rect->xmin, rect->ymin, rect->xmax, 
rect->ymax);
BLF_position(fs->uifont_id, rect->xmin + xofs, rect->ymin + yofs, 0.0f);
BLF_color4ubv(fs->uifont_id, col);

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


[Bf-blender-cvs] [2e043c266bf] master: Fix: "Jump To Target" showing up in workspace context menu

2019-03-15 Thread Dalai Felinto
Commit: 2e043c266bfff4b0de7c1cb2b324549cdf5a742b
Author: Dalai Felinto
Date:   Fri Mar 15 10:49:26 2019 -0300
Branches: master
https://developer.blender.org/rB2e043c266bfff4b0de7c1cb2b324549cdf5a742b

Fix: "Jump To Target" showing up in workspace context menu

Issue introduced on d227c58e3ec2020.

This was affecting WorkSpaces as well as background scene and probably
other places. We use the operator poll to decide whether to show it.

Reviewers: brecht, mont29

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

===

M   source/blender/editors/interface/interface_context_menu.c
M   source/blender/editors/interface/interface_intern.h
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 d075052f842..5c870e6a281 100644
--- a/source/blender/editors/interface/interface_context_menu.c
+++ b/source/blender/editors/interface/interface_context_menu.c
@@ -678,9 +678,13 @@ bool ui_popup_context_menu_for_button(bContext *C, uiBut 
*but)
/* Pointer properties and string properties with
 * prop_search support jumping to target object/bone. */
if (but->rnapoin.data && but->rnaprop) {
-   const PropertyType type = RNA_property_type(but->rnaprop);
-
-   if ((type == PROP_POINTER) || (type == PROP_STRING && but->type 
== UI_BTYPE_SEARCH_MENU && but->search_func == ui_rna_collection_search_cb)) {
+   const PropertyType prop_type = RNA_property_type(but->rnaprop);
+   if (((prop_type == PROP_POINTER) ||
+(prop_type == PROP_STRING &&
+ but->type == UI_BTYPE_SEARCH_MENU &&
+ but->search_func == ui_rna_collection_search_cb)) &&
+ ui_jump_to_target_button_poll(C))
+   {
uiItemO(layout, 
CTX_IFACE_(BLT_I18NCONTEXT_OPERATOR_DEFAULT, "Jump To Target"),
ICON_NONE, "UI_OT_jump_to_target_button");
uiItemS(layout);
diff --git a/source/blender/editors/interface/interface_intern.h 
b/source/blender/editors/interface/interface_intern.h
index e5f6f09e2eb..b0eb63712e2 100644
--- a/source/blender/editors/interface/interface_intern.h
+++ b/source/blender/editors/interface/interface_intern.h
@@ -900,4 +900,8 @@ typedef struct uiRNACollectionSearch {
 } uiRNACollectionSearch;
 void ui_rna_collection_search_cb(const struct bContext *C, void *arg, const 
char *str, uiSearchItems *items);
 
+/* interface_ops.c */
+bool ui_jump_to_target_button_poll(struct bContext *C);
+
+
 #endif  /* __INTERFACE_INTERN_H__ */
diff --git a/source/blender/editors/interface/interface_ops.c 
b/source/blender/editors/interface/interface_ops.c
index d39fe514f99..773d624fd5d 100644
--- a/source/blender/editors/interface/interface_ops.c
+++ b/source/blender/editors/interface/interface_ops.c
@@ -949,7 +949,7 @@ static bool jump_to_target_button(bContext *C, bool poll)
return false;
 }
 
-static bool jump_to_target_button_poll(bContext *C)
+bool ui_jump_to_target_button_poll(bContext *C)
 {
return jump_to_target_button(C, true);
 }
@@ -969,7 +969,7 @@ static void UI_OT_jump_to_target_button(wmOperatorType *ot)
ot->description = "Switch to the target object or bone";
 
/* callbacks */
-   ot->poll = jump_to_target_button_poll;
+   ot->poll = ui_jump_to_target_button_poll;
ot->exec = jump_to_target_button_exec;
 
/* flags */

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


[Bf-blender-cvs] [d5d518b96c1] master: Fix T62592: GPencil layer activation from outliner needed two clicks

2019-03-15 Thread Antonioya
Commit: d5d518b96c16bb36342d99f63aa7d1569e650cdf
Author: Antonioya
Date:   Fri Mar 15 14:38:40 2019 +0100
Branches: master
https://developer.blender.org/rBd5d518b96c16bb36342d99f63aa7d1569e650cdf

Fix  T62592: GPencil layer activation from outliner needed two clicks

For some reason, the code was commented and we missed to enable it again.

===

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 09fa6d63557..a1afe8b46ea 100644
--- a/source/blender/editors/space_outliner/outliner_select.c
+++ b/source/blender/editors/space_outliner/outliner_select.c
@@ -522,7 +522,7 @@ static eOLDrawState tree_element_active_defgroup(
return OL_DRAWSEL_NONE;
 }
 
-static eOLDrawState UNUSED_FUNCTION(tree_element_active_gplayer)(
+static eOLDrawState tree_element_active_gplayer(
 bContext *C, Scene *UNUSED(scene), TreeElement *te, TreeStoreElem 
*tselem, const eOLSetState set)
 {
bGPdata *gpd = (bGPdata *)tselem->id;
@@ -980,7 +980,7 @@ eOLDrawState tree_element_type_active(
case TSE_KEYMAP_ITEM:
return tree_element_active_keymap_item(C, scene, 
view_layer, te, tselem, set);
case TSE_GP_LAYER:
-   //return tree_element_active_gplayer(C, scene, s, te, 
tselem, set);
+   return tree_element_active_gplayer(C, scene, te, 
tselem, set);
break;
case TSE_VIEW_COLLECTION_BASE:
return tree_element_active_master_collection(C, te, 
set);

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


[Bf-blender-cvs] SVN commit: /data/svn/repos/bf-blender [62214] trunk/lib/tests/modeling/split_faces_test.blend: split_faces_test: fix by updating call to new_from_object.

2019-03-15 Thread Howard Trickey
Revision: 62214
  https://developer.blender.org/rBL62214
Author:   howardt
Date: 2019-03-15 14:06:51 +0100 (Fri, 15 Mar 2019)
Log Message:
---
split_faces_test: fix by updating call to new_from_object.

Also put in code to catch exceptions and cause test to fail,
as this test was erroneously seeming to pass.

Modified Paths:
--
trunk/lib/tests/modeling/split_faces_test.blend

Modified: trunk/lib/tests/modeling/split_faces_test.blend
===
(Binary files differ)

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


[Bf-blender-cvs] [e583e86a9af] master: Fix T62284: apply a retroactive fix for T57366 to old files.

2019-03-15 Thread Alexander Gavrilov
Commit: e583e86a9af458058fb2f92de6aaafb681756549
Author: Alexander Gavrilov
Date:   Fri Mar 15 14:58:04 2019 +0300
Branches: master
https://developer.blender.org/rBe583e86a9af458058fb2f92de6aaafb681756549

Fix T62284: apply a retroactive fix for T57366 to old files.

===

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

===

diff --git a/source/blender/blenloader/intern/versioning_280.c 
b/source/blender/blenloader/intern/versioning_280.c
index 7005ae2302c..b0b389c6c2d 100644
--- a/source/blender/blenloader/intern/versioning_280.c
+++ b/source/blender/blenloader/intern/versioning_280.c
@@ -2127,6 +2127,12 @@ void blo_do_versions_280(FileData *fd, Library 
*UNUSED(lib), Main *bmain)
}
}
 
+   if (!MAIN_VERSION_ATLEAST(bmain, 280, 28)) {
+   for (Mesh *mesh = bmain->meshes.first; mesh; mesh = 
mesh->id.next) {
+   BKE_mesh_calc_edges_loose(mesh);
+   }
+   }
+
if (!MAIN_VERSION_ATLEAST(bmain, 280, 29)) {
for (bScreen *screen = bmain->screens.first; screen; screen = 
screen->id.next) {
for (ScrArea *sa = screen->areabase.first; sa; sa = 
sa->next) {

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


[Bf-blender-cvs] [9a499636df7] master: UI: rename object Boundary back to Bounds, it's not the same thing.

2019-03-15 Thread Brecht Van Lommel
Commit: 9a499636df79bc75b9aab92557bb123fdb7a9011
Author: Brecht Van Lommel
Date:   Fri Mar 15 12:16:35 2019 +0100
Branches: master
https://developer.blender.org/rB9a499636df79bc75b9aab92557bb123fdb7a9011

UI: rename object Boundary back to Bounds, it's not the same thing.

===

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

===

diff --git a/release/scripts/startup/bl_ui/properties_object.py 
b/release/scripts/startup/bl_ui/properties_object.py
index f8da287f231..bace5acc67e 100644
--- a/release/scripts/startup/bl_ui/properties_object.py
+++ b/release/scripts/startup/bl_ui/properties_object.py
@@ -264,7 +264,7 @@ class OBJECT_PT_display(ObjectButtonsPanel, Panel):
 
 
 class OBJECT_PT_display_bounds(ObjectButtonsPanel, Panel):
-bl_label = "Boundary"
+bl_label = "Bounds"
 bl_parent_id = "OBJECT_PT_display"
 bl_options = {'DEFAULT_CLOSED'}

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


[Bf-blender-cvs] [e775ad6c1be] master: Correct tool name (missed in recent update)

2019-03-15 Thread Campbell Barton
Commit: e775ad6c1be730bf7773e82cab6dba9f702bd127
Author: Campbell Barton
Date:   Fri Mar 15 20:32:49 2019 +1100
Branches: master
https://developer.blender.org/rBe775ad6c1be730bf7773e82cab6dba9f702bd127

Correct tool name (missed in recent update)

===

M   release/scripts/presets/keyconfig/keymap_data/blender_default.py

===

diff --git a/release/scripts/presets/keyconfig/keymap_data/blender_default.py 
b/release/scripts/presets/keyconfig/keymap_data/blender_default.py
index c1f7785de4e..596c1d2afb0 100644
--- a/release/scripts/presets/keyconfig/keymap_data/blender_default.py
+++ b/release/scripts/presets/keyconfig/keymap_data/blender_default.py
@@ -810,7 +810,7 @@ def km_uv_editor(params):
 # Quick switch to select tool, since left select can't easily
 # select with any tool active.
 items.extend([
-op_tool_cycle("Select Box", {"type": 'W', "value": 'PRESS'}),
+op_tool_cycle("builtin.select_box", {"type": 'W', "value": 
'PRESS'}),
 ])
 
 return keymap
@@ -1173,7 +1173,7 @@ def km_view3d(params):
 # Quick switch to select tool, since left select can't easily
 # select with any tool active.
 items.extend([
-op_tool_cycle("Select Box", {"type": 'W', "value": 'PRESS'}),
+op_tool_cycle("builtin.select_box", {"type": 'W', "value": 
'PRESS'}),
 ])
 
 return keymap

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


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

2019-03-15 Thread Antonioya
Commit: cf5b7f97de8bbe487933ad62dbc632da58ac982e
Author: Antonioya
Date:   Fri Mar 15 10:10:27 2019 +0100
Branches: greasepencil-object
https://developer.blender.org/rBcf5b7f97de8bbe487933ad62dbc632da58ac982e

Merge branch 'master' into greasepencil-object

 Conflicts:
source/blender/editors/gpencil/gpencil_edit.c
source/blender/editors/gpencil/gpencil_primitive.c

===



===

diff --cc source/blender/editors/gpencil/gpencil_edit.c
index a6feb6477a3,1388beb0b20..7064f54be98
--- a/source/blender/editors/gpencil/gpencil_edit.c
+++ b/source/blender/editors/gpencil/gpencil_edit.c
@@@ -3360,8 -3363,9 +3363,9 @@@ static int gp_strokes_reproject_exec(bC
}
}
  
-   ED_gp_project_point_to_plane(scene, ob, 
rv3d, origin,
-   axis, );
+   ED_gp_project_point_to_plane(
 -  ob, rv3d, origin,
 -  axis, );
++  scene, ob, rv3d, origin,
++  axis, );
  
copy_v3_v3(>x, );
  
diff --cc source/blender/editors/gpencil/gpencil_primitive.c
index e57b66839ef,88906488e1a..fcba1ae7030
--- a/source/blender/editors/gpencil/gpencil_primitive.c
+++ b/source/blender/editors/gpencil/gpencil_primitive.c
@@@ -924,12 -925,12 +925,13 @@@ static void gp_primitive_update_strokes
  
/* get origin to reproject point */
float origin[3];
-   ED_gp_get_drawing_reference(tgpi->scene, tgpi->ob, 
tgpi->gpl,
-   ts->gpencil_v3d_align, origin);
+   ED_gp_get_drawing_reference(
+   tgpi->scene, tgpi->ob, tgpi->gpl,
+   ts->gpencil_v3d_align, origin);
/* reproject current */
ED_gpencil_tpoint_to_point(tgpi->ar, origin, tpt, );
 -  ED_gp_project_point_to_plane(tgpi->ob, tgpi->rv3d, 
origin, tgpi->lock_axis - 1, );
 +  ED_gp_project_point_to_plane(tgpi->scene, tgpi->ob, 
tgpi->rv3d,
 +  
origin, tgpi->lock_axis - 1, );
  
/* reproject previous */
ED_gpencil_tpoint_to_point(tgpi->ar, origin, tptb, 
);
@@@ -989,11 -989,11 +991,12 @@@
/* reproject to plane */
if (!is_depth) {
float origin[3];
-   ED_gp_get_drawing_reference(tgpi->scene, tgpi->ob, tgpi->gpl,
-   ts->gpencil_v3d_align, origin);
+   ED_gp_get_drawing_reference(
+   tgpi->scene, tgpi->ob, tgpi->gpl,
+   ts->gpencil_v3d_align, origin);
ED_gp_project_stroke_to_plane(
 -  tgpi->ob, tgpi->rv3d, gps, origin, 
ts->gp_sculpt.lock_axis - 1);
 +  tgpi->scene, tgpi->ob, tgpi->rv3d, gps,
 +  origin, ts->gp_sculpt.lock_axis - 1);
}
  
/* if parented 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


[Bf-blender-cvs] [98af74b9366] master: Fix T62297: Grease Pencil dots drawing crashes Blender

2019-03-15 Thread Antonioya
Commit: 98af74b9366b0e1006333fe9e493f3ea50ac952a
Author: Antonioya
Date:   Fri Mar 15 10:07:18 2019 +0100
Branches: master
https://developer.blender.org/rB98af74b9366b0e1006333fe9e493f3ea50ac952a

Fix T62297: Grease Pencil dots drawing crashes Blender

Fix again this bug. Maybe it was introduced when change how wireframe mode by 
object works.

===

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

===

diff --git a/source/blender/draw/engines/gpencil/gpencil_draw_utils.c 
b/source/blender/draw/engines/gpencil/gpencil_draw_utils.c
index ce01044a885..a50b4fac15c 100644
--- a/source/blender/draw/engines/gpencil/gpencil_draw_utils.c
+++ b/source/blender/draw/engines/gpencil/gpencil_draw_utils.c
@@ -685,7 +685,7 @@ static DRWShadingGroup *DRW_gpencil_shgroup_point_create(
DRW_shgroup_uniform_float(grp, "pixfactor", 
>storage->pixfactor, 1);
}
/* viewport x-ray */
-   stl->shgroups[id].is_xray = (ob->dt == OB_WIRE) ? 1 : 
stl->storage->is_xray;
+   stl->shgroups[id].is_xray = ((ob) && (ob->dt == OB_WIRE)) ? 1 : 
stl->storage->is_xray;
DRW_shgroup_uniform_int(grp, "viewport_xray", (const int 
*)>shgroups[id].is_xray, 1);
DRW_shgroup_uniform_int(grp, "shading_type", (const int 
*)>storage->shade_render, 2);
}

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


[Bf-blender-cvs] [41b289be300] master: Cleanup: unused imports

2019-03-15 Thread Campbell Barton
Commit: 41b289be30021b8fc63031aba701065f1c40ed47
Author: Campbell Barton
Date:   Fri Mar 15 19:45:21 2019 +1100
Branches: master
https://developer.blender.org/rB41b289be30021b8fc63031aba701065f1c40ed47

Cleanup: unused imports

===

M   intern/cycles/app/io_export_cycles_xml.py
M   release/scripts/modules/bl_app_override/helpers.py
M   release/scripts/modules/bpy_extras/mesh_utils.py
M   release/scripts/modules/rna_info.py
M   release/scripts/templates_py/ui_tool_simple.py

===

diff --git a/intern/cycles/app/io_export_cycles_xml.py 
b/intern/cycles/app/io_export_cycles_xml.py
index 437a504d014..a1b42f72f7c 100644
--- a/intern/cycles/app/io_export_cycles_xml.py
+++ b/intern/cycles/app/io_export_cycles_xml.py
@@ -16,7 +16,6 @@
 
 # XML exporter for generating test files, not intended for end users
 
-import os
 import xml.etree.ElementTree as etree
 import xml.dom.minidom as dom
 
diff --git a/release/scripts/modules/bl_app_override/helpers.py 
b/release/scripts/modules/bl_app_override/helpers.py
index 981039e8ddc..a6f67f2d435 100644
--- a/release/scripts/modules/bl_app_override/helpers.py
+++ b/release/scripts/modules/bl_app_override/helpers.py
@@ -100,7 +100,6 @@ class AppOverrideState:
 
 def _setup_addons(self):
 import sys
-import os
 
 sys_path = []
 if self.addon_paths is not None:
diff --git a/release/scripts/modules/bpy_extras/mesh_utils.py 
b/release/scripts/modules/bpy_extras/mesh_utils.py
index e76d1f1815e..98ddc731028 100644
--- a/release/scripts/modules/bpy_extras/mesh_utils.py
+++ b/release/scripts/modules/bpy_extras/mesh_utils.py
@@ -443,7 +443,6 @@ def triangle_random_points(num_points, loop_triangles):
 """
 
 from random import random
-from mathutils.geometry import area_tri
 
 # For each triangle, generate the required number of random points
 sampled_points = [None] * (num_points * len(loop_triangles))
diff --git a/release/scripts/modules/rna_info.py 
b/release/scripts/modules/rna_info.py
index 4a2b1085143..6f51dcf3aeb 100644
--- a/release/scripts/modules/rna_info.py
+++ b/release/scripts/modules/rna_info.py
@@ -756,8 +756,7 @@ def BuildRNAInfo():
 
 
 def main():
-import rna_info
-struct = rna_info.BuildRNAInfo()[0]
+struct = BuildRNAInfo()[0]
 data = []
 for _struct_id, v in sorted(struct.items()):
 struct_id_str = v.identifier  # "".join(sid for sid in struct_id if 
struct_id)
diff --git a/release/scripts/templates_py/ui_tool_simple.py 
b/release/scripts/templates_py/ui_tool_simple.py
index 9cd71d0160c..afda5088e69 100644
--- a/release/scripts/templates_py/ui_tool_simple.py
+++ b/release/scripts/templates_py/ui_tool_simple.py
@@ -1,7 +1,6 @@
 # This example adds an object mode tool to the toolbar.
 # This is just the circle-select and lasso tools tool.
 import bpy
-from bpy.utils.toolsystem import ToolDef
 from bpy.types import WorkSpaceTool
 
 class MyTool(WorkSpaceTool):

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


[Bf-blender-cvs] [25b6802aca4] greasepencil-object: GPencil: Drawing locked to 3D cursor (wip)

2019-03-15 Thread Antonioya
Commit: 25b6802aca4aa14f490547545221bed693711048
Author: Antonioya
Date:   Fri Mar 15 08:43:39 2019 +0100
Branches: greasepencil-object
https://developer.blender.org/rB25b6802aca4aa14f490547545221bed693711048

GPencil: Drawing locked to 3D cursor (wip)

Now it's possible to draw strokes attached to a plane locked to 3D cursor.

Still pending the lock in Sculpt mode.

===

M   source/blender/draw/engines/gpencil/gpencil_draw_cache_impl.c
M   source/blender/draw/engines/gpencil/gpencil_engine.c
M   source/blender/editors/gpencil/gpencil_edit.c
M   source/blender/editors/gpencil/gpencil_fill.c
M   source/blender/editors/gpencil/gpencil_paint.c
M   source/blender/editors/gpencil/gpencil_primitive.c
M   source/blender/editors/gpencil/gpencil_utils.c
M   source/blender/editors/include/ED_gpencil.h
M   source/blender/makesdna/DNA_scene_types.h
M   source/blender/makesrna/intern/rna_sculpt_paint.c

===

diff --git a/source/blender/draw/engines/gpencil/gpencil_draw_cache_impl.c 
b/source/blender/draw/engines/gpencil/gpencil_draw_cache_impl.c
index 70e679d4e72..e555375e593 100644
--- a/source/blender/draw/engines/gpencil/gpencil_draw_cache_impl.c
+++ b/source/blender/draw/engines/gpencil/gpencil_draw_cache_impl.c
@@ -270,7 +270,7 @@ GPUBatch *DRW_gpencil_get_buffer_stroke_geom(bGPdata *gpd, 
short thickness)
 
for (int i = 0; i < totpoints; i++, tpt++) {
ED_gpencil_tpoint_to_point(ar, origin, tpt, );
-   ED_gp_project_point_to_plane(ob, rv3d, origin, 
ts->gp_sculpt.lock_axis - 1, );
+   ED_gp_project_point_to_plane(scene, ob, rv3d, origin, 
ts->gp_sculpt.lock_axis - 1, );
 
/* first point for adjacency (not drawn) */
if (i == 0) {
@@ -361,7 +361,7 @@ GPUBatch *DRW_gpencil_get_buffer_point_geom(bGPdata *gpd, 
short thickness)
 
for (int i = 0; i < totpoints; i++, tpt++) {
ED_gpencil_tpoint_to_point(ar, origin, tpt, );
-   ED_gp_project_point_to_plane(ob, rv3d, origin, 
ts->gp_sculpt.lock_axis - 1, );
+   ED_gp_project_point_to_plane(scene, ob, rv3d, origin, 
ts->gp_sculpt.lock_axis - 1, );
 
/* set point */
gpencil_set_stroke_point(
diff --git a/source/blender/draw/engines/gpencil/gpencil_engine.c 
b/source/blender/draw/engines/gpencil/gpencil_engine.c
index d3afe4e3cc4..04e78feb07f 100644
--- a/source/blender/draw/engines/gpencil/gpencil_engine.c
+++ b/source/blender/draw/engines/gpencil/gpencil_engine.c
@@ -634,14 +634,30 @@ void GPENCIL_cache_populate(void *vedata, Object *ob)
e_data.batch_grid = DRW_gpencil_get_grid(ob);
 
/* define grid orientation */
-   if (ts->gp_sculpt.lock_axis != GP_LOCKAXIS_VIEW) {
-   copy_m4_m4(stl->storage->grid_matrix, 
ob->obmat);
-   }
-   else {
-   /* align always to view */
-   invert_m4_m4(stl->storage->grid_matrix, 
draw_ctx->rv3d->viewmat);
-   /* copy ob location */
-   copy_v3_v3(stl->storage->grid_matrix[3], 
ob->obmat[3]);
+   switch (ts->gp_sculpt.lock_axis) {
+   case GP_LOCKAXIS_VIEW:
+   {
+   /* align always to view */
+   invert_m4_m4(stl->storage->grid_matrix, 
draw_ctx->rv3d->viewmat);
+   /* copy ob location */
+   
copy_v3_v3(stl->storage->grid_matrix[3], ob->obmat[3]);
+   break;
+   }
+   case GP_LOCKAXIS_CURSOR:
+   {
+   const View3DCursor *cursor = 
>cursor;
+   float scale[3] = { 1.0f, 1.0f, 1.0f };
+   
loc_eul_size_to_mat4(stl->storage->grid_matrix,
+   
cursor->location,
+   
cursor->rotation_euler,
+   
scale);
+   break;
+   }
+   default:
+   {
+   copy_m4_m4(stl->storage->grid_matrix, 
ob->obmat);
+   break;
+   }
}
 
DRW_shgroup_call_add(
diff --git 

[Bf-blender-cvs] [62377431114] blender2.7: Cycles/OpenCL: Added missing opencl programs

2019-03-15 Thread Jeroen Bakker
Commit: 62377431114411c50ededadf98fda284ec4061c5
Author: Jeroen Bakker
Date:   Fri Mar 15 08:11:28 2019 +0100
Branches: blender2.7
https://developer.blender.org/rB62377431114411c50ededadf98fda284ec4061c5

Cycles/OpenCL: Added missing opencl programs

The functions that determine the program name + filename of kernels
were missing some base kernels like denoising and base. For completeness
I added those kernels so the function returns the correct results.

===

M   intern/cycles/device/opencl/opencl_split.cpp

===

diff --git a/intern/cycles/device/opencl/opencl_split.cpp 
b/intern/cycles/device/opencl/opencl_split.cpp
index 422813c2e07..57612098b34 100644
--- a/intern/cycles/device/opencl/opencl_split.cpp
+++ b/intern/cycles/device/opencl/opencl_split.cpp
@@ -40,7 +40,13 @@ struct texture_slot_t {
int slot;
 };
 
-static const string fast_compiled_kernels =
+static const string NON_SPLIT_KERNELS =
+   "denoising "
+   "base "
+   "background "
+   "displace ";
+
+static const string SPLIT_BUNDLE_KERNELS =
"data_init "
"path_init "
"state_buffer_size "
@@ -55,7 +61,10 @@ static const string fast_compiled_kernels =
 
 const string OpenCLDevice::get_opencl_program_name(const string& kernel_name)
 {
-   if (fast_compiled_kernels.find(kernel_name) != std::string::npos) {
+   if (NON_SPLIT_KERNELS.find(kernel_name) != std::string::npos) {
+   return kernel_name;
+   }
+   else if (SPLIT_BUNDLE_KERNELS.find(kernel_name) != std::string::npos) {
return "split_bundle";
}
else {
@@ -65,7 +74,10 @@ const string OpenCLDevice::get_opencl_program_name(const 
string& kernel_name)
 
 const string OpenCLDevice::get_opencl_program_filename(const string& 
kernel_name)
 {
-   if (fast_compiled_kernels.find(kernel_name) != std::string::npos) {
+   if (kernel_name == "denoising") {
+   return "filter.cl";
+   }
+   else if (SPLIT_BUNDLE_KERNELS.find(kernel_name) != std::string::npos) {
return "kernel_split_bundle.cl";
}
else {

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


[Bf-blender-cvs] [3400fe3ecee] master: Tool System: split UI label from tool identifiers

2019-03-15 Thread Campbell Barton
Commit: 3400fe3ecee99cb6a74455943f2755e6f22ef047
Author: Campbell Barton
Date:   Fri Mar 15 12:45:41 2019 +1100
Branches: master
https://developer.blender.org/rB3400fe3ecee99cb6a74455943f2755e6f22ef047

Tool System: split UI label from tool identifiers

Prepare for exposing tool registration to the Python API.

- Generated tools can use their own prefix so naming collisions
  won't happen between hard coded & generated tools.
- Add-on authors can use the add-on name as a prefix.

Currently the names match, renaming will happen next.

===

M   release/scripts/modules/bl_keymap_utils/keymap_from_toolbar.py
M   release/scripts/presets/keyconfig/keymap_data/blender_default.py
M   release/scripts/startup/bl_operators/wm.py
M   release/scripts/startup/bl_ui/space_toolsystem_common.py
M   release/scripts/startup/bl_ui/space_toolsystem_toolbar.py
M   release/scripts/startup/bl_ui/space_topbar.py
M   release/scripts/startup/bl_ui/space_view3d.py
M   source/blender/editors/interface/interface_query.c
M   source/blender/editors/interface/interface_region_tooltip.c
M   source/blender/makesrna/intern/rna_workspace.c
M   source/blender/makesrna/intern/rna_workspace_api.c
M   source/blender/windowmanager/WM_toolsystem.h
M   source/blender/windowmanager/intern/wm_keymap_utils.c
M   source/blender/windowmanager/intern/wm_toolsystem.c

===

diff --git a/release/scripts/modules/bl_keymap_utils/keymap_from_toolbar.py 
b/release/scripts/modules/bl_keymap_utils/keymap_from_toolbar.py
index 66d05903335..0c812780a23 100644
--- a/release/scripts/modules/bl_keymap_utils/keymap_from_toolbar.py
+++ b/release/scripts/modules/bl_keymap_utils/keymap_from_toolbar.py
@@ -59,7 +59,7 @@ def generate(context, space_type):
 for item in 
ToolSelectPanelHelper._tools_flatten(cls.tools_from_context(context))
 if item is not None
 ]
-items_all_text = {item_container[0].text for item_container in items_all}
+items_all_id = {item_container[0].idname for item_container in items_all}
 
 # Press the toolbar popup key again to set the default tool,
 # this is useful because the select box tool is useful as a way
@@ -70,7 +70,7 @@ def generate(context, space_type):
 # TODO: support other tools for modes which don't use this tool.
 tap_reset_tool = "Cursor"
 # Check the tool is available in the current context.
-if tap_reset_tool not in items_all_text:
+if tap_reset_tool not in items_all_id:
 use_tap_reset = False
 
 from bl_operators.wm import use_toolbar_release_hack
@@ -102,13 +102,13 @@ def generate(context, space_type):
 for kmi_src in keymap_src.keymap_items:
 # Skip tools that aren't currently shown.
 if (
-(kmi_src.idname == "wm.tool_set_by_name") and
-(kmi_src.properties.name not in items_all_text)
+(kmi_src.idname == "wm.tool_set_by_id") and
+(kmi_src.properties.name not in items_all_id)
 ):
 continue
 keymap.keymap_items.new_from_item(kmi_src)
 del keymap_src
-del items_all_text
+del items_all_id
 
 
 kmi_unique_args = set()
@@ -122,7 +122,7 @@ def generate(context, space_type):
 cls = ToolSelectPanelHelper._tool_class_from_space_type(space_type)
 
 if use_hack_properties:
-kmi_hack = keymap.keymap_items.new("wm.tool_set_by_name", 'NONE', 
'PRESS')
+kmi_hack = keymap.keymap_items.new("wm.tool_set_by_id", 'NONE', 
'PRESS')
 kmi_hack_properties = kmi_hack.properties
 kmi_hack.active = False
 
@@ -148,9 +148,9 @@ def generate(context, space_type):
 # First check for direct assignment, if this tool already has a 
key, no need to add a new one.
 kmi_hack_properties.name = tap_reset_tool
 kmi_found = wm.keyconfigs.find_item_from_operator(
-idname="wm.tool_set_by_name",
+idname="wm.tool_set_by_id",
 context='INVOKE_REGION_WIN',
-# properties={"name": item.text},
+# properties={"name": item.idname},
 properties=kmi_hack_properties,
 include={'KEYBOARD'},
 )[1]
@@ -165,7 +165,7 @@ def generate(context, space_type):
 items_all[:] = [
 item_container
 for item_container in items_all
-if item_container[0].text != tap_reset_tool
+if item_container[0].idname != tap_reset_tool
 ]
 
 # ---
@@ -179,11 +179,11 @@ def generate(context, space_type):
 # Only check the first item in the tools key-map (a little arbitrary).
 if use_hack_properties:
 # First check for direct assignment.
-kmi_hack_properties.name = item.text
+ 

[Bf-blender-cvs] [d4156b46d7a] master: Tool System: use categories for tool identifiers

2019-03-15 Thread Campbell Barton
Commit: d4156b46d7a4acb22f3abfde14b05c46ead34b43
Author: Campbell Barton
Date:   Fri Mar 15 14:18:21 2019 +1100
Branches: master
https://developer.blender.org/rBd4156b46d7a4acb22f3abfde14b05c46ead34b43

Tool System: use categories for tool identifiers

Tools that come with Blender use 'builtin' or 'builtin_brush' prefix.

===

M   release/scripts/modules/bl_keymap_utils/keymap_from_toolbar.py
M   release/scripts/presets/keyconfig/keymap_data/blender_default.py
M   release/scripts/startup/bl_ui/space_toolsystem_toolbar.py
M   release/scripts/startup/bl_ui/space_topbar.py
M   release/scripts/startup/bl_ui/space_view3d.py
M   source/blender/blenkernel/BKE_blender_version.h
M   source/blender/blenloader/intern/versioning_280.c
M   source/blender/editors/transform/transform_gizmo_3d.c
M   source/blender/windowmanager/intern/wm_toolsystem.c

===

diff --git a/release/scripts/modules/bl_keymap_utils/keymap_from_toolbar.py 
b/release/scripts/modules/bl_keymap_utils/keymap_from_toolbar.py
index 0c812780a23..e08e8b45135 100644
--- a/release/scripts/modules/bl_keymap_utils/keymap_from_toolbar.py
+++ b/release/scripts/modules/bl_keymap_utils/keymap_from_toolbar.py
@@ -68,7 +68,7 @@ def generate(context, space_type):
 # a shortcut based workflow (before the tool system was added).
 use_tap_reset = True
 # TODO: support other tools for modes which don't use this tool.
-tap_reset_tool = "Cursor"
+tap_reset_tool = "builtin.cursor"
 # Check the tool is available in the current context.
 if tap_reset_tool not in items_all_id:
 use_tap_reset = False
@@ -317,7 +317,7 @@ def generate(context, space_type):
 # -
 # Assign A-Z to Keys
 #
-# When th keys are free.
+# When the keys are free.
 
 if use_auto_keymap_alpha:
 # Map all unmapped keys to numbers,
diff --git a/release/scripts/presets/keyconfig/keymap_data/blender_default.py 
b/release/scripts/presets/keyconfig/keymap_data/blender_default.py
index 91651b7f549..c1f7785de4e 100644
--- a/release/scripts/presets/keyconfig/keymap_data/blender_default.py
+++ b/release/scripts/presets/keyconfig/keymap_data/blender_default.py
@@ -5029,9 +5029,9 @@ def km_popup_toolbar(_params):
 "Toolbar Popup",
 {"space_type": 'EMPTY', "region_type": 'TEMPORARY'},
 {"items": [
-op_tool("Select", {"type": 'W', "value": 'PRESS'}),
-op_tool("Transform", {"type": 'T', "value": 'PRESS'}),
-op_tool("Measure", {"type": 'M', "value": 'PRESS'}),
+op_tool("builtin.select", {"type": 'W', "value": 'PRESS'}),
+op_tool("builtin.transform", {"type": 'T', "value": 'PRESS'}),
+op_tool("builtin.measure", {"type": 'M', "value": 'PRESS'}),
 ]},
 )
 
diff --git a/release/scripts/startup/bl_ui/space_toolsystem_toolbar.py 
b/release/scripts/startup/bl_ui/space_toolsystem_toolbar.py
index b0b8327af9a..092494d783f 100644
--- a/release/scripts/startup/bl_ui/space_toolsystem_toolbar.py
+++ b/release/scripts/startup/bl_ui/space_toolsystem_toolbar.py
@@ -39,6 +39,7 @@ def kmi_to_string_or_none(kmi):
 
 def generate_from_enum_ex(
 context, *,
+idname_prefix,
 icon_prefix,
 type,
 attr,
@@ -51,7 +52,7 @@ def generate_from_enum_ex(
 tool_defs.append(
 ToolDef.from_dict(
 dict(
-idname=name,
+idname=idname_prefix + name,
 label=name,
 icon=icon_prefix + idname.lower(),
 data_block=idname,
@@ -86,7 +87,7 @@ class _defs_view3d_generic:
 layout.prop(props, "use_depth")
 layout.prop(props, "orientation")
 return dict(
-idname="Cursor",
+idname="builtin.cursor",
 label="Cursor",
 description=(
 "Set the cursor location, drag to transform"
@@ -99,7 +100,7 @@ class _defs_view3d_generic:
 @ToolDef.from_fn
 def cursor_click():
 return dict(
-idname="None",
+idname="builtin.none",
 label="None",
 icon="ops.generic.cursor",
 keymap=(),
@@ -126,7 +127,7 @@ class _defs_view3d_generic:
 kmi_to_string_or_none(kmi_remove),
 )
 return dict(
-idname="Measure",
+idname="builtin.measure",
 label="Measure",
 description=description,
 icon="ops.view3d.ruler",
@@ -179,7 +180,7 @@ class _defs_annotate:
 @ToolDef.from_fn.with_args(draw_settings=draw_settings_common)
 def scribble(*, draw_settings):
 return dict(
-idname="Annotate",
+idname="builtin.annotate",
 

[Bf-blender-cvs] [f29b80ff79e] master: Tool System: add tool registration API

2019-03-15 Thread Campbell Barton
Commit: f29b80ff79ec7c6a2532d0b0eb5841d00cc7af1b
Author: Campbell Barton
Date:   Thu Mar 14 14:15:29 2019 +1100
Branches: master
https://developer.blender.org/rBf29b80ff79ec7c6a2532d0b0eb5841d00cc7af1b

Tool System: add tool registration API

This mimics RNA style class registration,
keeping the same internal data types.

Currently there is a template which shows an example of adding a tool
group with a keymap.

Icon generation still needs to be exposed for general use.

===

M   release/scripts/modules/bpy/utils/__init__.py
A   release/scripts/templates_py/ui_tool_simple.py

===

diff --git a/release/scripts/modules/bpy/utils/__init__.py 
b/release/scripts/modules/bpy/utils/__init__.py
index ce7781517b8..81b62b59fa6 100644
--- a/release/scripts/modules/bpy/utils/__init__.py
+++ b/release/scripts/modules/bpy/utils/__init__.py
@@ -39,6 +39,7 @@ __all__ = (
 "unregister_manual_map",
 "register_classes_factory",
 "register_submodule_factory",
+"register_tool",
 "make_rna_paths",
 "manual_map",
 "previews",
@@ -50,6 +51,7 @@ __all__ = (
 "smpte_from_seconds",
 "units",
 "unregister_class",
+"unregister_tool",
 "user_resource",
 "execfile",
 )
@@ -715,6 +717,210 @@ def register_submodule_factory(module_name, 
submodule_names):
 return register, unregister
 
 
+# -
+# Tool Registration
+
+
+def register_tool(tool_cls, *, after=None, separator=False, group=False):
+"""
+Register a tool in the toolbar.
+
+:arg tool: A tool subclass.
+:type tool: :class:`bpy.types.WorkSpaceTool` subclass.
+:arg space_type: Space type identifier.
+:type space_type: string
+:arg after: Optional identifiers this tool will be added after.
+:type after: collection of strings or None.
+:arg separator: When true, add a separator before this tool.
+:type separator: bool
+:arg group: When true, add a new nested group of tools.
+:type group: bool
+"""
+space_type = tool_cls.bl_space_type
+context_mode = tool_cls.bl_context_mode
+
+from bl_ui.space_toolsystem_common import (
+ToolSelectPanelHelper,
+ToolDef,
+)
+
+cls = ToolSelectPanelHelper._tool_class_from_space_type(space_type)
+if cls is None:
+raise Exception(f"Space type {space_type!r} has no toolbar")
+tools = cls._tools[context_mode]
+
+# First sanity check
+from bpy.types import WorkSpaceTool
+tools_id = {
+item.idname for item in ToolSelectPanelHelper._tools_flatten(tools)
+if item is not None
+}
+if not issubclass(tool_cls, WorkSpaceTool):
+raise Exception(f"Expected WorkSpaceTool subclass, not 
{type(tool_cls)!r}")
+if tool_cls.bl_idname in tools_id:
+raise Exception(f"Tool {tool_cls.bl_idname!r} already exists!")
+del tools_id, WorkSpaceTool
+
+# Convert the class into a ToolDef.
+def tool_from_class(tool_cls):
+# Convert class to tuple, store in the class for removal.
+tool_def = ToolDef.from_dict({
+"idname": tool_cls.bl_idname,
+"label": tool_cls.bl_label,
+"description": getattr(tool_cls, "bl_description", 
tool_cls.__doc__),
+"icon": getattr(tool_cls, "bl_icon", None),
+"cursor": getattr(tool_cls, "bl_cursor", None),
+"widget": getattr(tool_cls, "bl_widget", None),
+"keymap": getattr(tool_cls, "bl_keymap", None),
+"data_block": getattr(tool_cls, "bl_data_block", None),
+"operator": getattr(tool_cls, "bl_operator", None),
+"draw_settings": getattr(tool_cls, "draw_settings", None),
+"draw_cursor": getattr(tool_cls, "draw_cursor", None),
+})
+tool_cls._bl_tool = tool_def
+
+keymap_data = tool_def.keymap
+if keymap_data is not None:
+if context_mode is None:
+context_descr = "All"
+else:
+context_descr = context_mode.replace("_", " ").title()
+from bpy import context
+wm = context.window_manager
+kc = wm.keyconfigs.default
+if callable(keymap_data[0]):
+cls._km_action_simple(kc, context_descr, tool_def.label, 
keymap_data)
+return tool_def
+
+tool_converted = tool_from_class(tool_cls)
+
+if group:
+# Create a new group
+tool_converted = (tool_converted,)
+
+
+tool_def_insert = (
+(None, tool_converted) if separator else
+(tool_converted,)
+)
+
+def skip_to_end_of_group(seq, i):
+i_prev = i
+while i < len(seq) and seq[i] is not None:
+i_prev = i
+i += 1
+return i_prev
+
+changed = False
+if after is not None:
+for i, item in