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

2022-06-16 Thread Campbell Barton
Commit: 62346abc022c2c5b39e4535e7b5786c045a44457
Author: Campbell Barton
Date:   Fri Jun 17 07:33:06 2022 +1000
Branches: master
https://developer.blender.org/rB62346abc022c2c5b39e4535e7b5786c045a44457

Cleanup: spelling in comments

===

M   intern/ghost/intern/GHOST_ContextGLX.cpp
M   intern/ghost/intern/GHOST_SystemWayland.cpp
M   source/blender/blenkernel/intern/gpencil_modifier.c
M   source/blender/blenloader/intern/versioning_280.c
M   source/blender/editors/mesh/editmesh_bevel.c
M   source/blender/io/wavefront_obj/importer/obj_import_file_reader.cc
M   source/blender/makesdna/DNA_constraint_types.h
M   source/blender/makesdna/DNA_ipo_types.h
M   source/blender/makesdna/DNA_light_types.h
M   source/blender/makesdna/DNA_windowmanager_types.h
M   source/blender/render/intern/render_result.c

===

diff --git a/intern/ghost/intern/GHOST_ContextGLX.cpp 
b/intern/ghost/intern/GHOST_ContextGLX.cpp
index baabdc6c521..b4a076e4598 100644
--- a/intern/ghost/intern/GHOST_ContextGLX.cpp
+++ b/intern/ghost/intern/GHOST_ContextGLX.cpp
@@ -105,7 +105,7 @@ GHOST_TSuccess GHOST_ContextGLX::initializeDrawingContext()
   GHOST_X11_ERROR_HANDLERS_OVERRIDE(handler_store);
 
   /*  */
-  /* Begin Inline Glew */
+  /* Begin Inline GLEW. */
 
 #ifdef USE_GLXEW_INIT_WORKAROUND
   const GLubyte *extStart = (GLubyte *)"";
@@ -142,11 +142,11 @@ GHOST_TSuccess 
GHOST_ContextGLX::initializeDrawingContext()
   "GLX_EXT_create_context_es2_profile", extStart, extEnd);
 #  endif /* WITH_GLEW_ES */
 
-  /* End Inline Glew */
+  /* End Inline GLEW. */
   /*  */
 #else
-  /* important to initialize only glxew (_not_ glew),
-   * since this breaks w/ Mesa's `swrast`, see: T46431 */
+  /* Important to initialize only glxew (_not_ GLEW),
+   * since this breaks w/ Mesa's `swrast`, see: T46431. */
   glxewInit();
 #endif /* USE_GLXEW_INIT_WORKAROUND */
 
@@ -395,7 +395,7 @@ int GHOST_X11_GL_GetAttributes(
   return i;
 }
 
-/* excuse inlining part of glew */
+/* Excuse inlining part of GLEW. */
 #ifdef USE_GLXEW_INIT_WORKAROUND
 static GLuint _glewStrLen(const GLubyte *s)
 {
diff --git a/intern/ghost/intern/GHOST_SystemWayland.cpp 
b/intern/ghost/intern/GHOST_SystemWayland.cpp
index d8fbe875f67..4b5fa2bf3fb 100644
--- a/intern/ghost/intern/GHOST_SystemWayland.cpp
+++ b/intern/ghost/intern/GHOST_SystemWayland.cpp
@@ -153,7 +153,7 @@ struct input_t {
*   wl_fixed_to_int(scale * input->xy[0]),
*   wl_fixed_to_int(scale * input->xy[1]),
* };
-   * \endocde
+   * \endcode
*/
   wl_fixed_t xy[2] = {0, 0};
   GHOST_Buttons buttons = GHOST_Buttons();
@@ -1860,14 +1860,12 @@ static void xdg_output_handle_logical_size(void *data,
 
   if (output->size_logical[0] != 0 && output->size_logical[1] != 0) {
 /* Original comment from SDL. */
-/* FIXME: GNOME has a bug where the logical size does not account for
+/* FIXME(@flibit): GNOME has a bug where the logical size does not account 
for
  * scale, resulting in bogus viewport sizes.
  *
  * Until this is fixed, validate that _some_ kind of scaling is being
  * done (we can't match exactly because fractional scaling can't be
- * detected otherwise), then override if necessary.
- * -flibit
- */
+ * detected otherwise), then override if necessary. */
 if ((output->size_logical[0] == width) && (output->scale_fractional == 
wl_fixed_from_int(1))) {
   GHOST_PRINT("xdg_output scale did not match, overriding with wl_output 
scale");
   return;
diff --git a/source/blender/blenkernel/intern/gpencil_modifier.c 
b/source/blender/blenkernel/intern/gpencil_modifier.c
index 5ef4d231807..0bf5418ea8f 100644
--- a/source/blender/blenkernel/intern/gpencil_modifier.c
+++ b/source/blender/blenkernel/intern/gpencil_modifier.c
@@ -678,7 +678,7 @@ static void copy_frame_to_eval_cb(bGPDlayer *gpl,
 
 static void gpencil_copy_visible_frames_to_eval(Depsgraph *depsgraph, Scene 
*scene, Object *ob)
 {
-  /* Remap layers'active frame with time modifiers applied. */
+  /* Remap layers active frame with time modifiers applied. */
   bGPdata *gpd_eval = ob->data;
   LISTBASE_FOREACH (bGPDlayer *, gpl_eval, _eval->layers) {
 bGPDframe *gpf_eval = gpl_eval->actframe;
diff --git a/source/blender/blenloader/intern/versioning_280.c 
b/source/blender/blenloader/intern/versioning_280.c
index eafb27f9758..e542bc46a28 100644
--- a/source/blender/blenloader/intern/versioning_280.c
+++ b/source/blender/blenloader/intern/versioning_280.c
@@ -4102,7 +4102,7 @@ void blo_do_versions_280(FileData *fd, Library 
*UNUSED(lib), Main *bmain)
 LISTBASE_FOREACH (Object *, ob, >objects) {
   LISTBASE_FOREACH (ModifierData *, md, >modifiers) {
 if (md->type == 

[Bf-blender-cvs] [483bc6c9c13] master: Cleanup: unused variable warning

2022-06-16 Thread Campbell Barton
Commit: 483bc6c9c136235a69eb4550d024f000b2a46df5
Author: Campbell Barton
Date:   Fri Jun 17 07:23:21 2022 +1000
Branches: master
https://developer.blender.org/rB483bc6c9c136235a69eb4550d024f000b2a46df5

Cleanup: unused variable warning

===

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

===

diff --git a/source/blender/blenkernel/intern/mesh_boolean_convert.cc 
b/source/blender/blenkernel/intern/mesh_boolean_convert.cc
index 79bdc08fe8f..a1ef2d2e6b5 100644
--- a/source/blender/blenkernel/intern/mesh_boolean_convert.cc
+++ b/source/blender/blenkernel/intern/mesh_boolean_convert.cc
@@ -853,7 +853,8 @@ Mesh *direct_mesh_boolean(Span meshes,
   target_transform,
   use_self,
   hole_tolerant,
-  boolean_mode);
+  boolean_mode,
+  r_intersecting_edges);
   return nullptr;
 #endif  // WITH_GMP
 }

___
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] [e2975cb7016] master: Geometry Nodes: add 'Intersecting Edges' output for boolean node

2022-06-16 Thread Philipp Oeser
Commit: e2975cb701692574504967178699c9ab083dc3f8
Author: Philipp Oeser
Date:   Mon Apr 4 12:26:50 2022 +0200
Branches: master
https://developer.blender.org/rBe2975cb701692574504967178699c9ab083dc3f8

Geometry Nodes: add 'Intersecting Edges' output for boolean node

This patch adds a 'Intersecting Edges' output with a boolean selection
that only gives you the new edges on intersections.

Will work on a couple of examples next, this should make some
interesting effects possible (including getting us closer to the "bevel-
after-boolean-usecase")

To achieve this, a Vector is passed to `direct_mesh_boolean` when the
iMesh is still available (and intersecting edges appended), then from
those edge indices a selection will be stored as attribute.

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

===

M   source/blender/blenkernel/BKE_mesh_boolean_convert.hh
M   source/blender/blenkernel/intern/mesh_boolean_convert.cc
M   source/blender/modifiers/intern/MOD_boolean.cc
M   source/blender/nodes/geometry/nodes/node_geo_boolean.cc

===

diff --git a/source/blender/blenkernel/BKE_mesh_boolean_convert.hh 
b/source/blender/blenkernel/BKE_mesh_boolean_convert.hh
index abaf2ab0178..441783d46a1 100644
--- a/source/blender/blenkernel/BKE_mesh_boolean_convert.hh
+++ b/source/blender/blenkernel/BKE_mesh_boolean_convert.hh
@@ -23,6 +23,8 @@ namespace blender::meshintersect {
  * \param material_remaps: An array of maps from material slot numbers in the 
corresponding mesh
  * to the material slot in the first mesh. It is OK for material_remaps or any 
of its constituent
  * arrays to be empty.
+ * \param r_intersecting_edges: Array to store indices of edges on the 
resulting mesh in. These
+ * 'new' edges are the result of the intersections.
  */
 Mesh *direct_mesh_boolean(Span meshes,
   Span transforms,
@@ -30,6 +32,7 @@ Mesh *direct_mesh_boolean(Span meshes,
   Span> material_remaps,
   bool use_self,
   bool hole_tolerant,
-  int boolean_mode);
+  int boolean_mode,
+  Vector *r_intersecting_edges);
 
 }  // namespace blender::meshintersect
diff --git a/source/blender/blenkernel/intern/mesh_boolean_convert.cc 
b/source/blender/blenkernel/intern/mesh_boolean_convert.cc
index 14bd6aa5b2f..79bdc08fe8f 100644
--- a/source/blender/blenkernel/intern/mesh_boolean_convert.cc
+++ b/source/blender/blenkernel/intern/mesh_boolean_convert.cc
@@ -791,7 +791,8 @@ Mesh *direct_mesh_boolean(Span meshes,
   Span> material_remaps,
   const bool use_self,
   const bool hole_tolerant,
-  const int boolean_mode)
+  const int boolean_mode,
+  Vector *r_intersecting_edges)
 {
 #ifdef WITH_GMP
   BLI_assert(meshes.size() == transforms.size());
@@ -828,7 +829,23 @@ Mesh *direct_mesh_boolean(Span meshes,
 write_obj_mesh(m_out, "m_out");
   }
 
-  return imesh_to_mesh(_out, mim);
+  Mesh *result = imesh_to_mesh(_out, mim);
+
+  /* Store intersecting edge indices. */
+  if (r_intersecting_edges != nullptr) {
+for (int fi : m_out.face_index_range()) {
+  const Face  = *m_out.face(fi);
+  const MPoly  = result->mpoly[fi];
+  for (int corner_i : face.index_range()) {
+if (face.is_intersect[corner_i]) {
+  int e_index = result->mloop[poly.loopstart + corner_i].e;
+  r_intersecting_edges->append(e_index);
+}
+  }
+}
+  }
+
+  return result;
 #else   // WITH_GMP
   UNUSED_VARS(meshes,
   transforms,
diff --git a/source/blender/modifiers/intern/MOD_boolean.cc 
b/source/blender/modifiers/intern/MOD_boolean.cc
index 07504d91fea..5739de1c65c 100644
--- a/source/blender/modifiers/intern/MOD_boolean.cc
+++ b/source/blender/modifiers/intern/MOD_boolean.cc
@@ -447,7 +447,8 @@ static Mesh *exact_boolean_mesh(BooleanModifierData *bmd,
  material_remaps,
  use_self,
  hole_tolerant,
- bmd->operation);
+ bmd->operation,
+ nullptr);
 }
 #endif
 
diff --git a/source/blender/nodes/geometry/nodes/node_geo_boolean.cc 
b/source/blender/nodes/geometry/nodes/node_geo_boolean.cc
index e485172d3e1..daeca311e08 100644
--- a/source/blender/nodes/geometry/nodes/node_geo_boolean.cc
+++ b/source/blender/nodes/geometry/nodes/node_geo_boolean.cc
@@ -20,6 +20,7 @@ static void node_declare(NodeDeclarationBuilder )
   b.add_input(N_("Self 

[Bf-blender-cvs] [5f9cebe6189] soc-2022-many-lights-sampling: Cycles: update light tree importance and correct normals/position args

2022-06-16 Thread Jeffrey Liu
Commit: 5f9cebe618922608c6f310cb7012bb9c0089c49d
Author: Jeffrey Liu
Date:   Thu Jun 16 14:14:58 2022 -0400
Branches: soc-2022-many-lights-sampling
https://developer.blender.org/rB5f9cebe618922608c6f310cb7012bb9c0089c49d

Cycles: update light tree importance and correct normals/position args

===

M   intern/cycles/kernel/integrator/shade_surface.h
M   intern/cycles/kernel/light/light_tree.h

===

diff --git a/intern/cycles/kernel/integrator/shade_surface.h 
b/intern/cycles/kernel/integrator/shade_surface.h
index d08ddca2291..c77ca9431df 100644
--- a/intern/cycles/kernel/integrator/shade_surface.h
+++ b/intern/cycles/kernel/integrator/shade_surface.h
@@ -117,7 +117,7 @@ ccl_device_forceinline void 
integrate_surface_direct_light(KernelGlobals kg,
 
 if (kg->__data.integrator.use_light_tree) {
   if (!light_tree_sample_from_position(
-  kg, rng_state, light_u, light_v, sd->time, sd->N, sd->P, bounce, 
path_flag, )) {
+  kg, rng_state, light_u, light_v, sd->time, sd->P, sd->N, bounce, 
path_flag, )) {
 return;
   }
 }
diff --git a/intern/cycles/kernel/light/light_tree.h 
b/intern/cycles/kernel/light/light_tree.h
index 839653faa44..4d62365d23e 100644
--- a/intern/cycles/kernel/light/light_tree.h
+++ b/intern/cycles/kernel/light/light_tree.h
@@ -4,12 +4,28 @@
 
 CCL_NAMESPACE_BEGIN
 
-ccl_device float light_tree_bounding_box_angle(KernelGlobals kg,
-   const float3 bbox_min,
+ccl_device float light_tree_bounding_box_angle(const float3 bbox_min,
const float3 bbox_max,
-   const float3 P)
+   const float3 P,
+   const float3 point_to_centroid)
 {
-  return 0;
+  /* Want to iterate through all 8 possible points of the bounding box. */
+  float theta_u = 0;
+  float3 corners[8];
+  corners[0] = bbox_min;
+  corners[1] = make_float3(bbox_min.x, bbox_min.y, bbox_max.z);
+  corners[2] = make_float3(bbox_min.x, bbox_max.y, bbox_min.z);
+  corners[3] = make_float3(bbox_min.x, bbox_max.y, bbox_max.z);
+  corners[4] = make_float3(bbox_max.x, bbox_min.y, bbox_min.z);
+  corners[5] = make_float3(bbox_max.x, bbox_min.y, bbox_max.z);
+  corners[6] = make_float3(bbox_max.x, bbox_max.y, bbox_min.z);
+  corners[7] = bbox_max;
+  for (int i = 0; i < 8; ++i) {
+float3 point_to_corner = normalize(P - corners[i]);
+const float cos_theta_u = dot(point_to_centroid, point_to_corner);
+theta_u = fmaxf(fast_acosf(cos_theta_u), theta_u);
+  }
+  return theta_u;
 }
 
 /* This is the general function for calculating the importance of either a 
cluster or an emitter.
@@ -25,14 +41,13 @@ ccl_device float light_tree_node_importance(const float3 P,
 const float energy)
 {
   const float3 centroid = 0.5f * bbox_min + 0.5f * bbox_max;
-  const float3 point_to_centroid = P - centroid;
-  const float3 point_to_bbox_max = P - bbox_max;
+  const float3 point_to_centroid = normalize(P - centroid);
 
-  const float distance_squared = len_squared(point_to_centroid);
+  const float distance_squared = len_squared(P - centroid);
 
   const float theta = fast_acosf(dot(bcone_axis, -point_to_centroid));
   const float theta_i = fast_acosf(dot(point_to_centroid, N));
-  const float theta_u = fast_acosf(dot(point_to_centroid, point_to_bbox_max));
+  const float theta_u = light_tree_bounding_box_angle(bbox_min, bbox_max, P, 
point_to_centroid);
 
   /* to-do: compare this with directly using fmaxf and cosf. */
   /* Avoid using cosine until needed. */

___
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] [c27a395d8cd] asset-greasepencil: Merge branch 'master' into asset-greasepencil

2022-06-16 Thread Antonio Vazquez
Commit: c27a395d8cd8b58b3155cfdc26ae35198fbcdb14
Author: Antonio Vazquez
Date:   Thu Jun 16 20:07:02 2022 +0200
Branches: asset-greasepencil
https://developer.blender.org/rBc27a395d8cd8b58b3155cfdc26ae35198fbcdb14

Merge branch 'master' into asset-greasepencil

===



===



___
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] [650d2f863dc] master: Cleanup: Use const in File Browser filtering operator

2022-06-16 Thread Julian Eisel
Commit: 650d2f863dcaa3c9f7fae8ac6fd715722df558b7
Author: Julian Eisel
Date:   Thu Jun 16 19:36:58 2022 +0200
Branches: master
https://developer.blender.org/rB650d2f863dcaa3c9f7fae8ac6fd715722df558b7

Cleanup: Use const in File Browser filtering operator

===

M   source/blender/editors/space_file/file_ops.c

===

diff --git a/source/blender/editors/space_file/file_ops.c 
b/source/blender/editors/space_file/file_ops.c
index 578288ca289..8b205029559 100644
--- a/source/blender/editors/space_file/file_ops.c
+++ b/source/blender/editors/space_file/file_ops.c
@@ -2914,9 +2914,9 @@ void FILE_OT_delete(struct wmOperatorType *ot)
 
 static int file_start_filter_exec(bContext *C, wmOperator *UNUSED(op))
 {
-  ScrArea *area = CTX_wm_area(C);
-  SpaceFile *sfile = CTX_wm_space_file(C);
-  FileSelectParams *params = ED_fileselect_get_active_params(sfile);
+  const ScrArea *area = CTX_wm_area(C);
+  const SpaceFile *sfile = CTX_wm_space_file(C);
+  const FileSelectParams *params = ED_fileselect_get_active_params(sfile);
 
   ARegion *region_ctx = CTX_wm_region(C);

___
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] [209bf7780e7] master: UI: Add file browser operator to edit directory field

2022-06-16 Thread Damien Picard
Commit: 209bf7780e7c005650482fa843062864f91845af
Author: Damien Picard
Date:   Thu Jun 16 19:44:39 2022 +0200
Branches: master
https://developer.blender.org/rB209bf7780e7c005650482fa843062864f91845af

UI: Add file browser operator to edit directory field

This allows using a shortcut from the file browser to edit the directory
path. The shortcut Ctrl + L is quite standard and used in multiple
GNU/Linux desktop desktop environments, Windows, as well as most web
browsers. Safari on macOS uses Cmd + L.

Reviewed by: Jacques Lucke, Julian Eisel

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

===

M   release/scripts/presets/keyconfig/keymap_data/blender_default.py
M   source/blender/editors/space_file/file_intern.h
M   source/blender/editors/space_file/file_ops.c
M   source/blender/editors/space_file/space_file.c

===

diff --git a/release/scripts/presets/keyconfig/keymap_data/blender_default.py 
b/release/scripts/presets/keyconfig/keymap_data/blender_default.py
index f61d8465952..7d0929ef28f 100644
--- a/release/scripts/presets/keyconfig/keymap_data/blender_default.py
+++ b/release/scripts/presets/keyconfig/keymap_data/blender_default.py
@@ -2223,6 +2223,7 @@ def km_file_browser(params):
 ("file.smoothscroll", {"type": 'TIMER1', "value": 'ANY', "any": True}, 
None),
 ("file.bookmark_add", {"type": 'B', "value": 'PRESS', "ctrl": True}, 
None),
 ("file.start_filter", {"type": 'F', "value": 'PRESS', "ctrl": True}, 
None),
+("file.edit_directory_path", {"type": 'L', "value": 'PRESS', "ctrl": 
True}, None),
 ("file.filenum", {"type": 'NUMPAD_PLUS', "value": 'PRESS', "repeat": 
True},
  {"properties": [("increment", 1)]}),
 ("file.filenum", {"type": 'NUMPAD_PLUS', "value": 'PRESS', "shift": 
True, "repeat": True},
diff --git a/source/blender/editors/space_file/file_intern.h 
b/source/blender/editors/space_file/file_intern.h
index 1ee6445f4ba..655a7983e2b 100644
--- a/source/blender/editors/space_file/file_intern.h
+++ b/source/blender/editors/space_file/file_intern.h
@@ -83,6 +83,7 @@ void FILE_OT_rename(struct wmOperatorType *ot);
 void FILE_OT_smoothscroll(struct wmOperatorType *ot);
 void FILE_OT_filepath_drop(struct wmOperatorType *ot);
 void FILE_OT_start_filter(struct wmOperatorType *ot);
+void FILE_OT_edit_directory_path(struct wmOperatorType *ot);
 void FILE_OT_view_selected(struct wmOperatorType *ot);
 
 void file_directory_enter_handle(bContext *C, void *arg_unused, void *arg_but);
diff --git a/source/blender/editors/space_file/file_ops.c 
b/source/blender/editors/space_file/file_ops.c
index 8b205029559..62bdd583bc1 100644
--- a/source/blender/editors/space_file/file_ops.c
+++ b/source/blender/editors/space_file/file_ops.c
@@ -2949,6 +2949,46 @@ void FILE_OT_start_filter(struct wmOperatorType *ot)
 
 /** \} */
 
+/*  */
+/** \name Edit Directory Path Operator
+ * \{ */
+
+static int file_edit_directory_path_exec(bContext *C, wmOperator *UNUSED(op))
+{
+  const ScrArea *area = CTX_wm_area(C);
+  const SpaceFile *sfile = CTX_wm_space_file(C);
+  const FileSelectParams *params = ED_fileselect_get_active_params(sfile);
+
+  ARegion *region_ctx = CTX_wm_region(C);
+
+  if (area) {
+LISTBASE_FOREACH (ARegion *, region, >regionbase) {
+  CTX_wm_region_set(C, region);
+  if (UI_textbutton_activate_rna(C, region, params, "directory")) {
+break;
+  }
+}
+  }
+
+  CTX_wm_region_set(C, region_ctx);
+
+  return OPERATOR_FINISHED;
+}
+
+void FILE_OT_edit_directory_path(struct wmOperatorType *ot)
+{
+  /* identifiers */
+  ot->name = "Edit Directory Path";
+  ot->description = "Start editing directory field";
+  ot->idname = "FILE_OT_edit_directory_path";
+
+  /* api callbacks */
+  ot->exec = file_edit_directory_path_exec;
+  ot->poll = ED_operator_file_active;
+}
+
+/** \} */
+
 /*  */
 /** \name Macro Operators
  * \{ */
diff --git a/source/blender/editors/space_file/space_file.c 
b/source/blender/editors/space_file/space_file.c
index 0170361f244..a462476aae0 100644
--- a/source/blender/editors/space_file/space_file.c
+++ b/source/blender/editors/space_file/space_file.c
@@ -695,6 +695,7 @@ static void file_operatortypes(void)
   WM_operatortype_append(FILE_OT_smoothscroll);
   WM_operatortype_append(FILE_OT_filepath_drop);
   WM_operatortype_append(FILE_OT_start_filter);
+  WM_operatortype_append(FILE_OT_edit_directory_path);
   WM_operatortype_append(FILE_OT_view_selected);
 }

___
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] [b6b5f317a3f] master: Revert "Revert "Revert "TEST COMMIT: API doc generation changes."""

2022-06-16 Thread Bastien Montagne
Commit: b6b5f317a3fba3b1ceb286f67556ab35c3e90d7c
Author: Bastien Montagne
Date:   Thu Jun 16 19:35:55 2022 +0200
Branches: master
https://developer.blender.org/rBb6b5f317a3fba3b1ceb286f67556ab35c3e90d7c

Revert "Revert "Revert "TEST COMMIT: API doc generation changes."""

This reverts commit 5a30fe29ef2e1f424df0403284b3ebba5644403f.

===

M   doc/python_api/sphinx_changelog_gen.py
M   doc/python_api/sphinx_doc_gen.py

===

diff --git a/doc/python_api/sphinx_changelog_gen.py 
b/doc/python_api/sphinx_changelog_gen.py
index 6a5ebc1cfb8..a782c6483b6 100644
--- a/doc/python_api/sphinx_changelog_gen.py
+++ b/doc/python_api/sphinx_changelog_gen.py
@@ -1,112 +1,59 @@
 # SPDX-License-Identifier: GPL-2.0-or-later
 
 """

+Dump the python API into a text file so we can generate changelogs.
 
-Dump the python API into a JSON file, or generate changelogs from those JSON 
API dumps.
+output from this tool should be added into "doc/python_api/rst/change_log.rst"
 
-Typically, changelog output from this tool should be added into 
"doc/python_api/rst/change_log.rst"
+# dump api blender_version.py in CWD
+blender --background --python doc/python_api/sphinx_changelog_gen.py -- --dump
 
-API dump files are saved together with the generated API doc on the server, 
with a general index file.
-This way the changelog generation simply needs to re-download the previous 
version's dump for the diffing process.
-

-
-# Dump api blender_version.json in CWD:
-blender --background  --factory-startup --python 
doc/python_api/sphinx_changelog_gen.py -- \
---indexpath="path/to/api/docs/api_dump_index.json" \
-dump --filepath-out="path/to/api/docs//api_dump.json"
-
-# Create changelog:
+# create changelog
 blender --background --factory-startup --python 
doc/python_api/sphinx_changelog_gen.py -- \
---indexpath="path/to/api/docs/api_dump_index.json" \
-changelog --filepath-out doc/python_api/rst/change_log.rst
+--api_from blender_2_63_0.py \
+--api_to   blender_2_64_0.py \
+--api_out changes.rst
 
-# Api comparison can also run without blender,
-# will by default generate changeloig between the last two available versions 
listed in the index,
-# unless input files are provided explicitely:
-python doc/python_api/sphinx_changelog_gen.py -- \
---indexpath="path/to/api/docs/api_dump_index.json" \
-changelog --filepath-in-from blender_api_2_63_0.json \
-  --filepath-in-to   blender_api_2_64_0.json \
-  --filepath-out changes.rst
 
---
-
-API dump index format:
-
-{[version_main, version_sub]: "/api_dump.json", ...
-}
-
-API dump format:
+# Api comparison can also run without blender
+python doc/python_api/sphinx_changelog_gen.py -- \
+--api_from blender_api_2_63_0.py \
+--api_to   blender_api_2_64_0.py \
+--api_out changes.rst
 
-[
-[version_main, vserion_sub, version_path],
-{"module.name":
-{"parent.class":
-{"basic_type", "member_name":
-["Name", type, range, length, default, descr, f_args, 
f_arg_types, f_ret_types]}, ...
-}, ...
-}
-]
+# Save the latest API dump in this folder, renaming it with its revision.
+# This way the next person updating it doesn't need to build an old Blender 
only for that
 
 """
 
-import json
-import os
-
+# format
+'''
+{"module.name":
+{"parent.class":
+{"basic_type", "member_name":
+("Name", type, range, length, default, descr, f_args, f_arg_types, 
f_ret_types)}, ...
+}, ...
+}
+'''
 
 api_names = "basic_type" "name", "type", "range", "length", "default", 
"descr", "f_args", "f_arg_types", "f_ret_types"
+
 API_BASIC_TYPE = 0
 API_F_ARGS = 7
 
 
-def api_version():
-try:
-import bpy
-except:
-return None, None
-version = tuple(bpy.app.version[:2])
-version_key = "%d.%d" % (version[0], version[1])
-return version, version_key
-
-
-def api_version_previous_in_index(index, version):
-print("Searching for previous version to %s in %r" % (version, index))
-version_prev = (version[0], version[1])
-while True:
-version_prev = (version_prev[0], version_prev[1] - 1)
-if version_prev[1] < 0:
-version_prev = (version_prev[0] - 1, 99)
-if version_prev[0] < 0:
-return None, None
-version_prev_key = "%d.%d" % (version_prev[0], version_prev[1])
-print("Checking for previous version %s" % (version_prev,))
-if version_prev_key in index:
-print("Found previous version %s: %r" % (version_prev, 
index[version_prev_key]))
-return version_prev, version_prev_key
-
-
-class JSONEncoderAPIDump(json.JSONEncoder):
-def default(self, o):
-if o is ...:
-return "..."
-if 

[Bf-blender-cvs] [23d2e77a54f] master: UI: Add initial "grid view"

2022-06-16 Thread Julian Eisel
Commit: 23d2e77a54f4f813d7ee38ddb06c14ecc0943e4e
Author: Julian Eisel
Date:   Thu Jun 16 11:29:20 2022 +0200
Branches: master
https://developer.blender.org/rB23d2e77a54f4f813d7ee38ddb06c14ecc0943e4e

UI: Add initial "grid view"

Part of T98560.
See https://wiki.blender.org/wiki/Source/Interface/Views

Adds all the basic functionality needed for grid views. They display
items in a grid of rows and columns, typically with a preview image and
a label underneath. Think of the main region in the Asset Browser.

Current features:
- Active item
- Notifier listening (also added this to the tree view)
- Performance: Skip adding buttons that are not scrolled into view
  (solves performance problems for big asset libraries, for example).
- Custom item size
- Preview items (items that draw a preview with a label underneath)
- Margins between items scale so the entire region width is filled with
  column, rather than leaving a big empty block at the right if there's
  not enough space for another column (like the File and current Asset
Browser does it).
- "Data-View Item" theme colors. Not shown in the UI yet.

No user visible changes expected since the grid views aren't used for
anything yet.

This was developed as part of a rewrite of the Asset Browser UI
(`asset-browser-grid-view` branch), see T95653. There's no reason to
keep this part in a branch, continuing development in master makes
things easier.

Grid and tree views have a lot of very similar code, so I'm planning to
unify them to a degree. I kept things separate for the start to first
find out how much and what exactly makes sense to override.

===

M   release/datafiles/userdef/userdef_default_theme.c
M   release/scripts/startup/bl_ui/space_userpref.py
M   source/blender/blenloader/intern/versioning_userdef.c
A   source/blender/editors/include/UI_grid_view.hh
M   source/blender/editors/include/UI_interface.h
M   source/blender/editors/include/UI_interface.hh
M   source/blender/editors/include/UI_tree_view.hh
M   source/blender/editors/interface/CMakeLists.txt
A   source/blender/editors/interface/grid_view.cc
M   source/blender/editors/interface/interface.cc
M   source/blender/editors/interface/interface_handlers.c
M   source/blender/editors/interface/interface_intern.h
M   source/blender/editors/interface/interface_query.cc
M   source/blender/editors/interface/interface_template_list.cc
M   source/blender/editors/interface/interface_view.cc
M   source/blender/editors/interface/interface_widgets.c
M   source/blender/editors/interface/tree_view.cc
M   source/blender/editors/screen/area.c
M   source/blender/editors/space_file/filesel.c
M   source/blender/editors/util/CMakeLists.txt
M   source/blender/makesdna/DNA_userdef_types.h
M   source/blender/makesrna/intern/rna_userdef.c

===

diff --git a/release/datafiles/userdef/userdef_default_theme.c 
b/release/datafiles/userdef/userdef_default_theme.c
index 19798e3f165..04ad04d4812 100644
--- a/release/datafiles/userdef/userdef_default_theme.c
+++ b/release/datafiles/userdef/userdef_default_theme.c
@@ -194,6 +194,15 @@ const bTheme U_theme_default = {
   .text_sel = RGBA(0x),
   .roundness = 0.2f,
 },
+.wcol_view_item = {
+  .outline = RGBA(0x2d2d2dff),
+  .inner = RGBA(0x303030ff),
+  .inner_sel = RGBA(0x4772b3ff),
+  .item = RGBA(0x4772b3ff),
+  .text = RGBA(0xccff),
+  .text_sel = RGBA(0x),
+  .roundness = 0.2f,
+},
 .wcol_pie_menu = {
   .outline = RGBA(0x242424ff),
   .inner = RGBA(0x181818ff),
diff --git a/release/scripts/startup/bl_ui/space_userpref.py 
b/release/scripts/startup/bl_ui/space_userpref.py
index 191066df89f..5070bd04142 100644
--- a/release/scripts/startup/bl_ui/space_userpref.py
+++ b/release/scripts/startup/bl_ui/space_userpref.py
@@ -1196,6 +1196,8 @@ class ThemeGenericClassGenerator:
 ("Scroll Bar", "wcol_scroll"),
 ("Progress Bar", "wcol_progress"),
 ("List Item", "wcol_list_item"),
+# Not used yet, so hide this from the UI.
+# ("Data-View Item", "wcol_view_item"),
 ("Tab", "wcol_tab"),
 ]
 
diff --git a/source/blender/blenloader/intern/versioning_userdef.c 
b/source/blender/blenloader/intern/versioning_userdef.c
index b3f3b9cbf7d..40359500d3c 100644
--- a/source/blender/blenloader/intern/versioning_userdef.c
+++ b/source/blender/blenloader/intern/versioning_userdef.c
@@ -347,6 +347,7 @@ static void do_versions_theme(const UserDef *userdef, 
bTheme *btheme)
*/
   {
 /* Keep this block, even when empty. */
+btheme->tui.wcol_view_item = U_theme_default.tui.wcol_view_item;
   }
 
 #undef FROM_DEFAULT_V4_UCHAR
diff --git a/source/blender/editors/include/UI_grid_view.hh 

[Bf-blender-cvs] [69d3f41d75e] master: Cleanup: Spelling in comment

2022-06-16 Thread Sergey Sharybin
Commit: 69d3f41d75ec62e3a7c9658104f438e0756a7e01
Author: Sergey Sharybin
Date:   Thu Jun 16 17:36:58 2022 +0200
Branches: master
https://developer.blender.org/rB69d3f41d75ec62e3a7c9658104f438e0756a7e01

Cleanup: Spelling in comment

===

M   source/blender/editors/mask/mask_query.c

===

diff --git a/source/blender/editors/mask/mask_query.c 
b/source/blender/editors/mask/mask_query.c
index 89524a7b9e2..02e1524e23e 100644
--- a/source/blender/editors/mask/mask_query.c
+++ b/source/blender/editors/mask/mask_query.c
@@ -615,7 +615,7 @@ bool ED_mask_selected_minmax(const bContext *C,
 
   /* Use evaluated mask to take animation into account.
* The animation of splies is not "flushed" back to original, so need to 
explicitly
-   * sue evaluated datablock here. */
+   * use evaluated datablock here. */
   Mask *mask_eval = (Mask *)DEG_get_evaluated_id(depsgraph, >id);
 
   INIT_MINMAX2(min, max);

___
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] [6562a11c60d] master: Cleanup: use proper variable name

2022-06-16 Thread Sergey Sharybin
Commit: 6562a11c60d83c42dfdd6c9f3f852e23ed87d633
Author: Sergey Sharybin
Date:   Thu Jun 16 16:58:33 2022 +0200
Branches: master
https://developer.blender.org/rB6562a11c60d83c42dfdd6c9f3f852e23ed87d633

Cleanup: use proper variable name

The `SpaceClip *sc` got incorrectly renamed to `SpaceClip *screen`
in the ad85989a3f88.

===

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

===

diff --git a/source/blender/editors/screen/screen_ops.c 
b/source/blender/editors/screen/screen_ops.c
index 80b0862bbab..55721e6380d 100644
--- a/source/blender/editors/screen/screen_ops.c
+++ b/source/blender/editors/screen/screen_ops.c
@@ -665,8 +665,8 @@ bool ED_operator_mask(bContext *C)
   if (area && area->spacedata.first) {
 switch (area->spacetype) {
   case SPACE_CLIP: {
-SpaceClip *screen = area->spacedata.first;
-return ED_space_clip_check_show_maskedit(screen);
+SpaceClip *space_clip = area->spacedata.first;
+return ED_space_clip_check_show_maskedit(space_clip);
   }
   case SPACE_SEQ: {
 SpaceSeq *sseq = area->spacedata.first;

___
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] [dc11e1164a0] master: Fix T98796: avoid unnecessary mesh copy

2022-06-16 Thread Jacques Lucke
Commit: dc11e1164a07bedd477020a43dcf35fabdb1ad49
Author: Jacques Lucke
Date:   Thu Jun 16 16:44:58 2022 +0200
Branches: master
https://developer.blender.org/rBdc11e1164a07bedd477020a43dcf35fabdb1ad49

Fix T98796: avoid unnecessary mesh copy

The call to `get_component_for_write` would sometimes copy the mesh
even when the mesh is replaced with itself. The `replace_mesh` method
handles that case already, so just use that instead.

===

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

===

diff --git a/source/blender/blenkernel/intern/geometry_set_instances.cc 
b/source/blender/blenkernel/intern/geometry_set_instances.cc
index d3c3f41779a..2d6e0e05a97 100644
--- a/source/blender/blenkernel/intern/geometry_set_instances.cc
+++ b/source/blender/blenkernel/intern/geometry_set_instances.cc
@@ -32,9 +32,7 @@ static void add_final_mesh_as_geometry_component(const Object 
, GeometryS
 
   if (mesh != nullptr) {
 BKE_mesh_wrapper_ensure_mdata(mesh);
-
-MeshComponent _component = 
geometry_set.get_component_for_write();
-mesh_component.replace(mesh, GeometryOwnershipType::ReadOnly);
+geometry_set.replace_mesh(mesh, GeometryOwnershipType::ReadOnly);
   }
 }

___
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] [947ece8d395] master: LineArt: Variable name cleanups.

2022-06-16 Thread Yiming Wu
Commit: 947ece8d395a61bdae52da0d2a760873d43d2305
Author: Yiming Wu
Date:   Tue Jun 14 21:30:41 2022 +0800
Branches: master
https://developer.blender.org/rB947ece8d395a61bdae52da0d2a760873d43d2305

LineArt: Variable name cleanups.

Use more descriptive names for some of the two character variables.

Reviewed By: Sebastian Parborg (zeddb)

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

===

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

===

diff --git a/source/blender/gpencil_modifiers/intern/lineart/MOD_lineart.h 
b/source/blender/gpencil_modifiers/intern/lineart/MOD_lineart.h
index 6ca6fe2ff96..a72ce76d591 100644
--- a/source/blender/gpencil_modifiers/intern/lineart/MOD_lineart.h
+++ b/source/blender/gpencil_modifiers/intern/lineart/MOD_lineart.h
@@ -102,7 +102,7 @@ typedef struct LineartVert {
* size of the struct is extended to include intersection data.
* See #eLineArtVertFlags.
*/
-  char flag;
+  uint8_t flag;
 
 } LineartVert;
 
@@ -460,9 +460,6 @@ typedef struct LineartBoundingArea {
 
 #define LRT_MIN3_INDEX_ABC(x, y, z) (x < y ? (x < z ? a : (y < z ? b : c)) : 
(y < z ? b : c))
 
-#define LRT_ABC(index) (index == 0 ? a : (index == 1 ? b : c))
-#define LRT_PABC(index) (index == 0 ? pa : (index == 1 ? pb : pc))
-
 #define DBL_LOOSER 1e-5
 #define LRT_DOUBLE_CLOSE_LOOSER(a, b) (((a) + DBL_LOOSER) >= (b) && 
((a)-DBL_LOOSER) <= (b))
 #define LRT_DOUBLE_CLOSE_ENOUGH(a, b) (((a) + DBL_EDGE_LIM) >= (b) && 
((a)-DBL_EDGE_LIM) <= (b))
diff --git a/source/blender/gpencil_modifiers/intern/lineart/lineart_cpu.c 
b/source/blender/gpencil_modifiers/intern/lineart/lineart_cpu.c
index 9a46f8d72ca..c08bf3e0fe9 100644
--- a/source/blender/gpencil_modifiers/intern/lineart/lineart_cpu.c
+++ b/source/blender/gpencil_modifiers/intern/lineart/lineart_cpu.c
@@ -168,9 +168,9 @@ static void lineart_edge_cut(LineartData *ld,
  uchar material_mask_bits,
  uchar mat_occlusion)
 {
-  LineartEdgeSegment *es, *ies, *next_es, *prev_es;
+  LineartEdgeSegment *seg, *i_seg, *next_seg, *prev_seg;
   LineartEdgeSegment *cut_start_before = 0, *cut_end_before = 0;
-  LineartEdgeSegment *ns = 0, *ns2 = 0;
+  LineartEdgeSegment *new_seg1 = 0, *new_seg2 = 0;
   int untouched = 0;
 
   /* If for some reason the occlusion function may give a result that has zero 
length, or reversed
@@ -197,136 +197,136 @@ static void lineart_edge_cut(LineartData *ld,
   /* Begin looking for starting position of the segment. */
   /* Not using a list iteration macro because of it more clear when using for 
loops to iterate
* through the segments. */
-  for (es = e->segments.first; es; es = es->next) {
-if (LRT_DOUBLE_CLOSE_ENOUGH(es->at, start)) {
-  cut_start_before = es;
-  ns = cut_start_before;
+  for (seg = e->segments.first; seg; seg = seg->next) {
+if (LRT_DOUBLE_CLOSE_ENOUGH(seg->at, start)) {
+  cut_start_before = seg;
+  new_seg1 = cut_start_before;
   break;
 }
-if (es->next == NULL) {
+if (seg->next == NULL) {
   break;
 }
-ies = es->next;
-if (ies->at > start + 1e-09 && start > es->at) {
-  cut_start_before = ies;
-  ns = lineart_give_segment(ld);
+i_seg = seg->next;
+if (i_seg->at > start + 1e-09 && start > seg->at) {
+  cut_start_before = i_seg;
+  new_seg1 = lineart_give_segment(ld);
   break;
 }
   }
   if (!cut_start_before && LRT_DOUBLE_CLOSE_ENOUGH(1, end)) {
 untouched = 1;
   }
-  for (es = cut_start_before; es; es = es->next) {
+  for (seg = cut_start_before; seg; seg = seg->next) {
 /* We tried to cut at existing cutting point (e.g. where the line's 
occluded by a triangle
  * strip). */
-if (LRT_DOUBLE_CLOSE_ENOUGH(es->at, end)) {
-  cut_end_before = es;
-  ns2 = cut_end_before;
+if (LRT_DOUBLE_CLOSE_ENOUGH(seg->at, end)) {
+  cut_end_before = seg;
+  new_seg2 = cut_end_before;
   break;
 }
 /* This check is to prevent `es->at == 1.0` (where we don't need to cut 
because we are at the
  * end point). */
-if (!es->next && LRT_DOUBLE_CLOSE_ENOUGH(1, end)) {
-  cut_end_before = es;
-  ns2 = cut_end_before;
+if (!seg->next && LRT_DOUBLE_CLOSE_ENOUGH(1, end)) {
+  cut_end_before = seg;
+  new_seg2 = cut_end_before;
   untouched = 1;
   break;
 }
 /* When an actual cut is needed in the line. */
-if (es->at > end) {
-  cut_end_before = es;
-  ns2 = lineart_give_segment(ld);
+if (seg->at > end) {
+  cut_end_before = seg;
+  new_seg2 = lineart_give_segment(ld);
   break;
 }
   }
 
   /* When we still can't find any existing cut in the line, we allocate new 

[Bf-blender-cvs] [8b9469ec361] master: Cleanup: Fix build for make lite and add . to code comments

2022-06-16 Thread Dalai Felinto
Commit: 8b9469ec361594bc8401bf29d5a11f71895182b4
Author: Dalai Felinto
Date:   Thu Jun 16 16:37:01 2022 +0200
Branches: master
https://developer.blender.org/rB8b9469ec361594bc8401bf29d5a11f71895182b4

Cleanup: Fix build for make lite and add . to code comments

Issue introduced on e6eefdd4020e.

===

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

===

diff --git a/source/blender/makesrna/intern/rna_scene.c 
b/source/blender/makesrna/intern/rna_scene.c
index 28fc2483ad3..9e2a1d81bd3 100644
--- a/source/blender/makesrna/intern/rna_scene.c
+++ b/source/blender/makesrna/intern/rna_scene.c
@@ -2712,7 +2712,8 @@ static char *rna_FFmpegSettings_path(const PointerRNA 
*UNUSED(ptr))
   return BLI_strdup("render.ffmpeg");
 }
 
-/* FFMpeg Codec setting update hook */
+#  ifdef WITH_FFMPEG
+/* FFMpeg Codec setting update hook. */
 static void rna_FFmpegSettings_codec_update(Main *UNUSED(bmain),
 Scene *UNUSED(scene),
 PointerRNA *ptr)
@@ -2721,11 +2722,12 @@ static void rna_FFmpegSettings_codec_update(Main 
*UNUSED(bmain),
   if (!ELEM(codec_data->codec, AV_CODEC_ID_H264, AV_CODEC_ID_MPEG4, 
AV_CODEC_ID_VP9)) {
 /* Constant Rate Factor (CRF) setting is only available for H264,
  * MPEG4 and WEBM/VP9 codecs. So changing encoder quality mode to
- * CBR as CRF is not supported
+ * CBR as CRF is not supported.
  */
 codec_data->constant_rate_factor = FFM_CRF_NONE;
   }
 }
+#  endif
 
 #else

___
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] [5a30fe29ef2] master: Revert "Revert "TEST COMMIT: API doc generation changes.""

2022-06-16 Thread Bastien Montagne
Commit: 5a30fe29ef2e1f424df0403284b3ebba5644403f
Author: Bastien Montagne
Date:   Thu Jun 16 16:36:11 2022 +0200
Branches: master
https://developer.blender.org/rB5a30fe29ef2e1f424df0403284b3ebba5644403f

Revert "Revert "TEST COMMIT: API doc generation changes.""

This reverts commit 502089f275ded113732c24cad2a96e2a899ecd5c.

Enable again temporarily the new test code for API doc generation.

===

M   doc/python_api/sphinx_changelog_gen.py
M   doc/python_api/sphinx_doc_gen.py

===

diff --git a/doc/python_api/sphinx_changelog_gen.py 
b/doc/python_api/sphinx_changelog_gen.py
index a782c6483b6..6a5ebc1cfb8 100644
--- a/doc/python_api/sphinx_changelog_gen.py
+++ b/doc/python_api/sphinx_changelog_gen.py
@@ -1,59 +1,112 @@
 # SPDX-License-Identifier: GPL-2.0-or-later
 
 """
-Dump the python API into a text file so we can generate changelogs.
+---
 
-output from this tool should be added into "doc/python_api/rst/change_log.rst"
+Dump the python API into a JSON file, or generate changelogs from those JSON 
API dumps.
 
-# dump api blender_version.py in CWD
-blender --background --python doc/python_api/sphinx_changelog_gen.py -- --dump
+Typically, changelog output from this tool should be added into 
"doc/python_api/rst/change_log.rst"
 
-# create changelog
-blender --background --factory-startup --python 
doc/python_api/sphinx_changelog_gen.py -- \
---api_from blender_2_63_0.py \
---api_to   blender_2_64_0.py \
---api_out changes.rst
+API dump files are saved together with the generated API doc on the server, 
with a general index file.
+This way the changelog generation simply needs to re-download the previous 
version's dump for the diffing process.
+
+---
 
+# Dump api blender_version.json in CWD:
+blender --background  --factory-startup --python 
doc/python_api/sphinx_changelog_gen.py -- \
+--indexpath="path/to/api/docs/api_dump_index.json" \
+dump --filepath-out="path/to/api/docs//api_dump.json"
+
+# Create changelog:
+blender --background --factory-startup --python 
doc/python_api/sphinx_changelog_gen.py -- \
+--indexpath="path/to/api/docs/api_dump_index.json" \
+changelog --filepath-out doc/python_api/rst/change_log.rst
 
-# Api comparison can also run without blender
+# Api comparison can also run without blender,
+# will by default generate changeloig between the last two available versions 
listed in the index,
+# unless input files are provided explicitely:
 python doc/python_api/sphinx_changelog_gen.py -- \
---api_from blender_api_2_63_0.py \
---api_to   blender_api_2_64_0.py \
---api_out changes.rst
+--indexpath="path/to/api/docs/api_dump_index.json" \
+changelog --filepath-in-from blender_api_2_63_0.json \
+  --filepath-in-to   blender_api_2_64_0.json \
+  --filepath-out changes.rst
 
-# Save the latest API dump in this folder, renaming it with its revision.
-# This way the next person updating it doesn't need to build an old Blender 
only for that
+--
 
-"""
+API dump index format:
 
-# format
-'''
-{"module.name":
-{"parent.class":
-{"basic_type", "member_name":
-("Name", type, range, length, default, descr, f_args, f_arg_types, 
f_ret_types)}, ...
-}, ...
+{[version_main, version_sub]: "/api_dump.json", ...
 }
-'''
 
-api_names = "basic_type" "name", "type", "range", "length", "default", 
"descr", "f_args", "f_arg_types", "f_ret_types"
+API dump format:
+
+[
+[version_main, vserion_sub, version_path],
+{"module.name":
+{"parent.class":
+{"basic_type", "member_name":
+["Name", type, range, length, default, descr, f_args, 
f_arg_types, f_ret_types]}, ...
+}, ...
+}
+]
 
+"""
+
+import json
+import os
+
+
+api_names = "basic_type" "name", "type", "range", "length", "default", 
"descr", "f_args", "f_arg_types", "f_ret_types"
 API_BASIC_TYPE = 0
 API_F_ARGS = 7
 
 
-def api_dunp_fname():
-import bpy
-return "blender_api_%s.py" % "_".join([str(i) for i in bpy.app.version])
+def api_version():
+try:
+import bpy
+except:
+return None, None
+version = tuple(bpy.app.version[:2])
+version_key = "%d.%d" % (version[0], version[1])
+return version, version_key
+
+
+def api_version_previous_in_index(index, version):
+print("Searching for previous version to %s in %r" % (version, index))
+version_prev = (version[0], version[1])
+while True:
+version_prev = (version_prev[0], version_prev[1] - 1)
+if version_prev[1] < 0:
+version_prev = (version_prev[0] - 1, 99)
+if version_prev[0] < 0:
+return None, None
+version_prev_key = "%d.%d" % (version_prev[0], version_prev[1])
+print("Checking for previous version %s" % 

[Bf-blender-cvs] [e0c966a3b97] master: Fix T98904: GPencil sculpt brushes break after you delete a brush

2022-06-16 Thread Antonio Vazquez
Commit: e0c966a3b974fd0054aeb9524822f102db773381
Author: Antonio Vazquez
Date:   Thu Jun 16 16:27:57 2022 +0200
Branches: master
https://developer.blender.org/rBe0c966a3b974fd0054aeb9524822f102db773381

Fix T98904:  GPencil sculpt brushes break after you delete a brush

There were two problems here:

1) Console warnings due to brush was None.
2) It was impossible to recreate a brush.

This patch fixes both issues and it is now possible to recreate any brush.

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

Reviewed by: @dflelinto

===

M   release/scripts/startup/bl_ui/properties_paint_common.py
M   release/scripts/startup/bl_ui/space_view3d.py
M   source/blender/editors/sculpt_paint/paint_ops.c

===

diff --git a/release/scripts/startup/bl_ui/properties_paint_common.py 
b/release/scripts/startup/bl_ui/properties_paint_common.py
index 68a7e2b4527..f0034a3d710 100644
--- a/release/scripts/startup/bl_ui/properties_paint_common.py
+++ b/release/scripts/startup/bl_ui/properties_paint_common.py
@@ -1316,6 +1316,8 @@ def brush_basic_gpencil_paint_settings(layout, context, 
brush, *, compact=False)
 
 
 def brush_basic_gpencil_sculpt_settings(layout, _context, brush, *, 
compact=False):
+if brush is None:
+return
 gp_settings = brush.gpencil_settings
 if gp_settings is None:
 return
diff --git a/release/scripts/startup/bl_ui/space_view3d.py 
b/release/scripts/startup/bl_ui/space_view3d.py
index 80ea33f8a75..5e5e7a79035 100644
--- a/release/scripts/startup/bl_ui/space_view3d.py
+++ b/release/scripts/startup/bl_ui/space_view3d.py
@@ -95,7 +95,7 @@ class VIEW3D_HT_tool_header(Header):
 elif tool_mode == 'PAINT_GPENCIL':
 if is_valid_context:
 brush = context.tool_settings.gpencil_paint.brush
-if brush.gpencil_tool != 'ERASE':
+if brush and brush.gpencil_tool != 'ERASE':
 if brush.gpencil_tool != 'TINT':
 
layout.popover("VIEW3D_PT_tools_grease_pencil_brush_advanced")
 
@@ -106,10 +106,11 @@ class VIEW3D_HT_tool_header(Header):
 elif tool_mode == 'SCULPT_GPENCIL':
 if is_valid_context:
 brush = context.tool_settings.gpencil_sculpt_paint.brush
-tool = brush.gpencil_sculpt_tool
-if tool != 'CLONE':
-
layout.popover("VIEW3D_PT_tools_grease_pencil_sculpt_brush_popover")
-
layout.popover("VIEW3D_PT_tools_grease_pencil_sculpt_appearance")
+if brush:
+tool = brush.gpencil_sculpt_tool
+if tool != 'CLONE':
+
layout.popover("VIEW3D_PT_tools_grease_pencil_sculpt_brush_popover")
+
layout.popover("VIEW3D_PT_tools_grease_pencil_sculpt_appearance")
 elif tool_mode == 'WEIGHT_GPENCIL':
 if is_valid_context:
 
layout.popover("VIEW3D_PT_tools_grease_pencil_weight_appearance")
diff --git a/source/blender/editors/sculpt_paint/paint_ops.c 
b/source/blender/editors/sculpt_paint/paint_ops.c
index 926a564184a..0f2b02ed3ab 100644
--- a/source/blender/editors/sculpt_paint/paint_ops.c
+++ b/source/blender/editors/sculpt_paint/paint_ops.c
@@ -82,11 +82,86 @@ static void BRUSH_OT_add(wmOperatorType *ot)
   ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO;
 }
 
+static eGPBrush_Presets gpencil_get_brush_preset_from_tool(bToolRef *tool,
+   enum 
eContextObjectMode mode)
+{
+  switch (mode) {
+case CTX_MODE_PAINT_GPENCIL: {
+  if (STREQ(tool->runtime->data_block, "DRAW")) {
+return GP_BRUSH_PRESET_PENCIL;
+  }
+  else if (STREQ(tool->runtime->data_block, "FILL")) {
+return GP_BRUSH_PRESET_FILL_AREA;
+  }
+  else if (STREQ(tool->runtime->data_block, "ERASE")) {
+return GP_BRUSH_PRESET_ERASER_SOFT;
+  }
+  else if (STREQ(tool->runtime->data_block, "TINT")) {
+return GP_BRUSH_PRESET_TINT;
+  }
+  break;
+}
+case CTX_MODE_SCULPT_GPENCIL: {
+  if (STREQ(tool->runtime->data_block, "SMOOTH")) {
+return GP_BRUSH_PRESET_SMOOTH_STROKE;
+  }
+  else if (STREQ(tool->runtime->data_block, "STRENGTH")) {
+return GP_BRUSH_PRESET_STRENGTH_STROKE;
+  }
+  else if (STREQ(tool->runtime->data_block, "THICKNESS")) {
+return GP_BRUSH_PRESET_THICKNESS_STROKE;
+  }
+  else if (STREQ(tool->runtime->data_block, "GRAB")) {
+return GP_BRUSH_PRESET_GRAB_STROKE;
+  }
+  else if (STREQ(tool->runtime->data_block, "PUSH")) {
+return GP_BRUSH_PRESET_PUSH_STROKE;
+  }
+  else if (STREQ(tool->runtime->data_block, "TWIST")) {
+return GP_BRUSH_PRESET_TWIST_STROKE;
+  }
+  else if (STREQ(tool->runtime->data_block, "PINCH")) {
+

[Bf-blender-cvs] [49b068bc639] master: Fix T98847: missing null check in versioning code

2022-06-16 Thread Jacques Lucke
Commit: 49b068bc639ce5e16a8d700beff2902ed266b74e
Author: Jacques Lucke
Date:   Thu Jun 16 16:23:26 2022 +0200
Branches: master
https://developer.blender.org/rB49b068bc639ce5e16a8d700beff2902ed266b74e

Fix T98847: missing null check in versioning code

It's perfectly legal for `nmd->settings.properties` to be null if
there are no properties.

===

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

===

diff --git a/source/blender/blenloader/intern/versioning_300.c 
b/source/blender/blenloader/intern/versioning_300.c
index 57240b93ab1..97b414d4b4a 100644
--- a/source/blender/blenloader/intern/versioning_300.c
+++ b/source/blender/blenloader/intern/versioning_300.c
@@ -1001,6 +1001,9 @@ static void do_version_subsurface_methods(bNode *node)
 
 static void 
version_geometry_nodes_add_attribute_input_settings(NodesModifierData *nmd)
 {
+  if (nmd->settings.properties == NULL) {
+return;
+  }
   /* Before versioning the properties, make sure it hasn't been done already. 
*/
   LISTBASE_FOREACH (const IDProperty *, property, 
>settings.properties->data.group) {
 if (strstr(property->name, "_use_attribute") || strstr(property->name, 
"_attribute_name")) {

___
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] [e6eefdd4020] master: Fix T86076: MPEG Settings Ignored at Render

2022-06-16 Thread Hamdi Ozbayburtlu
Commit: e6eefdd4020e3a9968c48b55967e4bf512b322ef
Author: Hamdi Ozbayburtlu
Date:   Thu Jun 16 16:01:57 2022 +0200
Branches: master
https://developer.blender.org/rBe6eefdd4020e3a9968c48b55967e4bf512b322ef

Fix T86076: MPEG Settings Ignored at Render

Add a RNA update function for output video codec setting to update
properties that are incompatible with defaults.

Previously video output bitrate settings were omitted because of the
Constant Rate Factor (CRF) default. CRF setting for video codec is only
available for H264, MPEG4 and WEBM/VP9 outputs, so for the others
changing encoder quality mode to constant bitrate (CBR) as CRF is not
supported.

Reviewed By: ISS, mano-wii

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

===

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

===

diff --git a/source/blender/makesrna/intern/rna_scene.c 
b/source/blender/makesrna/intern/rna_scene.c
index 3b739561f9a..28fc2483ad3 100644
--- a/source/blender/makesrna/intern/rna_scene.c
+++ b/source/blender/makesrna/intern/rna_scene.c
@@ -2712,6 +2712,21 @@ static char *rna_FFmpegSettings_path(const PointerRNA 
*UNUSED(ptr))
   return BLI_strdup("render.ffmpeg");
 }
 
+/* FFMpeg Codec setting update hook */
+static void rna_FFmpegSettings_codec_update(Main *UNUSED(bmain),
+Scene *UNUSED(scene),
+PointerRNA *ptr)
+{
+  FFMpegCodecData *codec_data = (FFMpegCodecData *)ptr->data;
+  if (!ELEM(codec_data->codec, AV_CODEC_ID_H264, AV_CODEC_ID_MPEG4, 
AV_CODEC_ID_VP9)) {
+/* Constant Rate Factor (CRF) setting is only available for H264,
+ * MPEG4 and WEBM/VP9 codecs. So changing encoder quality mode to
+ * CBR as CRF is not supported
+ */
+codec_data->constant_rate_factor = FFM_CRF_NONE;
+  }
+}
+
 #else
 
 /* Grease Pencil Interpolation tool settings */
@@ -5922,6 +5937,7 @@ static void rna_def_scene_ffmpeg_settings(BlenderRNA 
*brna)
   RNA_def_property_enum_items(prop, ffmpeg_codec_items);
   RNA_def_property_enum_default(prop, AV_CODEC_ID_H264);
   RNA_def_property_ui_text(prop, "Video Codec", "FFmpeg codec to use for video 
output");
+  RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, 
"rna_FFmpegSettings_codec_update");
 
   prop = RNA_def_property(srna, "video_bitrate", PROP_INT, PROP_NONE);
   RNA_def_property_int_sdna(prop, NULL, "video_bitrate");

___
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] [dce03ecd5c8] master: LibOverride: 3DView: simplification and improvements of override creation.

2022-06-16 Thread Bastien Montagne
Commit: dce03ecd5c85d8e8e23969ab1dc8bf800cea550e
Author: Bastien Montagne
Date:   Thu Jun 16 15:52:07 2022 +0200
Branches: master
https://developer.blender.org/rBdce03ecd5c85d8e8e23969ab1dc8bf800cea550e

LibOverride: 3DView: simplification and improvements of override creation.

This commit:
* Removes the popup to choose the root collection when called with a
  linked object selected (in typical cases there is only one valid
  option, if more then the operator fails and report to the user).
* Ensures that the linked reference of newly overridden collections are
  also removed from the ViewLayer (i.e. their local parent collections).

===

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

===

diff --git a/source/blender/editors/object/object_relations.c 
b/source/blender/editors/object/object_relations.c
index 6cfd322b2e2..f55ffdf0fcd 100644
--- a/source/blender/editors/object/object_relations.c
+++ b/source/blender/editors/object/object_relations.c
@@ -2290,27 +2290,19 @@ static int make_override_library_exec(bContext *C, 
wmOperator *op)
 user_overrides_from_selected_objects = false;
   }
   else if (!make_override_library_object_overridable_check(bmain, obact)) {
-const int i = RNA_property_enum_get(op->ptr, op->type->prop);
-const uint collection_session_uuid = *((uint *));
+const int i = RNA_property_int_get(op->ptr, op->type->prop);
+const uint collection_session_uuid = *((const uint *));
 if (collection_session_uuid == MAIN_ID_SESSION_UUID_UNSET) {
   BKE_reportf(op->reports,
   RPT_ERROR_INVALID_INPUT,
-  "Active object '%s' is not overridable",
+  "Could not find an overridable root hierarchy for object 
'%s'",
   obact->id.name + 2);
   return OPERATOR_CANCELLED;
 }
-
 Collection *collection = BLI_listbase_bytes_find(>collections,
  _session_uuid,
  
sizeof(collection_session_uuid),
  offsetof(ID, 
session_uuid));
-if (!ID_IS_OVERRIDABLE_LIBRARY(collection)) {
-  BKE_reportf(op->reports,
-  RPT_ERROR_INVALID_INPUT,
-  "Could not find an overridable collection containing object 
'%s'",
-  obact->id.name + 2);
-  return OPERATOR_CANCELLED;
-}
 id_root = >id;
 user_overrides_from_selected_objects = true;
   }
@@ -2372,10 +2364,36 @@ static int make_override_library_exec(bContext *C, 
wmOperator *op)
 BLI_gset_free(user_overrides_objects_uids, NULL);
   }
 
-  /* Remove the instance empty from this scene, the items now have an 
overridden collection
-   * instead. */
-  if (success && is_override_instancing_object) {
-ED_object_base_free_and_unlink(bmain, scene, obact);
+  if (success) {
+if (is_override_instancing_object) {
+  /* Remove the instance empty from this scene, the items now have an 
overridden collection
+   * instead. */
+  ED_object_base_free_and_unlink(bmain, scene, obact);
+}
+else {
+  /* Remove the found root ID from the view layer. */
+  switch (GS(id_root->name)) {
+case ID_GR: {
+  Collection *collection_root = (Collection *)id_root;
+  LISTBASE_FOREACH_MUTABLE (
+  CollectionParent *, collection_parent, 
_root->parents) {
+if (ID_IS_LINKED(collection_parent->collection) ||
+!BKE_view_layer_has_collection(view_layer, 
collection_parent->collection)) {
+  continue;
+}
+BKE_collection_child_remove(bmain, collection_parent->collection, 
collection_root);
+  }
+  break;
+}
+case ID_OB: {
+  /* TODO: Not sure how well we can handle this case, when we don't 
have the collections as
+   * reference containers... */
+  break;
+}
+default:
+  break;
+  }
+}
   }
 
   DEG_id_tag_update(_data_scene(C)->id, ID_RECALC_BASE_FLAGS | 
ID_RECALC_COPY_ON_WRITE);
@@ -2385,10 +2403,11 @@ static int make_override_library_exec(bContext *C, 
wmOperator *op)
 }
 
 /* Set the object to override. */
-static int make_override_library_invoke(bContext *C, wmOperator *op, const 
wmEvent *event)
+static int make_override_library_invoke(bContext *C, wmOperator *op, const 
wmEvent *UNUSED(event))
 {
   Main *bmain = CTX_data_main(C);
   Scene *scene = CTX_data_scene(C);
+  ViewLayer *view_layer = CTX_data_view_layer(C);
   Object *obact = ED_object_active_context(C);
 
   /* Sanity checks. */
@@ -2402,16 +2421,37 @@ static int make_override_library_invoke(bContext *C, 
wmOperator *op, const wmEve
 return make_override_library_exec(C, op);
   }
 
-  if (ID_IS_LINKED(obact)) {
-/* Show menu with list of directly linked 

[Bf-blender-cvs] [798b49109b2] master: ID Type: Sort the items alphabetically

2022-06-16 Thread Dalai Felinto
Commit: 798b49109b2959e25f8224cf8bd0e631236fbb37
Author: Dalai Felinto
Date:   Thu Jun 16 15:25:09 2022 +0200
Branches: master
https://developer.blender.org/rB798b49109b2959e25f8224cf8bd0e631236fbb37

ID Type: Sort the items alphabetically

This also renames Hair Curves to Curves. Meaning that until we get
rid of the old curve type we will have both of those entires there:

* Curve
* Curves

This rna enum is used among other things in the driver UI to pick
which data-block you want the property from.

===

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 b5cf8abaac6..8d2ee0ab534 100644
--- a/source/blender/makesrna/intern/rna_ID.c
+++ b/source/blender/makesrna/intern/rna_ID.c
@@ -33,41 +33,41 @@ const EnumPropertyItem rna_enum_id_type_items[] = {
 {ID_AC, "ACTION", ICON_ACTION, "Action", ""},
 {ID_AR, "ARMATURE", ICON_ARMATURE_DATA, "Armature", ""},
 {ID_BR, "BRUSH", ICON_BRUSH_DATA, "Brush", ""},
-{ID_CA, "CAMERA", ICON_CAMERA_DATA, "Camera", ""},
 {ID_CF, "CACHEFILE", ICON_FILE, "Cache File", ""},
+{ID_CA, "CAMERA", ICON_CAMERA_DATA, "Camera", ""},
+{ID_GR, "COLLECTION", ICON_OUTLINER_COLLECTION, "Collection", ""},
 {ID_CU_LEGACY, "CURVE", ICON_CURVE_DATA, "Curve", ""},
+{ID_CV, "CURVES", ICON_CURVES_DATA, "Curves", ""},
 {ID_VF, "FONT", ICON_FONT_DATA, "Font", ""},
 {ID_GD, "GREASEPENCIL", ICON_GREASEPENCIL, "Grease Pencil", ""},
-{ID_GR, "COLLECTION", ICON_OUTLINER_COLLECTION, "Collection", ""},
 {ID_IM, "IMAGE", ICON_IMAGE_DATA, "Image", ""},
 {ID_KE, "KEY", ICON_SHAPEKEY_DATA, "Key", ""},
-{ID_LA, "LIGHT", ICON_LIGHT_DATA, "Light", ""},
+{ID_LT, "LATTICE", ICON_LATTICE_DATA, "Lattice", ""},
 {ID_LI, "LIBRARY", ICON_LIBRARY_DATA_DIRECT, "Library", ""},
+{ID_LA, "LIGHT", ICON_LIGHT_DATA, "Light", ""},
+{ID_LP, "LIGHT_PROBE", ICON_LIGHTPROBE_CUBEMAP, "Light Probe", ""},
 {ID_LS, "LINESTYLE", ICON_LINE_DATA, "Line Style", ""},
-{ID_LT, "LATTICE", ICON_LATTICE_DATA, "Lattice", ""},
 {ID_MSK, "MASK", ICON_MOD_MASK, "Mask", ""},
 {ID_MA, "MATERIAL", ICON_MATERIAL_DATA, "Material", ""},
-{ID_MB, "META", ICON_META_DATA, "Metaball", ""},
 {ID_ME, "MESH", ICON_MESH_DATA, "Mesh", ""},
+{ID_MB, "META", ICON_META_DATA, "Metaball", ""},
 {ID_MC, "MOVIECLIP", ICON_TRACKER, "Movie Clip", ""},
 {ID_NT, "NODETREE", ICON_NODETREE, "Node Tree", ""},
 {ID_OB, "OBJECT", ICON_OBJECT_DATA, "Object", ""},
 {ID_PC, "PAINTCURVE", ICON_CURVE_BEZCURVE, "Paint Curve", ""},
 {ID_PAL, "PALETTE", ICON_COLOR, "Palette", ""},
 {ID_PA, "PARTICLE", ICON_PARTICLE_DATA, "Particle", ""},
-{ID_LP, "LIGHT_PROBE", ICON_LIGHTPROBE_CUBEMAP, "Light Probe", ""},
+{ID_PT, "POINTCLOUD", ICON_POINTCLOUD_DATA, "Point Cloud", ""},
 {ID_SCE, "SCENE", ICON_SCENE_DATA, "Scene", ""},
 {ID_SIM, "SIMULATION", ICON_PHYSICS, "Simulation", ""}, /* TODO: Use 
correct icon. */
 {ID_SO, "SOUND", ICON_SOUND, "Sound", ""},
 {ID_SPK, "SPEAKER", ICON_SPEAKER, "Speaker", ""},
 {ID_TXT, "TEXT", ICON_TEXT, "Text", ""},
 {ID_TE, "TEXTURE", ICON_TEXTURE_DATA, "Texture", ""},
-{ID_CV, "CURVES", ICON_CURVES_DATA, "Hair Curves", ""},
-{ID_PT, "POINTCLOUD", ICON_POINTCLOUD_DATA, "Point Cloud", ""},
 {ID_VO, "VOLUME", ICON_VOLUME_DATA, "Volume", ""},
 {ID_WM, "WINDOWMANAGER", ICON_WINDOW, "Window Manager", ""},
-{ID_WO, "WORLD", ICON_WORLD_DATA, "World", ""},
 {ID_WS, "WORKSPACE", ICON_WORKSPACE, "Workspace", ""},
+{ID_WO, "WORLD", ICON_WORLD_DATA, "World", ""},
 {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] [9ca7fb885e7] soc-2022-many-lights-sampling: Cycles: fix logic to support multiple point lights in tree

2022-06-16 Thread Jeffrey Liu
Commit: 9ca7fb885e7f090fd29fa1c166ba089a9150ba6b
Author: Jeffrey Liu
Date:   Thu Jun 16 05:53:22 2022 -0400
Branches: soc-2022-many-lights-sampling
https://developer.blender.org/rB9ca7fb885e7f090fd29fa1c166ba089a9150ba6b

Cycles: fix logic to support multiple point lights in tree

===

M   intern/cycles/kernel/light/light_tree.h
M   intern/cycles/scene/light_tree.cpp
M   release/scripts/addons

===

diff --git a/intern/cycles/kernel/light/light_tree.h 
b/intern/cycles/kernel/light/light_tree.h
index cf3ffa18497..839653faa44 100644
--- a/intern/cycles/kernel/light/light_tree.h
+++ b/intern/cycles/kernel/light/light_tree.h
@@ -156,6 +156,9 @@ ccl_device bool light_tree_sample(KernelGlobals kg,
 
   /* Special case where there's only a single light. */
   if (knode->num_prims == 1) {
+if (UNLIKELY(light_select_reached_max_bounces(kg, -knode->child_index, 
bounce))) {
+  return false;
+}
 return light_sample(
 kg, -knode->child_index, randu, randv, P, path_flag, ls);
   }
@@ -187,6 +190,9 @@ ccl_device bool light_tree_sample(KernelGlobals kg,
 if (tree_u < emitter_cdf) {
   *pdf_factor *= emitter_pdf;
   assert(*pdf_factor != 0.0f);
+  if (UNLIKELY(light_select_reached_max_bounces(kg, prim_index, bounce))) {
+return false;
+  }
   return light_sample(kg, prim_index, randu, randv, P, 
path_flag, ls);
 }
   }
diff --git a/intern/cycles/scene/light_tree.cpp 
b/intern/cycles/scene/light_tree.cpp
index ef5317f2bd1..35c3d11104e 100644
--- a/intern/cycles/scene/light_tree.cpp
+++ b/intern/cycles/scene/light_tree.cpp
@@ -177,14 +177,15 @@ LightTreeBuildNode 
*LightTree::recursive_build(vector 
   /* Var(X) = E[X^2] - E[X]^2 */
   float energy_variance = (energy_squared_total / num_prims) - (energy_total / 
num_prims) * (energy_total / num_prims);
 
-  if (num_prims == 1) {
+  /* to-do: find a better way to handle when all centroids overlap. */
+  if (num_prims == 1 || centroid_bounds.area() == 0.0f) {
 int first_prim_offset = ordered_prims.size();
 /* to-do: reduce this? */
 for (int i = start; i < end; i++) {
   int prim_num = primitive_info[i].prim_num;
   ordered_prims.push_back(prims_[prim_num]);
 }
-node->init_leaf(start, num_prims, node_bbox, node_bcone, energy_total, 
energy_variance);
+node->init_leaf(first_prim_offset, num_prims, node_bbox, node_bcone, 
energy_total, energy_variance);
   }
   else {
 /* Find the best place to split the primitives into 2 nodes. 
@@ -239,7 +240,7 @@ LightTreeBuildNode 
*LightTree::recursive_build(vector 
 int prim_num = primitive_info[i].prim_num;
 ordered_prims.push_back(prims_[prim_num]);
   }
-  node->init_leaf(start, num_prims, node_bbox, node_bcone, energy_total, 
energy_variance);
+  node->init_leaf(first_prim_offset, num_prims, node_bbox, node_bcone, 
energy_total, energy_variance);
 }
   }
 
@@ -263,6 +264,11 @@ void LightTree::split_saoh(const BoundBox _bbox,
   /* Check each dimension to find the minimum splitting cost. */
   min_cost = FLT_MAX;
   for (int dim = 0; dim < 3; dim++) {
+/* If the centroid bounding box is 0 along a given dimension, skip it. */
+if (centroid_bbox.size()[dim] == 0.0f) {
+  continue;
+}
+
 const float inv_extent = 1 / (centroid_bbox.size()[dim]);
 
 /* Fill in buckets with primitives. */
diff --git a/release/scripts/addons b/release/scripts/addons
index c51e0bb1793..ebe0bd5677a 16
--- a/release/scripts/addons
+++ b/release/scripts/addons
@@ -1 +1 @@
-Subproject commit c51e0bb1793c44c7a1b7435593dd5022cf7c8eec
+Subproject commit ebe0bd5677af5810972feb212a027b2a30f1ee6a

___
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] [8f530d6a47d] blender-v2.93-release: Fix (unreported) bad memory access in read/write code of MeshDeform modifier.

2022-06-16 Thread Bastien Montagne
Commit: 8f530d6a47d8a0fa9e8d8f4bdb66510a4f18b664
Author: Bastien Montagne
Date:   Thu May 12 17:19:22 2022 +0200
Branches: blender-v2.93-release
https://developer.blender.org/rB8f530d6a47d8a0fa9e8d8f4bdb66510a4f18b664

Fix (unreported) bad memory access in read/write code of MeshDeform modifier.

This abuse of one one size value to handle another allocated array of a
different size is bad in itself, but at least now read/write code of
this modifier should not risk invalid memory access anymore.

NOTE: invalid memory access would in practice only happen in case endian
switch would be performed at read time I think (those switches only check
for given length being non-zero, not for a NULL data pointer...).

===

M   source/blender/modifiers/intern/MOD_meshdeform.c

===

diff --git a/source/blender/modifiers/intern/MOD_meshdeform.c 
b/source/blender/modifiers/intern/MOD_meshdeform.c
index a94dd6da477..50754489a50 100644
--- a/source/blender/modifiers/intern/MOD_meshdeform.c
+++ b/source/blender/modifiers/intern/MOD_meshdeform.c
@@ -602,7 +602,14 @@ static void blendWrite(BlendWriter *writer, const 
ModifierData *md)
   int size = mmd->dyngridsize;
 
   BLO_write_struct_array(writer, MDefInfluence, mmd->totinfluence, 
mmd->bindinfluences);
-  BLO_write_int32_array(writer, mmd->totvert + 1, mmd->bindoffsets);
+  /* NOTE: `bindoffset` is abusing `totvert + 1` as its size, this becomes an 
incorrect value in
+   * case `totvert == 0`, since `bindoffset` is then NULL, not a size 1 
allocated array. */
+  if (mmd->totvert > 0) {
+BLO_write_int32_array(writer, mmd->totvert + 1, mmd->bindoffsets);
+  }
+  else {
+BLI_assert(mmd->bindoffsets == NULL);
+  }
   BLO_write_float3_array(writer, mmd->totcagevert, mmd->bindcagecos);
   BLO_write_struct_array(writer, MDefCell, size * size * size, mmd->dyngrid);
   BLO_write_struct_array(writer, MDefInfluence, mmd->totinfluence, 
mmd->dyninfluences);
@@ -614,7 +621,11 @@ static void blendRead(BlendDataReader *reader, 
ModifierData *md)
   MeshDeformModifierData *mmd = (MeshDeformModifierData *)md;
 
   BLO_read_data_address(reader, >bindinfluences);
-  BLO_read_int32_array(reader, mmd->totvert + 1, >bindoffsets);
+  /* NOTE: `bindoffset` is abusing `totvert + 1` as its size, this becomes an 
incorrect value in
+   * case `totvert == 0`, since `bindoffset` is then NULL, not a size 1 
allocated array. */
+  if (mmd->totvert > 0) {
+BLO_read_int32_array(reader, mmd->totvert + 1, >bindoffsets);
+  }
   BLO_read_float3_array(reader, mmd->totcagevert, >bindcagecos);
   BLO_read_data_address(reader, >dyngrid);
   BLO_read_data_address(reader, >dyninfluences);

___
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] [d57f57717ad] blender-v2.93-release: Fix T98699: Face dot colors in UV editor was using wrong color from theme

2022-06-16 Thread Chris Blackbourn
Commit: d57f57717ad5b39a8d16d9704cad414bce516fcc
Author: Chris Blackbourn
Date:   Wed Jun 15 19:39:28 2022 +1200
Branches: blender-v2.93-release
https://developer.blender.org/rBd57f57717ad5b39a8d16d9704cad414bce516fcc

Fix T98699: Face dot colors in UV editor was using wrong color from theme

===

M   source/blender/draw/engines/overlay/shaders/edit_uv_face_dots_vert.glsl

===

diff --git 
a/source/blender/draw/engines/overlay/shaders/edit_uv_face_dots_vert.glsl 
b/source/blender/draw/engines/overlay/shaders/edit_uv_face_dots_vert.glsl
index 4cdfe867840..65dbc5fa7a2 100644
--- a/source/blender/draw/engines/overlay/shaders/edit_uv_face_dots_vert.glsl
+++ b/source/blender/draw/engines/overlay/shaders/edit_uv_face_dots_vert.glsl
@@ -13,6 +13,6 @@ void main()
   vec3 world_pos = point_object_to_world(vec3(au, 0.0));
   gl_Position = point_world_to_ndc(world_pos);
 
-  finalColor = ((flag & FACE_UV_SELECT) != 0) ? colorVertexSelect : 
vec4(colorWire.rgb, 1.0);
+  finalColor = ((flag & FACE_UV_SELECT) != 0) ? colorFaceDot : 
vec4(colorWire.rgb, 1.0);
   gl_PointSize = pointSize;
 }

___
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] [9bed68de134] master: Fix T98860: VectorProperty type renamed to COORDS (breaking scripts)

2022-06-16 Thread Campbell Barton
Commit: 9bed68de134c9cc5ff5295b95cc1bf0bae97b78a
Author: Campbell Barton
Date:   Thu Jun 16 16:41:41 2022 +1000
Branches: master
https://developer.blender.org/rB9bed68de134c9cc5ff5295b95cc1bf0bae97b78a

Fix T98860: VectorProperty type renamed to COORDS (breaking scripts)

Regression in [0] unintentionally renamed COORDINATES.
There was a naming discrepancy when two (nearly) identical arrays,
de-duplicating them caused the error.

[0]: 9aaadf238ab2de4226d6b1b66284d479a931

===

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

===

diff --git a/source/blender/makesrna/intern/rna_rna.c 
b/source/blender/makesrna/intern/rna_rna.c
index 895d6e8ba70..16a4dfe71cf 100644
--- a/source/blender/makesrna/intern/rna_rna.c
+++ b/source/blender/makesrna/intern/rna_rna.c
@@ -89,7 +89,7 @@ const EnumPropertyItem rna_enum_property_type_items[] = {
   {PROP_XYZ, "XYZ", 0, "XYZ", ""}, \
   {PROP_XYZ_LENGTH, "XYZ_LENGTH", 0, "XYZ Length", ""}, \
   {PROP_COLOR_GAMMA, "COLOR_GAMMA", 0, "Color", ""}, \
-  {PROP_COORDS, "COORDS", 0, "Coordinates", ""}, \
+  {PROP_COORDS, "COORDINATES", 0, "Coordinates", ""}, \
   /* Boolean. */ \
   {PROP_LAYER, "LAYER", 0, "Layer", ""}, \
   {PROP_LAYER_MEMBER, "LAYER_MEMBER", 0, "Layer Member", ""}

___
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] [36307d8fbaa] master: Fix (studio-reported) broken 'system override' filtering in liboverride view of the Outliner.

2022-06-16 Thread Bastien Montagne
Commit: 36307d8fbaa6778ddac89cae669511f03bd3f22d
Author: Bastien Montagne
Date:   Thu Jun 16 09:56:15 2022 +0200
Branches: master
https://developer.blender.org/rB36307d8fbaa6778ddac89cae669511f03bd3f22d

Fix (studio-reported) broken 'system override' filtering in liboverride view of 
the Outliner.

Regression from recent rB717ab5aeaecc.

===

M   source/blender/editors/space_outliner/tree/tree_element_overrides.cc

===

diff --git 
a/source/blender/editors/space_outliner/tree/tree_element_overrides.cc 
b/source/blender/editors/space_outliner/tree/tree_element_overrides.cc
index 203ad18f85c..871de39b1dd 100644
--- a/source/blender/editors/space_outliner/tree/tree_element_overrides.cc
+++ b/source/blender/editors/space_outliner/tree/tree_element_overrides.cc
@@ -74,7 +74,8 @@ void TreeElementOverridesBase::expand(SpaceOutliner 
_outliner) const
 /* Check for conditions where the liboverride property should be 
considered as a system
  * override, if needed. */
 if (is_rna_path_valid && !show_system_overrides) {
-  bool do_continue = true;
+  bool do_skip = true;
+  bool is_system_override = false;
 
   /* Matching ID pointers are considered as system overrides. */
   if (ELEM(override_prop->rna_prop_type, PROP_POINTER, PROP_COLLECTION) &&
@@ -82,19 +83,22 @@ void TreeElementOverridesBase::expand(SpaceOutliner 
_outliner) const
 for (auto *override_prop_op :
  
ListBaseWrapper(override_prop->operations)) 
{
   if ((override_prop_op->flag & 
IDOVERRIDE_LIBRARY_FLAG_IDPOINTER_MATCH_REFERENCE) == 0) {
-do_continue = false;
+do_skip = false;
 break;
   }
+  else {
+is_system_override = true;
+  }
 }
   }
 
   /* Animated/driven properties are considered as system overrides. */
-  if (!BKE_lib_override_library_property_is_animated(
-  , override_prop, override_rna_prop, rnaprop_index)) {
-do_continue = false;
+  if (!is_system_override && 
!BKE_lib_override_library_property_is_animated(
+ , override_prop, override_rna_prop, 
rnaprop_index)) {
+do_skip = false;
   }
 
-  if (do_continue) {
+  if (do_skip) {
 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] [1064bf58c3e] master: Cleanup: differentiate region/screen relative coordinates

2022-06-16 Thread Campbell Barton
Commit: 1064bf58c3e8fd28d55a09632046a3c008ca1f03
Author: Campbell Barton
Date:   Thu Jun 16 16:23:24 2022 +1000
Branches: master
https://developer.blender.org/rB1064bf58c3e8fd28d55a09632046a3c008ca1f03

Cleanup: differentiate region/screen relative coordinates

- Avoid ambiguity which caused these values to be confused, use `mval`
  for region relative mouse coordinates, otherwise `event_xy`.

- Pass region relative coordinates to sample_detail_dyntopo &
  sample_detail_voxel as there is no reason to use screen-space values.

- Rename invalid use of mval for screen-space coordinates.

===

M   source/blender/editors/curve/editcurve_paint.c
M   source/blender/editors/gpencil/gpencil_utils.c
M   source/blender/editors/include/ED_gpencil.h
M   source/blender/editors/include/ED_sculpt.h
M   source/blender/editors/sculpt_paint/paint_cursor.c
M   source/blender/editors/sculpt_paint/paint_mask.c
M   source/blender/editors/sculpt_paint/paint_stroke.c
M   source/blender/editors/sculpt_paint/paint_vertex.cc
M   source/blender/editors/sculpt_paint/sculpt.c
M   source/blender/editors/sculpt_paint/sculpt_cloth.c
M   source/blender/editors/sculpt_paint/sculpt_detail.c
M   source/blender/editors/sculpt_paint/sculpt_expand.c
M   source/blender/editors/sculpt_paint/sculpt_face_set.c
M   source/blender/editors/sculpt_paint/sculpt_filter_color.c
M   source/blender/editors/sculpt_paint/sculpt_filter_mesh.c
M   source/blender/editors/sculpt_paint/sculpt_mask_expand.c
M   source/blender/editors/sculpt_paint/sculpt_ops.c
M   source/blender/editors/sculpt_paint/sculpt_transform.c
M   source/blender/windowmanager/intern/wm_event_system.cc

===

diff --git a/source/blender/editors/curve/editcurve_paint.c 
b/source/blender/editors/curve/editcurve_paint.c
index 598779c6ace..6946c09e6f1 100644
--- a/source/blender/editors/curve/editcurve_paint.c
+++ b/source/blender/editors/curve/editcurve_paint.c
@@ -105,7 +105,7 @@ struct CurveDrawData {
   } radius;
 
   struct {
-float mouse[2];
+float mval[2];
 /* Used in case we can't calculate the depth. */
 float location_world[3];
 
@@ -463,8 +463,8 @@ static void curve_draw_event_add(wmOperator *op, const 
wmEvent *event)
   }
   copy_v3_v3(cdd->prev.location_world, selem->location_world);
 
-  float len_sq = len_squared_v2v2(cdd->prev.mouse, selem->mval);
-  copy_v2_v2(cdd->prev.mouse, selem->mval);
+  float len_sq = len_squared_v2v2(cdd->prev.mval, selem->mval);
+  copy_v2_v2(cdd->prev.mval, selem->mval);
 
   if (cdd->sample.use_substeps && cdd->prev.selem) {
 const struct StrokeElem selem_target = *selem;
@@ -1165,7 +1165,7 @@ static int curve_draw_modal(bContext *C, wmOperator *op, 
const wmEvent *event)
   else if (ELEM(event->type, MOUSEMOVE, INBETWEEN_MOUSEMOVE)) {
 if (cdd->state == CURVE_DRAW_PAINTING) {
   const float mval_fl[2] = {UNPACK2(event->mval)};
-  if (len_squared_v2v2(mval_fl, cdd->prev.mouse) > 
square_f(STROKE_SAMPLE_DIST_MIN_PX)) {
+  if (len_squared_v2v2(mval_fl, cdd->prev.mval) > 
square_f(STROKE_SAMPLE_DIST_MIN_PX)) {
 curve_draw_event_add(op, event);
   }
 }
diff --git a/source/blender/editors/gpencil/gpencil_utils.c 
b/source/blender/editors/gpencil/gpencil_utils.c
index 4733da85291..fc5b3838900 100644
--- a/source/blender/editors/gpencil/gpencil_utils.c
+++ b/source/blender/editors/gpencil/gpencil_utils.c
@@ -2962,7 +2962,7 @@ void ED_gpencil_projected_2d_bound_box(const 
GP_SpaceConversion *gsc,
 
 bool ED_gpencil_stroke_check_collision(const GP_SpaceConversion *gsc,
bGPDstroke *gps,
-   const float mouse[2],
+   const float mval[2],
const int radius,
const float diff_mat[4][4])
 {
@@ -2980,7 +2980,7 @@ bool ED_gpencil_stroke_check_collision(const 
GP_SpaceConversion *gsc,
   rcti rect_stroke = {boundbox_min[0], boundbox_max[0], boundbox_min[1], 
boundbox_max[1]};
 
   /* For mouse, add a small offset to avoid false negative in corners. */
-  rcti rect_mouse = {mouse[0] - offset, mouse[0] + offset, mouse[1] - offset, 
mouse[1] + offset};
+  rcti rect_mouse = {mval[0] - offset, mval[0] + offset, mval[1] - offset, 
mval[1] + offset};
 
   /* Check collision between both rectangles. */
   return BLI_rcti_isect(_stroke, _mouse, NULL);
@@ -2988,7 +2988,7 @@ bool ED_gpencil_stroke_check_collision(const 
GP_SpaceConversion *gsc,
 
 bool ED_gpencil_stroke_point_is_inside(const bGPDstroke *gps,
const GP_SpaceConversion *gsc,
-   const int mouse[2],
+   const int mval[2],
const