[Bf-blender-cvs] [fa5164a8b2e] blender-v3.4-release: Sculpt: Fix T101914: Wpaint gradient tool doesn't work with vertex mask

2022-12-14 Thread Edward
Commit: fa5164a8b2e4b1285597ad5c1d3a4bdad0d4bf01
Author: Edward
Date:   Thu Nov 10 11:02:15 2022 -0800
Branches: blender-v3.4-release
https://developer.blender.org/rBfa5164a8b2e4b1285597ad5c1d3a4bdad0d4bf01

Sculpt: Fix T101914: Wpaint gradient tool doesn't work with vertex mask

Reviewed by: Julian Kaspar & Joseph Eagar
Differential Revision: https://developer.blender.org/D16293
Ref D16293

===

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

===

diff --git a/source/blender/editors/sculpt_paint/paint_vertex_weight_ops.c 
b/source/blender/editors/sculpt_paint/paint_vertex_weight_ops.c
index fca25ee2e4b..816e779cd06 100644
--- a/source/blender/editors/sculpt_paint/paint_vertex_weight_ops.c
+++ b/source/blender/editors/sculpt_paint/paint_vertex_weight_ops.c
@@ -587,6 +587,7 @@ typedef struct WPGradient_userData {
   Scene *scene;
   Mesh *me;
   MDeformVert *dvert;
+  const bool *select_vert;
   Brush *brush;
   const float *sco_start; /* [2] */
   const float *sco_end;   /* [2] */
@@ -683,7 +684,7 @@ static void gradientVertInit__mapFunc(void *userData,
   WPGradient_userData *grad_data = userData;
   WPGradient_vertStore *vs = _data->vert_cache->elem[index];
 
-  if (grad_data->use_select && !(grad_data->dvert[index].flag & SELECT)) {
+  if (grad_data->use_select && (grad_data->select_vert && 
!grad_data->select_vert[index])) {
 copy_v2_fl(vs->sco, FLT_MAX);
 return;
   }
@@ -811,6 +812,8 @@ static int paint_weight_gradient_exec(bContext *C, 
wmOperator *op)
   data.scene = scene;
   data.me = ob->data;
   data.dvert = dverts;
+  data.select_vert = (const bool *)CustomData_get_layer_named(
+  >vdata, CD_PROP_BOOL, ".select_vert");
   data.sco_start = sco_start;
   data.sco_end = sco_end;
   data.sco_line_div = 1.0f / len_v2v2(sco_start, sco_end);

___
Bf-blender-cvs mailing list
Bf-blender-cvs@blender.org
List details, subscription details or unsubscribe:
https://lists.blender.org/mailman/listinfo/bf-blender-cvs


[Bf-blender-cvs] [59618c76469] master: Sculpt: Fix T101914: Wpaint gradient tool doesn't work with vertex mask

2022-11-10 Thread Edward
Commit: 59618c764699e81d0a3615d755cd02b1f556bac3
Author: Edward
Date:   Thu Nov 10 11:02:15 2022 -0800
Branches: master
https://developer.blender.org/rB59618c764699e81d0a3615d755cd02b1f556bac3

Sculpt: Fix T101914: Wpaint gradient tool doesn't work with vertex mask

Reviewed by: Julian Kaspar & Joseph Eagar
Differential Revision: https://developer.blender.org/D16293
Ref D16293

===

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

===

diff --git a/source/blender/editors/sculpt_paint/paint_vertex_weight_ops.c 
b/source/blender/editors/sculpt_paint/paint_vertex_weight_ops.c
index fca25ee2e4b..816e779cd06 100644
--- a/source/blender/editors/sculpt_paint/paint_vertex_weight_ops.c
+++ b/source/blender/editors/sculpt_paint/paint_vertex_weight_ops.c
@@ -587,6 +587,7 @@ typedef struct WPGradient_userData {
   Scene *scene;
   Mesh *me;
   MDeformVert *dvert;
+  const bool *select_vert;
   Brush *brush;
   const float *sco_start; /* [2] */
   const float *sco_end;   /* [2] */
@@ -683,7 +684,7 @@ static void gradientVertInit__mapFunc(void *userData,
   WPGradient_userData *grad_data = userData;
   WPGradient_vertStore *vs = _data->vert_cache->elem[index];
 
-  if (grad_data->use_select && !(grad_data->dvert[index].flag & SELECT)) {
+  if (grad_data->use_select && (grad_data->select_vert && 
!grad_data->select_vert[index])) {
 copy_v2_fl(vs->sco, FLT_MAX);
 return;
   }
@@ -811,6 +812,8 @@ static int paint_weight_gradient_exec(bContext *C, 
wmOperator *op)
   data.scene = scene;
   data.me = ob->data;
   data.dvert = dverts;
+  data.select_vert = (const bool *)CustomData_get_layer_named(
+  >vdata, CD_PROP_BOOL, ".select_vert");
   data.sco_start = sco_start;
   data.sco_end = sco_end;
   data.sco_line_div = 1.0f / len_v2v2(sco_start, sco_end);

___
Bf-blender-cvs mailing list
Bf-blender-cvs@blender.org
List details, subscription details or unsubscribe:
https://lists.blender.org/mailman/listinfo/bf-blender-cvs


[Bf-blender-cvs] [1d71f82033f] master: Texture Paint: sync adding a new texture slot to the Image Editor

2022-11-08 Thread Edward
Commit: 1d71f82033f1ec3ad51195cfa64c59fcf0cd6ccc
Author: Edward
Date:   Tue Nov 8 14:28:44 2022 +0100
Branches: master
https://developer.blender.org/rB1d71f82033f1ec3ad51195cfa64c59fcf0cd6ccc

Texture Paint: sync adding a new texture slot to the Image Editor

When changing the texture paint slot index or activating a Texture Node, the 
texture displayed in the Image Editor changes accordingly.
This patch syncs the Image Editor when a new texture paint slot was added, 
which currently is not the case.

Also deduplicates some code.

===

M   source/blender/editors/include/ED_image.h
M   source/blender/editors/sculpt_paint/paint_image.cc
M   source/blender/editors/sculpt_paint/paint_image_proj.c
M   source/blender/editors/space_image/image_edit.c
M   source/blender/editors/space_node/node_edit.cc
M   source/blender/makesrna/intern/rna_material.c
M   source/blender/makesrna/intern/rna_sculpt_paint.c

===

diff --git a/source/blender/editors/include/ED_image.h 
b/source/blender/editors/include/ED_image.h
index da303f3552b..20e62ac8626 100644
--- a/source/blender/editors/include/ED_image.h
+++ b/source/blender/editors/include/ED_image.h
@@ -51,6 +51,7 @@ void ED_space_image_set(struct Main *bmain,
 struct SpaceImage *sima,
 struct Image *ima,
 bool automatic);
+void ED_space_image_sync(struct Main *bmain, Image *image, bool 
ignore_render_viewer);
 void ED_space_image_auto_set(const struct bContext *C, struct SpaceImage 
*sima);
 struct Mask *ED_space_image_get_mask(const struct SpaceImage *sima);
 void ED_space_image_set_mask(struct bContext *C, struct SpaceImage *sima, 
struct Mask *mask);
diff --git a/source/blender/editors/sculpt_paint/paint_image.cc 
b/source/blender/editors/sculpt_paint/paint_image.cc
index 8c6358520ca..f334b2eb8f8 100644
--- a/source/blender/editors/sculpt_paint/paint_image.cc
+++ b/source/blender/editors/sculpt_paint/paint_image.cc
@@ -780,20 +780,7 @@ void ED_object_texture_paint_mode_enter_ex(Main *bmain, 
Scene *scene, Object *ob
   }
 
   if (ima) {
-wmWindowManager *wm = static_cast(bmain->wm.first);
-LISTBASE_FOREACH (wmWindow *, win, >windows) {
-  const bScreen *screen = WM_window_get_active_screen(win);
-  LISTBASE_FOREACH (ScrArea *, area, >areabase) {
-SpaceLink *sl = static_cast(area->spacedata.first);
-if (sl->spacetype == SPACE_IMAGE) {
-  SpaceImage *sima = (SpaceImage *)sl;
-
-  if (!sima->pin) {
-ED_space_image_set(bmain, sima, ima, true);
-  }
-}
-  }
-}
+ED_space_image_sync(bmain, ima, false);
   }
 
   ob->mode |= OB_MODE_TEXTURE_PAINT;
diff --git a/source/blender/editors/sculpt_paint/paint_image_proj.c 
b/source/blender/editors/sculpt_paint/paint_image_proj.c
index ea33449f0dd..c85044bf915 100644
--- a/source/blender/editors/sculpt_paint/paint_image_proj.c
+++ b/source/blender/editors/sculpt_paint/paint_image_proj.c
@@ -74,6 +74,7 @@
 #include "DEG_depsgraph.h"
 #include "DEG_depsgraph_query.h"
 
+#include "ED_image.h"
 #include "ED_node.h"
 #include "ED_object.h"
 #include "ED_paint.h"
@@ -6704,6 +6705,7 @@ static bool proj_paint_add_slot(bContext *C, wmOperator 
*op)
   BKE_texpaint_slot_refresh_cache(scene, ma, ob);
   BKE_image_signal(bmain, ima, NULL, IMA_SIGNAL_USER_NEW_IMAGE);
   WM_event_add_notifier(C, NC_IMAGE | NA_ADDED, ima);
+  ED_space_image_sync(bmain, ima, false);
 }
 if (layer) {
   BKE_texpaint_slot_refresh_cache(scene, ma, ob);
diff --git a/source/blender/editors/space_image/image_edit.c 
b/source/blender/editors/space_image/image_edit.c
index 0122e509c3b..68b1a9e4466 100644
--- a/source/blender/editors/space_image/image_edit.c
+++ b/source/blender/editors/space_image/image_edit.c
@@ -67,6 +67,30 @@ void ED_space_image_set(Main *bmain, SpaceImage *sima, Image 
*ima, bool automati
   WM_main_add_notifier(NC_SPACE | ND_SPACE_IMAGE, NULL);
 }
 
+void ED_space_image_sync(struct Main *bmain, struct Image *image, bool 
ignore_render_viewer)
+{
+  wmWindowManager *wm = (wmWindowManager *)bmain->wm.first;
+  LISTBASE_FOREACH (wmWindow *, win, >windows) {
+const bScreen *screen = WM_window_get_active_screen(win);
+LISTBASE_FOREACH (ScrArea *, area, >areabase) {
+  LISTBASE_FOREACH (SpaceLink *, sl, >spacedata) {
+if (sl->spacetype != SPACE_IMAGE) {
+  continue;
+}
+SpaceImage *sima = (SpaceImage *)sl;
+if (sima->pin) {
+  continue;
+}
+if (ignore_render_viewer && sima->image &&
+ELEM(sima->image->type, IMA_TYPE_R_RESULT, IMA_TYPE_COMPOSITE)) {
+  continue;
+}
+ED_space_imag

[Bf-blender-cvs] [4776a74bf7f] master: Fix T101974: Potential memoryleak GHOST_WindowWayland.newDrawingContext

2022-10-21 Thread Edward
Commit: 4776a74bf7f1ed60efee22290c5fea732d7e2e5a
Author: Edward
Date:   Fri Oct 21 15:35:20 2022 +0200
Branches: master
https://developer.blender.org/rB4776a74bf7f1ed60efee22290c5fea732d7e2e5a

Fix T101974: Potential memoryleak GHOST_WindowWayland.newDrawingContext

Reviewed By: jbakker

Maniphest Tasks: T101974

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

===

M   intern/ghost/intern/GHOST_WindowWayland.cpp

===

diff --git a/intern/ghost/intern/GHOST_WindowWayland.cpp 
b/intern/ghost/intern/GHOST_WindowWayland.cpp
index b29c5efd8d4..986e18d7a87 100644
--- a/intern/ghost/intern/GHOST_WindowWayland.cpp
+++ b/intern/ghost/intern/GHOST_WindowWayland.cpp
@@ -946,7 +946,12 @@ GHOST_Context 
*GHOST_WindowWayland::newDrawingContext(GHOST_TDrawingContextType
  EGL_OPENGL_API);
   }
 
-  return (context->initializeDrawingContext() == GHOST_kSuccess) ? context : 
nullptr;
+  if (context->initializeDrawingContext()) {
+return context;
+  }
+
+  delete context;
+  return nullptr;
 }
 
 /** \} */

___
Bf-blender-cvs mailing list
Bf-blender-cvs@blender.org
List details, subscription details or unsubscribe:
https://lists.blender.org/mailman/listinfo/bf-blender-cvs


[Bf-blender-cvs] [8d8316a] master: Cycles: Consolidate the various split CL kernel feature defines within the AMD platform

2016-08-24 Thread Edward O'Callaghan
Commit: 8d8316a057d335e37d2d51ca5a8d0ee1fed432c0
Author: Edward O'Callaghan
Date:   Wed Aug 24 12:30:05 2016 +0200
Branches: master
https://developer.blender.org/rB8d8316a057d335e37d2d51ca5a8d0ee1fed432c0

Cycles: Consolidate the various split CL kernel feature defines within the AMD 
platform

Reviewers: sergey

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

===

M   intern/cycles/kernel/kernel_types.h

===

diff --git a/intern/cycles/kernel/kernel_types.h 
b/intern/cycles/kernel/kernel_types.h
index 3152ec6..deebf87 100644
--- a/intern/cycles/kernel/kernel_types.h
+++ b/intern/cycles/kernel/kernel_types.h
@@ -113,16 +113,7 @@ CCL_NAMESPACE_BEGIN
 #  ifdef __KERNEL_OPENCL_AMD__
 #define __CL_USE_NATIVE__
 #define __KERNEL_SHADING__
-#define __MULTI_CLOSURE__
-#define __PASSES__
-#define __BACKGROUND_MIS__
-#define __LAMP_MIS__
-#define __AO__
-#define __CAMERA_MOTION__
-#define __OBJECT_MOTION__
-#define __HAIR__
-#define __BAKING__
-#define __TRANSPARENT_SHADOWS__
+#define __KERNEL_ADV_SHADING__
 #  endif  /* __KERNEL_OPENCL_AMD__ */
 
 #  ifdef __KERNEL_OPENCL_INTEL_CPU__

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