[Bf-blender-cvs] [ab519b91b2c] master: Make this link again; needs more work for orbis to work.

2019-10-04 Thread Howard Trickey
Commit: ab519b91b2c4f14ac8cd30038e879fffa290e0cc
Author: Howard Trickey
Date:   Fri Oct 4 18:33:20 2019 -0400
Branches: master
https://developer.blender.org/rBab519b91b2c4f14ac8cd30038e879fffa290e0cc

Make this link again; needs more work for orbis to work.

===

M   build_files/cmake/platform/platform_apple.cmake

===

diff --git a/build_files/cmake/platform/platform_apple.cmake 
b/build_files/cmake/platform/platform_apple.cmake
index 3cc6eb00476..249546dd216 100644
--- a/build_files/cmake/platform/platform_apple.cmake
+++ b/build_files/cmake/platform/platform_apple.cmake
@@ -158,7 +158,7 @@ if(WITH_CODEC_FFMPEG)
 mp3lame swscale x264 xvidcore
 theora theoradec theoraenc
 vorbis vorbisenc vorbisfile ogg
-opus vpx swresample)
+vpx swresample)
   set(FFMPEG_LIBPATH ${FFMPEG}/lib)
 endif()

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


[Bf-blender-cvs] [1f6a34161de] master: make_deps: Fix building ffmpeg on windows

2019-10-04 Thread Ray Molenkamp
Commit: 1f6a34161de7bf577a27a2d3f64cabcb81848653
Author: Ray Molenkamp
Date:   Fri Oct 4 14:09:50 2019 -0600
Branches: master
https://developer.blender.org/rB1f6a34161de7bf577a27a2d3f64cabcb81848653

make_deps: Fix building ffmpeg on windows

I have no explanation on why this is needed, but it refused to
find opus without it.

===

M   build_files/build_environment/cmake/ffmpeg.cmake

===

diff --git a/build_files/build_environment/cmake/ffmpeg.cmake 
b/build_files/build_environment/cmake/ffmpeg.cmake
index 307a5f97aa6..9ff52914f53 100644
--- a/build_files/build_environment/cmake/ffmpeg.cmake
+++ b/build_files/build_environment/cmake/ffmpeg.cmake
@@ -19,7 +19,7 @@
 set(FFMPEG_CFLAGS "-I${mingw_LIBDIR}/lame/include 
-I${mingw_LIBDIR}/openjpeg/include/ -I${mingw_LIBDIR}/ogg/include 
-I${mingw_LIBDIR}/vorbis/include -I${mingw_LIBDIR}/theora/include 
-I${mingw_LIBDIR}/opus/include -I${mingw_LIBDIR}/vpx/include 
-I${mingw_LIBDIR}/x264/include -I${mingw_LIBDIR}/xvidcore/include 
-I${mingw_LIBDIR}/zlib/include")
 set(FFMPEG_LDFLAGS "-L${mingw_LIBDIR}/lame/lib -L${mingw_LIBDIR}/openjpeg/lib 
-L${mingw_LIBDIR}/ogg/lib -L${mingw_LIBDIR}/vorbis/lib 
-L${mingw_LIBDIR}/theora/lib -L${mingw_LIBDIR}/opus/lib 
-L${mingw_LIBDIR}/vpx/lib -L${mingw_LIBDIR}/x264/lib 
-L${mingw_LIBDIR}/xvidcore/lib -L${mingw_LIBDIR}/zlib/lib")
 set(FFMPEG_EXTRA_FLAGS --pkg-config-flags=--static 
--extra-cflags=${FFMPEG_CFLAGS} --extra-ldflags=${FFMPEG_LDFLAGS})
-set(FFMPEG_ENV 
PKG_CONFIG_PATH=${mingw_LIBDIR}/openjpeg/lib/pkgconfig:${mingw_LIBDIR}/x264/lib/pkgconfig:${mingw_LIBDIR}/vorbis/lib/pkgconfig:${mingw_LIBDIR}/ogg/lib/pkgconfig:${mingw_LIBDIR}:${mingw_LIBDIR}/vpx/lib/pkgconfig:${mingw_LIBDIR}/theora/lib/pkgconfig:${mingw_LIBDIR}/openjpeg/lib/pkgconfig:${mingw_LIBDIR}/opus/lib/pkgconfig)
+set(FFMPEG_ENV 
PKG_CONFIG_PATH=${mingw_LIBDIR}/openjpeg/lib/pkgconfig:${mingw_LIBDIR}/x264/lib/pkgconfig:${mingw_LIBDIR}/vorbis/lib/pkgconfig:${mingw_LIBDIR}/ogg/lib/pkgconfig:${mingw_LIBDIR}:${mingw_LIBDIR}/vpx/lib/pkgconfig:${mingw_LIBDIR}/theora/lib/pkgconfig:${mingw_LIBDIR}/openjpeg/lib/pkgconfig:${mingw_LIBDIR}/opus/lib/pkgconfig:)
 
 if(WIN32)
   set(FFMPEG_ENV set ${FFMPEG_ENV} &&)

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


[Bf-blender-cvs] [7c2affd350b] master: Fix: Headless build

2019-10-04 Thread Ray Molenkamp
Commit: 7c2affd350b6f4a4fb6a6a20632762186fc1867e
Author: Ray Molenkamp
Date:   Fri Oct 4 13:23:26 2019 -0600
Branches: master
https://developer.blender.org/rB7c2affd350b6f4a4fb6a6a20632762186fc1867e

Fix: Headless build

===

M   intern/ghost/intern/GHOST_SystemNULL.h
M   intern/ghost/intern/GHOST_WindowNULL.h

===

diff --git a/intern/ghost/intern/GHOST_SystemNULL.h 
b/intern/ghost/intern/GHOST_SystemNULL.h
index 93aea87e9a6..10138bfc6eb 100644
--- a/intern/ghost/intern/GHOST_SystemNULL.h
+++ b/intern/ghost/intern/GHOST_SystemNULL.h
@@ -114,8 +114,9 @@ class GHOST_SystemNULL : public GHOST_System {
   GHOST_TWindowState state,
   GHOST_TDrawingContextType type,
   GHOST_GLSettings glSettings,
-  bool exclusive,
-  const GHOST_TEmbedderWindowID parentWindow)
+  const bool exclusive,
+  const bool is_dialog,
+  const GHOST_IWindow *parentWindow)
   {
 return new GHOST_WindowNULL(this,
 title,
diff --git a/intern/ghost/intern/GHOST_WindowNULL.h 
b/intern/ghost/intern/GHOST_WindowNULL.h
index 1d332a7dc3e..29f3eee7cce 100644
--- a/intern/ghost/intern/GHOST_WindowNULL.h
+++ b/intern/ghost/intern/GHOST_WindowNULL.h
@@ -36,6 +36,11 @@ class GHOST_WindowNULL : public GHOST_Window {
 return NULL;
   }
 
+  GHOST_TSuccess hasCursorShape(GHOST_TStandardCursor)
+  {
+return GHOST_kSuccess;
+  }
+
   GHOST_WindowNULL(GHOST_SystemNULL *system,
const STR_String ,
GHOST_TInt32 left,
@@ -43,7 +48,7 @@ class GHOST_WindowNULL : public GHOST_Window {
GHOST_TUns32 width,
GHOST_TUns32 height,
GHOST_TWindowState state,
-   const GHOST_TEmbedderWindowID parentWindow,
+   const GHOST_IWindow *parentWindow,
GHOST_TDrawingContextType type,
const bool stereoVisual)
   : GHOST_Window(width, height, state, stereoVisual, false), 
m_system(system)

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


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

2019-10-04 Thread Antonio Vazquez
Commit: 5ed21899617781c2976ea3d780fed54b3bc27f83
Author: Antonio Vazquez
Date:   Fri Oct 4 21:00:25 2019 +0200
Branches: greasepencil-object
https://developer.blender.org/rB5ed21899617781c2976ea3d780fed54b3bc27f83

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] [5287eaac5b0] master: Small cleanup

2019-10-04 Thread Dalai Felinto
Commit: 5287eaac5b09ee61b71900fc0e64416550a88e0d
Author: Dalai Felinto
Date:   Fri Oct 4 10:53:57 2019 -0300
Branches: master
https://developer.blender.org/rB5287eaac5b09ee61b71900fc0e64416550a88e0d

Small cleanup

===

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 4759a3cb0db..40bb1c7378f 100644
--- a/source/blender/editors/object/object_edit.c
+++ b/source/blender/editors/object/object_edit.c
@@ -1547,7 +1547,7 @@ static int move_to_collection_exec(bContext *C, 
wmOperator *op)
   }
 
   int collection_index = RNA_property_int_get(op->ptr, prop);
-  collection = BKE_collection_from_index(CTX_data_scene(C), collection_index);
+  collection = BKE_collection_from_index(scene, collection_index);
   if (collection == NULL) {
 BKE_report(op->reports, RPT_ERROR, "Unexpected error, collection not 
found");
 return OPERATOR_CANCELLED;

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


[Bf-blender-cvs] [8f1f756b839] master: Subdiv CCG: add utility functions for accessing multires vertex neighbors

2019-10-04 Thread Sergey Sharybin
Commit: 8f1f756b839942531c69a7608c25ea85de1beb8a
Author: Sergey Sharybin
Date:   Fri Oct 4 18:49:39 2019 +0200
Branches: master
https://developer.blender.org/rB8f1f756b839942531c69a7608c25ea85de1beb8a

Subdiv CCG: add utility functions for accessing multires vertex neighbors

This is to be used by the new sculpting tools.

===

M   source/blender/blenkernel/BKE_subdiv_ccg.h
M   source/blender/blenkernel/intern/subdiv_ccg.c
M   source/blender/editors/sculpt_paint/sculpt.c

===

diff --git a/source/blender/blenkernel/BKE_subdiv_ccg.h 
b/source/blender/blenkernel/BKE_subdiv_ccg.h
index 9b7c613aa94..6e2733eb1ac 100644
--- a/source/blender/blenkernel/BKE_subdiv_ccg.h
+++ b/source/blender/blenkernel/BKE_subdiv_ccg.h
@@ -131,6 +131,9 @@ typedef struct SubdivCCG {
   /* Resolution of grid. All grids have matching resolution, and resolution
* is same as ptex created for non-quad polygons. */
   int grid_size;
+  /* Size of a single element of a grid (including coordinate and all the 
other layers).
+   * Measured in bytes. */
+  int grid_element_size;
   /* Grids represent limit surface, with displacement applied. Grids are
* corresponding to face-corners of coarse mesh, each grid has
* grid_size^2 elements.
@@ -251,4 +254,43 @@ void BKE_subdiv_ccg_topology_counters(const SubdivCCG 
*subdiv_ccg,
   int *r_num_faces,
   int *r_num_loops);
 
+typedef struct SubdivCCGCoord {
+  /* Index of the grid within SubdivCCG::grids array. */
+  int grid_index;
+
+  /* Coordinate within the grid. */
+  int x, y;
+} SubdivCCGCoord;
+
+typedef struct SubdivCCGNeighbors {
+  SubdivCCGCoord *coords;
+  int size;
+
+  SubdivCCGCoord coords_fixed[256];
+} SubdivCCGNeighbors;
+
+void BKE_subdiv_ccg_print_coord(const char *message, const SubdivCCGCoord 
*coord);
+bool BKE_subdiv_ccg_check_coord_valid(const SubdivCCG *subdiv_ccg, const 
SubdivCCGCoord *coord);
+
+/* CCG element neighbors.
+ *
+ * Neighbors are considered:
+ *
+ * - For an inner elements of a grid other elements which are sharing same row 
or column (4
+ *   neighbor elements in total).
+ *
+ * - For the corner element a single neighboring element on every adjacent 
edge, single from
+ *   every gird.
+ *
+ * - For the boundary element two neighbor elements on the boundary (from same 
grid) and one
+ *   element inside of every neighboring grid. */
+
+/* Get actual neighbors of the given coordinate.
+ *
+ * SubdivCCGNeighbors.neighbors must be freed if it is not equal to
+ * SubdivCCGNeighbors.fixed_neighbors. */
+void BKE_subdiv_ccg_neighbor_coords_get(const SubdivCCG *subdiv_ccg,
+const SubdivCCGCoord *coord,
+SubdivCCGNeighbors *r_neighbors);
+
 #endif /* __BKE_SUBDIV_CCG_H__ */
diff --git a/source/blender/blenkernel/intern/subdiv_ccg.c 
b/source/blender/blenkernel/intern/subdiv_ccg.c
index bbd73db42bf..66db58ec683 100644
--- a/source/blender/blenkernel/intern/subdiv_ccg.c
+++ b/source/blender/blenkernel/intern/subdiv_ccg.c
@@ -129,6 +129,7 @@ static void subdiv_ccg_alloc_elements(SubdivCCG 
*subdiv_ccg, Subdiv *subdiv)
   const int num_grids = topology_refiner_count_face_corners(topology_refiner);
   const int grid_size = BKE_subdiv_grid_size_from_level(subdiv_ccg->level);
   const int grid_area = grid_size * grid_size;
+  subdiv_ccg->grid_element_size = element_size;
   subdiv_ccg->num_grids = num_grids;
   subdiv_ccg->grids = MEM_calloc_arrayN(num_grids, sizeof(CCGElem *), "subdiv 
ccg grids");
   subdiv_ccg->grids_storage = MEM_calloc_arrayN(
@@ -1229,3 +1230,508 @@ void BKE_subdiv_ccg_topology_counters(const SubdivCCG 
*subdiv_ccg,
   *r_num_faces = num_grids * (grid_size - 1) * (grid_size - 1);
   *r_num_loops = *r_num_faces * 4;
 }
+
+/* 
=
+ * Neighbors.
+ */
+
+void BKE_subdiv_ccg_print_coord(const char *message, const SubdivCCGCoord 
*coord)
+{
+  printf("%s: grid index: %d, coord: (%d, %d)\n", message, coord->grid_index, 
coord->x, coord->y);
+}
+
+bool BKE_subdiv_ccg_check_coord_valid(const SubdivCCG *subdiv_ccg, const 
SubdivCCGCoord *coord)
+{
+  if (coord->grid_index < 0 || coord->grid_index >= subdiv_ccg->num_grids) {
+return false;
+  }
+  const int grid_size = subdiv_ccg->grid_size;
+  if (coord->x < 0 || coord->x >= grid_size) {
+return false;
+  }
+  if (coord->y < 0 || coord->y >= grid_size) {
+return false;
+  }
+  return true;
+}
+
+BLI_INLINE void subdiv_ccg_neighbors_init(SubdivCCGNeighbors *neighbors, int 
size)
+{
+  neighbors->size = size;
+  if (size < ARRAY_SIZE(neighbors->coords_fixed)) {
+neighbors->coords = neighbors->coords_fixed;
+  }
+  else {
+neighbors->coords = MEM_mallocN(sizeof(*neighbors->coords) * size,
+  

[Bf-blender-cvs] [f35bfbb25ea] master: Sculpt: mesh filter, mask filter and dirty mask now work with multires

2019-10-04 Thread Brecht Van Lommel
Commit: f35bfbb25eacd95a976cbf248986be57c1fa88e7
Author: Brecht Van Lommel
Date:   Fri Oct 4 19:00:09 2019 +0200
Branches: master
https://developer.blender.org/rBf35bfbb25eacd95a976cbf248986be57c1fa88e7

Sculpt: mesh filter, mask filter and dirty mask now work with multires

Thanks to Sergey's neighbor access functions.

Mesh filter still needs some improvements to handle open boundaries better.

===

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

===

diff --git a/source/blender/editors/sculpt_paint/sculpt.c 
b/source/blender/editors/sculpt_paint/sculpt.c
index 9bd788f7960..853324c7e17 100644
--- a/source/blender/editors/sculpt_paint/sculpt.c
+++ b/source/blender/editors/sculpt_paint/sculpt.c
@@ -186,7 +186,6 @@ static float sculpt_vertex_mask_get(SculptSession *ss, int 
index)
 
 static int sculpt_active_vertex_get(SculptSession *ss)
 {
-  BLI_assert(BKE_pbvh_type(ss->pbvh) != PBVH_GRIDS);
   switch (BKE_pbvh_type(ss->pbvh)) {
 case PBVH_FACES:
   return ss->active_vertex_index;
@@ -8296,6 +8295,11 @@ static void mesh_filter_task_cb(void *__restrict 
userdata,
 float fade = vd.mask ? *vd.mask : 0.0f;
 fade = 1 - fade;
 fade *= data->filter_strength;
+
+if (fade == 0.0f) {
+  continue;
+}
+
 copy_v3_v3(orig_co, orig_data.co);
 switch (filter_type) {
   case MESH_FILTER_SMOOTH:
@@ -8437,10 +8441,6 @@ static int sculpt_mesh_filter_invoke(bContext *C, 
wmOperator *op, const wmEvent
   SculptSession *ss = ob->sculpt;
   PBVH *pbvh = ob->sculpt->pbvh;
 
-  if (BKE_pbvh_type(ss->pbvh) == PBVH_GRIDS) {
-return OPERATOR_CANCELLED;
-  }
-
   int deform_axis = RNA_enum_get(op->ptr, "deform_axis");
   if (deform_axis == 0) {
 return OPERATOR_CANCELLED;
@@ -8651,10 +8651,6 @@ static int sculpt_mask_filter_exec(bContext *C, 
wmOperator *op)
   int totnode;
   int filter_type = RNA_enum_get(op->ptr, "filter_type");
 
-  if (BKE_pbvh_type(ss->pbvh) == PBVH_GRIDS) {
-return OPERATOR_CANCELLED;
-  }
-
   BKE_sculpt_update_object_for_edit(depsgraph, ob, true, true);
 
   sculpt_vertex_random_access_init(ss);
@@ -8868,10 +8864,6 @@ static int sculpt_dirty_mask_exec(bContext *C, 
wmOperator *op)
   Sculpt *sd = CTX_data_tool_settings(C)->sculpt;
   int totnode;
 
-  if (BKE_pbvh_type(ss->pbvh) == PBVH_GRIDS) {
-return OPERATOR_CANCELLED;
-  }
-
   BKE_sculpt_update_object_for_edit(depsgraph, ob, true, true);
 
   sculpt_vertex_random_access_init(ss);

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


[Bf-blender-cvs] [bebdb6c8249] master: Fix assert when deleting a RBW constraint object.

2019-10-04 Thread Bastien Montagne
Commit: bebdb6c8249939623f80cc72433aa7d7418444bf
Author: Bastien Montagne
Date:   Fri Oct 4 18:51:00 2019 +0200
Branches: master
https://developer.blender.org/rBbebdb6c8249939623f80cc72433aa7d7418444bf

Fix assert when deleting a RBW constraint object.

Side-reported in T70505.

Code did not ensure deleted object was removed from the RBW constraints
collection, leading to some invalid status (object in constraints
collection but without relevant contraints data).

Also fixed another issue - code deleting RBW objects would try to remove
any constraint one using it as target, in a very bad and broken way,
since you cannot iterate over objects of a collection while removing
some... Now instead just NULLify relevant pointers... I hope it works,
otherwise we'll have to take a different approach.

Needless to stress again how weak the whole RBW code is in general, and
regarding same object being used by RBW in more than one scene in particular,
that is known broken situation anyway.

===

M   source/blender/blenkernel/BKE_rigidbody.h
M   source/blender/blenkernel/BKE_scene.h
M   source/blender/blenkernel/intern/collection.c
M   source/blender/blenkernel/intern/rigidbody.c
M   source/blender/blenkernel/intern/scene.c
M   source/blender/editors/physics/rigidbody_constraint.c
M   source/blender/editors/physics/rigidbody_object.c

===

diff --git a/source/blender/blenkernel/BKE_rigidbody.h 
b/source/blender/blenkernel/BKE_rigidbody.h
index 4c023f54e04..b4c440d54a6 100644
--- a/source/blender/blenkernel/BKE_rigidbody.h
+++ b/source/blender/blenkernel/BKE_rigidbody.h
@@ -103,8 +103,14 @@ bool BKE_rigidbody_add_object(struct Main *bmain,
   int type,
   struct ReportList *reports);
 void BKE_rigidbody_ensure_local_object(struct Main *bmain, struct Object *ob);
-void BKE_rigidbody_remove_object(struct Main *bmain, struct Scene *scene, 
struct Object *ob);
-void BKE_rigidbody_remove_constraint(struct Scene *scene, struct Object *ob);
+void BKE_rigidbody_remove_object(struct Main *bmain,
+ struct Scene *scene,
+ struct Object *ob,
+ const bool free_us);
+void BKE_rigidbody_remove_constraint(struct Main *bmain,
+ struct Scene *scene,
+ struct Object *ob,
+ const bool free_us);
 
 /* -- */
 /* Utility Macros */
diff --git a/source/blender/blenkernel/BKE_scene.h 
b/source/blender/blenkernel/BKE_scene.h
index 846b8d21f28..5b77c36024a 100644
--- a/source/blender/blenkernel/BKE_scene.h
+++ b/source/blender/blenkernel/BKE_scene.h
@@ -75,7 +75,10 @@ void BKE_scene_free(struct Scene *sce);
 void BKE_scene_init(struct Scene *sce);
 struct Scene *BKE_scene_add(struct Main *bmain, const char *name);
 
-void BKE_scene_remove_rigidbody_object(struct Main *bmain, struct Scene 
*scene, struct Object *ob);
+void BKE_scene_remove_rigidbody_object(struct Main *bmain,
+   struct Scene *scene,
+   struct Object *ob,
+   const bool free_us);
 
 bool BKE_scene_object_find(struct Scene *scene, struct Object *ob);
 struct Object *BKE_scene_object_find_by_name(struct Scene *scene, const char 
*name);
diff --git a/source/blender/blenkernel/intern/collection.c 
b/source/blender/blenkernel/intern/collection.c
index f2098cc2430..931d248558d 100644
--- a/source/blender/blenkernel/intern/collection.c
+++ b/source/blender/blenkernel/intern/collection.c
@@ -773,7 +773,7 @@ static bool scene_collections_object_remove(
   bool removed = false;
 
   if (collection_skip == NULL) {
-BKE_scene_remove_rigidbody_object(bmain, scene, ob);
+BKE_scene_remove_rigidbody_object(bmain, scene, ob, free_us);
   }
 
   FOREACH_SCENE_COLLECTION_BEGIN (scene, collection) {
diff --git a/source/blender/blenkernel/intern/rigidbody.c 
b/source/blender/blenkernel/intern/rigidbody.c
index 514f000d73d..c7a5104619b 100644
--- a/source/blender/blenkernel/intern/rigidbody.c
+++ b/source/blender/blenkernel/intern/rigidbody.c
@@ -1415,7 +1415,7 @@ bool BKE_rigidbody_add_object(Main *bmain, Scene *scene, 
Object *ob, int type, R
   return true;
 }
 
-void BKE_rigidbody_remove_object(Main *bmain, Scene *scene, Object *ob)
+void BKE_rigidbody_remove_object(Main *bmain, Scene *scene, Object *ob, const 
bool free_us)
 {
   RigidBodyWorld *rbw = scene->rigidbody_world;
   RigidBodyCon *rbc;
@@ -1438,8 +1438,13 @@ void BKE_rigidbody_remove_object(Main *bmain, Scene 
*scene, Object *ob)
   FOREACH_COLLECTION_OBJECT_RECURSIVE_BEGIN (rbw->constraints, obt) {
 if (obt && obt->rigidbody_constraint) {
   rbc = obt->rigidbody_constraint;
-

[Bf-blender-cvs] [fc517cb0790] master: Cleanup: formatting for text highlighter

2019-10-04 Thread Campbell Barton
Commit: fc517cb0790df03eb7bfbe98ad581b9017d4989e
Author: Campbell Barton
Date:   Sat Oct 5 02:43:03 2019 +1000
Branches: master
https://developer.blender.org/rBfc517cb0790df03eb7bfbe98ad581b9017d4989e

Cleanup: formatting for text highlighter

===

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

===

diff --git a/source/blender/editors/space_text/text_format_lua.c 
b/source/blender/editors/space_text/text_format_lua.c
index 347d46a4234..935e288c7be 100644
--- a/source/blender/editors/space_text/text_format_lua.c
+++ b/source/blender/editors/space_text/text_format_lua.c
@@ -48,7 +48,7 @@ static int txtfmt_lua_find_keyword(const char *string)
   /* Keep aligned args for readability. */
   /* clang-format off */
 
-  if  (STR_LITERAL_STARTSWITH(string, "and",  len)) { i = len;
+  if(STR_LITERAL_STARTSWITH(string, "and",  len)) { i = len;
   } else if (STR_LITERAL_STARTSWITH(string, "break",len)) { i = len;
   } else if (STR_LITERAL_STARTSWITH(string, "do",   len)) { i = len;
   } else if (STR_LITERAL_STARTSWITH(string, "else", len)) { i = len;
@@ -66,8 +66,7 @@ static int txtfmt_lua_find_keyword(const char *string)
   } else if (STR_LITERAL_STARTSWITH(string, "then", len)) { i = len;
   } else if (STR_LITERAL_STARTSWITH(string, "until",len)) { i = len;
   } else if (STR_LITERAL_STARTSWITH(string, "while",len)) { i = len;
-  } else {  i = 0;
-}
+  } else {  i = 0; }
 
   /* clang-format on */
 
@@ -96,7 +95,7 @@ static int txtfmt_lua_find_specialvar(const char *string)
   /* Keep aligned args for readability. */
   /* clang-format off */
 
-  if  (STR_LITERAL_STARTSWITH(string, "assert",   len)) {   i = 
len;
+  if(STR_LITERAL_STARTSWITH(string, "assert",   len)) {   i = 
len;
   } else if (STR_LITERAL_STARTSWITH(string, "collectgarbage",   len)) {   i = 
len;
   } else if (STR_LITERAL_STARTSWITH(string, "dofile",   len)) {   i = 
len;
   } else if (STR_LITERAL_STARTSWITH(string, "error",len)) {   i = 
len;
@@ -124,8 +123,7 @@ static int txtfmt_lua_find_specialvar(const char *string)
   } else if (STR_LITERAL_STARTSWITH(string, "unpack",   len)) {   i = 
len;
   } else if (STR_LITERAL_STARTSWITH(string, "_VERSION", len)) {   i = 
len;
   } else if (STR_LITERAL_STARTSWITH(string, "xpcall",   len)) {   i = 
len;
-  } else {i = 0;
-}
+  } else {i = 
0; }
 
   /* clang-format on */
 
@@ -140,18 +138,13 @@ static int txtfmt_lua_find_bool(const char *string)
 {
   int i, len;
 
-  if (STR_LITERAL_STARTSWITH(string, "nil", len)) {
-i = len;
-  }
-  else if (STR_LITERAL_STARTSWITH(string, "true", len)) {
-i = len;
-  }
-  else if (STR_LITERAL_STARTSWITH(string, "false", len)) {
-i = len;
-  }
-  else {
-i = 0;
-  }
+  /* Keep aligned args for readability. */
+  /* clang-format off */
+
+  if(STR_LITERAL_STARTSWITH(string, "nil",len)) { i = len;
+  } else if (STR_LITERAL_STARTSWITH(string, "true",   len)) { i = len;
+  } else if (STR_LITERAL_STARTSWITH(string, "false",  len)) { i = len;
+  } else {i = 0; }
 
   /* clang-format on */
 
@@ -169,10 +162,9 @@ static char txtfmt_lua_format_identifier(const char *str)
   /* Keep aligned args for readability. */
   /* clang-format off */
 
-  if  ((txtfmt_lua_find_specialvar(str))  != -1) { fmt = FMT_TYPE_SPECIAL;
+  if((txtfmt_lua_find_specialvar(str))  != -1) { fmt = 
FMT_TYPE_SPECIAL;
   } else if ((txtfmt_lua_find_keyword(str)) != -1) { fmt = 
FMT_TYPE_KEYWORD;
-  } else {   fmt = 
FMT_TYPE_DEFAULT;
-}
+  } else {   fmt = 
FMT_TYPE_DEFAULT; }
 
   /* clang-format on */
 
diff --git a/source/blender/editors/space_text/text_format_osl.c 
b/source/blender/editors/space_text/text_format_osl.c
index fb9ddcb09cb..2da4488e901 100644
--- a/source/blender/editors/space_text/text_format_osl.c
+++ b/source/blender/editors/space_text/text_format_osl.c
@@ -40,7 +40,7 @@ static int txtfmt_osl_find_builtinfunc(const char *string)
   /* list is from
* 
https://github.com/imageworks/OpenShadingLanguage/raw/master/src/doc/osl-languagespec.pdf
*/
-  if  (STR_LITERAL_STARTSWITH(string, "break",len)) { i = len;
+  if(STR_LITERAL_STARTSWITH(string, "break",len)) { i = len;
  

[Bf-blender-cvs] [3c146283810] master: Cleanup: make context menu last in keymaps

2019-10-04 Thread Campbell Barton
Commit: 3c146283810fd8257b8405005e74bb37db035107
Author: Campbell Barton
Date:   Sat Oct 5 02:43:54 2019 +1000
Branches: master
https://developer.blender.org/rB3c146283810fd8257b8405005e74bb37db035107

Cleanup: make context menu last in keymaps

===

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 18a28582f80..58e11a160b5 100644
--- a/release/scripts/presets/keyconfig/keymap_data/blender_default.py
+++ b/release/scripts/presets/keyconfig/keymap_data/blender_default.py
@@ -1448,7 +1448,6 @@ def km_graph_editor(params):
 ("graph.bake", {"type": 'C', "value": 'PRESS', "alt": True}, None),
 op_menu("GRAPH_MT_delete", {"type": 'X', "value": 'PRESS'}),
 op_menu("GRAPH_MT_delete", {"type": 'DEL', "value": 'PRESS'}),
-op_menu("GRAPH_MT_context_menu", params.context_menu_event),
 ("graph.duplicate_move", {"type": 'D', "value": 'PRESS', "shift": 
True}, None),
 ("graph.keyframe_insert", {"type": 'I', "value": 'PRESS'}, None),
 ("graph.click_insert", {"type": params.action_mouse, "value": 'CLICK', 
"ctrl": True},
@@ -1479,6 +1478,7 @@ def km_graph_editor(params):
 op_menu_pie("GRAPH_MT_pivot_pie", {"type": 'PERIOD', "value": 
'PRESS'}),
 ("marker.add", {"type": 'M', "value": 'PRESS'}, None),
 ("marker.rename", {"type": 'M', "value": 'PRESS', "ctrl": True}, None),
+op_menu("GRAPH_MT_context_menu", params.context_menu_event),
 ])
 
 if params.select_mouse == 'LEFTMOUSE' and not params.legacy:
@@ -1582,9 +1582,9 @@ def km_image(params):
  )
 ),
 op_menu_pie("IMAGE_MT_pivot_pie", {"type": 'PERIOD', "value": 
'PRESS'}),
-op_menu("IMAGE_MT_mask_context_menu", params.context_menu_event),
 ("image.render_border", {"type": 'B', "value": 'PRESS', "ctrl": True}, 
None),
 ("image.clear_render_border", {"type": 'B', "value": 'PRESS', "ctrl": 
True, "alt": True}, None),
+op_menu("IMAGE_MT_mask_context_menu", params.context_menu_event),
 ])
 
 if params.legacy:
@@ -1671,7 +1671,6 @@ def km_node_editor(params):
  {"properties": [("factor", 1.2)]}),
 ("node.backimage_fit", {"type": 'HOME', "value": 'PRESS', "alt": 
True}, None),
 ("node.backimage_sample", {"type": params.action_mouse, "value": 
'PRESS', "alt": True}, None),
-op_menu("NODE_MT_context_menu", params.context_menu_event),
 ("node.link_make", {"type": 'F', "value": 'PRESS'},
  {"properties": [("replace", False)]}),
 ("node.link_make", {"type": 'F', "value": 'PRESS', "shift": True},
@@ -1737,6 +1736,7 @@ def km_node_editor(params):
  {"properties": [("data_path", 'tool_settings.use_snap')]}),
 ("wm.context_menu_enum", {"type": 'TAB', "value": 'PRESS', "shift": 
True, "ctrl": True},
  {"properties": [("data_path", 'tool_settings.snap_node_element')]}),
+op_menu("NODE_MT_context_menu", params.context_menu_event),
 ])
 
 return keymap
@@ -1983,7 +1983,6 @@ def km_dopesheet(params):
 ("action.interpolation_type", {"type": 'T', "value": 'PRESS'}, None),
 ("action.extrapolation_type", {"type": 'E', "value": 'PRESS', "shift": 
True}, None),
 ("action.keyframe_type", {"type": 'R', "value": 'PRESS'}, None),
-op_menu("DOPESHEET_MT_context_menu", params.context_menu_event),
 ("action.sample", {"type": 'O', "value": 'PRESS', "shift": True, 
"alt": True}, None),
 op_menu("DOPESHEET_MT_delete", {"type": 'X', "value": 'PRESS'}),
 op_menu("DOPESHEET_MT_delete", {"type": 'DEL', "value": 'PRESS'}),
@@ -2015,6 +2014,7 @@ def km_dopesheet(params):
 op_menu_pie("VIEW3D_MT_proportional_editing_falloff_pie", {"type": 
'O', "value": 'PRESS', "shift": True}),
 ("marker.add", {"type": 'M', "value": 'PRESS'}, None),
 ("marker.rename", {"type": 'M', "value": 'PRESS', "ctrl": True}, None),
+op_menu("DOPESHEET_MT_context_menu", params.context_menu_event),
 ])
 
 return keymap
@@ -2128,7 +2128,6 @@ def km_nla_editor(params):
 ("nla.apply_scale", {"type": 'A', "value": 'PRESS', "ctrl": True}, 
None),
 ("nla.clear_scale", {"type": 'S', "value": 'PRESS', "alt": True}, 
None),
 op_menu_pie("NLA_MT_snap_pie", {"type": 'S', "value": 'PRESS', 
"shift": True}),
-op_menu("NLA_MT_context_menu", params.context_menu_event),
 ("nla.fmodifier_add", {"type": 'M', "value": 'PRESS', "shift": True, 
"ctrl": True}, None),
 ("transform.transform", {"type": 'G', "value": 'PRESS'},
  {"properties": [("mode", 'TRANSLATION')]}),
@@ -2140,6 +2139,7 @@ def km_nla_editor(params):
  {"properties": [("mode", 

[Bf-blender-cvs] [dfcda05242d] master: Fix T70467: large cursors option on Linux not showing clear crosshair

2019-10-04 Thread Brecht Van Lommel
Commit: dfcda05242d3f51bde274aab71a58b159edac343
Author: Brecht Van Lommel
Date:   Fri Oct 4 18:00:43 2019 +0200
Branches: master
https://developer.blender.org/rBdfcda05242d3f51bde274aab71a58b159edac343

Fix T70467: large cursors option on Linux not showing clear crosshair

Not a great solution, but reverting back to what we had before the recent
changes for this specific case.

===

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

===

diff --git a/source/blender/windowmanager/intern/wm_cursors.c 
b/source/blender/windowmanager/intern/wm_cursors.c
index 4b1abeceebb..8e796a7981a 100644
--- a/source/blender/windowmanager/intern/wm_cursors.c
+++ b/source/blender/windowmanager/intern/wm_cursors.c
@@ -192,6 +192,15 @@ void WM_cursor_set(wmWindow *win, int curs)
 
   GHOST_TStandardCursor ghost_cursor = convert_to_ghost_standard_cursor(curs);
 
+#if !defined(_WIN32) && !defined(__APPLE__)
+  /* Workaround crosshair cursors with bad visibility in some cursor themes.
+   * Better solution would be to always use custom cursors and support DPI
+   * properly so that the cursors look as good as the native ones. */
+  if (U.curssize && ghost_cursor == GHOST_kStandardCursorCrosshair) {
+ghost_cursor = GHOST_kStandardCursorCustom;
+  }
+#endif
+
   if (ghost_cursor != GHOST_kStandardCursorCustom &&
   GHOST_HasCursorShape(win->ghostwin, ghost_cursor)) {
 /* Use native GHOST cursor when available. */
@@ -695,38 +704,40 @@ void wm_init_cursor_data(void)
   /** Normal Cross Cursor /
   BEGIN_CURSOR_BLOCK;
   static char cross_sbm[] = {
-  0x80, 0x01, 0x80, 0x01, 0x80, 0x01, 0x80, 0x01, 0x80, 0x01, 0x80,
-  0x01, 0x00, 0x00, 0x3f, 0xfc, 0x3f, 0xfc, 0x00, 0x00, 0x80, 0x01,
-  0x80, 0x01, 0x80, 0x01, 0x80, 0x01, 0x80, 0x01, 0x80, 0x01,
+  0x00, 0x00, 0x80, 0x01, 0x80, 0x01, 0x80, 0x01, 0x80, 0x01, 0x80,
+  0x01, 0x00, 0x00, 0x3e, 0x7c, 0x3e, 0x7c, 0x00, 0x00, 0x80, 0x01,
+  0x80, 0x01, 0x80, 0x01, 0x80, 0x01, 0x80, 0x01, 0x00, 0x00,
+
   };
 
   static char cross_smsk[] = {
   0xc0, 0x03, 0xc0, 0x03, 0xc0, 0x03, 0xc0, 0x03, 0xc0, 0x03, 0xc0,
-  0x03, 0x7f, 0xfe, 0x3f, 0xfc, 0x3f, 0xfc, 0x7f, 0xfe, 0xc0, 0x03,
+  0x03, 0x7f, 0xfe, 0x7f, 0xfe, 0x7f, 0xfe, 0xff, 0xff, 0xc0, 0x03,
   0xc0, 0x03, 0xc0, 0x03, 0xc0, 0x03, 0xc0, 0x03, 0xc0, 0x03,
   };
   static char cross_lbm[] = {
-  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x01, 0x00, 
0x00, 0x80, 0x01,
+  0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x01, 0x00, 0x00, 0x80, 0x01, 0x00, 
0x00, 0x80, 0x01,
   0x00, 0x00, 0x80, 0x01, 0x00, 0x00, 0x80, 0x01, 0x00, 0x00, 0x80, 0x01, 
0x00, 0x00, 0x80,
   0x01, 0x00, 0x00, 0x80, 0x01, 0x00, 0x00, 0x80, 0x01, 0x00, 0x00, 0x80, 
0x01, 0x00, 0x00,
-  0xc0, 0x03, 0x00, 0x00, 0xc0, 0x03, 0x00, 0x00, 0x40, 0x02, 0x00, 0x00, 
0x78, 0x1e, 0x00,
-  0xfc, 0x1f, 0xf8, 0x3f, 0xfc, 0x1f, 0xf8, 0x3f, 0x00, 0x78, 0x1e, 0x00, 
0x00, 0x40, 0x02,
-  0x00, 0x00, 0xc0, 0x03, 0x00, 0x00, 0xc0, 0x03, 0x00, 0x00, 0x80, 0x01, 
0x00, 0x00, 0x80,
+  0x80, 0x01, 0x00, 0x00, 0x80, 0x01, 0x00, 0x00, 0x80, 0x01, 0x00, 0x00, 
0x00, 0x00, 0x00,
+  0xfe, 0x3f, 0xfc, 0x7f, 0xfe, 0x3f, 0xfc, 0x7f, 0x00, 0x00, 0x00, 0x00, 
0x00, 0x80, 0x01,
+  0x00, 0x00, 0x80, 0x01, 0x00, 0x00, 0x80, 0x01, 0x00, 0x00, 0x80, 0x01, 
0x00, 0x00, 0x80,
   0x01, 0x00, 0x00, 0x80, 0x01, 0x00, 0x00, 0x80, 0x01, 0x00, 0x00, 0x80, 
0x01, 0x00, 0x00,
   0x80, 0x01, 0x00, 0x00, 0x80, 0x01, 0x00, 0x00, 0x80, 0x01, 0x00, 0x00, 
0x80, 0x01, 0x00,
-  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+  0x00, 0x80, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00,
+
   };
 
   static char cross_lmsk[] = {
-  0x00, 0x80, 0x01, 0x00, 0x00, 0x80, 0x01, 0x00, 0x00, 0x80, 0x01, 0x00, 
0x00, 0x80, 0x01,
-  0x00, 0x00, 0x80, 0x01, 0x00, 0x00, 0x80, 0x01, 0x00, 0x00, 0x80, 0x01, 
0x00, 0x00, 0x80,
-  0x01, 0x00, 0x00, 0x80, 0x01, 0x00, 0x00, 0x80, 0x01, 0x00, 0x00, 0x80, 
0x01, 0x00, 0x00,
-  0x80, 0x01, 0x00, 0x00, 0x80, 0x01, 0x00, 0x00, 0x80, 0x01, 0x00, 0x00, 
0x80, 0x01, 0x00,
-  0xff, 0x7f, 0xfe, 0xff, 0xff, 0x7f, 0xfe, 0xff, 0x00, 0x80, 0x01, 0x00, 
0x00, 0x80, 0x01,
-  0x00, 0x00, 0x80, 0x01, 0x00, 0x00, 0x80, 0x01, 0x00, 0x00, 0x80, 0x01, 
0x00, 0x00, 0x80,
-  0x01, 0x00, 0x00, 0x80, 0x01, 0x00, 0x00, 0x80, 0x01, 0x00, 0x00, 0x80, 
0x01, 0x00, 0x00,
-  0x80, 0x01, 0x00, 0x00, 0x80, 0x01, 0x00, 0x00, 0x80, 0x01, 0x00, 0x00, 
0x80, 0x01, 0x00,
-  0x00, 0x80, 0x01, 0x00, 0x00, 0x80, 0x01, 0x00,
+  0x00, 0xc0, 0x03, 0x00, 0x00, 0xc0, 0x03, 0x00, 0x00, 0xc0, 0x03, 0x00, 
0x00, 0xc0, 0x03,
+  0x00, 0x00, 0xc0, 0x03, 0x00, 0x00, 0xc0, 0x03, 0x00, 0x00, 0xc0, 0x03, 
0x00, 0x00, 0xc0,
+  0x03, 0x00, 0x00, 0xc0, 0x03, 0x00, 0x00, 0xc0, 0x03, 0x00, 0x00, 0xc0, 
0x03, 0x00, 0x00,
+  

[Bf-blender-cvs] [db66c33efe4] master: Fix T70462: Shift+Click on neighbour folder enters it

2019-10-04 Thread Julian Eisel
Commit: db66c33efe42161f984a7c5c54228c6efcca43fe
Author: Julian Eisel
Date:   Fri Oct 4 17:25:44 2019 +0200
Branches: master
https://developer.blender.org/rBdb66c33efe42161f984a7c5c54228c6efcca43fe

Fix T70462: Shift+Click on neighbour folder enters it

In fact, the operator implementation seems to have some issues, which is
why this behaved so glitchy. But for properly set up keymaps it should
work fine.

===

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

===

diff --git a/release/scripts/presets/keyconfig/keymap_data/blender_default.py 
b/release/scripts/presets/keyconfig/keymap_data/blender_default.py
index ddf7accc2b2..18a28582f80 100644
--- a/release/scripts/presets/keyconfig/keymap_data/blender_default.py
+++ b/release/scripts/presets/keyconfig/keymap_data/blender_default.py
@@ -1831,7 +1831,7 @@ def km_file_browser_main(params):
 ("file.select", {"type": 'LEFTMOUSE', "value": 'CLICK', "ctrl": True},
  {"properties": [("extend", True)]}),
 ("file.select", {"type": 'LEFTMOUSE', "value": 'CLICK', "shift": True},
- {"properties": [("extend", True), ("fill", True)]}),
+ {"properties": [("extend", True), ("fill", True), ("open", False)]}),
 ("file.select_walk", {"type": 'UP_ARROW', "value": 'PRESS'},
  {"properties": [("direction", 'UP')]}),
 ("file.select_walk", {"type": 'UP_ARROW', "value": 'PRESS', "shift": 
True},
diff --git 
a/release/scripts/presets/keyconfig/keymap_data/industry_compatible_data.py 
b/release/scripts/presets/keyconfig/keymap_data/industry_compatible_data.py
index 5ce79936836..7427db6ebe7 100644
--- a/release/scripts/presets/keyconfig/keymap_data/industry_compatible_data.py
+++ b/release/scripts/presets/keyconfig/keymap_data/industry_compatible_data.py
@@ -1221,7 +1221,7 @@ def km_file_browser_main(params):
 ("file.select", {"type": 'LEFTMOUSE', "value": 'CLICK', "ctrl": True},
  {"properties": [("extend", True)]}),
 ("file.select", {"type": 'LEFTMOUSE', "value": 'CLICK', "shift": 
True,},
- {"properties": [("extend", True), ("fill", True)]}),
+ {"properties": [("extend", True), ("fill", True), ("open", False)]}),
 ("file.select", {"type": 'RIGHTMOUSE', "value": 'CLICK', "shift": 
True},
  {"properties": [("extend", True), ("open", False)]}),
 ("file.select", {"type": 'RIGHTMOUSE', "value": 'CLICK', "alt": True},

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


[Bf-blender-cvs] [1fa56e72ec6] master: Fixed copy-paste error in install_deps.sh

2019-10-04 Thread Sybren A. Stüvel
Commit: 1fa56e72ec6ff2d2b84d65c71eed550284973263
Author: Sybren A. Stüvel
Date:   Fri Oct 4 17:10:47 2019 +0200
Branches: master
https://developer.blender.org/rB1fa56e72ec6ff2d2b84d65c71eed550284973263

Fixed copy-paste error in install_deps.sh

===

M   build_files/build_environment/install_deps.sh

===

diff --git a/build_files/build_environment/install_deps.sh 
b/build_files/build_environment/install_deps.sh
index a73873b1b46..fd3ebe241a2 100755
--- a/build_files/build_environment/install_deps.sh
+++ b/build_files/build_environment/install_deps.sh
@@ -3616,11 +3616,10 @@ install_RPM() {
   install_packages_RPM $VPX_DEV
   VPX_USE=true
 fi
+
 PRINT ""
 install_packages_RPM libspnav-devel
-  fi
 
-  if [ "$WITH_ALL" = true ]; then
 PRINT ""
 OPUS_DEV="libopus-devel"
 check_package_version_ge_RPM $OPUS_DEV $OPUS_VERSION_MIN
@@ -3628,8 +3627,6 @@ install_RPM() {
   install_packages_RPM $OPUS_DEV
   OPUS_USE=true
 fi
-PRINT ""
-install_packages_RPM libspnav-devel
   fi
 
   PRINT ""

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


[Bf-blender-cvs] [eeba31e2ca8] master: Fix T69910: crash when using a hotkey for a new or open recent file

2019-10-04 Thread Pedro Reis
Commit: eeba31e2ca80863da19624721c2fcf020f13db53
Author: Pedro Reis
Date:   Fri Oct 4 16:55:37 2019 +0200
Branches: master
https://developer.blender.org/rBeeba31e2ca80863da19624721c2fcf020f13db53

Fix T69910: crash when using a hotkey for a new or open recent file

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

===

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

===

diff --git a/source/blender/windowmanager/intern/wm_event_system.c 
b/source/blender/windowmanager/intern/wm_event_system.c
index 1eec08c2e7a..a744cfb8c28 100644
--- a/source/blender/windowmanager/intern/wm_event_system.c
+++ b/source/blender/windowmanager/intern/wm_event_system.c
@@ -2738,7 +2738,10 @@ static int wm_handlers_do_intern(bContext *C, wmEvent 
*event, ListBase *handlers
 /* Clear the tool-tip whenever a key binding is handled, without this 
tool-tips
  * are kept when a modal operators starts (annoying but otherwise 
harmless). */
 if (action & WM_HANDLER_BREAK) {
-  WM_tooltip_clear(C, CTX_wm_window(C));
+  /* Window may be gone after file read. */
+  if (CTX_wm_window(C) != NULL) {
+WM_tooltip_clear(C, CTX_wm_window(C));
+  }
 }
   }
   else if (handler_base->type == WM_HANDLER_TYPE_UI) {

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


[Bf-blender-cvs] [d4d036ae140] master: UI: Move all Selected Dopesheet Keys when Dragging

2019-10-04 Thread Julian Eisel
Commit: d4d036ae140aaa7785cd0b1edc32243847c64410
Author: Julian Eisel
Date:   Fri Oct 4 15:32:09 2019 +0200
Branches: master
https://developer.blender.org/rBd4d036ae140aaa7785cd0b1edc32243847c64410

UI: Move all Selected Dopesheet Keys when Dragging

Part of T57918. Selecting and dragging items were conflicting actions
previously when both were using the same mouse button. This avoids the
conflict.

See 056fcdfe7bbed3 for details on behavior.

===

M   source/blender/editors/space_action/action_select.c

===

diff --git a/source/blender/editors/space_action/action_select.c 
b/source/blender/editors/space_action/action_select.c
index 4a4ff5f5605..ca6efb5f69e 100644
--- a/source/blender/editors/space_action/action_select.c
+++ b/source/blender/editors/space_action/action_select.c
@@ -153,7 +153,8 @@ static void actkeys_find_key_in_list_element(bAnimContext 
*ac,
  float region_x,
  float *r_selx,
  float *r_frame,
- bool *r_found)
+ bool *r_found,
+ bool *r_is_selected)
 {
   *r_found = false;
 
@@ -182,6 +183,7 @@ static void actkeys_find_key_in_list_element(bAnimContext 
*ac,
   *r_selx = BKE_nla_tweakedit_remap(adt, ak->cfra, NLATIME_CONVERT_UNMAP);
   *r_frame = ak->cfra;
   *r_found = true;
+  *r_is_selected = (ak->sel & SELECT) != 0;
   break;
 }
   }
@@ -197,14 +199,16 @@ static void actkeys_find_key_at_position(bAnimContext *ac,
  bAnimListElem **r_ale,
  float *r_selx,
  float *r_frame,
- bool *r_found)
+ bool *r_found,
+ bool *r_is_selected)
 
 {
   *r_found = false;
   *r_ale = actkeys_find_list_element_at_position(ac, filter, region_x, 
region_y);
 
   if (*r_ale != NULL) {
-actkeys_find_key_in_list_element(ac, *r_ale, region_x, r_selx, r_frame, 
r_found);
+actkeys_find_key_in_list_element(
+ac, *r_ale, region_x, r_selx, r_frame, r_found, r_is_selected);
   }
 }
 
@@ -213,9 +217,11 @@ static bool actkeys_is_key_at_position(bAnimContext *ac, 
float region_x, float r
   bAnimListElem *ale;
   float selx, frame;
   bool found;
+  bool is_selected;
 
   int filter = ANIMFILTER_DATA_VISIBLE | ANIMFILTER_LIST_VISIBLE | 
ANIMFILTER_LIST_CHANNELS;
-  actkeys_find_key_at_position(ac, filter, region_x, region_y, , , 
, );
+  actkeys_find_key_at_position(
+  ac, filter, region_x, region_y, , , , , 
_selected);
 
   if (ale != NULL) {
 MEM_freeN(ale);
@@ -1681,20 +1687,29 @@ static void actkeys_mselect_channel_only(bAnimContext 
*ac, bAnimListElem *ale, s
 
 /* --- */
 
-static void mouse_action_keys(bAnimContext *ac,
-  const int mval[2],
-  short select_mode,
-  const bool deselect_all,
-  const bool column,
-  const bool same_channel)
+static int mouse_action_keys(bAnimContext *ac,
+ const int mval[2],
+ short select_mode,
+ const bool deselect_all,
+ const bool column,
+ const bool same_channel,
+ bool wait_to_deselect_others)
 {
   int filter = ANIMFILTER_DATA_VISIBLE | ANIMFILTER_LIST_VISIBLE | 
ANIMFILTER_LIST_CHANNELS;
 
   bAnimListElem *ale = NULL;
   bool found = false;
+  bool is_selected = false;
   float frame = 0.0f; /* frame of keyframe under mouse - NLA corrections not 
applied/included */
   float selx = 0.0f;  /* frame of keyframe under mouse */
-  actkeys_find_key_at_position(ac, filter, mval[0], mval[1], , , 
, );
+  int ret_value = OPERATOR_FINISHED;
+
+  actkeys_find_key_at_position(
+  ac, filter, mval[0], mval[1], , , , , _selected);
+
+  if (select_mode != SELECT_REPLACE) {
+wait_to_deselect_others = false;
+  }
 
   /* For replacing selection, if we have something to select, we have to clear 
existing selection.
* The same goes if we found nothing to select, and deselect_all is true
@@ -1703,56 +1718,61 @@ static void mouse_action_keys(bAnimContext *ac,
 /* reset selection mode for next steps */
 select_mode = SELECT_ADD;
 
-/* deselect all keyframes */
-deselect_action_keys(ac, 0, SELECT_SUBTRACT);
-
-/* highlight channel clicked on */
-if (ELEM(ac->datatype, ANIMCONT_ACTION, ANIMCONT_DOPESHEET, 
ANIMCONT_TIMELINE)) {
-  /* deselect all other channels 

[Bf-blender-cvs] [809ab298f1c] master: UI: Move all Selected Markers when Dragging

2019-10-04 Thread Julian Eisel
Commit: 809ab298f1ca8696b8f997c80da8ddf3ae95b89c
Author: Julian Eisel
Date:   Fri Oct 4 16:45:01 2019 +0200
Branches: master
https://developer.blender.org/rB809ab298f1ca8696b8f997c80da8ddf3ae95b89c

UI: Move all Selected Markers when Dragging

Part of T57918. Selecting and dragging items were conflicting actions
previously when both were using the same mouse button. This avoids the
conflict.

See 056fcdfe7bbed3 for details on behavior.

===

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

===

diff --git a/source/blender/editors/animation/anim_markers.c 
b/source/blender/editors/animation/anim_markers.c
index 2a35acdefcb..29d06d5b297 100644
--- a/source/blender/editors/animation/anim_markers.c
+++ b/source/blender/editors/animation/anim_markers.c
@@ -1148,33 +1148,48 @@ static void deselect_markers(ListBase *markers)
 }
 
 /* select/deselect TimeMarker at current frame */
-static void select_timeline_marker_frame(ListBase *markers, int frame, bool 
extend)
+static int select_timeline_marker_frame(ListBase *markers,
+int frame,
+bool extend,
+bool wait_to_deselect_others)
 {
-  TimeMarker *marker, *marker_first = NULL;
+  TimeMarker *marker, *marker_selected = NULL;
+  int ret_val = OPERATOR_FINISHED;
+
+  if (extend) {
+wait_to_deselect_others = false;
+  }
 
   /* support for selection cycling */
   for (marker = markers->first; marker; marker = marker->next) {
 if (marker->frame == frame) {
   if (marker->flag & SELECT) {
-marker_first = marker->next;
+marker_selected = marker->next;
 break;
   }
 }
   }
 
-  /* if extend is not set, then deselect markers */
-  if (extend == false) {
-deselect_markers(markers);
+  if (wait_to_deselect_others && marker_selected) {
+ret_val = OPERATOR_RUNNING_MODAL;
   }
+  /* if extend is not set, then deselect markers */
+  else {
+if (extend == false) {
+  deselect_markers(markers);
+}
 
-  LISTBASE_CIRCULAR_FORWARD_BEGIN (markers, marker, marker_first) {
-/* this way a not-extend select will always give 1 selected marker */
-if (marker->frame == frame) {
-  marker->flag ^= SELECT;
-  break;
+LISTBASE_CIRCULAR_FORWARD_BEGIN (markers, marker, marker_selected) {
+  /* this way a not-extend select will always give 1 selected marker */
+  if ((marker->frame == frame)) {
+marker->flag ^= SELECT;
+break;
+  }
 }
+LISTBASE_CIRCULAR_FORWARD_END(markers, marker, marker_selected);
   }
-  LISTBASE_CIRCULAR_FORWARD_END(markers, marker, marker_first);
+
+  return ret_val;
 }
 
 static void select_marker_camera_switch(
@@ -1221,17 +1236,17 @@ static void select_marker_camera_switch(
 #endif
 }
 
-static int ed_marker_select(bContext *C, const wmEvent *event, bool extend, 
bool camera)
+static int ed_marker_select(
+bContext *C, const int mval[2], bool extend, bool camera, bool 
wait_to_deselect_others)
 {
   ListBase *markers = ED_context_get_markers(C);
-  ARegion *ar = CTX_wm_region(C);
   View2D *v2d = UI_view2d_fromcontext(C);
+  int ret_val = OPERATOR_FINISHED;
 
-  float mouse_region_x = event->x - ar->winrct.xmin;
-  if (region_position_is_over_marker(v2d, markers, mouse_region_x)) {
-float frame_at_mouse_position = UI_view2d_region_to_view_x(v2d, 
mouse_region_x);
+  if (region_position_is_over_marker(v2d, markers, mval[0])) {
+float frame_at_mouse_position = UI_view2d_region_to_view_x(v2d, mval[0]);
 int cfra = ED_markers_find_nearest_marker_time(markers, 
frame_at_mouse_position);
-select_timeline_marker_frame(markers, cfra, extend);
+ret_val = select_timeline_marker_frame(markers, cfra, extend, 
wait_to_deselect_others);
 
 select_marker_camera_switch(C, camera, extend, markers, cfra);
   }
@@ -1243,17 +1258,22 @@ static int ed_marker_select(bContext *C, const wmEvent 
*event, bool extend, bool
   WM_event_add_notifier(C, NC_ANIMATION | ND_MARKERS, NULL);
 
   /* allowing tweaks, but needs OPERATOR_FINISHED, otherwise renaming fails... 
[#25987] */
-  return OPERATOR_FINISHED | OPERATOR_PASS_THROUGH;
+  return ret_val | OPERATOR_PASS_THROUGH;
 }
 
-static int ed_marker_select_invoke(bContext *C, wmOperator *op, const wmEvent 
*event)
+static int ed_marker_select_exec(bContext *C, wmOperator *op)
 {
   const bool extend = RNA_boolean_get(op->ptr, "extend");
+  const bool wait_to_deselect_others = RNA_boolean_get(op->ptr, 
"wait_to_deselect_others");
   bool camera = false;
 #ifdef DURIAN_CAMERA_SWITCH
   camera = RNA_boolean_get(op->ptr, "camera");
 #endif
-  return ed_marker_select(C, event, extend, camera);
+  int mval[2];
+  mval[0] = RNA_int_get(op->ptr, "mouse_x");
+  mval[1] = RNA_int_get(op->ptr, "mouse_y");
+
+  return ed_marker_select(C, mval, extend, camera, 

[Bf-blender-cvs] [1f5ae1a5a50] master: UI: Move all Selected Strips and Strip Handles when Dragging

2019-10-04 Thread Julian Eisel
Commit: 1f5ae1a5a505ad5aba8bcae794ca0c4e9dd2d684
Author: Julian Eisel
Date:   Fri Oct 4 15:23:03 2019 +0200
Branches: master
https://developer.blender.org/rB1f5ae1a5a505ad5aba8bcae794ca0c4e9dd2d684

UI: Move all Selected Strips and Strip Handles when Dragging

Part of T57918. Selecting and dragging items were previously conflicting
actions when both were using the same mouse button. This avoids the
conflict.

See 056fcdfe7bbed3 for details on behavior.

===

M   source/blender/editors/space_sequencer/sequencer_select.c

===

diff --git a/source/blender/editors/space_sequencer/sequencer_select.c 
b/source/blender/editors/space_sequencer/sequencer_select.c
index affb6d3fd88..4c20fc1707a 100644
--- a/source/blender/editors/space_sequencer/sequencer_select.c
+++ b/source/blender/editors/space_sequencer/sequencer_select.c
@@ -319,7 +319,7 @@ void SEQUENCER_OT_select_inverse(struct wmOperatorType *ot)
   ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO;
 }
 
-static int sequencer_select_invoke(bContext *C, wmOperator *op, const wmEvent 
*event)
+static int sequencer_select_exec(bContext *C, wmOperator *op)
 {
   View2D *v2d = UI_view2d_fromcontext(C);
   Scene *scene = CTX_data_scene(C);
@@ -328,7 +328,13 @@ static int sequencer_select_invoke(bContext *C, wmOperator 
*op, const wmEvent *e
   const bool deselect_all = RNA_boolean_get(op->ptr, "deselect_all");
   const bool linked_handle = RNA_boolean_get(op->ptr, "linked_handle");
   const bool linked_time = RNA_boolean_get(op->ptr, "linked_time");
+  bool wait_to_deselect_others = RNA_boolean_get(op->ptr, 
"wait_to_deselect_others");
   int left_right = RNA_enum_get(op->ptr, "left_right");
+  int mval[2];
+  int ret_value = OPERATOR_CANCELLED;
+
+  mval[0] = RNA_int_get(op->ptr, "mouse_x");
+  mval[1] = RNA_int_get(op->ptr, "mouse_y");
 
   Sequence *seq, *neighbor, *act_orig;
   int hand, sel_side;
@@ -338,9 +344,13 @@ static int sequencer_select_invoke(bContext *C, wmOperator 
*op, const wmEvent *e
 return OPERATOR_CANCELLED;
   }
 
+  if (extend) {
+wait_to_deselect_others = false;
+  }
+
   marker = find_nearest_marker(SCE_MARKERS, 1);  // XXX - dummy function for 
now
 
-  seq = find_nearest_seq(scene, v2d, , event->mval);
+  seq = find_nearest_seq(scene, v2d, , mval);
 
   // XXX - not nice, Ctrl+RMB needs to do left_right only when not over a strip
   if (seq && linked_time && (left_right == SEQ_SELECT_LR_MOUSE)) {
@@ -364,6 +374,8 @@ static int sequencer_select_invoke(bContext *C, wmOperator 
*op, const wmEvent *e
   /* deselect_markers(0, 0); */
   marker->flag |= SELECT;
 }
+
+ret_value = OPERATOR_FINISHED;
   }
   else if (left_right != SEQ_SELECT_LR_NONE) {
 /* use different logic for this */
@@ -374,7 +386,7 @@ static int sequencer_select_invoke(bContext *C, wmOperator 
*op, const wmEvent *e
 
 switch (left_right) {
   case SEQ_SELECT_LR_MOUSE:
-x = UI_view2d_region_to_view_x(v2d, event->mval[0]);
+x = UI_view2d_region_to_view_x(v2d, mval[0]);
 break;
   case SEQ_SELECT_LR_LEFT:
 x = CFRA - 1.0f;
@@ -409,13 +421,27 @@ static int sequencer_select_invoke(bContext *C, 
wmOperator *op, const wmEvent *e
 }
   }
 }
+
+ret_value = OPERATOR_FINISHED;
   }
   else {
 act_orig = ed->act_seq;
 
 if (seq) {
-  if (!extend && !linked_handle) {
+  /* Are we trying to select a handle that's already selected? */
+  const bool handle_selected = ((hand == SEQ_SIDE_LEFT) && (seq->flag & 
SEQ_LEFTSEL)) ||
+   ((hand == SEQ_SIDE_RIGHT) && (seq->flag & 
SEQ_RIGHTSEL));
+
+  if (wait_to_deselect_others && (seq->flag & SELECT) &&
+  (hand == SEQ_SIDE_NONE || handle_selected)) {
+ret_value = OPERATOR_RUNNING_MODAL;
+  }
+  else if (!extend && !linked_handle) {
 ED_sequencer_deselect_all(scene);
+ret_value = OPERATOR_FINISHED;
+  }
+  else {
+ret_value = OPERATOR_FINISHED;
   }
 
   BKE_sequencer_active_set(scene, seq);
@@ -509,6 +535,8 @@ static int sequencer_select_invoke(bContext *C, wmOperator 
*op, const wmEvent *e
 select_active_side(ed->seqbasep, sel_side, seq->machine, 
seq->startdisp);
   }
 }
+
+ret_value = OPERATOR_FINISHED;
   }
   else {
 if (extend && (seq->flag & SELECT) && ed->act_seq == act_orig) {
@@ -525,6 +553,7 @@ static int sequencer_select_invoke(bContext *C, wmOperator 
*op, const wmEvent *e
   seq->flag ^= SEQ_RIGHTSEL;
   break;
   }
+  ret_value = OPERATOR_FINISHED;
 }
 else {
   seq->flag |= SELECT;
@@ -542,9 +571,12 @@ static int sequencer_select_invoke(bContext *C, wmOperator 
*op, const wmEvent *e
   if (linked_time) {
 select_linked_time(ed->seqbasep, seq);
   }
+
+  

[Bf-blender-cvs] [5f51e781720] master: Node Editor: Use new operator utilities for node selection and dragging

2019-10-04 Thread Julian Eisel
Commit: 5f51e781720649be7c1079353d068a51829b33b9
Author: Julian Eisel
Date:   Fri Oct 4 15:19:30 2019 +0200
Branches: master
https://developer.blender.org/rB5f51e781720649be7c1079353d068a51829b33b9

Node Editor: Use new operator utilities for node selection and dragging

Previous commit moved most of this code into more general/generic
utility functions, so we can use that in the Node Editor now.

===

M   source/blender/editors/space_node/node_select.c

===

diff --git a/source/blender/editors/space_node/node_select.c 
b/source/blender/editors/space_node/node_select.c
index b66cd0d3069..e22ef389516 100644
--- a/source/blender/editors/space_node/node_select.c
+++ b/source/blender/editors/space_node/node_select.c
@@ -557,100 +557,40 @@ static int node_mouse_select(bContext *C,
 
 static int node_select_exec(bContext *C, wmOperator *op)
 {
+  const bool wait_to_deselect_others = RNA_boolean_get(op->ptr, 
"wait_to_deselect_others");
+
   /* get settings from RNA properties for operator */
   int mval[2];
   mval[0] = RNA_int_get(op->ptr, "mouse_x");
   mval[1] = RNA_int_get(op->ptr, "mouse_y");
 
   /* perform the select */
-  const int ret_value = node_mouse_select(C, op, mval, false);
+  const int ret_value = node_mouse_select(C, op, mval, 
wait_to_deselect_others);
 
   /* allow tweak event to work too */
   return ret_value | OPERATOR_PASS_THROUGH;
 }
 
-static int node_select_modal(bContext *C, wmOperator *op, const wmEvent *event)
-{
-  const short init_event_type = (short)POINTER_AS_INT(op->customdata);
-
-  /* get settings from RNA properties for operator */
-  int mval[2];
-  mval[0] = RNA_int_get(op->ptr, "mouse_x");
-  mval[1] = RNA_int_get(op->ptr, "mouse_y");
-
-  if (init_event_type == 0) {
-if (event->val == KM_PRESS) {
-  const int ret_value = node_mouse_select(C, op, mval, true);
-
-  op->customdata = POINTER_FROM_INT((int)event->type);
-  if (ret_value & OPERATOR_RUNNING_MODAL) {
-WM_event_add_modal_handler(C, op);
-  }
-  return ret_value | OPERATOR_PASS_THROUGH;
-}
-else {
-  /* If we are in init phase, and cannot validate init of modal operations,
-   * just fall back to basic exec.
-   */
-  const int ret_value = node_mouse_select(C, op, mval, false);
-  return ret_value | OPERATOR_PASS_THROUGH;
-}
-  }
-  else if (event->type == init_event_type && event->val == KM_RELEASE) {
-const int ret_value = node_mouse_select(C, op, mval, false);
-return ret_value | OPERATOR_PASS_THROUGH;
-  }
-  else if (ELEM(event->type, MOUSEMOVE, INBETWEEN_MOUSEMOVE)) {
-const int drag_delta[2] = {
-mval[0] - event->mval[0],
-mval[1] - event->mval[1],
-};
-/* If user moves mouse more than defined threshold, we consider select 
operator as
- * finished. Otherwise, it is still running until we get an 'release' 
event. In any
- * case, we pass through event, but select op is not finished yet. */
-if (WM_event_drag_test_with_delta(event, drag_delta)) {
-  return OPERATOR_FINISHED | OPERATOR_PASS_THROUGH;
-}
-else {
-  /* Important not to return anything other than PASS_THROUGH here,
-   * otherwise it prevents underlying tweak detection code to work 
properly. */
-  return OPERATOR_PASS_THROUGH;
-}
-  }
-
-  return OPERATOR_FINISHED | OPERATOR_PASS_THROUGH;
-}
-
-static int node_select_invoke(bContext *C, wmOperator *op, const wmEvent 
*event)
-{
-  RNA_int_set(op->ptr, "mouse_x", event->mval[0]);
-  RNA_int_set(op->ptr, "mouse_y", event->mval[1]);
-
-  op->customdata = POINTER_FROM_INT(0);
-
-  return node_select_modal(C, op, event);
-}
-
 void NODE_OT_select(wmOperatorType *ot)
 {
+  PropertyRNA *prop;
+
   /* identifiers */
   ot->name = "Select";
   ot->idname = "NODE_OT_select";
   ot->description = "Select the node under the cursor";
 
   /* api callbacks */
-  ot->invoke = node_select_invoke;
   ot->exec = node_select_exec;
-  ot->modal = node_select_modal;
+  ot->invoke = WM_generic_select_invoke;
+  ot->modal = WM_generic_select_modal;
   ot->poll = ED_operator_node_active;
 
   /* flags */
   ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO;
 
   /* properties */
-  PropertyRNA *prop;
-  RNA_def_int(ot->srna, "mouse_x", 0, INT_MIN, INT_MAX, "Mouse X", "", 
INT_MIN, INT_MAX);
-  RNA_def_int(ot->srna, "mouse_y", 0, INT_MIN, INT_MAX, "Mouse Y", "", 
INT_MIN, INT_MAX);
+  WM_operator_properties_generic_select(ot);
   RNA_def_boolean(ot->srna, "extend", false, "Extend", "");
   RNA_def_boolean(ot->srna, "socket_select", false, "Socket Select", "");
   prop = RNA_def_boolean(ot->srna,

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


[Bf-blender-cvs] [be2cd4bb532] master: WM: Utilities for select operators to work with click-dragging items

2019-10-04 Thread Julian Eisel
Commit: be2cd4bb5325fa7950a412fdd14448d49b342b57
Author: Julian Eisel
Date:   Fri Oct 4 15:11:19 2019 +0200
Branches: master
https://developer.blender.org/rBbe2cd4bb5325fa7950a412fdd14448d49b342b57

WM: Utilities for select operators to work with click-dragging items

Based on work by Bastien and Brecht in the Node Editor, this adds more
generalized support for selecting items so that click+drag actions on
items (nodes, makers, dopesheet keys, etc.) works as wanted.
Note that this only adds the barebones to support this in other editors,
it's not used yet (will be done in followup commits).

The behavior is supposed to work as follows:
* Clicking an unselected item immediately selects it, and deselects
  other items (doesn't wait for release events).
* Click+drag on an unselected item immediately selects it, deselects
  others and drags it in one go (don't require selecting it first!).
* Click+drag on a selected item won't change the selection state (and
  won't send an undo push) and start dragging all selected items as soon
  as the drag event is recognized.
* Clicking on a selected item will still deselect others, but that will
  only happen on mouse release, when we know the intention is not to drag
  the item.

Included in: https://developer.blender.org/D5979

Reviewed by: Brecht van Lommel, William Reynish

===

M   source/blender/windowmanager/WM_api.h
M   source/blender/windowmanager/intern/wm_operator_props.c
M   source/blender/windowmanager/intern/wm_operators.c

===

diff --git a/source/blender/windowmanager/WM_api.h 
b/source/blender/windowmanager/WM_api.h
index df253d619c9..f8b6b5171da 100644
--- a/source/blender/windowmanager/WM_api.h
+++ b/source/blender/windowmanager/WM_api.h
@@ -335,6 +335,12 @@ void WM_event_timer_sleep(struct wmWindowManager *wm,
 
 /* operator api, default callbacks */
 /* invoke callback, uses enum property named "type" */
+int WM_generic_select_modal(struct bContext *C,
+struct wmOperator *op,
+const struct wmEvent *event);
+int WM_generic_select_invoke(struct bContext *C,
+ struct wmOperator *op,
+ const struct wmEvent *event);
 void WM_operator_view3d_unit_defaults(struct bContext *C, struct wmOperator 
*op);
 int WM_operator_smooth_viewtx_get(const struct wmOperator *op);
 int WM_menu_invoke_ex(struct bContext *C, struct wmOperator *op, int 
opcontext);
@@ -474,6 +480,7 @@ void WM_operator_properties_select_random(struct 
wmOperatorType *ot);
 int WM_operator_properties_select_random_seed_increment_get(wmOperator *op);
 void WM_operator_properties_select_operation(struct wmOperatorType *ot);
 void WM_operator_properties_select_operation_simple(struct wmOperatorType *ot);
+void WM_operator_properties_generic_select(struct wmOperatorType *ot);
 struct CheckerIntervalParams {
   int nth; /* bypass when set to zero */
   int skip;
diff --git a/source/blender/windowmanager/intern/wm_operator_props.c 
b/source/blender/windowmanager/intern/wm_operator_props.c
index a8feb22cbf8..395de89c0da 100644
--- a/source/blender/windowmanager/intern/wm_operator_props.c
+++ b/source/blender/windowmanager/intern/wm_operator_props.c
@@ -396,6 +396,16 @@ void 
WM_operator_properties_select_operation_simple(wmOperatorType *ot)
   RNA_def_property_flag(prop, PROP_SKIP_SAVE);
 }
 
+void WM_operator_properties_generic_select(wmOperatorType *ot)
+{
+  PropertyRNA *prop = RNA_def_boolean(
+  ot->srna, "wait_to_deselect_others", true, "Wait to Deselect Others", 
"");
+  RNA_def_property_flag(prop, PROP_HIDDEN | PROP_SKIP_SAVE);
+
+  RNA_def_int(ot->srna, "mouse_x", 0, INT_MIN, INT_MAX, "Mouse X", "", 
INT_MIN, INT_MAX);
+  RNA_def_int(ot->srna, "mouse_y", 0, INT_MIN, INT_MAX, "Mouse Y", "", 
INT_MIN, INT_MAX);
+}
+
 void WM_operator_properties_gesture_box_zoom(wmOperatorType *ot)
 {
   WM_operator_properties_border(ot);
diff --git a/source/blender/windowmanager/intern/wm_operators.c 
b/source/blender/windowmanager/intern/wm_operators.c
index 97771d40b2c..292e27c3cbf 100644
--- a/source/blender/windowmanager/intern/wm_operators.c
+++ b/source/blender/windowmanager/intern/wm_operators.c
@@ -700,6 +700,82 @@ void WM_operator_properties_free(PointerRNA *ptr)
 /** \name Default Operator Callbacks
  * \{ */
 
+int WM_generic_select_modal(bContext *C, wmOperator *op, const wmEvent *event)
+{
+  PropertyRNA *wait_to_deselect_prop = RNA_struct_find_property(op->ptr,
+
"wait_to_deselect_others");
+  const short init_event_type = (short)POINTER_AS_INT(op->customdata);
+  int ret_value = 0;
+
+  /* get settings from RNA properties for operator */
+  int mval[2];
+  mval[0] = RNA_int_get(op->ptr, "mouse_x");
+  mval[1] = RNA_int_get(op->ptr, "mouse_y");
+
+  if (init_event_type == 0) {
+

[Bf-blender-cvs] [0bcada85b36] master: Fix T67212: No smooth blending in "Push Pose from Breakdown" and "Relax Pose to Breakdown"

2019-10-04 Thread Sebastian Parborg
Commit: 0bcada85b362fcc1874a1bf13ece157870c0fea7
Author: Sebastian Parborg
Date:   Fri Oct 4 16:37:56 2019 +0200
Branches: master
https://developer.blender.org/rB0bcada85b362fcc1874a1bf13ece157870c0fea7

Fix T67212: No smooth blending in "Push Pose from Breakdown" and "Relax Pose to 
Breakdown"

The previous method produced non smooth interpolation results and it was
very hard to control. (At least for me it seemed to be broken until I
actually took a look at what the code actually did)

Now we simply linearly interpolate between the breakdown position and
the current bone data.

Reviewed By: Sybren, Hjalti

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

===

M   source/blender/editors/armature/pose_slide.c

===

diff --git a/source/blender/editors/armature/pose_slide.c 
b/source/blender/editors/armature/pose_slide.c
index 616daf94e57..7ed41b5b4d0 100644
--- a/source/blender/editors/armature/pose_slide.c
+++ b/source/blender/editors/armature/pose_slide.c
@@ -368,30 +368,14 @@ static void pose_slide_apply_val(tPoseSlideOp *pso, 
FCurve *fcu, Object *ob, flo
   switch (pso->mode) {
 case POSESLIDE_PUSH: /* make the current pose more pronounced */
 {
-  /* perform a weighted average here, favoring the middle pose
-   * - numerator should be larger than denominator to 'expand' the result
-   * - perform this weighting a number of times given by the percentage...
-   */
-  /* TODO: maybe a sensitivity ctrl on top of this is needed */
-  int iters = (int)ceil(10.0f * pso->percentage);
-
-  while (iters-- > 0) {
-(*val) = (-((sVal * w2) + (eVal * w1)) + ((*val) * 6.0f)) / 5.0f;
-  }
+  /* Slide the pose away from the breakdown pose in the timeline */
+  (*val) -= ((sVal * w2) + (eVal * w1) - (*val)) * pso->percentage;
   break;
 }
 case POSESLIDE_RELAX: /* make the current pose more like its surrounding 
ones */
 {
-  /* perform a weighted average here, favoring the middle pose
-   * - numerator should be smaller than denominator to 'relax' the result
-   * - perform this weighting a number of times given by the percentage...
-   */
-  /* TODO: maybe a sensitivity ctrl on top of this is needed */
-  int iters = (int)ceil(10.0f * pso->percentage);
-
-  while (iters-- > 0) {
-(*val) = (((sVal * w2) + (eVal * w1)) + ((*val) * 5.0f)) / 6.0f;
-  }
+  /* Slide the pose towards the breakdown pose in the timeline */
+  (*val) += ((sVal * w2) + (eVal * w1) - (*val)) * pso->percentage;
   break;
 }
 case POSESLIDE_BREAKDOWN: /* make the current pose slide around between 
the endpoints */

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


[Bf-blender-cvs] [b9736e8e12d] master: Add Opus audio library and configure FFmpeg to use it

2019-10-04 Thread Sybren A. Stüvel
Commit: b9736e8e12dd9e1cd37fcde2ab330131c24dafd1
Author: Sybren A. Stüvel
Date:   Fri Oct 4 16:29:37 2019 +0200
Branches: master
https://developer.blender.org/rBb9736e8e12dd9e1cd37fcde2ab330131c24dafd1

Add Opus audio library and configure FFmpeg to use it

Opus support was enabled in 2ddfd51810e0. This commit adds the Opus
library and configures FFmpeg to be compiled with Opus support.

NOTE: It may be required to run `cmake -U '*FFMPEG_LIBRARIES*' .` in
your Blender build directory in order to refresh the `FFMPEG_LIBRARIES`
setting and add libopus.

===

M   build_files/build_environment/CMakeLists.txt
M   build_files/build_environment/cmake/ffmpeg.cmake
M   build_files/build_environment/cmake/harvest.cmake
A   build_files/build_environment/cmake/opus.cmake
M   build_files/build_environment/cmake/versions.cmake
M   build_files/build_environment/install_deps.sh
M   build_files/cmake/platform/platform_apple.cmake

===

diff --git a/build_files/build_environment/CMakeLists.txt 
b/build_files/build_environment/CMakeLists.txt
index 9756ad28454..e7590727822 100644
--- a/build_files/build_environment/CMakeLists.txt
+++ b/build_files/build_environment/CMakeLists.txt
@@ -128,6 +128,7 @@ if(NOT WIN32 OR ENABLE_MINGW64)
 include(cmake/ogg.cmake)
 include(cmake/vorbis.cmake)
 include(cmake/theora.cmake)
+include(cmake/opus.cmake)
 include(cmake/vpx.cmake)
 include(cmake/x264.cmake)
 include(cmake/xvidcore.cmake)
diff --git a/build_files/build_environment/cmake/ffmpeg.cmake 
b/build_files/build_environment/cmake/ffmpeg.cmake
index fc0116e9ee9..307a5f97aa6 100644
--- a/build_files/build_environment/cmake/ffmpeg.cmake
+++ b/build_files/build_environment/cmake/ffmpeg.cmake
@@ -16,10 +16,10 @@
 #
 # * END GPL LICENSE BLOCK *
 
-set(FFMPEG_CFLAGS "-I${mingw_LIBDIR}/lame/include 
-I${mingw_LIBDIR}/openjpeg/include/ -I${mingw_LIBDIR}/ogg/include 
-I${mingw_LIBDIR}/vorbis/include -I${mingw_LIBDIR}/theora/include 
-I${mingw_LIBDIR}/vpx/include -I${mingw_LIBDIR}/x264/include 
-I${mingw_LIBDIR}/xvidcore/include -I${mingw_LIBDIR}/zlib/include")
-set(FFMPEG_LDFLAGS "-L${mingw_LIBDIR}/lame/lib -L${mingw_LIBDIR}/openjpeg/lib 
-L${mingw_LIBDIR}/ogg/lib -L${mingw_LIBDIR}/vorbis/lib 
-L${mingw_LIBDIR}/theora/lib -L${mingw_LIBDIR}/vpx/lib 
-L${mingw_LIBDIR}/x264/lib -L${mingw_LIBDIR}/xvidcore/lib 
-L${mingw_LIBDIR}/zlib/lib")
+set(FFMPEG_CFLAGS "-I${mingw_LIBDIR}/lame/include 
-I${mingw_LIBDIR}/openjpeg/include/ -I${mingw_LIBDIR}/ogg/include 
-I${mingw_LIBDIR}/vorbis/include -I${mingw_LIBDIR}/theora/include 
-I${mingw_LIBDIR}/opus/include -I${mingw_LIBDIR}/vpx/include 
-I${mingw_LIBDIR}/x264/include -I${mingw_LIBDIR}/xvidcore/include 
-I${mingw_LIBDIR}/zlib/include")
+set(FFMPEG_LDFLAGS "-L${mingw_LIBDIR}/lame/lib -L${mingw_LIBDIR}/openjpeg/lib 
-L${mingw_LIBDIR}/ogg/lib -L${mingw_LIBDIR}/vorbis/lib 
-L${mingw_LIBDIR}/theora/lib -L${mingw_LIBDIR}/opus/lib 
-L${mingw_LIBDIR}/vpx/lib -L${mingw_LIBDIR}/x264/lib 
-L${mingw_LIBDIR}/xvidcore/lib -L${mingw_LIBDIR}/zlib/lib")
 set(FFMPEG_EXTRA_FLAGS --pkg-config-flags=--static 
--extra-cflags=${FFMPEG_CFLAGS} --extra-ldflags=${FFMPEG_LDFLAGS})
-set(FFMPEG_ENV 
PKG_CONFIG_PATH=${mingw_LIBDIR}/openjpeg/lib/pkgconfig:${mingw_LIBDIR}/x264/lib/pkgconfig:${mingw_LIBDIR}/vorbis/lib/pkgconfig:${mingw_LIBDIR}/ogg/lib/pkgconfig:${mingw_LIBDIR}:${mingw_LIBDIR}/vpx/lib/pkgconfig:${mingw_LIBDIR}/theora/lib/pkgconfig:${mingw_LIBDIR}/openjpeg/lib/pkgconfig)
+set(FFMPEG_ENV 
PKG_CONFIG_PATH=${mingw_LIBDIR}/openjpeg/lib/pkgconfig:${mingw_LIBDIR}/x264/lib/pkgconfig:${mingw_LIBDIR}/vorbis/lib/pkgconfig:${mingw_LIBDIR}/ogg/lib/pkgconfig:${mingw_LIBDIR}:${mingw_LIBDIR}/vpx/lib/pkgconfig:${mingw_LIBDIR}/theora/lib/pkgconfig:${mingw_LIBDIR}/openjpeg/lib/pkgconfig:${mingw_LIBDIR}/opus/lib/pkgconfig)
 
 if(WIN32)
   set(FFMPEG_ENV set ${FFMPEG_ENV} &&)
@@ -73,6 +73,7 @@ ExternalProject_Add(external_ffmpeg
 --disable-libgsm
 --disable-libspeex
 --enable-libvpx
+--enable-libopus
 --prefix=${LIBDIR}/ffmpeg
 --enable-libtheora
 --enable-libvorbis
@@ -130,6 +131,7 @@ add_dependencies(
   external_openjpeg
   external_xvidcore
   external_x264
+  external_opus
   external_vpx
   external_theora
   external_vorbis
diff --git a/build_files/build_environment/cmake/harvest.cmake 
b/build_files/build_environment/cmake/harvest.cmake
index 526e72e2e33..b10b413c39a 100644
--- a/build_files/build_environment/cmake/harvest.cmake
+++ b/build_files/build_environment/cmake/harvest.cmake
@@ -192,6 +192,7 @@ harvest(theora/lib ffmpeg/lib "*.a")
 harvest(tiff/include tiff/include "*.h")
 harvest(tiff/lib tiff/lib "*.a")
 harvest(vorbis/lib ffmpeg/lib "*.a")
+harvest(opus/lib ffmpeg/lib "*.a")
 harvest(vpx/lib ffmpeg/lib "*.a")
 harvest(webp/lib ffmpeg/lib "*.a")
 harvest(x264/lib ffmpeg/lib "*.a")
diff --git 

[Bf-blender-cvs] [6d8c053187c] master: Fix T70514: VP9 not working

2019-10-04 Thread Sybren A. Stüvel
Commit: 6d8c053187cbaf5773509ac8beab4f7e3525ad0d
Author: Sybren A. Stüvel
Date:   Fri Oct 4 14:24:55 2019 +0200
Branches: master
https://developer.blender.org/rB6d8c053187cbaf5773509ac8beab4f7e3525ad0d

Fix T70514: VP9 not working

This issue was two-fold:

- In the VPX library build script: missing `--enable-vp8` and
  `--enable-vp9` meant that the choice to enable these codecs or not was
  left to the library's `configure` script, rather than an explicit choice.
  On the build-bot it chose to not enable them.
- Missing pkgconfig paths passed to the FFmpeg build script

Thanks @brecht for helping out.

===

M   build_files/build_environment/cmake/ffmpeg.cmake
M   build_files/build_environment/cmake/vpx.cmake

===

diff --git a/build_files/build_environment/cmake/ffmpeg.cmake 
b/build_files/build_environment/cmake/ffmpeg.cmake
index 27d817e8948..fc0116e9ee9 100644
--- a/build_files/build_environment/cmake/ffmpeg.cmake
+++ b/build_files/build_environment/cmake/ffmpeg.cmake
@@ -19,7 +19,7 @@
 set(FFMPEG_CFLAGS "-I${mingw_LIBDIR}/lame/include 
-I${mingw_LIBDIR}/openjpeg/include/ -I${mingw_LIBDIR}/ogg/include 
-I${mingw_LIBDIR}/vorbis/include -I${mingw_LIBDIR}/theora/include 
-I${mingw_LIBDIR}/vpx/include -I${mingw_LIBDIR}/x264/include 
-I${mingw_LIBDIR}/xvidcore/include -I${mingw_LIBDIR}/zlib/include")
 set(FFMPEG_LDFLAGS "-L${mingw_LIBDIR}/lame/lib -L${mingw_LIBDIR}/openjpeg/lib 
-L${mingw_LIBDIR}/ogg/lib -L${mingw_LIBDIR}/vorbis/lib 
-L${mingw_LIBDIR}/theora/lib -L${mingw_LIBDIR}/vpx/lib 
-L${mingw_LIBDIR}/x264/lib -L${mingw_LIBDIR}/xvidcore/lib 
-L${mingw_LIBDIR}/zlib/lib")
 set(FFMPEG_EXTRA_FLAGS --pkg-config-flags=--static 
--extra-cflags=${FFMPEG_CFLAGS} --extra-ldflags=${FFMPEG_LDFLAGS})
-set(FFMPEG_ENV 
PKG_CONFIG_PATH=${mingw_LIBDIR}/openjpeg/lib/pkgconfig:${mingw_LIBDIR}/x264/lib/pkgconfig:${mingw_LIBDIR}/vorbis/lib/pkgconfig:${mingw_LIBDIR}/ogg/lib/pkgconfig:${mingw_LIBDIR})
+set(FFMPEG_ENV 
PKG_CONFIG_PATH=${mingw_LIBDIR}/openjpeg/lib/pkgconfig:${mingw_LIBDIR}/x264/lib/pkgconfig:${mingw_LIBDIR}/vorbis/lib/pkgconfig:${mingw_LIBDIR}/ogg/lib/pkgconfig:${mingw_LIBDIR}:${mingw_LIBDIR}/vpx/lib/pkgconfig:${mingw_LIBDIR}/theora/lib/pkgconfig:${mingw_LIBDIR}/openjpeg/lib/pkgconfig)
 
 if(WIN32)
   set(FFMPEG_ENV set ${FFMPEG_ENV} &&)
diff --git a/build_files/build_environment/cmake/vpx.cmake 
b/build_files/build_environment/cmake/vpx.cmake
index 1c3a7081b59..741493859e2 100644
--- a/build_files/build_environment/cmake/vpx.cmake
+++ b/build_files/build_environment/cmake/vpx.cmake
@@ -49,6 +49,8 @@ ExternalProject_Add(external_vpx
   --disable-avx2
   --disable-unit-tests
   --disable-examples
+  --enable-vp8
+  --enable-vp9
   ${VPX_EXTRA_FLAGS}
   BUILD_COMMAND ${CONFIGURE_ENV} && cd ${BUILD_DIR}/vpx/src/external_vpx/ && 
make -j${MAKE_THREADS}
   INSTALL_COMMAND ${CONFIGURE_ENV} && cd ${BUILD_DIR}/vpx/src/external_vpx/ && 
make install

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


[Bf-blender-cvs] [663d23dd9dc] master: Fix T70463 GPU: Very Slow Workbench/Eevee Performance

2019-10-04 Thread Clément Foucault
Commit: 663d23dd9dc4801a679b00e5d8ac80483d9b36a8
Author: Clément Foucault
Date:   Fri Oct 4 16:29:41 2019 +0200
Branches: master
https://developer.blender.org/rB663d23dd9dc4801a679b00e5d8ac80483d9b36a8

Fix T70463 GPU: Very Slow Workbench/Eevee Performance

===

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

===

diff --git a/source/blender/gpu/intern/gpu_batch.c 
b/source/blender/gpu/intern/gpu_batch.c
index dcc94cd843c..cffe46f4396 100644
--- a/source/blender/gpu/intern/gpu_batch.c
+++ b/source/blender/gpu/intern/gpu_batch.c
@@ -856,16 +856,19 @@ void GPU_draw_list_submit(GPUDrawList *list)
   uintptr_t offset = list->cmd_offset;
   uint cmd_len = list->cmd_len;
   size_t bytes_used = cmd_len * sizeof(GPUDrawCommandIndexed);
-  list->cmd_offset += bytes_used;
   list->cmd_len = 0; /* Avoid reuse. */
 
-  if (USE_MULTI_DRAW_INDIRECT) {
+  /* Only do multidraw indirect if doing more than 2 drawcall.
+   * This avoids the overhead of buffer mapping if scene is
+   * not very instance friendly. */
+  if (USE_MULTI_DRAW_INDIRECT && cmd_len > 2) {
 GLenum prim = batch->gl_prim_type;
 
 glBindBuffer(GL_DRAW_INDIRECT_BUFFER, list->buffer_id);
 glFlushMappedBufferRange(GL_DRAW_INDIRECT_BUFFER, 0, bytes_used);
 glUnmapBuffer(GL_DRAW_INDIRECT_BUFFER);
 list->commands = NULL; /* Unmapped */
+list->cmd_offset += bytes_used;
 
 if (batch->elem) {
   glMultiDrawElementsIndirect(prim, INDEX_TYPE(batch->elem), (void 
*)offset, cmd_len, 0);

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


[Bf-blender-cvs] [56dd7feb06b] master: GPU: Platform Support Level

2019-10-04 Thread Jeroen Bakker
Commit: 56dd7feb06bff69dce11d72828a6091eb48adebe
Author: Jeroen Bakker
Date:   Thu Oct 3 16:21:23 2019 +0200
Branches: master
https://developer.blender.org/rB56dd7feb06bff69dce11d72828a6091eb48adebe

GPU: Platform Support Level

Adds a check when starting blender if your platform is supported. We use a 
blacklist
as drivers are updated more regular then blender (stable releases).

The mechanism detects if the support level changed or has been validated by the 
user previously.
Changes can happen due to users updating their drivers, but also when we change 
the support
level in our code base.

When the user has seen the limited support level message it is saved in the 
user config.
It would be better to have a system specific config section, but currently not 
clear
what could benefit from that.

When the platform is unsupported or has limited support a dialog box will 
appear including a link
to our user manual describing what to do.

**Windows**
Windows uses the MessageBox that is provided by the windows kernel.

**X11**
We use a very lowlevel messagebox for X11. It is very limited in use and can be 
fine tuned when needed.

**SDL/APPLE**
There is no implementation for SDL or APPLE at this moment as the platform 
support feature targets mostly Windows users.

Reviewed By: brecht

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

===

M   intern/ghost/GHOST_C-api.h
M   intern/ghost/GHOST_ISystem.h
M   intern/ghost/GHOST_Types.h
M   intern/ghost/intern/GHOST_C-api.cpp
M   intern/ghost/intern/GHOST_System.h
M   intern/ghost/intern/GHOST_SystemCocoa.mm
M   intern/ghost/intern/GHOST_SystemWin32.cpp
M   intern/ghost/intern/GHOST_SystemWin32.h
M   intern/ghost/intern/GHOST_SystemX11.cpp
M   intern/ghost/intern/GHOST_SystemX11.h
M   source/blender/blenkernel/BKE_appdir.h
M   source/blender/draw/engines/eevee/eevee_effects.c
M   source/blender/draw/engines/eevee/eevee_occlusion.c
M   source/blender/draw/intern/draw_manager_exec.c
M   source/blender/editors/screen/screen_draw.c
M   source/blender/editors/space_node/drawnode.c
M   source/blender/gpu/CMakeLists.txt
M   source/blender/gpu/GPU_extensions.h
A   source/blender/gpu/GPU_platform.h
M   source/blender/gpu/intern/gpu_batch.c
M   source/blender/gpu/intern/gpu_draw.c
M   source/blender/gpu/intern/gpu_extensions.c
M   source/blender/gpu/intern/gpu_init_exit.c
A   source/blender/gpu/intern/gpu_platform.c
M   source/blender/gpu/intern/gpu_private.h
M   source/blender/gpu/intern/gpu_shader.c
M   source/blender/gpu/intern/gpu_texture.c
M   source/blender/windowmanager/CMakeLists.txt
M   source/blender/windowmanager/intern/wm_init_exit.c
A   source/blender/windowmanager/intern/wm_platform_support.c
A   source/blender/windowmanager/intern/wm_platform_support.h
M   source/blender/windowmanager/intern/wm_window.c
A   source/blender/windowmanager/intern/wm_window_private.h

===

diff --git a/intern/ghost/GHOST_C-api.h b/intern/ghost/GHOST_C-api.h
index 220e7aab8cd..5e0216c0339 100644
--- a/intern/ghost/GHOST_C-api.h
+++ b/intern/ghost/GHOST_C-api.h
@@ -65,6 +65,21 @@ extern GHOST_SystemHandle GHOST_CreateSystem(void);
  */
 extern GHOST_TSuccess GHOST_DisposeSystem(GHOST_SystemHandle systemhandle);
 
+/**
+ * Show a system message box to the user
+ * \param systemhandleThe handle to the system
+ * \param title   Title of the message box
+ * \param message Message of the message box
+ * \param linkOptional (hyper)link to a webpage to show when 
pressing help
+ * \param dialog_options  Options to configure the message box.
+ * \return void.
+ */
+extern void GHOST_ShowMessageBox(GHOST_SystemHandle systemhandle,
+ const char *title,
+ const char *message,
+ const char *link,
+ GHOST_DialogOptions dialog_options);
+
 /**
  * Creates an event consumer object
  * \param eventCallback The event callback routine.
@@ -191,6 +206,7 @@ extern GHOST_WindowHandle 
GHOST_CreateDialogWindow(GHOST_SystemHandle systemhand
  * Create a new offscreen context.
  * Never explicitly delete the context, use disposeContext() instead.
  * \param systemhandle The handle to the system
+ * \param platform_support_callback An optional callback to check platform 
support
  * \return A handle to the new context ( == NULL if creation failed).
  */
 extern GHOST_ContextHandle GHOST_CreateOpenGLContext(GHOST_SystemHandle 
systemhandle);
diff --git a/intern/ghost/GHOST_ISystem.h b/intern/ghost/GHOST_ISystem.h
index 1eeb6cd852f..d89785ad9b2 100644
--- a/intern/ghost/GHOST_ISystem.h
+++ b/intern/ghost/GHOST_ISystem.h
@@ -437,6 +437,23 @@ class GHOST_ISystem {
*/
   virtual void 

[Bf-blender-cvs] [45745f7862b] master: Fix: Gain socket is not available in ridged multifractal.

2019-10-04 Thread OmarSquircleArt
Commit: 45745f7862beb8baaf060d66ca97513d5dd9d848
Author: OmarSquircleArt
Date:   Fri Oct 4 16:05:36 2019 +0200
Branches: master
https://developer.blender.org/rB45745f7862beb8baaf060d66ca97513d5dd9d848

Fix: Gain socket is not available in ridged multifractal.

The gain socket in the Musgrave node should be available in the ridged
multifractal mode. The logic for the availability was incorrect.

Reviewers: brecht

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

===

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

===

diff --git a/source/blender/nodes/shader/nodes/node_shader_tex_musgrave.c 
b/source/blender/nodes/shader/nodes/node_shader_tex_musgrave.c
index daf4053f182..56e102a118d 100644
--- a/source/blender/nodes/shader/nodes/node_shader_tex_musgrave.c
+++ b/source/blender/nodes/shader/nodes/node_shader_tex_musgrave.c
@@ -136,8 +136,8 @@ static void node_shader_update_tex_musgrave(bNodeTree 
*UNUSED(ntree), bNode *nod
 tex->musgrave_type != SHD_MUSGRAVE_MULTIFRACTAL &&
 tex->musgrave_type != SHD_MUSGRAVE_FBM);
   nodeSetSocketAvailability(inGainSock,
-tex->musgrave_type == 
SHD_MUSGRAVE_HYBRID_MULTIFRACTAL &&
-tex->musgrave_type != 
SHD_MUSGRAVE_RIDGED_MULTIFRACTAL);
+tex->musgrave_type == 
SHD_MUSGRAVE_HYBRID_MULTIFRACTAL ||
+tex->musgrave_type == 
SHD_MUSGRAVE_RIDGED_MULTIFRACTAL);
 }
 
 void register_node_type_sh_tex_musgrave(void)

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


[Bf-blender-cvs] [295f8884336] master: Fix T70504: Moving nodes in the node editor stops after hotkey is lifted

2019-10-04 Thread Philipp Oeser
Commit: 295f8884336c6e4a3eb58cacb70ca3eb662a866f
Author: Philipp Oeser
Date:   Fri Oct 4 15:50:42 2019 +0200
Branches: master
https://developer.blender.org/rB295f8884336c6e4a3eb58cacb70ca3eb662a866f

Fix T70504: Moving nodes in the node editor stops after hotkey is lifted

This basically reverts 540eb2dc1e57 for an alternative solution that
only enforforces release_confirm [ignoring the preference] on mouse for
the node editor.

Approved by @brecht in T70504.

===

M   source/blender/editors/space_node/node_ops.c
M   source/blender/editors/transform/transform_generics.c

===

diff --git a/source/blender/editors/space_node/node_ops.c 
b/source/blender/editors/space_node/node_ops.c
index 5874b6d1cc0..11933ef0811 100644
--- a/source/blender/editors/space_node/node_ops.c
+++ b/source/blender/editors/space_node/node_ops.c
@@ -143,7 +143,6 @@ void ED_operatormacros_node(void)
 "Move nodes and attach to frame",
 OPTYPE_UNDO | OPTYPE_REGISTER);
   mot = WM_operatortype_macro_define(ot, "TRANSFORM_OT_translate");
-  RNA_boolean_set(mot->ptr, "release_confirm", true);
   WM_operatortype_macro_define(ot, "NODE_OT_attach");
   WM_operatortype_macro_define(ot, "NODE_OT_insert_offset");
 
@@ -153,7 +152,6 @@ void ED_operatormacros_node(void)
 "Move nodes and attach to frame",
 OPTYPE_UNDO | OPTYPE_REGISTER);
   mot = WM_operatortype_macro_define(ot, "TRANSFORM_OT_translate");
-  RNA_boolean_set(mot->ptr, "release_confirm", true);
   RNA_boolean_set(mot->ptr, "remove_on_cancel", true);
   WM_operatortype_macro_define(ot, "NODE_OT_attach");
   WM_operatortype_macro_define(ot, "NODE_OT_insert_offset");
diff --git a/source/blender/editors/transform/transform_generics.c 
b/source/blender/editors/transform/transform_generics.c
index 083b5b94c48..2dae16da4c3 100644
--- a/source/blender/editors/transform/transform_generics.c
+++ b/source/blender/editors/transform/transform_generics.c
@@ -1707,7 +1707,8 @@ void initTransInfo(bContext *C, TransInfo *t, wmOperator 
*op, const wmEvent *eve
 }
   }
   else {
-if (ISMOUSE(t->launch_event) && (U.flag & USER_RELEASECONFIRM)) {
+/* Release confirms preference should not affect node editor (T69288, 
T70504). */
+if (ISMOUSE(t->launch_event) && ((U.flag & USER_RELEASECONFIRM) || 
(t->spacetype == SPACE_NODE))) {
   /* Global "release confirm" on mouse bindings */
   t->flag |= T_RELEASE_CONFIRM;
 }

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


[Bf-blender-cvs] [40492251f2f] master: Fix T70454: Environment Texture Node Properties "reload" and "packing" not working

2019-10-04 Thread Philipp Oeser
Commit: 40492251f2ff7b82468d8b922d95c2af4b98264c
Author: Philipp Oeser
Date:   Fri Oct 4 14:58:40 2019 +0200
Branches: master
https://developer.blender.org/rB40492251f2ff7b82468d8b922d95c2af4b98264c

Fix T70454: Environment Texture Node Properties "reload" and "packing" not 
working

The bug was basically just caused by a missing 'edit_image' and
'edit_image_user' pointer in context for
'node_shader_buts_tex_environment_ex'.
So adding the following there would be enough to fix the bug:
uiLayoutSetContextPointer(layout, "edit_image", );
uiLayoutSetContextPointer(layout, "edit_image_user", );

However, I would suggest using the full-flegged uiTemplateImage (just as
'node_shader_buts_tex_image_ex' does -- instead of a "handmade" subset)
for the following consistency reasons:
- Layout was using single column for image textures, but not environment
textures
- Save / Discard feature on editing the image was there for image
textures, but not environment textures
- Environment textures: Color Space was displayed on node (but not
properties)
- Environment textures: Animation / Sequence settings were displayed on
node (but not properties)

Cant think of a reason for _not_ displaying the whole set for
environment textures (just as for regular image textures)?

Maniphest Tasks: T70454

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

===

M   source/blender/editors/space_node/drawnode.c

===

diff --git a/source/blender/editors/space_node/drawnode.c 
b/source/blender/editors/space_node/drawnode.c
index f7c772ef145..c0eedfeea1d 100644
--- a/source/blender/editors/space_node/drawnode.c
+++ b/source/blender/editors/space_node/drawnode.c
@@ -816,51 +816,8 @@ static void node_shader_buts_tex_environment(uiLayout 
*layout, bContext *C, Poin
 
 static void node_shader_buts_tex_environment_ex(uiLayout *layout, bContext *C, 
PointerRNA *ptr)
 {
-  PointerRNA imaptr = RNA_pointer_get(ptr, "image");
   PointerRNA iuserptr = RNA_pointer_get(ptr, "image_user");
-  Image *ima = imaptr.data;
-
-  uiLayoutSetContextPointer(layout, "image_user", );
-  uiTemplateID(layout,
-   C,
-   ptr,
-   "image",
-   "IMAGE_OT_new",
-   "IMAGE_OT_open",
-   NULL,
-   UI_TEMPLATE_ID_FILTER_ALL,
-   false);
-
-  if (!ima) {
-return;
-  }
-
-  uiItemR(layout, , "source", 0, IFACE_("Source"), ICON_NONE);
-
-  if (!(ELEM(ima->source, IMA_SRC_GENERATED, IMA_SRC_VIEWER))) {
-uiLayout *row = uiLayoutRow(layout, true);
-const bool is_packed = BKE_image_has_packedfile(ima);
-
-if (is_packed) {
-  uiItemO(row, "", ICON_PACKAGE, "image.unpack");
-}
-else {
-  uiItemO(row, "", ICON_UGLYPACKAGE, "image.pack");
-}
-
-row = uiLayoutRow(row, true);
-uiLayoutSetEnabled(row, !is_packed);
-uiItemR(row, , "filepath", 0, "", ICON_NONE);
-uiItemO(row, "", ICON_FILE_REFRESH, "image.reload");
-  }
-
-  /* multilayer? */
-  if (ima->type == IMA_TYPE_MULTILAYER && ima->rr) {
-uiTemplateImageLayers(layout, C, ima, iuserptr.data);
-  }
-  else if (ima->source != IMA_SRC_GENERATED) {
-uiTemplateImageInfo(layout, C, ima, iuserptr.data);
-  }
+  uiTemplateImage(layout, C, ptr, "image", , 0, 0);
 
   uiItemR(layout, ptr, "interpolation", 0, IFACE_("Interpolation"), ICON_NONE);
   uiItemR(layout, ptr, "projection", 0, IFACE_("Projection"), ICON_NONE);

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


[Bf-blender-cvs] [d590db83705] master: Sculpt: Clay Strips brush tweaks

2019-10-04 Thread Pablo Dobarro
Commit: d590db83705b9bfbb663c9aa388f5bf6fff09116
Author: Pablo Dobarro
Date:   Thu Oct 3 23:46:29 2019 +0200
Branches: master
https://developer.blender.org/rBd590db83705b9bfbb663c9aa388f5bf6fff09116

Sculpt: Clay Strips brush tweaks

- Fix accumulate by allowing normal radius greater than one. Now it works as it 
should and it should be enabled by default
- Make the square test sharper. This gives a lot more definition to the brush, 
even when working with fewer polygons

Reviewed By: brecht

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

===

M   source/blender/blenkernel/intern/brush.c
M   source/blender/editors/sculpt_paint/sculpt.c
M   source/blender/makesrna/intern/rna_brush.c

===

diff --git a/source/blender/blenkernel/intern/brush.c 
b/source/blender/blenkernel/intern/brush.c
index f80d262ee47..39a12a997ef 100644
--- a/source/blender/blenkernel/intern/brush.c
+++ b/source/blender/blenkernel/intern/brush.c
@@ -909,6 +909,13 @@ void BKE_brush_sculpt_reset(Brush *br)
 case SCULPT_TOOL_CLAY:
   br->flag |= BRUSH_FRONTFACE;
   break;
+case SCULPT_TOOL_CLAY_STRIPS:
+  br->flag |= BRUSH_ACCUMULATE;
+  br->alpha = 0.7f;
+  br->normal_radius_factor = 1.7f;
+  br->curve_preset = BRUSH_CURVE_SPHERE;
+  br->spacing = 6;
+  break;
 case SCULPT_TOOL_CREASE:
   br->flag |= BRUSH_DIR_IN;
   br->alpha = 0.25;
diff --git a/source/blender/editors/sculpt_paint/sculpt.c 
b/source/blender/editors/sculpt_paint/sculpt.c
index 6e9f62b980c..64674ecd0a1 100644
--- a/source/blender/editors/sculpt_paint/sculpt.c
+++ b/source/blender/editors/sculpt_paint/sculpt.c
@@ -1098,9 +1098,8 @@ bool sculpt_brush_test_cube(SculptBrushTest *test, const 
float co[3], float loca
   local_co[1] = fabsf(local_co[1]);
   local_co[2] = fabsf(local_co[2]);
 
+  const float p = 8.0f;
   if (local_co[0] <= side && local_co[1] <= side && local_co[2] <= side) {
-float p = 4.0f;
-
 test->dist = ((powf(local_co[0], p) + powf(local_co[1], p) + 
powf(local_co[2], p)) /
   powf(side, p));
 
@@ -1740,11 +1739,13 @@ static float brush_strength(const Sculpt *sd,
 
   switch (brush->sculpt_tool) {
 case SCULPT_TOOL_CLAY:
-case SCULPT_TOOL_CLAY_STRIPS:
 case SCULPT_TOOL_DRAW:
 case SCULPT_TOOL_DRAW_SHARP:
 case SCULPT_TOOL_LAYER:
   return alpha * flip * pressure * overlap * feather;
+case SCULPT_TOOL_CLAY_STRIPS:
+  /* Clay Strips needs extra strength to compensate for its default normal 
radius */
+  return alpha * flip * pressure * overlap * feather * 1.3f;
 
 case SCULPT_TOOL_MASK:
   overlap = (1 + overlap) / 2;
diff --git a/source/blender/makesrna/intern/rna_brush.c 
b/source/blender/makesrna/intern/rna_brush.c
index d64970d03ab..2aaa9e7855e 100644
--- a/source/blender/makesrna/intern/rna_brush.c
+++ b/source/blender/makesrna/intern/rna_brush.c
@@ -1885,8 +1885,8 @@ static void rna_def_brush(BlenderRNA *brna)
 
   prop = RNA_def_property(srna, "normal_radius_factor", PROP_FLOAT, 
PROP_FACTOR);
   RNA_def_property_float_sdna(prop, NULL, "normal_radius_factor");
-  RNA_def_property_range(prop, 0.0f, 1.0f);
-  RNA_def_property_ui_range(prop, 0.0f, 1.0f, 0.001, 3);
+  RNA_def_property_range(prop, 0.0f, 2.0f);
+  RNA_def_property_ui_range(prop, 0.0f, 2.0f, 0.001, 3);
   RNA_def_property_ui_text(prop,
"Normal Radius",
"Ratio between the brush radius and the radius that 
is going to be "

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


[Bf-blender-cvs] [2b55a1da50d] master: Fix T70499: Can't change Brush Texture Rotation without holding the Shift key.

2019-10-04 Thread Pablo Dobarro
Commit: 2b55a1da50d213b34993a00b6b4459970e82a5aa
Author: Pablo Dobarro
Date:   Thu Oct 3 23:26:05 2019 +0200
Branches: master
https://developer.blender.org/rB2b55a1da50d213b34993a00b6b4459970e82a5aa

Fix T70499: Can't change Brush Texture Rotation without holding the Shift key.

Reviewed By: brecht

Maniphest Tasks: T70499

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

===

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

===

diff --git a/source/blender/windowmanager/intern/wm_operators.c 
b/source/blender/windowmanager/intern/wm_operators.c
index 69c535308e6..97771d40b2c 100644
--- a/source/blender/windowmanager/intern/wm_operators.c
+++ b/source/blender/windowmanager/intern/wm_operators.c
@@ -2641,14 +2641,18 @@ static int radial_control_modal(bContext *C, wmOperator 
*op, const wmEvent *even
   }
   else {
 delta[0] = rc->initial_mouse[0] - event->x;
-delta[1] = 0.0f;
-
+delta[1] = rc->initial_mouse[1] - event->y;
 if (rc->zoom_prop) {
   RNA_property_float_get_array(>zoom_ptr, rc->zoom_prop, zoom);
   delta[0] /= zoom[0];
+  delta[1] /= zoom[1];
+}
+if (rc->subtype == PROP_ANGLE) {
+  dist = len_v2(delta);
+}
+else {
+  dist = clamp_f(-delta[0], 0.0f, FLT_MAX);
 }
-
-dist = clamp_f(-delta[0], 0.0f, FLT_MAX);
   }
 
   /* calculate new value and apply snapping  */

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


[Bf-blender-cvs] [8afa93d82d7] master: Fix: Clamping in Map Range node works incorrectly.

2019-10-04 Thread OmarSquircleArt
Commit: 8afa93d82d7dd2519af667d85e1d87b19bf6f2c5
Author: OmarSquircleArt
Date:   Fri Oct 4 15:18:08 2019 +0200
Branches: master
https://developer.blender.org/rB8afa93d82d7dd2519af667d85e1d87b19bf6f2c5

Fix: Clamping in Map Range node works incorrectly.

The clamp option in the Map Range node doesn't work correctly when the
inputs are linked. The code didn't put that into considration.

Reviewers: brecht

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

===

M   intern/cycles/render/nodes.cpp

===

diff --git a/intern/cycles/render/nodes.cpp b/intern/cycles/render/nodes.cpp
index 71f1863ea49..b58e10a7b52 100644
--- a/intern/cycles/render/nodes.cpp
+++ b/intern/cycles/render/nodes.cpp
@@ -5567,11 +5567,21 @@ void MapRangeNode::expand(ShaderGraph *graph)
 ShaderOutput *result_out = output("Result");
 if (!result_out->links.empty()) {
   ClampNode *clamp_node = new ClampNode();
-  clamp_node->min = to_min;
-  clamp_node->max = to_max;
   graph->add(clamp_node);
   graph->relink(result_out, clamp_node->output("Result"));
   graph->connect(result_out, clamp_node->input("Value"));
+  if (input("To Min")->link) {
+graph->connect(input("To Min")->link, clamp_node->input("Min"));
+  }
+  else {
+clamp_node->min = to_min;
+  }
+  if (input("To Max")->link) {
+graph->connect(input("To Max")->link, clamp_node->input("Max"));
+  }
+  else {
+clamp_node->max = to_max;
+  }
 }
   }
 }

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


[Bf-blender-cvs] [f025b625f41] master: Fix T70095: Quadriflow crash running on a messy mesh

2019-10-04 Thread Sebastian Parborg
Commit: f025b625f410ceb8a1edda584fe89acb5fff39d7
Author: Sebastian Parborg
Date:   Fri Oct 4 14:25:34 2019 +0200
Branches: master
https://developer.blender.org/rBf025b625f410ceb8a1edda584fe89acb5fff39d7

Fix T70095: Quadriflow crash running on a messy mesh

Quadriflow does not support non manifold meshes. (Edges with > 3
connected faces and discontinuous face normal directions)

While it does sometimes "work" in these configurations, the results are
not good and in most cases it just flat out will crash.

Added a sanity check to make sure that the input mesh is manifold.

Reviewed By: Brecht

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

===

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

===

diff --git a/source/blender/editors/object/object_remesh.c 
b/source/blender/editors/object/object_remesh.c
index 01d3fa5d35a..86d41056634 100644
--- a/source/blender/editors/object/object_remesh.c
+++ b/source/blender/editors/object/object_remesh.c
@@ -210,6 +210,62 @@ typedef struct QuadriFlowJob {
   int success;
 } QuadriFlowJob;
 
+static bool mesh_is_manifold_consistent(Mesh *mesh)
+{
+  /* In this check we count boundary edges as manifold. Additionally, we also
+   * check that the direction of the faces are consistent and doesn't suddenly
+   * flip
+   */
+
+  bool is_manifold_consistent = true;
+  const MLoop *mloop = mesh->mloop;
+  const MPoly *mpoly = mesh->mpoly;
+  char *edge_faces = (char *)MEM_callocN(mesh->totedge * sizeof(char), 
"remesh_manifold_check");
+  int *edge_vert = (int *)MEM_malloc_arrayN(
+  mesh->totedge, sizeof(unsigned int), "remesh_consistent_check");
+
+  for (unsigned int i = 0; i < mesh->totedge; i++) {
+edge_vert[i] = -1;
+  }
+
+  for (unsigned int poly_index = 0; poly_index < mesh->totpoly && 
is_manifold_consistent;
+   poly_index++) {
+const MPoly *poly = [poly_index];
+for (unsigned int corner = 0; corner < poly->totloop; corner++) {
+  const MLoop *loop = [poly->loopstart + corner];
+  edge_faces[loop->e] += 1;
+  if (edge_faces[loop->e] > 2) {
+is_manifold_consistent = false;
+break;
+  }
+
+  if (edge_vert[loop->e] == -1) {
+edge_vert[loop->e] = loop->v;
+  }
+  else if (edge_vert[loop->e] == loop->v) {
+/* Mesh has flips in the surface so it is non consistent */
+is_manifold_consistent = false;
+break;
+  }
+}
+  }
+
+  if (is_manifold_consistent) {
+/* check for wire edges */
+for (unsigned int i = 0; i < mesh->totedge; i++) {
+  if (edge_faces[i] == 0) {
+is_manifold_consistent = false;
+break;
+  }
+}
+  }
+
+  MEM_freeN(edge_faces);
+  MEM_freeN(edge_vert);
+
+  return is_manifold_consistent;
+}
+
 static void quadriflow_free_job(void *customdata)
 {
   QuadriFlowJob *qj = customdata;
@@ -326,6 +382,12 @@ static void quadriflow_start_job(void *customdata, short 
*stop, short *do_update
   Mesh *new_mesh;
   Mesh *bisect_mesh;
 
+  /* Check if the mesh is manifold. Quadriflow requires manifold meshes */
+  if (!mesh_is_manifold_consistent(mesh)) {
+qj->success = -2;
+return;
+  }
+
   /* Run Quadriflow bisect operations on a copy of the mesh to keep the code 
readable without
* freeing the original ID */
   bisect_mesh = BKE_mesh_copy(qj->bmain, mesh);
@@ -396,17 +458,22 @@ static void quadriflow_end_job(void *customdata)
 
   WM_set_locked_interface(G_MAIN->wm.first, false);
 
-  if (qj->success > 0) {
-DEG_id_tag_update(>id, ID_RECALC_GEOMETRY);
-WM_reportf(RPT_INFO, "QuadriFlow: Completed remeshing!");
-  }
-  else {
-if (qj->success == 0) {
+  switch (qj->success) {
+case 1:
+  DEG_id_tag_update(>id, ID_RECALC_GEOMETRY);
+  WM_reportf(RPT_INFO, "QuadriFlow: Completed remeshing!");
+  break;
+case 0:
   WM_reportf(RPT_ERROR, "QuadriFlow: remeshing failed!");
-}
-else {
+  break;
+case -1:
   WM_report(RPT_WARNING, "QuadriFlow: remeshing canceled!");
-}
+  break;
+case -2:
+  WM_report(RPT_WARNING,
+"QuadriFlow: The mesh needs to be manifold and have face 
normals that point in a "
+"consistent direction.");
+  break;
   }
 }

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


[Bf-blender-cvs] [19b0f690095] master: Fix T70481: Segfault printing 'private data' evaluated IDs.

2019-10-04 Thread Bastien Montagne
Commit: 19b0f69009501df8b153d33ffcf6977019d53291
Author: Bastien Montagne
Date:   Fri Oct 4 12:24:26 2019 +0200
Branches: master
https://developer.blender.org/rB19b0f69009501df8b153d33ffcf6977019d53291

Fix T70481: Segfault printing 'private data' evaluated IDs.

This commit solves the bug itself (code was broken when real_id owner of
the private data ID could not be found), and generates a more sensible
representation for all evaluated IDs, makes no sense to display them as
being part of `bpy.data`!

===

M   source/blender/python/intern/bpy_rna.c

===

diff --git a/source/blender/python/intern/bpy_rna.c 
b/source/blender/python/intern/bpy_rna.c
index 45a7d2dacd1..d13393280d0 100644
--- a/source/blender/python/intern/bpy_rna.c
+++ b/source/blender/python/intern/bpy_rna.c
@@ -70,6 +70,8 @@
 /* Only for types. */
 #include "BKE_node.h"
 
+#include "DEG_depsgraph_query.h"
+
 #include "../generic/idprop_py_api.h" /* For IDprop lookups. */
 #include "../generic/py_capi_utils.h"
 #include "../generic/python_utildefines.h"
@@ -918,7 +920,10 @@ static PyObject *pyrna_struct_repr(BPy_StructRNA *self)
 
   tmp_str = PyUnicode_FromString(id->name + 2);
 
-  if (RNA_struct_is_ID(self->ptr.type) && (id->flag & LIB_PRIVATE_DATA) == 0) {
+  if (DEG_get_original_id(id) != id) {
+ret = PyUnicode_FromFormat("Evaluated %s %R", 
BKE_idcode_to_name(GS(id->name)), tmp_str);
+  }
+  else if (RNA_struct_is_ID(self->ptr.type) && (id->flag & LIB_PRIVATE_DATA) 
== 0) {
 ret = PyUnicode_FromFormat(
 "bpy.data.%s[%R]", BKE_idcode_to_name_plural(GS(id->name)), tmp_str);
   }
@@ -926,14 +931,25 @@ static PyObject *pyrna_struct_repr(BPy_StructRNA *self)
 const char *path;
 ID *real_id = NULL;
 path = RNA_path_from_real_ID_to_struct(G_MAIN, >ptr, _id);
-if (path) {
-  if (real_id != id) {
+if (path != NULL) {
+  /* real_id may be NULL in some cases, although the only valid one is 
evaluated data,
+   * which should have been catched already above.
+   * So assert, but handle it without crashing for release builds. */
+  BLI_assert(real_id != NULL);
+
+  if (real_id != NULL) {
 Py_DECREF(tmp_str);
 tmp_str = PyUnicode_FromString(real_id->name + 2);
+ret = PyUnicode_FromFormat(
+"bpy.data.%s[%R].%s", 
BKE_idcode_to_name_plural(GS(real_id->name)), tmp_str, path);
+  }
+  else {
+/* Can't find the path, print something useful as a fallback. */
+ret = PyUnicode_FromFormat("bpy.data.%s[%R]...%s",
+   BKE_idcode_to_name_plural(GS(id->name)),
+   tmp_str,
+   RNA_struct_identifier(self->ptr.type));
   }
-  ret = PyUnicode_FromFormat(
-  "bpy.data.%s[%R].%s", BKE_idcode_to_name_plural(GS(real_id->name)), 
tmp_str, path);
-
   MEM_freeN((void *)path);
 }
 else {

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


[Bf-blender-cvs] [837653d7352] master: LibOverride: Fix bad handling of 'store' callback in IDProps case.

2019-10-04 Thread Bastien Montagne
Commit: 837653d735249a65ccdd7467625041493a14cc8a
Author: Bastien Montagne
Date:   Thu Oct 3 20:09:33 2019 +0200
Branches: master
https://developer.blender.org/rB837653d735249a65ccdd7467625041493a14cc8a

LibOverride: Fix bad handling of 'store' callback in IDProps case.

We need same kind of default handling for IDProps as we already have for
the diff callback.

===

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

===

diff --git a/source/blender/makesrna/intern/rna_access_compare_override.c 
b/source/blender/makesrna/intern/rna_access_compare_override.c
index b061c72157e..df1554ac7bc 100644
--- a/source/blender/makesrna/intern/rna_access_compare_override.c
+++ b/source/blender/makesrna/intern/rna_access_compare_override.c
@@ -400,9 +400,39 @@ static bool rna_property_override_operation_store(Main 
*bmain,
 return changed;
   }
 
-  BLI_assert(prop_local->override_store == prop_reference->override_store &&
- (!ptr_storage || prop_local->override_store == 
prop_storage->override_store) &&
- prop_local->override_store != NULL);
+  RNAPropOverrideStore override_store = NULL;
+  /* Special case for IDProps, we use default callback then. */
+  if (prop_local->magic != RNA_MAGIC) {
+override_store = rna_property_override_store_default;
+if (prop_reference->magic == RNA_MAGIC && prop_reference->override_store 
!= override_store) {
+  override_store = NULL;
+}
+  }
+  else if (prop_reference->magic != RNA_MAGIC) {
+override_store = rna_property_override_store_default;
+if (prop_local->override_store != override_store) {
+  override_store = NULL;
+}
+  }
+  else if (prop_local->override_store == prop_reference->override_store) {
+override_store = prop_local->override_store;
+  }
+
+  if (ptr_storage != NULL && prop_storage->magic == RNA_MAGIC &&
+  prop_storage->override_store != override_store) {
+override_store = NULL;
+  }
+
+  if (override_store == NULL) {
+#ifndef NDEBUG
+printf("'%s' gives unmatching or NULL RNA store callbacks, should not 
happen (%d vs. %d).\n",
+   op->rna_path,
+   prop_local->magic == RNA_MAGIC,
+   prop_reference->magic == RNA_MAGIC);
+#endif
+BLI_assert(0);
+return changed;
+  }
 
   for (IDOverrideLibraryPropertyOperation *opop = op->operations.first; opop; 
opop = opop->next) {
 /* Only needed for diff operations. */
@@ -413,17 +443,17 @@ static bool rna_property_override_operation_store(Main 
*bmain,
   continue;
 }
 
-if (prop_local->override_store(bmain,
-   ptr_local,
-   ptr_reference,
-   ptr_storage,
-   prop_local,
-   prop_reference,
-   prop_storage,
-   len_local,
-   len_reference,
-   len_storage,
-   opop)) {
+if (override_store(bmain,
+   ptr_local,
+   ptr_reference,
+   ptr_storage,
+   prop_local,
+   prop_reference,
+   prop_storage,
+   len_local,
+   len_reference,
+   len_storage,
+   opop)) {
   changed = true;
 }
   }

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


[Bf-blender-cvs] [ba10cd49220] master: LibOverride: Fix last main issue with overriding custom properties.

2019-10-04 Thread Bastien Montagne
Commit: ba10cd49220a778014fa2e77eff45c32ca106fbe
Author: Bastien Montagne
Date:   Thu Oct 3 20:29:38 2019 +0200
Branches: master
https://developer.blender.org/rBba10cd49220a778014fa2e77eff45c32ca106fbe

LibOverride: Fix last main issue with overriding custom properties.

Now, custom props defined as overriddable can be overridden, saved,
reloaded, etc. That fixes the last main issue with them.

Note that custom props still have a lot of glitches and weirdness in
their overriding behavior, but for now the most important is finally
achieved, will let them rest and settle a bit, those have been
incredibly painful to tame... :(

===

M   source/blender/makesrna/intern/rna_access.c
M   source/blender/makesrna/intern/rna_access_compare_override.c
M   source/blender/makesrna/intern/rna_access_internal.h

===

diff --git a/source/blender/makesrna/intern/rna_access.c 
b/source/blender/makesrna/intern/rna_access.c
index 71a3be24810..aeb6d528cdb 100644
--- a/source/blender/makesrna/intern/rna_access.c
+++ b/source/blender/makesrna/intern/rna_access.c
@@ -393,7 +393,7 @@ bool RNA_struct_idprops_check(StructRNA *srna)
   return (srna && srna->idproperties);
 }
 
-static IDProperty *rna_idproperty_find(PointerRNA *ptr, const char *name)
+IDProperty *rna_idproperty_find(PointerRNA *ptr, const char *name)
 {
   IDProperty *group = RNA_struct_idprops(ptr, 0);
 
diff --git a/source/blender/makesrna/intern/rna_access_compare_override.c 
b/source/blender/makesrna/intern/rna_access_compare_override.c
index df1554ac7bc..18fbe7886e9 100644
--- a/source/blender/makesrna/intern/rna_access_compare_override.c
+++ b/source/blender/makesrna/intern/rna_access_compare_override.c
@@ -625,6 +625,21 @@ bool RNA_struct_override_matches(Main *bmain,
 prop_local = rna_ensure_property_realdata(_local, ptr_local);
 prop_reference = rna_ensure_property_realdata(_reference, 
ptr_reference);
 
+/* IDProps (custom properties) are even more of a PITA here, we cannot use
+ * `rna_ensure_property_realdata()` to deal with them, we have to use the 
path generated from
+ * `prop_local` (which is valid) to access to the actual reference 
counterpart... */
+if (prop_local != NULL && prop_local->magic != RNA_MAGIC && prop_local == 
prop_reference) {
+  /* We could also use (lower in this code, after rna_path has been 
computed):
+   *RNA_path_resolve_property(ptr_reference, rna_path, _rna_ptr, 
_reference);
+   * But that would be much more costly, and would also fail when 
ptr_reference
+   * is not an ID pointer itself, so we'd need to rebuild it from its 
owner_id, then check that
+   * generated some_rna_ptr and ptr_reference do point to the same data, 
etc.
+   * For now, let's try that simple access, it won't cover all cases but 
should handle fine
+   * most basic custom properties situations. */
+  prop_reference = (PropertyRNA *)rna_idproperty_find(ptr_reference,
+  ((IDProperty 
*)prop_local)->name);
+}
+
 if (ELEM(NULL, prop_local, prop_reference)) {
   continue;
 }
diff --git a/source/blender/makesrna/intern/rna_access_internal.h 
b/source/blender/makesrna/intern/rna_access_internal.h
index 28ec504e376..c7995746d08 100644
--- a/source/blender/makesrna/intern/rna_access_internal.h
+++ b/source/blender/makesrna/intern/rna_access_internal.h
@@ -30,5 +30,6 @@ struct IDProperty;
 PropertyRNA *rna_ensure_property(PropertyRNA *prop);
 
 void rna_idproperty_touch(struct IDProperty *idprop);
+struct IDProperty *rna_idproperty_find(PointerRNA *ptr, const char *name);
 
 #endif /* __ACCESS_RNA_INTERNAL_H__ */

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


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

2019-10-04 Thread Antonio Vazquez
Commit: fc019244c8700e7d880c7cf9a0434dbe2d560897
Author: Antonio Vazquez
Date:   Fri Oct 4 10:22:03 2019 +0200
Branches: greasepencil-object
https://developer.blender.org/rBfc019244c8700e7d880c7cf9a0434dbe2d560897

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] [03bf290eae9] master: GPencil: Reduce VBO memory footprint when using modifiers

2019-10-04 Thread Antonio Vazquez
Commit: 03bf290eae99a0026b39b6e8351bd0d0eed3bc7e
Author: Antonio Vazquez
Date:   Fri Oct 4 10:14:49 2019 +0200
Branches: master
https://developer.blender.org/rB03bf290eae99a0026b39b6e8351bd0d0eed3bc7e

GPencil: Reduce VBO memory footprint when using modifiers

Before, the modifiers were evaluated in Draw Engine and this required to 
calculate a factor to increase the VBO size.

Now, the modifiers are evaluated in Depsgraph and the Draw Engine receives the 
evaluated stroke with the final number of vertices. As the number of vertices 
is the final value already, if Draw Manager increases the number with the 
modifiers only increases the memory with empty space because never would be 
used. This commit removes this double calculation, reducing the memory usage 
and removes a loop to calculate the size by modifier too.

Also, the function getDuplicationFactor() has been removed because is not 
required anymore.

===

M   source/blender/blenkernel/BKE_gpencil_modifier.h
M   source/blender/draw/engines/gpencil/gpencil_draw_utils.c
M   source/blender/gpencil_modifiers/intern/MOD_gpencilarmature.c
M   source/blender/gpencil_modifiers/intern/MOD_gpencilarray.c
M   source/blender/gpencil_modifiers/intern/MOD_gpencilbuild.c
M   source/blender/gpencil_modifiers/intern/MOD_gpencilcolor.c
M   source/blender/gpencil_modifiers/intern/MOD_gpencilhook.c
M   source/blender/gpencil_modifiers/intern/MOD_gpencillattice.c
M   source/blender/gpencil_modifiers/intern/MOD_gpencilmirror.c
M   source/blender/gpencil_modifiers/intern/MOD_gpencilnoise.c
M   source/blender/gpencil_modifiers/intern/MOD_gpenciloffset.c
M   source/blender/gpencil_modifiers/intern/MOD_gpencilopacity.c
M   source/blender/gpencil_modifiers/intern/MOD_gpencilsimplify.c
M   source/blender/gpencil_modifiers/intern/MOD_gpencilsmooth.c
M   source/blender/gpencil_modifiers/intern/MOD_gpencilsubdiv.c
M   source/blender/gpencil_modifiers/intern/MOD_gpencilthick.c
M   source/blender/gpencil_modifiers/intern/MOD_gpenciltime.c
M   source/blender/gpencil_modifiers/intern/MOD_gpenciltint.c

===

diff --git a/source/blender/blenkernel/BKE_gpencil_modifier.h 
b/source/blender/blenkernel/BKE_gpencil_modifier.h
index 918f85d146c..9cbc7d05ac2 100644
--- a/source/blender/blenkernel/BKE_gpencil_modifier.h
+++ b/source/blender/blenkernel/BKE_gpencil_modifier.h
@@ -261,12 +261,6 @@ typedef struct GpencilModifierTypeInfo {
  struct Object *ob,
  GreasePencilTexWalkFunc walk,
  void *userData);
-
-  /**
-   * Get the number of times the strokes are duplicated in this modifier.
-   * This is used to calculate the size of the GPU VBOs
-   */
-  int (*getDuplicationFactor)(struct GpencilModifierData *md);
 } GpencilModifierTypeInfo;
 
 /* Initialize modifier's global data (type info and some common global 
storages). */
diff --git a/source/blender/draw/engines/gpencil/gpencil_draw_utils.c 
b/source/blender/draw/engines/gpencil/gpencil_draw_utils.c
index ce5d8cbf732..a13896a2b08 100644
--- a/source/blender/draw/engines/gpencil/gpencil_draw_utils.c
+++ b/source/blender/draw/engines/gpencil/gpencil_draw_utils.c
@@ -37,7 +37,6 @@
 #include "DNA_gpencil_types.h"
 #include "DNA_material_types.h"
 #include "DNA_view3d_types.h"
-#include "DNA_gpencil_modifier_types.h"
 
 /* If builtin shaders are needed */
 #include "GPU_shader.h"
@@ -225,23 +224,6 @@ static void gpencil_calc_vertex(GPENCIL_StorageList *stl,
   cache->b_point.tot_vertex = cache_ob->tot_vertex;
   cache->b_edit.tot_vertex = cache_ob->tot_vertex;
   cache->b_edlin.tot_vertex = cache_ob->tot_vertex;
-
-  /* some modifiers can change the number of points */
-  int factor = 0;
-  GpencilModifierData *md;
-  for (md = ob->greasepencil_modifiers.first; md; md = md->next) {
-const GpencilModifierTypeInfo *mti = 
BKE_gpencil_modifierType_getInfo(md->type);
-/* only modifiers that change size */
-if (mti && mti->getDuplicationFactor) {
-  factor = mti->getDuplicationFactor(md);
-
-  cache->b_fill.tot_vertex *= factor;
-  cache->b_stroke.tot_vertex *= factor;
-  cache->b_point.tot_vertex *= factor;
-  cache->b_edit.tot_vertex *= factor;
-  cache->b_edlin.tot_vertex *= factor;
-}
-  }
 }
 
 /* Helper for doing all the checks on whether a stroke can be drawn */
diff --git a/source/blender/gpencil_modifiers/intern/MOD_gpencilarmature.c 
b/source/blender/gpencil_modifiers/intern/MOD_gpencilarmature.c
index 1f2f0554dd5..27c8175af3f 100644
--- a/source/blender/gpencil_modifiers/intern/MOD_gpencilarmature.c
+++ b/source/blender/gpencil_modifiers/intern/MOD_gpencilarmature.c
@@ -203,5 +203,4 @@ GpencilModifierTypeInfo modifierType_Gpencil_Armature = {
 /* foreachObjectLink */ foreachObjectLink,
 /* foreachIDLink */ NULL,
 /* 

[Bf-blender-cvs] [9d602cb3e96] soc-2019-embree-gpu: Add motion blur for unaligned box

2019-10-04 Thread MATILLAT Quentin
Commit: 9d602cb3e96cf2d265789809b33f0cbf53f674d0
Author: MATILLAT Quentin
Date:   Thu Oct 3 21:00:51 2019 +0200
Branches: soc-2019-embree-gpu
https://developer.blender.org/rB9d602cb3e96cf2d265789809b33f0cbf53f674d0

Add motion blur for unaligned box

===

M   build_files/build_environment/patches/embree.diff
M   intern/cycles/bvh/bvh_embree.cpp
M   intern/cycles/bvh/bvh_embree_converter.cpp
M   intern/cycles/bvh/bvh_embree_converter.h
M   intern/cycles/kernel/bvh/bvh_nodes.h

===

diff --git a/build_files/build_environment/patches/embree.diff 
b/build_files/build_environment/patches/embree.diff
index d5e69a7e925..5065942227b 100644
--- a/build_files/build_environment/patches/embree.diff
+++ b/build_files/build_environment/patches/embree.diff
@@ -1,20 +1,8 @@
-From cb61d8802827da68b3627af66bc4421573668985 Mon Sep 17 00:00:00 2001
-From: MATILLAT Quentin 
-Date: Sun, 18 Aug 2019 15:29:34 +0200
-Subject: [PATCH] Add ability to export curve from BVH
-

- include/embree3/rtcore_builder.h  |  22 +++
- include/embree3/rtcore_common.h   |   7 +
- kernels/bvh/bvh_builder_hair.cpp  |   3 +-
- kernels/common/rtcore_builder.cpp | 298 ++
- 4 files changed, 252 insertions(+), 78 deletions(-)
-
 diff --git a/include/embree3/rtcore_builder.h 
b/include/embree3/rtcore_builder.h
-index af84035b0..77e754f7e 100644
+index af84035b0..3f2c4eddf 100644
 --- a/include/embree3/rtcore_builder.h
 +++ b/include/embree3/rtcore_builder.h
-@@ -131,6 +131,28 @@ RTC_API void rtcRetainBVH(RTCBVH bvh);
+@@ -131,6 +131,35 @@ RTC_API void rtcRetainBVH(RTCBVH bvh);
  /* Releases the BVH (decrements reference count). */
  RTC_API void rtcReleaseBVH(RTCBVH bvh);
  
@@ -25,6 +13,12 @@ index af84035b0..77e754f7e 100644
 +
 +struct RTCBVHExtractFunction
 +{
++  /**
++   * Allow to preallocate buffer, is called before everything else
++   * Can be NULL if not used
++   */
++  void (*expectedSize) (unsigned int num_leaf, unsigned int num_tri, void 
*userData);
++
 +  // Leaf creator function
 +  void* (*createLeaf) (unsigned int nbPrim, const BVHPrimitive prims[], void 
*userData);
 +  void* (*createInstance) (unsigned int nbPrim, const unsigned int geomID[], 
void *userData);
@@ -36,6 +30,7 @@ index af84035b0..77e754f7e 100644
 +  void (*setAlignedBounds) (void *node, const RTCBounds , void 
*userData);
 +  void (*setLinearBounds) (void *node, const RTCLinearBounds , void 
*userData);
 +  void (*setUnalignedBounds) (void *node, const RTCAffineSpace , 
void *userData);
++  void (*setUnalignedLinearBounds) (void *node, const RTCAffineSpace 
, const RTCBounds , void *userData);
 +};
 +
 +RTC_API void *rtcExtractBVH(RTCScene hscene, RTCBVHExtractFunction args, void 
*userData);
@@ -77,10 +72,10 @@ index 14273787f..cad238123 100644
  }
  #endif
 diff --git a/kernels/common/rtcore_builder.cpp 
b/kernels/common/rtcore_builder.cpp
-index 56858294c..7c26c4193 100644
+index 56858294c..057565b2a 100644
 --- a/kernels/common/rtcore_builder.cpp
 +++ b/kernels/common/rtcore_builder.cpp
-@@ -29,8 +29,17 @@
+@@ -29,8 +29,18 @@
  #include "../builders/bvh_builder_sah.h"
  #include "../builders/bvh_builder_morton.h"
  
@@ -89,6 +84,7 @@ index 56858294c..7c26c4193 100644
 +#include "../geometry/trianglev.h"
 +#include "../geometry/trianglei.h"
 +#include "../geometry/curveNi.h"
++#include "../geometry/curveNi_mb.h"
 +#include "../geometry/linei.h"
 +
  namespace embree
@@ -98,7 +94,7 @@ index 56858294c..7c26c4193 100644
namespace isa // FIXME: support more ISAs for builders
{
  struct BVH : public RefCount
-@@ -334,92 +343,227 @@ namespace embree
+@@ -334,92 +344,349 @@ namespace embree
return root;
  }
  
@@ -131,6 +127,9 @@ index 56858294c..7c26c4193 100644
 -  return rtcBuildBVHBinnedSAH(arguments);
 -else
 -  return rtcBuildBVHSpatialSAH(arguments);
+-  }
+-  else
+-throw_RTCError(RTC_ERROR_INVALID_OPERATION,"invalid build quality");
 +void* createLeaf(const BVH4::NodeRef node,
 + const PrimitiveType *leafType,
 + const RTCBVHExtractFunction args,
@@ -217,27 +216,131 @@ index 56858294c..7c26c4193 100644
 +}
 +
 +return args.createCurve(realNum, primsArray, userData);
++} else if(leafType == ::type) {
++typedef unsigned char Primitive;
++
++Primitive* prim = (Primitive*)node.leaf(nb);
++if(nb == 0) return nullptr;
++
++assert(nb == 1);
++Geometry::GType ty = (Geometry::GType)(*prim);
++
++BVHPrimitive primsArray[8];
++unsigned int realNum = 0;
++
++switch(ty) {
++case Geometry::GTY_FLAT_LINEAR_CURVE: {
++// Access to PrimID from right ISA, otherwise lead to 
allignement issue
++DEFINE_ISA_FUNCTION(unsigned int,