[Bf-blender-cvs] [1b946319757] master: CMake: Fix using numpy variable for the zstandard path

2022-01-17 Thread Campbell Barton
Commit: 1b946319757af390b85cf10ccf423528b1c48aec
Author: Campbell Barton
Date:   Tue Jan 18 17:18:57 2022 +1100
Branches: master
https://developer.blender.org/rB1b946319757af390b85cf10ccf423528b1c48aec

CMake: Fix using numpy variable for the zstandard path

Copy paste error in a5917175d8c1a7cab83b401ae2f4affcd4ab8df4.

===

M   source/creator/CMakeLists.txt

===

diff --git a/source/creator/CMakeLists.txt b/source/creator/CMakeLists.txt
index a5d20e1fa37..0609b8fd792 100644
--- a/source/creator/CMakeLists.txt
+++ b/source/creator/CMakeLists.txt
@@ -656,11 +656,11 @@ if(UNIX AND NOT APPLE)
 # Install to the same directory as the source, so debian-like
 # distros are happy with their policy.
 set(_suffix "site-packages")
-if(${PYTHON_NUMPY_PATH} MATCHES "dist-packages")
+if(${PYTHON_ZSTANDARD_PATH} MATCHES "dist-packages")
   set(_suffix "dist-packages")
 endif()
 install(
-  DIRECTORY ${PYTHON_NUMPY_PATH}/zstandard
+  DIRECTORY ${PYTHON_ZSTANDARD_PATH}/zstandard
   DESTINATION 
${TARGETDIR_VER}/python/${_target_LIB}/python${PYTHON_VERSION}/${_suffix}
   PATTERN ".svn" EXCLUDE
   PATTERN "__pycache__" EXCLUDE   # * any cache *

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


[Bf-blender-cvs] SVN commit: bf-blender [62792] trunk/lib/tests/io_tests/obj: Update obj golden files for changes to dedup normals in obj exporter

2022-01-17 Thread Howard Trickey
Revision: 62792
  https://developer.blender.org/rBL62792
Author:   howardt
Date: 2022-01-18 05:29:37 +0100 (Tue, 18 Jan 2022)
Log Message:
---
Update obj golden files for changes to dedup normals in obj exporter

Modified Paths:
--
trunk/lib/tests/io_tests/obj/all_objects.obj
trunk/lib/tests/io_tests/obj/all_quads.obj
trunk/lib/tests/io_tests/obj/all_tris.obj
trunk/lib/tests/io_tests/obj/cube_all_data_triangulated.obj
trunk/lib/tests/io_tests/obj/fgons.obj
trunk/lib/tests/io_tests/obj/suzanne_all_data.obj

Modified: trunk/lib/tests/io_tests/obj/all_objects.obj
===
--- trunk/lib/tests/io_tests/obj/all_objects.obj2022-01-17 18:39:57 UTC 
(rev 62791)
+++ trunk/lib/tests/io_tests/obj/all_objects.obj2022-01-18 04:29:37 UTC 
(rev 62792)
@@ -259,906 +259,262 @@
 v 13.36 -1.51 0.742593
 v 13.42 -1.51 0.720371
 v 13.49 -1.51 0.694445
-vn -0.324632 -0.353080 0.877467
-vn -0.330530 -0.330530 0.884025
-vn -0.353078 -0.324633 0.877467
-vn -0.345605 -0.345607 0.872418
-vn -0.277831 -0.368180 0.887273
-vn -0.283136 -0.344867 0.894931
-vn -0.330530 -0.330530 0.884025
-vn -0.324632 -0.353080 0.877467
-vn -0.229505 -0.381036 0.895622
-vn -0.234077 -0.357095 0.904263
-vn -0.283136 -0.344867 0.894931
-vn -0.277831 -0.368180 0.887273
-vn -0.179891 -0.391504 0.902421
-vn -0.183599 -0.367069 0.911894
-vn -0.234077 -0.357095 0.904263
-vn -0.229505 -0.381036 0.895622
-vn -0.129248 -0.399465 0.907592
-vn -0.131982 -0.374664 0.917719
-vn -0.183599 -0.367069 0.911894
-vn -0.179891 -0.391504 0.902421
-vn -0.077853 -0.404826 0.911074
-vn -0.079529 -0.379783 0.921651
-vn -0.131982 -0.374664 0.917719
-vn -0.129248 -0.399465 0.907592
-vn -0.026003 -0.407523 0.912825
-vn -0.026567 -0.382360 0.923631
-vn -0.079529 -0.379783 0.921651
-vn -0.077853 -0.404826 0.911074
-vn 0.026000 -0.407523 0.912825
-vn 0.026566 -0.382360 0.923632
-vn -0.026567 -0.382360 0.923631
-vn -0.026003 -0.407523 0.912825
-vn 0.077853 -0.404826 0.911074
-vn 0.079529 -0.379783 0.921651
-vn 0.026566 -0.382360 0.923632
-vn 0.026000 -0.407523 0.912825
-vn 0.129248 -0.399465 0.907592
-vn 0.131982 -0.374664 0.917719
-vn 0.079529 -0.379783 0.921651
-vn 0.077853 -0.404826 0.911074
-vn 0.179890 -0.391504 0.902421
-vn 0.183599 -0.367069 0.911895
-vn 0.131982 -0.374664 0.917719
-vn 0.129248 -0.399465 0.907592
-vn 0.229505 -0.381035 0.895622
-vn 0.234076 -0.357095 0.904263
-vn 0.183599 -0.367069 0.911895
-vn 0.179890 -0.391504 0.902421
-vn 0.277830 -0.368180 0.887274
-vn 0.283135 -0.344867 0.894931
-vn 0.234076 -0.357095 0.904263
-vn 0.229505 -0.381035 0.895622
-vn 0.324631 -0.353080 0.877467
-vn 0.330529 -0.330530 0.884025
-vn 0.283135 -0.344867 0.894931
-vn 0.277830 -0.368180 0.887274
-vn 0.345605 -0.345606 0.872418
-vn 0.353079 -0.324633 0.877467
-vn 0.330529 -0.330530 0.884025
-vn 0.324631 -0.353080 0.877467
-vn -0.330530 -0.330530 0.884025
-vn -0.344867 -0.283135 0.894931
-vn -0.368180 -0.277830 0.887273
-vn -0.353078 -0.324633 0.877467
-vn -0.283136 -0.344867 0.894931
-vn -0.296104 -0.296104 0.908099
-vn -0.344867 -0.283135 0.894931
-vn -0.330530 -0.330530 0.884025
-vn -0.234077 -0.357095 0.904263
-vn -0.245303 -0.307235 0.919474
-vn -0.296104 -0.296104 0.908099
-vn -0.283136 -0.344867 0.894931
-vn -0.183599 -0.367069 0.911894
-vn -0.192738 -0.316361 0.928853
-vn -0.245303 -0.307235 0.919474
-vn -0.234077 -0.357095 0.904263
-vn -0.131982 -0.374664 0.917719
-vn -0.138738 -0.323342 0.936057
-vn -0.192738 -0.316361 0.928853
-vn -0.183599 -0.367069 0.911894
-vn -0.079529 -0.379783 0.921651
-vn -0.083678 -0.328062 0.940943
-vn -0.138738 -0.323342 0.936057
-vn -0.131982 -0.374664 0.917719
-vn -0.026567 -0.382360 0.923631
-vn -0.027966 -0.330442 0.943412
-vn -0.083678 -0.328062 0.940943
-vn -0.079529 -0.379783 0.921651
-vn 0.026566 -0.382360 0.923632
-vn 0.027965 -0.330442 0.943412
-vn -0.027966 -0.330442 0.943412
-vn -0.026567 -0.382360 0.923631
-vn 0.079529 -0.379783 0.921651
-vn 0.083677 -0.328062 0.940943
-vn 0.027965 -0.330442 0.943412
-vn 0.026566 -0.382360 0.923632
-vn 0.131982 -0.374664 0.917719
-vn 0.138737 -0.323342 0.936057
-vn 0.083677 -0.328062 0.940943
-vn 0.079529 -0.379783 0.921651
-vn 0.183599 -0.367069 0.911895
-vn 0.192737 -0.316361 0.928853
-vn 0.138737 -0.323342 0.936057
-vn 0.131982 -0.374664 0.917719
-vn 0.234076 -0.357095 0.904263
-vn 0.245302 -0.307235 0.919475
-vn 0.192737 -0.316361 0.928853
-vn 0.183599 -0.367069 0.911895
-vn 0.283135 -0.344867 0.894931
-vn 0.296104 -0.296105 0.908099
-vn 0.245302 -0.307235 0.919475
-vn 0.234076 -0.357095 0.904263
-vn 0.330529 -0.330530 0.884025
-vn 0.344866 -0.283136 0.894931
-vn 0.296104 -0.296105 0.908099
-vn 0.283135 -0.344867 0.894931
-vn 0.353079 -0.324633 0.877467
-vn 0.368179 -0.277830 0.887274
-vn 0.344866 -0.283136 0.894931
-vn 0.330529 -0.330530 0.884025
-vn -0.344867 -0.283135 0.894931
-vn -0.357095 -0.234077 0.904263
-vn -0.381035 -0.229505 0.895622
-vn

[Bf-blender-cvs] [6dd89afa966] master: Fix obj exporter tests by deduping normals and printing with less precision.

2022-01-17 Thread Howard Trickey
Commit: 6dd89afa966042f8ae402c848655ac0dc0d795fe
Author: Howard Trickey
Date:   Mon Jan 17 23:22:40 2022 -0500
Branches: master
https://developer.blender.org/rB6dd89afa966042f8ae402c848655ac0dc0d795fe

Fix obj exporter tests by deduping normals and printing with less precision.

Some new obj exporter tests were disabled because the normals were different
in the last decimal place on different platforms.
The old python exporter deduped normals with their coordinates rounded to
four decimal places. This change does the same in the new exporter.
On one test, this produced a file 25% smaller and even ran 10% faster.

===

M   source/blender/io/wavefront_obj/exporter/obj_export_file_writer.cc
M   source/blender/io/wavefront_obj/exporter/obj_export_file_writer.hh
M   source/blender/io/wavefront_obj/exporter/obj_export_io.hh
M   source/blender/io/wavefront_obj/exporter/obj_export_mesh.cc
M   source/blender/io/wavefront_obj/exporter/obj_export_mesh.hh
M   source/blender/io/wavefront_obj/tests/obj_exporter_tests.cc

===

diff --git a/source/blender/io/wavefront_obj/exporter/obj_export_file_writer.cc 
b/source/blender/io/wavefront_obj/exporter/obj_export_file_writer.cc
index 45fa75c65b3..8c845c34db2 100644
--- a/source/blender/io/wavefront_obj/exporter/obj_export_file_writer.cc
+++ b/source/blender/io/wavefront_obj/exporter/obj_export_file_writer.cc
@@ -175,23 +175,13 @@ void OBJWriter::write_uv_coords(OBJMesh &r_obj_mesh_data) 
const
   }
 }
 
-void OBJWriter::write_poly_normals(const OBJMesh &obj_mesh_data) const
+void OBJWriter::write_poly_normals(OBJMesh &obj_mesh_data)
 {
   obj_mesh_data.ensure_mesh_normals();
-  Vector lnormals;
-  const int tot_polygons = obj_mesh_data.tot_polygons();
-  for (int i = 0; i < tot_polygons; i++) {
-if (obj_mesh_data.is_ith_poly_smooth(i)) {
-  obj_mesh_data.calc_loop_normals(i, lnormals);
-  for (const float3 &lnormal : lnormals) {
-file_handler_->write(lnormal[0], 
lnormal[1], lnormal[2]);
-  }
-}
-else {
-  float3 poly_normal = obj_mesh_data.calc_poly_normal(i);
-  file_handler_->write(
-  poly_normal[0], poly_normal[1], poly_normal[2]);
-}
+  Vector normals;
+  obj_mesh_data.store_normal_coords_and_indices(normals);
+  for (const float3 &normal : normals) {
+file_handler_->write(normal[0], normal[1], 
normal[2]);
   }
 }
 
@@ -298,28 +288,17 @@ void OBJWriter::write_poly_elements(const OBJMesh 
&obj_mesh_data,
   const func_vert_uv_normal_indices poly_element_writer = 
get_poly_element_writer(
   obj_mesh_data.tot_uv_vertices());
 
-  /* Number of normals may not be equal to number of polygons due to smooth 
shading. */
-  int per_object_tot_normals = 0;
   const int tot_polygons = obj_mesh_data.tot_polygons();
   for (int i = 0; i < tot_polygons; i++) {
 Vector poly_vertex_indices = 
obj_mesh_data.calc_poly_vertex_indices(i);
 Span poly_uv_indices = obj_mesh_data.calc_poly_uv_indices(i);
-/* For an Object, a normal index depends on how many of its normals have 
been written before
- * it. This is unknown because of smooth shading. So pass "per object 
total normals"
- * and update it after each call. */
-int new_normals = 0;
-Vector poly_normal_indices;
-std::tie(new_normals, poly_normal_indices) = 
obj_mesh_data.calc_poly_normal_indices(
-i, per_object_tot_normals);
-per_object_tot_normals += new_normals;
+Vector poly_normal_indices = 
obj_mesh_data.calc_poly_normal_indices(i);
 
 last_poly_smooth_group = write_smooth_group(obj_mesh_data, i, 
last_poly_smooth_group);
 last_poly_vertex_group = write_vertex_group(obj_mesh_data, i, 
last_poly_vertex_group);
 last_poly_mat_nr = write_poly_material(obj_mesh_data, i, last_poly_mat_nr, 
matname_fn);
 (this->*poly_element_writer)(poly_vertex_indices, poly_uv_indices, 
poly_normal_indices);
   }
-  /* Unusual: Other indices are updated in #OBJWriter::update_index_offsets. */
-  index_offsets_.normal_offset += per_object_tot_normals;
 }
 
 void OBJWriter::write_edges_indices(const OBJMesh &obj_mesh_data) const
@@ -390,7 +369,7 @@ void OBJWriter::update_index_offsets(const OBJMesh 
&obj_mesh_data)
 {
   index_offsets_.vertex_offset += obj_mesh_data.tot_vertices();
   index_offsets_.uv_vertex_offset += obj_mesh_data.tot_uv_vertices();
-  /* Normal index is updated right after writing the normals. */
+  index_offsets_.normal_offset += obj_mesh_data.tot_normal_indices();
 }
 
 /*  */
diff --git a/source/blender/io/wavefront_obj/exporter/obj_export_file_writer.hh 
b/source/blender/io/wavefront_obj/exporter/obj_export_file_writer.hh
index 3403d059068..1cad179a70c 100644
--- a/source/blender/io/wavefront_obj/exporter/obj_export_file_writer.hh
+++ b/source/blender/io/wavefront_obj/exporter/obj_export_fi

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

2022-01-17 Thread Campbell Barton
Commit: db496a0b7dcf1ab024aece9858257c40529138e4
Author: Campbell Barton
Date:   Tue Jan 18 14:27:29 2022 +1100
Branches: master
https://developer.blender.org/rBdb496a0b7dcf1ab024aece9858257c40529138e4

Cleanup: spelling in comments

===

M   source/blender/blenkernel/intern/lib_remap_test.cc
M   source/blender/blenlib/tests/BLI_any_test.cc
M   source/blender/blenloader/intern/versioning_250.c
M   source/blender/blenloader/intern/versioning_userdef.c
M   source/blender/editors/screen/glutil.c
M   source/blender/gpu/intern/gpu_shader_create_info.cc
M   source/blender/gpu/intern/gpu_shader_create_info.hh
M   source/blender/gpu/intern/gpu_shader_create_info_private.hh
M   source/blender/gpu/intern/gpu_shader_dependency.cc
M   source/blender/gpu/intern/gpu_shader_shared_utils.h
M   source/blender/makesrna/intern/rna_fcurve.c
M   source/blender/render/intern/texture_margin.cc

===

diff --git a/source/blender/blenkernel/intern/lib_remap_test.cc 
b/source/blender/blenkernel/intern/lib_remap_test.cc
index f803e600787..2faf9265ea6 100644
--- a/source/blender/blenkernel/intern/lib_remap_test.cc
+++ b/source/blender/blenkernel/intern/lib_remap_test.cc
@@ -227,7 +227,7 @@ TEST(lib_remap, delete_when_remap_to_self_not_allowed)
 /** \} */
 
 /*  */
-/** \name Userref counting
+/** \name User Reference Counting
  * \{ */
 
 TEST(lib_remap, users_are_decreased_when_not_skipping_never_null)
diff --git a/source/blender/blenlib/tests/BLI_any_test.cc 
b/source/blender/blenlib/tests/BLI_any_test.cc
index 3a5cbee6d72..dc72affd610 100644
--- a/source/blender/blenlib/tests/BLI_any_test.cc
+++ b/source/blender/blenlib/tests/BLI_any_test.cc
@@ -54,7 +54,7 @@ TEST(any, AssignMap)
 
   Any<> c = std::move(a);
   /* Test valid state after self assignment. Clang emits 
`-Wself-assign-overloaded` with `c=c;`.
-   * And pragma suppression creates warnings on other compilers. */
+   * And `pragma` suppression creates warnings on other compilers. */
   c = static_cast(c);
   EXPECT_TRUE(c);
   EXPECT_EQ((c.get>().lookup(4)), 2);
diff --git a/source/blender/blenloader/intern/versioning_250.c 
b/source/blender/blenloader/intern/versioning_250.c
index bee8bb757e4..52737950ea3 100644
--- a/source/blender/blenloader/intern/versioning_250.c
+++ b/source/blender/blenloader/intern/versioning_250.c
@@ -856,10 +856,9 @@ void blo_do_versions_250(FileData *fd, Library *lib, Main 
*bmain)
   if (!ts->uv_selectmode || ts->vgroup_weight == 0.0f) {
 ts->selectmode = SCE_SELECT_VERTEX;
 
-/* autokeying - setting should be taken from the user-prefs
- * but the userprefs version may not have correct flags set
- * (i.e. will result in blank box when enabled)
- */
+/* The auto-keying setting should be taken from the user-preferences
+ * but the user-preferences version may not have correct flags set
+ * (i.e. will result in blank box when enabled). */
 ts->autokey_mode = U.autokey_mode;
 if (ts->autokey_mode == 0) {
   ts->autokey_mode = 2; /* 'add/replace' but not on */
diff --git a/source/blender/blenloader/intern/versioning_userdef.c 
b/source/blender/blenloader/intern/versioning_userdef.c
index 3338d2f658c..064d7977c68 100644
--- a/source/blender/blenloader/intern/versioning_userdef.c
+++ b/source/blender/blenloader/intern/versioning_userdef.c
@@ -569,8 +569,8 @@ void blo_do_versions_userdef(UserDef *userdef)
   }
 
   if (!USER_VERSION_ATLEAST(257, 0)) {
-/* clear "AUTOKEY_FLAG_ONLYKEYINGSET" flag from userprefs,
- * so that it doesn't linger around from old configs like a ghost */
+/* Clear #AUTOKEY_FLAG_ONLYKEYINGSET flag from user-preferences,
+ * so that it doesn't linger around from old configurations like a ghost. 
*/
 userdef->autokey_flag &= ~AUTOKEY_FLAG_ONLYKEYINGSET;
   }
 
diff --git a/source/blender/editors/screen/glutil.c 
b/source/blender/editors/screen/glutil.c
index 03e817c467d..63b7fbc14a7 100644
--- a/source/blender/editors/screen/glutil.c
+++ b/source/blender/editors/screen/glutil.c
@@ -89,9 +89,9 @@ void immDrawPixelsTexScaledFullSize(const 
IMMDrawPixelsTexState *state,
   static const float white[4] = {1.0f, 1.0f, 1.0f, 1.0f};
   const float draw_width = img_w * scaleX * xzoom;
   const float draw_height = img_h * scaleY * yzoom;
-  /* Downscaling with regular bilinear interpolation (i.e. #GL_LINEAR) doesn't 
give good filtering
-   * results. Mipmaps can be used to get better results (i.e. 
#GL_LINEAR_MIPMAP_LINEAR), so always
-   * use mipmaps when filtering. */
+  /* Down-scaling with regular bi-linear interpolation (i.e. #GL_LINEAR) 
doesn't give good
+   * filtering results. Mipmaps can be used to get better results (i.e. 
#GL_LINEAR_MIPMAP_LINEAR),
+   * so always use mipmaps 

[Bf-blender-cvs] [84f6d86445d] master: Fix batch renaming selected meta-strips

2022-01-17 Thread Campbell Barton
Commit: 84f6d86445d59b011782c920dbc842a28bf2500b
Author: Campbell Barton
Date:   Tue Jan 18 11:13:05 2022 +1100
Branches: master
https://developer.blender.org/rB84f6d86445d59b011782c920dbc842a28bf2500b

Fix batch renaming selected meta-strips

===

M   release/scripts/startup/bl_operators/wm.py

===

diff --git a/release/scripts/startup/bl_operators/wm.py 
b/release/scripts/startup/bl_operators/wm.py
index 5ee857d7ea2..e99858a64a5 100644
--- a/release/scripts/startup/bl_operators/wm.py
+++ b/release/scripts/startup/bl_operators/wm.py
@@ -2514,10 +2514,9 @@ class WM_OT_batch_rename(Operator):
 return data_type_test
 if data_type == data_type_test:
 data = (
-# TODO, we don't have access to seqbasep, this won't work 
when inside metas.
-[seq for seq in 
context.scene.sequence_editor.sequences_all if seq.select]
+context.selected_sequences
 if only_selected else
-context.scene.sequence_editor.sequences_all,
+scene.sequence_editor.sequences_all,
 "name",
 "Strip(s)",
 )

___
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] [20df402adc8] master: Cleanup: move docs to definition

2022-01-17 Thread Campbell Barton
Commit: 20df402adc871a76cd98f7de116c48bebd151ce3
Author: Campbell Barton
Date:   Tue Jan 18 13:05:07 2022 +1100
Branches: master
https://developer.blender.org/rB20df402adc871a76cd98f7de116c48bebd151ce3

Cleanup: move docs to definition

===

M   source/blender/blenkernel/BKE_subdiv_modifier.h
M   source/blender/blenkernel/BKE_volume.h
M   source/blender/blenkernel/BKE_volume_to_mesh.hh
M   source/blender/blenkernel/intern/subdiv_modifier.c
M   source/blender/blenkernel/intern/volume.cc
M   source/blender/blenkernel/intern/volume_to_mesh.cc
M   source/blender/render/RE_texture_margin.h
M   source/blender/render/intern/texture_margin.cc

===

diff --git a/source/blender/blenkernel/BKE_subdiv_modifier.h 
b/source/blender/blenkernel/BKE_subdiv_modifier.h
index e8672b6baa8..8a179206dd7 100644
--- a/source/blender/blenkernel/BKE_subdiv_modifier.h
+++ b/source/blender/blenkernel/BKE_subdiv_modifier.h
@@ -40,8 +40,10 @@ void BKE_subsurf_modifier_subdiv_settings_init(struct 
SubdivSettings *settings,
const struct 
SubsurfModifierData *smd,
bool use_render_params);
 
-/* If skip_check_is_last is true, we assume that the modifier passed is the 
last enabled modifier
- * in the stack. */
+/**
+ * \param skip_check_is_last: When true, we assume that the modifier passed is 
the last enabled
+ * modifier in the stack.
+ */
 bool BKE_subsurf_modifier_can_do_gpu_subdiv_ex(const struct Scene *scene,
const struct Object *ob,
const struct 
SubsurfModifierData *smd,
@@ -54,6 +56,10 @@ bool BKE_subsurf_modifier_can_do_gpu_subdiv(const struct 
Scene *scene,
 
 extern void (*BKE_subsurf_modifier_free_gpu_cache_cb)(struct Subdiv *subdiv);
 
+/**
+ * Main goal of this function is to give usable subdivision surface descriptor
+ * which matches settings and topology.
+ */
 struct Subdiv *BKE_subsurf_modifier_subdiv_descriptor_ensure(
 const struct SubsurfModifierData *smd,
 const struct SubdivSettings *subdiv_settings,
@@ -62,8 +68,10 @@ struct Subdiv *BKE_subsurf_modifier_subdiv_descriptor_ensure(
 
 struct SubsurfRuntimeData *BKE_subsurf_modifier_ensure_runtime(struct 
SubsurfModifierData *smd);
 
-/* Return the #ModifierMode required for the evaluation of the subsurf 
modifier, which should be
- * used to check if the modifier is enabled. */
+/**
+ * Return the #ModifierMode required for the evaluation of the subsurf 
modifier,
+ * which should be used to check if the modifier is enabled.
+ */
 int BKE_subsurf_modifier_eval_required_mode(bool is_final_render, bool 
is_edit_mode);
 
 #ifdef __cplusplus
diff --git a/source/blender/blenkernel/BKE_volume.h 
b/source/blender/blenkernel/BKE_volume.h
index b40facc3572..8b42de7303d 100644
--- a/source/blender/blenkernel/BKE_volume.h
+++ b/source/blender/blenkernel/BKE_volume.h
@@ -181,6 +181,11 @@ bool BKE_volume_grid_bounds(openvdb::GridBase::ConstPtr 
grid,
 blender::float3 &r_min,
 blender::float3 &r_max);
 
+/**
+ * Return a new grid pointer with only the metadata and transform changed.
+ * This is useful for instances, where there is a separate transform on top of 
the original
+ * grid transform that must be applied for some operations that only take a 
grid argument.
+ */
 openvdb::GridBase::ConstPtr 
BKE_volume_grid_shallow_transform(openvdb::GridBase::ConstPtr grid,
   const 
blender::float4x4 &transform);
 
diff --git a/source/blender/blenkernel/BKE_volume_to_mesh.hh 
b/source/blender/blenkernel/BKE_volume_to_mesh.hh
index b99ae625042..123cb33f24f 100644
--- a/source/blender/blenkernel/BKE_volume_to_mesh.hh
+++ b/source/blender/blenkernel/BKE_volume_to_mesh.hh
@@ -56,11 +56,20 @@ struct Mesh *volume_to_mesh(const openvdb::GridBase &grid,
 float threshold,
 float adaptivity);
 
+/**
+ * Convert an OpenVDB volume grid to corresponding mesh data: vertex positions 
and quad and
+ * triangle indices.
+ */
 struct OpenVDBMeshData volume_to_mesh_data(const openvdb::GridBase &grid,
const VolumeToMeshResolution 
&resolution,
float threshold,
float adaptivity);
 
+/**
+ * Convert mesh data from the format provided by OpenVDB into Blender's #Mesh 
data structure.
+ * This can be used to add mesh data from a grid into an existing mesh rather 
than merging multiple
+ * meshes later on.
+ */
 void fill_mesh_from_openvdb_data(const Span vdb_verts,
  const Span vdb_tris,
  const S

[Bf-blender-cvs] [7220897280e] master: WM: batch rename support for volume & light object data

2022-01-17 Thread Campbell Barton
Commit: 7220897280e285305d8ab908a3ca95f8311dfa3e
Author: Campbell Barton
Date:   Tue Jan 18 12:22:45 2022 +1100
Branches: master
https://developer.blender.org/rB7220897280e285305d8ab908a3ca95f8311dfa3e

WM: batch rename support for volume & light object data

Also order items to match the "Add" menu.

===

M   release/scripts/startup/bl_operators/wm.py

===

diff --git a/release/scripts/startup/bl_operators/wm.py 
b/release/scripts/startup/bl_operators/wm.py
index 2c764849d05..3a46bb7fb53 100644
--- a/release/scripts/startup/bl_operators/wm.py
+++ b/release/scripts/startup/bl_operators/wm.py
@@ -2471,15 +2471,18 @@ class WM_OT_batch_rename(Operator):
 ('MATERIAL', "Materials", ""),
 None,
 # Enum identifiers are compared with 'object.type'.
+# Follow order in "Add" menu.
 ('MESH', "Meshes", ""),
 ('CURVE', "Curves", ""),
 ('META', "Metaballs", ""),
+('VOLUME', "Volumes", ""),
+('GPENCIL', "Grease Pencils", ""),
 ('ARMATURE', "Armatures", ""),
 ('LATTICE', "Lattices", ""),
-('GPENCIL', "Grease Pencils", ""),
+('LIGHT', "Light", ""),
+('LIGHT_PROBE', "Light Probes", ""),
 ('CAMERA', "Cameras", ""),
 ('SPEAKER', "Speakers", ""),
-('LIGHT_PROBE', "Light Probes", ""),
 None,
 ('BONE', "Bones", ""),
 ('NODE', "Nodes", ""),
@@ -2595,12 +2598,14 @@ class WM_OT_batch_rename(Operator):
 'MESH': ("meshes", "Mesh(es)", bpy.types.Mesh),
 'CURVE': ("curves", "Curve(s)", bpy.types.Curve),
 'META': ("metaballs", "Metaball(s)", bpy.types.MetaBall),
+'VOLUME': ("volumes", "Volume(s)", bpy.types.Volume),
+'GPENCIL': ("grease_pencils", "Grease Pencil(s)", 
bpy.types.GreasePencil),
 'ARMATURE': ("armatures", "Armature(s)", bpy.types.Armature),
 'LATTICE': ("lattices", "Lattice(s)", bpy.types.Lattice),
-'GPENCIL': ("grease_pencils", "Grease Pencil(s)", 
bpy.types.GreasePencil),
+'LIGHT': ("lights", "Light(s)", bpy.types.Light),
+'LIGHT_PROBE': ("light_probes", "Light Probe(s)", 
bpy.types.LightProbe),
 'CAMERA': ("cameras", "Camera(s)", bpy.types.Camera),
 'SPEAKER': ("speakers", "Speaker(s)", bpy.types.Speaker),
-'LIGHT_PROBE': ("light_probes", "Light Probe(s)", 
bpy.types.LightProbe),
 }
 
 # Finish with space types.

___
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] [75d84b1b642] master: WM: batch rename outliner support for various ID types

2022-01-17 Thread Campbell Barton
Commit: 75d84b1b642a82777d2688a9bdeedd7064dcee10
Author: Campbell Barton
Date:   Tue Jan 18 12:08:41 2022 +1100
Branches: master
https://developer.blender.org/rB75d84b1b642a82777d2688a9bdeedd7064dcee10

WM: batch rename outliner support for various ID types

The outliner selection can now be used for renaming objects,
object-data & materials.

===

M   release/scripts/startup/bl_operators/wm.py

===

diff --git a/release/scripts/startup/bl_operators/wm.py 
b/release/scripts/startup/bl_operators/wm.py
index 1d2225d7848..2c764849d05 100644
--- a/release/scripts/startup/bl_operators/wm.py
+++ b/release/scripts/startup/bl_operators/wm.py
@@ -23,7 +23,6 @@ import bpy
 from bpy.types import (
 Menu,
 Operator,
-Collection,
 bpy_prop_array,
 )
 from bpy.props import (
@@ -2500,7 +2499,26 @@ class WM_OT_batch_rename(Operator):
 actions: CollectionProperty(type=BatchRenameAction)
 
 @staticmethod
-def _data_from_context(context, data_type, only_selected, *, 
check_context=False):
+def _selected_ids_from_outliner_by_type(context, ty):
+return [
+id for id in context.selected_ids
+if isinstance(id, ty)
+if id.library is None
+]
+
+@staticmethod
+def _selected_ids_from_outliner_by_type_for_object_data(context, ty):
+# Include selected object-data as well as the selected ID's.
+from bpy.types import Object
+# De-duplicate the result as object-data may cause duplicates.
+return tuple(set([
+id for id_base in context.selected_ids
+if isinstance(id := id_base.data if isinstance(id_base, Object) 
else id_base, ty)
+if id.library is None
+]))
+
+@classmethod
+def _data_from_context(cls, context, data_type, only_selected, *, 
check_context=False):
 
 mode = context.mode
 scene = context.scene
@@ -2538,7 +2556,7 @@ class WM_OT_batch_rename(Operator):
 return data_type_test
 if data_type == data_type_test:
 data = (
-[id for id in context.selected_ids if isinstance(id, 
Collection) and id.library is None]
+cls._selected_ids_from_outliner_by_type(context, 
bpy.types.Collection)
 if only_selected else
 scene.collection.children_recursive,
 "name",
@@ -2574,15 +2592,15 @@ class WM_OT_batch_rename(Operator):
 return 'OBJECT'
 
 object_data_type_attrs_map = {
-'MESH': ("meshes", "Mesh(es)"),
-'CURVE': ("curves", "Curve(s)"),
-'META': ("metaballs", "Metaball(s)"),
-'ARMATURE': ("armatures", "Armature(s)"),
-'LATTICE': ("lattices", "Lattice(s)"),
-'GPENCIL': ("grease_pencils", "Grease Pencil(s)"),
-'CAMERA': ("cameras", "Camera(s)"),
-'SPEAKER': ("speakers", "Speaker(s)"),
-'LIGHT_PROBE': ("light_probes", "Light Probe(s)"),
+'MESH': ("meshes", "Mesh(es)", bpy.types.Mesh),
+'CURVE': ("curves", "Curve(s)", bpy.types.Curve),
+'META': ("metaballs", "Metaball(s)", bpy.types.MetaBall),
+'ARMATURE': ("armatures", "Armature(s)", bpy.types.Armature),
+'LATTICE': ("lattices", "Lattice(s)", bpy.types.Lattice),
+'GPENCIL': ("grease_pencils", "Grease Pencil(s)", 
bpy.types.GreasePencil),
+'CAMERA': ("cameras", "Camera(s)", bpy.types.Camera),
+'SPEAKER': ("speakers", "Speaker(s)", bpy.types.Speaker),
+'LIGHT_PROBE': ("light_probes", "Light Probe(s)", 
bpy.types.LightProbe),
 }
 
 # Finish with space types.
@@ -2590,7 +2608,13 @@ class WM_OT_batch_rename(Operator):
 
 if data_type == 'OBJECT':
 data = (
-context.selected_editable_objects
+(
+# Outliner.
+cls._selected_ids_from_outliner_by_type(context, 
bpy.types.Object)
+if space_type == 'OUTLINER' else
+# 3D View (default).
+context.selected_editable_objects
+)
 if only_selected else
 [id for id in bpy.data.objects if id.library is None],
 "name",
@@ -2598,6 +2622,7 @@ class WM_OT_batch_rename(Operator):
 )
 elif data_type == 'COLLECTION':
 data = (
+# Outliner case is handled already.
 tuple(set(
 ob.instance_collection
 for ob in context.selected_objects
@@ -2612,26 +2637,38 @@ class WM_OT_batch_rename(Operator):
 )
 elif data_type == 'MATERIAL':
 data 

[Bf-blender-cvs] [0fc9526178a] master: Fix for batch rename operating on library collections & materials

2022-01-17 Thread Campbell Barton
Commit: 0fc9526178ad7024c9ac0a8af1ec4de957cafb21
Author: Campbell Barton
Date:   Tue Jan 18 11:50:02 2022 +1100
Branches: master
https://developer.blender.org/rB0fc9526178ad7024c9ac0a8af1ec4de957cafb21

Fix for batch rename operating on library collections & materials

===

M   release/scripts/startup/bl_operators/wm.py

===

diff --git a/release/scripts/startup/bl_operators/wm.py 
b/release/scripts/startup/bl_operators/wm.py
index e99858a64a5..1d2225d7848 100644
--- a/release/scripts/startup/bl_operators/wm.py
+++ b/release/scripts/startup/bl_operators/wm.py
@@ -2538,7 +2538,7 @@ class WM_OT_batch_rename(Operator):
 return data_type_test
 if data_type == data_type_test:
 data = (
-[id for id in context.selected_ids if isinstance(id, 
Collection)]
+[id for id in context.selected_ids if isinstance(id, 
Collection) and id.library is None]
 if only_selected else
 scene.collection.children_recursive,
 "name",
@@ -2613,10 +2613,10 @@ class WM_OT_batch_rename(Operator):
 elif data_type == 'MATERIAL':
 data = (
 tuple(set(
-slot.material
+id
 for ob in context.selected_objects
 for slot in ob.material_slots
-if slot.material is not None
+if (id := slot.material) is not None and id.library is 
None
 ))
 if only_selected else
 [id for id in bpy.data.materials if id.library is None],

___
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] [c11c2a4b91d] master: WM: batch rename collections outside the outliner

2022-01-17 Thread Campbell Barton
Commit: c11c2a4b91d57bed588615734da858ac3c2af5b3
Author: Campbell Barton
Date:   Tue Jan 18 10:45:14 2022 +1100
Branches: master
https://developer.blender.org/rBc11c2a4b91d57bed588615734da858ac3c2af5b3

WM: batch rename collections outside the outliner

Use selected objects collection instances to rename in the 3D view.

===

M   release/scripts/startup/bl_operators/wm.py

===

diff --git a/release/scripts/startup/bl_operators/wm.py 
b/release/scripts/startup/bl_operators/wm.py
index 798e745ce95..5ee857d7ea2 100644
--- a/release/scripts/startup/bl_operators/wm.py
+++ b/release/scripts/startup/bl_operators/wm.py
@@ -2597,6 +2597,20 @@ class WM_OT_batch_rename(Operator):
 "name",
 "Object(s)",
 )
+elif data_type == 'COLLECTION':
+data = (
+tuple(set(
+ob.instance_collection
+for ob in context.selected_objects
+if ((ob.instance_type == 'COLLECTION') and
+(collection := ob.instance_collection) is not None 
and
+(collection.library is None))
+))
+if only_selected else
+[id for id in bpy.data.collections if id.library is None],
+"name",
+"Collection(s)",
+)
 elif data_type == 'MATERIAL':
 data = (
 tuple(set(

___
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] [0fa36c81d90] master: Cleanup: quite old-style-declaration warning, strip trailing space

2022-01-17 Thread Campbell Barton
Commit: 0fa36c81d906264c340cecc457656acf673770cb
Author: Campbell Barton
Date:   Tue Jan 18 10:25:37 2022 +1100
Branches: master
https://developer.blender.org/rB0fa36c81d906264c340cecc457656acf673770cb

Cleanup: quite old-style-declaration warning, strip trailing space

===

M   release/scripts/modules/keyingsets_utils.py
M   source/blender/editors/screen/glutil.c
M   source/blender/freestyle/CMakeLists.txt
M   source/blender/gpu/CMakeLists.txt
M   source/blender/gpu/intern/gpu_shader_shared_utils.h
M   source/blender/gpu/shaders/infos/gpu_shader_2D_area_borders_info.hh
M   source/blender/gpu/shaders/infos/gpu_shader_2D_image_rect_color_info.hh
M   source/blender/gpu/shaders/infos/gpu_shader_gpencil_stroke_info.hh
M   
source/blender/gpu/shaders/infos/gpu_shader_instance_varying_color_varying_size_info.hh
M   source/blender/gpu/shaders/infos/gpu_shader_keyframe_shape_info.hh
M   source/blender/gpu/shaders/infos/gpu_shader_text_info.hh
M   source/blender/nodes/composite/nodes/node_composite_scene_time.cc

===

diff --git a/release/scripts/modules/keyingsets_utils.py 
b/release/scripts/modules/keyingsets_utils.py
index 84a01ef3666..0dd06995ed3 100644
--- a/release/scripts/modules/keyingsets_utils.py
+++ b/release/scripts/modules/keyingsets_utils.py
@@ -245,7 +245,7 @@ def RKS_GEN_custom_props(_ksi, _context, ks, data):
 # Can technically happen, but there is no known case.
 continue
 if rna_property is None:
-# In this case the property cannot be converted to an 
+# In this case the property cannot be converted to an
 # FCurve-compatible value, so we can't keyframe it anyways.
 continue
 if rna_property.rna_type not in prop_type_compat:
diff --git a/source/blender/editors/screen/glutil.c 
b/source/blender/editors/screen/glutil.c
index 0ddede017e2..03e817c467d 100644
--- a/source/blender/editors/screen/glutil.c
+++ b/source/blender/editors/screen/glutil.c
@@ -86,7 +86,7 @@ void immDrawPixelsTexScaledFullSize(const 
IMMDrawPixelsTexState *state,
 const float yzoom,
 const float color[4])
 {
-  const static float white[4] = {1.0f, 1.0f, 1.0f, 1.0f};
+  static const float white[4] = {1.0f, 1.0f, 1.0f, 1.0f};
   const float draw_width = img_w * scaleX * xzoom;
   const float draw_height = img_h * scaleY * yzoom;
   /* Downscaling with regular bilinear interpolation (i.e. #GL_LINEAR) doesn't 
give good filtering
diff --git a/source/blender/freestyle/CMakeLists.txt 
b/source/blender/freestyle/CMakeLists.txt
index 47da6bc55f6..d16787714c9 100644
--- a/source/blender/freestyle/CMakeLists.txt
+++ b/source/blender/freestyle/CMakeLists.txt
@@ -595,6 +595,6 @@ endif()
 
 blender_add_lib(bf_freestyle "${SRC}" "${INC}" "${INC_SYS}" "${LIB}")
 
-if(COMMAND target_precompile_headers) 
+if(COMMAND target_precompile_headers)
   target_precompile_headers(bf_freestyle PRIVATE FRS_precomp.h)
 endif()
diff --git a/source/blender/gpu/CMakeLists.txt 
b/source/blender/gpu/CMakeLists.txt
index a525986e1cd..691c131b1c0 100644
--- a/source/blender/gpu/CMakeLists.txt
+++ b/source/blender/gpu/CMakeLists.txt
@@ -481,9 +481,9 @@ if(WITH_GPU_SHADER_BUILDER)
 ${PLATFORM_LINKLIBS}
   )
   target_include_directories(shader_builder PRIVATE ${INC} 
${CMAKE_CURRENT_BINARY_DIR})
-  
+
   set(BAKED_CREATE_INFOS_FILE ${CMAKE_CURRENT_BINARY_DIR}/shader_baked.hh)
-  
+
   add_custom_command(
 OUTPUT
 ${BAKED_CREATE_INFOS_FILE}
diff --git a/source/blender/gpu/intern/gpu_shader_shared_utils.h 
b/source/blender/gpu/intern/gpu_shader_shared_utils.h
index f2e2aab208c..1097547e5ae 100644
--- a/source/blender/gpu/intern/gpu_shader_shared_utils.h
+++ b/source/blender/gpu/intern/gpu_shader_shared_utils.h
@@ -102,4 +102,4 @@ typedef int bool2[2];
 typedef int bool3[2];
 typedef int bool4[4];
 
-#endif
\ No newline at end of file
+#endif
diff --git 
a/source/blender/gpu/shaders/infos/gpu_shader_2D_area_borders_info.hh 
b/source/blender/gpu/shaders/infos/gpu_shader_2D_area_borders_info.hh
index 56c30e79e6d..bf746eae9b4 100644
--- a/source/blender/gpu/shaders/infos/gpu_shader_2D_area_borders_info.hh
+++ b/source/blender/gpu/shaders/infos/gpu_shader_2D_area_borders_info.hh
@@ -36,4 +36,4 @@ GPU_SHADER_CREATE_INFO(gpu_shader_2D_area_borders)
 .push_constant(25, Type::INT, "cornerLen")
 .vertex_source("gpu_shader_2D_area_borders_vert.glsl")
 .fragment_source("gpu_shader_2D_area_borders_frag.glsl")
-.do_static_compilation(true);
\ No newline at end of file
+.do_static_compilation(true);
diff --git 
a/source/blender/gpu/shaders/infos/gpu_shader_2D_image_rect_color_info.hh 
b/source/blender/gpu/shaders/infos/gpu_shader_2D_image_rect_color_info.hh
index b9b4381eb50..b94556bbb25 100644
--- a/source/blender/gpu/s

[Bf-blender-cvs] [54fb1a75ee1] master: WM: batch rename collections

2022-01-17 Thread Red Mser
Commit: 54fb1a75ee191e5d97cda29a1e4dc78b4563bfb3
Author: Red Mser
Date:   Tue Jan 18 10:26:20 2022 +1100
Branches: master
https://developer.blender.org/rB54fb1a75ee191e5d97cda29a1e4dc78b4563bfb3

WM: batch rename collections

User must activate the operator from the outliner,
so that the selected collections can be determined.

Reviewed By: campbellbarton

Ref D13821

===

M   release/scripts/startup/bl_operators/wm.py

===

diff --git a/release/scripts/startup/bl_operators/wm.py 
b/release/scripts/startup/bl_operators/wm.py
index a2f482d1a55..798e745ce95 100644
--- a/release/scripts/startup/bl_operators/wm.py
+++ b/release/scripts/startup/bl_operators/wm.py
@@ -23,6 +23,7 @@ import bpy
 from bpy.types import (
 Menu,
 Operator,
+Collection,
 bpy_prop_array,
 )
 from bpy.props import (
@@ -2467,6 +2468,7 @@ class WM_OT_batch_rename(Operator):
 name="Type",
 items=(
 ('OBJECT', "Objects", ""),
+('COLLECTION', "Collections", ""),
 ('MATERIAL', "Materials", ""),
 None,
 # Enum identifiers are compared with 'object.type'.
@@ -2531,6 +2533,18 @@ class WM_OT_batch_rename(Operator):
 "name",
 "Node(s)",
 )
+elif space_type == 'OUTLINER':
+data_type_test = 'COLLECTION'
+if check_context:
+return data_type_test
+if data_type == data_type_test:
+data = (
+[id for id in context.selected_ids if isinstance(id, 
Collection)]
+if only_selected else
+scene.collection.children_recursive,
+"name",
+"Collection(s)",
+)
 else:
 if mode == 'POSE' or (mode == 'WEIGHT_PAINT' and 
context.pose_object):
 data_type_test = 'BONE'

___
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] [3bbb39ecc11] master: Cleanup: remove HWND from GHOST_Wintab constructor.

2022-01-17 Thread Nicholas Rishel
Commit: 3bbb39ecc114ddd2c5c3fc91e1376e1cc33f55b7
Author: Nicholas Rishel
Date:   Mon Jan 17 12:58:54 2022 -0800
Branches: master
https://developer.blender.org/rB3bbb39ecc114ddd2c5c3fc91e1376e1cc33f55b7

Cleanup: remove HWND from GHOST_Wintab constructor.

No change in behavior.

===

M   intern/ghost/intern/GHOST_Wintab.cpp
M   intern/ghost/intern/GHOST_Wintab.h

===

diff --git a/intern/ghost/intern/GHOST_Wintab.cpp 
b/intern/ghost/intern/GHOST_Wintab.cpp
index d13d1a560b7..953fcb171e5 100644
--- a/intern/ghost/intern/GHOST_Wintab.cpp
+++ b/intern/ghost/intern/GHOST_Wintab.cpp
@@ -130,8 +130,7 @@ GHOST_Wintab *GHOST_Wintab::loadWintab(HWND hwnd)
 }
   }
 
-  return new GHOST_Wintab(hwnd,
-  std::move(handle),
+  return new GHOST_Wintab(std::move(handle),
   info,
   get,
   set,
@@ -174,8 +173,7 @@ void GHOST_Wintab::extractCoordinates(LOGCONTEXT &lc, Coord 
&tablet, Coord &syst
   system.y.ext = -lc.lcSysExtY;
 }
 
-GHOST_Wintab::GHOST_Wintab(HWND hwnd,
-   unique_hmodule handle,
+GHOST_Wintab::GHOST_Wintab(unique_hmodule handle,
GHOST_WIN32_WTInfo info,
GHOST_WIN32_WTGet get,
GHOST_WIN32_WTSet set,
diff --git a/intern/ghost/intern/GHOST_Wintab.h 
b/intern/ghost/intern/GHOST_Wintab.h
index c61b1c8ccda..1994f057db9 100644
--- a/intern/ghost/intern/GHOST_Wintab.h
+++ b/intern/ghost/intern/GHOST_Wintab.h
@@ -214,8 +214,7 @@ class GHOST_Wintab {
   /** Most recently received tablet data, or none if pen is not in range. */
   GHOST_TabletData m_lastTabletData = GHOST_TABLET_DATA_NONE;
 
-  GHOST_Wintab(HWND hwnd,
-   unique_hmodule handle,
+  GHOST_Wintab(unique_hmodule handle,
GHOST_WIN32_WTInfo info,
GHOST_WIN32_WTGet get,
GHOST_WIN32_WTSet set,

___
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] [44ca984dc7b] master: BLI: Add index_range method to VectorSet

2022-01-17 Thread Hans Goudey
Commit: 44ca984dc7b150e5fd6ad88b999d0dbdc7cb9218
Author: Hans Goudey
Date:   Mon Jan 17 15:10:52 2022 -0600
Branches: master
https://developer.blender.org/rB44ca984dc7b150e5fd6ad88b999d0dbdc7cb9218

BLI: Add index_range method to VectorSet

This can simplify iterating through all of the indices in the vector,
which is fairly common, since one of the benefits of the data structure
is that all values are contiguous.

===

M   source/blender/blenlib/BLI_vector_set.hh

===

diff --git a/source/blender/blenlib/BLI_vector_set.hh 
b/source/blender/blenlib/BLI_vector_set.hh
index cc9cb585a1c..0aac96f93bc 100644
--- a/source/blender/blenlib/BLI_vector_set.hh
+++ b/source/blender/blenlib/BLI_vector_set.hh
@@ -464,6 +464,14 @@ class VectorSet {
 return keys_ + this->size();
   }
 
+  /**
+   * Get an index range containing all valid indices for this array.
+   */
+  IndexRange index_range() const
+  {
+return IndexRange(this->size());
+  }
+
   /**
* Print common statistics like size and collision count. This is useful for 
debugging purposes.
*/

___
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] [453b50b1615] temp-geometry-nodes-extrude-mesh: Merge branch 'master' into temp-geometry-nodes-extrude-mesh

2022-01-17 Thread Hans Goudey
Commit: 453b50b161581ace396423e1af847c5a6b47e43a
Author: Hans Goudey
Date:   Mon Jan 17 15:04:00 2022 -0600
Branches: temp-geometry-nodes-extrude-mesh
https://developer.blender.org/rB453b50b161581ace396423e1af847c5a6b47e43a

Merge branch 'master' into temp-geometry-nodes-extrude-mesh

===



===



___
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] [8c1ddee10cf] master: Geometry Nodes: Set Handle Type Node: Left and right by default

2022-01-17 Thread Hans Goudey
Commit: 8c1ddee10cfe11c2dba8a5005290db20546c2cb6
Author: Hans Goudey
Date:   Mon Jan 17 15:02:15 2022 -0600
Branches: master
https://developer.blender.org/rB8c1ddee10cfe11c2dba8a5005290db20546c2cb6

Geometry Nodes: Set Handle Type Node: Left and right by default

This node's UI uses a multi-select enum to allow adjusting the
type of both handle sides with the same node. Since usually the
user wants to affect both handles, and it's the multi-select behavior
isn't obvious, selecting both by default is an improvement.

===

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

===

diff --git a/source/blender/nodes/geometry/nodes/node_geo_curve_set_handles.cc 
b/source/blender/nodes/geometry/nodes/node_geo_curve_set_handles.cc
index b4ca51d0fa7..74bdce4cef3 100644
--- a/source/blender/nodes/geometry/nodes/node_geo_curve_set_handles.cc
+++ b/source/blender/nodes/geometry/nodes/node_geo_curve_set_handles.cc
@@ -43,7 +43,7 @@ static void node_init(bNodeTree *UNUSED(tree), bNode *node)
   NodeGeometryCurveSetHandles *data = 
MEM_cnew(__func__);
 
   data->handle_type = GEO_NODE_CURVE_HANDLE_AUTO;
-  data->mode = GEO_NODE_CURVE_HANDLE_LEFT;
+  data->mode = GEO_NODE_CURVE_HANDLE_LEFT | GEO_NODE_CURVE_HANDLE_RIGHT;
   node->storage = 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] [b776c46d2f6] master: Fix T94715: multiple volumes using the same .vdb causes freeze

2022-01-17 Thread Brecht Van Lommel
Commit: b776c46d2f67dffd36e2a68a1152c0f0d7bef7e6
Author: Brecht Van Lommel
Date:   Mon Jan 17 20:36:59 2022 +0100
Branches: master
https://developer.blender.org/rBb776c46d2f67dffd36e2a68a1152c0f0d7bef7e6

Fix T94715: multiple volumes using the same .vdb causes freeze

Needs more TBB task isolation, as even freeing an OpenVDB grid uses
multithreading.

===

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

===

diff --git a/source/blender/blenkernel/intern/volume.cc 
b/source/blender/blenkernel/intern/volume.cc
index c17706dc216..579526a051f 100644
--- a/source/blender/blenkernel/intern/volume.cc
+++ b/source/blender/blenkernel/intern/volume.cc
@@ -138,11 +138,19 @@ static struct VolumeFileCache {
   }
 
   std::lock_guard lock(mutex);
-  return simplified_grids.lookup_or_add_cb(simplify_level, [&]() {
-const float resolution_factor = 1.0f / (1 << simplify_level);
-const VolumeGridType grid_type = BKE_volume_grid_type_openvdb(*grid);
-return BKE_volume_grid_create_with_changed_resolution(grid_type, 
*grid, resolution_factor);
+  openvdb::GridBase::Ptr simple_grid;
+
+  /* Isolate creating grid since that's multithreaded and we are
+   * holding a mutex lock. */
+  blender::threading::isolate_task([&] {
+simple_grid = simplified_grids.lookup_or_add_cb(simplify_level, [&]() {
+  const float resolution_factor = 1.0f / (1 << simplify_level);
+  const VolumeGridType grid_type = BKE_volume_grid_type_openvdb(*grid);
+  return BKE_volume_grid_create_with_changed_resolution(
+  grid_type, *grid, resolution_factor);
+});
   });
+  return simple_grid;
 }
 
 /* Unique key: filename + grid name. */
@@ -247,16 +255,20 @@ static struct VolumeFileCache {
  protected:
   void update_for_remove_user(Entry &entry)
   {
-if (entry.num_metadata_users + entry.num_tree_users == 0) {
-  cache.erase(entry);
-}
-else if (entry.num_tree_users == 0) {
-  /* Note we replace the grid rather than clearing, so that if there is
-   * any other shared pointer to the grid it will keep the tree. */
-  entry.grid = entry.grid->copyGridWithNewTree();
-  entry.simplified_grids.clear();
-  entry.is_loaded = false;
-}
+/* Isolate file unloading since that's multithreaded and we are
+ * holding a mutex lock. */
+blender::threading::isolate_task([&] {
+  if (entry.num_metadata_users + entry.num_tree_users == 0) {
+cache.erase(entry);
+  }
+  else if (entry.num_tree_users == 0) {
+/* Note we replace the grid rather than clearing, so that if there is
+ * any other shared pointer to the grid it will keep the tree. */
+entry.grid = entry.grid->copyGridWithNewTree();
+entry.simplified_grids.clear();
+entry.is_loaded = false;
+  }
+});
   }
 
   /* Cache contents */

___
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] [449db0ab1e3] master: Baking: new method to generate margin, based on adjacent faces

2022-01-17 Thread Martijn Versteegh
Commit: 449db0ab1e34976f3936310b846ab38cc2d6467d
Author: Martijn Versteegh
Date:   Mon Jan 17 18:00:35 2022 +0100
Branches: master
https://developer.blender.org/rB449db0ab1e34976f3936310b846ab38cc2d6467d

Baking: new method to generate margin, based on adjacent faces

This significantly reduces discontinuities on UV seams, by giving a better
match of the texture filtered colors on both sides of the seam. It works by
using pixels from adjacent faces across the UV seam.

This new option is called "Adjacent Faces" and is the default. The old option
is called "Extend", and extends border pixels outwards.

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

===

M   intern/cycles/blender/addon/ui.py
M   source/blender/blenloader/intern/versioning_legacy.c
M   source/blender/editors/object/object_bake.c
M   source/blender/editors/object/object_bake_api.c
M   source/blender/makesdna/DNA_scene_defaults.h
M   source/blender/makesdna/DNA_scene_types.h
M   source/blender/makesdna/intern/dna_rename_defs.h
M   source/blender/makesrna/RNA_enum_items.h
M   source/blender/makesrna/intern/rna_scene.c
M   source/blender/render/CMakeLists.txt
M   source/blender/render/RE_bake.h
M   source/blender/render/RE_multires_bake.h
A   source/blender/render/RE_texture_margin.h
M   source/blender/render/intern/bake.c
M   source/blender/render/intern/multires_bake.c
A   source/blender/render/intern/texture_margin.cc

===

diff --git a/intern/cycles/blender/addon/ui.py 
b/intern/cycles/blender/addon/ui.py
index e4fbc898070..ddef3f63641 100644
--- a/intern/cycles/blender/addon/ui.py
+++ b/intern/cycles/blender/addon/ui.py
@@ -1803,18 +1803,45 @@ class CYCLES_RENDER_PT_bake_output(CyclesButtonsPanel, 
Panel):
 rd = scene.render
 
 if rd.use_bake_multires:
-layout.prop(rd, "bake_margin")
 layout.prop(rd, "use_bake_clear", text="Clear Image")
-
 if rd.bake_type == 'DISPLACEMENT':
 layout.prop(rd, "use_bake_lores_mesh")
 else:
 layout.prop(cbk, "target")
-
 if cbk.target == 'IMAGE_TEXTURES':
-layout.prop(cbk, "margin")
 layout.prop(cbk, "use_clear", text="Clear Image")
 
+class CYCLES_RENDER_PT_bake_output_margin(CyclesButtonsPanel, Panel):
+bl_label = "Margin"
+bl_context = "render"
+bl_parent_id = "CYCLES_RENDER_PT_bake_output"
+COMPAT_ENGINES = {'CYCLES'}
+
+@classmethod
+def poll(cls, context):
+scene = context.scene
+cbk = scene.render.bake
+return cbk.target == 'IMAGE_TEXTURES'
+
+def draw(self, context):
+layout = self.layout
+layout.use_property_split = True
+layout.use_property_decorate = False  # No animation.
+
+scene = context.scene
+cscene = scene.cycles
+cbk = scene.render.bake
+rd = scene.render
+
+if rd.use_bake_multires:
+layout.prop(rd, "bake_margin_type", text="Type")
+layout.prop(rd, "bake_margin", text="Size")
+else:
+if cbk.target == 'IMAGE_TEXTURES':
+layout.prop(cbk, "margin_type", text="Type")
+layout.prop(cbk, "margin", text="Size")
+
+
 
 class CYCLES_RENDER_PT_debug(CyclesDebugButtonsPanel, Panel):
 bl_label = "Debug"
@@ -2183,6 +2210,7 @@ classes = (
 CYCLES_RENDER_PT_bake_influence,
 CYCLES_RENDER_PT_bake_selected_to_active,
 CYCLES_RENDER_PT_bake_output,
+CYCLES_RENDER_PT_bake_output_margin,
 CYCLES_RENDER_PT_debug,
 node_panel(CYCLES_MATERIAL_PT_settings),
 node_panel(CYCLES_MATERIAL_PT_settings_surface),
diff --git a/source/blender/blenloader/intern/versioning_legacy.c 
b/source/blender/blenloader/intern/versioning_legacy.c
index 2fceb42262e..94720ad0b0a 100644
--- a/source/blender/blenloader/intern/versioning_legacy.c
+++ b/source/blender/blenloader/intern/versioning_legacy.c
@@ -1859,7 +1859,8 @@ void blo_do_versions_pre250(FileData *fd, Library *lib, 
Main *bmain)
 if (bmain->subversionfile < 4) {
   for (sce = bmain->scenes.first; sce; sce = sce->id.next) {
 sce->r.bake_mode = 1; /* prevent to include render stuff here */
-sce->r.bake_filter = 16;
+sce->r.bake_margin = 16;
+sce->r.bake_margin_type = R_BAKE_ADJACENT_FACES;
 sce->r.bake_flag = R_BAKE_CLEAR;
   }
 }
diff --git a/source/blender/editors/object/object_bake.c 
b/source/blender/editors/object/object_bake.c
index 1b6b0c78037..a5e6e7f0852 100644
--- a/source/blender/editors/object/object_bake.c
+++ b/source/blender/editors/object/object_bake.c
@@ -108,8 +108,10 @@ typedef struct {
   ListBase data;
   /** Clear the images before baking */
   bool bake_clear;
-  /** Bake-filter, aka margin */
-  int bake_filter;
+  /** margin size in pixels*/
+  int

[Bf-blender-cvs] [9881c851239] soc-2021-curves: Fixed - Invisible handles selectable

2022-01-17 Thread Dilith Jayakody
Commit: 9881c85123983d57f521997be4853dbbdd863c62
Author: Dilith Jayakody
Date:   Mon Jan 17 23:12:42 2022 +0530
Branches: soc-2021-curves
https://developer.blender.org/rB9881c85123983d57f521997be4853dbbdd863c62

Fixed - Invisible handles selectable

===

M   source/blender/editors/curve/editcurve_pen.c

===

diff --git a/source/blender/editors/curve/editcurve_pen.c 
b/source/blender/editors/curve/editcurve_pen.c
index 644d8d0b247..1e4fecca525 100644
--- a/source/blender/editors/curve/editcurve_pen.c
+++ b/source/blender/editors/curve/editcurve_pen.c
@@ -578,7 +578,13 @@ static bool get_closest_vertex_to_point_in_nurbs(const 
ListBase *nurbs,
   for (int i = 0; i < nu->pntsu; i++) {
 BezTriple *bezt = &nu->bezt[i];
 float bezt_vec[2];
-for (short j = 0; j < 3; j++) {
+int start = 0, end = 3;
+int handle_display = vc->v3d->overlay.handle_display;
+if (handle_display == CURVE_HANDLE_NONE ||
+(handle_display == CURVE_HANDLE_SELECTED && !BEZT_ISSEL_IDX(bezt, 
1))) {
+  start = 1, end = 2;
+}
+for (short j = start; j < end; j++) {
   if (worldspace_to_screenspace(bezt->vec[j], vc, bezt_vec)) {
 const float distance = len_manhattan_v2v2(bezt_vec, point);
 if (distance < min_distance_bezt) {

___
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] [668c1bccaed] soc-2021-curves: Merge branch 'master' into soc-2021-curves

2022-01-17 Thread Dilith Jayakody
Commit: 668c1bccaed0beb9a414c84f417fe88cad84b8ea
Author: Dilith Jayakody
Date:   Mon Jan 17 23:14:31 2022 +0530
Branches: soc-2021-curves
https://developer.blender.org/rB668c1bccaed0beb9a414c84f417fe88cad84b8ea

Merge branch 'master' into soc-2021-curves

===



===



___
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] [a0915d3ba6b] soc-2021-curves: Fixed new point wrong handle being dragged

2022-01-17 Thread Dilith Jayakody
Commit: a0915d3ba6ba33a3f5162816f0291ea4b947f5c5
Author: Dilith Jayakody
Date:   Mon Jan 17 22:55:47 2022 +0530
Branches: soc-2021-curves
https://developer.blender.org/rBa0915d3ba6ba33a3f5162816f0291ea4b947f5c5

Fixed new point wrong handle being dragged

===

M   source/blender/editors/curve/editcurve_pen.c

===

diff --git a/source/blender/editors/curve/editcurve_pen.c 
b/source/blender/editors/curve/editcurve_pen.c
index d1bd61d6d1f..644d8d0b247 100644
--- a/source/blender/editors/curve/editcurve_pen.c
+++ b/source/blender/editors/curve/editcurve_pen.c
@@ -234,8 +234,8 @@ static void move_new_bezt_handles_to_mouse(const wmEvent 
*event,
 bezt->h2 = HD_ALIGN;
   }
 
-  const bool is_endpoint = (nu->bezt + nu->pntsu - 1 == bezt && !(nu->flagu & 
CU_NURB_CYCLIC)) ||
-   (nu->bezt == bezt && (nu->flagu & CU_NURB_CYCLIC));
+  const bool is_last_point = nu->pntsu > 1 && nu->bezt + nu->pntsu - 1 == bezt 
&&
+ !(nu->flagu & CU_NURB_CYCLIC);
 
   float bezt_loc[2];
   worldspace_to_screenspace(bezt->vec[1], vc, bezt_loc);
@@ -245,7 +245,7 @@ static void move_new_bezt_handles_to_mouse(const wmEvent 
*event,
   screenspace_to_worldspace(bezt_loc, bezt->vec[1], vc, location);
 
   /* If the new point is the last point of the curve, move the second handle 
to the mouse. */
-  if (is_endpoint) {
+  if (is_last_point) {
 
 copy_v3_v3(bezt->vec[2], location);

___
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] [419714a40c9] soc-2021-curves: Support for closing 2 point splines

2022-01-17 Thread Dilith Jayakody
Commit: 419714a40c90a0ad7533e2f116108e6d482c3dd3
Author: Dilith Jayakody
Date:   Mon Jan 17 22:40:46 2022 +0530
Branches: soc-2021-curves
https://developer.blender.org/rB419714a40c90a0ad7533e2f116108e6d482c3dd3

Support for closing 2 point splines

===

M   release/scripts/addons
M   source/blender/editors/curve/editcurve_pen.c

===

diff --git a/release/scripts/addons b/release/scripts/addons
index ee7f95212b9..d4fcda5935c 16
--- a/release/scripts/addons
+++ b/release/scripts/addons
@@ -1 +1 @@
-Subproject commit ee7f95212b96c2786a27e4ba4729fff4a504328d
+Subproject commit d4fcda5935c5c561e77aadd32a32500cf280dcaa
diff --git a/source/blender/editors/curve/editcurve_pen.c 
b/source/blender/editors/curve/editcurve_pen.c
index 8cb2f8e1435..d1bd61d6d1f 100644
--- a/source/blender/editors/curve/editcurve_pen.c
+++ b/source/blender/editors/curve/editcurve_pen.c
@@ -1761,8 +1761,7 @@ static int curve_pen_modal(bContext *C, wmOperator *op, 
const wmEvent *event)
 get_selected_points(cu, vc.v3d, &nu, &bezt, &bp);
 if (cpd->nu && !(cpd->nu->flagu & CU_NURB_CYCLIC)) {
   copy_v2_v2_int(vc.mval, event->mval);
-  cpd->acted = cpd->nu->pntsu > 2 &&
-   make_cyclic_if_endpoints(cpd->nu, cpd->bezt, cpd->bp, 
&vc, C, sel_dist_mul);
+  cpd->acted = make_cyclic_if_endpoints(cpd->nu, cpd->bezt, cpd->bp, 
&vc, C, sel_dist_mul);
 }
   }

___
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] [8af22719d0c] master: Cleanup: Remove now redundant performance workaround for asset previews

2022-01-17 Thread Julian Eisel
Commit: 8af22719d0c98e24104d01089ecb0cff840df7e8
Author: Julian Eisel
Date:   Mon Jan 17 18:24:25 2022 +0100
Branches: master
https://developer.blender.org/rB8af22719d0c98e24104d01089ecb0cff840df7e8

Cleanup: Remove now redundant performance workaround for asset previews

Not needed anymore after aa0ecd179. The removed function was identical
to `icon_draw_rect()` now.

Reverts ab7214ca2ef9.

===

M   source/blender/editors/interface/interface_icons.c

===

diff --git a/source/blender/editors/interface/interface_icons.c 
b/source/blender/editors/interface/interface_icons.c
index 085b7d04be9..18018461ac2 100644
--- a/source/blender/editors/interface/interface_icons.c
+++ b/source/blender/editors/interface/interface_icons.c
@@ -1478,78 +1478,6 @@ PreviewImage *UI_icon_to_preview(int icon_id)
   return NULL;
 }
 
-/**
- * Version of #icon_draw_rect() that uses the GPU for scaling. This is only 
used for
- * #ICON_TYPE_IMBUF because it's a back-ported fix for performance issues, see 
T92922. Only
- * File/Asset Browser use #ICON_TYPE_IMBUF right now, which makes implications 
more predictable.
- *
- * TODO(Julian): This code is mostly duplicated. #icon_draw_rect() should be 
ported to use the GPU
- *   instead (D13144).
- */
-static void icon_draw_rect_fast(float x,
-float y,
-int w,
-int h,
-float UNUSED(aspect),
-int rw,
-int rh,
-uint *rect,
-float alpha,
-const float desaturate)
-{
-  int draw_w = w;
-  int draw_h = h;
-  int draw_x = x;
-  /* We need to round y, to avoid the icon jittering in some cases. */
-  int draw_y = round_fl_to_int(y);
-
-  /* sanity check */
-  if (w <= 0 || h <= 0 || w > 2000 || h > 2000) {
-printf("%s: icons are %i x %i pixels?\n", __func__, w, h);
-BLI_assert_msg(0, "invalid icon size");
-return;
-  }
-  /* modulate color */
-  const float col[4] = {alpha, alpha, alpha, alpha};
-
-  float scale_x = 1.0f;
-  float scale_y = 1.0f;
-  /* rect contains image in 'rendersize', we only scale if needed */
-  if (rw != w || rh != h) {
-/* preserve aspect ratio and center */
-if (rw > rh) {
-  draw_w = w;
-  draw_h = (int)(((float)rh / (float)rw) * (float)w);
-  draw_y += (h - draw_h) / 2;
-}
-else if (rw < rh) {
-  draw_w = (int)(((float)rw / (float)rh) * (float)h);
-  draw_h = h;
-  draw_x += (w - draw_w) / 2;
-}
-scale_x = draw_w / (float)rw;
-scale_y = draw_h / (float)rh;
-/* If the image is squared, the `draw_*` initialization values are good. */
-  }
-
-  /* draw */
-  eGPUBuiltinShader shader;
-  if (desaturate != 0.0f) {
-shader = GPU_SHADER_2D_IMAGE_DESATURATE_COLOR;
-  }
-  else {
-shader = GPU_SHADER_2D_IMAGE_COLOR;
-  }
-  IMMDrawPixelsTexState state = immDrawPixelsTexSetup(shader);
-
-  if (shader == GPU_SHADER_2D_IMAGE_DESATURATE_COLOR) {
-immUniform1f("factor", desaturate);
-  }
-
-  immDrawPixelsTexScaledFullSize(
-  &state, draw_x, draw_y, rw, rh, GPU_RGBA8, true, rect, scale_x, scale_y, 
1.0f, 1.0f, col);
-}
-
 static void icon_draw_rect(float x,
float y,
int w,
@@ -1867,9 +1795,7 @@ static void icon_draw_size(float x,
 ImBuf *ibuf = icon->obj;
 
 GPU_blend(GPU_BLEND_ALPHA_PREMULT);
-/* These icons are only used by the File/Asset Browser currently. Without 
this `_fast()`
- * version, there may be performance issues, see T92922. */
-icon_draw_rect_fast(x, y, w, h, aspect, ibuf->x, ibuf->y, ibuf->rect, 
alpha, desaturate);
+icon_draw_rect(x, y, w, h, aspect, ibuf->x, ibuf->y, ibuf->rect, alpha, 
desaturate);
 GPU_blend(GPU_BLEND_ALPHA);
   }
   else if (di->type == ICON_TYPE_VECTOR) {

___
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] [fa1fef50817] master: Cleanup: Correct comments for immediate mode buffer draw functions

2022-01-17 Thread Julian Eisel
Commit: fa1fef50817783bf4e2ba72a3b26807d88090cdd
Author: Julian Eisel
Date:   Mon Jan 17 18:18:22 2022 +0100
Branches: master
https://developer.blender.org/rBfa1fef50817783bf4e2ba72a3b26807d88090cdd

Cleanup: Correct comments for immediate mode buffer draw functions

===

M   source/blender/editors/include/BIF_glutil.h
M   source/blender/editors/screen/glutil.c

===

diff --git a/source/blender/editors/include/BIF_glutil.h 
b/source/blender/editors/include/BIF_glutil.h
index e8d5bc4c868..61dd0adc84d 100644
--- a/source/blender/editors/include/BIF_glutil.h
+++ b/source/blender/editors/include/BIF_glutil.h
@@ -148,8 +148,8 @@ void immDrawPixelsTexTiled_scaling(IMMDrawPixelsTexState 
*state,
  *
  * If color is NULL then use white by default
  *
- * Be also aware that this function unbinds the shader when
- * it's finished.
+ * Unless state->do_shader_unbind is explicitly set to `false`, the 
shader is unbound when
+ * finished.
  */
 void immDrawPixelsTexTiled_scaling_clipping(IMMDrawPixelsTexState *state,
 float x,
diff --git a/source/blender/editors/screen/glutil.c 
b/source/blender/editors/screen/glutil.c
index 1c00040a894..0ddede017e2 100644
--- a/source/blender/editors/screen/glutil.c
+++ b/source/blender/editors/screen/glutil.c
@@ -64,7 +64,7 @@ IMMDrawPixelsTexState immDrawPixelsTexSetup(int builtin)
 
   state.shader = GPU_shader_get_builtin_shader(builtin);
 
-  /* Shader will be unbind by immUnbindProgram in 
immDrawPixelsTexScaled_clipping */
+  /* Shader will be unbind by immUnbindProgram in a `immDrawPixelsTex` 
function. */
   immBindBuiltinProgram(builtin);
   immUniform1i("image", 0);
   state.do_shader_unbind = 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] [aa0ecd17918] master: UI: Speed up icon scaling

2022-01-17 Thread Julian Eisel
Commit: aa0ecd17918d5f1c3ce684f8f14b6aa7080ea9e1
Author: Julian Eisel
Date:   Mon Jan 17 18:02:29 2022 +0100
Branches: master
https://developer.blender.org/rBaa0ecd17918d5f1c3ce684f8f14b6aa7080ea9e1

UI: Speed up icon scaling

Use GPU-side scaling to speed up the scaling itself, and to avoid having
to copy the image buffer using the CPU. Mipmapping is used to get decent
filtering when downscaling without ugly artifacts.
In my comparisons, there was barely any difference between the methods
for DPIs >= 1. Below that, the result looks a bit different due to the
different filtering method.

See D13144 for screen-recordings showing the difference.

Part of T92922.

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

Reviewed by: Jeroen Bakker

===

M   source/blender/editors/include/BIF_glutil.h
M   source/blender/editors/interface/interface_icons.c
M   source/blender/editors/screen/glutil.c

===

diff --git a/source/blender/editors/include/BIF_glutil.h 
b/source/blender/editors/include/BIF_glutil.h
index 8f2a189e35e..8546c3eae89 100644
--- a/source/blender/editors/include/BIF_glutil.h
+++ b/source/blender/editors/include/BIF_glutil.h
@@ -54,6 +54,36 @@ typedef struct IMMDrawPixelsTexState {
  */
 IMMDrawPixelsTexState immDrawPixelsTexSetup(int builtin);
 
+/**
+ * Unlike the other `immDrawPixelsTex` functions, this doesn't do tiled 
drawing, but draws into a
+ * full texture.
+ *
+ * Use the currently bound shader.
+ *
+ * Use #immDrawPixelsTexSetup to bind the shader you want before calling 
#immDrawPixelsTex.
+ *
+ * If using a special shader double check it uses the same attributes "pos" 
"texCoord" and uniform
+ * "image".
+ *
+ * If color is NULL then use white by default
+ *
+ * Unless state->do_shader_unbind is explicitly set to `false`, the 
shader is unbound when
+ * finished.
+ */
+void immDrawPixelsTexScaledFullSize(const IMMDrawPixelsTexState *state,
+const float x,
+const float y,
+const int img_w,
+const int img_h,
+const eGPUTextureFormat gpu_format,
+const bool use_filter,
+const void *rect,
+const float scaleX,
+const float scaleY,
+const float xzoom,
+const float yzoom,
+const float color[4]);
+
 /**
  * #immDrawPixelsTex - Functions like a limited #glDrawPixels, but actually 
draws the
  * image using textures, which can be tremendously faster on low-end
diff --git a/source/blender/editors/interface/interface_icons.c 
b/source/blender/editors/interface/interface_icons.c
index ca5d08ba40e..085b7d04be9 100644
--- a/source/blender/editors/interface/interface_icons.c
+++ b/source/blender/editors/interface/interface_icons.c
@@ -1546,7 +1546,7 @@ static void icon_draw_rect_fast(float x,
 immUniform1f("factor", desaturate);
   }
 
-  immDrawPixelsTexScaled(
+  immDrawPixelsTexScaledFullSize(
   &state, draw_x, draw_y, rw, rh, GPU_RGBA8, true, rect, scale_x, scale_y, 
1.0f, 1.0f, col);
 }
 
@@ -1561,7 +1561,6 @@ static void icon_draw_rect(float x,
float alpha,
const float desaturate)
 {
-  ImBuf *ima = NULL;
   int draw_w = w;
   int draw_h = h;
   int draw_x = x;
@@ -1577,6 +1576,8 @@ static void icon_draw_rect(float x,
   /* modulate color */
   const float col[4] = {alpha, alpha, alpha, alpha};
 
+  float scale_x = 1.0f;
+  float scale_y = 1.0f;
   /* rect contains image in 'rendersize', we only scale if needed */
   if (rw != w || rh != h) {
 /* preserve aspect ratio and center */
@@ -1590,13 +1591,9 @@ static void icon_draw_rect(float x,
   draw_h = h;
   draw_x += (w - draw_w) / 2;
 }
+scale_x = draw_w / (float)rw;
+scale_y = draw_h / (float)rh;
 /* If the image is squared, the `draw_*` initialization values are good. */
-
-/* first allocate imbuf for scaling and copy preview into it */
-ima = IMB_allocImBuf(rw, rh, 32, IB_rect);
-memcpy(ima->rect, rect, rw * rh * sizeof(uint));
-IMB_scaleImBuf(ima, draw_w, draw_h); /* scale it */
-rect = ima->rect;
   }
 
   /* draw */
@@ -1613,12 +1610,8 @@ static void icon_draw_rect(float x,
 immUniform1f("factor", desaturate);
   }
 
-  immDrawPixelsTex(
-  &state, draw_x, draw_y, draw_w, draw_h, GPU_RGBA8, false, rect, 1.0f, 
1.0f, col);
-
-  if (ima) {
-IMB_freeImBuf(ima);
-  }
+  immDrawPixelsTexScaledFullSize(
+  &state, draw_x, draw_y, rw, rh, GPU_RGBA8, true, rect, scale_x, scale_y, 
1.0f, 1.0f, col);
 }
 
 /* High enough to make a difference, low enough

[Bf-blender-cvs] [194979e9294] master: Cleanup: Improve naming of immediate mode buffer draw functions

2022-01-17 Thread Julian Eisel
Commit: 194979e92947524c6257a38ae7bee4b20dc61d9e
Author: Julian Eisel
Date:   Mon Jan 17 18:13:54 2022 +0100
Branches: master
https://developer.blender.org/rB194979e92947524c6257a38ae7bee4b20dc61d9e

Cleanup: Improve naming of immediate mode buffer draw functions

Followup to the previous commit. Jeroen and I agreed the old naming was
confusing.

===

M   source/blender/editors/include/BIF_glutil.h
M   source/blender/editors/interface/interface_draw.c
M   source/blender/editors/mask/mask_draw.c
M   source/blender/editors/render/render_preview.cc
M   source/blender/editors/screen/glutil.c
M   source/blender/editors/space_file/file_draw.c
M   source/blender/editors/space_node/node_draw.cc
M   source/blender/windowmanager/intern/wm_dragdrop.c
M   source/blender/windowmanager/intern/wm_gesture.c

===

diff --git a/source/blender/editors/include/BIF_glutil.h 
b/source/blender/editors/include/BIF_glutil.h
index 8546c3eae89..e8d5bc4c868 100644
--- a/source/blender/editors/include/BIF_glutil.h
+++ b/source/blender/editors/include/BIF_glutil.h
@@ -55,7 +55,7 @@ typedef struct IMMDrawPixelsTexState {
 IMMDrawPixelsTexState immDrawPixelsTexSetup(int builtin);
 
 /**
- * Unlike the other `immDrawPixelsTex` functions, this doesn't do tiled 
drawing, but draws into a
+ * Unlike the `immDrawPixelsTexTiled` functions, this doesn't do tiled 
drawing, but draws into a
  * full texture.
  *
  * Use the currently bound shader.
@@ -98,45 +98,45 @@ void immDrawPixelsTexScaledFullSize(const 
IMMDrawPixelsTexState *state,
  * model-view and projection matrices are assumed to define a
  * 1-to-1 mapping to screen space.
  */
-void immDrawPixelsTex(IMMDrawPixelsTexState *state,
-  float x,
-  float y,
-  int img_w,
-  int img_h,
-  eGPUTextureFormat gpu_format,
-  bool use_filter,
-  void *rect,
-  float xzoom,
-  float yzoom,
-  const float color[4]);
-void immDrawPixelsTex_clipping(IMMDrawPixelsTexState *state,
-   float x,
-   float y,
-   int img_w,
-   int img_h,
-   eGPUTextureFormat gpu_format,
-   bool use_filter,
-   void *rect,
-   float clip_min_x,
-   float clip_min_y,
-   float clip_max_x,
-   float clip_max_y,
-   float xzoom,
-   float yzoom,
-   const float color[4]);
-void immDrawPixelsTexScaled(IMMDrawPixelsTexState *state,
-float x,
-float y,
-int img_w,
-int img_h,
-eGPUTextureFormat gpu_format,
-bool use_filter,
-void *rect,
-float scaleX,
-float scaleY,
-float xzoom,
-float yzoom,
-const float color[4]);
+void immDrawPixelsTexTiled(IMMDrawPixelsTexState *state,
+   float x,
+   float y,
+   int img_w,
+   int img_h,
+   eGPUTextureFormat gpu_format,
+   bool use_filter,
+   void *rect,
+   float xzoom,
+   float yzoom,
+   const float color[4]);
+void immDrawPixelsTexTiled_clipping(IMMDrawPixelsTexState *state,
+float x,
+float y,
+int img_w,
+int img_h,
+eGPUTextureFormat gpu_format,
+bool use_filter,
+void *rect,
+float clip_min_x,
+float clip_min_y,
+float clip_max_x,
+float clip_max_y,
+float xzoom,
+float yzoom,
+const float color[4]);
+void immDrawPixelsTexTiled_scaling(IMMDrawPixelsTexState *state,
+   float x,
+   float y,
+   

[Bf-blender-cvs] [4d10a46e636] master: Cleanup: refactor BVH2 in preparation of self intersection skip

2022-01-17 Thread Brecht Van Lommel
Commit: 4d10a46e6368f0b48a901325b94ebd43b672db32
Author: Brecht Van Lommel
Date:   Thu Jan 13 17:15:30 2022 +0100
Branches: master
https://developer.blender.org/rB4d10a46e6368f0b48a901325b94ebd43b672db32

Cleanup: refactor BVH2 in preparation of self intersection skip

Move some logic out of triangle intersection functions and into BVH
traversal, so we can share logic between primitives.

Ref D12954

===

M   intern/cycles/kernel/bvh/local.h
M   intern/cycles/kernel/bvh/shadow_all.h
M   intern/cycles/kernel/bvh/traversal.h
M   intern/cycles/kernel/bvh/volume.h
M   intern/cycles/kernel/bvh/volume_all.h
M   intern/cycles/kernel/geom/motion_triangle_intersect.h
M   intern/cycles/kernel/geom/triangle_intersect.h

===

diff --git a/intern/cycles/kernel/bvh/local.h b/intern/cycles/kernel/bvh/local.h
index 79cde69699e..4d0e6aac901 100644
--- a/intern/cycles/kernel/bvh/local.h
+++ b/intern/cycles/kernel/bvh/local.h
@@ -148,12 +148,23 @@ ccl_device_inline
 /* intersect ray against primitive */
 for (; prim_addr < prim_addr2; prim_addr++) {
   kernel_assert(kernel_tex_fetch(__prim_type, prim_addr) == type);
+
+  /* Only intersect with matching object, for instanced objects we
+   * already know we are only intersecting the right object. */
+  if (object == OBJECT_NONE) {
+if (kernel_tex_fetch(__prim_object, prim_addr) != 
local_object) {
+  continue;
+}
+  }
+
+  const int prim = kernel_tex_fetch(__prim_index, prim_addr);
+
   if (triangle_intersect_local(kg,
local_isect,
P,
dir,
-   object,
local_object,
+   prim,
prim_addr,
isect_t,
lcg_state,
@@ -168,13 +179,24 @@ ccl_device_inline
 /* intersect ray against primitive */
 for (; prim_addr < prim_addr2; prim_addr++) {
   kernel_assert(kernel_tex_fetch(__prim_type, prim_addr) == type);
+
+  /* Only intersect with matching object, for instanced objects we
+   * already know we are only intersecting the right object. */
+  if (object == OBJECT_NONE) {
+if (kernel_tex_fetch(__prim_object, prim_addr) != 
local_object) {
+  continue;
+}
+  }
+
+  const int prim = kernel_tex_fetch(__prim_index, prim_addr);
+
   if (motion_triangle_intersect_local(kg,
   local_isect,
   P,
   dir,
   ray->time,
-  object,
   local_object,
+  prim,
   prim_addr,
   isect_t,
   lcg_state,
diff --git a/intern/cycles/kernel/bvh/shadow_all.h 
b/intern/cycles/kernel/bvh/shadow_all.h
index b0e799675e0..0fb86bfda77 100644
--- a/intern/cycles/kernel/bvh/shadow_all.h
+++ b/intern/cycles/kernel/bvh/shadow_all.h
@@ -146,7 +146,7 @@ ccl_device_inline
   --stack_ptr;
 
   /* primitive intersection */
-  while (prim_addr < prim_addr2) {
+  for (; prim_addr < prim_addr2; prim_addr++) {
 kernel_assert((kernel_tex_fetch(__prim_type, prim_addr) & 
PRIMITIVE_ALL) ==
   (type & PRIMITIVE_ALL));
 bool hit;
@@ -156,16 +156,29 @@ ccl_device_inline
  * might give a few % performance improvement */
 Intersection isect ccl_optional_struct_init;
 
+const int prim_object = (object == OBJECT_NONE) ?
+kernel_tex_fetch(__prim_object, 
prim_addr) :
+object;
+const int prim = kernel_tex_fetch(__prim_index, prim_addr);
+
 switch (type & PRIMITIVE_ALL) {
   case PRIMITIVE_TRIANGLE: {
 hit = triangle_intersect(
-kg, &isect, P, dir, t_max_current, visibility, object, 
prim_addr);
+kg, &isect, P, dir, t_max_current, visibility, 
prim_object, prim, prim_addr);
 break;
   }
 #if BVH_FEATURE(BVH_MOTION)
   

[Bf-blender-cvs] [9d519f1db48] blender-v2.83-release: Fix T89081: Freestyle noise seed of zero crash

2022-01-17 Thread Philipp Oeser
Commit: 9d519f1db48602b5b728ae4fcef2bae6c2369c6f
Author: Philipp Oeser
Date:   Tue Nov 23 12:27:17 2021 +0100
Branches: blender-v2.83-release
https://developer.blender.org/rB9d519f1db48602b5b728ae4fcef2bae6c2369c6f

Fix T89081: Freestyle noise seed of zero crash

This leads to division by zero in Freestyle's NoiseShader which also
crashes blender.

Not sure if we really need a do_version patch for old files, as an
alternative we could also force a positive number in the NoiseShader.
This patch does not do either, just force a positive range in RNA from
now on.

Maniphest Tasks: T89081

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

===

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

===

diff --git a/source/blender/makesrna/intern/rna_linestyle.c 
b/source/blender/makesrna/intern/rna_linestyle.c
index 945f13fa90b..9e0645d5e0c 100644
--- a/source/blender/makesrna/intern/rna_linestyle.c
+++ b/source/blender/makesrna/intern/rna_linestyle.c
@@ -949,8 +949,9 @@ static void rna_def_linestyle_modifiers(BlenderRNA *brna)
   RNA_def_property_ui_text(prop, "Period", "Period of the noise");
   RNA_def_property_update(prop, NC_LINESTYLE, "rna_LineStyle_update");
 
-  prop = RNA_def_property(srna, "seed", PROP_INT, PROP_NONE);
+  prop = RNA_def_property(srna, "seed", PROP_INT, PROP_UNSIGNED);
   RNA_def_property_int_sdna(prop, NULL, "seed");
+  RNA_def_property_range(prop, 1, SHRT_MAX);
   RNA_def_property_ui_text(prop, "Seed", "Seed for the noise generation");
   RNA_def_property_update(prop, NC_LINESTYLE, "rna_LineStyle_update");
 
@@ -1051,8 +1052,9 @@ static void rna_def_linestyle_modifiers(BlenderRNA *brna)
   RNA_def_property_ui_text(prop, "Period", "Period of the noise");
   RNA_def_property_update(prop, NC_LINESTYLE, "rna_LineStyle_update");
 
-  prop = RNA_def_property(srna, "seed", PROP_INT, PROP_NONE);
+  prop = RNA_def_property(srna, "seed", PROP_INT, PROP_UNSIGNED);
   RNA_def_property_int_sdna(prop, NULL, "seed");
+  RNA_def_property_range(prop, 1, SHRT_MAX);
   RNA_def_property_ui_text(prop, "Seed", "Seed for the noise generation");
   RNA_def_property_update(prop, NC_LINESTYLE, "rna_LineStyle_update");
 
@@ -1191,8 +1193,9 @@ static void rna_def_linestyle_modifiers(BlenderRNA *brna)
   RNA_def_property_ui_text(prop, "Period", "Period of the noise");
   RNA_def_property_update(prop, NC_LINESTYLE, "rna_LineStyle_update");
 
-  prop = RNA_def_property(srna, "seed", PROP_INT, PROP_NONE);
+  prop = RNA_def_property(srna, "seed", PROP_INT, PROP_UNSIGNED);
   RNA_def_property_int_sdna(prop, NULL, "seed");
+  RNA_def_property_range(prop, 1, SHRT_MAX);
   RNA_def_property_ui_text(prop, "Seed", "Seed for the noise generation");
   RNA_def_property_update(prop, NC_LINESTYLE, "rna_LineStyle_update");

___
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] [50733e14799] blender-v2.83-release: Fix T93322: Freestyle Sinus Displacement Division by Zero Crash

2022-01-17 Thread Philipp Oeser
Commit: 50733e1479943d2652cbb3a60d92877674250b60
Author: Philipp Oeser
Date:   Tue Nov 23 11:48:44 2021 +0100
Branches: blender-v2.83-release
https://developer.blender.org/rB50733e1479943d2652cbb3a60d92877674250b60

Fix T93322: Freestyle Sinus Displacement Division by Zero Crash

This happens if the Wavelength is set to 0.0f.

Not sure if we really need a do_version patch for old files, as an
alternative we could also force a slight offset in the
SinusDisplacementShader. This patch does not do either, just force a
positive range from now on.

Maniphest Tasks: T93322

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

===

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

===

diff --git a/source/blender/makesrna/intern/rna_linestyle.c 
b/source/blender/makesrna/intern/rna_linestyle.c
index 788246f5edd..945f13fa90b 100644
--- a/source/blender/makesrna/intern/rna_linestyle.c
+++ b/source/blender/makesrna/intern/rna_linestyle.c
@@ -1306,8 +1306,9 @@ static void rna_def_linestyle_modifiers(BlenderRNA *brna)
   srna, "Sinus Displacement", "Add sinus displacement to stroke backbone 
geometry");
   rna_def_geometry_modifier(srna);
 
-  prop = RNA_def_property(srna, "wavelength", PROP_FLOAT, PROP_NONE);
+  prop = RNA_def_property(srna, "wavelength", PROP_FLOAT, PROP_UNSIGNED);
   RNA_def_property_float_sdna(prop, NULL, "wavelength");
+  RNA_def_property_range(prop, 0.0001f, FLT_MAX);
   RNA_def_property_ui_text(prop, "Wavelength", "Wavelength of the sinus 
displacement");
   RNA_def_property_update(prop, NC_LINESTYLE, "rna_LineStyle_update");

___
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] [b82b608e91e] blender-v2.83-release: Fix T93007: Cycles not updating for animated Object properties like color

2022-01-17 Thread Brecht Van Lommel
Commit: b82b608e91e868ad9afef675e63051b6401d6a7e
Author: Brecht Van Lommel
Date:   Thu Nov 11 18:49:44 2021 +0100
Branches: blender-v2.83-release
https://developer.blender.org/rBb82b608e91e868ad9afef675e63051b6401d6a7e

Fix T93007: Cycles not updating for animated Object properties like color

===

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

===

diff --git a/source/blender/makesrna/intern/rna_depsgraph.c 
b/source/blender/makesrna/intern/rna_depsgraph.c
index e47b6957d35..cdd47e71745 100644
--- a/source/blender/makesrna/intern/rna_depsgraph.c
+++ b/source/blender/makesrna/intern/rna_depsgraph.c
@@ -207,8 +207,10 @@ static bool 
rna_DepsgraphUpdate_is_updated_transform_get(PointerRNA *ptr)
 
 static bool rna_DepsgraphUpdate_is_updated_shading_get(PointerRNA *ptr)
 {
+  /* Assume any animated parameters can affect shading, we don't have fine
+   * grained enough updates to distinguish this. */
   ID *id = ptr->data;
-  return ((id->recalc & ID_RECALC_SHADING) != 0);
+  return ((id->recalc & (ID_RECALC_SHADING | ID_RECALC_ANIMATION)) != 0);
 }
 
 static bool rna_DepsgraphUpdate_is_updated_geometry_get(PointerRNA *ptr)

___
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] [944a705215f] blender-v2.83-release: Fix T93320: Freestyle LineStyleModifier blend 'Minimum' error

2022-01-17 Thread Philipp Oeser
Commit: 944a705215f48de70001bf106cda8c2932ea0b60
Author: Philipp Oeser
Date:   Tue Nov 23 11:10:33 2021 +0100
Branches: blender-v2.83-release
https://developer.blender.org/rB944a705215f48de70001bf106cda8c2932ea0b60

Fix T93320: Freestyle LineStyleModifier blend 'Minimum' error

This was just a typo in {rBb408d8af31c9}
Must be 'MINIMUM' (instead of 'MININUM').

Maniphest Tasks: T93320

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

===

M   release/scripts/freestyle/modules/parameter_editor.py

===

diff --git a/release/scripts/freestyle/modules/parameter_editor.py 
b/release/scripts/freestyle/modules/parameter_editor.py
index 534ee7d65be..8be10ff7fb3 100644
--- a/release/scripts/freestyle/modules/parameter_editor.py
+++ b/release/scripts/freestyle/modules/parameter_editor.py
@@ -164,7 +164,7 @@ class ScalarBlendModifier(StrokeShader):
 v1 = facm * v1 + fac * v1 / v2 if v2 != 0.0 else v1
 elif self.blend_type == 'DIFFERENCE':
 v1 = facm * v1 + fac * abs(v1 - v2)
-elif self.blend_type == 'MININUM':
+elif self.blend_type == 'MINIMUM':
 v1 = min(fac * v2, v1)
 elif self.blend_type == 'MAXIMUM':
 v1 = max(fac * v2, v1)

___
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] [a25cfc5db26] master: Texture/Vertex Paint: Add secondary color to the tool header

2022-01-17 Thread Sebastian Parborg
Commit: a25cfc5db2625d147c4f2d89584e6d87748a47bb
Author: Sebastian Parborg
Date:   Mon Jan 17 16:48:18 2022 +0100
Branches: master
https://developer.blender.org/rBa25cfc5db2625d147c4f2d89584e6d87748a47bb

Texture/Vertex Paint: Add secondary color to the tool header

Before we would only display the secondary color in the N-panel.
Now we also display it in the tool header.

===

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

===

diff --git a/release/scripts/startup/bl_ui/properties_paint_common.py 
b/release/scripts/startup/bl_ui/properties_paint_common.py
index 49effabc5cf..347f771d1f6 100644
--- a/release/scripts/startup/bl_ui/properties_paint_common.py
+++ b/release/scripts/startup/bl_ui/properties_paint_common.py
@@ -1107,7 +1107,11 @@ def brush_basic_texpaint_settings(layout, context, 
brush, *, compact=False):
 capabilities = brush.image_paint_capabilities
 
 if capabilities.has_color:
-UnifiedPaintPanel.prop_unified_color(layout, context, brush, "color", 
text="")
+row = layout.row(align=True)
+row.ui_units_x = 4
+UnifiedPaintPanel.prop_unified_color(row, context, brush, "color", 
text="")
+UnifiedPaintPanel.prop_unified_color(row, context, brush, 
"secondary_color", text="")
+row.separator()
 layout.prop(brush, "blend", text="" if compact else "Blend")
 
 UnifiedPaintPanel.prop_unified(

___
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] [be8f10a4e21] master: T94828: Appending collection with instancing links nested collections

2022-01-17 Thread Julian Eisel
Commit: be8f10a4e2172eb686863998d1a8df904463ab21
Author: Julian Eisel
Date:   Mon Jan 17 16:32:00 2022 +0100
Branches: master
https://developer.blender.org/rBbe8f10a4e2172eb686863998d1a8df904463ab21

T94828: Appending collection with instancing links nested collections

See T94828 for details.

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

Reviewed by: Bastien Montagne

===

M   source/blender/blenkernel/intern/blendfile_link_append.c

===

diff --git a/source/blender/blenkernel/intern/blendfile_link_append.c 
b/source/blender/blenkernel/intern/blendfile_link_append.c
index 169a410bccc..9b3f4c2fae8 100644
--- a/source/blender/blenkernel/intern/blendfile_link_append.c
+++ b/source/blender/blenkernel/intern/blendfile_link_append.c
@@ -681,21 +681,25 @@ static void loose_data_instantiate_collection_process(
 Collection *collection = (Collection *)id;
 bool do_add_collection = (id->tag & LIB_TAG_DOIT) != 0;
 
+if (!do_add_collection) {
+  continue;
+}
 /* When instantiated into view-layer, do not add collections if one of 
their parents is also
- * instantiated. In case of empty-instantiation though, instantiation of 
all user-selected
- * collections is the desired behavior. */
-if (!do_add_collection ||
-(!do_instantiate_as_empty &&
- 
loose_data_instantiate_collection_parents_check_recursive(collection))) {
+ * instantiated. */
+if (!do_instantiate_as_empty &&
+loose_data_instantiate_collection_parents_check_recursive(collection)) 
{
+  continue;
+}
+/* When instantiated as empty, do not add indirectly linked (i.e. 
non-user-selected)
+ * collections. */
+if (do_instantiate_as_empty && (item->tag & LINK_APPEND_TAG_INDIRECT) != 
0) {
   continue;
 }
 
 loose_data_instantiate_ensure_active_collection(instantiate_context);
 Collection *active_collection = instantiate_context->active_collection;
 
-/* In case user requested instantiation of collections as empties, do so 
for the one they
- * explicitly selected (originally directly linked IDs) only. */
-if (do_instantiate_as_empty && (item->tag & LINK_APPEND_TAG_INDIRECT) == 
0) {
+if (do_instantiate_as_empty) {
   /* BKE_object_add(...) messes with the selection. */
   Object *ob = BKE_object_add_only_object(bmain, OB_EMPTY, 
collection->id.name + 2);
   ob->type = OB_EMPTY;

___
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] [e3fd0b1d177] master: Fix compiler warning on Windows

2022-01-17 Thread Antonio Vazquez
Commit: e3fd0b1d177cb1a17e6ec729b7d695465f67ead8
Author: Antonio Vazquez
Date:   Mon Jan 17 16:08:48 2022 +0100
Branches: master
https://developer.blender.org/rBe3fd0b1d177cb1a17e6ec729b7d695465f67ead8

Fix compiler warning on Windows

The variable was `uint64_t` and needs `1ull`

===

M   source/blender/gpu/opengl/gl_shader_interface.cc

===

diff --git a/source/blender/gpu/opengl/gl_shader_interface.cc 
b/source/blender/gpu/opengl/gl_shader_interface.cc
index 9dd7b1d57c3..2211c2fbb7c 100644
--- a/source/blender/gpu/opengl/gl_shader_interface.cc
+++ b/source/blender/gpu/opengl/gl_shader_interface.cc
@@ -402,7 +402,7 @@ GLShaderInterface::GLShaderInterface(GLuint program, const 
shader::ShaderCreateI
 glUniform1i(input->location, res.slot);
   }
   input->binding = res.slot;
-  enabled_tex_mask_ |= (1 << input->binding);
+  enabled_tex_mask_ |= (1ull << input->binding);
   input++;
 }
 else if (res.bind_type == ShaderCreateInfo::Resource::BindType::IMAGE) {

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

2022-01-17 Thread Antonio Vazquez
Commit: 4cd11f862fbd5d6919c94dbcfc9926b8b470e74a
Author: Antonio Vazquez
Date:   Mon Jan 17 16:01:11 2022 +0100
Branches: asset-greasepencil
https://developer.blender.org/rB4cd11f862fbd5d6919c94dbcfc9926b8b470e74a

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] [fcdaeba7782] blender-v2.83-release: Fix T94799: GPencil Strokes drawn at 0.0 Strength still visible

2022-01-17 Thread Antonio Vazquez
Commit: fcdaeba7782073b4b1166ed912ad7983cd89b36c
Author: Antonio Vazquez
Date:   Tue Jan 11 22:45:21 2022 +0100
Branches: blender-v2.83-release
https://developer.blender.org/rBfcdaeba7782073b4b1166ed912ad7983cd89b36c

Fix T94799: GPencil Strokes drawn at 0.0 Strength still visible

There was a clamp with a value greater than 0.

===

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

===

diff --git a/source/blender/editors/gpencil/gpencil_paint.c 
b/source/blender/editors/gpencil/gpencil_paint.c
index 139e52254f4..9c8be88ea00 100644
--- a/source/blender/editors/gpencil/gpencil_paint.c
+++ b/source/blender/editors/gpencil/gpencil_paint.c
@@ -765,7 +765,7 @@ static short gp_stroke_addpoint(tGPsdata *p, const float 
mval[2], float pressure
 /* color strength */
 if (brush_settings->flag & GP_BRUSH_USE_STENGTH_PRESSURE) {
   pt->strength *= 
BKE_curvemapping_evaluateF(brush_settings->curve_strength, 0, pressure);
-  CLAMP(pt->strength, GPENCIL_STRENGTH_MIN, 1.0f);
+  CLAMP(pt->strength, MIN2(GPENCIL_STRENGTH_MIN, 
brush_settings->draw_strength), 1.0f);
 }
 
 if (brush_settings->flag & GP_BRUSH_GROUP_RANDOM) {
@@ -865,6 +865,7 @@ static void gp_stroke_newfrombuffer(tGPsdata *p)
   tGPspoint *ptc;
   MDeformVert *dvert = NULL;
   Brush *brush = p->brush;
+  BrushGpencilSettings *brush_settings = brush->gpencil_settings;
   ToolSettings *ts = p->scene->toolsettings;
   Depsgraph *depsgraph = p->depsgraph;
   Object *obact = (Object *)p->ownerPtr.data;
@@ -958,7 +959,7 @@ static void gp_stroke_newfrombuffer(tGPsdata *p)
   /* copy pressure and time */
   pt->pressure = ptc->pressure;
   pt->strength = ptc->strength;
-  CLAMP(pt->strength, GPENCIL_STRENGTH_MIN, 1.0f);
+  CLAMP(pt->strength, MIN2(GPENCIL_STRENGTH_MIN, 
brush_settings->draw_strength), 1.0f);
   pt->time = ptc->time;
   /* Apply the vertex color to point. */
   ED_gpencil_point_vertex_color_set(ts, brush, pt);
@@ -991,7 +992,7 @@ static void gp_stroke_newfrombuffer(tGPsdata *p)
   /* copy pressure and time */
   pt->pressure = ptc->pressure;
   pt->strength = ptc->strength;
-  CLAMP(pt->strength, GPENCIL_STRENGTH_MIN, 1.0f);
+  CLAMP(pt->strength, MIN2(GPENCIL_STRENGTH_MIN, 
brush_settings->draw_strength), 1.0f);
   pt->time = ptc->time;
   /* Apply the vertex color to point. */
   ED_gpencil_point_vertex_color_set(ts, brush, pt);
@@ -1112,7 +1113,7 @@ static void gp_stroke_newfrombuffer(tGPsdata *p)
   /* copy pressure and time */
   pt->pressure = ptc->pressure;
   pt->strength = ptc->strength;
-  CLAMP(pt->strength, GPENCIL_STRENGTH_MIN, 1.0f);
+  CLAMP(pt->strength, MIN2(GPENCIL_STRENGTH_MIN, 
brush_settings->draw_strength), 1.0f);
   pt->time = ptc->time;
   pt->uv_fac = ptc->uv_fac;
   pt->uv_rot = ptc->uv_rot;

___
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] [67861003134] blender-v2.83-release: Fix T93130: Frame Selected with selected paint mask does not work

2022-01-17 Thread Philipp Oeser
Commit: 678610031345457966fdacbea1b956c14ad3bba3
Author: Philipp Oeser
Date:   Tue Nov 16 20:25:11 2021 +0100
Branches: blender-v2.83-release
https://developer.blender.org/rB678610031345457966fdacbea1b956c14ad3bba3

Fix T93130: Frame Selected with selected paint mask does not work

This broke with {rB20fac2eca723} (which landed in 2.63), so long
standing bug.

Convention for paint modes is:
- when no paint mask is active, `Frame Selected` will focus the last
stroke
- when paint mask is active, `Frame Selected` will focus the selected
mask faces

To check the right vert coords we have to offset with `mp->loopstart`.

Maniphest Tasks: T93130

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

===

M   source/blender/editors/mesh/editface.c

===

diff --git a/source/blender/editors/mesh/editface.c 
b/source/blender/editors/mesh/editface.c
index b303c4c7e4e..215a1e5e929 100644
--- a/source/blender/editors/mesh/editface.c
+++ b/source/blender/editors/mesh/editface.c
@@ -370,7 +370,7 @@ bool paintface_minmax(Object *ob, float r_min[3], float 
r_max[3])
   continue;
 }
 
-ml = me->mloop + mp->totloop;
+ml = me->mloop + mp->loopstart;
 for (b = 0; b < mp->totloop; b++, ml++) {
   mul_v3_m3v3(vec, bmat, mvert[ml->v].co);
   add_v3_v3v3(vec, vec, ob->obmat[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] [5d1efa9759c] blender-v2.83-release: Fix T93117: Texture paint clone tool crash in certain situation

2022-01-17 Thread Philipp Oeser
Commit: 5d1efa9759c9050fb3f50102cec5a33836f6d225
Author: Philipp Oeser
Date:   Fri Nov 26 10:00:09 2021 +0100
Branches: blender-v2.83-release
https://developer.blender.org/rB5d1efa9759c9050fb3f50102cec5a33836f6d225

Fix T93117: Texture paint clone tool crash in certain situation

Caused by {rBaf162658e127}, so long standing bug.

When changing clone slots (report involved a quite complicated sequence
of selecting textures and undo -- but I think this could happen in more
situations) code checks for UV of new clone slot.
However, since above commit the slot and the clone slot were mixed up,
so in this case the responsible NULL check (for when no UV is assigned)
wasnt working.
Now correct this (NULL check the clone slot uv -- instead of the paint
slot UV).

note: not sure why low level CustomData functions actually dont do the
name NULL checks themselves (seems like callers are always responsible).

Maniphest Tasks: T93117

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

===

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

===

diff --git a/source/blender/editors/sculpt_paint/paint_image_proj.c 
b/source/blender/editors/sculpt_paint/paint_image_proj.c
index 832f56738ce..558a5db673c 100644
--- a/source/blender/editors/sculpt_paint/paint_image_proj.c
+++ b/source/blender/editors/sculpt_paint/paint_image_proj.c
@@ -4163,8 +4163,9 @@ static bool project_paint_clone_face_skip(ProjPaintState 
*ps,
 
 if (ps->do_material_slots) {
   if (lc->slot_clone != lc->slot_last_clone) {
-if (!slot->uvname || !(lc->mloopuv_clone_base = 
CustomData_get_layer_named(
-   &ps->me_eval->ldata, CD_MLOOPUV, 
lc->slot_clone->uvname))) {
+if (!lc->slot_clone->uvname ||
+!(lc->mloopuv_clone_base = CustomData_get_layer_named(
+  &ps->me_eval->ldata, CD_MLOOPUV, lc->slot_clone->uvname))) {
   lc->mloopuv_clone_base = CustomData_get_layer(&ps->me_eval->ldata, 
CD_MLOOPUV);
 }
 lc->slot_last_clone = lc->slot_clone;

___
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] [4946f0c5a29] blender-v2.83-release: Fix T93563: Crash subdividing with overlapping tri and quad

2022-01-17 Thread Campbell Barton
Commit: 4946f0c5a29080a7c632fa859b456c82eb47a26a
Author: Campbell Barton
Date:   Thu Dec 2 22:39:27 2021 +1100
Branches: blender-v2.83-release
https://developer.blender.org/rB4946f0c5a29080a7c632fa859b456c82eb47a26a

Fix T93563: Crash subdividing with overlapping tri and quad

The first loop was left out when finding the split edge boundary.

Error from f2138686d9d8c105ebf8884774fd7e4d8ff239a1.

===

M   source/blender/bmesh/operators/bmo_subdivide.c

===

diff --git a/source/blender/bmesh/operators/bmo_subdivide.c 
b/source/blender/bmesh/operators/bmo_subdivide.c
index bf63261fd4d..19341fee7ee 100644
--- a/source/blender/bmesh/operators/bmo_subdivide.c
+++ b/source/blender/bmesh/operators/bmo_subdivide.c
@@ -1187,12 +1187,14 @@ void bmo_subdivide_edges_exec(BMesh *bm, BMOperator *op)
   vlen = BLI_array_len(loops);
 
   /* find the boundary of one of the split edges */
-  for (a = 1; a < vlen; a++) {
-if (!BMO_vert_flag_test(bm, loops[a - 1]->v, ELE_INNER) &&
+  for (a = 0; a < vlen; a++) {
+if (!BMO_vert_flag_test(bm, loops[a ? (a - 1) : (vlen - 1)]->v, 
ELE_INNER) &&
 BMO_vert_flag_test(bm, loops[a]->v, ELE_INNER)) {
   break;
 }
   }
+  /* Failure to break means there is an internal error. */
+  BLI_assert(a < vlen);
 
   if (BMO_vert_flag_test(bm, loops[(a + numcuts + 1) % vlen]->v, 
ELE_INNER)) {
 b = (a + numcuts + 1) % vlen;

___
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] [cbc6c3938d1] blender-v2.83-release: Fix T93353: Reload Library Override file loses Constraints, take II.

2022-01-17 Thread Bastien Montagne
Commit: cbc6c3938d186852bebecb9847694195100dde9f
Author: Bastien Montagne
Date:   Tue Nov 30 15:19:30 2021 +0100
Branches: blender-v2.83-release
https://developer.blender.org/rBcbc6c3938d186852bebecb9847694195100dde9f

Fix T93353: Reload Library Override file loses Constraints, take II.

When adding `INSERT` operations over RNACollection items, rna diffing
code did not properly report the properties as not being equals.

This in turn triggered the 'purge unused exiting override properties'
mechanism, thus deleting the exitsting (valid) insert override property
operation.

NOTE: This should also be backported to 2.93, and probably 2.83.

Reviewed By: sybren, jbakker

Maniphest Tasks: T93353

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

===

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 96e6980aa1d..acc67188688 100644
--- a/source/blender/makesrna/intern/rna_rna.c
+++ b/source/blender/makesrna/intern/rna_rna.c
@@ -1831,6 +1831,7 @@ int rna_property_override_diff_default(Main *bmain,
prev_propname_a,
idx_a - 1);
 #  endif
+equals = false;
   }
   else if (is_id || is_valid_for_diffing) {
 if (equals || do_create) {

___
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] [ca881afef16] blender-v2.83-release: Fix T88877: 2.93: Crash on recent OSX with a non-English locale.

2022-01-17 Thread Ankit Meel
Commit: ca881afef1631cdd138ccf9af090ca6fb29b3608
Author: Ankit Meel
Date:   Fri Oct 29 10:11:04 2021 +0200
Branches: blender-v2.83-release
https://developer.blender.org/rBca881afef1631cdd138ccf9af090ca6fb29b3608

Fix T88877: 2.93: Crash on recent OSX with a non-English locale.

Looks like OSX changed the default format of its locale, which is not
valid anymore for gettext/boost::locale.

Solution based on investigations and patch by Kieun Mun (@kieuns), with
some further tweaks by Ankit Meel (@ankitm), many thanks.

Also add an exception catcher on `std::runtime_error` in
`bl_locale_set()`, since in OSX catching the ancestor `std::exception`
does not work with `boost::locale::conv::conversion_error` and the like
for some reasons.

Reviewed By: #platform_macos, brecht

Maniphest Tasks: T88877

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

===

M   intern/locale/boost_locale_wrapper.cpp
M   intern/locale/osx_user_locale.mm

===

diff --git a/intern/locale/boost_locale_wrapper.cpp 
b/intern/locale/boost_locale_wrapper.cpp
index 73433fe7c5e..ede9377b38f 100644
--- a/intern/locale/boost_locale_wrapper.cpp
+++ b/intern/locale/boost_locale_wrapper.cpp
@@ -117,6 +117,13 @@ void bl_locale_set(const char *locale)
 
 #undef LOCALE_INFO
   }
+  // Extra catch on `std::runtime_error` is needed for macOS/Clang as it seems 
that exceptions
+  // like `boost::locale::conv::conversion_error` (which inherit from 
`std::runtime_error`) are
+  // not caught by their ancestor `std::exception`. See
+  // https://developer.blender.org/T88877#1177108 .
+  catch (std::runtime_error const &e) {
+std::cout << "bl_locale_set(" << locale << "): " << e.what() << " \n";
+  }
   catch (std::exception const &e) {
 std::cout << "bl_locale_set(" << locale << "): " << e.what() << " \n";
   }
diff --git a/intern/locale/osx_user_locale.mm b/intern/locale/osx_user_locale.mm
index e2f65d39df9..ce694b5fc1e 100644
--- a/intern/locale/osx_user_locale.mm
+++ b/intern/locale/osx_user_locale.mm
@@ -14,7 +14,17 @@ const char *osx_user_locale()
   CFLocaleRef myCFLocale = CFLocaleCopyCurrent();
   NSLocale *myNSLocale = (NSLocale *)myCFLocale;
   [myNSLocale autorelease];
-  NSString *nsIdentifier = [myNSLocale localeIdentifier];
+
+  // This produces gettext-invalid locale in recent macOS versions (11.4),
+  // like `ko-Kore_KR` instead of `ko_KR`. See T88877.
+  // NSString *nsIdentifier = [myNSLocale localeIdentifier];
+
+  const NSString *nsIdentifier = [myNSLocale languageCode];
+  const NSString *const nsIdentifier_country = [myNSLocale countryCode];
+  if ([nsIdentifier length] != 0 && [nsIdentifier_country length] != 0) {
+nsIdentifier = [NSString stringWithFormat:@"%@_%@", nsIdentifier, 
nsIdentifier_country];
+  }
+
   user_locale = ::strdup([nsIdentifier UTF8String]);
   [pool drain];

___
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] [70395ff7fda] blender-v2.83-release: Fix T93194: greasepencil channel lists ignoring collection visibility

2022-01-17 Thread Philipp Oeser
Commit: 70395ff7fda9fb6c7b68391dbfaad2a3038f27ca
Author: Philipp Oeser
Date:   Fri Nov 19 11:16:04 2021 +0100
Branches: blender-v2.83-release
https://developer.blender.org/rB70395ff7fda9fb6c7b68391dbfaad2a3038f27ca

Fix T93194: greasepencil channel lists ignoring collection visibility

Same fix as rB0a3b4d4c64f1, but this time for greasepencil.

To repeat: dopesheet in greasepencil mode was ignoring the temporariy
visibility flag of collections. As a result, even though the dopesheet
was supposed to show animation data of visible greasepencils only was
still showing such data of greasepencils that were hidden by hiding
their collection.

===

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

===

diff --git a/source/blender/editors/animation/anim_filter.c 
b/source/blender/editors/animation/anim_filter.c
index 4dc0bef3a1b..5804b5c1354 100644
--- a/source/blender/editors/animation/anim_filter.c
+++ b/source/blender/editors/animation/anim_filter.c
@@ -1870,7 +1870,8 @@ static size_t animdata_filter_gpencil(bAnimContext *ac,
   if ((filter_mode & ANIMFILTER_DATA_VISIBLE) && !(ads->filterflag & 
ADS_FILTER_INCL_HIDDEN)) {
 /* Layer visibility - we check both object and base,
  * since these may not be in sync yet. */
-if ((base->flag & BASE_VISIBLE_DEPSGRAPH) == 0) {
+if ((base->flag & BASE_VISIBLE_DEPSGRAPH) == 0 ||
+(base->flag & BASE_VISIBLE_VIEWLAYER) == 0) {
   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] [7abdd82dfda] master: Fix T94338: bpy.data.libraries.load does not return the right thing.

2022-01-17 Thread Bastien Montagne
Commit: 7abdd82dfdad893957e8550c15f9557253971d7d
Author: Bastien Montagne
Date:   Mon Jan 17 15:15:01 2022 +0100
Branches: master
https://developer.blender.org/rB7abdd82dfdad893957e8550c15f9557253971d7d

Fix T94338: bpy.data.libraries.load does not return the right thing.

Typo in rB605cdc4346e5f82, both `eBlendfileLinkAppendForeachItemFlag`
flags had the same value, effectively preventing to filter out direct
vs. indirect appended items.

===

M   source/blender/blenkernel/BKE_blendfile_link_append.h

===

diff --git a/source/blender/blenkernel/BKE_blendfile_link_append.h 
b/source/blender/blenkernel/BKE_blendfile_link_append.h
index 04521cc8939..e55a2d15dcc 100644
--- a/source/blender/blenkernel/BKE_blendfile_link_append.h
+++ b/source/blender/blenkernel/BKE_blendfile_link_append.h
@@ -150,7 +150,7 @@ typedef enum eBlendfileLinkAppendForeachItemFlag {
*
* IMPORTANT: Those 'indirect' items currently may not cover **all** 
indirectly linked data.
* See comments in #foreach_libblock_link_append_callback. */
-  BKE_BLENDFILE_LINK_APPEND_FOREACH_ITEM_FLAG_DO_INDIRECT = 1 << 0,
+  BKE_BLENDFILE_LINK_APPEND_FOREACH_ITEM_FLAG_DO_INDIRECT = 1 << 1,
 } eBlendfileLinkAppendForeachItemFlag;
 /**
  * Callback called by #BKE_blendfile_link_append_context_item_foreach over 
each (or a subset of

___
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] [59fcbdd815d] master: Cleanup: deduplicate condition in transform curve code

2022-01-17 Thread Germano Cavalcante
Commit: 59fcbdd815d01863d91e41c24ccf1fbfbdae2864
Author: Germano Cavalcante
Date:   Mon Jan 17 11:14:13 2022 -0300
Branches: master
https://developer.blender.org/rB59fcbdd815d01863d91e41c24ccf1fbfbdae2864

Cleanup: deduplicate condition in transform curve code

Checking `t->around` and `nu->pntsv` does not need to be done in 2 places.

===

M   source/blender/editors/transform/transform_convert_curve.c

===

diff --git a/source/blender/editors/transform/transform_convert_curve.c 
b/source/blender/editors/transform/transform_convert_curve.c
index 255af3feca2..924e51a2b41 100644
--- a/source/blender/editors/transform/transform_convert_curve.c
+++ b/source/blender/editors/transform/transform_convert_curve.c
@@ -357,26 +357,6 @@ void createTransCurveVerts(TransInfo *t)
 for (a = nu->pntsu * nu->pntsv, bp = nu->bp; a > 0; a--, bp++) {
   if (bp->hide == 0) {
 if (is_prop_edit || (bp->f1 & SELECT)) {
-  float axismtx[3][3];
-
-  if (t->around == V3D_AROUND_LOCAL_ORIGINS) {
-if (nu->pntsv == 1) {
-  float normal[3], plane[3];
-
-  BKE_nurb_bpoint_calc_normal(nu, bp, normal);
-  BKE_nurb_bpoint_calc_plane(nu, bp, plane);
-
-  if (createSpaceNormalTangent(axismtx, normal, plane)) {
-/* pass */
-  }
-  else {
-normalize_v3(normal);
-axis_dominant_v3_to_m3(axismtx, normal);
-invert_m3(axismtx);
-  }
-}
-  }
-
   copy_v3_v3(td->iloc, bp->vec);
   td->loc = bp->vec;
   copy_v3_v3(td->center, td->loc);
@@ -400,9 +380,22 @@ void createTransCurveVerts(TransInfo *t)
 
   copy_m3_m3(td->smtx, smtx);
   copy_m3_m3(td->mtx, mtx);
+
   if (t->around == V3D_AROUND_LOCAL_ORIGINS) {
 if (nu->pntsv == 1) {
-  copy_m3_m3(td->axismtx, axismtx);
+  float normal[3], plane[3];
+
+  BKE_nurb_bpoint_calc_normal(nu, bp, normal);
+  BKE_nurb_bpoint_calc_plane(nu, bp, plane);
+
+  if (createSpaceNormalTangent(td->axismtx, normal, plane)) {
+/* pass */
+  }
+  else {
+normalize_v3(normal);
+axis_dominant_v3_to_m3(td->axismtx, normal);
+invert_m3(td->axismtx);
+  }
 }
   }

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


[Bf-blender-cvs] SVN commit: bf-blender [62790] trunk/lib/tests/alembic: Add test files for Alembic override layers.

2022-01-17 Thread Kévin Dietrich
Revision: 62790
  https://developer.blender.org/rBL62790
Author:   kevindietrich
Date: 2022-01-17 14:49:12 +0100 (Mon, 17 Jan 2022)
Log Message:
---
Add test files for Alembic override layers.

Ref D13603.

Added Paths:
---
trunk/lib/tests/alembic/cube-base-file.abc
trunk/lib/tests/alembic/cube-hi-res.abc

Added: trunk/lib/tests/alembic/cube-base-file.abc
===
(Binary files differ)

Index: trunk/lib/tests/alembic/cube-base-file.abc
===
--- trunk/lib/tests/alembic/cube-base-file.abc  2022-01-17 05:08:28 UTC (rev 
62789)
+++ trunk/lib/tests/alembic/cube-base-file.abc  2022-01-17 13:49:12 UTC (rev 
62790)

Property changes on: trunk/lib/tests/alembic/cube-base-file.abc
___
Added: svn:mime-type
## -0,0 +1 ##
+application/octet-stream
\ No newline at end of property
Added: trunk/lib/tests/alembic/cube-hi-res.abc
===
(Binary files differ)

Index: trunk/lib/tests/alembic/cube-hi-res.abc
===
--- trunk/lib/tests/alembic/cube-hi-res.abc 2022-01-17 05:08:28 UTC (rev 
62789)
+++ trunk/lib/tests/alembic/cube-hi-res.abc 2022-01-17 13:49:12 UTC (rev 
62790)

Property changes on: trunk/lib/tests/alembic/cube-hi-res.abc
___
Added: svn:mime-type
## -0,0 +1 ##
+application/octet-stream
\ No newline at end of property
___
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] [9d3f35a0bf1] master: Revert "Revert "GPUShaderCreateInfo for interface abstraction""

2022-01-17 Thread Jeroen Bakker
Commit: 9d3f35a0bf1bf5776363bfd61d53a7c85b5827a4
Author: Jeroen Bakker
Date:   Mon Jan 17 14:45:22 2022 +0100
Branches: master
https://developer.blender.org/rB9d3f35a0bf1bf5776363bfd61d53a7c85b5827a4

Revert "Revert "GPUShaderCreateInfo for interface abstraction""

This reverts commit edee5a947b7ea3e1324aa334a22c7c9bbf47f5f7.

Fixes compilation error (Missing file BLI_float2.hh)

===

M   CMakeLists.txt
M   source/blender/draw/CMakeLists.txt
M   source/blender/draw/engines/workbench/shaders/workbench_common_lib.glsl
M   source/blender/draw/engines/workbench/shaders/workbench_data_lib.glsl
M   
source/blender/draw/engines/workbench/shaders/workbench_effect_cavity_frag.glsl
A   
source/blender/draw/engines/workbench/shaders/workbench_effect_cavity_info.hh
M   source/blender/draw/engines/workbench/shaders/workbench_image_lib.glsl
M   
source/blender/draw/engines/workbench/shaders/workbench_prepass_frag.glsl
M   
source/blender/draw/engines/workbench/shaders/workbench_prepass_hair_vert.glsl
A   source/blender/draw/engines/workbench/shaders/workbench_prepass_info.hh
M   
source/blender/draw/engines/workbench/shaders/workbench_prepass_pointcloud_vert.glsl
M   
source/blender/draw/engines/workbench/shaders/workbench_prepass_vert.glsl
M   
source/blender/draw/engines/workbench/shaders/workbench_shader_interface_lib.glsl
M   
source/blender/draw/engines/workbench/shaders/workbench_transparent_accum_frag.glsl
A   source/blender/draw/engines/workbench/workbench_shader_shared.h
M   source/blender/draw/intern/draw_manager.c
A   source/blender/draw/intern/draw_shader_shared.h
M   source/blender/draw/intern/shaders/common_fullscreen_vert.glsl
M   source/blender/draw/intern/shaders/common_pointcloud_lib.glsl
M   source/blender/draw/intern/shaders/common_view_lib.glsl
A   source/blender/draw/intern/shaders/draw_fullscreen_info.hh
A   source/blender/draw/intern/shaders/draw_object_infos_info.hh
A   source/blender/draw/intern/shaders/draw_view_info.hh
M   source/blender/editors/gpencil/drawgpencil.c
M   source/blender/editors/interface/interface_draw.c
M   source/blender/editors/space_node/drawnode.cc
M   source/blender/gpu/CMakeLists.txt
M   source/blender/gpu/GPU_immediate.h
M   source/blender/gpu/GPU_shader.h
A   source/blender/gpu/GPU_shader_shared.h
M   source/blender/gpu/intern/gpu_immediate.cc
M   source/blender/gpu/intern/gpu_init_exit.c
M   source/blender/gpu/intern/gpu_shader.cc
A   source/blender/gpu/intern/gpu_shader_builder.cc
A   source/blender/gpu/intern/gpu_shader_builder_stubs.cc
M   source/blender/gpu/intern/gpu_shader_builtin.c
A   source/blender/gpu/intern/gpu_shader_create_info.cc
A   source/blender/gpu/intern/gpu_shader_create_info.hh
A   source/blender/gpu/intern/gpu_shader_create_info_private.hh
A   source/blender/gpu/intern/gpu_shader_dependency.cc
A   source/blender/gpu/intern/gpu_shader_dependency_private.h
A   source/blender/gpu/intern/gpu_shader_info_baked.cc
M   source/blender/gpu/intern/gpu_shader_interface.hh
M   source/blender/gpu/intern/gpu_shader_private.hh
A   source/blender/gpu/intern/gpu_shader_shared_utils.h
M   source/blender/gpu/opengl/gl_backend.cc
M   source/blender/gpu/opengl/gl_context.hh
M   source/blender/gpu/opengl/gl_shader.cc
M   source/blender/gpu/opengl/gl_shader.hh
M   source/blender/gpu/opengl/gl_shader_interface.cc
M   source/blender/gpu/opengl/gl_shader_interface.hh
M   source/blender/gpu/shaders/gpu_shader_2D_area_borders_frag.glsl
M   source/blender/gpu/shaders/gpu_shader_2D_area_borders_vert.glsl
M   source/blender/gpu/shaders/gpu_shader_2D_flat_color_vert.glsl
M   source/blender/gpu/shaders/gpu_shader_2D_image_multi_rect_vert.glsl
M   source/blender/gpu/shaders/gpu_shader_2D_image_rect_vert.glsl
M   source/blender/gpu/shaders/gpu_shader_2D_image_vert.glsl
M   source/blender/gpu/shaders/gpu_shader_2D_line_dashed_frag.glsl
M   
source/blender/gpu/shaders/gpu_shader_2D_line_dashed_uniform_color_vert.glsl
M   source/blender/gpu/shaders/gpu_shader_2D_nodelink_frag.glsl
M   source/blender/gpu/shaders/gpu_shader_2D_nodelink_vert.glsl
M   source/blender/gpu/shaders/gpu_shader_2D_point_uniform_size_aa_vert.glsl
M   
source/blender/gpu/shaders/gpu_shader_2D_point_uniform_size_outline_aa_vert.glsl
M   
source/blender/gpu/shaders/gpu_shader_2D_point_varying_size_varying_color_vert.glsl
M   source/blender/gpu/shaders/gpu_shader_2D_smooth_color_frag.glsl
M   source/blender/gpu/shaders/gpu_shader_2D_smooth_color_vert.glsl
M   source/blender/gpu/shaders/gpu_shader_2D_vert.glsl
M   source/blender/gpu/shaders/gpu_shader_2D_widget_base_frag.glsl
M   source/blender/gpu/shaders/gpu_shader_2D_widget_base_vert.glsl
M   source/blender/gpu/shaders/gpu_s

[Bf-blender-cvs] [edee5a947b7] master: Revert "GPUShaderCreateInfo for interface abstraction"

2022-01-17 Thread Jeroen Bakker
Commit: edee5a947b7ea3e1324aa334a22c7c9bbf47f5f7
Author: Jeroen Bakker
Date:   Mon Jan 17 14:34:28 2022 +0100
Branches: master
https://developer.blender.org/rBedee5a947b7ea3e1324aa334a22c7c9bbf47f5f7

Revert "GPUShaderCreateInfo for interface abstraction"

This reverts commit 8fb2ff458ba579dba08bfdf57d043ad158b5db07.
Missing some files.

===

M   CMakeLists.txt
M   source/blender/draw/CMakeLists.txt
M   source/blender/draw/engines/workbench/shaders/workbench_common_lib.glsl
M   source/blender/draw/engines/workbench/shaders/workbench_data_lib.glsl
M   
source/blender/draw/engines/workbench/shaders/workbench_effect_cavity_frag.glsl
D   
source/blender/draw/engines/workbench/shaders/workbench_effect_cavity_info.hh
M   source/blender/draw/engines/workbench/shaders/workbench_image_lib.glsl
M   
source/blender/draw/engines/workbench/shaders/workbench_prepass_frag.glsl
M   
source/blender/draw/engines/workbench/shaders/workbench_prepass_hair_vert.glsl
D   source/blender/draw/engines/workbench/shaders/workbench_prepass_info.hh
M   
source/blender/draw/engines/workbench/shaders/workbench_prepass_pointcloud_vert.glsl
M   
source/blender/draw/engines/workbench/shaders/workbench_prepass_vert.glsl
M   
source/blender/draw/engines/workbench/shaders/workbench_shader_interface_lib.glsl
M   
source/blender/draw/engines/workbench/shaders/workbench_transparent_accum_frag.glsl
D   source/blender/draw/engines/workbench/workbench_shader_shared.h
M   source/blender/draw/intern/draw_manager.c
D   source/blender/draw/intern/draw_shader_shared.h
M   source/blender/draw/intern/shaders/common_fullscreen_vert.glsl
M   source/blender/draw/intern/shaders/common_pointcloud_lib.glsl
M   source/blender/draw/intern/shaders/common_view_lib.glsl
D   source/blender/draw/intern/shaders/draw_fullscreen_info.hh
D   source/blender/draw/intern/shaders/draw_object_infos_info.hh
D   source/blender/draw/intern/shaders/draw_view_info.hh
M   source/blender/editors/gpencil/drawgpencil.c
M   source/blender/editors/interface/interface_draw.c
M   source/blender/editors/space_node/drawnode.cc
M   source/blender/gpu/CMakeLists.txt
M   source/blender/gpu/GPU_immediate.h
M   source/blender/gpu/GPU_shader.h
D   source/blender/gpu/GPU_shader_shared.h
M   source/blender/gpu/intern/gpu_immediate.cc
M   source/blender/gpu/intern/gpu_init_exit.c
M   source/blender/gpu/intern/gpu_shader.cc
D   source/blender/gpu/intern/gpu_shader_builder.cc
D   source/blender/gpu/intern/gpu_shader_builder_stubs.cc
M   source/blender/gpu/intern/gpu_shader_builtin.c
D   source/blender/gpu/intern/gpu_shader_create_info.cc
D   source/blender/gpu/intern/gpu_shader_create_info.hh
D   source/blender/gpu/intern/gpu_shader_create_info_private.hh
D   source/blender/gpu/intern/gpu_shader_dependency.cc
D   source/blender/gpu/intern/gpu_shader_dependency_private.h
D   source/blender/gpu/intern/gpu_shader_info_baked.cc
M   source/blender/gpu/intern/gpu_shader_interface.hh
M   source/blender/gpu/intern/gpu_shader_private.hh
D   source/blender/gpu/intern/gpu_shader_shared_utils.h
M   source/blender/gpu/opengl/gl_backend.cc
M   source/blender/gpu/opengl/gl_context.hh
M   source/blender/gpu/opengl/gl_shader.cc
M   source/blender/gpu/opengl/gl_shader.hh
M   source/blender/gpu/opengl/gl_shader_interface.cc
M   source/blender/gpu/opengl/gl_shader_interface.hh
M   source/blender/gpu/shaders/gpu_shader_2D_area_borders_frag.glsl
M   source/blender/gpu/shaders/gpu_shader_2D_area_borders_vert.glsl
M   source/blender/gpu/shaders/gpu_shader_2D_flat_color_vert.glsl
M   source/blender/gpu/shaders/gpu_shader_2D_image_multi_rect_vert.glsl
M   source/blender/gpu/shaders/gpu_shader_2D_image_rect_vert.glsl
M   source/blender/gpu/shaders/gpu_shader_2D_image_vert.glsl
M   source/blender/gpu/shaders/gpu_shader_2D_line_dashed_frag.glsl
M   
source/blender/gpu/shaders/gpu_shader_2D_line_dashed_uniform_color_vert.glsl
M   source/blender/gpu/shaders/gpu_shader_2D_nodelink_frag.glsl
M   source/blender/gpu/shaders/gpu_shader_2D_nodelink_vert.glsl
M   source/blender/gpu/shaders/gpu_shader_2D_point_uniform_size_aa_vert.glsl
M   
source/blender/gpu/shaders/gpu_shader_2D_point_uniform_size_outline_aa_vert.glsl
M   
source/blender/gpu/shaders/gpu_shader_2D_point_varying_size_varying_color_vert.glsl
M   source/blender/gpu/shaders/gpu_shader_2D_smooth_color_frag.glsl
M   source/blender/gpu/shaders/gpu_shader_2D_smooth_color_vert.glsl
M   source/blender/gpu/shaders/gpu_shader_2D_vert.glsl
M   source/blender/gpu/shaders/gpu_shader_2D_widget_base_frag.glsl
M   source/blender/gpu/shaders/gpu_shader_2D_widget_base_vert.glsl
M   source/blender/gpu/shaders/gpu_shader_2D_widget_shadow_frag.glsl
M   so

[Bf-blender-cvs] [8fb2ff458ba] master: GPUShaderCreateInfo for interface abstraction

2022-01-17 Thread Jeroen Bakker
Commit: 8fb2ff458ba579dba08bfdf57d043ad158b5db07
Author: Jeroen Bakker
Date:   Mon Jan 17 14:32:03 2022 +0100
Branches: master
https://developer.blender.org/rB8fb2ff458ba579dba08bfdf57d043ad158b5db07

GPUShaderCreateInfo for interface abstraction

This is a first part of the Shader Create Info system could be.

A shader create info provides a way to define shader structure, resources
and interfaces. This makes for a quick way to provide backend agnostic
binding informations while also making shader variations easy to declare.

- Clear source input (only one file). Cleans up the GPU api since we can create 
a
  shader from one descriptor
- Resources and interfaces are generated by the backend (much simpler than 
parsing).
- Bindings are explicit from position in the array.
- GPUShaderInterface becomes a trivial translation of enums and string copy.
- No external dependency to third party lib.
- Cleaner code, less fragmentation of resources in several libs.
- Easy to modify / extend at runtime.
- no parser involve, very easy to code.
- Does not hold any data, can be static and kept on disc.
- Could hold precompiled bytecode for static shaders.

This also includes a new global dependency system.
GLSL shaders can include other sources by using #pragma BLENDER_REQUIRE(...).

This patch already migrated several builtin shaders. Other shaders should be 
migrated
one at a time, and could be done inside master.

There is a new compile directive `WITH_GPU_SHADER_BUILDER` this is an optional
directive for linting shaders to increase turn around time.

What is remaining:
- pyGPU API {T94975}
- Migration of other shaders. This could be a community effort.

Reviewed By: jbakker

Maniphest Tasks: T94975

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

===

M   CMakeLists.txt
M   source/blender/draw/CMakeLists.txt
M   source/blender/draw/engines/workbench/shaders/workbench_common_lib.glsl
M   source/blender/draw/engines/workbench/shaders/workbench_data_lib.glsl
M   
source/blender/draw/engines/workbench/shaders/workbench_effect_cavity_frag.glsl
A   
source/blender/draw/engines/workbench/shaders/workbench_effect_cavity_info.hh
M   source/blender/draw/engines/workbench/shaders/workbench_image_lib.glsl
M   
source/blender/draw/engines/workbench/shaders/workbench_prepass_frag.glsl
M   
source/blender/draw/engines/workbench/shaders/workbench_prepass_hair_vert.glsl
A   source/blender/draw/engines/workbench/shaders/workbench_prepass_info.hh
M   
source/blender/draw/engines/workbench/shaders/workbench_prepass_pointcloud_vert.glsl
M   
source/blender/draw/engines/workbench/shaders/workbench_prepass_vert.glsl
M   
source/blender/draw/engines/workbench/shaders/workbench_shader_interface_lib.glsl
M   
source/blender/draw/engines/workbench/shaders/workbench_transparent_accum_frag.glsl
A   source/blender/draw/engines/workbench/workbench_shader_shared.h
M   source/blender/draw/intern/draw_manager.c
A   source/blender/draw/intern/draw_shader_shared.h
M   source/blender/draw/intern/shaders/common_fullscreen_vert.glsl
M   source/blender/draw/intern/shaders/common_pointcloud_lib.glsl
M   source/blender/draw/intern/shaders/common_view_lib.glsl
A   source/blender/draw/intern/shaders/draw_fullscreen_info.hh
A   source/blender/draw/intern/shaders/draw_object_infos_info.hh
A   source/blender/draw/intern/shaders/draw_view_info.hh
M   source/blender/editors/gpencil/drawgpencil.c
M   source/blender/editors/interface/interface_draw.c
M   source/blender/editors/space_node/drawnode.cc
M   source/blender/gpu/CMakeLists.txt
M   source/blender/gpu/GPU_immediate.h
M   source/blender/gpu/GPU_shader.h
A   source/blender/gpu/GPU_shader_shared.h
M   source/blender/gpu/intern/gpu_immediate.cc
M   source/blender/gpu/intern/gpu_init_exit.c
M   source/blender/gpu/intern/gpu_shader.cc
A   source/blender/gpu/intern/gpu_shader_builder.cc
A   source/blender/gpu/intern/gpu_shader_builder_stubs.cc
M   source/blender/gpu/intern/gpu_shader_builtin.c
A   source/blender/gpu/intern/gpu_shader_create_info.cc
A   source/blender/gpu/intern/gpu_shader_create_info.hh
A   source/blender/gpu/intern/gpu_shader_create_info_private.hh
A   source/blender/gpu/intern/gpu_shader_dependency.cc
A   source/blender/gpu/intern/gpu_shader_dependency_private.h
A   source/blender/gpu/intern/gpu_shader_info_baked.cc
M   source/blender/gpu/intern/gpu_shader_interface.hh
M   source/blender/gpu/intern/gpu_shader_private.hh
A   source/blender/gpu/intern/gpu_shader_shared_utils.h
M   source/blender/gpu/opengl/gl_backend.cc
M   source/blender/gpu/opengl/gl_context.hh
M   source/blender/gpu/opengl/gl_shader.cc
M   source/blender/gpu/opengl/gl_shader.hh
M   source/blender/gpu/opengl/gl_shader_interface.cc
M   source/blender/gpu/

[Bf-blender-cvs] [fb21201d424] blender-v2.93-release: Fix T94837: curve tilt on a 2-point-curve is wrong

2022-01-17 Thread Philipp Oeser
Commit: fb21201d4244e3bd8f9c01fece2cb14e0ae29d2d
Author: Philipp Oeser
Date:   Wed Jan 12 12:03:26 2022 +0100
Branches: blender-v2.93-release
https://developer.blender.org/rBfb21201d4244e3bd8f9c01fece2cb14e0ae29d2d

Fix T94837: curve tilt on a 2-point-curve is wrong

2-point-curves are treated separately from 3plus-point-curves (assume a
lot of the twisting reduction can be skipped, so there is a dedicated
function for single segment curves).

And while using the 3plus-point-curves function [`make_bevel_list_3D`]
would actually work in this case, the dedicated function
`make_bevel_list_segment_3D` would only consider the tilt of the second
point and would just copy over the quat to the first point as well. Dont
see a reason for this, now consider the first point's tilt as well.

Maniphest Tasks: T94837

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

===

M   source/blender/blenkernel/intern/curve.c

===

diff --git a/source/blender/blenkernel/intern/curve.c 
b/source/blender/blenkernel/intern/curve.c
index 577e6758459..37cd62c3bc8 100644
--- a/source/blender/blenkernel/intern/curve.c
+++ b/source/blender/blenkernel/intern/curve.c
@@ -2524,12 +2524,15 @@ static void make_bevel_list_segment_3D(BevList *bl)
   normalize_v3(bevp1->dir);
 
   vec_to_quat(bevp1->quat, bevp1->dir, 5, 1);
-
   axis_angle_to_quat(q, bevp1->dir, bevp1->tilt);
   mul_qt_qtqt(bevp1->quat, q, bevp1->quat);
   normalize_qt(bevp1->quat);
+
   copy_v3_v3(bevp2->dir, bevp1->dir);
-  copy_qt_qt(bevp2->quat, bevp1->quat);
+  vec_to_quat(bevp2->quat, bevp2->dir, 5, 1);
+  axis_angle_to_quat(q, bevp2->dir, bevp2->tilt);
+  mul_qt_qtqt(bevp2->quat, q, bevp2->quat);
+  normalize_qt(bevp2->quat);
 }
 
 /* only for 2 points */

___
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] [08822801acf] master: Fix T94805: Library weak reference generates "path not found" reports.

2022-01-17 Thread Bastien Montagne
Commit: 08822801acf648d23791fa308ec8c1c26f86963e
Author: Bastien Montagne
Date:   Mon Jan 17 14:21:53 2022 +0100
Branches: master
https://developer.blender.org/rB08822801acf648d23791fa308ec8c1c26f86963e

Fix T94805: Library weak reference generates "path not found" reports.

No reason to handle those paths here, those are fully internal temp
data, user should not be exposed to it currently.

===

M   source/blender/blenkernel/intern/bpath.c

===

diff --git a/source/blender/blenkernel/intern/bpath.c 
b/source/blender/blenkernel/intern/bpath.c
index 44ef3ec96ff..a1570b4e031 100644
--- a/source/blender/blenkernel/intern/bpath.c
+++ b/source/blender/blenkernel/intern/bpath.c
@@ -237,7 +237,7 @@ void BKE_bpath_missing_files_check(Main *bmain, ReportList 
*reports)
   .bmain = bmain,
   .callback_function = check_missing_files_foreach_path_cb,
   .flag = BKE_BPATH_FOREACH_PATH_ABSOLUTE | 
BKE_BPATH_FOREACH_PATH_SKIP_PACKED |
-  BKE_BPATH_FOREACH_PATH_RESOLVE_TOKEN,
+  BKE_BPATH_FOREACH_PATH_RESOLVE_TOKEN | 
BKE_BPATH_TRAVERSE_SKIP_WEAK_REFERENCES,
   .user_data = reports});
 }

___
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] [49f25ae23ce] blender-v2.93-release: Fix T94089: GPencil Drawing don't Update after paste in Dopesheet

2022-01-17 Thread Antonio Vazquez
Commit: 49f25ae23ce8570b0aa7df07a5ed53ecf835f933
Author: Antonio Vazquez
Date:   Fri Jan 14 13:51:30 2022 +0100
Branches: blender-v2.93-release
https://developer.blender.org/rB49f25ae23ce8570b0aa7df07a5ed53ecf835f933

Fix T94089: GPencil Drawing don't Update after paste in Dopesheet

When paste new frames, the datablock need to be tagged to update the drawings.

===

M   source/blender/editors/gpencil/editaction_gpencil.c
M   source/blender/editors/space_action/action_edit.c

===

diff --git a/source/blender/editors/gpencil/editaction_gpencil.c 
b/source/blender/editors/gpencil/editaction_gpencil.c
index 4a53aa83358..eb51527db5c 100644
--- a/source/blender/editors/gpencil/editaction_gpencil.c
+++ b/source/blender/editors/gpencil/editaction_gpencil.c
@@ -46,6 +46,8 @@
 
 #include "WM_api.h"
 
+#include "DEG_depsgraph.h"
+
 /* * */
 /* NOTE ABOUT THIS FILE:
  * This file contains code for editing Grease Pencil data in the Action Editor
@@ -503,6 +505,9 @@ bool ED_gpencil_anim_copybuf_paste(bAnimContext *ac, const 
short offset_mode)
   /* unapply offset from buffer-frame */
   gpfs->framenum -= offset;
 }
+
+/* Tag destination datablock. */
+DEG_id_tag_update(ale->id, ID_RECALC_TRANSFORM | ID_RECALC_GEOMETRY);
   }
 
   /* clean up */
diff --git a/source/blender/editors/space_action/action_edit.c 
b/source/blender/editors/space_action/action_edit.c
index fea62f0d9c2..425ab26665e 100644
--- a/source/blender/editors/space_action/action_edit.c
+++ b/source/blender/editors/space_action/action_edit.c
@@ -642,6 +642,10 @@ static int actkeys_paste_exec(bContext *C, wmOperator *op)
 }
   }
 
+  /* Grease Pencil needs extra update to refresh the added keyframes. */
+  if (ac.datatype == ANIMCONT_GPENCIL) {
+WM_event_add_notifier(C, NC_GPENCIL | ND_DATA, NULL);
+  }
   /* set notifier that keyframes have changed */
   WM_event_add_notifier(C, NC_ANIMATION | ND_KEYFRAME | NA_EDITED, 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] [4cd881c70f2] blender-v2.93-release: Fix T94903: GPencil: Copying keys doesn't preserve Keyframe Type

2022-01-17 Thread Antonio Vazquez
Commit: 4cd881c70f2e325ad30316dfbf5b32d22ba9da3b
Author: Antonio Vazquez
Date:   Fri Jan 14 13:05:50 2022 +0100
Branches: blender-v2.93-release
https://developer.blender.org/rB4cd881c70f2e325ad30316dfbf5b32d22ba9da3b

Fix T94903: GPencil: Copying keys doesn't preserve Keyframe Type

When a new frame is created, ensure the keytype of source key is used.

===

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

===

diff --git a/source/blender/editors/gpencil/editaction_gpencil.c 
b/source/blender/editors/gpencil/editaction_gpencil.c
index 166111c582c..4a53aa83358 100644
--- a/source/blender/editors/gpencil/editaction_gpencil.c
+++ b/source/blender/editors/gpencil/editaction_gpencil.c
@@ -474,6 +474,8 @@ bool ED_gpencil_anim_copybuf_paste(bAnimContext *ac, const 
short offset_mode)
 
   /* get frame to copy data into (if no frame returned, then just ignore) 
*/
   gpf = BKE_gpencil_layer_frame_get(gpld, gpfs->framenum, 
GP_GETFRAME_ADD_NEW);
+  /* Ensure to use same keyframe type. */
+  gpf->key_type = gpfs->key_type;
   if (gpf) {
 bGPDstroke *gps, *gpsn;

___
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] [8e2ee4a3b7c] blender-v2.93-release: Fix T91005: Autosplit produces unusable files

2022-01-17 Thread Richard Antalik
Commit: 8e2ee4a3b7c261aa973001622419e2844a37f0fb
Author: Richard Antalik
Date:   Tue Dec 14 01:16:24 2021 +0100
Branches: blender-v2.93-release
https://developer.blender.org/rB8e2ee4a3b7c261aa973001622419e2844a37f0fb

Fix T91005: Autosplit produces unusable files

Audio PTS was reset for each new file. This caused misalignment of video
and audio streams. In Blender, these files can't be loaded, other
players will fail to align audio and video.

Since timestamps are reset intentionally, reset also video stream
timestamps.

There were other bugs:
After timestamp was reset for audio, write_audio_frames started
encoding from timeline start until target frame, so each split video
had more audio than it should.

Also audio for last frame before splitting was written into new file.

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

===

M   source/blender/blenkernel/intern/writeffmpeg.c

===

diff --git a/source/blender/blenkernel/intern/writeffmpeg.c 
b/source/blender/blenkernel/intern/writeffmpeg.c
index ba1bf88f89f..c0bc5b06fa4 100644
--- a/source/blender/blenkernel/intern/writeffmpeg.c
+++ b/source/blender/blenkernel/intern/writeffmpeg.c
@@ -86,6 +86,7 @@ typedef struct FFMpegContext {
   AVStream *video_stream;
   AVStream *audio_stream;
   AVFrame *current_frame; /* Image frame in output pixel format. */
+  int video_time;
 
   /* Image frame in Blender's own pixel format, may need conversion to the 
output pixel format. */
   AVFrame *img_convert_frame;
@@ -95,6 +96,7 @@ typedef struct FFMpegContext {
   uint8_t *audio_deinterleave_buffer;
   int audio_input_samples;
   double audio_time;
+  double audio_time_total;
   bool audio_deinterleave;
   int audio_sample_size;
 
@@ -317,14 +319,15 @@ static const char **get_file_extensions(int format)
 }
 
 /* Write a frame to the output file */
-static int write_video_frame(FFMpegContext *context, int cfra, AVFrame *frame, 
ReportList *reports)
+static int write_video_frame(FFMpegContext *context, AVFrame *frame, 
ReportList *reports)
 {
   int ret, success = 1;
   AVPacket *packet = av_packet_alloc();
 
   AVCodecContext *c = context->video_codec;
 
-  frame->pts = cfra;
+  frame->pts = context->video_time;
+  context->video_time++;
 
   ret = avcodec_send_frame(c, frame);
   if (ret < 0) {
@@ -798,6 +801,8 @@ static AVStream *alloc_video_stream(FFMpegContext *context,
 
   avcodec_parameters_from_context(st->codecpar, c);
 
+  context->video_time = 0.0f;
+
   return st;
 }
 
@@ -1391,9 +1396,10 @@ static void write_audio_frames(FFMpegContext *context, 
double to_pts)
   AVCodecContext *c = context->audio_codec;
 
   while (context->audio_stream) {
-if ((context->audio_time >= to_pts) || !write_audio_frame(context)) {
+if ((context->audio_time_total >= to_pts) || !write_audio_frame(context)) {
   break;
 }
+context->audio_time_total += (double)context->audio_input_samples / 
(double)c->sample_rate;
 context->audio_time += (double)context->audio_input_samples / 
(double)c->sample_rate;
   }
 }
@@ -1417,22 +1423,23 @@ int BKE_ffmpeg_append(void *context_v,
 
   if (context->video_stream) {
 avframe = generate_video_frame(context, (unsigned char *)pixels);
-success = (avframe && write_video_frame(context, frame - start_frame, 
avframe, reports));
+success = (avframe && write_video_frame(context, avframe, reports));
+#  ifdef WITH_AUDASPACE
+/* Add +1 frame because we want to encode audio up until the next video 
frame. */
+write_audio_frames(
+context, (frame - start_frame + 1) / (((double)rd->frs_sec) / 
(double)rd->frs_sec_base));
+#  endif
 
 if (context->ffmpeg_autosplit) {
   if (avio_tell(context->outfile->pb) > FFMPEG_AUTOSPLIT_SIZE) {
 end_ffmpeg_impl(context, true);
 context->ffmpeg_autosplit_count++;
+
 success &= start_ffmpeg_impl(context, rd, rectx, recty, suffix, 
reports);
   }
 }
   }
 
-#  ifdef WITH_AUDASPACE
-  /* Add +1 frame because we want to encode audio up until the next video 
frame. */
-  write_audio_frames(
-  context, (frame - start_frame + 1) / (((double)rd->frs_sec) / 
(double)rd->frs_sec_base));
-#  endif
   return success;
 }
 
@@ -1872,6 +1879,7 @@ void *BKE_ffmpeg_context_create(void)
   context->ffmpeg_autosplit_count = 0;
   context->ffmpeg_preview = false;
   context->stamp_data = NULL;
+  context->audio_time_total = 0.0;
 
   return 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] [caf362422e4] blender-v2.93-release: Fix crash caused by exception in Python gizmo target get handler

2022-01-17 Thread Campbell Barton
Commit: caf362422e458da5f8b9d8878167165946994fa4
Author: Campbell Barton
Date:   Fri Jan 14 10:16:02 2022 +1100
Branches: blender-v2.93-release
https://developer.blender.org/rBcaf362422e458da5f8b9d8878167165946994fa4

Fix crash caused by exception in Python gizmo target get handler

===

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

===

diff --git a/source/blender/python/intern/bpy_rna_gizmo.c 
b/source/blender/python/intern/bpy_rna_gizmo.c
index ade9516d768..8bf752e0cf1 100644
--- a/source/blender/python/intern/bpy_rna_gizmo.c
+++ b/source/blender/python/intern/bpy_rna_gizmo.c
@@ -103,7 +103,7 @@ fail:
   PyErr_Print();
   PyErr_Clear();
 
-  Py_DECREF(ret);
+  Py_XDECREF(ret);
 
   PyGILState_Release(gilstate);
 }

___
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] [ccb2456df6d] blender-v2.93-release: Fix T94799: GPencil Strokes drawn at 0.0 Strength still visible

2022-01-17 Thread Antonio Vazquez
Commit: ccb2456df6d4aa5113146e57e32be46f648d0efa
Author: Antonio Vazquez
Date:   Tue Jan 11 22:45:21 2022 +0100
Branches: blender-v2.93-release
https://developer.blender.org/rBccb2456df6d4aa5113146e57e32be46f648d0efa

Fix T94799: GPencil Strokes drawn at 0.0 Strength still visible

There was a clamp with a value greater than 0.

===

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

===

diff --git a/source/blender/editors/gpencil/gpencil_paint.c 
b/source/blender/editors/gpencil/gpencil_paint.c
index 1a59eba803d..8d16a275335 100644
--- a/source/blender/editors/gpencil/gpencil_paint.c
+++ b/source/blender/editors/gpencil/gpencil_paint.c
@@ -840,7 +840,7 @@ static short gpencil_stroke_addpoint(tGPsdata *p,
 /* color strength */
 if (brush_settings->flag & GP_BRUSH_USE_STRENGTH_PRESSURE) {
   pt->strength *= 
BKE_curvemapping_evaluateF(brush_settings->curve_strength, 0, pressure);
-  CLAMP(pt->strength, GPENCIL_STRENGTH_MIN, 1.0f);
+  CLAMP(pt->strength, MIN2(GPENCIL_STRENGTH_MIN, 
brush_settings->draw_strength), 1.0f);
 }
 
 /* Set vertex colors for buffer. */
@@ -934,6 +934,7 @@ static void gpencil_stroke_newfrombuffer(tGPsdata *p)
   tGPspoint *ptc;
   MDeformVert *dvert = NULL;
   Brush *brush = p->brush;
+  BrushGpencilSettings *brush_settings = brush->gpencil_settings;
   ToolSettings *ts = p->scene->toolsettings;
   Depsgraph *depsgraph = p->depsgraph;
   Object *obact = (Object *)p->ownerPtr.data;
@@ -1025,7 +1026,7 @@ static void gpencil_stroke_newfrombuffer(tGPsdata *p)
   /* copy pressure and time */
   pt->pressure = ptc->pressure;
   pt->strength = ptc->strength;
-  CLAMP(pt->strength, GPENCIL_STRENGTH_MIN, 1.0f);
+  CLAMP(pt->strength, MIN2(GPENCIL_STRENGTH_MIN, 
brush_settings->draw_strength), 1.0f);
   copy_v4_v4(pt->vert_color, ptc->vert_color);
   pt->time = ptc->time;
   /* Apply the vertex color to point. */
@@ -1059,7 +1060,7 @@ static void gpencil_stroke_newfrombuffer(tGPsdata *p)
   /* copy pressure and time */
   pt->pressure = ptc->pressure;
   pt->strength = ptc->strength;
-  CLAMP(pt->strength, GPENCIL_STRENGTH_MIN, 1.0f);
+  CLAMP(pt->strength, MIN2(GPENCIL_STRENGTH_MIN, 
brush_settings->draw_strength), 1.0f);
   pt->time = ptc->time;
   /* Apply the vertex color to point. */
   ED_gpencil_point_vertex_color_set(ts, brush, pt, ptc);
@@ -1182,7 +1183,7 @@ static void gpencil_stroke_newfrombuffer(tGPsdata *p)
   /* copy pressure and time */
   pt->pressure = ptc->pressure;
   pt->strength = ptc->strength;
-  CLAMP(pt->strength, GPENCIL_STRENGTH_MIN, 1.0f);
+  CLAMP(pt->strength, MIN2(GPENCIL_STRENGTH_MIN, 
brush_settings->draw_strength), 1.0f);
   copy_v4_v4(pt->vert_color, ptc->vert_color);
   pt->time = ptc->time;
   pt->uv_fac = ptc->uv_fac;

___
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] [8b749260fbe] blender-v2.93-release: Fix T94768: Crash in VSE prefetching

2022-01-17 Thread Richard Antalik
Commit: 8b749260fbeb1b2d0b1d462eeacd29a175621dfd
Author: Richard Antalik
Date:   Mon Jan 17 14:03:58 2022 +0100
Branches: blender-v2.93-release
https://developer.blender.org/rB8b749260fbeb1b2d0b1d462eeacd29a175621dfd

Fix T94768: Crash in VSE prefetching

Only the fix part of rBf2fb9a0c59a applied (P2726).

===

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

===

diff --git a/source/blender/sequencer/intern/prefetch.c 
b/source/blender/sequencer/intern/prefetch.c
index 4317fa3a850..e4028b7b642 100644
--- a/source/blender/sequencer/intern/prefetch.c
+++ b/source/blender/sequencer/intern/prefetch.c
@@ -463,7 +463,7 @@ static void *seq_prefetch_frames(void *job)
  */
 pfjob->scene_eval->ed->prefetch_job = pfjob;
 
-ListBase *seqbase = SEQ_active_seqbase_get(SEQ_editing_get(pfjob->scene, 
false));
+ListBase *seqbase = 
SEQ_active_seqbase_get(SEQ_editing_get(pfjob->scene_eval, false));
 if (seq_prefetch_do_skip_frame(pfjob, seqbase)) {
   pfjob->num_frames_prefetched++;
   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] [44ac03785c5] blender-v3.0-release: Fix T94799: GPencil Strokes drawn at 0.0 Strength still visible

2022-01-17 Thread Antonio Vazquez
Commit: 44ac03785c520e2ecf4fe1cb607693958f6d26a9
Author: Antonio Vazquez
Date:   Tue Jan 11 22:45:21 2022 +0100
Branches: blender-v3.0-release
https://developer.blender.org/rB44ac03785c520e2ecf4fe1cb607693958f6d26a9

Fix T94799: GPencil Strokes drawn at 0.0 Strength still visible

There was a clamp with a value greater than 0.

===

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

===

diff --git a/source/blender/editors/gpencil/gpencil_paint.c 
b/source/blender/editors/gpencil/gpencil_paint.c
index 333ae60e84b..4da1a8c34da 100644
--- a/source/blender/editors/gpencil/gpencil_paint.c
+++ b/source/blender/editors/gpencil/gpencil_paint.c
@@ -830,7 +830,7 @@ static short gpencil_stroke_addpoint(tGPsdata *p,
 /* color strength */
 if (brush_settings->flag & GP_BRUSH_USE_STRENGTH_PRESSURE) {
   pt->strength *= 
BKE_curvemapping_evaluateF(brush_settings->curve_strength, 0, pressure);
-  CLAMP(pt->strength, GPENCIL_STRENGTH_MIN, 1.0f);
+  CLAMP(pt->strength, MIN2(GPENCIL_STRENGTH_MIN, 
brush_settings->draw_strength), 1.0f);
 }
 
 /* Set vertex colors for buffer. */
@@ -924,6 +924,7 @@ static void gpencil_stroke_newfrombuffer(tGPsdata *p)
   tGPspoint *ptc;
   MDeformVert *dvert = NULL;
   Brush *brush = p->brush;
+  BrushGpencilSettings *brush_settings = brush->gpencil_settings;
   ToolSettings *ts = p->scene->toolsettings;
   Depsgraph *depsgraph = p->depsgraph;
   Object *obact = (Object *)p->ownerPtr.data;
@@ -1012,7 +1013,7 @@ static void gpencil_stroke_newfrombuffer(tGPsdata *p)
   /* copy pressure and time */
   pt->pressure = ptc->pressure;
   pt->strength = ptc->strength;
-  CLAMP(pt->strength, GPENCIL_STRENGTH_MIN, 1.0f);
+  CLAMP(pt->strength, MIN2(GPENCIL_STRENGTH_MIN, 
brush_settings->draw_strength), 1.0f);
   copy_v4_v4(pt->vert_color, ptc->vert_color);
   pt->time = ptc->time;
   /* Apply the vertex color to point. */
@@ -1046,7 +1047,7 @@ static void gpencil_stroke_newfrombuffer(tGPsdata *p)
   /* copy pressure and time */
   pt->pressure = ptc->pressure;
   pt->strength = ptc->strength;
-  CLAMP(pt->strength, GPENCIL_STRENGTH_MIN, 1.0f);
+  CLAMP(pt->strength, MIN2(GPENCIL_STRENGTH_MIN, 
brush_settings->draw_strength), 1.0f);
   pt->time = ptc->time;
   /* Apply the vertex color to point. */
   ED_gpencil_point_vertex_color_set(ts, brush, pt, ptc);
@@ -1169,7 +1170,7 @@ static void gpencil_stroke_newfrombuffer(tGPsdata *p)
   /* copy pressure and time */
   pt->pressure = ptc->pressure;
   pt->strength = ptc->strength;
-  CLAMP(pt->strength, GPENCIL_STRENGTH_MIN, 1.0f);
+  CLAMP(pt->strength, MIN2(GPENCIL_STRENGTH_MIN, 
brush_settings->draw_strength), 1.0f);
   copy_v4_v4(pt->vert_color, ptc->vert_color);
   pt->time = ptc->time;
   pt->uv_fac = ptc->uv_fac;

___
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] [9600f36cfcb] blender-v3.0-release: Fix T94768: Crash in VSE prefetching

2022-01-17 Thread Richard Antalik
Commit: 9600f36cfcba0bb9182e8fd453b7ef2040f8886a
Author: Richard Antalik
Date:   Mon Jan 17 13:07:21 2022 +0100
Branches: blender-v3.0-release
https://developer.blender.org/rB9600f36cfcba0bb9182e8fd453b7ef2040f8886a

Fix T94768: Crash in VSE prefetching

Only the fix part of rBf2fb9a0c59a applied (P2726).

===

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

===

diff --git a/source/blender/sequencer/intern/prefetch.c 
b/source/blender/sequencer/intern/prefetch.c
index 3e0b4738db1..36fb57a6266 100644
--- a/source/blender/sequencer/intern/prefetch.c
+++ b/source/blender/sequencer/intern/prefetch.c
@@ -491,7 +491,7 @@ static void *seq_prefetch_frames(void *job)
  */
 pfjob->scene_eval->ed->prefetch_job = pfjob;
 
-ListBase *seqbase = SEQ_active_seqbase_get(SEQ_editing_get(pfjob->scene));
+ListBase *seqbase = 
SEQ_active_seqbase_get(SEQ_editing_get(pfjob->scene_eval));
 if (seq_prefetch_must_skip_frame(pfjob, seqbase)) {
   pfjob->num_frames_prefetched++;
   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] [688713db24b] blender-v3.0-release: Fix T94827: Group Input/Output cannot connect to custom sockets

2022-01-17 Thread Philipp Oeser
Commit: 688713db24b1777fac516cb573a9dba8200e51b5
Author: Philipp Oeser
Date:   Wed Jan 12 16:49:49 2022 +0100
Branches: blender-v3.0-release
https://developer.blender.org/rB688713db24b1777fac516cb573a9dba8200e51b5

Fix T94827: Group Input/Output cannot connect to custom sockets

Caused by rBa5c59fb90ef9.

Since Group Input and Output sockets happen to be of type `SOCK_CUSTOM`
[and since rBa5c59fb90ef9 custom py defined sockets are too :)] a check
introduced in rB513066e8ad6f that prevents connections for `SOCK_CUSTOM`
triggered.

Now refine the check, so it specifically looks for NODE_GROUP_INPUT /
NODE_GROUP_OUTPUT, too (this keeps the intention intact to not connect
group inputs to group outputs and vice versa, but allows custom py
defined sockets to connect again) and put it in new utility function.

Maniphest Tasks: T94827

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

===

M   source/blender/nodes/intern/node_common.cc

===

diff --git a/source/blender/nodes/intern/node_common.cc 
b/source/blender/nodes/intern/node_common.cc
index e5ec50858d9..4fcc96470c5 100644
--- a/source/blender/nodes/intern/node_common.cc
+++ b/source/blender/nodes/intern/node_common.cc
@@ -442,6 +442,11 @@ void BKE_node_tree_unlink_id(ID *id, struct bNodeTree 
*ntree)
 /** \name Node #GROUP_INPUT / #GROUP_OUTPUT
  * \{ */
 
+static bool is_group_extension_socket(const bNode *node, const bNodeSocket 
*socket)
+{
+  return socket->type == SOCK_CUSTOM && ELEM(node->type, NODE_GROUP_OUTPUT, 
NODE_GROUP_INPUT);
+}
+
 static void node_group_input_init(bNodeTree *ntree, bNode *node)
 {
   node_group_input_update(ntree, node);
@@ -493,7 +498,7 @@ void node_group_input_update(bNodeTree *ntree, bNode *node)
  * This could be improved by choosing the "best" type among all links,
  * whatever that means.
  */
-if (link->tosock->type != SOCK_CUSTOM) {
+if (!is_group_extension_socket(link->tonode, link->tosock)) {
   exposelink = link;
   break;
 }
@@ -590,7 +595,7 @@ void node_group_output_update(bNodeTree *ntree, bNode *node)
  * This could be improved by choosing the "best" type among all links,
  * whatever that means.
  */
-if (link->fromsock->type != SOCK_CUSTOM) {
+if (!is_group_extension_socket(link->fromnode, link->fromsock)) {
   exposelink = link;
   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] [bcca7bf9755] blender-v3.0-release: Fix T94089: GPencil Drawing don't Update after paste in Dopesheet

2022-01-17 Thread Antonio Vazquez
Commit: bcca7bf9755c0f452559ca7860fbdce2b8611d08
Author: Antonio Vazquez
Date:   Fri Jan 14 13:51:30 2022 +0100
Branches: blender-v3.0-release
https://developer.blender.org/rBbcca7bf9755c0f452559ca7860fbdce2b8611d08

Fix T94089: GPencil Drawing don't Update after paste in Dopesheet

When paste new frames, the datablock need to be tagged to update the drawings.

===

M   source/blender/editors/gpencil/editaction_gpencil.c
M   source/blender/editors/space_action/action_edit.c

===

diff --git a/source/blender/editors/gpencil/editaction_gpencil.c 
b/source/blender/editors/gpencil/editaction_gpencil.c
index 5c4524202db..58f3eba39a4 100644
--- a/source/blender/editors/gpencil/editaction_gpencil.c
+++ b/source/blender/editors/gpencil/editaction_gpencil.c
@@ -46,6 +46,8 @@
 
 #include "WM_api.h"
 
+#include "DEG_depsgraph.h"
+
 /* * */
 /* NOTE ABOUT THIS FILE:
  * This file contains code for editing Grease Pencil data in the Action Editor
@@ -503,6 +505,9 @@ bool ED_gpencil_anim_copybuf_paste(bAnimContext *ac, const 
short offset_mode)
   /* unapply offset from buffer-frame */
   gpfs->framenum -= offset;
 }
+
+/* Tag destination datablock. */
+DEG_id_tag_update(ale->id, ID_RECALC_TRANSFORM | ID_RECALC_GEOMETRY);
   }
 
   /* clean up */
diff --git a/source/blender/editors/space_action/action_edit.c 
b/source/blender/editors/space_action/action_edit.c
index f68446b1cae..184d715a347 100644
--- a/source/blender/editors/space_action/action_edit.c
+++ b/source/blender/editors/space_action/action_edit.c
@@ -642,6 +642,10 @@ static int actkeys_paste_exec(bContext *C, wmOperator *op)
 }
   }
 
+  /* Grease Pencil needs extra update to refresh the added keyframes. */
+  if (ac.datatype == ANIMCONT_GPENCIL) {
+WM_event_add_notifier(C, NC_GPENCIL | ND_DATA, NULL);
+  }
   /* set notifier that keyframes have changed */
   WM_event_add_notifier(C, NC_ANIMATION | ND_KEYFRAME | NA_EDITED, 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] [71bc9d47601] blender-v3.0-release: Fix T94624: Object as font instances don't work

2022-01-17 Thread Hans Goudey
Commit: 71bc9d47601a433ace7073478a2b92acbcaf
Author: Hans Goudey
Date:   Wed Jan 12 13:46:13 2022 -0600
Branches: blender-v3.0-release
https://developer.blender.org/rB71bc9d47601a433ace7073478a2b92acbcaf

Fix T94624: Object as font instances don't work

The fundamental limitation is that we can only have one instance
("dupli") generator at a time. Because the mesh output of a curve
object is output as an instances, the geometry set instances existed,
replacing the object as font instances. The "fix" is to reverse the
order. The behavior won't be perfect still, but at least the old
behavior will be preserved, which is really what matters for a
feature like this.

One way to take this change further would be completely disabling
regular geometry evaluation while this option is active. However,
it doesn't seem like that would actually improve the state of the code.

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

===

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

===

diff --git a/source/blender/blenkernel/intern/object_dupli.cc 
b/source/blender/blenkernel/intern/object_dupli.cc
index 442755be15d..b5a07ae6b08 100644
--- a/source/blender/blenkernel/intern/object_dupli.cc
+++ b/source/blender/blenkernel/intern/object_dupli.cc
@@ -1640,6 +1640,14 @@ static const DupliGenerator *get_dupli_generator(const 
DupliContext *ctx)
 return nullptr;
   }
 
+  /* Give "Object as Font" instances higher priority than geometry set 
instances, to retain
+   * the behavior from before curve object meshes were processed as instances 
internally. */
+  if (transflag & OB_DUPLIVERTS) {
+if (ctx->object->type == OB_FONT) {
+  return &gen_dupli_verts_font;
+}
+  }
+
   if (ctx->object->runtime.geometry_set_eval != nullptr) {
 if (BKE_object_has_geometry_set_instances(ctx->object)) {
   return &gen_dupli_geometry_set;
@@ -1653,9 +1661,6 @@ static const DupliGenerator *get_dupli_generator(const 
DupliContext *ctx)
 if (ctx->object->type == OB_MESH) {
   return &gen_dupli_verts;
 }
-if (ctx->object->type == OB_FONT) {
-  return &gen_dupli_verts_font;
-}
 if (ctx->object->type == OB_POINTCLOUD) {
   return &gen_dupli_verts_pointcloud;
 }

___
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] [5079a460a74] blender-v3.0-release: Fix T94878: LineArt crease threshold logic error.

2022-01-17 Thread YimingWu
Commit: 5079a460a748911043d9a8cd41f7e266ba2b79bb
Author: YimingWu
Date:   Fri Jan 14 21:42:52 2022 +0800
Branches: blender-v3.0-release
https://developer.blender.org/rB5079a460a748911043d9a8cd41f7e266ba2b79bb

Fix T94878: LineArt crease threshold logic error.

A coding mistake allows default crease to override object crease, 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 f417bfd6fe3..d5344048bc6 100644
--- a/source/blender/gpencil_modifiers/intern/lineart/lineart_cpu.c
+++ b/source/blender/gpencil_modifiers/intern/lineart/lineart_cpu.c
@@ -1770,7 +1770,7 @@ static void 
lineart_geometry_object_load(LineartObjectInfo *obi, LineartRenderBu
   if (orig_ob->lineart.flags & OBJECT_LRT_OWN_CREASE) {
 use_crease = cosf(M_PI - orig_ob->lineart.crease_threshold);
   }
-  if (obi->original_me->flag & ME_AUTOSMOOTH) {
+  else if (obi->original_me->flag & ME_AUTOSMOOTH) {
 use_crease = cosf(obi->original_me->smoothresh);
 use_auto_smooth = 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] [40c5786df33] blender-v3.0-release: Fix crash caused by exception in Python gizmo target get handler

2022-01-17 Thread Campbell Barton
Commit: 40c5786df3309b82e358cc8935fc373b56833fb4
Author: Campbell Barton
Date:   Fri Jan 14 10:16:02 2022 +1100
Branches: blender-v3.0-release
https://developer.blender.org/rB40c5786df3309b82e358cc8935fc373b56833fb4

Fix crash caused by exception in Python gizmo target get handler

===

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

===

diff --git a/source/blender/python/intern/bpy_rna_gizmo.c 
b/source/blender/python/intern/bpy_rna_gizmo.c
index e4fb5b33e97..e769fe7f4c2 100644
--- a/source/blender/python/intern/bpy_rna_gizmo.c
+++ b/source/blender/python/intern/bpy_rna_gizmo.c
@@ -201,7 +201,7 @@ fail:
   PyErr_Print();
   PyErr_Clear();
 
-  Py_DECREF(ret);
+  Py_XDECREF(ret);
 
   PyGILState_Release(gilstate);
 }

___
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] [d7a1fc0868f] blender-v3.0-release: Fix T94903: GPencil: Copying keys doesn't preserve Keyframe Type

2022-01-17 Thread Antonio Vazquez
Commit: d7a1fc0868f17f2652311488dcfe39946eef134b
Author: Antonio Vazquez
Date:   Fri Jan 14 13:05:50 2022 +0100
Branches: blender-v3.0-release
https://developer.blender.org/rBd7a1fc0868f17f2652311488dcfe39946eef134b

Fix T94903: GPencil: Copying keys doesn't preserve Keyframe Type

When a new frame is created, ensure the keytype of source key is used.

===

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

===

diff --git a/source/blender/editors/gpencil/editaction_gpencil.c 
b/source/blender/editors/gpencil/editaction_gpencil.c
index fbdb7c8e520..5c4524202db 100644
--- a/source/blender/editors/gpencil/editaction_gpencil.c
+++ b/source/blender/editors/gpencil/editaction_gpencil.c
@@ -474,6 +474,8 @@ bool ED_gpencil_anim_copybuf_paste(bAnimContext *ac, const 
short offset_mode)
 
   /* get frame to copy data into (if no frame returned, then just ignore) 
*/
   gpf = BKE_gpencil_layer_frame_get(gpld, gpfs->framenum, 
GP_GETFRAME_ADD_NEW);
+  /* Ensure to use same keyframe type. */
+  gpf->key_type = gpfs->key_type;
   if (gpf) {
 bGPDstroke *gps, *gpsn;

___
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] [1d462e17298] blender-v3.0-release: Fix T92953: Tool Settings: Drag on Tweak fails with LMB select

2022-01-17 Thread Campbell Barton
Commit: 1d462e172981671f9d023f2a37fdb0f2c1055b4d
Author: Campbell Barton
Date:   Thu Jan 13 14:30:12 2022 +1100
Branches: blender-v3.0-release
https://developer.blender.org/rB1d462e172981671f9d023f2a37fdb0f2c1055b4d

Fix T92953: Tool Settings: Drag on Tweak fails with LMB select

===

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

===

diff --git a/release/scripts/presets/keyconfig/keymap_data/blender_default.py 
b/release/scripts/presets/keyconfig/keymap_data/blender_default.py
index 6a837e64b78..1eb5355a274 100644
--- a/release/scripts/presets/keyconfig/keymap_data/blender_default.py
+++ b/release/scripts/presets/keyconfig/keymap_data/blender_default.py
@@ -6258,7 +6258,8 @@ def km_image_editor_tool_uv_select(params, *, fallback):
 _fallback_id("Image Editor Tool: Uv, Tweak", fallback),
 {"space_type": 'IMAGE_EDITOR', "region_type": 'WINDOW'},
 {"items": [
-*([] if fallback else _template_items_tool_select(params, 
"uv.select", "uv.cursor_set", extend="extend")),
+*([] if (fallback and (params.select_mouse == 'RIGHTMOUSE')) else 
_template_items_tool_select(
+params, "uv.select", "uv.cursor_set", extend="extend")),
 *([] if (not params.use_fallback_tool_rmb) else 
_template_uv_select(
 type=params.select_mouse, value=params.select_mouse_value, 
legacy=params.legacy)),
 ]},
@@ -6376,7 +6377,7 @@ def km_node_editor_tool_select(params, *, fallback):
 _fallback_id("Node Tool: Tweak", fallback),
 {"space_type": 'NODE_EDITOR', "region_type": 'WINDOW'},
 {"items": [
-*([] if fallback else [
+*([] if (fallback and (params.select_mouse == 'RIGHTMOUSE')) else [
 ("node.select", {"type": params.select_mouse, "value": 
'PRESS'},
  {"properties": [("deselect_all", not params.legacy)]}),
 ]),
@@ -6458,7 +6459,7 @@ def km_3d_view_tool_select(params, *, fallback):
 _fallback_id("3D View Tool: Tweak", fallback),
 {"space_type": 'VIEW_3D', "region_type": 'WINDOW'},
 {"items": [
-*([] if fallback else _template_items_tool_select(
+*([] if (fallback and (params.select_mouse == 'RIGHTMOUSE')) else 
_template_items_tool_select(
 params, "view3d.select", "view3d.cursor3d", extend="toggle")),
 *([] if (not params.use_fallback_tool_rmb) else 
_template_view3d_select(
 type=params.select_mouse, value=params.select_mouse_value, 
legacy=params.legacy)),
@@ -7368,7 +7369,7 @@ def km_3d_view_tool_edit_gpencil_select(params, *, 
fallback):
 _fallback_id("3D View Tool: Edit Gpencil, Tweak", fallback),
 {"space_type": 'VIEW_3D', "region_type": 'WINDOW'},
 {"items": [
-*([] if fallback else _template_items_tool_select(
+*([] if (fallback and (params.select_mouse == 'RIGHTMOUSE')) else 
_template_items_tool_select(
 params, "gpencil.select", "view3d.cursor3d", extend="toggle")),
 *([] if (not params.use_fallback_tool_rmb) else 
_template_view3d_gpencil_select(
 type=params.select_mouse, value=params.select_mouse_value, 
legacy=params.legacy)),
@@ -7544,7 +7545,7 @@ def km_sequencer_editor_tool_generic_select(params, *, 
fallback):
 _fallback_id("Sequencer Tool: Tweak", fallback),
 {"space_type": 'SEQUENCE_EDITOR', "region_type": 'WINDOW'},
 {"items": [
-*([] if fallback else _template_items_tool_select(
+*([] if (fallback and (params.select_mouse == 'RIGHTMOUSE')) else 
_template_items_tool_select(
 params, "sequencer.select", "sequencer.cursor_set", 
extend="toggle")),
 
 *([] if (not params.use_fallback_tool_rmb) else 
_template_sequencer_preview_select(

___
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] [be08d432cd4] tmp-gpu-shader-descriptor-2: Enabled migrated workbench shaders.

2022-01-17 Thread Jeroen Bakker
Commit: be08d432cd4f7f0d7e2587b907954bf112baa824
Author: Jeroen Bakker
Date:   Mon Jan 17 12:54:17 2022 +0100
Branches: tmp-gpu-shader-descriptor-2
https://developer.blender.org/rBbe08d432cd4f7f0d7e2587b907954bf112baa824

Enabled migrated workbench shaders.

===

M   source/blender/draw/engines/workbench/shaders/workbench_cavity_lib.glsl
M   source/blender/gpu/CMakeLists.txt

===

diff --git 
a/source/blender/draw/engines/workbench/shaders/workbench_cavity_lib.glsl 
b/source/blender/draw/engines/workbench/shaders/workbench_cavity_lib.glsl
index 9038aae533b..13265800cbb 100644
--- a/source/blender/draw/engines/workbench/shaders/workbench_cavity_lib.glsl
+++ b/source/blender/draw/engines/workbench/shaders/workbench_cavity_lib.glsl
@@ -3,12 +3,14 @@
 #pragma BLENDER_REQUIRE(workbench_data_lib.glsl)
 #pragma BLENDER_REQUIRE(workbench_common_lib.glsl)
 
+#ifndef USE_GPU_SHADER_CREATE_INFO
 layout(std140) uniform samples_block
 {
   vec4 samples_coords[512];
 };
 
 uniform sampler2D cavityJitter;
+#endif
 
 /*  From The Alchemy screen-space ambient obscurance algorithm
  * http://graphics.cs.williams.edu/papers/AlchemyHPG11/VV11AlchemyAO.pdf */
diff --git a/source/blender/gpu/CMakeLists.txt 
b/source/blender/gpu/CMakeLists.txt
index a525986e1cd..7090f5096fe 100644
--- a/source/blender/gpu/CMakeLists.txt
+++ b/source/blender/gpu/CMakeLists.txt
@@ -402,7 +402,7 @@ list(APPEND INC ${CMAKE_CURRENT_BINARY_DIR})
 
 set(SHADER_CREATE_INFOS
 #../draw/engines/workbench/shaders/workbench_effect_cavity_info.hh
-#../draw/engines/workbench/shaders/workbench_prepass_info.hh
+../draw/engines/workbench/shaders/workbench_prepass_info.hh
 ../draw/intern/shaders/draw_fullscreen_info.hh
 ../draw/intern/shaders/draw_view_info.hh
 ../draw/intern/shaders/draw_object_infos_info.hh

___
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] [04feaa8bd05] master: Core: Library Remap test cases.

2022-01-17 Thread Jeroen Bakker
Commit: 04feaa8bd0569a5453bec7a282f3f4a593eeb6ff
Author: Jeroen Bakker
Date:   Mon Jan 17 12:44:55 2022 +0100
Branches: master
https://developer.blender.org/rB04feaa8bd0569a5453bec7a282f3f4a593eeb6ff

Core: Library Remap test cases.

For an upcoming refactoring of library remapping we want to be able to test if 
the logic won't change.
It also increased my experience inside the remapping codebase and find out what 
exactly needed to
be refactored.

This patch adds test cases for the core functionality of 
`foreach_libblock_remap_callback`. The test cases
don't cover of all the branches. Also pre-, post-processing, referencing and 
proxies are not tested.

Reviewed By: mont29

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

===

M   source/blender/blenkernel/CMakeLists.txt
A   source/blender/blenkernel/intern/lib_remap_test.cc

===

diff --git a/source/blender/blenkernel/CMakeLists.txt 
b/source/blender/blenkernel/CMakeLists.txt
index 4449a1bce62..7f8a917e002 100644
--- a/source/blender/blenkernel/CMakeLists.txt
+++ b/source/blender/blenkernel/CMakeLists.txt
@@ -819,6 +819,7 @@ if(WITH_GTESTS)
 intern/lattice_deform_test.cc
 intern/layer_test.cc
 intern/lib_id_test.cc
+intern/lib_remap_test.cc
 intern/tracking_test.cc
   )
   set(TEST_INC
diff --git a/source/blender/blenkernel/intern/lib_remap_test.cc 
b/source/blender/blenkernel/intern/lib_remap_test.cc
new file mode 100644
index 000..f803e600787
--- /dev/null
+++ b/source/blender/blenkernel/intern/lib_remap_test.cc
@@ -0,0 +1,369 @@
+/*
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ * The Original Code is Copyright (C) 2022 by Blender Foundation.
+ */
+#include "testing/testing.h"
+
+#include "BLI_utildefines.h"
+
+#include "CLG_log.h"
+
+#include "DNA_mesh_types.h"
+#include "DNA_node_types.h"
+#include "DNA_object_types.h"
+#include "DNA_scene_types.h"
+
+#include "RNA_define.h"
+
+#include "BKE_appdir.h"
+#include "BKE_context.h"
+#include "BKE_global.h"
+#include "BKE_idtype.h"
+#include "BKE_lib_id.h"
+#include "BKE_lib_remap.h"
+#include "BKE_main.h"
+#include "BKE_mesh.h"
+#include "BKE_node.h"
+#include "BKE_object.h"
+#include "BKE_scene.h"
+
+#include "IMB_imbuf.h"
+
+#include "ED_node.h"
+
+#include "MEM_guardedalloc.h"
+
+namespace blender::bke::tests {
+
+class TestData {
+ public:
+  Main *bmain = nullptr;
+  struct bContext *C = nullptr;
+
+  virtual void setup()
+  {
+if (bmain == nullptr) {
+  bmain = BKE_main_new();
+  G.main = bmain;
+}
+
+if (C == nullptr) {
+  C = CTX_create();
+  CTX_data_main_set(C, bmain);
+}
+  }
+
+  virtual void teardown()
+  {
+if (bmain != nullptr) {
+  BKE_main_free(bmain);
+  bmain = nullptr;
+  G.main = nullptr;
+}
+
+if (C != nullptr) {
+  CTX_free(C);
+  C = nullptr;
+}
+  }
+};
+
+class SceneTestData : public TestData {
+ public:
+  Scene *scene = nullptr;
+  void setup() override
+  {
+TestData::setup();
+scene = BKE_scene_add(bmain, "IDRemapScene");
+CTX_data_scene_set(C, scene);
+  }
+};
+
+class CompositorTestData : public SceneTestData {
+ public:
+  bNodeTree *compositor_nodetree = nullptr;
+  void setup() override
+  {
+SceneTestData::setup();
+ED_node_composit_default(C, scene);
+compositor_nodetree = scene->nodetree;
+  }
+};
+
+class MeshTestData : public TestData {
+ public:
+  Mesh *mesh = nullptr;
+
+  void setup() override
+  {
+TestData::setup();
+mesh = BKE_mesh_add(bmain, nullptr);
+  }
+};
+
+class TwoMeshesTestData : public MeshTestData {
+ public:
+  Mesh *other_mesh = nullptr;
+
+  void setup() override
+  {
+MeshTestData::setup();
+other_mesh = BKE_mesh_add(bmain, nullptr);
+  }
+};
+
+class MeshObjectTestData : public MeshTestData {
+ public:
+  Object *object;
+  void setup() override
+  {
+MeshTestData::setup();
+
+object = BKE_object_add_only_object(bmain, OB_MESH, nullptr);
+object->data = mesh;
+  }
+};
+
+template class Context {
+ public:
+  TestData test_data;
+
+  Context()
+  {
+CLG_init();
+BKE_idtype_init();
+RNA_init();
+BKE_node_system_init();
+BKE_appdir_init();
+IMB_init();

[Bf-blender-cvs] [883923173ab] asset-greasepencil: Safe checking of pointers of material

2022-01-17 Thread Antonio Vazquez
Commit: 883923173ab537fd4a154f7c0c2e13ad44c556e6
Author: Antonio Vazquez
Date:   Mon Jan 17 11:52:56 2022 +0100
Branches: asset-greasepencil
https://developer.blender.org/rB883923173ab537fd4a154f7c0c2e13ad44c556e6

Safe checking of pointers of material

===

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

===

diff --git a/source/blender/editors/gpencil/gpencil_asset.c 
b/source/blender/editors/gpencil/gpencil_asset.c
index 2c71684dc2e..a487061937f 100644
--- a/source/blender/editors/gpencil/gpencil_asset.c
+++ b/source/blender/editors/gpencil/gpencil_asset.c
@@ -1032,6 +1032,10 @@ static bool gpencil_asset_append_strokes(tGPDasset *tgpa)
 
   /* Loop all strokes and duplicate. */
   LISTBASE_FOREACH (bGPDstroke *, gps_asset, &gpf_asset->strokes) {
+if (gps_asset->mat_nr == -1) {
+  continue;
+}
+
 bGPDstroke *gps_target = BKE_gpencil_stroke_duplicate(gps_asset, true, 
true);
 gps_target->next = gps_target->prev = NULL;
 gps_target->flag &= ~GP_STROKE_SELECT;
@@ -1041,8 +1045,9 @@ static bool gpencil_asset_append_strokes(tGPDasset *tgpa)
 Material *ma_src = 
gpencil_asset_material_get_from_id(&tgpa->gpd_asset->id,
   
gps_asset->mat_nr);
 
-int mat_index = BKE_gpencil_object_material_index_get_by_name(tgpa->ob,
-  
ma_src->id.name + 2);
+int mat_index = (ma_src != NULL) ? 
BKE_gpencil_object_material_index_get_by_name(
+   tgpa->ob, ma_src->id.name + 2) :
+   -1;
 bool is_new_mat = false;
 if (mat_index == -1) {
   const int totcolors = tgpa->ob->totcol;

___
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] [93244ec3366] asset-greasepencil: Fix crash importing due wrong active frame pointer

2022-01-17 Thread Antonio Vazquez
Commit: 93244ec3366f55e462e52963fd3fa808fe1e2c14
Author: Antonio Vazquez
Date:   Mon Jan 17 12:25:29 2022 +0100
Branches: asset-greasepencil
https://developer.blender.org/rB93244ec3366f55e462e52963fd3fa808fe1e2c14

Fix crash importing due wrong active frame pointer

The active frame was not NULL and this linked the frame with the asset frame 
instead of target frame.

===

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

===

diff --git a/source/blender/editors/gpencil/gpencil_asset.c 
b/source/blender/editors/gpencil/gpencil_asset.c
index a487061937f..3d94adf3791 100644
--- a/source/blender/editors/gpencil/gpencil_asset.c
+++ b/source/blender/editors/gpencil/gpencil_asset.c
@@ -998,6 +998,7 @@ static bool gpencil_asset_append_strokes(tGPDasset *tgpa)
 if (gpl_target == NULL) {
   gpl_target = BKE_gpencil_layer_duplicate(gpl_asset, false, false);
   BLI_assert(gpl_target != NULL);
+  gpl_target->actframe = NULL;
   BLI_listbase_clear(&gpl_target->frames);
   BLI_addtail(&gpd_target->layers, gpl_target);
   is_new_gpl = 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] [4fcc9b146c9] asset-greasepencil: Merge branch 'master' into asset-greasepencil

2022-01-17 Thread Antonio Vazquez
Commit: 4fcc9b146c952bc25b7d4175f64e4772b5e6be09
Author: Antonio Vazquez
Date:   Mon Jan 17 10:38:29 2022 +0100
Branches: asset-greasepencil
https://developer.blender.org/rB4fcc9b146c952bc25b7d4175f64e4772b5e6be09

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] [e15449623d1] master: InstallDeps: Increase 'MEX' version of llvm to 14.

2022-01-17 Thread Bastien Montagne
Commit: e15449623d13454f04292445539e5f77fdb258fc
Author: Bastien Montagne
Date:   Mon Jan 17 10:33:02 2022 +0100
Branches: master
https://developer.blender.org/rBe15449623d13454f04292445539e5f77fdb258fc

InstallDeps: Increase 'MEX' version of llvm to 14.

llvm 13 is now default on debian testing, tried it quickly and it seems
to work fine, so raising exclusive maximum value for it to 14.

===

M   build_files/build_environment/install_deps.sh

===

diff --git a/build_files/build_environment/install_deps.sh 
b/build_files/build_environment/install_deps.sh
index bf24c3ef285..ce7a251bfba 100755
--- a/build_files/build_environment/install_deps.sh
+++ b/build_files/build_environment/install_deps.sh
@@ -492,7 +492,7 @@ OIIO_SKIP=false
 LLVM_VERSION="12.0.0"
 LLVM_VERSION_SHORT="12.0"
 LLVM_VERSION_MIN="11.0"
-LLVM_VERSION_MEX="13.0"
+LLVM_VERSION_MEX="14.0"
 LLVM_VERSION_FOUND=""
 LLVM_FORCE_BUILD=false
 LLVM_FORCE_REBUILD=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] [94b4ab6a162] lineart-shadow: Merge branch 'temp-lineart-contained' into lineart-shadow

2022-01-17 Thread YimingWu
Commit: 94b4ab6a162adf2e7fc4276daaa5436b9b066b5b
Author: YimingWu
Date:   Mon Jan 17 17:29:21 2022 +0800
Branches: lineart-shadow
https://developer.blender.org/rB94b4ab6a162adf2e7fc4276daaa5436b9b066b5b

Merge branch 'temp-lineart-contained' into lineart-shadow

===



===

diff --cc source/blender/gpencil_modifiers/intern/lineart/lineart_cpu.c
index dc484f111cb,1dddb835c50..bec20f590c7
--- a/source/blender/gpencil_modifiers/intern/lineart/lineart_cpu.c
+++ b/source/blender/gpencil_modifiers/intern/lineart/lineart_cpu.c
@@@ -3353,16 -3285,6 +3355,10 @@@ static LineartRenderBuffer *lineart_cre
rb->use_loose = (edge_types & LRT_EDGE_FLAG_LOOSE) != 0;
rb->use_light_contour = ((edge_types & LRT_EDGE_FLAG_LIGHT_CONTOUR) != 0 &&
 (lmd->light_contour_object != NULL));
 +  rb->use_shadow = ((edge_types & LRT_EDGE_FLAG_PROJECTED_SHADOW) != 0 &&
 +(lmd->light_contour_object != NULL));
 +
 +  rb->use_back_face_culling = (lmd->calculation_flags & 
LRT_USE_BACK_FACE_CULLING) != 0;
-   if (rb->max_occlusion_level < 1 && !rb->use_shadow) {
- rb->use_back_face_culling = true;
- if (G.debug_value == 4000) {
-   printf("Backface culling enabled automatically.\n");
- }
-   }
  
rb->filter_face_mark_invert = (lmd->calculation_flags & 
LRT_FILTER_FACE_MARK_INVERT) != 0;
rb->filter_face_mark = (lmd->calculation_flags & LRT_FILTER_FACE_MARK) != 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] [bf6677fecb8] temp-lineart-contained: LineArt: Preserve details option for noise tolerant chaining.

2022-01-17 Thread YimingWu
Commit: bf6677fecb83e4354d29891e8c330e03732059ea
Author: YimingWu
Date:   Mon Jan 17 10:18:45 2022 +0800
Branches: temp-lineart-contained
https://developer.blender.org/rBbf6677fecb83e4354d29891e8c330e03732059ea

LineArt: Preserve details option for noise tolerant chaining.

Added such option to control whether to show zig-zags.

===

M   source/blender/gpencil_modifiers/intern/MOD_gpencillineart.c
M   source/blender/gpencil_modifiers/intern/lineart/MOD_lineart.h
M   source/blender/gpencil_modifiers/intern/lineart/lineart_chain.c
M   source/blender/gpencil_modifiers/intern/lineart/lineart_cpu.c
M   source/blender/makesdna/DNA_lineart_types.h
M   source/blender/makesrna/intern/rna_gpencil_modifier.c

===

diff --git a/source/blender/gpencil_modifiers/intern/MOD_gpencillineart.c 
b/source/blender/gpencil_modifiers/intern/MOD_gpencillineart.c
index 401eac201ea..822170fb3fe 100644
--- a/source/blender/gpencil_modifiers/intern/MOD_gpencillineart.c
+++ b/source/blender/gpencil_modifiers/intern/MOD_gpencillineart.c
@@ -641,6 +641,8 @@ static void chaining_panel_draw(const bContext *UNUSED(C), 
Panel *panel)
 
   uiItemR(col, ptr, "use_loose_edge_chain", 0, IFACE_("Loose Edges"), 
ICON_NONE);
   uiItemR(col, ptr, "use_loose_as_contour", 0, IFACE_("Loose Edges As 
Contour"), ICON_NONE);
+
+  uiItemR(col, ptr, "use_detail_preserve", 0, NULL, ICON_NONE);
   uiItemR(col, ptr, "use_geometry_space_chain", 0, IFACE_("Geometry Space"), 
ICON_NONE);
 
   uiItemR(layout,
diff --git a/source/blender/gpencil_modifiers/intern/lineart/MOD_lineart.h 
b/source/blender/gpencil_modifiers/intern/lineart/MOD_lineart.h
index 14f85a3dc5d..30ff0a314fa 100644
--- a/source/blender/gpencil_modifiers/intern/lineart/MOD_lineart.h
+++ b/source/blender/gpencil_modifiers/intern/lineart/MOD_lineart.h
@@ -317,6 +317,8 @@ typedef struct LineartRenderBuffer {
   bool force_crease;
   bool sharp_as_crease;
 
+  bool chain_preserve_details;
+
   /* Keep an copy of these data so when line art is running it's 
self-contained. */
   bool cam_is_persp;
   float cam_obmat[4][4];
diff --git a/source/blender/gpencil_modifiers/intern/lineart/lineart_chain.c 
b/source/blender/gpencil_modifiers/intern/lineart/lineart_chain.c
index 3316a4921f3..ebed50b2b62 100644
--- a/source/blender/gpencil_modifiers/intern/lineart/lineart_chain.c
+++ b/source/blender/gpencil_modifiers/intern/lineart/lineart_chain.c
@@ -571,8 +571,10 @@ static void 
lineart_bounding_area_link_chain(LineartRenderBuffer *rb, LineartEdg
   }
 }
 
-static bool lineart_chain_try_skip_noise(LineartEdgeChainItem 
*last_matching_eci,
+static bool lineart_chain_try_skip_noise(LineartEdgeChain *ec,
+ LineartEdgeChainItem 
*last_matching_eci,
  float distance_threshold,
+ bool preserve_details,
  LineartEdgeChainItem **r_next_eci)
 {
   float dist_accum = 0;
@@ -598,11 +600,21 @@ static bool 
lineart_chain_try_skip_noise(LineartEdgeChainItem *last_matching_eci
 }
   }
   if (can_skip_to) {
-/* Mark all in-between segments with the same occlusion and mask. */
-for (LineartEdgeChainItem *eci = last_matching_eci->next; eci != 
can_skip_to;
- eci = eci->next) {
-  eci->material_mask_bits = fixed_mask;
-  eci->occlusion = fixed_occ;
+/* Either mark all in-between segments with the same occlusion and mask or 
delete those
+ * different ones. */
+LineartEdgeChainItem *next_eci;
+for (LineartEdgeChainItem *eci = last_matching_eci->next; eci != 
can_skip_to; eci = next_eci) {
+  next_eci = eci->next;
+  if (eci->material_mask_bits == fixed_mask && eci->occlusion == 
fixed_occ) {
+continue;
+  }
+  if (preserve_details) {
+eci->material_mask_bits = fixed_mask;
+eci->occlusion = fixed_occ;
+  }
+  else {
+BLI_remlink(&ec->chain, eci);
+  }
 }
 *r_next_eci = can_skip_to;
 return true;
@@ -641,7 +653,11 @@ void 
MOD_lineart_chain_split_for_fixed_occlusion(LineartRenderBuffer *rb)
   if (lineart_point_overlapping(next_eci, eci->pos[0], eci->pos[1], 
1e-5)) {
 continue;
   }
-  if (lineart_chain_try_skip_noise(eci->prev, 
rb->chaining_image_threshold, &next_eci)) {
+  if (lineart_chain_try_skip_noise(ec,
+   eci->prev,
+   rb->chaining_image_threshold,
+   rb->chain_preserve_details,
+   &next_eci)) {
 continue;
   }
 }
diff --git a/source/blender/gpencil_modifiers/intern/lineart/lineart_cpu.c 
b/source/blender/gpencil_modifiers/intern/lineart/lineart_cpu.c
index 167b97ed3

[Bf-blender-cvs] [40c8e23d481] master: LineArt: Invert collection option.

2022-01-17 Thread YimingWu
Commit: 40c8e23d481cbee683ea890a6bf49129e7fcf5df
Author: YimingWu
Date:   Mon Jan 17 17:20:47 2022 +0800
Branches: master
https://developer.blender.org/rB40c8e23d481cbee683ea890a6bf49129e7fcf5df

LineArt: Invert collection option.

Allows conveniently selecting an inverse of a collection.

Reviewed By: Antonio Vazquez (antoniov)

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

===

M   source/blender/gpencil_modifiers/intern/MOD_gpencillineart.c
M   source/blender/gpencil_modifiers/intern/lineart/lineart_cpu.c
M   source/blender/makesdna/DNA_gpencil_modifier_types.h
M   source/blender/makesrna/intern/rna_gpencil_modifier.c

===

diff --git a/source/blender/gpencil_modifiers/intern/MOD_gpencillineart.c 
b/source/blender/gpencil_modifiers/intern/MOD_gpencillineart.c
index b35ebd4be9a..59937bb0757 100644
--- a/source/blender/gpencil_modifiers/intern/MOD_gpencillineart.c
+++ b/source/blender/gpencil_modifiers/intern/MOD_gpencillineart.c
@@ -314,7 +314,9 @@ static void panel_draw(const bContext *UNUSED(C), Panel 
*panel)
 uiItemR(layout, ptr, "source_object", 0, NULL, ICON_OBJECT_DATA);
   }
   else if (source_type == LRT_SOURCE_COLLECTION) {
-uiItemR(layout, ptr, "source_collection", 0, NULL, 
ICON_OUTLINER_COLLECTION);
+uiLayout *sub = uiLayoutRow(layout, true);
+uiItemR(sub, ptr, "source_collection", 0, NULL, ICON_OUTLINER_COLLECTION);
+uiItemR(sub, ptr, "use_invert_collection", 0, "", ICON_ARROW_LEFTRIGHT);
   }
   else {
 /* Source is Scene. */
diff --git a/source/blender/gpencil_modifiers/intern/lineart/lineart_cpu.c 
b/source/blender/gpencil_modifiers/intern/lineart/lineart_cpu.c
index f08d35891ce..5461b80cad1 100644
--- a/source/blender/gpencil_modifiers/intern/lineart/lineart_cpu.c
+++ b/source/blender/gpencil_modifiers/intern/lineart/lineart_cpu.c
@@ -4363,8 +4363,15 @@ static void lineart_gpencil_generate(LineartCache *cache,
   continue;
 }
 if (orig_col && ec->object_ref) {
-  if (!BKE_collection_has_object_recursive_instanced(orig_col, (Object 
*)ec->object_ref)) {
-continue;
+  if (BKE_collection_has_object_recursive_instanced(orig_col, (Object 
*)ec->object_ref)) {
+if (modifier_flags & LRT_GPENCIL_INVERT_COLLECTION) {
+  continue;
+}
+  }
+  else {
+if (!(modifier_flags & LRT_GPENCIL_INVERT_COLLECTION)) {
+  continue;
+}
   }
 }
 if (mask_switches & LRT_GPENCIL_MATERIAL_MASK_ENABLE) {
diff --git a/source/blender/makesdna/DNA_gpencil_modifier_types.h 
b/source/blender/makesdna/DNA_gpencil_modifier_types.h
index 0f69a256f56..b361372ff8b 100644
--- a/source/blender/makesdna/DNA_gpencil_modifier_types.h
+++ b/source/blender/makesdna/DNA_gpencil_modifier_types.h
@@ -989,6 +989,7 @@ typedef enum eLineArtGPencilModifierFlags {
   LRT_GPENCIL_IS_BAKED = (1 << 3),
   LRT_GPENCIL_USE_CACHE = (1 << 4),
   LRT_GPENCIL_OFFSET_TOWARDS_CUSTOM_CAMERA = (1 << 5),
+  LRT_GPENCIL_INVERT_COLLECTION = (1 << 6),
 } eLineArtGPencilModifierFlags;
 
 typedef enum eLineartGpencilMaskSwitches {
diff --git a/source/blender/makesrna/intern/rna_gpencil_modifier.c 
b/source/blender/makesrna/intern/rna_gpencil_modifier.c
index e06aac31124..086da4c31ba 100644
--- a/source/blender/makesrna/intern/rna_gpencil_modifier.c
+++ b/source/blender/makesrna/intern/rna_gpencil_modifier.c
@@ -3446,6 +3446,13 @@ static void rna_def_modifier_gpencillineart(BlenderRNA 
*brna)
   "Trim all edges right at the boundary of image(including overscan 
region)");
   RNA_def_property_update(prop, 0, "rna_GpencilModifier_update");
 
+  prop = RNA_def_property(srna, "use_invert_collection", PROP_BOOLEAN, 
PROP_NONE);
+  RNA_def_property_boolean_sdna(prop, NULL, "flags", 
LRT_GPENCIL_INVERT_COLLECTION);
+  RNA_def_property_ui_text(prop,
+   "Invert Collection Filtering",
+   "Select everything except lines from specified 
collection");
+  RNA_def_property_update(prop, 0, "rna_GpencilModifier_update");
+
   RNA_define_lib_overridable(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