[Bf-blender-cvs] [e62b5e867d1] master: Cleanup: spelling in comments

2022-05-02 Thread Campbell Barton
Commit: e62b5e867d164d6ee822e369885d979d94ac4106
Author: Campbell Barton
Date:   Tue May 3 15:11:27 2022 +1000
Branches: master
https://developer.blender.org/rBe62b5e867d164d6ee822e369885d979d94ac4106

Cleanup: spelling in comments

===

M   source/blender/blenkernel/BKE_lib_principle_properties.h
M   source/blender/blenkernel/BKE_modifier.h
M   source/blender/blenkernel/BKE_paint.h
M   source/blender/blenkernel/intern/blendfile_link_append.c
M   source/blender/draw/engines/eevee/eevee_cryptomatte.c
M   source/blender/draw/engines/eevee/eevee_private.h
M   source/blender/draw/engines/eevee_next/eevee_defines.hh
M   source/blender/draw/engines/eevee_next/eevee_instance.cc
M   source/blender/draw/engines/eevee_next/eevee_material.hh
M   source/blender/draw/engines/eevee_next/eevee_shader.cc
M   source/blender/draw/engines/eevee_next/eevee_shader.hh
M   source/blender/draw/engines/eevee_next/eevee_shader_shared.hh
M   source/blender/draw/engines/eevee_next/eevee_sync.hh
M   source/blender/draw/engines/eevee_next/eevee_view.cc
M   source/blender/draw/engines/eevee_next/eevee_view.hh
M   source/blender/draw/engines/eevee_next/eevee_world.hh
M   
source/blender/draw/engines/eevee_next/shaders/infos/eevee_material_info.hh
M   source/blender/draw/engines/overlay/shaders/infos/extra_info.hh
M   source/blender/draw/engines/overlay/shaders/infos/volume_info.hh
M   source/blender/draw/engines/overlay/shaders/infos/wireframe_info.hh
M   source/blender/draw/engines/select/shaders/infos/select_id_info.hh
M   source/blender/editors/gpencil/gpencil_sculpt_paint.c
M   source/blender/editors/sculpt_paint/paint_vertex.cc
M   source/blender/gpu/metal/mtl_texture.hh
M   source/blender/gpu/metal/mtl_texture.mm
M   source/blender/gpu/shaders/infos/gpu_shader_3D_uniform_color_info.hh
M   source/blender/io/wavefront_obj/importer/obj_import_file_reader.cc
M   source/blender/makesdna/DNA_layer_types.h
M   source/blender/windowmanager/WM_types.h

===

diff --git a/source/blender/blenkernel/BKE_lib_principle_properties.h 
b/source/blender/blenkernel/BKE_lib_principle_properties.h
index 10d0d33a0c4..42177204efb 100644
--- a/source/blender/blenkernel/BKE_lib_principle_properties.h
+++ b/source/blender/blenkernel/BKE_lib_principle_properties.h
@@ -40,7 +40,7 @@ struct ReportList;
 struct IDPrincipleProperties *BKE_lib_principleprop_init(struct ID *id);
 #if 0
 /**
- * Shallow or deep copy of a whole princple properties from \a src_id to \a 
dst_id.
+ * Shallow or deep copy of a whole principle properties from \a src_id to \a 
dst_id.
  */
 void BKE_lib_principleprop_copy(struct ID *dst_id, const struct ID *src_id, 
bool do_full_copy);
 #endif
diff --git a/source/blender/blenkernel/BKE_modifier.h 
b/source/blender/blenkernel/BKE_modifier.h
index 881e86ccc54..a38bfb497a2 100644
--- a/source/blender/blenkernel/BKE_modifier.h
+++ b/source/blender/blenkernel/BKE_modifier.h
@@ -113,7 +113,7 @@ typedef enum ModifierApplyFlag {
   /** Render time. */
   MOD_APPLY_RENDER = 1 << 0,
   /** Result of evaluation will be cached, so modifier might
-   * want to cache data for quick updates (used by subsurf) */
+   * want to cache data for quick updates (used by subdivision-surface) */
   MOD_APPLY_USECACHE = 1 << 1,
   /** Modifier evaluated for undeformed texture coordinates */
   MOD_APPLY_ORCO = 1 << 2,
diff --git a/source/blender/blenkernel/BKE_paint.h 
b/source/blender/blenkernel/BKE_paint.h
index 0e976f04dd1..03cbcf575c3 100644
--- a/source/blender/blenkernel/BKE_paint.h
+++ b/source/blender/blenkernel/BKE_paint.h
@@ -733,7 +733,7 @@ enum {
 /* paint_vertex.cc */
 
 /**
- * Fills the object's active color atribute layer with the fill color.
+ * Fills the object's active color attribute layer with the fill color.
  *
  * \param[in] ob: The object.
  * \param[in] fill_color: The fill color.
diff --git a/source/blender/blenkernel/intern/blendfile_link_append.c 
b/source/blender/blenkernel/intern/blendfile_link_append.c
index 555c4690308..e2f22ef00d3 100644
--- a/source/blender/blenkernel/intern/blendfile_link_append.c
+++ b/source/blender/blenkernel/intern/blendfile_link_append.c
@@ -1564,7 +1564,7 @@ void 
BKE_blendfile_library_relocate(BlendfileLinkAppendContext *lapp_context,
   }
 
   if (GS(old_id->name) == ID_KE) {
-/* Shape Keys are handled as part of their owning obdata (see below). 
This implies thar
+/* Shape Keys are handled as part of their owning obdata (see below). 
This implies that
  * there is no way to know when the old pointer gets invalid, so just 
clear it immediately.
  */
 item->userdata = NULL;
diff --git a/source/blender/draw/engines/eevee/eevee_cryptomatte.c 
b/source/blender/draw/engines/eevee/eevee_cryptomatte.c
index 

[Bf-blender-cvs] [ab7379ae622] master: Merge branch 'blender-v3.2-release'

2022-05-02 Thread Campbell Barton
Commit: ab7379ae62232ebae6ff36ce6ae54ba297418e6c
Author: Campbell Barton
Date:   Tue May 3 14:58:09 2022 +1000
Branches: master
https://developer.blender.org/rBab7379ae62232ebae6ff36ce6ae54ba297418e6c

Merge branch 'blender-v3.2-release'

===



===



___
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] [4ee8dfa8b30] blender-v3.2-release: Fix use after free error when exiting a temp screen

2022-05-02 Thread Campbell Barton
Commit: 4ee8dfa8b30fbbb2d700e961f8c686199af39fe6
Author: Campbell Barton
Date:   Tue May 3 14:50:40 2022 +1000
Branches: blender-v3.2-release
https://developer.blender.org/rB4ee8dfa8b30fbbb2d700e961f8c686199af39fe6

Fix use after free error when exiting a temp screen

Regression in [0] caused by checking the screen after event handling.

[0]: d4bdf2192964f786520c774d1a2ee44617302bc1

===

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 87588c40b57..1c3f7ed3e7a 100644
--- a/source/blender/windowmanager/intern/wm_event_system.c
+++ b/source/blender/windowmanager/intern/wm_event_system.c
@@ -1301,8 +1301,14 @@ static wmOperator *wm_operator_create(wmWindowManager 
*wm,
  * This isn't very nice but needed to redraw gizmos which are hidden while 
tweaking,
  * See #WM_GIZMOGROUPTYPE_DELAY_REFRESH_FOR_TWEAK for details.
  */
-static void wm_region_tag_draw_on_gizmo_delay_refresh_for_tweak(wmWindow *win, 
bScreen *screen)
+static void wm_region_tag_draw_on_gizmo_delay_refresh_for_tweak(wmWindow *win)
 {
+
+  bScreen *screen = WM_window_get_active_screen(win);
+  /* Unlikely but not impossible as this runs after events have been handled. 
*/
+  if (UNLIKELY(screen == NULL)) {
+return;
+  }
   ED_screen_areas_iter (win, screen, area) {
 LISTBASE_FOREACH (ARegion *, region, >regionbase) {
   if (region->gizmo_map != NULL) {
@@ -3929,7 +3935,7 @@ void wm_event_do_handlers(bContext *C)
   }
 
   if (event_queue_check_drag_prev && (win->event_queue_check_drag == 
false)) {
-wm_region_tag_draw_on_gizmo_delay_refresh_for_tweak(win, screen);
+wm_region_tag_draw_on_gizmo_delay_refresh_for_tweak(win);
   }
 
   /* Update previous mouse position for following events to use. */

___
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] [80c8a7dcb0d] master: Merge branch 'blender-v3.2-release'

2022-05-02 Thread Campbell Barton
Commit: 80c8a7dcb0da12a609fcd37300ea68a55f31d621
Author: Campbell Barton
Date:   Tue May 3 13:27:20 2022 +1000
Branches: master
https://developer.blender.org/rB80c8a7dcb0da12a609fcd37300ea68a55f31d621

Merge branch 'blender-v3.2-release'

===



===



___
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] [8810d0cecdd] blender-v3.2-release: Fix T85379: Cube projection size parameter is wrong

2022-05-02 Thread Campbell Barton
Commit: 8810d0cecdd5c192d0562c62490695d22ca684d5
Author: Campbell Barton
Date:   Tue May 3 13:21:44 2022 +1000
Branches: blender-v3.2-release
https://developer.blender.org/rB8810d0cecdd5c192d0562c62490695d22ca684d5

Fix T85379: Cube projection size parameter is wrong

The input size was doubled & inverted.

===

M   source/blender/editors/uvedit/uvedit_unwrap_ops.c

===

diff --git a/source/blender/editors/uvedit/uvedit_unwrap_ops.c 
b/source/blender/editors/uvedit/uvedit_unwrap_ops.c
index 609fa72d56b..34fae2ffb2a 100644
--- a/source/blender/editors/uvedit/uvedit_unwrap_ops.c
+++ b/source/blender/editors/uvedit/uvedit_unwrap_ops.c
@@ -2841,6 +2841,10 @@ static void uvedit_unwrap_cube_project(BMesh *bm,
 zero_v3(loc);
   }
 
+  if (UNLIKELY(cube_size == 0.0f)) {
+cube_size = 1.0f;
+  }
+
   /* choose x,y,z axis for projection depending on the largest normal
* component, but clusters all together around the center of map. */
 
@@ -2853,8 +2857,8 @@ static void uvedit_unwrap_cube_project(BMesh *bm,
 
 BM_ITER_ELEM (l, , efa, BM_LOOPS_OF_FACE) {
   luv = BM_ELEM_CD_GET_VOID_P(l, cd_loop_uv_offset);
-  luv->uv[0] = 0.5f + 0.5f * cube_size * (l->v->co[cox] - loc[cox]);
-  luv->uv[1] = 0.5f + 0.5f * cube_size * (l->v->co[coy] - loc[coy]);
+  luv->uv[0] = 0.5f + ((l->v->co[cox] - loc[cox]) / cube_size);
+  luv->uv[1] = 0.5f + ((l->v->co[coy] - loc[coy]) / cube_size);
 }
   }
 }
@@ -2900,7 +2904,6 @@ static int cube_project_exec(bContext *C, wmOperator *op)
   float dims[3];
   sub_v3_v3v3(dims, bounds[1], bounds[0]);
   cube_size = max_fff(UNPACK3(dims));
-  cube_size = cube_size ? 2.0f / cube_size : 1.0f;
   if (ob_index == 0) {
 /* This doesn't fit well with, multiple objects. */
 RNA_property_float_set(op->ptr, prop_cube_size, cube_size);
@@ -2975,7 +2978,8 @@ void ED_uvedit_add_simple_uvs(Main *bmain, const Scene 
*scene, Object *ob)
  }));
   /* select all uv loops first - pack parameters needs this to make sure 
charts are registered */
   ED_uvedit_select_all(bm);
-  uvedit_unwrap_cube_project(bm, 1.0, false, NULL);
+  /* A cube size of 2.0 maps [-1..1] vertex coords to [0.0..1.0] in UV coords. 
*/
+  uvedit_unwrap_cube_project(bm, 2.0, false, NULL);
   /* Set the margin really quickly before the packing operation. */
   scene->toolsettings->uvcalc_margin = 0.001f;
   uvedit_pack_islands(scene, ob, bm);

___
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] [502c420170b] lineart-shadow: LineArt: Fix light/shade cutting for intersections

2022-05-02 Thread YimingWu
Commit: 502c420170b7f130e01cb9f1e618ab0f10d2a273
Author: YimingWu
Date:   Tue May 3 11:00:18 2022 +0800
Branches: lineart-shadow
https://developer.blender.org/rB502c420170b7f130e01cb9f1e618ab0f10d2a273

LineArt: Fix light/shade cutting for intersections

===

M   source/blender/gpencil_modifiers/intern/lineart/MOD_lineart.h
M   source/blender/gpencil_modifiers/intern/lineart/lineart_cpu.c

===

diff --git a/source/blender/gpencil_modifiers/intern/lineart/MOD_lineart.h 
b/source/blender/gpencil_modifiers/intern/lineart/MOD_lineart.h
index a2c619eadcd..c1eec27d914 100644
--- a/source/blender/gpencil_modifiers/intern/lineart/MOD_lineart.h
+++ b/source/blender/gpencil_modifiers/intern/lineart/MOD_lineart.h
@@ -80,6 +80,7 @@ typedef enum eLineArtElementNodeFlag {
   LRT_ELEMENT_IS_ADDITIONAL = (1 << 0),
   LRT_ELEMENT_BORDER_ONLY = (1 << 1),
   LRT_ELEMENT_NO_INTERSECTION = (1 << 2),
+  LRT_ELEMENT_INTERSECTION_DATA = (1 << 3),
 } eLineArtElementNodeFlag;
 
 typedef struct LineartElementLinkNode {
diff --git a/source/blender/gpencil_modifiers/intern/lineart/lineart_cpu.c 
b/source/blender/gpencil_modifiers/intern/lineart/lineart_cpu.c
index 33dbcefd5ed..0cfd3892489 100644
--- a/source/blender/gpencil_modifiers/intern/lineart/lineart_cpu.c
+++ b/source/blender/gpencil_modifiers/intern/lineart/lineart_cpu.c
@@ -2006,6 +2006,38 @@ static void 
lineart_register_shadow_cuts(LineartRenderBuffer *rb,
   }
 }
 
+static void lineart_register_intersection_shadow_cuts(LineartRenderBuffer *rb,
+  ListBase *shadow_elns)
+{
+  LineartElementLinkNode *eln_isect_shadow = NULL, *eln_isect_original = NULL;
+  if (!shadow_elns) {
+return;
+  }
+  LISTBASE_FOREACH (LineartElementLinkNode *, eln, shadow_elns) {
+if (eln->flags & LRT_ELEMENT_INTERSECTION_DATA) {
+  eln_isect_shadow = eln;
+  break;
+}
+  }
+  LISTBASE_FOREACH (LineartElementLinkNode *, eln, >line_buffer_pointers) {
+if (eln->flags & LRT_ELEMENT_INTERSECTION_DATA) {
+  eln_isect_original = eln;
+  break;
+}
+  }
+  if (!eln_isect_shadow || !eln_isect_original) {
+return;
+  }
+  LineartEdge *e = (LineartEdge *)eln_isect_original->pointer;
+  for (int i = 0; i < eln_isect_original->element_count; i++) {
+LineartEdge *shadow_e = lineart_find_matching_edge(eln_isect_shadow, 
(uint64_t)e->from_shadow);
+if (shadow_e) {
+  lineart_register_shadow_cuts(rb, e, shadow_e);
+}
+e++;
+  }
+}
+
 static void lineart_geometry_object_load_no_bmesh(LineartObjectInfo *ob_info,
   LineartRenderBuffer *re_buf,
   ListBase *shadow_elns)
@@ -,6 +4476,7 @@ static void 
lineart_create_edges_from_isec_data(LineartIsecData *d)
   double ZMax = rb->far_clip;
   double ZMin = rb->near_clip;
 
+  int total_lines = 0;
   for (int i = 0; i < d->thread_count; i++) {
 LineartIsecThread *th = >threads[i];
 if (G.debug_value == 4000) {
@@ -4452,13 +4485,32 @@ static void 
lineart_create_edges_from_isec_data(LineartIsecData *d)
 if (!th->current) {
   continue;
 }
-/* We don't care about removing duplicated vert in this method, chaning 
can handle that,
- * and it saves us from using locks and look up tables. */
-LineartVert *v = lineart_mem_acquire(>render_data_pool,
- sizeof(LineartVert) * th->current * 
2);
-LineartEdge *e = lineart_mem_acquire(>render_data_pool, 
sizeof(LineartEdge) * th->current);
-LineartEdgeSegment *es = lineart_mem_acquire(>render_data_pool,
- sizeof(LineartEdgeSegment) * 
th->current);
+total_lines += th->current;
+  }
+
+  if (!total_lines) {
+return;
+  }
+
+  /* We don't care about removing duplicated vert in this method, chaning can 
handle that,
+   * and it saves us from using locks and look up tables. */
+  LineartVert *v = lineart_mem_acquire(rb->edge_data_pool, sizeof(LineartVert) 
* total_lines * 2);
+  LineartEdge *e = lineart_mem_acquire(rb->edge_data_pool, sizeof(LineartEdge) 
* total_lines);
+  LineartEdgeSegment *es = lineart_mem_acquire(rb->edge_data_pool,
+   sizeof(LineartEdgeSegment) * 
total_lines);
+
+  LineartElementLinkNode *eln = lineart_mem_acquire(rb->edge_data_pool,
+
sizeof(LineartElementLinkNode));
+  eln->element_count = total_lines;
+  eln->pointer = e;
+  eln->flags |= LRT_ELEMENT_INTERSECTION_DATA;
+  BLI_addhead(>line_buffer_pointers, eln);
+
+  for (int i = 0; i < d->thread_count; i++) {
+LineartIsecThread *th = >threads[i];
+if (!th->current) {
+  continue;
+}
 for (int j = 0; j < th->current; j++) {
   LineartVert *v1 = v;
   LineartVert *v2 

[Bf-blender-cvs] [62cabfca879] xr-dev: XR: Add dedicated handling/API for VR trackers

2022-05-02 Thread Peter Kim
Commit: 62cabfca87977a79cdd716f862c0c1029d9733d7
Author: Peter Kim
Date:   Tue May 3 09:58:15 2022 +0900
Branches: xr-dev
https://developer.blender.org/rB62cabfca87977a79cdd716f862c0c1029d9733d7

XR: Add dedicated handling/API for VR trackers

Allows for easier testing/debugging of tracker functionality by
separating trackers from session controller data. Also, this should
make it possible to use controllers and trackers during a VR session
simultaneously.

===

M   source/blender/makesdna/DNA_xr_types.h
M   source/blender/makesrna/intern/rna_xr.c
M   source/blender/windowmanager/WM_api.h
M   source/blender/windowmanager/xr/intern/wm_xr_action.c
M   source/blender/windowmanager/xr/intern/wm_xr_draw.c
M   source/blender/windowmanager/xr/intern/wm_xr_intern.h
M   source/blender/windowmanager/xr/intern/wm_xr_session.c

===

diff --git a/source/blender/makesdna/DNA_xr_types.h 
b/source/blender/makesdna/DNA_xr_types.h
index 6097dfcfe7e..e4b92fe885b 100644
--- a/source/blender/makesdna/DNA_xr_types.h
+++ b/source/blender/makesdna/DNA_xr_types.h
@@ -115,6 +115,8 @@ typedef enum eXrPoseFlag {
   /* Pose represents controller grip/aim. */
   XR_POSE_GRIP = (1 << 0),
   XR_POSE_AIM = (1 << 1),
+  /* Pose represents VR tracker. */
+  XR_POSE_TRACKER = (1 << 2),
 } eXrPoseFlag;
 
 typedef enum eXrMotionCaptureFlag {
diff --git a/source/blender/makesrna/intern/rna_xr.c 
b/source/blender/makesrna/intern/rna_xr.c
index db35807b151..65f99166e51 100644
--- a/source/blender/makesrna/intern/rna_xr.c
+++ b/source/blender/makesrna/intern/rna_xr.c
@@ -523,6 +523,29 @@ static void 
rna_XrActionMapItem_pose_is_controller_aim_set(PointerRNA *ptr, bool
 #  endif
 }
 
+static bool rna_XrActionMapItem_pose_is_tracker_get(PointerRNA *ptr)
+{
+#  ifdef WITH_XR_OPENXR
+  XrActionMapItem *ami = ptr->data;
+  if ((ami->pose_flag & XR_POSE_TRACKER) != 0) {
+return true;
+  }
+#  else
+  UNUSED_VARS(ptr);
+#  endif
+  return false;
+}
+
+static void rna_XrActionMapItem_pose_is_tracker_set(PointerRNA *ptr, bool 
value)
+{
+#  ifdef WITH_XR_OPENXR
+  XrActionMapItem *ami = ptr->data;
+  SET_FLAG_FROM_TEST(ami->pose_flag, value, XR_POSE_TRACKER);
+#  else
+  UNUSED_VARS(ptr, value);
+#  endif
+}
+
 static void rna_XrActionMapItem_bindings_begin(CollectionPropertyIterator 
*iter, PointerRNA *ptr)
 {
 #  ifdef WITH_XR_OPENXR
@@ -1048,6 +1071,32 @@ bool 
rna_XrSessionState_controller_pose_actions_set(bContext *C,
 #  endif
 }
 
+bool rna_XrSessionState_tracker_pose_action_add(bContext *C,
+const char *action_set_name,
+const char 
*tracker_action_name)
+{
+#  ifdef WITH_XR_OPENXR
+  wmWindowManager *wm = CTX_wm_manager(C);
+  return WM_xr_tracker_pose_action_add(>xr, action_set_name, 
tracker_action_name);
+#  else
+  UNUSED_VARS(C, action_set_name, tracker_action_name);
+  return false;
+#  endif
+}
+
+bool rna_XrSessionState_tracker_pose_action_remove(bContext *C,
+   const char *action_set_name,
+   const char 
*tracker_action_name)
+{
+#  ifdef WITH_XR_OPENXR
+  wmWindowManager *wm = CTX_wm_manager(C);
+  return WM_xr_tracker_pose_action_remove(>xr, action_set_name, 
tracker_action_name);
+#  else
+  UNUSED_VARS(C, action_set_name, tracker_action_name);
+  return false;
+#  endif
+}
+
 void rna_XrSessionState_action_state_get(bContext *C,
  const char *action_set_name,
  const char *action_name,
@@ -1171,6 +1220,32 @@ static void 
rna_XrSessionState_controller_aim_rotation_get(bContext *C,
 #  endif
 }
 
+static void rna_XrSessionState_tracker_location_get(bContext *C,
+const char *user_path,
+float r_values[3])
+{
+#  ifdef WITH_XR_OPENXR
+  const wmWindowManager *wm = CTX_wm_manager(C);
+  WM_xr_session_state_tracker_location_get(>xr, user_path, r_values);
+#  else
+  UNUSED_VARS(C, user_path);
+  zero_v3(r_values);
+#  endif
+}
+
+static void rna_XrSessionState_tracker_rotation_get(bContext *C,
+const char *user_path,
+float r_values[4])
+{
+#  ifdef WITH_XR_OPENXR
+  const wmWindowManager *wm = CTX_wm_manager(C);
+  WM_xr_session_state_tracker_rotation_get(>xr, user_path, r_values);
+#  else
+  UNUSED_VARS(C, user_path);
+  unit_qt(r_values);
+#  endif
+}
+
 static void rna_XrSessionState_viewer_pose_location_get(PointerRNA *ptr, float 
*r_values)
 {
 #  ifdef WITH_XR_OPENXR
@@ -1827,6 +1902,11 @@ static void rna_def_xr_actionmap(BlenderRNA *brna)
   RNA_def_property_ui_text(
   prop, "Is Controller Aim", 

[Bf-blender-cvs] [07c35a743a6] xr-dev: Merge branch 'master' into xr-dev

2022-05-02 Thread Peter Kim
Commit: 07c35a743a6c157e01a056ce12944648d8cd4d8a
Author: Peter Kim
Date:   Tue May 3 10:39:15 2022 +0900
Branches: xr-dev
https://developer.blender.org/rB07c35a743a6c157e01a056ce12944648d8cd4d8a

Merge branch 'master' into xr-dev

===



===

diff --cc source/blender/editors/include/ED_transform.h
index d688736,82cc518f029..2d3a3bc6f0a
--- a/source/blender/editors/include/ED_transform.h
+++ b/source/blender/editors/include/ED_transform.h
@@@ -204,19 -202,21 +204,34 @@@ int ED_transform_calc_gizmo_stats(cons
const struct TransformCalcParams *params,
struct TransformBounds *tbounds);
  
 +/* transform_convert.c */
 +void ED_transform_animrecord_check_state(struct Scene *scene,
 + struct wmTimer *animtimer,
 + struct Object *ob);
 +
 +/* transform_convert_object.c */
 +void ED_transform_autokeyframe_object(struct bContext *C,
 +  struct Scene *scene,
 +  struct ViewLayer *view_layer,
 +  struct Object *ob,
 +  int tmode);
 +bool ED_transform_motionpath_need_update_object(struct Scene *scene, struct 
Object *ob);
 +
+ /**
+  * Iterates over all the strips and finds the closest snapping candidate of 
either \a frame_1 or \a
+  * frame_2. The closest snapping candidate will be the closest start or end 
frame of an existing
+  * strip.
+  * \returns True if there was anything to snap to.
+  */
+ bool ED_transform_snap_sequencer_to_closest_strip_calc(struct Scene *scene,
+struct ARegion *region,
+int frame_1,
+int frame_2,
+int *r_snap_distance,
+float *r_snap_frame);
+ 
+ void ED_draw_sequencer_snap_point(struct bContext *C, float snap_point);
+ 
  #ifdef __cplusplus
  }
  #endif
diff --cc source/blender/makesdna/DNA_xr_types.h
index e4b92fe885b,44419c9763f..fa590c69728
--- a/source/blender/makesdna/DNA_xr_types.h
+++ b/source/blender/makesdna/DNA_xr_types.h
@@@ -37,14 -37,9 +37,18 @@@ typedef struct XrSessionSettings 
  
int flag;
  
+   /** Object type settings to apply to VR view (unlike shading, not shared 
with window 3D-View). */
+   int object_type_exclude_viewport;
+   int object_type_exclude_select;
++
 +  ListBase actionmaps; /* XrActionMap */
 +  short act_actionmap;
 +  short sel_actionmap;
 +  char _pad3[2];
 +
 +  /** Objects to bind to headset/controller poses. */
 +  short sel_mocap_object;
 +  ListBase mocap_objects; /* #XrMotionCaptureObject */
  } XrSessionSettings;
  
  typedef enum eXrSessionFlag {
diff --cc source/blender/makesrna/intern/rna_xr.c
index 65f99166e51,a04b29b8815..9f88f568204
--- a/source/blender/makesrna/intern/rna_xr.c
+++ b/source/blender/makesrna/intern/rna_xr.c
@@@ -845,71 -691,25 +845,90 @@@ static void rna_XrSessionSettings_use_a
  #  endif
  }
  
 +static bool 
rna_XrSessionSettings_enable_vive_tracker_extension_get(PointerRNA *ptr)
 +{
 +#  ifdef WITH_XR_OPENXR
 +  const wmXrData *xr = rna_XrSession_wm_xr_data_get(ptr);
 +  return (xr->session_settings.flag & 
XR_SESSION_ENABLE_VIVE_TRACKER_EXTENSION) != 0;
 +#  else
 +  UNUSED_VARS(ptr);
 +  return false;
 +#  endif
 +}
 +
 +static void 
rna_XrSessionSettings_enable_vive_tracker_extension_set(PointerRNA *ptr, bool 
value)
 +{
 +#  ifdef WITH_XR_OPENXR
 +  wmXrData *xr = rna_XrSession_wm_xr_data_get(ptr);
 +  SET_FLAG_FROM_TEST(xr->session_settings.flag, value, 
XR_SESSION_ENABLE_VIVE_TRACKER_EXTENSION);
 +#  else
 +  UNUSED_VARS(ptr, value);
 +#  endif
 +}
 +
+ static int 
rna_XrSessionSettings_icon_from_show_object_viewport_get(PointerRNA *ptr)
+ {
+ #  ifdef WITH_XR_OPENXR
+   const wmXrData *xr = rna_XrSession_wm_xr_data_get(ptr);
+   return rna_object_type_visibility_icon_get_common(
+   xr->session_settings.object_type_exclude_viewport,
+ #if 0
+ /* For the future when selection in VR is reliably supported. */
+ >session_settings.object_type_exclude_select
+ #else
+   NULL
+ #endif
+   );
+ #  else
+   UNUSED_VARS(ptr);
+   return ICON_NONE;
+ #  endif
+ }
+ 
 +static void rna_XrSessionSettings_actionmaps_begin(CollectionPropertyIterator 
*iter,
 +   PointerRNA *ptr)
 +{
 +#  ifdef WITH_XR_OPENXR
 +  wmXrData *xr = rna_XrSession_wm_xr_data_get(ptr);
 +  rna_iterator_listbase_begin(iter, >session_settings.actionmaps, NULL);
 +#  else
 +  UNUSED_VARS(iter, ptr);
 +#  endif
 +}
 +
 +static int rna_XrSessionSettings_actionmaps_length(PointerRNA 

[Bf-blender-cvs] [00aa4252c51] universal-scene-description: Updates to build with USD 21.11.

2022-05-02 Thread Michael Kowalski
Commit: 00aa4252c51766f28f174653030be07a87f39e85
Author: Michael Kowalski
Date:   Mon May 2 20:22:01 2022 -0400
Branches: universal-scene-description
https://developer.blender.org/rB00aa4252c51766f28f174653030be07a87f39e85

Updates to build with USD 21.11.

===

M   source/blender/io/usd/intern/usd_reader_instance.cc
M   source/blender/io/usd/intern/usd_umm.cc

===

diff --git a/source/blender/io/usd/intern/usd_reader_instance.cc 
b/source/blender/io/usd/intern/usd_reader_instance.cc
index 5ee4cc7e9a7..070ad47a872 100644
--- a/source/blender/io/usd/intern/usd_reader_instance.cc
+++ b/source/blender/io/usd/intern/usd_reader_instance.cc
@@ -54,8 +54,8 @@ void USDInstanceReader::set_instance_collection(Collection 
*coll)
 
 pxr::SdfPath USDInstanceReader::proto_path() const
 {
-  if (pxr::UsdPrim master = prim_.GetMaster()) {
-return master.GetPath();
+  if (pxr::UsdPrim proto = prim_.GetPrototype()) {
+return proto.GetPath();
   }
 
   return pxr::SdfPath();
diff --git a/source/blender/io/usd/intern/usd_umm.cc 
b/source/blender/io/usd/intern/usd_umm.cc
index 24d236208fc..c648c2f2c23 100644
--- a/source/blender/io/usd/intern/usd_umm.cc
+++ b/source/blender/io/usd/intern/usd_umm.cc
@@ -60,16 +60,10 @@ using namespace blender::io::usd;
 
 static std::string anchor_relative_path(pxr::UsdStagePtr stage, const 
std::string _path)
 {
-  if (asset_path.empty()) {
+  if (asset_path.empty() || asset_path.front() != '.') {
 return std::string();
   }
 
-  pxr::ArResolver  = pxr::ArGetResolver();
-
-  if (!resolver.IsRelativePath(asset_path)) {
-return asset_path;
-  }
-
   // TODO(makowalski): avoid recomputing the USD path, if possible.
   pxr::SdfLayerHandle layer = stage->GetRootLayer();
 
@@ -79,7 +73,11 @@ static std::string anchor_relative_path(pxr::UsdStagePtr 
stage, const std::strin
 return asset_path;
   }
 
-  return resolver.AnchorRelativePath(stage_path, asset_path);
+#if PXR_VERSION >= 2111
+  return pxr::ArGetResolver().CreateIdentifier(asset_path, 
pxr::ArResolvedPath(stage_path));
+#else
+  return pxr::ArGetResolver().AnchorRelativePath(stage_path, asset_path);
+#endif
 }
 
 static void print_obj(PyObject *obj)

___
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] [8f17cb2052b] universal-scene-description: Merge branch 'master' into universal-scene-description

2022-05-02 Thread Michael Kowalski
Commit: 8f17cb2052bd5f4e5e0c57fd87fb3f527585609a
Author: Michael Kowalski
Date:   Mon May 2 20:17:10 2022 -0400
Branches: universal-scene-description
https://developer.blender.org/rB8f17cb2052bd5f4e5e0c57fd87fb3f527585609a

Merge branch 'master' into universal-scene-description

===



===

diff --cc source/blender/editors/io/io_usd.c
index fa76a0dc529,e0616a0cec3..684c7c45ef9
--- a/source/blender/editors/io/io_usd.c
+++ b/source/blender/editors/io/io_usd.c
@@@ -520,7 -201,7 +520,8 @@@ void WM_OT_usd_export(struct wmOperator
ot->poll = WM_operator_winactive;
ot->ui = wm_usd_export_draw;
  
-   ot->flag = OPTYPE_PRESET;
 -  ot->flag = OPTYPE_REGISTER; /* No UNDO possible. */
++  ot->flag = OPTYPE_PRESET /* Show preset menu. */
++ | OPTYPE_REGISTER; /* No UNDO possible. */
  
WM_operator_properties_filesel(ot,
   FILE_TYPE_FOLDER | FILE_TYPE_USD,
@@@ -562,93 -222,37 +563,93 @@@
"visible_objects_only",
true,
"Visible Only",
-   "Only visible objects are exported. Invisible parents of 
exported objects are "
-   "exported as empty transform");
+   "Only export visible objects. Invisible parents of exported 
objects are "
+   "exported as empty transforms");
+ 
+   RNA_def_boolean(
+   ot->srna,
+   "export_animation",
+   false,
+   "Animation",
+   "Export all frames in the render frame range, rather than only the 
current frame");
 +
-   RNA_def_boolean(ot->srna,
-   "export_animation",
-   false,
-   "Animation",
-   "When checked, the render frame range is exported. When 
false, only the current "
-   "frame is exported");
RNA_def_boolean(
-   ot->srna, "export_hair", true, "Hair", "When checked, hair is exported 
as USD curves");
 -  ot->srna, "export_hair", false, "Hair", "Export hair particle systems 
as USD curves");
 -  RNA_def_boolean(
 -  ot->srna, "export_uvmaps", true, "UV Maps", "Include all mesh UV maps 
in the export");
++  ot->srna, "export_hair", true, "Hair", "Export hair particle systems as 
USD curves");
 +  RNA_def_boolean(ot->srna,
 +  "export_vertices",
 +  true,
 +  "Vertices",
 +  "When checked, vertex and point data are included in the 
export");
 +  RNA_def_boolean(ot->srna,
 +  "export_vertex_colors",
 +  true,
 +  "Vertex Colors",
 +  "When checked, all vertex colors are included in the 
export");
 +  RNA_def_boolean(ot->srna,
 +  "export_vertex_groups",
 +  false,
 +  "Vertex Groups",
 +  "When checked, all vertex groups are included in the 
export");
 +  RNA_def_boolean(ot->srna,
 +  "export_face_maps",
 +  false,
 +  "Face Maps",
 +  "When checked, all face maps are included in the export");
 +  RNA_def_boolean(ot->srna,
 +  "export_uvmaps",
 +  true,
-   "UV Maps",
-   "When checked, all UV maps of exported meshes are included 
in the export");
++  "UV Maps", "Include all mesh UV maps in the export");
++
RNA_def_boolean(ot->srna,
"export_normals",
true,
"Normals",
-   "When checked, normals of exported meshes are included in 
the export");
+   "Include normals of exported meshes in the export");
 +  RNA_def_boolean(
 +  ot->srna,
 +  "export_transforms",
 +  true,
 +  "Transforms",
 +  "When checked, transform data/operations will be exported for all 
applicable prims");
RNA_def_boolean(ot->srna,
"export_materials",
true,
"Materials",
-   "When checked, the viewport settings of materials are 
exported as USD preview "
-   "materials, and material assignments are exported as 
geometry subsets");
+   "Export viewport settings of materials as USD preview 
materials, and export "
+   "material assignments as geometry subsets");
 +  RNA_def_boolean(
 +  ot->srna, "export_meshes", true, "Meshes", "When checked, all meshes 
will be exported");
 +  RNA_def_boolean(
 +  ot->srna, "export_lights", true, "Lights", "When checked, all lights 
will be exported");
 +  RNA_def_boolean(
 +  ot->srna, "export_cameras", true, "Cameras", "When checked, all cameras 
will be exported");
 +  RNA_def_boolean(
 +  ot->srna, "export_curves", true, "Curves", "When checked, all curves 
will be 

[Bf-blender-cvs] [ecc2ec724e3] master: Cleanup: quiet shadow warning

2022-05-02 Thread Campbell Barton
Commit: ecc2ec724e35a60e0e85036161d4b3a40dd60524
Author: Campbell Barton
Date:   Tue May 3 09:43:56 2022 +1000
Branches: master
https://developer.blender.org/rBecc2ec724e35a60e0e85036161d4b3a40dd60524

Cleanup: quiet shadow warning

===

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

===

diff --git a/source/blender/editors/gpencil/gpencil_sculpt_paint.c 
b/source/blender/editors/gpencil/gpencil_sculpt_paint.c
index 7a511c33673..ae40c76916b 100644
--- a/source/blender/editors/gpencil/gpencil_sculpt_paint.c
+++ b/source/blender/editors/gpencil/gpencil_sculpt_paint.c
@@ -1601,8 +1601,6 @@ static bool gpencil_sculpt_brush_do_frame(bContext *C,
   BKE_gpencil_layer_transform_matrix_get(gso->depsgraph, gso->object, gpl, 
bound_mat);
 
   LISTBASE_FOREACH (bGPDstroke *, gps, >strokes) {
-bGPDstroke *gps_active = (gps->runtime.gps_orig) ? gps->runtime.gps_orig : 
gps;
-
 /* skip strokes that are invalid for current view */
 if (ED_gpencil_stroke_can_use(C, gps) == false) {
   continue;
@@ -1612,8 +1610,11 @@ static bool gpencil_sculpt_brush_do_frame(bContext *C,
   continue;
 }
 
-if ((is_automasking) && (!BLI_ghash_haskey(gso->automasking_strokes, 
gps_active))) {
-  continue;
+{
+  bGPDstroke *gps_active = (gps->runtime.gps_orig) ? gps->runtime.gps_orig 
: gps;
+  if ((is_automasking) && (!BLI_ghash_haskey(gso->automasking_strokes, 
gps_active))) {
+continue;
+  }
 }
 
 /* Check if the stroke collide with brush. */

___
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] [e5a738af6d5] master: Merge branch 'blender-v3.2-release'

2022-05-02 Thread Campbell Barton
Commit: e5a738af6d511f0de5924c15573c906ddcb2bd85
Author: Campbell Barton
Date:   Tue May 3 09:49:09 2022 +1000
Branches: master
https://developer.blender.org/rBe5a738af6d511f0de5924c15573c906ddcb2bd85

Merge branch 'blender-v3.2-release'

===



===



___
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] [79d4740edab] blender-v3.2-release: Cleanup: use context.temp_override

2022-05-02 Thread Campbell Barton
Commit: 79d4740edabbe0a7cd20b708a4c67e69958396b4
Author: Campbell Barton
Date:   Tue May 3 09:32:28 2022 +1000
Branches: blender-v3.2-release
https://developer.blender.org/rB79d4740edabbe0a7cd20b708a4c67e69958396b4

Cleanup: use context.temp_override

Remove use of deprecated operator context passing.

Also minor clarification in the context.temp_override docs.

===

M   doc/python_api/examples/bpy.types.Context.temp_override.1.py
M   
release/scripts/startup/bl_app_templates_system/Video_Editing/__init__.py

===

diff --git a/doc/python_api/examples/bpy.types.Context.temp_override.1.py 
b/doc/python_api/examples/bpy.types.Context.temp_override.1.py
index 68f0eef93c3..6213db30e00 100644
--- a/doc/python_api/examples/bpy.types.Context.temp_override.1.py
+++ b/doc/python_api/examples/bpy.types.Context.temp_override.1.py
@@ -10,7 +10,7 @@ Notes:
 
 - Temporary context overrides may be nested, when this is done, members will 
be added to the existing overrides.
 
-- Context members are restored outside the scope of the context.
+- Context members are restored outside the scope of the context-manager.
   The only exception to this is when the data is no longer available.
 
   In the event windowing data was removed (for example), the state of the 
context is left as-is.
diff --git 
a/release/scripts/startup/bl_app_templates_system/Video_Editing/__init__.py 
b/release/scripts/startup/bl_app_templates_system/Video_Editing/__init__.py
index 0f5b81041cf..cdf7d0bad5c 100644
--- a/release/scripts/startup/bl_app_templates_system/Video_Editing/__init__.py
+++ b/release/scripts/startup/bl_app_templates_system/Video_Editing/__init__.py
@@ -14,6 +14,8 @@ def update_factory_startup_screens():
 
 
 def update_factory_startup_ffmpeg_preset():
+from bpy import context
+
 preset = "H264_in_MP4"
 preset_filepath = bpy.utils.preset_find(preset, preset_path="ffmpeg")
 if not preset_filepath:
@@ -24,7 +26,8 @@ def update_factory_startup_ffmpeg_preset():
 render.image_settings.file_format = 'FFMPEG'
 
 if preset_filepath:
-bpy.ops.script.python_file_run({"scene": scene}, 
filepath=preset_filepath)
+with context.temp_override(scene=scene):
+bpy.ops.script.python_file_run(filepath=preset_filepath)
 
 render.ffmpeg.audio_codec = 'AAC'
 render.ffmpeg.audio_bitrate = 256

___
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] [309b6319a04] blender-v3.2-release: Cleanup: quiet unused variable warning

2022-05-02 Thread Campbell Barton
Commit: 309b6319a045ea95c7602475a4a5f5a6e4afdd07
Author: Campbell Barton
Date:   Tue May 3 09:32:27 2022 +1000
Branches: blender-v3.2-release
https://developer.blender.org/rB309b6319a045ea95c7602475a4a5f5a6e4afdd07

Cleanup: quiet unused variable warning

===

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

===

diff --git a/source/blender/makesrna/intern/rna_xr.c 
b/source/blender/makesrna/intern/rna_xr.c
index 6f43afe23fe..a04b29b8815 100644
--- a/source/blender/makesrna/intern/rna_xr.c
+++ b/source/blender/makesrna/intern/rna_xr.c
@@ -705,6 +705,7 @@ static int 
rna_XrSessionSettings_icon_from_show_object_viewport_get(PointerRNA *
 #endif
   );
 #  else
+  UNUSED_VARS(ptr);
   return ICON_NONE;
 #  endif
 }

___
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] [fd7384a751b] master: Merge branch 'blender-v3.2-release'

2022-05-02 Thread Henrik Dick
Commit: fd7384a751b6cbf6f64ecee1427f4ddf4a107f51
Author: Henrik Dick
Date:   Mon May 2 22:18:21 2022 +0200
Branches: master
https://developer.blender.org/rBfd7384a751b6cbf6f64ecee1427f4ddf4a107f51

Merge branch 'blender-v3.2-release'

===



===



___
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] [62ef1c08af9] blender-v3.2-release: GPencil: Fix envelope modifier deform mode thickness

2022-05-02 Thread Henrik Dick
Commit: 62ef1c08af9a62104201e062f2b9a374c056e53b
Author: Henrik Dick
Date:   Mon May 2 22:13:38 2022 +0200
Branches: blender-v3.2-release
https://developer.blender.org/rB62ef1c08af9a62104201e062f2b9a374c056e53b

GPencil: Fix envelope modifier deform mode thickness

The thickness in the deform mode was just correct if the radius when
drawing a stroke was set to 20. Now all factors that influence the
stroke thickness are considered in deform mode.

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

===

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

===

diff --git a/source/blender/gpencil_modifiers/intern/MOD_gpencilenvelope.c 
b/source/blender/gpencil_modifiers/intern/MOD_gpencilenvelope.c
index 8b0a6ee84a2..e5604005240 100644
--- a/source/blender/gpencil_modifiers/intern/MOD_gpencilenvelope.c
+++ b/source/blender/gpencil_modifiers/intern/MOD_gpencilenvelope.c
@@ -152,8 +152,12 @@ static float calc_radius_limit(
   return radius_limit;
 }
 
-static void apply_stroke_envelope(
-bGPDstroke *gps, int spread, const int def_nr, const bool invert_vg, const 
float thickness)
+static void apply_stroke_envelope(bGPDstroke *gps,
+  int spread,
+  const int def_nr,
+  const bool invert_vg,
+  const float thickness,
+  const float pixfactor)
 {
   const bool is_cyclic = (gps->flag & GP_STROKE_CYCLIC) != 0;
   if (is_cyclic) {
@@ -282,9 +286,7 @@ static void apply_stroke_envelope(
 }
 
 float fac = use_dist * weight;
-/* The 50 is an internal constant for the default pixel size. The result 
can be messed up if
- * #bGPdata.pixfactor is not default, but I think modifiers shouldn't 
access that. */
-point->pressure += fac * 50.0f * GP_DEFAULT_PIX_FACTOR;
+point->pressure += fac * pixfactor;
 interp_v3_v3v3(>x, >x, new_center, fac / len_v3v3(closest, 
closest2));
   }
 
@@ -326,8 +328,14 @@ static void deformStroke(GpencilModifierData *md,
 return;
   }
 
-  apply_stroke_envelope(
-  gps, mmd->spread, def_nr, (mmd->flag & GP_ENVELOPE_INVERT_VGROUP) != 0, 
mmd->thickness);
+  bGPdata *gpd = (bGPdata *)ob->data;
+  const float pixfactor = 1000.0f / ((gps->thickness + gpl->line_change) * 
gpd->pixfactor);
+  apply_stroke_envelope(gps,
+mmd->spread,
+def_nr,
+(mmd->flag & GP_ENVELOPE_INVERT_VGROUP) != 0,
+mmd->thickness,
+pixfactor);
 }
 
 static void add_stroke(Object *ob,

___
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] [0d9e22d43ca] master: GPencil: New Noise modifier random in Keyframes only

2022-05-02 Thread Antonio Vazquez
Commit: 0d9e22d43ca18d8326aed33fabe3177dcf0663b8
Author: Antonio Vazquez
Date:   Mon May 2 17:28:24 2022 +0200
Branches: master
https://developer.blender.org/rB0d9e22d43ca18d8326aed33fabe3177dcf0663b8

GPencil: New Noise modifier random in Keyframes only

This is for some animation styles that usually copy and paste keyframes and 
they want avoid that both frames look equal, but they don't want noise 
randomness changes in the inbetween frames.

The patch adds a new random `Mode` option to select when the noise change.

Reviewed By: pepeland

Maniphest Tasks: T97099

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

===

M   source/blender/gpencil_modifiers/intern/MOD_gpencilnoise.c
M   source/blender/makesdna/DNA_gpencil_modifier_types.h
M   source/blender/makesrna/intern/rna_gpencil_modifier.c

===

diff --git a/source/blender/gpencil_modifiers/intern/MOD_gpencilnoise.c 
b/source/blender/gpencil_modifiers/intern/MOD_gpencilnoise.c
index fcf1e28c6da..259e62a249c 100644
--- a/source/blender/gpencil_modifiers/intern/MOD_gpencilnoise.c
+++ b/source/blender/gpencil_modifiers/intern/MOD_gpencilnoise.c
@@ -122,6 +122,8 @@ static void deformStroke(GpencilModifierData *md,
   const int def_nr = BKE_object_defgroup_name_index(ob, mmd->vgname);
   const bool invert_group = (mmd->flag & GP_NOISE_INVERT_VGROUP) != 0;
   const bool use_curve = (mmd->flag & GP_NOISE_CUSTOM_CURVE) != 0 && 
mmd->curve_intensity;
+  const int cfra = (int)DEG_get_ctime(depsgraph);
+  const bool is_keyframe = (mmd->noise_mode == GP_NOISE_RANDOM_KEYFRAME);
 
   if (!is_stroke_affected_by_modifier(ob,
   mmd->layername,
@@ -148,7 +150,13 @@ static void deformStroke(GpencilModifierData *md,
   seed += BLI_hash_string(md->name);
 
   if (mmd->flag & GP_NOISE_USE_RANDOM) {
-seed += ((int)DEG_get_ctime(depsgraph)) / mmd->step;
+if (!is_keyframe) {
+  seed += cfra / mmd->step;
+}
+else {
+  /* If change every keyframe, use the last keyframe. */
+  seed += gpf->framenum;
+}
   }
 
   /* Sanitize as it can create out of bound reads. */
@@ -302,7 +310,12 @@ static void random_panel_draw(const bContext *UNUSED(C), 
Panel *panel)
 
   uiLayoutSetActive(layout, RNA_boolean_get(ptr, "use_random"));
 
-  uiItemR(layout, ptr, "step", 0, NULL, ICON_NONE);
+  uiItemR(layout, ptr, "random_mode", 0, NULL, ICON_NONE);
+
+  const int mode = RNA_enum_get(ptr, "random_mode");
+  if (mode != GP_NOISE_RANDOM_KEYFRAME) {
+uiItemR(layout, ptr, "step", 0, NULL, ICON_NONE);
+  }
 }
 
 static void mask_panel_draw(const bContext *UNUSED(C), Panel *panel)
diff --git a/source/blender/makesdna/DNA_gpencil_modifier_types.h 
b/source/blender/makesdna/DNA_gpencil_modifier_types.h
index b0e7342c9cb..535533565dd 100644
--- a/source/blender/makesdna/DNA_gpencil_modifier_types.h
+++ b/source/blender/makesdna/DNA_gpencil_modifier_types.h
@@ -102,7 +102,8 @@ typedef struct NoiseGpencilModifierData {
   /** Noise Frequency scaling */
   float noise_scale;
   float noise_offset;
-  char _pad[4];
+  short noise_mode;
+  char _pad[2];
   /** How many frames before recalculate randoms. */
   int step;
   /** Custom index for passes. */
@@ -127,6 +128,11 @@ typedef enum eNoiseGpencil_Flag {
   GP_NOISE_INVERT_MATERIAL = (1 << 11),
 } eNoiseGpencil_Flag;
 
+typedef enum eNoiseRandomGpencil_Mode {
+  GP_NOISE_RANDOM_STEP = 0,
+  GP_NOISE_RANDOM_KEYFRAME = 1,
+} eNoiseRandomGpencil_Mode;
+
 typedef struct SubdivGpencilModifierData {
   GpencilModifierData modifier;
   /** Material for filtering. */
diff --git a/source/blender/makesrna/intern/rna_gpencil_modifier.c 
b/source/blender/makesrna/intern/rna_gpencil_modifier.c
index 1f9bb972923..da2c404ac88 100644
--- a/source/blender/makesrna/intern/rna_gpencil_modifier.c
+++ b/source/blender/makesrna/intern/rna_gpencil_modifier.c
@@ -232,6 +232,11 @@ static const EnumPropertyItem 
gpencil_envelope_mode_items[] = {
  "Add fill segments to create the envelope. Don't keep the original 
stroke"},
 {0, NULL, 0, NULL, NULL},
 };
+static const EnumPropertyItem modifier_noise_random_mode_items[] = {
+{GP_NOISE_RANDOM_STEP, "STEP", 0, "Steps", "Apply random every N steps"},
+{GP_NOISE_RANDOM_KEYFRAME, "KEYFRAME", 0, "On Keyframes", "Apply random 
every keyframe"},
+{0, NULL, 0, NULL, NULL},
+};
 #endif
 
 #ifdef RNA_RUNTIME
@@ -959,6 +964,12 @@ static void rna_def_modifier_gpencilnoise(BlenderRNA *brna)
   RNA_def_property_ui_text(prop, "Inverse Pass", "Inverse filter");
   RNA_def_property_update(prop, 0, "rna_GpencilModifier_update");
 
+  prop = RNA_def_property(srna, "random_mode", PROP_ENUM, PROP_NONE);
+  RNA_def_property_enum_sdna(prop, NULL, "noise_mode");
+  RNA_def_property_enum_items(prop, modifier_noise_random_mode_items);
+  RNA_def_property_ui_text(prop, "Mode", "How the random changes are applied");
+  

[Bf-blender-cvs] [0ebd7d41aea] temp-T97479-3d-texturing-undo: 3D Texturing: Undo.

2022-05-02 Thread Jeroen Bakker
Commit: 0ebd7d41aea0ef810d834e1da905945274b80621
Author: Jeroen Bakker
Date:   Mon May 2 16:14:34 2022 +0200
Branches: temp-T97479-3d-texturing-undo
https://developer.blender.org/rB0ebd7d41aea0ef810d834e1da905945274b80621

3D Texturing: Undo.

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

===

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 32b7047c2b0..53a45f5a8d9 100644
--- a/source/blender/editors/sculpt_paint/sculpt.c
+++ b/source/blender/editors/sculpt_paint/sculpt.c
@@ -5276,6 +5276,7 @@ static bool sculpt_stroke_test_start(bContext *C, struct 
wmOperator *op, const f
 SculptSession *ss = ob->sculpt;
 Sculpt *sd = CTX_data_tool_settings(C)->sculpt;
 Brush *brush = BKE_paint_brush(>paint);
+ToolSettings *tool_settings = CTX_data_tool_settings(C);
 
 /* NOTE: This should be removed when paint mode is available. Paint mode 
can force based on the
  * canvas it is painting on. (ref. use_sculpt_texture_paint). */
@@ -5293,7 +5294,14 @@ static bool sculpt_stroke_test_start(bContext *C, struct 
wmOperator *op, const f
 SculptCursorGeometryInfo sgi;
 SCULPT_cursor_geometry_info_update(C, , mouse, false);
 
-SCULPT_undo_push_begin(ob, sculpt_tool_name(sd));
+/* This is incorrect as this crashes other areas. We should integrate the 
image undo into the
+ * sculpt undo. (sub system?). */
+if (SCULPT_use_image_paint_brush(_settings->paint_mode, ob)) {
+  ED_image_undo_push_begin(op->type->name, PAINT_MODE_TEXTURE_3D);
+}
+else {
+  SCULPT_undo_push_begin(ob, sculpt_tool_name(sd));
+}
 
 return true;
   }
@@ -5420,22 +5428,28 @@ static void sculpt_stroke_done(const bContext *C, 
struct PaintStroke *UNUSED(str
   SCULPT_cache_free(ss->cache);
   ss->cache = NULL;
 
-  SCULPT_undo_push_end(ob);
-
-  if (brush->sculpt_tool == SCULPT_TOOL_MASK) {
-SCULPT_flush_update_done(C, ob, SCULPT_UPDATE_MASK);
-  }
-  else if (brush->sculpt_tool == SCULPT_TOOL_PAINT) {
-if (SCULPT_use_image_paint_brush(_settings->paint_mode, ob)) {
-  SCULPT_flush_update_done(C, ob, SCULPT_UPDATE_IMAGE);
-}
+  if (SCULPT_use_image_paint_brush(_settings->paint_mode, ob)) {
+ED_image_undo_push_end();
   }
   else {
-SCULPT_flush_update_done(C, ob, SCULPT_UPDATE_COORDS);
+SCULPT_undo_push_end(ob);
   }
+}
 
-  WM_event_add_notifier(C, NC_OBJECT | ND_DRAW, ob);
-  sculpt_brush_exit_tex(sd);
+if (brush->sculpt_tool == SCULPT_TOOL_MASK) {
+  SCULPT_flush_update_done(C, ob, SCULPT_UPDATE_MASK);
+}
+else if (brush->sculpt_tool == SCULPT_TOOL_PAINT) {
+  if (SCULPT_use_image_paint_brush(_settings->paint_mode, ob)) {
+SCULPT_flush_update_done(C, ob, SCULPT_UPDATE_IMAGE);
+  }
+}
+else {
+  SCULPT_flush_update_done(C, ob, SCULPT_UPDATE_COORDS);
+}
+
+WM_event_add_notifier(C, NC_OBJECT | ND_DRAW, ob);
+sculpt_brush_exit_tex(sd);
 }
 
 static int sculpt_brush_stroke_invoke(bContext *C, wmOperator *op, const 
wmEvent *event)

___
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] [b1e0be0d255] master: Merge branch 'blender-v3.2-release'

2022-05-02 Thread Bastien Montagne
Commit: b1e0be0d2553742fcceda9cfe29ebb70f26b06a1
Author: Bastien Montagne
Date:   Mon May 2 16:06:42 2022 +0200
Branches: master
https://developer.blender.org/rBb1e0be0d2553742fcceda9cfe29ebb70f26b06a1

Merge branch 'blender-v3.2-release'

===



===



___
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] [5188c14718c] blender-v3.2-release: Fix T97688: Deleting a scene with a scene strip causes the referenced scene to have zero users

2022-05-02 Thread Bastien Montagne
Commit: 5188c14718c56e4d088d3c5bb3ce3ed9ed8b7bdc
Author: Bastien Montagne
Date:   Mon May 2 15:54:15 2022 +0200
Branches: blender-v3.2-release
https://developer.blender.org/rB5188c14718c56e4d088d3c5bb3ce3ed9ed8b7bdc

Fix T97688: Deleting a scene with a scene strip causes the referenced scene to 
have zero users

Relinking code would weirdly enough allow clearing of extra/fake user
status on IDs used by affected ID, which would be utterly wrong.

Fairly unclear why this was working OK in reported case before rBa71a513def20,
could not spot any obvious reason just from reading code...

Also, in `libblock_remap_data_update_tags`, only transfer fake user
status if `new_id` is not NULL (otherwise that would have removed that
falg from `old_id`, without actually transferring it to anything).

===

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

===

diff --git a/source/blender/blenkernel/intern/lib_id_delete.c 
b/source/blender/blenkernel/intern/lib_id_delete.c
index ba5556c8b2d..904039d56c8 100644
--- a/source/blender/blenkernel/intern/lib_id_delete.c
+++ b/source/blender/blenkernel/intern/lib_id_delete.c
@@ -120,7 +120,7 @@ void BKE_id_free_ex(Main *bmain, void *idv, int flag, const 
bool use_flag_from_i
   Key *key = ((flag & LIB_ID_FREE_NO_MAIN) == 0) ? BKE_key_from_id(id) : NULL;
 
   if ((flag & LIB_ID_FREE_NO_USER_REFCOUNT) == 0) {
-BKE_libblock_relink_ex(bmain, id, NULL, NULL, 0);
+BKE_libblock_relink_ex(bmain, id, NULL, NULL, ID_REMAP_SKIP_USER_CLEAR);
   }
 
   if ((flag & LIB_ID_FREE_NO_MAIN) == 0 && key != NULL) {
@@ -264,7 +264,12 @@ static size_t id_delete(Main *bmain, const bool 
do_tagged_deletion)
ID_REMAP_FORCE_INTERNAL_RUNTIME_POINTERS));
 /* Since we removed ID from Main,
  * we also need to unlink its own other IDs usages ourself. */
-BKE_libblock_relink_ex(bmain, id, NULL, NULL, 
ID_REMAP_FORCE_INTERNAL_RUNTIME_POINTERS);
+BKE_libblock_relink_ex(
+bmain,
+id,
+NULL,
+NULL,
+(ID_REMAP_FORCE_INTERNAL_RUNTIME_POINTERS | 
ID_REMAP_SKIP_USER_CLEAR));
   }
 }
 
diff --git a/source/blender/blenkernel/intern/lib_remap.c 
b/source/blender/blenkernel/intern/lib_remap.c
index 3f40c9d2088..971db852463 100644
--- a/source/blender/blenkernel/intern/lib_remap.c
+++ b/source/blender/blenkernel/intern/lib_remap.c
@@ -409,7 +409,7 @@ static void libblock_remap_data_update_tags(ID *old_id, ID 
*new_id, void *user_d
 /* XXX We may not want to always 'transfer' fake-user from old to new id...
  * Think for now it's desired behavior though,
  * we can always add an option (flag) to control this later if needed. 
*/
-if (old_id && (old_id->flag & LIB_FAKEUSER)) {
+if (old_id != NULL && (old_id->flag & LIB_FAKEUSER) && new_id != NULL) {
   id_fake_user_clear(old_id);
   id_fake_user_set(new_id);
 }
@@ -417,7 +417,7 @@ static void libblock_remap_data_update_tags(ID *old_id, ID 
*new_id, void *user_d
 id_us_clear_real(old_id);
   }
 
-  if (new_id && (new_id->tag & LIB_TAG_INDIRECT) &&
+  if (new_id != NULL && (new_id->tag & LIB_TAG_INDIRECT) &&
   (new_id->runtime.remap.status & ID_REMAP_IS_LINKED_DIRECT)) {
 new_id->tag &= ~LIB_TAG_INDIRECT;
 new_id->flag &= ~LIB_INDIRECT_WEAK_LINK;

___
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] [263f56ba493] blender-v3.2-release: Add RNA accessor for 'extra user' ID tag,

2022-05-02 Thread Bastien Montagne
Commit: 263f56ba493ae3c9b87e4df095b158af9805d552
Author: Bastien Montagne
Date:   Mon May 2 15:53:29 2022 +0200
Branches: blender-v3.2-release
https://developer.blender.org/rB263f56ba493ae3c9b87e4df095b158af9805d552

Add RNA accessor for 'extra user' ID tag,

Not expected to be used directly by users, but very handy to have around
for investigations and debugging.

===

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

===

diff --git a/source/blender/makesrna/intern/rna_ID.c 
b/source/blender/makesrna/intern/rna_ID.c
index e2ce1f23a33..b65e08311fe 100644
--- a/source/blender/makesrna/intern/rna_ID.c
+++ b/source/blender/makesrna/intern/rna_ID.c
@@ -586,6 +586,18 @@ void rna_ID_fake_user_set(PointerRNA *ptr, bool value)
   }
 }
 
+void rna_ID_extra_user_set(PointerRNA *ptr, bool value)
+{
+  ID *id = (ID *)ptr->data;
+
+  if (value) {
+id_us_ensure_real(id);
+  }
+  else {
+id_us_clear_real(id);
+  }
+}
+
 IDProperty **rna_PropertyGroup_idprops(PointerRNA *ptr)
 {
   return (IDProperty **)>data;
@@ -1959,6 +1971,14 @@ static void rna_def_ID(BlenderRNA *brna)
   RNA_def_property_ui_icon(prop, ICON_FAKE_USER_OFF, true);
   RNA_def_property_boolean_funcs(prop, NULL, "rna_ID_fake_user_set");
 
+  prop = RNA_def_property(srna, "use_extra_user", PROP_BOOLEAN, PROP_NONE);
+  RNA_def_property_boolean_sdna(prop, NULL, "tag", LIB_TAG_EXTRAUSER);
+  RNA_def_property_ui_text(
+  prop,
+  "Extra User",
+  "Indicates wether an extra user is set or not (mainly for internal/debug 
usages)");
+  RNA_def_property_boolean_funcs(prop, NULL, "rna_ID_extra_user_set");
+
   prop = RNA_def_property(srna, "is_embedded_data", PROP_BOOLEAN, PROP_NONE);
   RNA_def_property_boolean_sdna(prop, NULL, "flag", LIB_EMBEDDED_DATA);
   RNA_def_property_clear_flag(prop, PROP_EDITABLE);

___
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] [ab5d52a6db5] master: GPencil: New Sculpt Auto masking options

2022-05-02 Thread Antonio Vazquez
Commit: ab5d52a6db559b78ffaca71c7963e48371c786ff
Author: Antonio Vazquez
Date:   Mon May 2 16:05:04 2022 +0200
Branches: master
https://developer.blender.org/rBab5d52a6db559b78ffaca71c7963e48371c786ff

GPencil: New Sculpt Auto masking options

Now it's possible to use auto masking at 3 levels:

* Stroke
* Layer
* Material

The masking options can be combined and allows to limit the effect of the 
sculpt brush.

Diff Revision: https://developer.blender.org/D14589

===

M   release/scripts/presets/keyconfig/keymap_data/blender_default.py
M   release/scripts/startup/bl_ui/properties_grease_pencil_common.py
M   release/scripts/startup/bl_ui/space_view3d.py
M   release/scripts/startup/bl_ui/space_view3d_toolbar.py
M   source/blender/editors/gpencil/gpencil_sculpt_paint.c
M   source/blender/makesdna/DNA_brush_enums.h
M   source/blender/makesrna/intern/rna_brush.c

===

diff --git a/release/scripts/presets/keyconfig/keymap_data/blender_default.py 
b/release/scripts/presets/keyconfig/keymap_data/blender_default.py
index 78620c41d1e..d7fb5673ff5 100644
--- a/release/scripts/presets/keyconfig/keymap_data/blender_default.py
+++ b/release/scripts/presets/keyconfig/keymap_data/blender_default.py
@@ -3977,6 +3977,8 @@ def km_grease_pencil_stroke_sculpt_mode(params):
 ("gpencil.active_frames_delete_all", {"type": 'DEL', "value": 'PRESS', 
"shift": True}, None),
 # Active layer
 op_menu("GPENCIL_MT_layer_active", {"type": 'Y', "value": 'PRESS'}),
+# Active material
+op_menu("GPENCIL_MT_material_active", {"type": 'U', "value": 'PRESS'}),
 # Merge Layer
 ("gpencil.layer_merge", {"type": 'M', "value": 'PRESS', "shift": True, 
"ctrl": True}, None),
 # Keyframe menu
diff --git a/release/scripts/startup/bl_ui/properties_grease_pencil_common.py 
b/release/scripts/startup/bl_ui/properties_grease_pencil_common.py
index 481753d5e79..189210d8540 100644
--- a/release/scripts/startup/bl_ui/properties_grease_pencil_common.py
+++ b/release/scripts/startup/bl_ui/properties_grease_pencil_common.py
@@ -41,17 +41,7 @@ class AnnotationDrawingToolsPanel:
 row.prop_enum(tool_settings, "annotation_stroke_placement_view2d", 
'IMAGE', text="Image")
 
 
-class GreasePencilSculptOptionsPanel:
-bl_label = "Sculpt Strokes"
-
-@classmethod
-def poll(cls, context):
-tool_settings = context.scene.tool_settings
-settings = tool_settings.gpencil_sculpt_paint
-brush = settings.brush
-tool = brush.gpencil_sculpt_tool
-
-return bool(tool in {'SMOOTH', 'RANDOMIZE'})
+class GreasePencilSculptAdvancedPanel:
 
 def draw(self, context):
 layout = self.layout
@@ -59,17 +49,21 @@ class GreasePencilSculptOptionsPanel:
 layout.use_property_decorate = False
 
 tool_settings = context.scene.tool_settings
-settings = tool_settings.gpencil_sculpt_paint
-brush = settings.brush
-gp_settings = brush.gpencil_settings
+brush = context.tool_settings.gpencil_sculpt_paint.brush
 tool = brush.gpencil_sculpt_tool
+gp_settings = brush.gpencil_settings
 
-if tool in {'SMOOTH', 'RANDOMIZE'}:
-layout.prop(gp_settings, "use_edit_position", text="Affect 
Position")
-layout.prop(gp_settings, "use_edit_strength", text="Affect 
Strength")
-layout.prop(gp_settings, "use_edit_thickness", text="Affect 
Thickness")
+col = layout.column(heading="Auto-Masking", align=True)
+col.prop(gp_settings, "use_automasking_stroke", text="Stroke")
+col.prop(gp_settings, "use_automasking_layer", text="Layer")
+col.prop(gp_settings, "use_automasking_material", text="Material")
 
-layout.prop(gp_settings, "use_edit_uv", text="Affect UV")
+if tool in {'SMOOTH', 'RANDOMIZE'}:
+col = layout.column(heading="Affect", align=True)
+col.prop(gp_settings, "use_edit_position", text="Position")
+col.prop(gp_settings, "use_edit_strength", text="Strength")
+col.prop(gp_settings, "use_edit_thickness", text="Thickness")
+col.prop(gp_settings, "use_edit_uv", text="UV")
 
 
 # GP Object Tool Settings
diff --git a/release/scripts/startup/bl_ui/space_view3d.py 
b/release/scripts/startup/bl_ui/space_view3d.py
index 69477c80c07..d1c0c6c9dac 100644
--- a/release/scripts/startup/bl_ui/space_view3d.py
+++ b/release/scripts/startup/bl_ui/space_view3d.py
@@ -109,8 +109,8 @@ class VIEW3D_HT_tool_header(Header):
 if is_valid_context:
 brush = context.tool_settings.gpencil_sculpt_paint.brush
 tool = brush.gpencil_sculpt_tool
-if tool in {'SMOOTH', 'RANDOMIZE'}:
-
layout.popover("VIEW3D_PT_tools_grease_pencil_sculpt_options")
+if tool != 

[Bf-blender-cvs] [34ff1264706] temp-T97352-3d-texturing-seam-bleeding: Renamed watertight to image_tile_user.

2022-05-02 Thread Jeroen Bakker
Commit: 34ff12647064bbc4b3b043011af14c12408fc196
Author: Jeroen Bakker
Date:   Mon May 2 13:30:25 2022 +0200
Branches: temp-T97352-3d-texturing-seam-bleeding
https://developer.blender.org/rB34ff12647064bbc4b3b043011af14c12408fc196

Renamed watertight to image_tile_user.

===

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

===

diff --git a/source/blender/blenkernel/intern/pbvh_pixels_seams.cc 
b/source/blender/blenkernel/intern/pbvh_pixels_seams.cc
index 379d47ba69a..dac1398d411 100644
--- a/source/blender/blenkernel/intern/pbvh_pixels_seams.cc
+++ b/source/blender/blenkernel/intern/pbvh_pixels_seams.cc
@@ -246,11 +246,11 @@ Vector create_tile_bitmap(const PBVH ,
 Bitmaps create_tile_bitmap(const PBVH , Image , ImageUser 
_user)
 {
   Bitmaps result;
-  ImageUser watertight = image_user;
+  ImageUser image_tile_user = image_user;
   LISTBASE_FOREACH (ImageTile *, tile_data, ) {
 image::ImageTileWrapper image_tile(tile_data);
-watertight.tile = image_tile.get_tile_number();
-ImBuf *image_buffer = BKE_image_acquire_ibuf(, , nullptr);
+image_tile_user.tile = image_tile.get_tile_number();
+ImBuf *image_buffer = BKE_image_acquire_ibuf(, _tile_user, 
nullptr);
 if (image_buffer == nullptr) {
   continue;
 }

___
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] [87ea1d1d634] temp-T97352-3d-texturing-seam-bleeding: Merge branch 'master' into temp-T97352-3d-texturing-seam-bleeding

2022-05-02 Thread Jeroen Bakker
Commit: 87ea1d1d634da6278f6c13c32cc1196d959d5c42
Author: Jeroen Bakker
Date:   Mon May 2 09:00:02 2022 +0200
Branches: temp-T97352-3d-texturing-seam-bleeding
https://developer.blender.org/rB87ea1d1d634da6278f6c13c32cc1196d959d5c42

Merge branch 'master' into temp-T97352-3d-texturing-seam-bleeding

===



===



___
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] [9ce9cf5a315] temp-T97352-3d-texturing-seam-bleeding: Make seamfix distance as a user controlled setting per image.

2022-05-02 Thread Jeroen Bakker
Commit: 9ce9cf5a31519d149a00a21891e3dbd575d0cdfd
Author: Jeroen Bakker
Date:   Mon May 2 14:33:52 2022 +0200
Branches: temp-T97352-3d-texturing-seam-bleeding
https://developer.blender.org/rB9ce9cf5a31519d149a00a21891e3dbd575d0cdfd

Make seamfix distance as a user controlled setting per image.

===

M   source/blender/blenkernel/intern/paint_canvas.cc
M   source/blender/blenkernel/intern/pbvh_pixels_seams.cc
M   source/blender/blenloader/intern/versioning_300.c
M   source/blender/editors/space_image/image_buttons.c
M   source/blender/makesdna/DNA_image_defaults.h
M   source/blender/makesdna/DNA_image_types.h
M   source/blender/makesrna/intern/rna_image.c

===

diff --git a/source/blender/blenkernel/intern/paint_canvas.cc 
b/source/blender/blenkernel/intern/paint_canvas.cc
index b72418d88c0..f06b5222cd2 100644
--- a/source/blender/blenkernel/intern/paint_canvas.cc
+++ b/source/blender/blenkernel/intern/paint_canvas.cc
@@ -113,6 +113,7 @@ char *BKE_paint_canvas_key_get(struct PaintModeSettings 
*settings, struct Object
   Image *image;
   ImageUser *image_user;
   if (BKE_paint_canvas_image_get(settings, ob, , _user)) {
+ss << ",SEAM_DIST:" << image->seamfix_distance;
 ImageUser tile_user = *image_user;
 LISTBASE_FOREACH (ImageTile *, image_tile, >tiles) {
   tile_user.tile = image_tile->tile_number;
diff --git a/source/blender/blenkernel/intern/pbvh_pixels_seams.cc 
b/source/blender/blenkernel/intern/pbvh_pixels_seams.cc
index c2d68a3a380..c598a10f17c 100644
--- a/source/blender/blenkernel/intern/pbvh_pixels_seams.cc
+++ b/source/blender/blenkernel/intern/pbvh_pixels_seams.cc
@@ -18,9 +18,6 @@
 
 namespace blender::bke::pbvh::pixels {
 
-/* Distance between a pixel and its edge that will be fixed. Value is in 
pixels space. */
-constexpr float SEAMFIX_EDGE_DISTANCE = 3.5f;
-
 struct EdgeLoop {
   /** Loop indexes that form an edge. */
   int l[2];
@@ -377,7 +374,8 @@ static void build_fixes(PBVH ,
 const MLoopUV _a_2,
 const MLoopUV _b_1,
 const MLoopUV _b_2,
-const float scale_factor)
+const float scale_factor,
+const float seamfix_distance)
 {
   if (uvbounds.xmax < 0 || uvbounds.ymax < 0 || uvbounds.xmin > 
bitmap.resolution.x ||
   uvbounds.ymin > bitmap.resolution.y) {
@@ -412,7 +410,7 @@ static void build_fixes(PBVH ,
 
   /* Distance to the edge in pixel space. */
   float distance_to_edge = len_v2v2(closest_coord, uv_coord);
-  if (distance_to_edge > SEAMFIX_EDGE_DISTANCE) {
+  if (distance_to_edge > seamfix_distance) {
 continue;
   }
 
@@ -445,7 +443,8 @@ static void build_fixes(PBVH ,
 static void build_fixes(PBVH ,
 const Vector> ,
 Bitmaps ,
-const MLoopUV *ldata_uv)
+const MLoopUV *ldata_uv,
+const float seamfix_distance)
 {
   for (const std::pair  : connected) {
 // determine bounding rect in uv space + margin of 1;
@@ -477,8 +476,16 @@ static void build_fixes(PBVH ,
 bitmap.resolution[1] +
 MARGIN;
 
-  build_fixes(
-  pbvh, bitmaps, bitmap, uvbounds_i, luv_a_1, luv_a_2, luv_b_1, 
luv_b_2, scale_factor);
+  build_fixes(pbvh,
+  bitmaps,
+  bitmap,
+  uvbounds_i,
+  luv_a_1,
+  luv_a_2,
+  luv_b_1,
+  luv_b_2,
+  scale_factor,
+  seamfix_distance);
 }
   }
 }
@@ -490,8 +497,12 @@ static void build_fixes(PBVH ,
 /** \name Build fixes for unconnected edges.
  * \{ */
 
-static void build_fixes(
-PBVH , Bitmap , const rcti , const MLoopUV _1, 
const MLoopUV _2)
+static void build_fixes(PBVH ,
+Bitmap ,
+const rcti ,
+const MLoopUV _1,
+const MLoopUV _2,
+const float seamfix_distance)
 {
   if (uvbounds.xmax < 0 || uvbounds.ymax < 0 || uvbounds.xmin > 
bitmap.resolution.x ||
   uvbounds.ymin > bitmap.resolution.y) {
@@ -523,7 +534,7 @@ static void build_fixes(
   float2 closest_coord(closest_point.x * bitmap.resolution.x,
closest_point.y * bitmap.resolution.y);
   float distance_to_edge = len_v2v2(uv_coord, closest_coord);
-  if (distance_to_edge > SEAMFIX_EDGE_DISTANCE) {
+  if (distance_to_edge > seamfix_distance) {
 continue;
   }
 
@@ -550,7 +561,8 @@ static void build_fixes(
 static void build_fixes(PBVH ,
 const Vector ,
 Bitmaps ,
-const MLoopUV *ldata_uv)
+  

[Bf-blender-cvs] [cd277c94e71] temp-T97352-3d-texturing-seam-bleeding: Merge branch 'master' into temp-T97352-3d-texturing-seam-bleeding

2022-05-02 Thread Jeroen Bakker
Commit: cd277c94e71130951a106f06c84c8541d2aaf011
Author: Jeroen Bakker
Date:   Mon May 2 12:25:59 2022 +0200
Branches: temp-T97352-3d-texturing-seam-bleeding
https://developer.blender.org/rBcd277c94e71130951a106f06c84c8541d2aaf011

Merge branch 'master' into temp-T97352-3d-texturing-seam-bleeding

===



===



___
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] [0e5a73fe8a3] temp-T97352-3d-texturing-seam-bleeding: Remove limit check in uv space.

2022-05-02 Thread Jeroen Bakker
Commit: 0e5a73fe8a324f504cda70ebb1d8f6615a7b6b3a
Author: Jeroen Bakker
Date:   Mon May 2 09:27:50 2022 +0200
Branches: temp-T97352-3d-texturing-seam-bleeding
https://developer.blender.org/rB0e5a73fe8a324f504cda70ebb1d8f6615a7b6b3a

Remove limit check in uv space.

===

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

===

diff --git a/source/blender/blenkernel/intern/pbvh_pixels_seams.cc 
b/source/blender/blenkernel/intern/pbvh_pixels_seams.cc
index 9aada456c77..77b1530d00f 100644
--- a/source/blender/blenkernel/intern/pbvh_pixels_seams.cc
+++ b/source/blender/blenkernel/intern/pbvh_pixels_seams.cc
@@ -46,10 +46,9 @@ bool share_uv(const MLoopUV *ldata_uv, EdgeLoop , 
EdgeLoop )
   const float2 _1_b = ldata_uv[edge1.l[1]].uv;
   const float2 _2_a = ldata_uv[edge2.l[0]].uv;
   const float2 _2_b = ldata_uv[edge2.l[1]].uv;
-  const float limit = 0.0001f;
 
-  return (compare_v2v2(uv_1_a, uv_2_a, limit) && compare_v2v2(uv_1_b, uv_2_b, 
limit)) ||
- (compare_v2v2(uv_1_a, uv_2_b, limit) && compare_v2v2(uv_1_b, uv_2_a, 
limit));
+  return (equals_v2v2(uv_1_a, uv_2_a) && equals_v2v2(uv_1_b, uv_2_b)) ||
+ (equals_v2v2(uv_1_a, uv_2_b) && equals_v2v2(uv_1_b, uv_2_a));
 }
 
 /** Make a list of connected and unconnected edgeloops that require UV Seam 
fixes. */
@@ -361,7 +360,8 @@ static void build_fixes(PBVH ,
* difference.
*/
   float2 other_closest_point;
-  interp_v2_v2v2(other_closest_point, luv_b_1.uv, luv_b_2.uv, lambda);
+  // How should we handle the winding order...
+  interp_v2_v2v2(other_closest_point, luv_b_2.uv, luv_b_1.uv, lambda);
 
   /*
* Find the bitmap containing the information of the tile containing the

___
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] [e80c6c48aaf] temp-T97352-3d-texturing-seam-bleeding: Add early exits to skip bitmaps.

2022-05-02 Thread Jeroen Bakker
Commit: e80c6c48aaf6f934172ea2ce1b239e486d003fec
Author: Jeroen Bakker
Date:   Mon May 2 13:34:42 2022 +0200
Branches: temp-T97352-3d-texturing-seam-bleeding
https://developer.blender.org/rBe80c6c48aaf6f934172ea2ce1b239e486d003fec

Add early exits to skip bitmaps.

===

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

===

diff --git a/source/blender/blenkernel/intern/pbvh_pixels_seams.cc 
b/source/blender/blenkernel/intern/pbvh_pixels_seams.cc
index dac1398d411..c2d68a3a380 100644
--- a/source/blender/blenkernel/intern/pbvh_pixels_seams.cc
+++ b/source/blender/blenkernel/intern/pbvh_pixels_seams.cc
@@ -379,6 +379,11 @@ static void build_fixes(PBVH ,
 const MLoopUV _b_2,
 const float scale_factor)
 {
+  if (uvbounds.xmax < 0 || uvbounds.ymax < 0 || uvbounds.xmin > 
bitmap.resolution.x ||
+  uvbounds.ymin > bitmap.resolution.y) {
+return;
+  }
+
   for (int v = uvbounds.ymin; v <= uvbounds.ymax; v++) {
 for (int u = uvbounds.xmin; u <= uvbounds.xmax; u++) {
   if (u < 0 || u >= bitmap.resolution.x || v < 0 || v >= 
bitmap.resolution.y) {
@@ -488,6 +493,11 @@ static void build_fixes(PBVH ,
 static void build_fixes(
 PBVH , Bitmap , const rcti , const MLoopUV _1, 
const MLoopUV _2)
 {
+  if (uvbounds.xmax < 0 || uvbounds.ymax < 0 || uvbounds.xmin > 
bitmap.resolution.x ||
+  uvbounds.ymin > bitmap.resolution.y) {
+return;
+  }
+
   for (int v = uvbounds.ymin; v <= uvbounds.ymax; v++) {
 for (int u = uvbounds.xmin; u <= uvbounds.xmax; u++) {
   if (u < 0 || u >= bitmap.resolution[0] || v < 0 || v >= 
bitmap.resolution[1]) {

___
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] [f7c0638258d] temp-T97352-3d-texturing-seam-bleeding: Separate projection code.

2022-05-02 Thread Jeroen Bakker
Commit: f7c0638258d1dfa2a32d742358a53b03b7e95d55
Author: Jeroen Bakker
Date:   Mon May 2 10:53:47 2022 +0200
Branches: temp-T97352-3d-texturing-seam-bleeding
https://developer.blender.org/rBf7c0638258d1dfa2a32d742358a53b03b7e95d55

Separate projection code.

===

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

===

diff --git a/source/blender/blenkernel/intern/pbvh_pixels_seams.cc 
b/source/blender/blenkernel/intern/pbvh_pixels_seams.cc
index 77b1530d00f..ac53f11eb74 100644
--- a/source/blender/blenkernel/intern/pbvh_pixels_seams.cc
+++ b/source/blender/blenkernel/intern/pbvh_pixels_seams.cc
@@ -313,6 +313,53 @@ static void add_seam_fix(PBVHNode ,
 /** \name Build fixes for connected edges.
  * \{ */
 
+struct Projection {
+  const Bitmap *bitmap;
+  int2 pixel;
+  PixelInfo pixel_info;
+  bool is_valid;
+};
+
+/*
+ * Project the point over onto the connected UV space. Taking into account the 
scale
+ * difference.
+ */
+static void find_projection_source(const Bitmaps ,
+   const float distance_to_edge,
+   const float lambda,
+   const MLoopUV ,
+   const MLoopUV ,
+   const float scale_factor,
+   Projection _projection)
+{
+  r_projection.is_valid = false;
+
+  float2 closest_point;
+  interp_v2_v2v2(closest_point, uv1.uv, uv2.uv, lambda);
+
+  r_projection.bitmap = bitmaps.find_containing_uv(closest_point);
+  if (r_projection.bitmap == nullptr) {
+return;
+  }
+
+  closest_point.x -= r_projection.bitmap->image_tile.get_tile_x_offset();
+  closest_point.y -= r_projection.bitmap->image_tile.get_tile_y_offset();
+
+  float2 direction;
+  sub_v2_v2v2(direction, uv2.uv, uv1.uv);
+
+  float2 perpedicular(direction.y, -direction.x);
+  normalize_v2(perpedicular);
+  perpedicular.x /= r_projection.bitmap->resolution.x;
+  perpedicular.y /= r_projection.bitmap->resolution.y;
+  float2 projected_coord = closest_point + perpedicular * distance_to_edge * 
scale_factor;
+  projected_coord.x *= r_projection.bitmap->resolution.x;
+  projected_coord.y *= r_projection.bitmap->resolution.y;
+  r_projection.pixel = find_source_pixel(*r_projection.bitmap, 
projected_coord);
+  r_projection.pixel_info = 
r_projection.bitmap->get_pixel_info(r_projection.pixel);
+  r_projection.is_valid = r_projection.pixel_info.is_extracted();
+}
+
 static void build_fixes(PBVH ,
 Bitmaps ,
 Bitmap ,
@@ -355,65 +402,25 @@ static void build_fixes(PBVH ,
 continue;
   }
 
-  /*
-   * Project the point over onto the connected UV space. Taking into 
account the scale
-   * difference.
-   */
-  float2 other_closest_point;
-  // How should we handle the winding order...
-  interp_v2_v2v2(other_closest_point, luv_b_2.uv, luv_b_1.uv, lambda);
-
-  /*
-   * Find the bitmap containing the information of the tile containing the
-   * 'other_closest_point`. This will fail for edges that are part of 
multiple tiles, but that
-   * should already be a problem during rendering.
-   */
-  const Bitmap *src_bitmap = 
bitmaps.find_containing_uv(other_closest_point);
-  if (src_bitmap == nullptr) {
-continue;
-  }
-
-  other_closest_point.x -= src_bitmap->image_tile.get_tile_x_offset();
-  other_closest_point.y -= src_bitmap->image_tile.get_tile_y_offset();
-
-  float2 direction_b;
-  sub_v2_v2v2(direction_b, luv_b_2.uv, luv_b_1.uv);
-
-  int2 source_pixel(0, 0);
-  PixelInfo src_pixel_info;
-  float2 perpedicular_b(direction_b.y, -direction_b.x);
-  normalize_v2(perpedicular_b);
-  perpedicular_b.x /= src_bitmap->resolution.x;
-  perpedicular_b.y /= src_bitmap->resolution.y;
-  float2 projected_coord_a = other_closest_point +
- perpedicular_b * distance_to_edge * 
scale_factor;
-  projected_coord_a.x *= src_bitmap->resolution.x;
-  projected_coord_a.y *= src_bitmap->resolution.y;
-  source_pixel = find_source_pixel(*src_bitmap, projected_coord_a);
-  src_pixel_info = src_bitmap->get_pixel_info(source_pixel);
-
-  /* When no solution found check the other winding order. */
-  if (!src_pixel_info.is_extracted()) {
-float2 projected_coord_b = other_closest_point -
-   perpedicular_b * distance_to_edge * 
scale_factor;
-projected_coord_b.x *= src_bitmap->resolution.x;
-projected_coord_b.y *= src_bitmap->resolution.y;
-source_pixel = find_source_pixel(*src_bitmap, projected_coord_b);
-src_pixel_info = src_bitmap->get_pixel_info(source_pixel);
+  Projection solution;
+  find_projection_source(
+  bitmaps, 

[Bf-blender-cvs] [4ce7dab4c6f] temp-T97352-3d-texturing-seam-bleeding: Fix some artifacts by checking the winding order.

2022-05-02 Thread Jeroen Bakker
Commit: 4ce7dab4c6fb0fd46ff1ab982afe328a5ff9a8dc
Author: Jeroen Bakker
Date:   Mon May 2 13:28:59 2022 +0200
Branches: temp-T97352-3d-texturing-seam-bleeding
https://developer.blender.org/rB4ce7dab4c6fb0fd46ff1ab982afe328a5ff9a8dc

Fix some artifacts by checking the winding order.

===

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

===

diff --git a/source/blender/blenkernel/intern/pbvh_pixels_seams.cc 
b/source/blender/blenkernel/intern/pbvh_pixels_seams.cc
index ac53f11eb74..379d47ba69a 100644
--- a/source/blender/blenkernel/intern/pbvh_pixels_seams.cc
+++ b/source/blender/blenkernel/intern/pbvh_pixels_seams.cc
@@ -37,6 +37,8 @@ struct EdgeCheck {
   EdgeCheckFlag flag;
   EdgeLoop first;
   EdgeLoop second;
+  /* First vertex index of the first edge loop to determine winding order 
switching. */
+  int first_v;
 };
 
 /** Do the two given EdgeLoops share the same uv coordinates. */
@@ -72,16 +74,24 @@ void find_edges_that_need_fixing(const Mesh *mesh,
   if (!BLI_edgehash_ensure_p(eh, prev_mloop.v, mloop.v, _ptr)) {
 EdgeCheck *value = MEM_cnew(__func__);
 value->flag = EdgeCheckFlag::Unconnected;
-value->first.l[0] = min_ii(prev_l, current_l);
-value->first.l[1] = max_ii(prev_l, current_l);
+value->first.l[0] = prev_l;
+value->first.l[1] = current_l;
+value->first_v = prev_mloop.v;
 *value_ptr = value;
   }
   else {
 EdgeCheck *value = static_cast(*value_ptr);
 if (value->flag == EdgeCheckFlag::Unconnected) {
   value->flag = EdgeCheckFlag::Connected;
-  value->second.l[0] = min_ii(prev_l, current_l);
-  value->second.l[1] = max_ii(prev_l, current_l);
+  /* Switch winding order to match the first edge. */
+  if (prev_mloop.v == value->first_v) {
+value->second.l[0] = prev_l;
+value->second.l[1] = current_l;
+  }
+  else {
+value->second.l[0] = current_l;
+value->second.l[1] = prev_l;
+  }
 }
   }
 
@@ -99,7 +109,6 @@ void find_edges_that_need_fixing(const Mesh *mesh,
 break;
   }
   case EdgeCheckFlag::Connected: {
-// check for uv space to add to r_connected
 if (!share_uv(ldata_uv, value->first, value->second)) {
   r_connected.append(std::pair(value->first, 
value->second));
   r_connected.append(std::pair(value->second, 
value->first));
@@ -407,7 +416,7 @@ static void build_fixes(PBVH ,
   bitmaps, distance_to_edge, lambda, luv_b_1, luv_b_2, scale_factor, 
solution);
   if (!solution.is_valid) {
 find_projection_source(
-bitmaps, distance_to_edge, lambda, luv_b_1, luv_b_2, scale_factor, 
solution);
+bitmaps, distance_to_edge, 1.0f - lambda, luv_b_2, luv_b_1, 
scale_factor, solution);
   }
   if (!solution.is_valid) {
 /* No solution found skip this pixel. */

___
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] [e07ac34b3fe] master: Merge branch 'blender-v3.2-release'

2022-05-02 Thread Jeroen Bakker
Commit: e07ac34b3fefced77e464ea2d9af318ae72bb125
Author: Jeroen Bakker
Date:   Mon May 2 12:21:15 2022 +0200
Branches: master
https://developer.blender.org/rBe07ac34b3fefced77e464ea2d9af318ae72bb125

Merge branch 'blender-v3.2-release'

===



===



___
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] [3d5f5c2d9a5] blender-v3.2-release: Color Attributes: Add initial fill color option

2022-05-02 Thread Ethan-Hall
Commit: 3d5f5c2d9a5f1c04ea4d8722bfcb78ea7eedfa8b
Author: Ethan-Hall
Date:   Mon May 2 12:18:04 2022 +0200
Branches: blender-v3.2-release
https://developer.blender.org/rB3d5f5c2d9a5f1c04ea4d8722bfcb78ea7eedfa8b

Color Attributes: Add initial fill color option

This patch adds allows the user to select the initial fill color when
adding a new color attribute layer.

---
{F13035372}

Reviewed By: JulienKaspar, joeedh

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

===

M   source/blender/blenkernel/BKE_paint.h
M   source/blender/editors/geometry/geometry_attributes.cc
M   source/blender/editors/sculpt_paint/paint_vertex.cc

===

diff --git a/source/blender/blenkernel/BKE_paint.h 
b/source/blender/blenkernel/BKE_paint.h
index f0488e84091..0e976f04dd1 100644
--- a/source/blender/blenkernel/BKE_paint.h
+++ b/source/blender/blenkernel/BKE_paint.h
@@ -730,6 +730,21 @@ enum {
   SCULPT_MASK_LAYER_CALC_LOOP = (1 << 1),
 };
 
+/* paint_vertex.cc */
+
+/**
+ * Fills the object's active color atribute layer with the fill color.
+ *
+ * \param[in] ob: The object.
+ * \param[in] fill_color: The fill color.
+ * \param[in] only_selected: Limit the fill to selected faces or vertices.
+ *
+ * \return #true if successful.
+ */
+bool BKE_object_attributes_active_color_fill(struct Object *ob,
+ const float fill_color[4],
+ bool only_selected);
+
 /* paint_canvas.cc */
 
 /**
diff --git a/source/blender/editors/geometry/geometry_attributes.cc 
b/source/blender/editors/geometry/geometry_attributes.cc
index 7bba297af8c..05f9e19da71 100644
--- a/source/blender/editors/geometry/geometry_attributes.cc
+++ b/source/blender/editors/geometry/geometry_attributes.cc
@@ -18,6 +18,7 @@
 #include "BKE_lib_id.h"
 #include "BKE_mesh.h"
 #include "BKE_object_deform.h"
+#include "BKE_paint.h"
 #include "BKE_report.h"
 
 #include "RNA_access.h"
@@ -221,6 +222,9 @@ static int geometry_color_attribute_add_exec(bContext *C, 
wmOperator *op)
   AttributeDomain domain = (AttributeDomain)RNA_enum_get(op->ptr, "domain");
   CustomDataLayer *layer = BKE_id_attribute_new(id, name, type, domain, 
op->reports);
 
+  float color[4];
+  RNA_float_get_array(op->ptr, "color", color);
+
   if (layer == nullptr) {
 return OPERATOR_CANCELLED;
   }
@@ -231,6 +235,8 @@ static int geometry_color_attribute_add_exec(bContext *C, 
wmOperator *op)
 BKE_id_attributes_render_color_set(id, layer);
   }
 
+  BKE_object_attributes_active_color_fill(ob, color, false);
+
   DEG_id_tag_update(id, ID_RECALC_GEOMETRY);
   WM_main_add_notifier(NC_GEOM | ND_DATA, id);
 
@@ -353,6 +359,7 @@ static void geometry_color_attribute_add_ui(bContext 
*UNUSED(C), wmOperator *op)
   uiItemR(layout, op->ptr, "name", 0, nullptr, ICON_NONE);
   uiItemR(layout, op->ptr, "domain", UI_ITEM_R_EXPAND, nullptr, ICON_NONE);
   uiItemR(layout, op->ptr, "data_type", UI_ITEM_R_EXPAND, nullptr, ICON_NONE);
+  uiItemR(layout, op->ptr, "color", 0, nullptr, ICON_NONE);
 }
 
 void GEOMETRY_OT_color_attribute_add(wmOperatorType *ot)
@@ -399,6 +406,13 @@ void GEOMETRY_OT_color_attribute_add(wmOperatorType *ot)
   CD_PROP_COLOR,
   "Data Type",
   "Type of data stored in attribute");
+
+  static float default_color[4] = {0.0f, 0.0f, 0.0f, 1.0f};
+
+  prop = RNA_def_float_color(
+  ot->srna, "color", 4, NULL, 0.0f, FLT_MAX, "Color", "Default fill 
color", 0.0f, 1.0f);
+  RNA_def_property_subtype(prop, PROP_COLOR_GAMMA);
+  RNA_def_property_float_array_default(prop, default_color);
 }
 
 static int geometry_color_attribute_set_render_exec(bContext *C, wmOperator 
*op)
diff --git a/source/blender/editors/sculpt_paint/paint_vertex.cc 
b/source/blender/editors/sculpt_paint/paint_vertex.cc
index a474767b1a1..747295f3de0 100644
--- a/source/blender/editors/sculpt_paint/paint_vertex.cc
+++ b/source/blender/editors/sculpt_paint/paint_vertex.cc
@@ -4144,43 +4144,77 @@ static bool vertex_color_set(Object *ob, ColorPaint4f 
paintcol_in, Color *color_
   return true;
 }
 
-static int vertex_color_set_exec(bContext *C, wmOperator *UNUSED(op))
+/**
+ * Fills the object's active color atribute layer with the fill color.
+ *
+ * \param[in] ob: The object.
+ * \param[in] fill_color: The fill color.
+ * \param[in] only_selected: Limit the fill to selected faces or vertices.
+ *
+ * \return #true if successful.
+ */
+static bool paint_object_attributes_active_color_fill_ex(Object *ob,
+ ColorPaint4f 
fill_color,
+ bool only_selected = 
true)
 {
-  Scene *scene = CTX_data_scene(C);
-  Object *obact = CTX_data_active_object(C);
-  Mesh *me = BKE_object_get_original_mesh(obact);
-
-  // uint paintcol = 

[Bf-blender-cvs] [38394e1a321] blender-v3.2-release: GPU: Remove OCIO workaround for Apple.

2022-05-02 Thread Jeroen Bakker
Commit: 38394e1a321ef0d139c0040cbd36c7627276c28e
Author: Jeroen Bakker
Date:   Mon May 2 12:15:21 2022 +0200
Branches: blender-v3.2-release
https://developer.blender.org/rB38394e1a321ef0d139c0040cbd36c7627276c28e

GPU: Remove OCIO workaround for Apple.

OCIO shader was ported to use GPUShaderCreateInfo a while ago. That
made this workaround not needed anymore.

Best to remove it before the release.

===

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

===

diff --git a/source/blender/gpu/intern/gpu_shader_builtin.c 
b/source/blender/gpu/intern/gpu_shader_builtin.c
index 1a3215f1bb5..13238a03688 100644
--- a/source/blender/gpu/intern/gpu_shader_builtin.c
+++ b/source/blender/gpu/intern/gpu_shader_builtin.c
@@ -185,14 +185,7 @@ static const GPUShaderStages 
builtin_shader_stages[GPU_SHADER_BUILTIN_LEN] = {
 [GPU_SHADER_2D_IMAGE_OVERLAYS_MERGE] =
 {
 .name = "GPU_SHADER_2D_IMAGE_OVERLAYS_MERGE",
-#ifdef __APPLE__
-/* GPUShaderCreateInfo is disabled on MacOS due to mismatch with 
OCIO shader. See
- * T95052 for more details. */
-.vert = datatoc_gpu_shader_2D_image_vert_glsl,
-.frag = datatoc_gpu_shader_image_overlays_merge_frag_glsl,
-#else
 .create_info = "gpu_shader_2D_image_overlays_merge",
-#endif
 },
 [GPU_SHADER_2D_IMAGE_OVERLAYS_STEREO_MERGE] =
 {

___
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] [b54c6a20aaf] master: Curves: fix brush position is not under mouse cursor

2022-05-02 Thread Jacques Lucke
Commit: b54c6a20aaf58136e2447e6fdd939e4052256115
Author: Jacques Lucke
Date:   Mon May 2 11:36:27 2022 +0200
Branches: master
https://developer.blender.org/rBb54c6a20aaf58136e2447e6fdd939e4052256115

Curves: fix brush position is not under mouse cursor

This was mostly noticable in the case of the Delete brush, when
clicking somewhere in empty space. It used the closest point on
a curve as brush position.

===

M   source/blender/editors/sculpt_paint/curves_sculpt_3d_brush.cc

===

diff --git a/source/blender/editors/sculpt_paint/curves_sculpt_3d_brush.cc 
b/source/blender/editors/sculpt_paint/curves_sculpt_3d_brush.cc
index 945bb09c0c6..3d2d4f8527e 100644
--- a/source/blender/editors/sculpt_paint/curves_sculpt_3d_brush.cc
+++ b/source/blender/editors/sculpt_paint/curves_sculpt_3d_brush.cc
@@ -116,8 +116,11 @@ static std::optional 
find_curves_brush_position(const CurvesGeometry 
 
 const float distance_sq_re = math::distance_squared(brush_pos_re, 
closest_re);
 
+float3 brush_position_cu;
+closest_to_line_segment_v3(brush_position_cu, closest_cu, 
ray_start_cu, ray_end_cu);
+
 BrushPositionCandidate candidate;
-candidate.position_cu = closest_cu;
+candidate.position_cu = brush_position_cu;
 candidate.depth_sq_cu = depth_sq_cu;
 candidate.distance_sq_re = distance_sq_re;

___
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] [4f3b5625068] master: Revert "Blender 3.2 - Beta"

2022-05-02 Thread Thomas Dinges
Commit: 4f3b562506863bc9f53f700a3c5e92a9e0d9cfb0
Author: Thomas Dinges
Date:   Mon May 2 11:06:21 2022 +0200
Branches: master
https://developer.blender.org/rB4f3b562506863bc9f53f700a3c5e92a9e0d9cfb0

Revert "Blender 3.2 - Beta"

This reverts commit da46ed9116cd3a82f440cfec180728f0b3871d9c.

===

M   build_files/build_environment/cmake/download.cmake
M   build_files/config/pipeline_config.yaml
M   source/blender/blenkernel/BKE_blender_version.h

===

diff --git a/build_files/build_environment/cmake/download.cmake 
b/build_files/build_environment/cmake/download.cmake
index 92dea453133..80c53d05c28 100644
--- a/build_files/build_environment/cmake/download.cmake
+++ b/build_files/build_environment/cmake/download.cmake
@@ -1,7 +1,7 @@
 # SPDX-License-Identifier: GPL-2.0-or-later
 
 ## Update and uncomment this in the release branch
-set(BLENDER_VERSION 3.2)
+# set(BLENDER_VERSION 3.1)
 
 function(download_source dep)
   set(TARGET_FILE ${${dep}_FILE})
diff --git a/build_files/config/pipeline_config.yaml 
b/build_files/config/pipeline_config.yaml
index d1f1fe78d21..8222f2ff0b9 100644
--- a/build_files/config/pipeline_config.yaml
+++ b/build_files/config/pipeline_config.yaml
@@ -5,38 +5,38 @@
 update-code:
 git:
 submodules:
--   branch: blender-v3.2-release
+-   branch: master
 commit_id: HEAD
 path: release/scripts/addons
--   branch: blender-v3.2-release
+-   branch: master
 commit_id: HEAD
 path: release/scripts/addons_contrib
--   branch: blender-v3.2-release
+-   branch: master
 commit_id: HEAD
 path: release/datafiles/locale
--   branch: blender-v3.2-release
+-   branch: master
 commit_id: HEAD
 path: source/tools
 svn:
 libraries:
 darwin-arm64:
-branch: tags/blender-3.2-release
+branch: trunk
 commit_id: HEAD
 path: lib/darwin_arm64
 darwin-x86_64:
-branch: tags/blender-3.2-release
+branch: trunk
 commit_id: HEAD
 path: lib/darwin
 linux-x86_64:
-branch: tags/blender-3.2-release
+branch: trunk
 commit_id: HEAD
 path: lib/linux_centos7_x86_64
 windows-amd64:
-branch: tags/blender-3.2-release
+branch: trunk
 commit_id: HEAD
 path: lib/win64_vc15
 tests:
-branch: tags/blender-3.2-release
+branch: trunk
 commit_id: HEAD
 path: lib/tests
 benchmarks:
diff --git a/source/blender/blenkernel/BKE_blender_version.h 
b/source/blender/blenkernel/BKE_blender_version.h
index 2ae7fb2d9c5..ab13a2e85d0 100644
--- a/source/blender/blenkernel/BKE_blender_version.h
+++ b/source/blender/blenkernel/BKE_blender_version.h
@@ -21,7 +21,7 @@ extern "C" {
 /* Blender patch version for bugfix releases. */
 #define BLENDER_VERSION_PATCH 0
 /** Blender release cycle stage: alpha/beta/rc/release. */
-#define BLENDER_VERSION_CYCLE beta
+#define BLENDER_VERSION_CYCLE alpha
 
 /* Blender file format version. */
 #define BLENDER_FILE_VERSION BLENDER_VERSION

___
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] [951fae35787] master: Revert "Blender 3.2 splashscreen"

2022-05-02 Thread Thomas Dinges
Commit: 951fae35787e416aedcdb5e1d67008afe9dbc17a
Author: Thomas Dinges
Date:   Mon May 2 11:06:38 2022 +0200
Branches: master
https://developer.blender.org/rB951fae35787e416aedcdb5e1d67008afe9dbc17a

Revert "Blender 3.2 splashscreen"

This reverts commit d1cbfc81bb900c82098a7a5076890fd200069cae.

===

M   release/datafiles/locale
M   release/datafiles/splash.png

===

diff --git a/release/datafiles/locale b/release/datafiles/locale
index 44cf4b4bf74..2e715d54178 16
--- a/release/datafiles/locale
+++ b/release/datafiles/locale
@@ -1 +1 @@
-Subproject commit 44cf4b4bf74f22fff55941e39cebeacec68a5a80
+Subproject commit 2e715d54178e24ea463c7bc0cdeb27c682c39ecf
diff --git a/release/datafiles/splash.png b/release/datafiles/splash.png
index 332ee39849e..eb1250cf5a5 100644
Binary files a/release/datafiles/splash.png and b/release/datafiles/splash.png 
differ

___
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] [0c80a0acd87] master: Merge branch 'blender-v3.2-release'

2022-05-02 Thread Thomas Dinges
Commit: 0c80a0acd87cf3f641441d210e794df725f8d834
Author: Thomas Dinges
Date:   Mon May 2 11:05:53 2022 +0200
Branches: master
https://developer.blender.org/rB0c80a0acd87cf3f641441d210e794df725f8d834

Merge branch 'blender-v3.2-release'

===



===



___
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] [d1cbfc81bb9] blender-v3.2-release: Blender 3.2 splashscreen

2022-05-02 Thread Thomas Dinges
Commit: d1cbfc81bb900c82098a7a5076890fd200069cae
Author: Thomas Dinges
Date:   Mon May 2 10:38:59 2022 +0200
Branches: blender-v3.2-release
https://developer.blender.org/rBd1cbfc81bb900c82098a7a5076890fd200069cae

Blender 3.2 splashscreen

Credits: Oksana Dobrovolska

===

M   release/datafiles/locale
M   release/datafiles/splash.png

===

diff --git a/release/datafiles/locale b/release/datafiles/locale
index 2e715d54178..44cf4b4bf74 16
--- a/release/datafiles/locale
+++ b/release/datafiles/locale
@@ -1 +1 @@
-Subproject commit 2e715d54178e24ea463c7bc0cdeb27c682c39ecf
+Subproject commit 44cf4b4bf74f22fff55941e39cebeacec68a5a80
diff --git a/release/datafiles/splash.png b/release/datafiles/splash.png
index eb1250cf5a5..332ee39849e 100644
Binary files a/release/datafiles/splash.png and b/release/datafiles/splash.png 
differ

___
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] [da46ed9116c] blender-v3.2-release: Blender 3.2 - Beta

2022-05-02 Thread Thomas Dinges
Commit: da46ed9116cd3a82f440cfec180728f0b3871d9c
Author: Thomas Dinges
Date:   Mon May 2 10:35:39 2022 +0200
Branches: blender-v3.2-release
https://developer.blender.org/rBda46ed9116cd3a82f440cfec180728f0b3871d9c

Blender 3.2 - Beta

* BLENDER_VERSION_CYCLE set to beta
* Update pipeline_config.yaml to point to 3.2 branches and svn tags
* Update and uncomment BLENDER_VERSION in download.cmake

===

M   build_files/build_environment/cmake/download.cmake
M   build_files/config/pipeline_config.yaml
M   source/blender/blenkernel/BKE_blender_version.h

===

diff --git a/build_files/build_environment/cmake/download.cmake 
b/build_files/build_environment/cmake/download.cmake
index 80c53d05c28..92dea453133 100644
--- a/build_files/build_environment/cmake/download.cmake
+++ b/build_files/build_environment/cmake/download.cmake
@@ -1,7 +1,7 @@
 # SPDX-License-Identifier: GPL-2.0-or-later
 
 ## Update and uncomment this in the release branch
-# set(BLENDER_VERSION 3.1)
+set(BLENDER_VERSION 3.2)
 
 function(download_source dep)
   set(TARGET_FILE ${${dep}_FILE})
diff --git a/build_files/config/pipeline_config.yaml 
b/build_files/config/pipeline_config.yaml
index 8222f2ff0b9..d1f1fe78d21 100644
--- a/build_files/config/pipeline_config.yaml
+++ b/build_files/config/pipeline_config.yaml
@@ -5,38 +5,38 @@
 update-code:
 git:
 submodules:
--   branch: master
+-   branch: blender-v3.2-release
 commit_id: HEAD
 path: release/scripts/addons
--   branch: master
+-   branch: blender-v3.2-release
 commit_id: HEAD
 path: release/scripts/addons_contrib
--   branch: master
+-   branch: blender-v3.2-release
 commit_id: HEAD
 path: release/datafiles/locale
--   branch: master
+-   branch: blender-v3.2-release
 commit_id: HEAD
 path: source/tools
 svn:
 libraries:
 darwin-arm64:
-branch: trunk
+branch: tags/blender-3.2-release
 commit_id: HEAD
 path: lib/darwin_arm64
 darwin-x86_64:
-branch: trunk
+branch: tags/blender-3.2-release
 commit_id: HEAD
 path: lib/darwin
 linux-x86_64:
-branch: trunk
+branch: tags/blender-3.2-release
 commit_id: HEAD
 path: lib/linux_centos7_x86_64
 windows-amd64:
-branch: trunk
+branch: tags/blender-3.2-release
 commit_id: HEAD
 path: lib/win64_vc15
 tests:
-branch: trunk
+branch: tags/blender-3.2-release
 commit_id: HEAD
 path: lib/tests
 benchmarks:
diff --git a/source/blender/blenkernel/BKE_blender_version.h 
b/source/blender/blenkernel/BKE_blender_version.h
index 7f0a4c0d7af..15fdc73adeb 100644
--- a/source/blender/blenkernel/BKE_blender_version.h
+++ b/source/blender/blenkernel/BKE_blender_version.h
@@ -21,7 +21,7 @@ extern "C" {
 /* Blender patch version for bugfix releases. */
 #define BLENDER_VERSION_PATCH 0
 /** Blender release cycle stage: alpha/beta/rc/release. */
-#define BLENDER_VERSION_CYCLE alpha
+#define BLENDER_VERSION_CYCLE beta
 
 /* Blender file format version. */
 #define BLENDER_FILE_VERSION BLENDER_VERSION

___
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] [46b32c9d7b4] master: Blender 3.3 bcon1 - alpha

2022-05-02 Thread Thomas Dinges
Commit: 46b32c9d7b429e23efc30f5ac4c2b2d4ba59db38
Author: Thomas Dinges
Date:   Mon May 2 10:28:30 2022 +0200
Branches: master
https://developer.blender.org/rB46b32c9d7b429e23efc30f5ac4c2b2d4ba59db38

Blender 3.3 bcon1 - alpha

Bump the version number for the new release cycle.

===

M   doc/doxygen/Doxyfile
M   source/blender/blenkernel/BKE_blender_version.h

===

diff --git a/doc/doxygen/Doxyfile b/doc/doxygen/Doxyfile
index b8f54f548b4..0176a888377 100644
--- a/doc/doxygen/Doxyfile
+++ b/doc/doxygen/Doxyfile
@@ -38,7 +38,7 @@ PROJECT_NAME   = Blender
 # could be handy for archiving the generated documentation or if some version
 # control system is used.
 
-PROJECT_NUMBER = V3.2
+PROJECT_NUMBER = V3.3
 
 # Using the PROJECT_BRIEF tag one can provide an optional one line description
 # for a project that appears at the top of each page and should give viewer a
diff --git a/source/blender/blenkernel/BKE_blender_version.h 
b/source/blender/blenkernel/BKE_blender_version.h
index 7f0a4c0d7af..ab13a2e85d0 100644
--- a/source/blender/blenkernel/BKE_blender_version.h
+++ b/source/blender/blenkernel/BKE_blender_version.h
@@ -17,7 +17,7 @@ extern "C" {
  */
 
 /* Blender major and minor version. */
-#define BLENDER_VERSION 302
+#define BLENDER_VERSION 303
 /* Blender patch version for bugfix releases. */
 #define BLENDER_VERSION_PATCH 0
 /** Blender release cycle stage: alpha/beta/rc/release. */
@@ -25,7 +25,7 @@ extern "C" {
 
 /* Blender file format version. */
 #define BLENDER_FILE_VERSION BLENDER_VERSION
-#define BLENDER_FILE_SUBVERSION 14
+#define BLENDER_FILE_SUBVERSION 0
 
 /* Minimum Blender version that supports reading file written with the current
  * version. Older Blender versions will test this and show a warning if the 
file

___
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] SVN commit: bf-blender [62904] tags/blender-3.2-release/lib/: Copy libs to Blender 3.2 tag

2022-05-02 Thread Thomas Dinges
Revision: 62904
  https://developer.blender.org/rBL62904
Author:   dingto
Date: 2022-05-02 10:21:03 +0200 (Mon, 02 May 2022)
Log Message:
---
Copy libs to Blender 3.2 tag

Added Paths:
---
tags/blender-3.2-release/lib/

___
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] SVN commit: bf-blender [62903] tags/blender-3.2-release/: Create Blender 3.2 tag

2022-05-02 Thread Thomas Dinges
Revision: 62903
  https://developer.blender.org/rBL62903
Author:   dingto
Date: 2022-05-02 10:20:27 +0200 (Mon, 02 May 2022)
Log Message:
---
Create Blender 3.2 tag

Added Paths:
---
tags/blender-3.2-release/

___
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] [7cb48199fd1] cycles_oneapi: Merge branch 'master' into cycles_oneapi

2022-05-02 Thread Stefan Werner
Commit: 7cb48199fd17f5b8c69289c8b078a85995780803
Author: Stefan Werner
Date:   Mon May 2 09:31:31 2022 +0200
Branches: cycles_oneapi
https://developer.blender.org/rB7cb48199fd17f5b8c69289c8b078a85995780803

Merge branch 'master' into cycles_oneapi

===



===

diff --cc intern/cycles/cmake/external_libs.cmake
index 0c0bdd220d1,f4186374d10..5b875565c97
--- a/intern/cycles/cmake/external_libs.cmake
+++ b/intern/cycles/cmake/external_libs.cmake
@@@ -80,10 -85,12 +85,13 @@@ if(CYCLES_STANDALONE_REPOSITORY
  _set_default(OSL_ROOT_DIR "${_cycles_lib_dir}/osl")
  _set_default(PNG_ROOT "${_cycles_lib_dir}/png")
  _set_default(PUGIXML_ROOT_DIR "${_cycles_lib_dir}/pugixml")
+ _set_default(SDL2_ROOT_DIR "${_cycles_lib_dir}/sdl")
  _set_default(TBB_ROOT_DIR "${_cycles_lib_dir}/tbb")
  _set_default(TIFF_ROOT "${_cycles_lib_dir}/tiff")
+ _set_default(USD_ROOT_DIR "${_cycles_lib_dir}/usd")
+ _set_default(WEBP_ROOT_DIR "${_cycles_lib_dir}/webp")
  _set_default(ZLIB_ROOT "${_cycles_lib_dir}/zlib")
 +_set_default(LEVEL_ZERO_ROOT_DIR "${_cycles_lib_dir}/level-zero")
  
  # Ignore system libraries
  set(CMAKE_IGNORE_PATH 
"${CMAKE_PLATFORM_IMPLICIT_LINK_DIRECTORIES};${CMAKE_SYSTEM_INCLUDE_PATH};${CMAKE_C_IMPLICIT_INCLUDE_DIRECTORIES};${CMAKE_CXX_IMPLICIT_INCLUDE_DIRECTORIES}")
@@@ -675,34 -647,3 +648,21 @@@ if(WITH_CYCLES_DEVICE_METAL
  message(STATUS "Found Metal: ${METAL_LIBRARY}")
endif()
  endif()
 +
 +###
 +# oneAPI
 +###
 +if (WITH_CYCLES_DEVICE_ONEAPI)
 +  find_package(SYCL)
 +  find_package(LevelZero)
 +
 +  if (SYCL_FOUND AND LEVEL_ZERO_FOUND)
 +message(STATUS "Found oneAPI: ${SYCL_LIBRARY}")
 +message(STATUS "Found Level Zero: ${LEVEL_ZERO_LIBRARY}")
 +  else()
 +message(STATUS "oneAPI or Level Zero not found, disabling oneAPI device 
from Cycles")
 +set(WITH_CYCLES_DEVICE_ONEAPI OFF)
 +  endif()
 +endif()
 +
 +unset(_cycles_lib_dir)
- 
- ###
- # macOS
- ###
- 
- if(CYCLES_STANDALONE_REPOSITORY)
-   # On macOS, always use zlib from system.
-   if(APPLE)
- set(ZLIB_ROOT /usr)
- find_package(ZLIB REQUIRED)
- find_package(PNG REQUIRED)
-   endif()
- endif()

___
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] [f0f44fd92f1] master: Curves: support spherical delete brush

2022-05-02 Thread Jacques Lucke
Commit: f0f44fd92f1684552ee0275d14bb6dd72405c8fd
Author: Jacques Lucke
Date:   Mon May 2 09:18:57 2022 +0200
Branches: master
https://developer.blender.org/rBf0f44fd92f1684552ee0275d14bb6dd72405c8fd

Curves: support spherical delete brush

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

===

M   release/scripts/startup/bl_ui/space_view3d.py
M   source/blender/editors/sculpt_paint/curves_sculpt_delete.cc

===

diff --git a/release/scripts/startup/bl_ui/space_view3d.py 
b/release/scripts/startup/bl_ui/space_view3d.py
index 4f1d001b2f3..69477c80c07 100644
--- a/release/scripts/startup/bl_ui/space_view3d.py
+++ b/release/scripts/startup/bl_ui/space_view3d.py
@@ -529,6 +529,9 @@ class _draw_tool_settings_context_mode:
 layout.prop(brush, "falloff_shape", expand=True)
 layout.prop(brush, "curve_preset")
 
+if brush.curves_sculpt_tool == 'DELETE':
+layout.prop(brush, "falloff_shape", expand=True)
+
 
 class VIEW3D_HT_header(Header):
 bl_space_type = 'VIEW_3D'
diff --git a/source/blender/editors/sculpt_paint/curves_sculpt_delete.cc 
b/source/blender/editors/sculpt_paint/curves_sculpt_delete.cc
index 018c8c2a34f..2841a19d677 100644
--- a/source/blender/editors/sculpt_paint/curves_sculpt_delete.cc
+++ b/source/blender/editors/sculpt_paint/curves_sculpt_delete.cc
@@ -35,68 +35,202 @@
 #include "ED_screen.h"
 #include "ED_view3d.h"
 
+/**
+ * The code below uses a suffix naming convention to indicate the coordinate 
space:
+ * cu: Local space of the curves object that is being edited.
+ * wo: World space.
+ * re: 2D coordinates within the region.
+ */
+
 namespace blender::ed::sculpt_paint {
 
 using blender::bke::CurvesGeometry;
 
 class DeleteOperation : public CurvesSculptStrokeOperation {
  private:
-  float2 last_mouse_position_;
+  float2 brush_pos_prev_re_;
+
+  CurvesBrush3D brush_3d_;
+
+  friend struct DeleteOperationExecutor;
 
  public:
-  void on_stroke_extended(bContext *C, const StrokeExtension 
_extension) override
-  {
-Scene  = *CTX_data_scene(C);
-Object  = *CTX_data_active_object(C);
-ARegion *region = CTX_wm_region(C);
-RegionView3D *rv3d = CTX_wm_region_view3d(C);
+  void on_stroke_extended(bContext *C, const StrokeExtension 
_extension) override;
+};
 
-CurvesSculpt _sculpt = *scene.toolsettings->curves_sculpt;
-Brush  = *BKE_paint_brush(_sculpt.paint);
-const float brush_radius = BKE_brush_size_get(, );
+struct DeleteOperationExecutor {
+  DeleteOperation *self_ = nullptr;
+  bContext *C_ = nullptr;
+  Depsgraph *depsgraph_ = nullptr;
+  Scene *scene_ = nullptr;
+  Object *object_ = nullptr;
+  ARegion *region_ = nullptr;
+  View3D *v3d_ = nullptr;
+  RegionView3D *rv3d_ = nullptr;
 
-float4x4 projection;
-ED_view3d_ob_project_mat_get(rv3d, , projection.values);
+  Curves *curves_id_ = nullptr;
+  CurvesGeometry *curves_ = nullptr;
+
+  CurvesSculpt *curves_sculpt_ = nullptr;
+  Brush *brush_ = nullptr;
+  float brush_radius_re_;
+
+  float2 brush_pos_re_;
+  float2 brush_pos_prev_re_;
 
-Curves _id = *static_cast(object.data);
-CurvesGeometry  = CurvesGeometry::wrap(curves_id.geometry);
-Span positions = curves.positions();
+  float4x4 curves_to_world_mat_;
+  float4x4 world_to_curves_mat_;
 
-const float2 mouse_start = stroke_extension.is_first ? 
stroke_extension.mouse_position :
-   
last_mouse_position_;
-const float2 mouse_end = stroke_extension.mouse_position;
+  void execute(DeleteOperation , bContext *C, const StrokeExtension 
_extension)
+  {
+BLI_SCOPED_DEFER([&]() { self.brush_pos_prev_re_ = 
stroke_extension.mouse_position; });
+
+self_ = 
+C_ = C;
+depsgraph_ = CTX_data_depsgraph_pointer(C);
+scene_ = CTX_data_scene(C);
+object_ = CTX_data_active_object(C);
+region_ = CTX_wm_region(C);
+v3d_ = CTX_wm_view3d(C);
+rv3d_ = CTX_wm_region_view3d(C);
+
+curves_id_ = static_cast(object_->data);
+curves_ = ::wrap(curves_id_->geometry);
+
+curves_sculpt_ = scene_->toolsettings->curves_sculpt;
+brush_ = BKE_paint_brush(_sculpt_->paint);
+brush_radius_re_ = BKE_brush_size_get(scene_, brush_);
+
+brush_pos_re_ = stroke_extension.mouse_position;
+brush_pos_prev_re_ = stroke_extension.is_first ? 
stroke_extension.mouse_position :
+ self.brush_pos_prev_re_;
+
+curves_to_world_mat_ = object_->obmat;
+world_to_curves_mat_ = curves_to_world_mat_.inverted();
+
+const eBrushFalloffShape falloff_shape = static_cast(
+brush_->falloff_shape);
+
+if (stroke_extension.is_first) {
+  if (falloff_shape == PAINT_FALLOFF_SHAPE_SPHERE) {
+this->initialize_spherical_brush_reference_point();
+  }
+}
+
+if (falloff_shape ==