[Bf-blender-cvs] [e47bf05e852] master: NDOF: use logging for GHOST so users can enable event logging

2022-10-17 Thread Campbell Barton
Commit: e47bf05e8527c77700aea24b90d5fa7fc66990cf
Author: Campbell Barton
Date:   Tue Oct 18 13:44:23 2022 +1100
Branches: master
https://developer.blender.org/rBe47bf05e8527c77700aea24b90d5fa7fc66990cf

NDOF: use logging for GHOST so users can enable event logging

Previously this was only available as a build options, making it
difficult to get user feedback when NDOF events didn't work as expected.

Now logging can be enabled with:

  blender --log "ghost.ndof.*" --log-level 2 --log-show-basename

===

M   intern/ghost/GHOST_Types.h
M   intern/ghost/intern/GHOST_NDOFManager.cpp
M   intern/ghost/intern/GHOST_NDOFManager.h

===

diff --git a/intern/ghost/GHOST_Types.h b/intern/ghost/GHOST_Types.h
index 182eb6eb7d2..2645ce448b0 100644
--- a/intern/ghost/GHOST_Types.h
+++ b/intern/ghost/GHOST_Types.h
@@ -526,7 +526,7 @@ typedef struct {
 } GHOST_TStringArray;
 
 typedef enum {
-  GHOST_kNotStarted,
+  GHOST_kNotStarted = 0,
   GHOST_kStarting,
   GHOST_kInProgress,
   GHOST_kFinishing,
diff --git a/intern/ghost/intern/GHOST_NDOFManager.cpp 
b/intern/ghost/intern/GHOST_NDOFManager.cpp
index b1bd5287d24..f4c726c7450 100644
--- a/intern/ghost/intern/GHOST_NDOFManager.cpp
+++ b/intern/ghost/intern/GHOST_NDOFManager.cpp
@@ -7,18 +7,23 @@
 #include "GHOST_WindowManager.h"
 #include "GHOST_utildefines.h"
 
+/* Logging, use `ghost.ndof.*` prefix. */
+#include "CLG_log.h"
+
 #include 
 #include 
 #include   /* For error/info reporting. */
 #include  /* For memory functions. */
 
-#ifdef DEBUG_NDOF_MOTION
 /* Printable version of each GHOST_TProgress value. */
 static const char *progress_string[] = {
-"not started", "starting", "in progress", "finishing", "finished"};
-#endif
+"not started",
+"starting",
+"in progress",
+"finishing",
+"finished",
+};
 
-#ifdef DEBUG_NDOF_BUTTONS
 static const char *ndof_button_names[] = {
 /* used internally, never sent */
 "NDOF_BUTTON_NONE",
@@ -69,8 +74,8 @@ static const char *ndof_button_names[] = {
 "NDOF_BUTTON_B",
 "NDOF_BUTTON_C",
 /* the end */
-"NDOF_BUTTON_LAST"};
-#endif
+"NDOF_BUTTON_LAST",
+};
 
 /* Shared by the latest 3Dconnexion hardware
  * SpacePilotPro uses all of these
@@ -150,6 +155,13 @@ GHOST_NDOFManager::GHOST_NDOFManager(GHOST_System &sys)
   memset(m_rotation, 0, sizeof(m_rotation));
 }
 
+/*  */
+/** \name NDOF Device Setup
+ * \{ */
+
+static CLG_LogRef LOG_NDOF_DEVICE = {"ghost.ndof.device"};
+#define LOG (&LOG_NDOF_DEVICE)
+
 bool GHOST_NDOFManager::setDevice(ushort vendor_id, ushort product_id)
 {
   /* Call this function until it returns true
@@ -260,13 +272,19 @@ bool GHOST_NDOFManager::setDevice(ushort vendor_id, 
ushort product_id)
 m_buttonMask = int(~(UINT_MAX << m_buttonCount));
   }
 
-#ifdef DEBUG_NDOF_BUTTONS
-  printf("ndof: %d buttons -> hex:%X\n", m_buttonCount, m_buttonMask);
-#endif
+  CLOG_INFO(LOG, 2, "%d buttons -> hex:%X", m_buttonCount, (uint)m_buttonMask);
 
   return m_deviceType != NDOF_UnknownDevice;
 }
 
+#undef LOG
+
+/** \} */
+
+/*  */
+/** \name NDOF Update State
+ * \{ */
+
 void GHOST_NDOFManager::updateTranslation(const int t[3], uint64_t time)
 {
   memcpy(m_translation, t, sizeof(m_translation));
@@ -281,6 +299,36 @@ void GHOST_NDOFManager::updateRotation(const int r[3], 
uint64_t time)
   m_motionEventPending = true;
 }
 
+/** \} */
+
+/*  */
+/** \name NDOF Buttons
+ * \{ */
+
+static CLG_LogRef LOG_NDOF_BUTTONS = {"ghost.ndof.buttons"};
+#define LOG (&LOG_NDOF_BUTTONS)
+
+static GHOST_TKey ghost_map_keyboard_from_ndof_buttom(const NDOF_ButtonT 
button)
+{
+  switch (button) {
+case NDOF_BUTTON_ESC: {
+  return GHOST_kKeyEsc;
+}
+case NDOF_BUTTON_ALT: {
+  return GHOST_kKeyLeftAlt;
+}
+case NDOF_BUTTON_SHIFT: {
+  return GHOST_kKeyLeftShift;
+}
+case NDOF_BUTTON_CTRL: {
+  return GHOST_kKeyLeftControl;
+}
+default: {
+  return GHOST_kKeyUnknown;
+}
+  }
+}
+
 void GHOST_NDOFManager::sendButtonEvent(NDOF_ButtonT button,
 bool press,
 uint64_t time,
@@ -295,10 +343,6 @@ void GHOST_NDOFManager::sendButtonEvent(NDOF_ButtonT 
button,
   data->action = press ? GHOST_kPress : GHOST_kRelease;
   data->button = button;
 
-#ifdef DEBUG_NDOF_BUTTONS
-  printf("%s %s\n", ndof_button_names[button], press ? "pressed" : "released");
-#endif
-
   m_system.pushEvent(event);
 }
 
@@ -310,44 +354,41 @@ void GHOST_NDOFManager::sendKeyEvent(GHOST_TKey key,
   GHOST_TEventType type = press ? GHOST_kEventKeyDown : GHOST_kEventKeyUp;
   GHOST_EventKey *event = new GHOST_EventKey(time, type, window, key, false);

[Bf-blender-cvs] [1edebb794b7] master: UV: support snapping on non-uniform grids

2022-10-17 Thread Chris Blackbourn
Commit: 1edebb794b76326e06b527fd0a04eba34d51ab7c
Author: Chris Blackbourn
Date:   Tue Oct 18 15:59:35 2022 +1300
Branches: master
https://developer.blender.org/rB1edebb794b76326e06b527fd0a04eba34d51ab7c

UV: support snapping on non-uniform grids

Part of a wider set of changes to Grid and Pixel snapping in the
UV Editor.

This change fixes snapping behavior for non-uniform grids, either
manually specified Fixed grids, or pixel grids where the underlying
image is non-square.

See a24fc6bbc1ae for visual changes.

Maniphest Tasks: T78391

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

===

M   source/blender/editors/transform/transform.c
M   source/blender/editors/transform/transform.h
M   source/blender/editors/transform/transform_mode_translate.c
M   source/blender/editors/transform/transform_snap.c

===

diff --git a/source/blender/editors/transform/transform.c 
b/source/blender/editors/transform/transform.c
index 93e99f97387..34e5b78c48f 100644
--- a/source/blender/editors/transform/transform.c
+++ b/source/blender/editors/transform/transform.c
@@ -60,8 +60,6 @@
  * and being able to set it to zero is handy. */
 /* #define USE_NUM_NO_ZERO */
 
-static void initSnapSpatial(TransInfo *t, float r_snap[2]);
-
 bool transdata_check_local_islands(TransInfo *t, short around)
 {
   if (t->options & (CTX_CURSOR | CTX_TEXTURE_SPACE)) {
@@ -1723,7 +1721,7 @@ void saveTransform(bContext *C, TransInfo *t, wmOperator 
*op)
   }
 }
 
-static void initSnapSpatial(TransInfo *t, float r_snap[2])
+static void initSnapSpatial(TransInfo *t, float r_snap[2], float r_snap_y[2])
 {
   if (t->spacetype == SPACE_VIEW3D) {
 if (t->region->regiondata) {
@@ -1737,18 +1735,15 @@ static void initSnapSpatial(TransInfo *t, float 
r_snap[2])
 View2D *v2d = &t->region->v2d;
 int grid_size = SI_GRID_STEPS_LEN;
 float zoom_factor = ED_space_image_zoom_level(v2d, grid_size);
-float grid_steps[SI_GRID_STEPS_LEN];
+float grid_steps_x[SI_GRID_STEPS_LEN];
 float grid_steps_y[SI_GRID_STEPS_LEN];
 
-ED_space_image_grid_steps(sima, grid_steps, grid_steps_y, grid_size);
+ED_space_image_grid_steps(sima, grid_steps_x, grid_steps_y, grid_size);
 /* Snapping value based on what type of grid is used (adaptive-subdividing 
or custom-grid). */
-r_snap[0] = ED_space_image_increment_snap_value(grid_size, grid_steps, 
zoom_factor);
+r_snap[0] = ED_space_image_increment_snap_value(grid_size, grid_steps_x, 
zoom_factor);
 r_snap[1] = r_snap[0] / 2.0f;
-
-/* TODO: Implement snapping for custom grid sizes with `grid_steps[0] != 
grid_steps_y[0]`.
- * r_snap_y[0] = ED_space_image_increment_snap_value(grid_size, 
grid_steps_y, zoom_factor);
- * r_snap_y[1] = r_snap_y[0] / 2.0f;
- */
+r_snap_y[0] = ED_space_image_increment_snap_value(grid_size, grid_steps_y, 
zoom_factor);
+r_snap_y[1] = r_snap_y[0] / 2.0f;
   }
   else if (t->spacetype == SPACE_CLIP) {
 r_snap[0] = 0.125f;
@@ -1903,7 +1898,7 @@ bool initTransform(bContext *C, TransInfo *t, wmOperator 
*op, const wmEvent *eve
 
   initSnapping(t, op); /* Initialize snapping data AFTER mode flags */
 
-  initSnapSpatial(t, t->snap_spatial);
+  initSnapSpatial(t, t->snap_spatial_x, t->snap_spatial_y);
 
   /* EVIL! posemode code can switch translation to rotate when 1 bone is 
selected.
* will be removed (ton) */
diff --git a/source/blender/editors/transform/transform.h 
b/source/blender/editors/transform/transform.h
index e2bab378cad..95686f12fe2 100644
--- a/source/blender/editors/transform/transform.h
+++ b/source/blender/editors/transform/transform.h
@@ -555,7 +555,9 @@ typedef struct TransInfo {
   /** Snapping Gears. */
   float snap[2];
   /** Spatial snapping gears(even when rotating, scaling... etc). */
-  float snap_spatial[2];
+  float snap_spatial_x[2];
+  /** Spatial snapping in the Y coordinate, for non-uniform grid in UV Editor. 
*/
+  float snap_spatial_y[2];
   /** Mouse side of the current frame, 'L', 'R' or 'B' */
   char frame_side;
 
diff --git a/source/blender/editors/transform/transform_mode_translate.c 
b/source/blender/editors/transform/transform_mode_translate.c
index 8f6ec7bd98f..91388ecd661 100644
--- a/source/blender/editors/transform/transform_mode_translate.c
+++ b/source/blender/editors/transform/transform_mode_translate.c
@@ -590,7 +590,7 @@ void initTranslation(TransInfo *t)
   t->num.flag = 0;
   t->num.idx_max = t->idx_max;
 
-  copy_v2_v2(t->snap, t->snap_spatial);
+  copy_v2_v2(t->snap, t->snap_spatial_x);
 
   copy_v3_fl(t->num.val_inc, t->snap[0]);
   t->num.unit_sys = t->scene->unit.system;
diff --git a/source/blender/editors/transform/transform_snap.c 
b/source/blender/editors/transform/transform_snap.c
index 3f9cca55138..553202b5798 100644
--- a/source/blender/editors/transform/transform_snap.c
+++ b/source/blender/editors/transform/trans

[Bf-blender-cvs] [c7051192e21] master: UI: Improve tooltip for texture shading mode

2022-10-17 Thread Aaron Carlisle
Commit: c7051192e217a89cceb9117776b62d45a9f8da38
Author: Aaron Carlisle
Date:   Mon Oct 17 22:57:01 2022 -0400
Branches: master
https://developer.blender.org/rBc7051192e217a89cceb9117776b62d45a9f8da38

UI: Improve tooltip for texture shading mode

Pointed out in T98506

===

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

===

diff --git a/source/blender/makesrna/intern/rna_space.c 
b/source/blender/makesrna/intern/rna_space.c
index 3cd8020ca6c..5c192b80dc1 100644
--- a/source/blender/makesrna/intern/rna_space.c
+++ b/source/blender/makesrna/intern/rna_space.c
@@ -426,7 +426,11 @@ static const EnumPropertyItem 
rna_enum_shading_color_type_items[] = {
 {V3D_SHADING_OBJECT_COLOR, "OBJECT", 0, "Object", "Show object color"},
 {V3D_SHADING_RANDOM_COLOR, "RANDOM", 0, "Random", "Show random object 
color"},
 {V3D_SHADING_VERTEX_COLOR, "VERTEX", 0, "Attribute", "Show active color 
attribute"},
-{V3D_SHADING_TEXTURE_COLOR, "TEXTURE", 0, "Texture", "Show texture"},
+{V3D_SHADING_TEXTURE_COLOR,
+ "TEXTURE",
+ 0,
+ "Texture",
+ "Show the texture from the active image texture node using the active UV 
map coordinates"},
 {0, NULL, 0, NULL, NULL},
 };

___
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] [ba4cc169311] tmp_libs_34: deps_builder: oiio / openpgl version changes

2022-10-17 Thread Ray Molenkamp
Commit: ba4cc1693111e633fcf3fa9588e8f2cbad66ffb0
Author: Ray Molenkamp
Date:   Mon Oct 17 18:00:05 2022 -0600
Branches: tmp_libs_34
https://developer.blender.org/rBba4cc1693111e633fcf3fa9588e8f2cbad66ffb0

deps_builder: oiio / openpgl version changes

OpenPGL has done their release, so we no longer
need to use a hash.

OIOO had to be downgraded due to a 10x perf regression
in the .hdr format

===

M   build_files/build_environment/cmake/versions.cmake

===

diff --git a/build_files/build_environment/cmake/versions.cmake 
b/build_files/build_environment/cmake/versions.cmake
index c86ada94a47..828ceda984c 100644
--- a/build_files/build_environment/cmake/versions.cmake
+++ b/build_files/build_environment/cmake/versions.cmake
@@ -159,9 +159,9 @@ set(OPENMP_URI 
https://github.com/llvm/llvm-project/releases/download/llvmorg-${
 set(OPENMP_HASH_TYPE MD5)
 set(OPENMP_FILE openmp-${OPENMP_VERSION}.src.tar.xz)
 
-set(OPENIMAGEIO_VERSION v2.4.4.2)
+set(OPENIMAGEIO_VERSION v2.3.20.0)
 set(OPENIMAGEIO_URI 
https://github.com/OpenImageIO/oiio/archive/refs/tags/${OPENIMAGEIO_VERSION}.tar.gz)
-set(OPENIMAGEIO_HASH c0b4b67e4e81b21e56be66e14ebce52f)
+set(OPENIMAGEIO_HASH defb1fe7c8e64bac60eb3cacaf5c3736)
 set(OPENIMAGEIO_HASH_TYPE MD5)
 set(OPENIMAGEIO_FILE OpenImageIO-${OPENIMAGEIO_VERSION}.tar.gz)
 
@@ -558,10 +558,10 @@ set(BROTLI_HASH_TYPE SHA256)
 set(BROTLI_FILE brotli-v${BROTLI_VERSION}.tar.gz)
 set(BROTLI_CPE "cpe:2.3:a:google:brotli:${BROTLI_VERSION}:*:*:*:*:*:*:*")
 
-set(OPENPGL_VERSION 40fa9f4ae16d0a00d9afa8bfbe95276b37f931cd)
+set(OPENPGL_VERSION v0.4.0-beta)
 set(OPENPGL_SHORT_VERSION 0.4.0)
-set(OPENPGL_URI 
https://github.com/OpenPathGuidingLibrary/openpgl/archive/${OPENPGL_VERSION}.tar.gz)
-set(OPENPGL_HASH 
46895cce761fc56ee20bedaf9ca94c7337e1e12a947d29a7a3edce0cda731571)
+set(OPENPGL_URI 
https://github.com/OpenPathGuidingLibrary/openpgl/archive/refs/tags/${OPENPGL_VERSION}.tar.gz)
+set(OPENPGL_HASH 
1f090f88ab2bad028e8b3619aa926f4f97cf7b2c175b904704d2fec8593dd3cd)
 set(OPENPGL_HASH_TYPE SHA256)
 set(OPENPGL_FILE openpgl-${OPENPGL_VERSION}.tar.gz)

___
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] [85875455b91] master: Fix T101872: Curves sculpt deform node crash with changed curve count

2022-10-17 Thread Hans Goudey
Commit: 85875455b9171a602f57102bb4575f6e2c2a9b7f
Author: Hans Goudey
Date:   Mon Oct 17 17:08:09 2022 -0500
Branches: master
https://developer.blender.org/rB85875455b9171a602f57102bb4575f6e2c2a9b7f

Fix T101872: Curves sculpt deform node crash with changed curve count

There might be more or fewer curves in the input to the deform curves on
surface node than the original, so the curve's surface UV coordinates
need to be retrieved from the original curves.

===

M   source/blender/nodes/geometry/nodes/node_geo_deform_curves_on_surface.cc

===

diff --git 
a/source/blender/nodes/geometry/nodes/node_geo_deform_curves_on_surface.cc 
b/source/blender/nodes/geometry/nodes/node_geo_deform_curves_on_surface.cc
index a12ae9bbb92..0932624bdc3 100644
--- a/source/blender/nodes/geometry/nodes/node_geo_deform_curves_on_surface.cc
+++ b/source/blender/nodes/geometry/nodes/node_geo_deform_curves_on_surface.cc
@@ -379,19 +379,22 @@ static void node_geo_exec(GeoNodeExecParams params)
   invalid_uv_count);
 /* Then also deform edit curve information for use in sculpt mode. */
 const CurvesGeometry &curves_orig = 
CurvesGeometry::wrap(edit_hints->curves_id_orig.geometry);
-deform_curves(curves_orig,
-  *surface_mesh_orig,
-  *surface_mesh_eval,
-  surface_uv_coords,
-  reverse_uv_sampler_orig,
-  reverse_uv_sampler_eval,
-  corner_normals_orig,
-  corner_normals_eval,
-  rest_positions,
-  transforms.surface_to_curves,
-  edit_hint_positions,
-  edit_hint_rotations,
-  invalid_uv_count);
+const Span surface_uv_coords_orig = 
curves_orig.surface_uv_coords();
+if (!surface_uv_coords_orig.is_empty()) {
+  deform_curves(curves_orig,
+*surface_mesh_orig,
+*surface_mesh_eval,
+surface_uv_coords_orig,
+reverse_uv_sampler_orig,
+reverse_uv_sampler_eval,
+corner_normals_orig,
+corner_normals_eval,
+rest_positions,
+transforms.surface_to_curves,
+edit_hint_positions,
+edit_hint_rotations,
+invalid_uv_count);
+}
   }
 
   curves.tag_positions_changed();

___
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] [161aa5e0d03] master: Fix T101882: Division by zero in mesh topology nodes

2022-10-17 Thread Hans Goudey
Commit: 161aa5e0d039577964d7080817e3df229aa153c0
Author: Hans Goudey
Date:   Mon Oct 17 16:51:42 2022 -0500
Branches: master
https://developer.blender.org/rB161aa5e0d039577964d7080817e3df229aa153c0

Fix T101882: Division by zero in mesh topology nodes

A vertex might be connected to no edges or no faces. Most of these nodes
worked fine in that case, but we might as well make that explicit
and skip the sorting anyway.

===

M   
source/blender/nodes/geometry/nodes/node_geo_mesh_topology_corners_of_vertex.cc
M   
source/blender/nodes/geometry/nodes/node_geo_mesh_topology_edges_of_vertex.cc

===

diff --git 
a/source/blender/nodes/geometry/nodes/node_geo_mesh_topology_corners_of_vertex.cc
 
b/source/blender/nodes/geometry/nodes/node_geo_mesh_topology_corners_of_vertex.cc
index cce3f4e3648..036af2d3b93 100644
--- 
a/source/blender/nodes/geometry/nodes/node_geo_mesh_topology_corners_of_vertex.cc
+++ 
b/source/blender/nodes/geometry/nodes/node_geo_mesh_topology_corners_of_vertex.cc
@@ -93,6 +93,10 @@ class CornersOfVertInput final : public bke::MeshFieldInput {
 }
 
 const Span corners = vert_to_loop_map[vert_i];
+if (corners.is_empty()) {
+  corner_of_vertex[selection_i] = 0;
+  continue;
+}
 
 /* Retrieve the connected edge indices as 64 bit integers for 
#materialize_compressed. */
 corner_indices.reinitialize(corners.size());
diff --git 
a/source/blender/nodes/geometry/nodes/node_geo_mesh_topology_edges_of_vertex.cc 
b/source/blender/nodes/geometry/nodes/node_geo_mesh_topology_edges_of_vertex.cc
index 053ef61deed..f0cc191e217 100644
--- 
a/source/blender/nodes/geometry/nodes/node_geo_mesh_topology_edges_of_vertex.cc
+++ 
b/source/blender/nodes/geometry/nodes/node_geo_mesh_topology_edges_of_vertex.cc
@@ -93,6 +93,10 @@ class EdgesOfVertInput final : public bke::MeshFieldInput {
 }
 
 const Span edges = vert_to_edge_map[vert_i];
+if (edges.is_empty()) {
+  edge_of_vertex[selection_i] = 0;
+  continue;
+}
 
 /* Retrieve the connected edge indices as 64 bit integers for 
#materialize_compressed. */
 edge_indices.reinitialize(edges.size());

___
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] [f8e871168a8] universal-scene-description: Fix linux/mac build warnings and errors.

2022-10-17 Thread Michael Kowalski
Commit: f8e871168a8ddf374ff578ce8ef817041de62e4e
Author: Michael Kowalski
Date:   Mon Oct 17 16:33:09 2022 -0400
Branches: universal-scene-description
https://developer.blender.org/rBf8e871168a8ddf374ff578ce8ef817041de62e4e

Fix linux/mac build warnings and errors.

===

M   source/blender/io/usd/intern/usd_reader_shape.cc
M   source/blender/io/usd/intern/usd_reader_shape.h

===

diff --git a/source/blender/io/usd/intern/usd_reader_shape.cc 
b/source/blender/io/usd/intern/usd_reader_shape.cc
index 92597c290ee..9038238b387 100644
--- a/source/blender/io/usd/intern/usd_reader_shape.cc
+++ b/source/blender/io/usd/intern/usd_reader_shape.cc
@@ -37,7 +37,7 @@ USDShapeReader::USDShapeReader(const pxr::UsdPrim &prim,
 {
 }
 
-void USDShapeReader::create_object(Main *bmain, double motionSampleTime)
+void USDShapeReader::create_object(Main *bmain, double /* motionSampleTime */)
 {
   Mesh *mesh = BKE_mesh_add(bmain, name_.c_str());
   object_ = BKE_object_add_only_object(bmain, OB_MESH, name_.c_str());
@@ -72,16 +72,16 @@ void USDShapeReader::read_values(const double 
motionSampleTime,
  pxr::VtIntArray &face_counts)
 {
   pxr::VtValue meshPoints = Adapter::GetMeshPoints(prim_, motionSampleTime);
-  positions = meshPoints.Get>();
-  pxr::HdMeshTopology meshTopologyValue = 
Adapter::GetMeshTopology().Get();
+  positions = meshPoints.template Get>();
+  pxr::HdMeshTopology meshTopologyValue = Adapter::GetMeshTopology().template 
Get();
   face_counts = meshTopologyValue.GetFaceVertexCounts();
   face_indices = meshTopologyValue.GetFaceVertexIndices();
 }
 
 struct Mesh *USDShapeReader::read_mesh(struct Mesh *existing_mesh,
double motionSampleTime,
-   int read_flag,
-   const char **err_str)
+   int /* read_flag */,
+   const char ** /* err_str */)
 {
   if (!prim_) {
 return existing_mesh;
diff --git a/source/blender/io/usd/intern/usd_reader_shape.h 
b/source/blender/io/usd/intern/usd_reader_shape.h
index 25f08aba207..7e91be1d4f4 100644
--- a/source/blender/io/usd/intern/usd_reader_shape.h
+++ b/source/blender/io/usd/intern/usd_reader_shape.h
@@ -32,7 +32,7 @@ class USDShapeReader : public USDGeomReader {
  const char **err_str) override;
   bool is_time_varying();
 
-  virtual bool topology_changed(const Mesh * /* existing_mesh */, double /* 
motionSampleTime */)
+  virtual bool topology_changed(const Mesh * /* existing_mesh */, double /* 
motionSampleTime */) override
   {
 return false;
   };

___
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] [525a0319358] node-add-asset-menu: Add "Is Loading" label for the first time the menu is opened

2022-10-17 Thread Hans Goudey
Commit: 525a0319358a3cbf78f8eebfc2c2bfb6aa27b404
Author: Hans Goudey
Date:   Mon Oct 17 15:28:43 2022 -0500
Branches: node-add-asset-menu
https://developer.blender.org/rB525a0319358a3cbf78f8eebfc2c2bfb6aa27b404

Add "Is Loading" label for the first time the menu is opened

===

M   source/blender/editors/asset/ED_asset_list.h
M   source/blender/editors/asset/intern/asset_list.cc
M   source/blender/editors/space_node/add_menu_assets.cc

===

diff --git a/source/blender/editors/asset/ED_asset_list.h 
b/source/blender/editors/asset/ED_asset_list.h
index b54f81004f2..3d2aaa3bda1 100644
--- a/source/blender/editors/asset/ED_asset_list.h
+++ b/source/blender/editors/asset/ED_asset_list.h
@@ -23,6 +23,7 @@ struct wmNotifier;
  */
 void ED_assetlist_storage_fetch(const struct AssetLibraryReference 
*library_reference,
 const struct bContext *C);
+bool ED_assetlist_is_loaded(const struct AssetLibraryReference 
*library_reference);
 void ED_assetlist_ensure_previews_job(const struct AssetLibraryReference 
*library_reference,
   const struct bContext *C);
 void ED_assetlist_clear(const struct AssetLibraryReference *library_reference, 
struct bContext *C);
diff --git a/source/blender/editors/asset/intern/asset_list.cc 
b/source/blender/editors/asset/intern/asset_list.cc
index 7fdb924d769..01a6dc46c48 100644
--- a/source/blender/editors/asset/intern/asset_list.cc
+++ b/source/blender/editors/asset/intern/asset_list.cc
@@ -422,6 +422,18 @@ void ED_assetlist_storage_fetch(const 
AssetLibraryReference *library_reference,
   AssetListStorage::fetch_library(*library_reference, *C);
 }
 
+bool ED_assetlist_is_loaded(const AssetLibraryReference *library_reference)
+{
+  AssetList *list = AssetListStorage::lookup_list(*library_reference);
+  if (!list) {
+return false;
+  }
+  if (list->needsRefetch()) {
+return false;
+  }
+  return true;
+}
+
 void ED_assetlist_ensure_previews_job(const AssetLibraryReference 
*library_reference,
   const bContext *C)
 {
diff --git a/source/blender/editors/space_node/add_menu_assets.cc 
b/source/blender/editors/space_node/add_menu_assets.cc
index 5d4b198eda6..1cba47c8d26 100644
--- a/source/blender/editors/space_node/add_menu_assets.cc
+++ b/source/blender/editors/space_node/add_menu_assets.cc
@@ -11,11 +11,12 @@
 #include "BKE_idprop.h"
 #include "BKE_screen.h"
 
+#include "BLT_translation.h"
+
 #include "RNA_access.h"
 #include "RNA_prototypes.h"
 
 #include "ED_asset.h"
-#include "ED_screen.h"
 
 #include "node_intern.hh"
 
@@ -42,23 +43,21 @@ struct AssetItemTree {
   Map 
full_catalog_per_tree_item;
 };
 
-static void search_listen_fn(const wmRegionListenerParams *params)
+static bool all_loading_finished()
 {
-  const wmNotifier *wmn = params->notifier;
-
-  switch (wmn->category) {
-case NC_ASSET:
-  if (wmn->data == ND_ASSET_LIST_READING) {
-std::cout << "TAGGING FOR REDRAW\n";
-ED_region_tag_redraw(params->region);
-ED_region_tag_refresh_ui(params->region);
-  }
-  break;
+  for (const AssetLibraryReference &library : bke::all_asset_library_refs()) {
+if (!ED_assetlist_is_loaded(&library)) {
+  return false;
+}
   }
+  return true;
 }
 
-static AssetItemTree build_catalog_tree(const bContext &C, const bNodeTree 
&node_tree)
+static AssetItemTree build_catalog_tree(const bContext &C, const bNodeTree 
*node_tree)
 {
+  if (!node_tree) {
+return {};
+  }
   const Main &bmain = *CTX_data_main(&C);
   const Vector all_libraries = 
bke::all_asset_library_refs();
 
@@ -94,7 +93,7 @@ static AssetItemTree build_catalog_tree(const bContext &C, 
const bNodeTree &node
   }
   const AssetMetaData &meta_data = *ED_asset_handle_get_metadata(&asset);
   const IDProperty *tree_type = BKE_asset_metadata_idprop_find(&meta_data, 
"type");
-  if (tree_type == nullptr || IDP_Int(tree_type) != node_tree.type) {
+  if (tree_type == nullptr || IDP_Int(tree_type) != node_tree->type) {
 return true;
   }
   if (BLI_uuid_is_nil(meta_data.catalog_id)) {
@@ -163,49 +162,53 @@ static void node_add_catalog_assets_draw(const bContext 
*C, Menu *menu)
   uiItemS(layout);
 
   for (const LibraryAsset &item : asset_items) {
-uiLayout *row = uiLayoutColumn(layout, false);
+uiLayout *col = uiLayoutColumn(layout, false);
 PointerRNA file{
 &screen.id, &RNA_FileSelectEntry, const_cast(item.handle.file_data)};
-uiLayoutSetContextPointer(row, "active_file", &file);
+uiLayoutSetContextPointer(col, "active_file", &file);
 
 PointerRNA library_ptr{&screen.id,
&RNA_AssetLibraryReference,
const_cast(&item.library_ref)};
-uiLayoutSetContextPointer(row, "asset_library_ref", &library_ptr);
+uiLayoutSe

[Bf-blender-cvs] [b280dce0a48] node-add-asset-menu: Merge branch 'master' into node-add-asset-menu

2022-10-17 Thread Hans Goudey
Commit: b280dce0a489720fb86820666317506c5fba50cd
Author: Hans Goudey
Date:   Mon Oct 17 13:22:35 2022 -0500
Branches: node-add-asset-menu
https://developer.blender.org/rBb280dce0a489720fb86820666317506c5fba50cd

Merge branch 'master' into node-add-asset-menu

===



===



___
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] [50a30043283] universal-scene-description: USD Import: support reading USD shapes.

2022-10-17 Thread Michael Kowalski
Commit: 50a300432838d8f731bf567d6914fff5fc140080
Author: Michael Kowalski
Date:   Mon Oct 17 15:11:42 2022 -0400
Branches: universal-scene-description
https://developer.blender.org/rB50a300432838d8f731bf567d6914fff5fc140080

USD Import: support reading USD shapes.

Added readers for importing USD shapes (capsule, cylinder,
cone, cube and sphere) as meshes.  Implemented by Charles
Wardlaw.

===

M   source/blender/editors/io/io_usd.c
M   source/blender/io/usd/CMakeLists.txt
M   source/blender/io/usd/intern/usd_capi_import.cc
A   source/blender/io/usd/intern/usd_reader_shape.cc
A   source/blender/io/usd/intern/usd_reader_shape.h
M   source/blender/io/usd/intern/usd_reader_stage.cc
M   source/blender/io/usd/intern/usd_reader_stage.h
M   source/blender/io/usd/usd.h

===

diff --git a/source/blender/editors/io/io_usd.c 
b/source/blender/editors/io/io_usd.c
index ca0df20a45e..0998fc77b01 100644
--- a/source/blender/editors/io/io_usd.c
+++ b/source/blender/editors/io/io_usd.c
@@ -1060,6 +1060,7 @@ static int wm_usd_import_exec(bContext *C, wmOperator *op)
   const bool import_blendshapes = RNA_boolean_get(op->ptr, 
"import_blendshapes");
   const bool import_volumes = RNA_boolean_get(op->ptr, "import_volumes");
   const bool import_skeletons = RNA_boolean_get(op->ptr, "import_skeletons");
+  const bool import_shapes = RNA_boolean_get(op->ptr, "import_shapes");
 
   const bool import_subdiv = RNA_boolean_get(op->ptr, "import_subdiv");
 
@@ -1144,7 +1145,8 @@ static int wm_usd_import_exec(bContext *C, wmOperator *op)
.scale_light_radius = scale_light_radius,
.create_background_shader = 
create_background_shader,
.mtl_name_collision_mode = 
mtl_name_collision_mode,
-   .attr_import_mode = attr_import_mode};
+   .attr_import_mode = attr_import_mode,
+   .import_shapes = import_shapes};
 
   const bool ok = USD_import(C, filename, ¶ms, as_background_job);
 
@@ -1169,6 +1171,7 @@ static void wm_usd_import_draw(bContext *UNUSED(C), 
wmOperator *op)
   uiItemR(col, ptr, "import_blendshapes", 0, NULL, ICON_NONE);
   uiItemR(col, ptr, "import_volumes", 0, NULL, ICON_NONE);
   uiItemR(col, ptr, "import_skeletons", 0, NULL, ICON_NONE);
+  uiItemR(col, ptr, "import_shapes", 0, NULL, ICON_NONE);
   uiItemR(box, ptr, "prim_path_mask", 0, NULL, ICON_NONE);
   uiItemR(box, ptr, "scale", 0, NULL, ICON_NONE);
   uiItemR(box, ptr, "apply_unit_conversion_scale", 0, NULL, ICON_NONE);
@@ -1267,6 +1270,7 @@ void WM_OT_usd_import(struct wmOperatorType *ot)
   RNA_def_boolean(ot->srna, "import_blendshapes", true, "Blend Shapes", "");
   RNA_def_boolean(ot->srna, "import_volumes", true, "Volumes", "");
   RNA_def_boolean(ot->srna, "import_skeletons", true, "Skeletons", "");
+  RNA_def_boolean(ot->srna, "import_shapes", true, "USD Shapes", "");
 
   RNA_def_boolean(ot->srna,
   "import_subdiv",
diff --git a/source/blender/io/usd/CMakeLists.txt 
b/source/blender/io/usd/CMakeLists.txt
index 4a77bb32544..28cbf158a01 100644
--- a/source/blender/io/usd/CMakeLists.txt
+++ b/source/blender/io/usd/CMakeLists.txt
@@ -74,6 +74,7 @@ set(SRC
   intern/usd_reader_camera.cc
   intern/usd_reader_curve.cc
   intern/usd_reader_geom.cc
+   intern/usd_reader_shape.cc
   intern/usd_reader_instance.cc
   intern/usd_reader_light.cc
   intern/usd_reader_material.cc
@@ -114,6 +115,7 @@ set(SRC
   intern/usd_reader_camera.h
   intern/usd_reader_curve.h
   intern/usd_reader_geom.h
+   intern/usd_reader_shape.h
   intern/usd_reader_instance.h
   intern/usd_reader_light.h
   intern/usd_reader_material.h
@@ -179,6 +181,7 @@ endif()
 # Source: 
https://github.com/PixarAnimationStudios/USD/blob/master/BUILDING.md#linking-whole-archives
 if(WIN32)
   target_link_libraries(bf_usd INTERFACE ${USD_LIBRARIES})
+  target_compile_options(bf_usd PRIVATE /w34101)
 elseif(APPLE)
   target_link_libraries(bf_usd INTERFACE -Wl,-force_load ${USD_LIBRARIES})
 elseif(UNIX)
diff --git a/source/blender/io/usd/intern/usd_capi_import.cc 
b/source/blender/io/usd/intern/usd_capi_import.cc
index 1d005f92116..791ddc351e8 100644
--- a/source/blender/io/usd/intern/usd_capi_import.cc
+++ b/source/blender/io/usd/intern/usd_capi_import.cc
@@ -339,6 +339,7 @@ static void report_job_duration(const ImportJobData *data)
   std::cout << '\n';
 }
 
+
 static void import_startjob(void *customdata, short *stop, short *do_update, 
float *progress)
 {
   ImportJobData *data = static_cast(customdata);
diff --git a/source/blender/io/usd/intern/usd_reader_shape.cc 
b/source/blender/io/usd/intern/usd_reader_shape.cc
new file mode 100644
index 000..92597c290ee
--- /dev/null
+++ b/source/blender/io/usd/intern/u

[Bf-blender-cvs] [23ea72f0510] master: Cleanup: Move versioning_defaults.c to C++

2022-10-17 Thread Hans Goudey
Commit: 23ea72f051028c8980736eee157f3fabc0615dd5
Author: Hans Goudey
Date:   Mon Oct 17 13:00:37 2022 -0500
Branches: master
https://developer.blender.org/rB23ea72f051028c8980736eee157f3fabc0615dd5

Cleanup: Move versioning_defaults.c to C++

===

M   source/blender/blenloader/CMakeLists.txt
R083source/blender/blenloader/intern/versioning_defaults.c  
source/blender/blenloader/intern/versioning_defaults.cc

===

diff --git a/source/blender/blenloader/CMakeLists.txt 
b/source/blender/blenloader/CMakeLists.txt
index f0209d1337c..86793d38b0b 100644
--- a/source/blender/blenloader/CMakeLists.txt
+++ b/source/blender/blenloader/CMakeLists.txt
@@ -47,7 +47,7 @@ set(SRC
   intern/versioning_400.cc
   intern/versioning_common.cc
   intern/versioning_cycles.c
-  intern/versioning_defaults.c
+  intern/versioning_defaults.cc
   intern/versioning_dna.c
   intern/versioning_legacy.c
   intern/versioning_userdef.c
diff --git a/source/blender/blenloader/intern/versioning_defaults.c 
b/source/blender/blenloader/intern/versioning_defaults.cc
similarity index 83%
rename from source/blender/blenloader/intern/versioning_defaults.c
rename to source/blender/blenloader/intern/versioning_defaults.cc
index 06903865381..8917654de85 100644
--- a/source/blender/blenloader/intern/versioning_defaults.c
+++ b/source/blender/blenloader/intern/versioning_defaults.cc
@@ -15,6 +15,7 @@
 
 #include "BLI_listbase.h"
 #include "BLI_math.h"
+#include "BLI_math_vec_types.hh"
 #include "BLI_string.h"
 #include "BLI_system.h"
 #include "BLI_utildefines.h"
@@ -119,7 +120,7 @@ static void blo_update_defaults_screen(bScreen *screen,
 
 if (area->spacetype == SPACE_IMAGE) {
   if (STREQ(workspace_name, "UV Editing")) {
-SpaceImage *sima = area->spacedata.first;
+SpaceImage *sima = static_cast(area->spacedata.first);
 if (sima->mode == SI_MODE_VIEW) {
   sima->mode = SI_MODE_UV;
 }
@@ -127,7 +128,7 @@ static void blo_update_defaults_screen(bScreen *screen,
 }
 else if (area->spacetype == SPACE_ACTION) {
   /* Show markers region, hide channels and collapse summary in timelines. 
*/
-  SpaceAction *saction = area->spacedata.first;
+  SpaceAction *saction = static_cast(area->spacedata.first);
   saction->flag |= SACTION_SHOW_MARKERS;
   if (saction->mode == SACTCONT_TIMELINE) {
 saction->ads.flag |= ADS_FLAG_SUMMARY_COLLAPSED;
@@ -148,15 +149,15 @@ static void blo_update_defaults_screen(bScreen *screen,
   }
 }
 else if (area->spacetype == SPACE_GRAPH) {
-  SpaceGraph *sipo = area->spacedata.first;
+  SpaceGraph *sipo = static_cast(area->spacedata.first);
   sipo->flag |= SIPO_SHOW_MARKERS;
 }
 else if (area->spacetype == SPACE_NLA) {
-  SpaceNla *snla = area->spacedata.first;
+  SpaceNla *snla = static_cast(area->spacedata.first);
   snla->flag |= SNLA_SHOW_MARKERS;
 }
 else if (area->spacetype == SPACE_SEQ) {
-  SpaceSeq *seq = area->spacedata.first;
+  SpaceSeq *seq = static_cast(area->spacedata.first);
   seq->flag |= SEQ_SHOW_MARKERS | SEQ_ZOOM_TO_FIT | SEQ_USE_PROXIES | 
SEQ_SHOW_OVERLAY;
   seq->render_size = SEQ_RENDER_SIZE_PROXY_100;
   seq->timeline_overlay.flag |= SEQ_TIMELINE_SHOW_STRIP_SOURCE | 
SEQ_TIMELINE_SHOW_STRIP_NAME |
@@ -166,12 +167,12 @@ static void blo_update_defaults_screen(bScreen *screen,
 }
 else if (area->spacetype == SPACE_TEXT) {
   /* Show syntax and line numbers in Script workspace text editor. */
-  SpaceText *stext = area->spacedata.first;
+  SpaceText *stext = static_cast(area->spacedata.first);
   stext->showsyntax = true;
   stext->showlinenrs = true;
 }
 else if (area->spacetype == SPACE_VIEW3D) {
-  View3D *v3d = area->spacedata.first;
+  View3D *v3d = static_cast(area->spacedata.first);
   /* Screen space cavity by default for faster performance. */
   v3d->shading.cavity_type = V3D_SHADING_CAVITY_CURVATURE;
   v3d->shading.flag |= V3D_SHADING_SPECULAR_HIGHLIGHT;
@@ -195,7 +196,7 @@ static void blo_update_defaults_screen(bScreen *screen,
   v3d->overlay.normals_constant_screen_size = 7.0f;
 }
 else if (area->spacetype == SPACE_CLIP) {
-  SpaceClip *sclip = area->spacedata.first;
+  SpaceClip *sclip = static_cast(area->spacedata.first);
   sclip->around = V3D_AROUND_CENTER_MEDIAN;
   sclip->mask_info.blend_factor = 0.7f;
   sclip->mask_info.draw_flag = MASK_DRAWFLAG_SPLINE;
@@ -206,7 +207,9 @@ static void blo_update_defaults_screen(bScreen *screen,
   const bool hide_image_tool_header = STREQ(workspace_name, "Rendering");
   LISTBASE_FOREACH (ScrArea *, area, &screen->areabase) {
 LISTBASE_FOREACH (SpaceLink *, sl, &area->spacedata) {
-  ListBase *regionbase = (sl == area->spacedata.first) ? &area->regionbase 
: &sl->regionbase;
+

[Bf-blender-cvs] [e8291f4504d] master: Sculpt: Remove face sets from default cube

2022-10-17 Thread Hans Goudey
Commit: e8291f4504d320ea1eac0601a9b99263fbf305e8
Author: Hans Goudey
Date:   Mon Oct 17 13:11:50 2022 -0500
Branches: master
https://developer.blender.org/rBe8291f4504d320ea1eac0601a9b99263fbf305e8

Sculpt: Remove face sets from default cube

As discussed in T101623, since face sets have become optionally stored,
(see b5f7af31d6d474c3b4) the default cube shouldn't have face sets--
they should be created explicitly by the user instead. This may improve
performance when modifying the default cube mesh.

===

M   source/blender/blenloader/intern/versioning_defaults.cc

===

diff --git a/source/blender/blenloader/intern/versioning_defaults.cc 
b/source/blender/blenloader/intern/versioning_defaults.cc
index 8917654de85..da23e9cb49f 100644
--- a/source/blender/blenloader/intern/versioning_defaults.cc
+++ b/source/blender/blenloader/intern/versioning_defaults.cc
@@ -37,6 +37,7 @@
 #include "DNA_workspace_types.h"
 
 #include "BKE_appdir.h"
+#include "BKE_attribute.hh"
 #include "BKE_brush.h"
 #include "BKE_colortools.h"
 #include "BKE_curveprofile.h"
@@ -576,6 +577,7 @@ void BLO_update_defaults_startup_blend(Main *bmain, const 
char *app_template)
   CustomData_free_layers(&mesh->vdata, CD_PAINT_MASK, mesh->totvert);
   CustomData_free_layers(&mesh->ldata, CD_GRID_PAINT_MASK, mesh->totloop);
 }
+mesh->attributes_for_write().remove(".sculpt_face_set");
   }
 
   LISTBASE_FOREACH (Camera *, camera, &bmain->cameras) {

___
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] [603a534f09b] master: Fix T101850: Cycles DDS oversaturation when alpha is in use

2022-10-17 Thread Aras Pranckevicius
Commit: 603a534f09b0f94f599c607240a4934f7c1a2ef6
Author: Aras Pranckevicius
Date:   Mon Oct 17 21:03:17 2022 +0300
Branches: master
https://developer.blender.org/rB603a534f09b0f94f599c607240a4934f7c1a2ef6

Fix T101850: Cycles DDS oversaturation when alpha is in use

DDS files coming through OIIO needed a similar treatment as TGA in
T99565; just for DDS OIIO just never set the "unassociated alpha"
attribute. Fixes T101850.

Reviewed By: Brecht Van Lommel
Differential Revision: https://developer.blender.org/D16270

===

M   intern/cycles/scene/image_oiio.cpp

===

diff --git a/intern/cycles/scene/image_oiio.cpp 
b/intern/cycles/scene/image_oiio.cpp
index d59359970c6..7bcf1ccb073 100644
--- a/intern/cycles/scene/image_oiio.cpp
+++ b/intern/cycles/scene/image_oiio.cpp
@@ -196,11 +196,16 @@ bool OIIOImageLoader::load_pixels(const ImageMetaData 
&metadata,
   if (associate_alpha) {
 do_associate_alpha = spec.get_int_attribute("oiio:UnassociatedAlpha", 0);
 
-/* Workaround OIIO not detecting TGA file alpha the same as Blender (since 
#3019).
- * We want anything not marked as premultiplied alpha to get associated. */
-if (!do_associate_alpha && spec.alpha_channel != -1 &&
-strcmp(in->format_name(), "targa") == 0) {
-  do_associate_alpha = spec.get_int_attribute("targa:alpha_type", -1) != 4;
+if (!do_associate_alpha && spec.alpha_channel != -1) {
+  /* Workaround OIIO not detecting TGA file alpha the same as Blender 
(since #3019).
+   * We want anything not marked as premultiplied alpha to get associated. 
*/
+  if (strcmp(in->format_name(), "targa") == 0) {
+do_associate_alpha = spec.get_int_attribute("targa:alpha_type", -1) != 
4;
+  }
+  /* OIIO DDS reader never sets UnassociatedAlpha attribute. */
+  if (strcmp(in->format_name(), "dds") == 0) {
+do_associate_alpha = true;
+  }
 }
   }

___
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] [921166c0628] tmp_libs_34: Deps builder: Initial pass as deps update for 3.4

2022-10-17 Thread Ray Molenkamp
Commit: 921166c062841600a5e1079fc272c64ef0d3aa29
Author: Ray Molenkamp
Date:   Mon Oct 17 17:50:34 2022 -0600
Branches: tmp_libs_34
https://developer.blender.org/rB921166c062841600a5e1079fc272c64ef0d3aa29

Deps builder: Initial pass as deps update for 3.4

This was mostly just bumping deps with known CVE's
the only exception was OIIO/OSL. OIIO needed a rebuild
anyhow because of openjpeg, so was it was no effort to
bump it to 2.4.x where some of the work @aras_p has
been doing had been landed, also I think there were some
drastic perf improvements with one of the USD sample scenes.

|dep|old|new|
|zlib|1.2.12|1.2.13|
|freetype|2.11.1|2.12.1|
|openimageio|2.3.13.0|2.4.4.2|
|OSL|1.11.17.0|1.12.6.2|
|python|3.10.2|3.10.8|
|openjpeg|2.4.0|2.5.0|
|ffmpeg|5.0|5.1.2|
|sndfile|1.0.28|1.1.0|
|xml2|2.9.10|2.10.3|
|expat|2.4.4|2.4.9|
|openssl|1.1.1g/i|1.1.1q|
|sqlite|3.31.1|3.37.2|
|openpgl|0.3.1-beta|0.4.0-beta|

This diff is mostly just so we can get an easy overview of the
changes being done, please do any work in the `tmp_libs_34` branch.
(and update this diff occasionally)

Notable changes:

AOM : the hack we had in place to make it not detect
pthreads on windows no longer worked with a more
recent cmake version. Disabled pthreads with a diff
(windows only)

Python:
Python had an embedded copy of zlib 2.1.12 swapped it
out for our 2.1.13 copy with some folder manipulation
on windows.

Freetype:
Freetype was harbouring a copy of zlib 2.1.12 as well,
so that had to end.

FFMpeg:
The patch we had in place for D11796 no longer applies,
and it doesn't look like it is needed any-more, but i
was unable to verify this since the original problem
only showed on mac.

There is a new patch to deal with simple_idct.asm
generating an object file with no sections in it,
upsetting strip, causing a build error. This is a
backport from an upstream commit.

SQLITE:
They changed their filenames a bit, given python takes
care of these on windows, i hope i picked the right one.

OSL:
OSL has an extra lib now: oslnoise. this may need
adjustments in the platform/find cmake files for that.

TINYXML:
was still being downloaded, but nothing seemingly uses
it, as there are no build scripts for it. Removed it
from versions/download.cmake

===

M   build_files/build_environment/cmake/aom.cmake
M   build_files/build_environment/cmake/download.cmake
M   build_files/build_environment/cmake/ffmpeg.cmake
M   build_files/build_environment/cmake/freetype.cmake
M   build_files/build_environment/cmake/osl.cmake
M   build_files/build_environment/cmake/python.cmake
M   build_files/build_environment/cmake/versions.cmake
M   build_files/build_environment/dependencies.dot
A   build_files/build_environment/patches/aom.diff
M   build_files/build_environment/patches/ffmpeg.diff
M   build_files/build_environment/patches/osl.diff
D   build_files/build_environment/patches/python_windows.diff
M   build_files/cmake/platform/platform_win32.cmake

===

diff --git a/build_files/build_environment/cmake/aom.cmake 
b/build_files/build_environment/cmake/aom.cmake
index 9f64439771f..9d5fbd24787 100644
--- a/build_files/build_environment/cmake/aom.cmake
+++ b/build_files/build_environment/cmake/aom.cmake
@@ -8,11 +8,6 @@ if(WIN32)
   # building with mingw, it'll have an unhappy time with that and
   # we need to clear them out.
   set(AOM_CMAKE_FLAGS )
-  # CMake will correctly identify phreads being available, however
-  # we do not want to use them, as that gains a dependency on
-  # libpthreadswin.dll which we do not want. when pthreads is not
-  # available oam will use a pthreads emulation layer using win32 threads
-  set(AOM_EXTRA_ARGS_WIN32 -DCMAKE_HAVE_PTHREAD_H=OFF)
 else()
   set(AOM_GENERATOR "Unix Makefiles")
   set(AOM_CMAKE_FLAGS ${DEFAULT_CMAKE_FLAGS})
@@ -36,6 +31,7 @@ ExternalProject_Add(external_aom
   DOWNLOAD_DIR ${DOWNLOAD_DIR}
   URL_HASH ${AOM_HASH_TYPE}=${AOM_HASH}
   PREFIX ${BUILD_DIR}/aom
+  PATCH_COMMAND ${PATCH_CMD} --verbose -p 1 -N -d 
${BUILD_DIR}/aom/src/external_aom < ${PATCH_DIR}/aom.diff  
   CONFIGURE_COMMAND ${CONFIGURE_ENV} &&
 cd ${BUILD_DIR}/aom/src/external_aom-build/ &&
 ${CMAKE_COMMAND} -G "${AOM_GENERATOR}" 
-DCMAKE_INSTALL_PREFIX=${LIBDIR}/aom ${AOM_CMAKE_FLAGS} ${AOM_EXTRA_ARGS} 
${BUILD_DIR}/aom/src/external_aom/
diff --git a/build_files/build_environment/cmake/download.cmake 
b/build_files/build_environment/cmake/download.cmake
index 35bc028a1e3..8d75f0ff0ed 100644
--- a/build_files/build_environment/cmake/download.cmake
+++ b/build_files/build_environment/cmake/download.cmake
@@ -62,7 +62,7 @@ function(download_source dep)
 # since the actual build of the dep will notify the
 # platform maintainer if there is a problem with the
 # source package and refuse to build.
-if(NOT PACKAGE_USE_UPSTREAM_SOURCES)
+if(NOT PACK

[Bf-blender-cvs] [728451f01ad] master: Fix T101871: Realize instances node can skip material indices

2022-10-17 Thread Hans Goudey
Commit: 728451f01ad5eec6abdc4f54364fe82490b151c5
Author: Hans Goudey
Date:   Mon Oct 17 12:21:30 2022 -0500
Branches: master
https://developer.blender.org/rB728451f01ad5eec6abdc4f54364fe82490b151c5

Fix T101871: Realize instances node can skip material indices

The node only created a material index attribute on the result mesh
if it existed on any of the input meshes. But the input meshes might
not have the attribute if they had a single material or no materials.
As a fix, also create the attribute if the result has more than one
material.

===

M   source/blender/geometry/intern/realize_instances.cc

===

diff --git a/source/blender/geometry/intern/realize_instances.cc 
b/source/blender/geometry/intern/realize_instances.cc
index daafe0e4aa7..c649bde06ca 100644
--- a/source/blender/geometry/intern/realize_instances.cc
+++ b/source/blender/geometry/intern/realize_instances.cc
@@ -859,6 +859,7 @@ static AllMeshesInfo preprocess_meshes(const GeometrySet 
&geometry_set,
   }
 }
   }
+  info.create_material_index_attribute |= info.materials.size() > 1;
   info.realize_info.reinitialize(info.order.size());
   for (const int mesh_index : info.realize_info.index_range()) {
 MeshRealizeInfo &mesh_info = info.realize_info[mesh_index];

___
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] [d3b47fa8429] master: FIX T101445: halo Particles are not working.

2022-10-17 Thread Jason Fielder
Commit: d3b47fa84297dbbf5d5f91d0d68473468c363bd4
Author: Jason Fielder
Date:   Mon Oct 17 17:39:59 2022 +0200
Branches: master
https://developer.blender.org/rBd3b47fa84297dbbf5d5f91d0d68473468c363bd4

FIX T101445: halo Particles are not working.

color uniform assignment needing to be changed to ucolor was missed.

Ref T101445

Reviewed By: fclem

Maniphest Tasks: T101445

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

===

M   source/blender/draw/engines/overlay/overlay_particle.cc

===

diff --git a/source/blender/draw/engines/overlay/overlay_particle.cc 
b/source/blender/draw/engines/overlay/overlay_particle.cc
index 6f77a777ba0..c9e3ccba008 100644
--- a/source/blender/draw/engines/overlay/overlay_particle.cc
+++ b/source/blender/draw/engines/overlay/overlay_particle.cc
@@ -181,14 +181,14 @@ void OVERLAY_particle_cache_populate(OVERLAY_Data 
*vedata, Object *ob)
 default:
 case PART_DRAW_DOT:
   grp = DRW_shgroup_create_sub(pd->particle_dots_grp);
-  DRW_shgroup_uniform_vec4_copy(grp, "color", color);
+  DRW_shgroup_uniform_vec4_copy(grp, "ucolor", color);
   DRW_shgroup_call(grp, geom, nullptr);
   break;
 case PART_DRAW_AXIS:
 case PART_DRAW_CIRC:
 case PART_DRAW_CROSS:
   grp = DRW_shgroup_create_sub(pd->particle_shapes_grp);
-  DRW_shgroup_uniform_vec4_copy(grp, "color", color);
+  DRW_shgroup_uniform_vec4_copy(grp, "ucolor", color);
   shape = DRW_cache_particles_get_prim(draw_as);
   DRW_shgroup_call_instances_with_attrs(grp, nullptr, shape, geom);
   break;

___
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] [06d9027e221] gpencil-new-data-proposal: Merge branch 'master' into gpencil-new-data-proposal

2022-10-17 Thread Antonio Vazquez
Commit: 06d9027e221c249105341dc1ecdeae6f8cbe5b3f
Author: Antonio Vazquez
Date:   Mon Oct 17 17:41:40 2022 +0200
Branches: gpencil-new-data-proposal
https://developer.blender.org/rB06d9027e221c249105341dc1ecdeae6f8cbe5b3f

Merge branch 'master' into gpencil-new-data-proposal

===



===



___
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] [694481095ba] master: Fix for T101506: BLF Disable Kerning in Main Font

2022-10-17 Thread Harley Acheson
Commit: 694481095baca58d13474aed26ee7619615399b2
Author: Harley Acheson
Date:   Mon Oct 17 08:35:11 2022 -0700
Branches: master
https://developer.blender.org/rB694481095baca58d13474aed26ee7619615399b2

Fix for T101506: BLF Disable Kerning in Main Font

Disable kerning in our main font to exactly restore the spacing of text
as seen in Blender 3.1 - 3.3

See D16186 for more details.

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

Reviewed by Brecht Van Lommel

===

M   source/blender/blenfont/intern/blf.c

===

diff --git a/source/blender/blenfont/intern/blf.c 
b/source/blender/blenfont/intern/blf.c
index a673f4a1bc7..d4f5be617fd 100644
--- a/source/blender/blenfont/intern/blf.c
+++ b/source/blender/blenfont/intern/blf.c
@@ -162,6 +162,14 @@ int BLF_load_unique(const char *name)
   }
 
   FontBLF *font = blf_font_new(name, filepath);
+
+  /* XXX: Temporarily disable kerning in our main font. Kerning had been 
accidentally removed from
+   * our font in 3.1. In 3.4 we disable kerning here in the new version to 
keep spacing the same
+   * (T101506). Enable again later with change of font, placement, or 
rendering - Harley. */
+  if (font && BLI_str_endswith(filepath, BLF_DEFAULT_PROPORTIONAL_FONT)) {
+font->face_flags &= ~FT_FACE_FLAG_KERNING;
+  }
+
   MEM_freeN(filepath);
 
   if (!font) {

___
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] [67e053b1fb2] temp-gpencil-automask: Fix merge error

2022-10-17 Thread Antonio Vazquez
Commit: 67e053b1fb2fd73f6bdc41bd51cd6d751a263de5
Author: Antonio Vazquez
Date:   Mon Oct 17 16:59:46 2022 +0200
Branches: temp-gpencil-automask
https://developer.blender.org/rB67e053b1fb2fd73f6bdc41bd51cd6d751a263de5

Fix merge error

===

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

===

diff --git a/release/scripts/startup/bl_ui/space_view3d.py 
b/release/scripts/startup/bl_ui/space_view3d.py
index ff7774529a1..d9abad1f790 100644
--- a/release/scripts/startup/bl_ui/space_view3d.py
+++ b/release/scripts/startup/bl_ui/space_view3d.py
@@ -837,20 +837,18 @@ class VIEW3D_HT_header(Header):
 panel="VIEW3D_PT_gpencil_guide",
 text="Guides",
 )
-
-elif object_mode == 'SCULPT':
-layout.popover(
-panel="VIEW3D_PT_sculpt_automasking",
-text="",
-icon="MOD_MASK"
-)
-
 if object_mode == 'SCULPT_GPENCIL':
 layout.popover(
panel="VIEW3D_PT_gpencil_sculpt_automasking",
text="",
icon="MOD_MASK"
 )
+elif object_mode == 'SCULPT':
+layout.popover(
+panel="VIEW3D_PT_sculpt_automasking",
+text="",
+icon="MOD_MASK"
+)
 else:
 # Transform settings depending on tool header visibility
 VIEW3D_HT_header.draw_xform_template(layout, context)

___
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] [3150277d0cb] temp-gpencil-automask: Merge branch 'master' into temp-gpencil-automask

2022-10-17 Thread Antonio Vazquez
Commit: 3150277d0cb5b466e910db49974e8b3bb26d0405
Author: Antonio Vazquez
Date:   Mon Oct 17 16:57:31 2022 +0200
Branches: temp-gpencil-automask
https://developer.blender.org/rB3150277d0cb5b466e910db49974e8b3bb26d0405

Merge branch 'master' into temp-gpencil-automask

===



===

diff --cc release/scripts/startup/bl_ui/space_view3d.py
index 9308a3e8082,ea257498e11..ff7774529a1
--- a/release/scripts/startup/bl_ui/space_view3d.py
+++ b/release/scripts/startup/bl_ui/space_view3d.py
@@@ -838,14 -838,13 +838,19 @@@ class VIEW3D_HT_header(Header)
  text="Guides",
  )
  
+ elif object_mode == 'SCULPT':
+ layout.popover(
+ panel="VIEW3D_PT_sculpt_automasking",
+ text="",
+ icon="MOD_MASK"
+ )
+ 
 +if object_mode == 'SCULPT_GPENCIL':
 +layout.popover(
 +   panel="VIEW3D_PT_gpencil_sculpt_automasking",
 +   text="",
 +   icon="MOD_MASK"
 +)
- 
- layout.separator_spacer()
  else:
  # Transform settings depending on tool header visibility
  VIEW3D_HT_header.draw_xform_template(layout, context)

___
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] [c98268d3f56] blender-v3.3-release: DRW: fix use of potentially uninitialized variable

2022-10-17 Thread Germano Cavalcante
Commit: c98268d3f56dd6d448584872c00aceda6b91ccfe
Author: Germano Cavalcante
Date:   Thu Oct 6 15:00:35 2022 -0300
Branches: blender-v3.3-release
https://developer.blender.org/rBc98268d3f56dd6d448584872c00aceda6b91ccfe

DRW: fix use of potentially uninitialized variable

Bug introduced in rB6774cae3f25b.

This causes undefined behavior in `DRW_state_draw_support()` making
overlay depth drawing unpredictable.

===

M   source/blender/draw/DRW_engine.h
M   source/blender/draw/intern/draw_manager.c
M   source/blender/editors/space_view3d/view3d_draw.c

===

diff --git a/source/blender/draw/DRW_engine.h b/source/blender/draw/DRW_engine.h
index dec7a22aadb..8c5f1b70cc0 100644
--- a/source/blender/draw/DRW_engine.h
+++ b/source/blender/draw/DRW_engine.h
@@ -126,14 +126,10 @@ void DRW_draw_select_loop(struct Depsgraph *depsgraph,
 void DRW_draw_depth_loop(struct Depsgraph *depsgraph,
  struct ARegion *region,
  struct View3D *v3d,
- struct GPUViewport *viewport);
-/**
- * Converted from #ED_view3d_draw_depth_gpencil (legacy drawing).
- */
-void DRW_draw_depth_loop_gpencil(struct Depsgraph *depsgraph,
- struct ARegion *region,
- struct View3D *v3d,
- struct GPUViewport *viewport);
+ struct GPUViewport *viewport,
+ const bool use_gpencil,
+ const bool use_basic,
+ const bool use_overlay);
 /**
  * Clears the Depth Buffer and draws only the specified object.
  */
diff --git a/source/blender/draw/intern/draw_manager.c 
b/source/blender/draw/intern/draw_manager.c
index b2422504825..fcada20e5fb 100644
--- a/source/blender/draw/intern/draw_manager.c
+++ b/source/blender/draw/intern/draw_manager.c
@@ -2534,13 +2534,13 @@ void DRW_draw_select_loop(struct Depsgraph *depsgraph,
 /**
  * object mode select-loop, see: ED_view3d_draw_depth_loop (legacy drawing).
  */
-static void drw_draw_depth_loop_impl(struct Depsgraph *depsgraph,
- ARegion *region,
- View3D *v3d,
- GPUViewport *viewport,
- const bool use_gpencil,
- const bool use_basic,
- const bool use_overlay)
+void DRW_draw_depth_loop(struct Depsgraph *depsgraph,
+ ARegion *region,
+ View3D *v3d,
+ GPUViewport *viewport,
+ const bool use_gpencil,
+ const bool use_basic,
+ const bool use_overlay)
 {
   Scene *scene = DEG_get_evaluated_scene(depsgraph);
   RenderEngineType *engine_type = ED_view3d_engine_type(scene, 
v3d->shading.type);
@@ -2649,23 +2649,6 @@ static void drw_draw_depth_loop_impl(struct Depsgraph 
*depsgraph,
   drw_manager_exit(&DST);
 }
 
-void DRW_draw_depth_loop(struct Depsgraph *depsgraph,
- ARegion *region,
- View3D *v3d,
- GPUViewport *viewport)
-{
-  drw_draw_depth_loop_impl(
-  depsgraph, region, v3d, viewport, false, true, DRW_state_draw_support());
-}
-
-void DRW_draw_depth_loop_gpencil(struct Depsgraph *depsgraph,
- ARegion *region,
- View3D *v3d,
- GPUViewport *viewport)
-{
-  drw_draw_depth_loop_impl(depsgraph, region, v3d, viewport, true, false, 
false);
-}
-
 void DRW_draw_select_id(Depsgraph *depsgraph, ARegion *region, View3D *v3d, 
const rcti *rect)
 {
   SELECTID_Context *sel_ctx = DRW_select_engine_context_get();
diff --git a/source/blender/editors/space_view3d/view3d_draw.c 
b/source/blender/editors/space_view3d/view3d_draw.c
index df5ff163cf2..f854b5d18af 100644
--- a/source/blender/editors/space_view3d/view3d_draw.c
+++ b/source/blender/editors/space_view3d/view3d_draw.c
@@ -2332,10 +2332,11 @@ void ED_view3d_depth_override(Depsgraph *depsgraph,
   if (viewport != NULL) {
 switch (mode) {
   case V3D_DEPTH_NO_GPENCIL:
-DRW_draw_depth_loop(depsgraph, region, v3d, viewport);
+DRW_draw_depth_loop(
+depsgraph, region, v3d, viewport, false, true, (v3d->flag2 & 
V3D_HIDE_OVERLAYS) == 0);
 break;
   case V3D_DEPTH_GPENCIL_ONLY:
-DRW_draw_depth_loop_gpencil(depsgraph, region, v3d, viewport);
+DRW_draw_depth_loop(depsgraph, region, v3d, viewport, true, false, 
false);
 break;
   case V3D_DEPTH_OBJECT_ONLY:
 DRW_draw_depth_object(

___
Bf-blender-cvs mailing list
Bf-blender-cvs@blender.org
List detail

[Bf-blender-cvs] [86f8898ccd3] blender-v3.3-release: Fix T101618: Freeze when reloading a library in certain situation

2022-10-17 Thread Philipp Oeser
Commit: 86f8898ccd3b6981572e6765f15dc6c42be7692c
Author: Philipp Oeser
Date:   Thu Oct 6 12:10:26 2022 +0200
Branches: blender-v3.3-release
https://developer.blender.org/rB86f8898ccd3b6981572e6765f15dc6c42be7692c

Fix T101618: Freeze when reloading a library in certain situation

Freeze happened when reloading a library while having an Object property
with a custom getter function defined in Python.

Just piggybacking on rB62eb21e3ce87, this just applies the same fix (use
the BPy_BEGIN/END_ALLOW_THREADS macros) to relading from RNA/py.

All credit goes to @brecht and @mont29.

Maniphest Tasks: T101618

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

===

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 242bfd99eae..293386d2f37 100644
--- a/source/blender/makesrna/intern/rna_ID.c
+++ b/source/blender/makesrna/intern/rna_ID.c
@@ -1392,6 +1392,19 @@ static void rna_Library_version_get(PointerRNA *ptr, int 
*value)
   value[2] = lib->subversionfile;
 }
 
+static void rna_Library_reload(Library *lib, bContext *C, ReportList *reports)
+{
+#  ifdef WITH_PYTHON
+  BPy_BEGIN_ALLOW_THREADS;
+#  endif
+
+  WM_lib_reload(lib, C, reports);
+
+#  ifdef WITH_PYTHON
+  BPy_END_ALLOW_THREADS;
+#  endif
+}
+
 #else
 
 static void rna_def_ID_properties(BlenderRNA *brna)
@@ -2236,7 +2249,7 @@ static void rna_def_library(BlenderRNA *brna)
   RNA_def_property_clear_flag(prop, PROP_EDITABLE);
   RNA_def_property_flag(prop, PROP_THICK_WRAP);
 
-  func = RNA_def_function(srna, "reload", "WM_lib_reload");
+  func = RNA_def_function(srna, "reload", "rna_Library_reload");
   RNA_def_function_flag(func, FUNC_USE_REPORTS | FUNC_USE_CONTEXT);
   RNA_def_function_ui_description(func, "Reload this library and all its 
linked data-blocks");
 }

___
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] [8725bb5108c] blender-v3.3-release: Fix T101517: GPencil strokes snap to origin in a Scale value is on 0

2022-10-17 Thread Antonio Vazquez
Commit: 8725bb5108ccab455c61a98f0da7d05dc0972660
Author: Antonio Vazquez
Date:   Thu Oct 6 13:29:56 2022 +0200
Branches: blender-v3.3-release
https://developer.blender.org/rB8725bb5108ccab455c61a98f0da7d05dc0972660

Fix T101517: GPencil strokes snap to origin in a Scale value is on 0

The problem was the conversion to object space converted the
points to zero.

Now, the new function `zero_axis_bias_m4` is used in order to add
a small bias in the inverse matrix and avoid the zero points.

A known math issue is the stroke can be offsetted if the scale is set to 1 
again. In this case apply the scale to reset to 1.

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

===

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

===

diff --git a/source/blender/editors/gpencil/gpencil_sculpt_paint.c 
b/source/blender/editors/gpencil/gpencil_sculpt_paint.c
index e27cd255217..424544c8085 100644
--- a/source/blender/editors/gpencil/gpencil_sculpt_paint.c
+++ b/source/blender/editors/gpencil/gpencil_sculpt_paint.c
@@ -544,8 +544,10 @@ static void 
gpencil_brush_grab_apply_cached(tGP_BrushEditData *gso,
 return;
   }
 
-  float inverse_diff_mat[4][4];
-  invert_m4_m4(inverse_diff_mat, diff_mat);
+  float matrix[4][4], inverse_diff_mat[4][4];
+  copy_m4_m4(matrix, diff_mat);
+  zero_axis_bias_m4(matrix);
+  invert_m4_m4(inverse_diff_mat, matrix);
 
   /* Apply dvec to all of the stored points */
   for (int i = 0; i < data->size; i++) {
@@ -1169,7 +1171,10 @@ static bool gpencil_sculpt_brush_init(bContext *C, 
wmOperator *op)
   gso->scene = scene;
   gso->object = ob;
   if (ob) {
-invert_m4_m4(gso->inv_mat, ob->obmat);
+float matrix[4][4];
+copy_m4_m4(matrix, ob->obmat);
+zero_axis_bias_m4(matrix);
+invert_m4_m4(gso->inv_mat, matrix);
 gso->vrgroup = gso->gpd->vertex_group_active_index - 1;
 if (!BLI_findlink(&gso->gpd->vertex_group_names, gso->vrgroup)) {
   gso->vrgroup = -1;
diff --git a/source/blender/editors/gpencil/gpencil_utils.c 
b/source/blender/editors/gpencil/gpencil_utils.c
index 7b659511aaa..b554c81ab00 100644
--- a/source/blender/editors/gpencil/gpencil_utils.c
+++ b/source/blender/editors/gpencil/gpencil_utils.c
@@ -633,6 +633,7 @@ void gpencil_apply_parent(Depsgraph *depsgraph, Object 
*obact, bGPDlayer *gpl, b
   float fpt[3];
 
   BKE_gpencil_layer_transform_matrix_get(depsgraph, obact, gpl, diff_mat);
+  zero_axis_bias_m4(diff_mat);
   invert_m4_m4(inverse_diff_mat, diff_mat);
 
   for (i = 0; i < gps->totpoints; i++) {
@@ -653,6 +654,7 @@ void gpencil_apply_parent_point(Depsgraph *depsgraph,
   float fpt[3];
 
   BKE_gpencil_layer_transform_matrix_get(depsgraph, obact, gpl, diff_mat);
+  zero_axis_bias_m4(diff_mat);
   invert_m4_m4(inverse_diff_mat, diff_mat);
 
   mul_v3_m4v3(fpt, inverse_diff_mat, &pt->x);
@@ -935,6 +937,7 @@ void ED_gpencil_project_stroke_to_view(bContext *C, 
bGPDlayer *gpl, bGPDstroke *
   gpencil_point_conversion_init(C, &gsc);
 
   BKE_gpencil_layer_transform_matrix_get(depsgraph, ob, gpl, diff_mat);
+  zero_axis_bias_m4(diff_mat);
   invert_m4_m4(inverse_diff_mat, diff_mat);
 
   /* Adjust each point */
@@ -1050,6 +1053,7 @@ void ED_gpencil_stroke_reproject(Depsgraph *depsgraph,
 
   float diff_mat[4][4], inverse_diff_mat[4][4];
   BKE_gpencil_layer_transform_matrix_get(depsgraph, gsc->ob, gpl, diff_mat);
+  zero_axis_bias_m4(diff_mat);
   invert_m4_m4(inverse_diff_mat, diff_mat);
 
   float origin[3];

___
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] [e2beed6ae22] blender-v3.3-release: Fix T101591: mathutils.geometry.intersect_line_line 2D vector error

2022-10-17 Thread Campbell Barton
Commit: e2beed6ae2223cb56f64cc6e01bd284ae53fd968
Author: Campbell Barton
Date:   Thu Oct 6 17:32:11 2022 +1100
Branches: blender-v3.3-release
https://developer.blender.org/rBe2beed6ae2223cb56f64cc6e01bd284ae53fd968

Fix T101591: mathutils.geometry.intersect_line_line 2D vector error

Uninitialized stack memory was used when intersecting 2D vectors.

===

M   source/blender/python/mathutils/mathutils_geometry.c

===

diff --git a/source/blender/python/mathutils/mathutils_geometry.c 
b/source/blender/python/mathutils/mathutils_geometry.c
index 1e492574903..a993f9639c8 100644
--- a/source/blender/python/mathutils/mathutils_geometry.c
+++ b/source/blender/python/mathutils/mathutils_geometry.c
@@ -185,6 +185,13 @@ static PyObject *M_Geometry_intersect_line_line(PyObject 
*UNUSED(self), PyObject
 return NULL;
   }
 
+  /* Zero 3rd axis of 2D vectors. */
+  if (ix_vec_num == 2) {
+lines[1][2] = 0.0f;
+lines[2][2] = 0.0f;
+lines[3][2] = 0.0f;
+  }
+
   result = isect_line_line_v3(UNPACK4(lines), i1, i2);
   /* The return-code isn't exposed,
* this way we can check know how close the lines are. */

___
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] [85fb4708f4c] blender-v3.3-release: Fix T101492: UV stitch crash (more than 32 objects selected)

2022-10-17 Thread Philipp Oeser
Commit: 85fb4708f4c029db46910c80a07e0e79dc0a9067
Author: Philipp Oeser
Date:   Fri Sep 30 13:41:07 2022 +0200
Branches: blender-v3.3-release
https://developer.blender.org/rB85fb4708f4c029db46910c80a07e0e79dc0a9067

Fix T101492: UV stitch crash (more than 32 objects selected)

Crash happened when adjusting operator props in Adjust Last Operation
panel.

When there are more than 32 objects selected in muti-object-editmode, we
are running into RNA array limit (`objects_selection_count` is defined as
an RNA array (which can only hold 32 entries, see
`RNA_MAX_ARRAY_LENGTH`), leading to reading random memory errors.

While there might be ways to make this work with more than 32 selected
objects (e.g. by instead using a collection, or investigate supporting
dynamic sized arrays for run-time RNA), this patch only cancels the
operator with a report message (instead of crashing).

Maniphest Tasks: T101492

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

===

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

===

diff --git a/source/blender/editors/uvedit/uvedit_smart_stitch.c 
b/source/blender/editors/uvedit/uvedit_smart_stitch.c
index 579674930a6..beb4d2c261d 100644
--- a/source/blender/editors/uvedit/uvedit_smart_stitch.c
+++ b/source/blender/editors/uvedit/uvedit_smart_stitch.c
@@ -14,6 +14,7 @@
 #include "DNA_meshdata_types.h"
 #include "DNA_object_types.h"
 #include "DNA_scene_types.h"
+#include "DNA_windowmanager_types.h"
 
 #include "BLI_ghash.h"
 #include "BLI_math.h"
@@ -28,6 +29,7 @@
 #include "BKE_editmesh.h"
 #include "BKE_layer.h"
 #include "BKE_mesh_mapping.h"
+#include "BKE_report.h"
 
 #include "DEG_depsgraph.h"
 
@@ -2227,6 +2229,28 @@ static int stitch_init_all(bContext *C, wmOperator *op)
   Scene *scene = CTX_data_scene(C);
   ToolSettings *ts = scene->toolsettings;
 
+  ViewLayer *view_layer = CTX_data_view_layer(C);
+  View3D *v3d = CTX_wm_view3d(C);
+  uint objects_len = 0;
+  Object **objects = 
BKE_view_layer_array_from_objects_in_edit_mode_unique_data_with_uvs(
+  view_layer, v3d, &objects_len);
+
+  if (objects_len == 0) {
+MEM_freeN(objects);
+BKE_report(op->reports, RPT_ERROR, "No objects selected");
+return 0;
+  }
+
+  if (objects_len > RNA_MAX_ARRAY_LENGTH) {
+MEM_freeN(objects);
+BKE_reportf(op->reports,
+RPT_ERROR,
+"Stitching only works with less than %i objects selected (%u 
selected)",
+RNA_MAX_ARRAY_LENGTH,
+objects_len);
+return 0;
+  }
+
   StitchStateContainer *ssc = MEM_callocN(sizeof(StitchStateContainer), 
"stitch collection");
 
   op->customdata = ssc;
@@ -2261,21 +2285,6 @@ static int stitch_init_all(bContext *C, wmOperator *op)
 }
   }
 
-  ssc->objects_len = 0;
-  ssc->states = NULL;
-
-  ViewLayer *view_layer = CTX_data_view_layer(C);
-  View3D *v3d = CTX_wm_view3d(C);
-  uint objects_len = 0;
-  Object **objects = 
BKE_view_layer_array_from_objects_in_edit_mode_unique_data_with_uvs(
-  view_layer, v3d, &objects_len);
-
-  if (objects_len == 0) {
-MEM_freeN(objects);
-state_delete_all(ssc);
-return 0;
-  }
-
   ssc->objects = MEM_callocN(sizeof(Object *) * objects_len, "Object 
*ssc->objects");
   ssc->states = MEM_callocN(sizeof(StitchState *) * objects_len, 
"StitchState");
   ssc->objects_len = 0;
@@ -2341,6 +2350,7 @@ static int stitch_init_all(bContext *C, wmOperator *op)
 
   if (ssc->objects_len == 0) {
 state_delete_all(ssc);
+BKE_report(op->reports, RPT_ERROR, "Could not initialize stitching on any 
selected object");
 return 0;
   }

___
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] [a18b8ba1be6] blender-v3.3-release: Fix T101334: Paint Texture Slots appear greyed out

2022-10-17 Thread Philipp Oeser
Commit: a18b8ba1be6b0128548ed3a70075f45b63c0c4d9
Author: Philipp Oeser
Date:   Tue Oct 4 12:17:31 2022 +0200
Branches: blender-v3.3-release
https://developer.blender.org/rBa18b8ba1be6b0128548ed3a70075f45b63c0c4d9

Fix T101334: Paint Texture Slots appear greyed out

To the user, this looks like a disfunctional thing (usually greying out
is used for props having no effect).

The greying out is caused by
{rB8b7cd1ed2a17e40661101eea4adae99e8e3d02e9}.
Above commit disabled the direct renaming of images in the
`TEXTURE_UL_texpaintslots` UIList (and instead displays the texture slot
directly as a prop -- which has its `PROP_EDITABLE` flag cleared)
(from the commit message):
> A limitation of this patch is that is isn't possible anymore to rename
images directly from
> the selection panel. This is currently allowed in master. But as
CustomDataLayers
> aren't ID fields and not owned by the material supporting this wouldn't
be easy.

To work around the UI confusion (but still keep the non-editable nature
of the property), now just display this as a label.

Maniphest Tasks: T101334

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

===

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

===

diff --git a/release/scripts/startup/bl_ui/space_view3d_toolbar.py 
b/release/scripts/startup/bl_ui/space_view3d_toolbar.py
index 49ac6841c35..559ea480ac7 100644
--- a/release/scripts/startup/bl_ui/space_view3d_toolbar.py
+++ b/release/scripts/startup/bl_ui/space_view3d_toolbar.py
@@ -278,7 +278,7 @@ class TEXTURE_UL_texpaintslots(UIList):
 # mat = data
 
 if self.layout_type in {'DEFAULT', 'COMPACT'}:
-layout.prop(item, "name", text="", emboss=False, 
icon_value=item.icon_value)
+layout.label(text=item.name, icon_value=item.icon_value)
 elif self.layout_type == 'GRID':
 layout.alignment = 'CENTER'
 layout.label(text="")

___
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] [2a78941d2cd] blender-v3.3-release: LineArt: Fix "No intersection" flicker.

2022-10-17 Thread YimingWu
Commit: 2a78941d2cd0d679b70a1bb1f438d17ebf71ce8a
Author: YimingWu
Date:   Wed Oct 5 18:06:21 2022 +0800
Branches: blender-v3.3-release
https://developer.blender.org/rB2a78941d2cd0d679b70a1bb1f438d17ebf71ce8a

LineArt: Fix "No intersection" flicker.

The flicker was caused by the failure for checking both triangles for
flags. Now fixed.

===

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

===

diff --git a/source/blender/gpencil_modifiers/intern/lineart/lineart_cpu.c 
b/source/blender/gpencil_modifiers/intern/lineart/lineart_cpu.c
index 5893df2ba56..e251292fe2f 100644
--- a/source/blender/gpencil_modifiers/intern/lineart/lineart_cpu.c
+++ b/source/blender/gpencil_modifiers/intern/lineart/lineart_cpu.c
@@ -3400,8 +3400,8 @@ static void 
lineart_triangle_intersect_in_bounding_area(LineartTriangle *tri,
 }
 tt->testing_e[th->thread_id] = (LineartEdge *)tri;
 
-if(!((testing_triangle->flags | tri->flags) & 
LRT_TRIANGLE_FORCE_INTERSECTION)){
-  if ((testing_triangle->flags & LRT_TRIANGLE_NO_INTERSECTION) ||
+if (!((testing_triangle->flags | tri->flags) & 
LRT_TRIANGLE_FORCE_INTERSECTION)) {
+  if (((testing_triangle->flags | tri->flags) & 
LRT_TRIANGLE_NO_INTERSECTION) ||
   (testing_triangle->flags & tri->flags & 
LRT_TRIANGLE_INTERSECTION_ONLY)) {
 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] [7e5db850dc9] blender-v3.3-release: New math function to add small bias to zero axis

2022-10-17 Thread Antonio Vazquez
Commit: 7e5db850dc9d835ee85d85ae3126b0fa10dddcf8
Author: Antonio Vazquez
Date:   Wed Oct 5 22:10:53 2022 +0200
Branches: blender-v3.3-release
https://developer.blender.org/rB7e5db850dc9d835ee85d85ae3126b0fa10dddcf8

New math function to add small bias to zero axis

In some situations the zero axis can produce problems and need to add a small 
bias.

This function adds a small bias using the orthogonal result of the others valid 
axis.

Reviewed By: fclem

Differential Revision: https://developer.blender.org/D16158
6d

===

M   source/blender/blenlib/BLI_math_matrix.h
M   source/blender/blenlib/intern/math_matrix.c

===

diff --git a/source/blender/blenlib/BLI_math_matrix.h 
b/source/blender/blenlib/BLI_math_matrix.h
index c2dafbe3a1a..a622f6a2f55 100644
--- a/source/blender/blenlib/BLI_math_matrix.h
+++ b/source/blender/blenlib/BLI_math_matrix.h
@@ -367,6 +367,8 @@ void pseudoinverse_m4_m4(float Ainv[4][4], const float 
A[4][4], float epsilon);
 void pseudoinverse_m3_m3(float Ainv[3][3], const float A[3][3], float epsilon);
 
 bool has_zero_axis_m4(const float matrix[4][4]);
+/** Fix any zero scale axis adding a small bias orthogonal to the other valid 
axis. */
+void zero_axis_bias_m4(float mat[4][4]);
 
 void invert_m4_m4_safe(float Ainv[4][4], const float A[4][4]);
 
diff --git a/source/blender/blenlib/intern/math_matrix.c 
b/source/blender/blenlib/intern/math_matrix.c
index fcd017b3082..7b7082e5c0a 100644
--- a/source/blender/blenlib/intern/math_matrix.c
+++ b/source/blender/blenlib/intern/math_matrix.c
@@ -3122,6 +3122,34 @@ bool has_zero_axis_m4(const float matrix[4][4])
  len_squared_v3(matrix[2]) < FLT_EPSILON;
 }
 
+void zero_axis_bias_m4(float mat[4][4])
+{
+  const bool axis_x_degenerate = len_squared_v3(mat[0]) < FLT_EPSILON;
+  const bool axis_y_degenerate = len_squared_v3(mat[1]) < FLT_EPSILON;
+  const bool axis_z_degenerate = len_squared_v3(mat[2]) < FLT_EPSILON;
+
+  /* X Axis. */
+  if (axis_x_degenerate && !axis_y_degenerate && !axis_z_degenerate) {
+cross_v3_v3v3(mat[0], mat[1], mat[2]);
+mul_v3_fl(mat[0], FLT_EPSILON);
+return;
+  }
+
+  /* Y Axis. */
+  if (!axis_x_degenerate && axis_y_degenerate && !axis_z_degenerate) {
+cross_v3_v3v3(mat[1], mat[2], mat[0]);
+mul_v3_fl(mat[1], FLT_EPSILON);
+return;
+  }
+
+  /* Z Axis. */
+  if (!axis_x_degenerate && !axis_y_degenerate && axis_z_degenerate) {
+cross_v3_v3v3(mat[2], mat[0], mat[1]);
+mul_v3_fl(mat[2], FLT_EPSILON);
+return;
+  }
+}
+
 void invert_m4_m4_safe(float Ainv[4][4], const float A[4][4])
 {
   if (!invert_m4_m4(Ainv, A)) {

___
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] [cb2fb570f13] blender-v3.3-release: Fix T101405: Deleting a baked action results in an error.

2022-10-17 Thread Bastien Montagne
Commit: cb2fb570f1303e2262de4ce97f50bd87f8ae27b4
Author: Bastien Montagne
Date:   Wed Oct 5 15:54:03 2022 +0200
Branches: blender-v3.3-release
https://developer.blender.org/rBcb2fb570f1303e2262de4ce97f50bd87f8ae27b4

Fix T101405: Deleting a baked action results in an error.

RNA code to create new actions did not properly remove the extra user
set by default, as done in other `new` callbacks of other ID types.

NOTE: Mask ID had the same issue, also fixed in this commit.

NOTE: At some point this needs to be properly fixed, default super-low
level ID creation code should simply not add a 'default' user, this is
extremely bad design and forces higher-level code to do all kind of
extra work to get rid of it half of the time, in very unclear and
confusing ways and places.

===

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

===

diff --git a/source/blender/makesrna/intern/rna_main_api.c 
b/source/blender/makesrna/intern/rna_main_api.c
index 1f21fa3fab9..35678f2f1dd 100644
--- a/source/blender/makesrna/intern/rna_main_api.c
+++ b/source/blender/makesrna/intern/rna_main_api.c
@@ -629,6 +629,7 @@ static bAction *rna_Main_actions_new(Main *bmain, const 
char *name)
 
   bAction *act = BKE_action_add(bmain, safe_name);
   id_fake_user_clear(&act->id);
+  id_us_min(&act->id);
 
   WM_main_add_notifier(NC_ID | NA_ADDED, NULL);
 
@@ -701,6 +702,7 @@ static Mask *rna_Main_mask_new(Main *bmain, const char 
*name)
   rna_idname_validate(name, safe_name);
 
   Mask *mask = BKE_mask_new(bmain, safe_name);
+  id_us_min(&mask->id);
 
   WM_main_add_notifier(NC_ID | NA_ADDED, NULL);

___
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] [660c47596e1] master: Weight Paint: relax heuristic to determine when final mesh can be used.

2022-10-17 Thread Alexander Gavrilov
Commit: 660c47596e17229dbadca2b129767ec9a17338e9
Author: Alexander Gavrilov
Date:   Sat Oct 15 22:07:03 2022 +0300
Branches: master
https://developer.blender.org/rB660c47596e17229dbadca2b129767ec9a17338e9

Weight Paint: relax heuristic to determine when final mesh can be used.

Checking for polygon and loop data to be referenced is too fragile
re changes in geometry node implementations. Instead, compare counts
of polygons, face corners and vertices: topology changes are unlikely
to keep all three unchanged.

Ref D15501

===

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

===

diff --git a/source/blender/blenkernel/intern/paint.cc 
b/source/blender/blenkernel/intern/paint.cc
index 9248e4d520e..13243925b28 100644
--- a/source/blender/blenkernel/intern/paint.cc
+++ b/source/blender/blenkernel/intern/paint.cc
@@ -1786,8 +1786,8 @@ static void sculpt_update_object(
   /* If the fully evaluated mesh has the same topology as the deform-only 
version, use it.
* This matters because crazyspace evaluation is very restrictive and 
excludes even modifiers
* that simply recompute vertex weights (which can even include Geometry 
Nodes). */
-  if (me_eval_deform->polys().data() == me_eval->polys().data() &&
-  me_eval_deform->loops().data() == me_eval->loops().data() &&
+  if (me_eval_deform->totpoly == me_eval->totpoly &&
+  me_eval_deform->totloop == me_eval->totloop &&
   me_eval_deform->totvert == me_eval->totvert) {
 BKE_sculptsession_free_deformMats(ss);

___
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] [8f8eac78cf8] blender-v3.3-release: Bump version cycle for Blender 3.3.2 candidate

2022-10-17 Thread Philipp Oeser
Commit: 8f8eac78cf8b1cb31afb4c10189ee5c004fc5387
Author: Philipp Oeser
Date:   Mon Oct 17 14:13:00 2022 +0200
Branches: blender-v3.3-release
https://developer.blender.org/rB8f8eac78cf8b1cb31afb4c10189ee5c004fc5387

Bump version cycle for Blender 3.3.2 candidate

===

M   source/blender/blenkernel/BKE_blender_version.h

===

diff --git a/source/blender/blenkernel/BKE_blender_version.h 
b/source/blender/blenkernel/BKE_blender_version.h
index e0efb95c094..de3cfb9693c 100644
--- a/source/blender/blenkernel/BKE_blender_version.h
+++ b/source/blender/blenkernel/BKE_blender_version.h
@@ -19,9 +19,9 @@ extern "C" {
 /* Blender major and minor version. */
 #define BLENDER_VERSION 303
 /* Blender patch version for bugfix releases. */
-#define BLENDER_VERSION_PATCH 1
+#define BLENDER_VERSION_PATCH 2
 /** Blender release cycle stage: alpha/beta/rc/release. */
-#define BLENDER_VERSION_CYCLE release
+#define BLENDER_VERSION_CYCLE rc
 
 /* 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] [295eb04ba3b] blender-v3.3-release: Fix T101447: Hold split not working correctly

2022-10-17 Thread Richard Antalik
Commit: 295eb04ba3b750ba836ccbd6df112ca89909011a
Author: Richard Antalik
Date:   Tue Oct 4 16:05:48 2022 +0200
Branches: blender-v3.3-release
https://developer.blender.org/rB295eb04ba3b750ba836ccbd6df112ca89909011a

Fix T101447: Hold split not working correctly

Caused by incorrect conflict resolution in commit 302b04a5a3fc0e76.

===

M   source/blender/sequencer/intern/strip_edit.c

===

diff --git a/source/blender/sequencer/intern/strip_edit.c 
b/source/blender/sequencer/intern/strip_edit.c
index 15c472dd5a7..a302a570eeb 100644
--- a/source/blender/sequencer/intern/strip_edit.c
+++ b/source/blender/sequencer/intern/strip_edit.c
@@ -259,49 +259,50 @@ bool SEQ_edit_move_strip_to_meta(Scene *scene,
   return true;
 }
 
-static void seq_split_set_left_hold_offset(Scene *scene, Sequence *seq, int 
timeline_frame)
+static void seq_split_set_right_hold_offset(Scene *scene, Sequence *seq, int 
timeline_frame)
 {
-  /* Adjust within range of extended stillframes before strip. */
-  if (timeline_frame < seq->start) {
-seq->start = timeline_frame - 1;
-seq->anim_endofs += SEQ_time_strip_length_get(scene, seq) - 1;
-seq->startstill = timeline_frame - seq->startdisp - 1;
-seq->endstill = 0;
+  const float content_start = seq->start;
+  const float content_end = seq->start + SEQ_time_strip_length_get(scene, seq);
+
+  /* Adjust within range of extended still-frames before strip. */
+  if (timeline_frame < content_start) {
+const float offset = content_start + 1 - timeline_frame;
+seq->start -= offset;
+seq->startofs += offset;
+SEQ_time_right_handle_frame_set(scene, seq, timeline_frame);
   }
   /* Adjust within range of strip contents. */
-  else if ((timeline_frame >= seq->start) &&
-   (timeline_frame <= (seq->start + SEQ_time_strip_length_get(scene, 
seq {
+  else if ((timeline_frame >= content_start) && (timeline_frame <= 
content_end)) {
 seq->endofs = 0;
-seq->endstill = 0;
-seq->anim_endofs += (seq->start + SEQ_time_strip_length_get(scene, seq)) - 
timeline_frame;
+seq->anim_endofs += (content_end - timeline_frame) * seq->speed_factor;
   }
-  /* Adjust within range of extended stillframes after strip. */
-  else if ((seq->start + SEQ_time_strip_length_get(scene, seq)) < 
timeline_frame) {
-seq->endstill = timeline_frame - seq->start - 
SEQ_time_strip_length_get(scene, seq);
+  /* Adjust within range of extended still-frames after strip. */
+  else if (timeline_frame > content_end) {
+SEQ_time_right_handle_frame_set(scene, seq, timeline_frame);
   }
 }
 
-static void seq_split_set_right_hold_offset(Scene *scene, Sequence *seq, int 
timeline_frame)
+static void seq_split_set_left_hold_offset(Scene *scene, Sequence *seq, int 
timeline_frame)
 {
-  /* Adjust within range of extended stillframes before strip. */
-  if (timeline_frame < seq->start) {
-seq->startstill = seq->start - timeline_frame;
+  const float content_start = seq->start;
+  const float content_end = seq->start + SEQ_time_strip_length_get(scene, seq);
+
+  /* Adjust within range of extended still-frames before strip. */
+  if (timeline_frame < content_start) {
+SEQ_time_left_handle_frame_set(scene, seq, timeline_frame);
   }
   /* Adjust within range of strip contents. */
-  else if ((timeline_frame >= seq->start) &&
-   (timeline_frame <= (seq->start + SEQ_time_strip_length_get(scene, 
seq {
-seq->anim_startofs += timeline_frame - seq->start;
+  else if ((timeline_frame >= content_start) && (timeline_frame <= 
content_end)) {
+seq->anim_startofs += (timeline_frame - content_start) * seq->speed_factor;
 seq->start = timeline_frame;
-seq->startstill = 0;
 seq->startofs = 0;
   }
-  /* Adjust within range of extended stillframes after strip. */
-  else if ((seq->start + SEQ_time_strip_length_get(scene, seq)) < 
timeline_frame) {
-seq->start = timeline_frame;
-seq->startofs = 0;
-seq->anim_startofs += SEQ_time_strip_length_get(scene, seq) - 1;
-seq->endstill = seq->enddisp - timeline_frame - 1;
-seq->startstill = 0;
+  /* Adjust within range of extended still-frames after strip. */
+  else if (timeline_frame > content_end) {
+const float offset = timeline_frame - content_end + 1;
+seq->start += offset;
+seq->endofs += offset;
+SEQ_time_left_handle_frame_set(scene, seq, timeline_frame);
   }
 }

___
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] [5d820393af2] blender-v3.3-release: Fix T101306: crash when calling Delete command for Library Override

2022-10-17 Thread Philipp Oeser
Commit: 5d820393af22326d9cbec3d5136d4858023bb829
Author: Philipp Oeser
Date:   Wed Oct 5 12:45:21 2022 +0200
Branches: blender-v3.3-release
https://developer.blender.org/rB5d820393af22326d9cbec3d5136d4858023bb829

Fix T101306: crash when calling Delete command for Library Override

Was not passing user_data to id_override_library_delete_hierarchy_fn.

Also correct a wrong assert.

Greenlit by @mont29 in T101306.
Should also go into 3.3 LTS.

===

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

===

diff --git a/source/blender/editors/space_outliner/outliner_tools.cc 
b/source/blender/editors/space_outliner/outliner_tools.cc
index 382004a2484..f79866c97bd 100644
--- a/source/blender/editors/space_outliner/outliner_tools.cc
+++ b/source/blender/editors/space_outliner/outliner_tools.cc
@@ -1224,7 +1224,7 @@ static void id_override_library_create_hierarchy(
 /* Remove the instance empty from this scene, the items now have an 
overridden collection
  * instead. */
 if (success && data_idroot.is_override_instancing_object) {
-  BLI_assert(GS(data_idroot.id_instance_hint) == ID_OB);
+  BLI_assert(GS(data_idroot.id_instance_hint->name) == ID_OB);
   ED_object_base_free_and_unlink(
   &bmain, scene, reinterpret_cast(data_idroot.id_instance_hint));
 }
@@ -1813,7 +1813,7 @@ static int outliner_liboverride_operation_exec(bContext 
*C, wmOperator *op)
   space_outliner,
   
id_override_library_delete_hierarchy_fn,
   
OUTLINER_LIB_SELECTIONSET_SELECTED,
-  nullptr);
+  &override_data);
 
   id_override_library_delete_hierarchy_process(C, op->reports, 
override_data);

___
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] [72a34ab1b91] blender-v3.3-release: Fix T100330: Remove Render Slot not working for first slot

2022-10-17 Thread Lukas Stockner
Commit: 72a34ab1b91d56926aeee8677b2896d583f1cd8f
Author: Lukas Stockner
Date:   Sat Sep 17 01:46:03 2022 +0200
Branches: blender-v3.3-release
https://developer.blender.org/rB72a34ab1b91d56926aeee8677b2896d583f1cd8f

Fix T100330: Remove Render Slot not working for first slot

This bug was caused by the weird ownership logic for render results.
Basically, the most recent render result is owned by the Render, while
all others are owned by the RenderSlots.
When a new render is started, the previous Render is handed over to its
slot, and the new slot is cleared. So far, so good.

However, when a slot is removed and happens to be the one with the most
recent render, this causes a complication.
The code handles this by making another slot the most recent one, along
with moving its result back to the Render, as if that had always been
the most recent one.

That works, unless there is no most recent render because you haven't
rendered anything yet. Unfortunately, there is no way to store "there
hasn't been a render yet", so the code still tries to perform this
handover but can't.
Previously, the code handled that case by just refusing to delete the
slot. However, this blocks users from deleting this slot.

But of course, if there hasn't been a render yet, the slots will not
contain anything yet, so this entire maneuver is pointless.
Therefore, the fix for the bug is to just skip it altogether if there
is no Render instead of failing the operation.

Technically, there is a weird corner case remaining, because Renders
are per-scene. Therefore, if a user renders images in one scene,
switches to a different scene, deletes a slot there and then switches
back, in some situations the result in the deleted slot might end up
in the next slot.
Unfortunately this is just a limitation of the weird split ownership
logic and can't just be worked around. The proper fix for this
probably would be to hand over ownership of the result from the Render
to the RenderSlot once the render is done, but this is quite complex.

Also fixes a crash when iuser->scene is NULL.

===

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

===

diff --git a/source/blender/blenkernel/intern/image.cc 
b/source/blender/blenkernel/intern/image.cc
index b196bcd7207..d56e3530b7c 100644
--- a/source/blender/blenkernel/intern/image.cc
+++ b/source/blender/blenkernel/intern/image.cc
@@ -5476,15 +5476,14 @@ bool BKE_image_remove_renderslot(Image *ima, ImageUser 
*iuser, int slot)
   next_last_slot = current_slot;
 }
 
-if (!iuser) {
+if (iuser == nullptr || iuser->scene == nullptr) {
   return false;
 }
 Render *re = RE_GetSceneRender(iuser->scene);
-if (!re) {
-  return false;
+if (re != nullptr) {
+  RE_SwapResult(re, ¤t_last_slot->render);
+  RE_SwapResult(re, &next_last_slot->render);
 }
-RE_SwapResult(re, ¤t_last_slot->render);
-RE_SwapResult(re, &next_last_slot->render);
 current_last_slot = next_last_slot;
   }

___
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] [197f3d75d1b] blender-v3.3-release: Fix T101499: Do not allow unlinking objects from linked collections.

2022-10-17 Thread Bastien Montagne
Commit: 197f3d75d1beeae78da2567a1066be1ca9876ada
Author: Bastien Montagne
Date:   Tue Oct 4 14:58:15 2022 +0200
Branches: blender-v3.3-release
https://developer.blender.org/rB197f3d75d1beeae78da2567a1066be1ca9876ada

Fix T101499: Do not allow unlinking objects from linked collections.

===

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

===

diff --git a/source/blender/editors/space_outliner/outliner_tools.cc 
b/source/blender/editors/space_outliner/outliner_tools.cc
index dfb421367c1..382004a2484 100644
--- a/source/blender/editors/space_outliner/outliner_tools.cc
+++ b/source/blender/editors/space_outliner/outliner_tools.cc
@@ -380,7 +380,7 @@ static void unlink_collection_fn(bContext *C,
 }
 
 static void unlink_object_fn(bContext *C,
- ReportList *UNUSED(reports),
+ ReportList *reports,
  Scene *UNUSED(scene),
  TreeElement *te,
  TreeStoreElem *tsep,
@@ -395,12 +395,28 @@ static void unlink_object_fn(bContext *C,
   /* Parented objects need to find which collection to unlink from. */
   TreeElement *te_parent = te->parent;
   while (tsep && GS(tsep->id->name) == ID_OB) {
+if (ID_IS_LINKED(tsep->id)) {
+  BKE_reportf(reports,
+  RPT_WARNING,
+  "Cannot unlink object '%s' parented to another linked 
object '%s'",
+  ob->id.name + 2,
+  tsep->id->name + 2);
+  return;
+}
 te_parent = te_parent->parent;
 tsep = te_parent ? TREESTORE(te_parent) : nullptr;
   }
 }
 
 if (tsep && tsep->id) {
+  if (ID_IS_LINKED(tsep->id) || ID_IS_OVERRIDE_LIBRARY(tsep->id)) {
+BKE_reportf(reports,
+RPT_WARNING,
+"Cannot unlink object '%s' from linked collection or scene 
'%s'",
+ob->id.name + 2,
+tsep->id->name + 2);
+return;
+  }
   if (GS(tsep->id->name) == ID_GR) {
 Collection *parent = (Collection *)tsep->id;
 BKE_collection_object_remove(bmain, parent, ob, true);

___
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] [1111af5cb49] master: Sculpt: add versioning for Auto-masking cavity factor default

2022-10-17 Thread Pablo Vazquez
Commit: af5cb4964369963c587b5400ab784a4397c6
Author: Pablo Vazquez
Date:   Mon Oct 17 14:47:49 2022 +0200
Branches: master
https://developer.blender.org/rBaf5cb4964369963c587b5400ab784a4397c6

Sculpt: add versioning for Auto-masking cavity factor default

Also remove automasking_cavity_factor default from RNA for brushes.
Data-blocks set their defaults via `DNA_brush_defaults.h`

Continuation from previous commit and rBdb40b6

Thanks to Dalai for the help!

===

M   source/blender/blenkernel/BKE_blender_version.h
M   source/blender/blenloader/intern/versioning_300.cc
M   source/blender/makesrna/intern/rna_brush.c

===

diff --git a/source/blender/blenkernel/BKE_blender_version.h 
b/source/blender/blenkernel/BKE_blender_version.h
index 3c8f7d758b6..96df8f7a443 100644
--- a/source/blender/blenkernel/BKE_blender_version.h
+++ b/source/blender/blenkernel/BKE_blender_version.h
@@ -25,7 +25,7 @@ extern "C" {
 
 /* Blender file format version. */
 #define BLENDER_FILE_VERSION BLENDER_VERSION
-#define BLENDER_FILE_SUBVERSION 3
+#define BLENDER_FILE_SUBVERSION 4
 
 /* 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
diff --git a/source/blender/blenloader/intern/versioning_300.cc 
b/source/blender/blenloader/intern/versioning_300.cc
index 5328107e1f2..e2b98b2283f 100644
--- a/source/blender/blenloader/intern/versioning_300.cc
+++ b/source/blender/blenloader/intern/versioning_300.cc
@@ -3623,6 +3623,13 @@ void blo_do_versions_300(FileData *fd, Library * 
/*lib*/, Main *bmain)
 }
   }
 
+  if (!MAIN_VERSION_ATLEAST(bmain, 304, 4)) {
+/* Update brush sculpt settings. */
+LISTBASE_FOREACH (Brush *, brush, &bmain->brushes) {
+  brush->automasking_cavity_factor = 1.0f;
+}
+  }
+
   /**
* Versioning code until next subversion bump goes here.
*
diff --git a/source/blender/makesrna/intern/rna_brush.c 
b/source/blender/makesrna/intern/rna_brush.c
index b44b0620329..35e01be366b 100644
--- a/source/blender/makesrna/intern/rna_brush.c
+++ b/source/blender/makesrna/intern/rna_brush.c
@@ -3242,7 +3242,6 @@ static void rna_def_brush(BlenderRNA *brna)
 
   prop = RNA_def_property(srna, "automasking_cavity_factor", PROP_FLOAT, 
PROP_FACTOR);
   RNA_def_property_float_sdna(prop, NULL, "automasking_cavity_factor");
-  RNA_def_property_float_default(prop, 1.0f);
   RNA_def_property_ui_text(prop, "Cavity Factor", "The contrast of the cavity 
mask");
   RNA_def_property_range(prop, 0.0f, 5.0f);
   RNA_def_property_ui_range(prop, 0.0f, 1.0f, 0.1, 3);

___
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] [0a35afbf86c] master: Fix T99565: Cycles reading TGA files with alpha different than Blender

2022-10-17 Thread Brecht Van Lommel
Commit: 0a35afbf86c86963ebb638f0804a706d17df5b50
Author: Brecht Van Lommel
Date:   Mon Oct 17 14:20:42 2022 +0200
Branches: master
https://developer.blender.org/rB0a35afbf86c86963ebb638f0804a706d17df5b50

Fix T99565: Cycles reading TGA files with alpha different than Blender

Thanks to Lukas for tracking down the cause in OIIO.

===

M   intern/cycles/scene/image_oiio.cpp

===

diff --git a/intern/cycles/scene/image_oiio.cpp 
b/intern/cycles/scene/image_oiio.cpp
index 8792393e5a1..d59359970c6 100644
--- a/intern/cycles/scene/image_oiio.cpp
+++ b/intern/cycles/scene/image_oiio.cpp
@@ -192,8 +192,17 @@ bool OIIOImageLoader::load_pixels(const ImageMetaData 
&metadata,
 return false;
   }
 
-  const bool do_associate_alpha = associate_alpha &&
-  
spec.get_int_attribute("oiio:UnassociatedAlpha", 0);
+  bool do_associate_alpha = false;
+  if (associate_alpha) {
+do_associate_alpha = spec.get_int_attribute("oiio:UnassociatedAlpha", 0);
+
+/* Workaround OIIO not detecting TGA file alpha the same as Blender (since 
#3019).
+ * We want anything not marked as premultiplied alpha to get associated. */
+if (!do_associate_alpha && spec.alpha_channel != -1 &&
+strcmp(in->format_name(), "targa") == 0) {
+  do_associate_alpha = spec.get_int_attribute("targa:alpha_type", -1) != 4;
+}
+  }
 
   switch (metadata.type) {
 case IMAGE_DATA_TYPE_BYTE:

___
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] [3eaf2b7fc69] master: Fix OpenPGL and OneAPI being detected by CMake when Cycles is disabled

2022-10-17 Thread Brecht Van Lommel
Commit: 3eaf2b7fc69668cacd4ddb221faf90e60736015e
Author: Brecht Van Lommel
Date:   Mon Oct 17 13:24:24 2022 +0200
Branches: master
https://developer.blender.org/rB3eaf2b7fc69668cacd4ddb221faf90e60736015e

Fix OpenPGL and OneAPI being detected by CMake when Cycles is disabled

===

M   build_files/cmake/platform/platform_apple.cmake
M   build_files/cmake/platform/platform_unix.cmake
M   build_files/cmake/platform/platform_win32.cmake

===

diff --git a/build_files/cmake/platform/platform_apple.cmake 
b/build_files/cmake/platform/platform_apple.cmake
index 9f1824ec827..04f5a312030 100644
--- a/build_files/cmake/platform/platform_apple.cmake
+++ b/build_files/cmake/platform/platform_apple.cmake
@@ -429,7 +429,7 @@ if(WITH_HARU)
   endif()
 endif()
 
-if(WITH_CYCLES_PATH_GUIDING)
+if(WITH_CYCLES AND WITH_CYCLES_PATH_GUIDING)
   find_package(openpgl QUIET)
   if(openpgl_FOUND)
 get_target_property(OPENPGL_LIBRARIES openpgl::openpgl LOCATION)
diff --git a/build_files/cmake/platform/platform_unix.cmake 
b/build_files/cmake/platform/platform_unix.cmake
index 85a6080cc3f..695ea3d773e 100644
--- a/build_files/cmake/platform/platform_unix.cmake
+++ b/build_files/cmake/platform/platform_unix.cmake
@@ -329,7 +329,7 @@ if(WITH_CYCLES AND WITH_CYCLES_OSL)
   endif()
 endif()
 
-if(WITH_CYCLES_DEVICE_ONEAPI)
+if(WITH_CYCLES AND WITH_CYCLES_DEVICE_ONEAPI)
   set(CYCLES_LEVEL_ZERO ${LIBDIR}/level-zero CACHE PATH "Path to Level Zero 
installation")
   if(EXISTS ${CYCLES_LEVEL_ZERO} AND NOT LEVEL_ZERO_ROOT_DIR)
 set(LEVEL_ZERO_ROOT_DIR ${CYCLES_LEVEL_ZERO})
@@ -592,7 +592,7 @@ if(WITH_HARU)
   endif()
 endif()
 
-if(WITH_CYCLES_PATH_GUIDING)
+if(WITH_CYCLES AND WITH_CYCLES_PATH_GUIDING)
   find_package_wrapper(openpgl)
   if(openpgl_FOUND)
 get_target_property(OPENPGL_LIBRARIES openpgl::openpgl LOCATION)
diff --git a/build_files/cmake/platform/platform_win32.cmake 
b/build_files/cmake/platform/platform_win32.cmake
index 7031b1faac4..cfb8bf34b81 100644
--- a/build_files/cmake/platform/platform_win32.cmake
+++ b/build_files/cmake/platform/platform_win32.cmake
@@ -936,7 +936,7 @@ if(WITH_HARU)
   endif()
 endif()
 
-if(WITH_CYCLES_PATH_GUIDING)
+if(WITH_CYCLES AND WITH_CYCLES_PATH_GUIDING)
   find_package(openpgl QUIET)
   if(openpgl_FOUND)
 get_target_property(OPENPGL_LIBRARIES_RELEASE openpgl::openpgl 
LOCATION_RELEASE)
@@ -952,7 +952,7 @@ endif()
 set(ZSTD_INCLUDE_DIRS ${LIBDIR}/zstd/include)
 set(ZSTD_LIBRARIES ${LIBDIR}/zstd/lib/zstd_static.lib)
 
-if(WITH_CYCLES_DEVICE_ONEAPI)
+if(WITH_CYCLES AND WITH_CYCLES_DEVICE_ONEAPI)
   set(LEVEL_ZERO_ROOT_DIR ${LIBDIR}/level_zero)
   set(CYCLES_SYCL ${LIBDIR}/dpcpp CACHE PATH "Path to oneAPI DPC++ compiler")
   if(EXISTS ${CYCLES_SYCL} AND NOT SYCL_ROOT_DIR)

___
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] [baa9a00f5f9] master: Fix Wayland not being disabled when dependencies are not found

2022-10-17 Thread Brecht Van Lommel
Commit: baa9a00f5f97c04330f0247f36af34bb335e2dcb
Author: Brecht Van Lommel
Date:   Mon Oct 17 13:24:00 2022 +0200
Branches: master
https://developer.blender.org/rBbaa9a00f5f97c04330f0247f36af34bb335e2dcb

Fix Wayland not being disabled when dependencies are not found

===

M   build_files/cmake/platform/platform_unix.cmake

===

diff --git a/build_files/cmake/platform/platform_unix.cmake 
b/build_files/cmake/platform/platform_unix.cmake
index 7b7937959bf..85a6080cc3f 100644
--- a/build_files/cmake/platform/platform_unix.cmake
+++ b/build_files/cmake/platform/platform_unix.cmake
@@ -740,27 +740,27 @@ if(WITH_GHOST_WAYLAND)
 set(wayland-cursor_FOUND ON)
   endif()
 
-  if (NOT ${wayland-client_FOUND})
+  if (NOT wayland-client_FOUND)
 message(STATUS "wayland-client not found, disabling WITH_GHOST_WAYLAND")
 set(WITH_GHOST_WAYLAND OFF)
   endif()
-  if (NOT ${wayland-egl_FOUND})
+  if (NOT wayland-egl_FOUND)
 message(STATUS "wayland-egl not found, disabling WITH_GHOST_WAYLAND")
 set(WITH_GHOST_WAYLAND OFF)
   endif()
-  if (NOT ${wayland-scanner_FOUND})
+  if (NOT wayland-scanner_FOUND)
 message(STATUS "wayland-scanner not found, disabling WITH_GHOST_WAYLAND")
 set(WITH_GHOST_WAYLAND OFF)
   endif()
-  if (NOT ${wayland-cursor_FOUND})
+  if (NOT wayland-cursor_FOUND)
 message(STATUS "wayland-cursor not found, disabling WITH_GHOST_WAYLAND")
 set(WITH_GHOST_WAYLAND OFF)
   endif()
-  if (NOT ${wayland-protocols_FOUND})
+  if (NOT wayland-protocols_FOUND)
 message(STATUS "wayland-protocols not found, disabling WITH_GHOST_WAYLAND")
 set(WITH_GHOST_WAYLAND OFF)
   endif()
-  if (NOT ${xkbcommon_FOUND})
+  if (NOT xkbcommon_FOUND)
 message(STATUS "xkbcommon not found, disabling WITH_GHOST_WAYLAND")
 set(WITH_GHOST_WAYLAND OFF)
   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] [390cf2fe756] master: Cleanup: compiler warnings

2022-10-17 Thread Brecht Van Lommel
Commit: 390cf2fe756e2759ec2f0dcc0ef4b1f84142f1d6
Author: Brecht Van Lommel
Date:   Mon Oct 17 14:34:13 2022 +0200
Branches: master
https://developer.blender.org/rB390cf2fe756e2759ec2f0dcc0ef4b1f84142f1d6

Cleanup: compiler warnings

===

M   source/blender/blenkernel/BKE_instances.hh

===

diff --git a/source/blender/blenkernel/BKE_instances.hh 
b/source/blender/blenkernel/BKE_instances.hh
index 69b6f944838..6502fefec88 100644
--- a/source/blender/blenkernel/BKE_instances.hh
+++ b/source/blender/blenkernel/BKE_instances.hh
@@ -25,7 +25,7 @@
 
 #include "BKE_attribute.hh"
 
-class GeometrySet;
+struct GeometrySet;
 struct Object;
 struct Collection;

___
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] [69e7274d4f5] master: Brush: Fix mismatch in DNA Brush defaults

2022-10-17 Thread Pablo Vazquez
Commit: 69e7274d4f58f76e750b7104c1bc0334243a9b91
Author: Pablo Vazquez
Date:   Mon Oct 17 14:11:11 2022 +0200
Branches: master
https://developer.blender.org/rB69e7274d4f58f76e750b7104c1bc0334243a9b91

Brush: Fix mismatch in DNA Brush defaults

Missed changing the DNA brush default in rBdb40b6

Thanks to SteffenD for reporting in blender.chat!

===

M   source/blender/makesdna/DNA_brush_defaults.h

===

diff --git a/source/blender/makesdna/DNA_brush_defaults.h 
b/source/blender/makesdna/DNA_brush_defaults.h
index 348e8f4e098..6e88275672a 100644
--- a/source/blender/makesdna/DNA_brush_defaults.h
+++ b/source/blender/makesdna/DNA_brush_defaults.h
@@ -92,7 +92,7 @@
 .hardness = 0.0f, \
 .automasking_boundary_edges_propagation_steps = 1, \
 .automasking_cavity_blur_steps = 0,\
-.automasking_cavity_factor = 0.5f,\
+.automasking_cavity_factor = 1.0f,\
  \
 /* A kernel radius of 1 has almost no effect (T63233). */ \
 .blur_kernel_radius = 2, \

___
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] [e96ad822b38] master: Fix AssetCatalogTest failure on WIN32

2022-10-17 Thread Campbell Barton
Commit: e96ad822b382c131f9f55857364b330f6fff1521
Author: Campbell Barton
Date:   Mon Oct 17 20:50:02 2022 +1100
Branches: master
https://developer.blender.org/rBe96ad822b382c131f9f55857364b330f6fff1521

Fix AssetCatalogTest failure on WIN32

Recent changes to path handling (most likely [0]) caused
AssetCatalogTest.create_catalog_after_loading_file to fail on WIN32.

The test relied on the resulting path to be joined with "/" as a path
separator. The resulting path used both forward and back-slashes.
While these do work for some API's on WIN32, mixing both in a file path
isn't expected behavior in most cases, so update the tests to use native
slash direction for file-paths.

[0]: 9f6a045e23cf4ab132ef78eeaf070bd53d0c509f

===

M   source/blender/blenkernel/intern/asset_catalog_test.cc
M   source/blender/blenkernel/intern/asset_library_service_test.cc

===

diff --git a/source/blender/blenkernel/intern/asset_catalog_test.cc 
b/source/blender/blenkernel/intern/asset_catalog_test.cc
index 81eb1786322..ee2dd652b61 100644
--- a/source/blender/blenkernel/intern/asset_catalog_test.cc
+++ b/source/blender/blenkernel/intern/asset_catalog_test.cc
@@ -98,7 +98,7 @@ class AssetCatalogTest : public testing::Test {
   FAIL();
 }
 
-asset_library_root_ = test_files_dir + "/" + "asset_library";
+asset_library_root_ = test_files_dir + SEP_STR + "asset_library";
 temp_library_path_ = "";
   }
 
@@ -116,7 +116,7 @@ class AssetCatalogTest : public testing::Test {
   {
 BKE_tempdir_init("");
 const CatalogFilePath tempdir = BKE_tempdir_session();
-temp_library_path_ = tempdir + "test-temporary-path/";
+temp_library_path_ = tempdir + "test-temporary-path" + SEP_STR;
 return temp_library_path_;
   }
 
@@ -202,9 +202,10 @@ class AssetCatalogTest : public testing::Test {
   void save_from_memory_into_existing_asset_lib(const bool 
should_top_level_cdf_exist)
   {
 const CatalogFilePath target_dir = create_temp_path(); /* Has trailing 
slash. */
-const CatalogFilePath original_cdf_file = asset_library_root_ + 
"/blender_assets.cats.txt";
-const CatalogFilePath registered_asset_lib = target_dir + 
"my_asset_library/";
-const CatalogFilePath asset_lib_subdir = registered_asset_lib + "subdir/";
+const CatalogFilePath original_cdf_file = asset_library_root_ + SEP_STR +
+  "blender_assets.cats.txt";
+const CatalogFilePath registered_asset_lib = target_dir + 
"my_asset_library" + SEP_STR;
+const CatalogFilePath asset_lib_subdir = registered_asset_lib + "subdir" + 
SEP_STR;
 CatalogFilePath cdf_toplevel = registered_asset_lib +

AssetCatalogService::DEFAULT_CATALOG_FILENAME;
 CatalogFilePath cdf_in_subdir = asset_lib_subdir +
@@ -272,7 +273,7 @@ class AssetCatalogTest : public testing::Test {
 TEST_F(AssetCatalogTest, load_single_file)
 {
   AssetCatalogService service(asset_library_root_);
-  service.load_from_disk(asset_library_root_ + "/" + 
"blender_assets.cats.txt");
+  service.load_from_disk(asset_library_root_ + SEP_STR + 
"blender_assets.cats.txt");
 
   /* Test getting a non-existent catalog ID. */
   EXPECT_EQ(nullptr, service.find_catalog(BLI_uuid_generate_random()));
@@ -313,7 +314,7 @@ TEST_F(AssetCatalogTest, load_single_file)
 TEST_F(AssetCatalogTest, load_catalog_path_backslashes)
 {
   AssetCatalogService service(asset_library_root_);
-  service.load_from_disk(asset_library_root_ + "/" + 
"blender_assets.cats.txt");
+  service.load_from_disk(asset_library_root_ + SEP_STR + 
"blender_assets.cats.txt");
 
   const AssetCatalog *found_by_id = 
service.find_catalog(UUID_POSES_ELLIE_BACKSLASHES);
   ASSERT_NE(nullptr, found_by_id);
@@ -332,7 +333,7 @@ TEST_F(AssetCatalogTest, load_catalog_path_backslashes)
 TEST_F(AssetCatalogTest, is_first_loaded_flag)
 {
   AssetCatalogService service(asset_library_root_);
-  service.load_from_disk(asset_library_root_ + "/" + 
"blender_assets.cats.txt");
+  service.load_from_disk(asset_library_root_ + SEP_STR + 
"blender_assets.cats.txt");
 
   AssetCatalog *new_cat = service.create_catalog("never/before/seen/path");
   EXPECT_FALSE(new_cat->flags.is_first_loaded)
@@ -435,7 +436,7 @@ TEST_F(AssetCatalogTest, insert_item_into_tree)
 TEST_F(AssetCatalogTest, load_single_file_into_tree)
 {
   AssetCatalogService service(asset_library_root_);
-  service.load_from_disk(asset_library_root_ + "/" + 
"blender_assets.cats.txt");
+  service.load_from_disk(asset_library_root_ + SEP_STR + 
"blender_assets.cats.txt");
 
   /* Contains not only paths from the CDF but also the missing parents 
(implicitly defined
* catalogs). */
@@ -476,7 +477,7 @@ TEST_F(AssetCatalogTest, foreach_in_tree)
   }
 
   AssetCatalogService service(asset_library_root_);
-  service.load_from_disk(asset_library_root_ + "/" + 
"blender_assets

[Bf-blender-cvs] [a6b83617e9d] master: Fix T101705: crash when connecting reroute to multi-input socket

2022-10-17 Thread Iliya Katueshenock
Commit: a6b83617e9de01c3a4719770f88fc0ad2933e55a
Author: Iliya Katueshenock
Date:   Mon Oct 17 12:00:09 2022 +0200
Branches: master
https://developer.blender.org/rBa6b83617e9de01c3a4719770f88fc0ad2933e55a

Fix T101705: crash when connecting reroute to multi-input socket

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

===

M   source/blender/blenkernel/BKE_node.h
M   source/blender/blenkernel/intern/node.cc
M   source/blender/nodes/intern/geometry_nodes_lazy_function.cc

===

diff --git a/source/blender/blenkernel/BKE_node.h 
b/source/blender/blenkernel/BKE_node.h
index b1b4045370c..ecf7a556459 100644
--- a/source/blender/blenkernel/BKE_node.h
+++ b/source/blender/blenkernel/BKE_node.h
@@ -792,6 +792,12 @@ void nodeChainIterBackwards(const bNodeTree *ntree,
  */
 void nodeParentsIter(bNode *node, bool (*callback)(bNode *, void *), void 
*userdata);
 
+/**
+ * A dangling reroute node is a reroute node that does *not* have a "data 
source", i.e. no
+ * non-reroute node is connected to its input.
+ */
+bool nodeIsDanglingReroute(const struct bNodeTree *ntree, const struct bNode 
*node);
+
 struct bNodeLink *nodeFindLink(struct bNodeTree *ntree,
const struct bNodeSocket *from,
const struct bNodeSocket *to);
diff --git a/source/blender/blenkernel/intern/node.cc 
b/source/blender/blenkernel/intern/node.cc
index 654eb06a781..8028f990c42 100644
--- a/source/blender/blenkernel/intern/node.cc
+++ b/source/blender/blenkernel/intern/node.cc
@@ -2157,6 +2157,38 @@ void nodeParentsIter(bNode *node, bool (*callback)(bNode 
*, void *), void *userd
   }
 }
 
+bool nodeIsDanglingReroute(const bNodeTree *ntree, const bNode *node)
+{
+  ntree->ensure_topology_cache();
+  
BLI_assert(blender::bke::node_tree_runtime::topology_cache_is_available(*ntree));
+  BLI_assert(!ntree->has_available_link_cycle());
+
+  const bNode *iter_node = node;
+  if (!iter_node->is_reroute()) {
+return false;
+  }
+
+  while (true) {
+const blender::Span links =
+iter_node->input_socket(0).directly_linked_links();
+BLI_assert(links.size() <= 1);
+if (links.is_empty()) {
+  return true;
+}
+const bNodeLink &link = *links[0];
+if (!link.is_available()) {
+  return false;
+}
+if (link.is_muted()) {
+  return false;
+}
+iter_node = link.fromnode;
+if (!iter_node->is_reroute()) {
+  return false;
+}
+  }
+}
+
 /* ** Add stuff ** */
 
 void nodeUniqueName(bNodeTree *ntree, bNode *node)
diff --git a/source/blender/nodes/intern/geometry_nodes_lazy_function.cc 
b/source/blender/nodes/intern/geometry_nodes_lazy_function.cc
index 6475a16477a..5bf245f1832 100644
--- a/source/blender/nodes/intern/geometry_nodes_lazy_function.cc
+++ b/source/blender/nodes/intern/geometry_nodes_lazy_function.cc
@@ -158,8 +158,9 @@ class LazyFunctionForMultiInput : public LazyFunction {
 base_type_ = get_socket_cpp_type(socket);
 BLI_assert(base_type_ != nullptr);
 BLI_assert(socket.is_multi_input());
+const bNodeTree &btree = socket.owner_tree();
 for (const bNodeLink *link : socket.directly_linked_links()) {
-  if (!link->is_muted()) {
+  if (!(link->is_muted() || nodeIsDanglingReroute(&btree, 
link->fromnode))) {
 inputs_.append({"Input", *base_type_});
   }
 }
@@ -1073,9 +1074,7 @@ struct GeometryNodesLazyFunctionGraphBuilder {
 
   void insert_links_from_socket(const bNodeSocket &from_bsocket, 
lf::OutputSocket &from_lf_socket)
   {
-const bNode &from_bnode = from_bsocket.owner_node();
-if (this->is_dangling_reroute_input(from_bnode)) {
-  /* Dangling reroutes should not be used as source of values. */
+if (nodeIsDanglingReroute(&btree_, &from_bsocket.owner_node())) {
   return;
 }
 
@@ -1145,7 +1144,8 @@ struct GeometryNodesLazyFunctionGraphBuilder {
 if (multi_input_link == link) {
   break;
 }
-if (!multi_input_link->is_muted()) {
+if (!(multi_input_link->is_muted() ||
+  nodeIsDanglingReroute(&btree_, multi_input_link->fromnode))) 
{
   link_index++;
 }
   }
@@ -1174,33 +1174,6 @@ struct GeometryNodesLazyFunctionGraphBuilder {
 }
   }
 
-  bool is_dangling_reroute_input(const bNode &node)
-  {
-if (!node.is_reroute()) {
-  return false;
-}
-const bNode *iter_node = &node;
-/* It is guaranteed at a higher level that there are no link cycles. */
-while (true) {
-  const Span links = 
iter_node->input_socket(0).directly_linked_links();
-  BLI_assert(links.size() <= 1);
-  if (links.is_empty()) {
-return true;
-  }
-  const bNodeLink &link = *links[0];
-  if (!link.is_available()) {
-return false;
-  }
-  if (link.is_mute

[Bf-blender-cvs] [e5425b566d0] master: Geometry Nodes: separate Instances from InstancesComponent

2022-10-17 Thread Jacques Lucke
Commit: e5425b566d0f25f60b5895c4025c183fd67c7d9c
Author: Jacques Lucke
Date:   Mon Oct 17 11:39:40 2022 +0200
Branches: master
https://developer.blender.org/rBe5425b566d0f25f60b5895c4025c183fd67c7d9c

Geometry Nodes: separate Instances from InstancesComponent

This makes instance handling more consistent with all the other geometry
component types. For example, `MeshComponent` contains a `Mesh *` and
now `InstancesComponent` has a `Instances *`.

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

===

M   source/blender/blenkernel/BKE_geometry_fields.hh
M   source/blender/blenkernel/BKE_geometry_set.hh
A   source/blender/blenkernel/BKE_instances.hh
M   source/blender/blenkernel/CMakeLists.txt
M   source/blender/blenkernel/intern/geometry_component_instances.cc
M   source/blender/blenkernel/intern/geometry_fields.cc
M   source/blender/blenkernel/intern/geometry_set.cc
M   source/blender/blenkernel/intern/geometry_set_instances.cc
A   source/blender/blenkernel/intern/instances.cc
M   source/blender/blenkernel/intern/object_dupli.cc
M   source/blender/editors/space_spreadsheet/spreadsheet_column.cc
M   
source/blender/editors/space_spreadsheet/spreadsheet_data_source_geometry.cc
M   source/blender/editors/space_spreadsheet/spreadsheet_layout.cc
M   source/blender/editors/space_spreadsheet/spreadsheet_row_filter.cc
M   source/blender/geometry/intern/realize_instances.cc
M   source/blender/nodes/geometry/nodes/node_geo_collection_info.cc
M   source/blender/nodes/geometry/nodes/node_geo_delete_geometry.cc
M   source/blender/nodes/geometry/nodes/node_geo_duplicate_elements.cc
M   source/blender/nodes/geometry/nodes/node_geo_geometry_to_instance.cc
M   source/blender/nodes/geometry/nodes/node_geo_input_instance_rotation.cc
M   source/blender/nodes/geometry/nodes/node_geo_input_instance_scale.cc
M   source/blender/nodes/geometry/nodes/node_geo_instance_on_points.cc
M   source/blender/nodes/geometry/nodes/node_geo_instances_to_points.cc
M   source/blender/nodes/geometry/nodes/node_geo_join_geometry.cc
M   source/blender/nodes/geometry/nodes/node_geo_object_info.cc
M   source/blender/nodes/geometry/nodes/node_geo_rotate_instances.cc
M   source/blender/nodes/geometry/nodes/node_geo_scale_instances.cc
M   source/blender/nodes/geometry/nodes/node_geo_string_to_curves.cc
M   source/blender/nodes/geometry/nodes/node_geo_transform.cc
M   source/blender/nodes/geometry/nodes/node_geo_translate_instances.cc
M   source/blender/nodes/intern/geometry_nodes_log.cc

===

diff --git a/source/blender/blenkernel/BKE_geometry_fields.hh 
b/source/blender/blenkernel/BKE_geometry_fields.hh
index 988e0017f04..2eef67dba98 100644
--- a/source/blender/blenkernel/BKE_geometry_fields.hh
+++ b/source/blender/blenkernel/BKE_geometry_fields.hh
@@ -75,14 +75,14 @@ class PointCloudFieldContext : public fn::FieldContext {
 
 class InstancesFieldContext : public fn::FieldContext {
  private:
-  const InstancesComponent &instances_;
+  const Instances &instances_;
 
  public:
-  InstancesFieldContext(const InstancesComponent &instances) : 
instances_(instances)
+  InstancesFieldContext(const Instances &instances) : instances_(instances)
   {
   }
 
-  const InstancesComponent &instances() const
+  const Instances &instances() const
   {
 return instances_;
   }
@@ -128,13 +128,13 @@ class GeometryFieldContext : public fn::FieldContext {
   const Mesh *mesh() const;
   const CurvesGeometry *curves() const;
   const PointCloud *pointcloud() const;
-  const InstancesComponent *instances() const;
+  const Instances *instances() const;
 
  private:
   GeometryFieldContext(const Mesh &mesh, eAttrDomain domain);
   GeometryFieldContext(const CurvesGeometry &curves, eAttrDomain domain);
   GeometryFieldContext(const PointCloud &points);
-  GeometryFieldContext(const InstancesComponent &instances);
+  GeometryFieldContext(const Instances &instances);
 };
 
 class GeometryFieldInput : public fn::FieldInput {
@@ -187,8 +187,7 @@ class InstancesFieldInput : public fn::FieldInput {
   GVArray get_varray_for_context(const fn::FieldContext &context,
  IndexMask mask,
  ResourceScope &scope) const override;
-  virtual GVArray get_varray_for_context(const InstancesComponent &instances,
- IndexMask mask) const = 0;
+  virtual GVArray get_varray_for_context(const Instances &instances, IndexMask 
mask) const = 0;
 };
 
 class AttributeFieldInput : public GeometryFieldInput {
diff --git a/source/blender/blenkernel/BKE_geometry_set.hh 
b/source/blender/blenkernel/BKE_geometry_set.hh
index 2ef9556afc7..b488806c8e7 100644
--- a/source/blender/blenkernel/BKE_geometry_set.hh
+++ b/source/blender/blenkernel/BKE_geo

[Bf-blender-cvs] [db40b62252e] master: Sculpt: Auto-masking UI improvements

2022-10-17 Thread Pablo Vazquez
Commit: db40b62252e5a7716cd403a0574cc164163b2ce9
Author: Pablo Vazquez
Date:   Mon Oct 17 11:17:42 2022 +0200
Branches: master
https://developer.blender.org/rBdb40b62252e5a7716cd403a0574cc164163b2ce9

Sculpt: Auto-masking UI improvements

Add auto-masking as a popover in the header while in Sculpt mode,
following the design in T101593.

These properties were present in the Options panel (and popover),
they have been removed from there.

Moreover, this commit makes the auto-masking section in Brush settings
match the new popover.

In the future this popover can be used for other modes that support
auto-masking such as Grease Pencil.

See D16145 for details and screenshots.

Reviewed By: JulienKaspar

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

===

M   release/scripts/startup/bl_ui/properties_paint_common.py
M   release/scripts/startup/bl_ui/space_view3d.py
M   release/scripts/startup/bl_ui/space_view3d_toolbar.py
M   source/blender/makesrna/intern/rna_brush.c
M   source/blender/makesrna/intern/rna_sculpt_paint.c

===

diff --git a/release/scripts/startup/bl_ui/properties_paint_common.py 
b/release/scripts/startup/bl_ui/properties_paint_common.py
index 72a87703bd5..0e49a506e73 100644
--- a/release/scripts/startup/bl_ui/properties_paint_common.py
+++ b/release/scripts/startup/bl_ui/properties_paint_common.py
@@ -928,60 +928,80 @@ def brush_settings_advanced(layout, context, brush, 
popover=False):
 use_frontface = False
 
 if mode == 'SCULPT':
+sculpt = context.tool_settings.sculpt
 capabilities = brush.sculpt_capabilities
 use_accumulate = capabilities.has_accumulate
 use_frontface = True
 
 col = layout.column(heading="Auto-Masking", align=True)
 
-# topology automasking
+col = layout.column(align=True)
 col.prop(brush, "use_automasking_topology", text="Topology")
-
-# face masks automasking
 col.prop(brush, "use_automasking_face_sets", text="Face Sets")
 
-# boundary edges/face sets automasking
+layout.separator()
+
+col = layout.column(align=True)
 col.prop(brush, "use_automasking_boundary_edges", text="Mesh Boundary")
 col.prop(brush, "use_automasking_boundary_face_sets", text="Face Sets 
Boundary")
-col.prop(brush, "use_automasking_cavity", text="Cavity")
-col.prop(brush, "use_automasking_cavity_inverted", text="Cavity 
(Inverted)")
-col.prop(brush, "use_automasking_start_normal", text="Area Normal")
-col.prop(brush, "use_automasking_view_normal", text="View Normal")
 
-col.separator()
-col.prop(brush, "automasking_boundary_edges_propagation_steps")
+if brush.use_automasking_boundary_edges or 
brush.use_automasking_boundary_face_sets:
+col = layout.column()
+col.use_property_split = False
+split = col.split(factor=0.4)
+col = split.column()
+split.prop(brush, "automasking_boundary_edges_propagation_steps")
 
-sculpt = context.tool_settings.sculpt
+layout.separator()
 
-if brush.use_automasking_start_normal:
-col.separator()
+col = layout.column(align=True)
+row = col.row()
+row.prop(brush, "use_automasking_cavity", text="Cavity")
 
-col.prop(sculpt, "automasking_start_normal_limit")
-col.prop(sculpt, "automasking_start_normal_falloff")
+is_cavity_active = brush.use_automasking_cavity or 
brush.use_automasking_cavity_inverted
 
-if brush.use_automasking_view_normal:
-col.separator()
+if is_cavity_active:
+row.operator("sculpt.mask_from_cavity", text="Create Mask")
 
-col.prop(brush, "use_automasking_view_occlusion", text="Occlusion")
-col.prop(sculpt, "automasking_view_normal_limit")
-col.prop(sculpt, "automasking_view_normal_falloff")
+col.prop(brush, "use_automasking_cavity_inverted", text="Cavity 
(inverted)")
 
-if brush.use_automasking_cavity or 
brush.use_automasking_cavity_inverted:
-col.separator()
+if is_cavity_active:
+col = layout.column(align=True)
+col.prop(brush, "automasking_cavity_factor", text="Factor")
+col.prop(brush, "automasking_cavity_blur_steps", text="Blur")
 
-col.prop(brush, "automasking_cavity_factor", text="Cavity Factor")
-col.prop(brush, "automasking_cavity_blur_steps", text="Cavity 
Blur")
-col.prop(brush, "use_automasking_custom_cavity_curve", text="Use 
Curve")
+col = layout.column()
+col.prop(brush, "use_automasking_custom_cavity_curve", 
text="Custom Curve")
 
 if brush.use_automasking_custom_cavity_curve:
 col.template_curve_mapping(brush, "auto

[Bf-blender-cvs] [11bb38e887d] master: Make sure all dependency graphs are updated on particles system copy

2022-10-17 Thread Sergey Sharybin
Commit: 11bb38e887d29635498fb184f6434144546e9fb4
Author: Sergey Sharybin
Date:   Mon Oct 17 11:03:21 2022 +0200
Branches: master
https://developer.blender.org/rB11bb38e887d29635498fb184f6434144546e9fb4

Make sure all dependency graphs are updated on particles system copy

===

M   source/blender/editors/physics/particle_object.c

===

diff --git a/source/blender/editors/physics/particle_object.c 
b/source/blender/editors/physics/particle_object.c
index 4986ed8f343..210757173eb 100644
--- a/source/blender/editors/physics/particle_object.c
+++ b/source/blender/editors/physics/particle_object.c
@@ -1267,8 +1267,7 @@ static int copy_particle_systems_exec(bContext *C, 
wmOperator *op)
   CTX_DATA_END;
 
   if (changed_tot > 0) {
-Depsgraph *depsgraph = CTX_data_depsgraph_pointer(C);
-DEG_graph_tag_relations_update(depsgraph);
+DEG_relations_tag_update(CTX_data_main(C));
   }
 
   if ((changed_tot == 0 && fail == 0) || fail) {

___
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] [89effac57e0] master: Fix T101851: Duplicating a particle system crashes

2022-10-17 Thread Sergey Sharybin
Commit: 89effac57e057249b787454191b95be392633ecf
Author: Sergey Sharybin
Date:   Mon Oct 17 11:02:13 2022 +0200
Branches: master
https://developer.blender.org/rB89effac57e057249b787454191b95be392633ecf

Fix T101851: Duplicating a particle system crashes

===

M   source/blender/editors/physics/particle_object.c

===

diff --git a/source/blender/editors/physics/particle_object.c 
b/source/blender/editors/physics/particle_object.c
index 71ed32caede..4986ed8f343 100644
--- a/source/blender/editors/physics/particle_object.c
+++ b/source/blender/editors/physics/particle_object.c
@@ -1204,9 +1204,7 @@ static bool copy_particle_systems_to_object(const 
bContext *C,
 #undef PSYS_FROM_FIRST
 #undef PSYS_FROM_NEXT
 
-  if (duplicate_settings) {
-DEG_relations_tag_update(bmain);
-  }
+  DEG_relations_tag_update(bmain);
   DEG_id_tag_update(&ob_to->id, ID_RECALC_GEOMETRY);
   WM_main_add_notifier(NC_OBJECT | ND_PARTICLE | NA_EDITED, ob_to);
   return true;

___
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] [cb22eae31bb] sculpt-dev: sculpt-dev: fix hide bugs and a compiler error

2022-10-17 Thread Joseph Eagar
Commit: cb22eae31bb1fb751c24450db1be716287ef9818
Author: Joseph Eagar
Date:   Mon Oct 17 00:48:36 2022 -0700
Branches: sculpt-dev
https://developer.blender.org/rBcb22eae31bb1fb751c24450db1be716287ef9818

sculpt-dev: fix hide bugs and a compiler error

===

M   source/blender/blenkernel/intern/paint.cc
M   source/blender/editors/sculpt_paint/paint_hide.c
M   source/blender/editors/sculpt_paint/sculpt.c

===

diff --git a/source/blender/blenkernel/intern/paint.cc 
b/source/blender/blenkernel/intern/paint.cc
index c8602b74e3c..11c4f3b8c15 100644
--- a/source/blender/blenkernel/intern/paint.cc
+++ b/source/blender/blenkernel/intern/paint.cc
@@ -2794,7 +2794,7 @@ static void init_sculptvert_layer_faces(SculptSession 
*ss, PBVH *pbvh, int totve
 MV_ADD_FLAG(mv, SCULPTVERT_NEED_VALENCE | SCULPTVERT_NEED_DISK_SORT);
 mv->stroke_id = -1;
 
-PBVHVertRef vertex = {.i = i};
+PBVHVertRef vertex = {i};
 
 BKE_sculpt_boundary_flag_update(ss, vertex);
 
@@ -2826,7 +2826,7 @@ static void init_sculptvert_layer_grids(SculptSession 
*ss, PBVH *pbvh, int totve
 MV_ADD_FLAG(mv, SCULPTVERT_NEED_VALENCE | SCULPTVERT_NEED_DISK_SORT);
 mv->stroke_id = -1;
 
-PBVHVertRef vertex = {.i = i};
+PBVHVertRef vertex = {i};
 
 BKE_sculpt_boundary_flag_update(ss, vertex);
 BKE_pbvh_update_vert_boundary_grids(pbvh, ss->subdiv_ccg, vertex);
diff --git a/source/blender/editors/sculpt_paint/paint_hide.c 
b/source/blender/editors/sculpt_paint/paint_hide.c
index 7b5a24c3a35..edaf94c7c82 100644
--- a/source/blender/editors/sculpt_paint/paint_hide.c
+++ b/source/blender/editors/sculpt_paint/paint_hide.c
@@ -223,17 +223,13 @@ static void partialvis_update_bmesh_verts(BMesh *bm,
   TGSET_ITER_END
 }
 
-static void partialvis_update_bmesh_faces(TableGSet *faces)
+static void partialvis_update_bmesh_faces(TableGSet *faces, int cd_hide_poly)
 {
   BMFace *f;
-
+  
   TGSET_ITER (f, faces) {
-if (paint_is_bmesh_face_hidden(f)) {
-  BM_elem_flag_enable(f, BM_ELEM_HIDDEN);
-}
-else {
-  BM_elem_flag_disable(f, BM_ELEM_HIDDEN);
-}
+bool hidden = paint_is_bmesh_face_hidden(f);
+BM_ELEM_CD_SET_BOOL(f, cd_hide_poly, hidden);
   }
   TGSET_ITER_END
 }
@@ -261,7 +257,7 @@ static void partialvis_update_bmesh(Object *ob,
   partialvis_update_bmesh_verts(bm, other, action, area, planes, &any_changed, 
&any_visible);
 
   /* Finally loop over node faces and tag the ones that are fully hidden. */
-  partialvis_update_bmesh_faces(faces);
+  partialvis_update_bmesh_faces(faces, 
ob->sculpt->attrs.hide_poly->bmesh_cd_offset);
 
   if (any_changed) {
 BKE_pbvh_node_mark_rebuild_draw(node);
@@ -340,6 +336,8 @@ static int hide_show_exec(bContext *C, wmOperator *op)
   clip_planes_from_rect(C, depsgraph, clip_planes, &rect);
 
   pbvh = BKE_sculpt_object_pbvh_ensure(depsgraph, ob);
+  BKE_sculpt_hide_poly_ensure(ob);
+
   BLI_assert(ob->sculpt->pbvh == pbvh);
 
   get_pbvh_nodes(pbvh, &nodes, &totnode, clip_planes, area);
diff --git a/source/blender/editors/sculpt_paint/sculpt.c 
b/source/blender/editors/sculpt_paint/sculpt.c
index 66a1c802d88..d5c915651a3 100644
--- a/source/blender/editors/sculpt_paint/sculpt.c
+++ b/source/blender/editors/sculpt_paint/sculpt.c
@@ -810,6 +810,11 @@ void SCULPT_face_visibility_all_invert(SculptSession *ss)
 
 void SCULPT_face_visibility_all_set(SculptSession *ss, bool visible)
 {
+  if (visible && !ss->attrs.hide_poly) {
+/* This case is allowed. */
+return;
+  }
+
   switch (BKE_pbvh_type(ss->pbvh)) {
 case PBVH_FACES:
 case PBVH_GRIDS:
@@ -822,7 +827,7 @@ void SCULPT_face_visibility_all_set(SculptSession *ss, bool 
visible)
   for (int i = 0; i < ss->totfaces; i++) {
 PBVHFaceRef face = BKE_pbvh_index_to_face(ss->pbvh, i);
 
-*(bool *)BKE_sculpt_face_attr_get(face, ss->attrs.hide_poly) = visible;
+*(bool *)BKE_sculpt_face_attr_get(face, ss->attrs.hide_poly) = 
!visible;
   }
   }
 }
@@ -1202,6 +1207,8 @@ void SCULPT_visibility_sync_all_from_faces(Object *ob)
 
   if (!ss->attrs.hide_poly) {
 BM_ITER_MESH (f, &iter, ss->bm, BM_FACES_OF_MESH) {
+  BM_elem_flag_disable(f, BM_ELEM_HIDDEN);
+
   BMLoop *l = f->l_first;
   do {
 BM_elem_flag_disable(l->v, BM_ELEM_HIDDEN);
@@ -1226,9 +1233,12 @@ void SCULPT_visibility_sync_all_from_faces(Object *ob)
   /* Unhide verts and edges attached to visible faces. */
   BM_ITER_MESH (f, &iter, ss->bm, BM_FACES_OF_MESH) {
 if (BM_ELEM_CD_GET_BOOL(f, cd_hide_poly)) {
+  BM_elem_flag_enable(f, BM_ELEM_HIDDEN);
   continue;
 }
 
+BM_elem_flag_disable(f, BM_ELEM_HIDDEN);
+
 BMLoop *l = f->l_first;
 do {
   BM_elem_flag_disable(l->v, BM_ELEM_HIDDEN);

___
Bf-blender-cvs mailing list
Bf-b

[Bf-blender-cvs] [4dad98a6ae9] sculpt-dev: sculpt-dev: Fix windows compile error

2022-10-17 Thread Joseph Eagar
Commit: 4dad98a6ae929ac61b937330cb89e676634a3c4c
Author: Joseph Eagar
Date:   Mon Oct 17 00:18:47 2022 -0700
Branches: sculpt-dev
https://developer.blender.org/rB4dad98a6ae929ac61b937330cb89e676634a3c4c

sculpt-dev: Fix windows compile error

===

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

===

diff --git a/source/blender/blenkernel/intern/mesh_mapping.cc 
b/source/blender/blenkernel/intern/mesh_mapping.cc
index 10775c9eeab..173ce286240 100644
--- a/source/blender/blenkernel/intern/mesh_mapping.cc
+++ b/source/blender/blenkernel/intern/mesh_mapping.cc
@@ -213,7 +213,7 @@ static void calc_cloud_normal(DiskCycleSortData *varr,
 
   /* Find the 'co_a' point from center. */
   int co_a_index = 0;
-  const float *co_a = NULL;
+  const float *co_a = nullptr;
   {
 float dist_sq_max = -1.0f;
 for (int i = 0; i < varr_len; i++) {
@@ -227,13 +227,13 @@ static void calc_cloud_normal(DiskCycleSortData *varr,
   }
 
   float dir_a[3];
-  const float *co_a_opposite = NULL;
-  const float *co_b_opposite = NULL;
+  const float *co_a_opposite = nullptr;
+  const float *co_b_opposite = nullptr;
 
   sub_v3_v3v3(dir_a, co_a, center);
   normalize_v3(dir_a);
 
-  const float *co_b = NULL;
+  const float *co_b = nullptr;
   float dir_b[3] = {0.0f, 0.0f, 0.0f};
   {
 float dist_sq_max = -1.0f;
@@ -288,10 +288,10 @@ static void calc_cloud_normal(DiskCycleSortData *varr,
   normal_quad_v3(r_normal, co_a, co_b, co_a_opposite, co_b_opposite);
 
 finally:
-  if (r_center != NULL) {
+  if (r_center != nullptr) {
 copy_v3_v3(r_center, center);
   }
-  if (r_index_tangent != NULL) {
+  if (r_index_tangent != nullptr) {
 *r_index_tangent = co_a_index;
   }
 }
@@ -408,8 +408,9 @@ static bool sort_disk_cycle(const MPoly *mpoly,
 bool is_loops,
 bool is_edges)
 {
-  DiskCycleSortData *sortdata = BLI_array_alloca(sortdata, (unsigned 
int)elem->count);
-  int *doneset = BLI_array_alloca(doneset, (unsigned int)elem->count);
+  DiskCycleSortData *sortdata = (DiskCycleSortData *)BLI_array_alloca(sortdata,
+  
(unsigned int)elem->count);
+  int *doneset = (int *)BLI_array_alloca(doneset, (unsigned int)elem->count);
   int donelen = 0;
 
   if (is_loops) {
@@ -645,7 +646,7 @@ void BKE_mesh_vert_edge_map_create(MeshElemMap **r_map,
 
   if (sort_disk_cycles) {
 for (i = 0; i < totvert; i++) {
-  sort_disk_cycle(NULL, NULL, medge, mvert, i, map + i, false, true);
+  sort_disk_cycle(nullptr, nullptr, medge, mvert, i, map + i, false, true);
 }
   }
 
@@ -1458,8 +1459,8 @@ static bool mesh_calc_islands_loop_poly_uv(const MVert * 
/*verts*/,
   edge_innercut_indices);
   }
 
-  MEM_freeN(edge_poly_map);
-  MEM_freeN(edge_poly_mem);
+  MEM_SAFE_FREE(edge_poly_map);
+  MEM_SAFE_FREE(edge_poly_mem);
 
   if (luvs) {
 MEM_freeN(edge_loop_map);

___
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