[Bf-blender-cvs] [8c194e1ba6a] master: Cleanup: format

2022-12-28 Thread Chris Blackbourn
Commit: 8c194e1ba6aefa0cffafcc7edccb47f8ba8589c0
Author: Chris Blackbourn
Date:   Thu Dec 29 20:49:08 2022 +1300
Branches: master
https://developer.blender.org/rB8c194e1ba6aefa0cffafcc7edccb47f8ba8589c0

Cleanup: format

===

M   source/blender/blenkernel/BKE_image_partial_update.hh
M   source/blender/editors/mesh/editmesh_mask_extract.c
M   source/blender/gpencil_modifiers/intern/lineart/lineart_shadow.c
M   source/blender/gpu/intern/gpu_codegen.cc
M   source/blender/modifiers/intern/MOD_util.cc
M   source/blender/nodes/intern/node_socket.cc
M   source/blender/nodes/texture/node_texture_util.cc
M   tests/python/bl_blendfile_io.py
M   tests/python/modifiers.py

===

diff --git a/source/blender/blenkernel/BKE_image_partial_update.hh 
b/source/blender/blenkernel/BKE_image_partial_update.hh
index 6c7776c091c..8f962ace268 100644
--- a/source/blender/blenkernel/BKE_image_partial_update.hh
+++ b/source/blender/blenkernel/BKE_image_partial_update.hh
@@ -29,7 +29,6 @@ struct PartialUpdateUser;
 
 namespace blender::bke::image {
 
-
 namespace partial_update {
 
 /* --- image_partial_update.cc --- */
diff --git a/source/blender/editors/mesh/editmesh_mask_extract.c 
b/source/blender/editors/mesh/editmesh_mask_extract.c
index bb4d745a677..9988bdcb367 100644
--- a/source/blender/editors/mesh/editmesh_mask_extract.c
+++ b/source/blender/editors/mesh/editmesh_mask_extract.c
@@ -293,7 +293,7 @@ static int paint_mask_extract_exec(bContext *C, wmOperator 
*op)
* Note: A second push happens after the operator due to
* the OPTYPE_UNDO flag; having an initial undo step here
* is just needed to preserve the active object pointer.
-   * 
+   *
* Fixes T103261.
*/
   ED_undo_push_op(C, op);
diff --git a/source/blender/gpencil_modifiers/intern/lineart/lineart_shadow.c 
b/source/blender/gpencil_modifiers/intern/lineart/lineart_shadow.c
index 7ac1ecb3796..26352f8ed54 100644
--- a/source/blender/gpencil_modifiers/intern/lineart/lineart_shadow.c
+++ b/source/blender/gpencil_modifiers/intern/lineart/lineart_shadow.c
@@ -588,7 +588,7 @@ static void lineart_shadow_edge_cut(LineartData *ld,
 new_seg_2->ratio = end;
   }
 
-  double r_fb_co_1[4]={0}, r_fb_co_2[4]={0}, r_gloc_1[3]={0}, r_gloc_2[3]={0};
+  double r_fb_co_1[4] = {0}, r_fb_co_2[4] = {0}, r_gloc_1[3] = {0}, 
r_gloc_2[3] = {0};
   double r_new_in_the_middle[4], r_new_in_the_middle_global[3], r_new_at;
   double *s1_fb_co_1, *s1_fb_co_2, *s1_gloc_1, *s1_gloc_2;
 
diff --git a/source/blender/gpu/intern/gpu_codegen.cc 
b/source/blender/gpu/intern/gpu_codegen.cc
index c4c0e403af1..465a621e864 100644
--- a/source/blender/gpu/intern/gpu_codegen.cc
+++ b/source/blender/gpu/intern/gpu_codegen.cc
@@ -211,7 +211,8 @@ static std::ostream <<(std::ostream , const 
GPUOutput *output)
 }
 
 /* Trick type to change overload and keep a somewhat nice syntax. */
-struct GPUConstant : public GPUInput {};
+struct GPUConstant : public GPUInput {
+};
 
 /* Print data constructor (i.e: vec2(1.0f, 1.0f)). */
 static std::ostream <<(std::ostream , const GPUConstant *input)
diff --git a/source/blender/modifiers/intern/MOD_util.cc 
b/source/blender/modifiers/intern/MOD_util.cc
index 6b7072db121..844e2d19a58 100644
--- a/source/blender/modifiers/intern/MOD_util.cc
+++ b/source/blender/modifiers/intern/MOD_util.cc
@@ -40,7 +40,6 @@
 
 #include "MEM_guardedalloc.h"
 
-
 void MOD_init_texture(MappingInfoModifierData *dmd, const ModifierEvalContext 
*ctx)
 {
   Tex *tex = dmd->texture;
diff --git a/source/blender/nodes/intern/node_socket.cc 
b/source/blender/nodes/intern/node_socket.cc
index e179740aafb..8f2c36152c5 100644
--- a/source/blender/nodes/intern/node_socket.cc
+++ b/source/blender/nodes/intern/node_socket.cc
@@ -482,7 +482,6 @@ void node_socket_copy_default_value(bNodeSocket *to, const 
bNodeSocket *from)
   to->flag |= (from->flag & SOCK_HIDE_VALUE);
 }
 
-
 static void standard_node_socket_interface_init_socket(bNodeTree * /*ntree*/,
const bNodeSocket 
*interface_socket,
bNode * /*node*/,
diff --git a/source/blender/nodes/texture/node_texture_util.cc 
b/source/blender/nodes/texture/node_texture_util.cc
index 2c2f14d0316..46d8417bfce 100644
--- a/source/blender/nodes/texture/node_texture_util.cc
+++ b/source/blender/nodes/texture/node_texture_util.cc
@@ -23,7 +23,9 @@
 
 #include "node_texture_util.hh"
 
-bool tex_node_poll_default(const bNodeType * /*ntype*/, const bNodeTree 
*ntree, const char **r_disabled_hint)
+bool tex_node_poll_default(const bNodeType * /*ntype*/,
+   const bNodeTree *ntree,
+   const char **r_disabled_hint)
 {
   if (!STREQ(ntree->idname, "TextureNodeTree")) {
 *r_disabled_hint = TIP_("Not a texture node tree");
diff --git 

[Bf-blender-cvs] [4e027fdde6e] master: update_deps.sh: Update OSL and USD for Blender 3.5.\

2022-12-28 Thread Bastien Montagne
Commit: 4e027fdde6ea0940be97b4e64317980ebf5cc175
Author: Bastien Montagne
Date:   Thu Dec 29 15:33:42 2022 +0900
Branches: master
https://developer.blender.org/rB4e027fdde6ea0940be97b4e64317980ebf5cc175

update_deps.sh: Update OSL and USD for Blender 3.5.\

OSL: 1.13-dev-1a7670600c8b08c2443a78d03c8c27e9a1149140
USD: 22.11

Re. T99618.

===

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 cbb7e20cda6..c876bdd63e2 100755
--- a/build_files/build_environment/install_deps.sh
+++ b/build_files/build_environment/install_deps.sh
@@ -523,8 +523,8 @@ LLVM_FORCE_REBUILD=false
 LLVM_SKIP=false
 
 # OSL needs to be compiled for now!
-OSL_VERSION="1.12.6.2"
-OSL_VERSION_SHORT="1.12"
+OSL_VERSION="1.13.0.2"
+OSL_VERSION_SHORT="1.13"
 OSL_VERSION_MIN="1.11"
 OSL_VERSION_MEX="2.0"
 OSL_FORCE_BUILD=false
@@ -560,8 +560,8 @@ ALEMBIC_FORCE_BUILD=false
 ALEMBIC_FORCE_REBUILD=false
 ALEMBIC_SKIP=false
 
-USD_VERSION="22.03"
-USD_VERSION_SHORT="22.03"
+USD_VERSION="22.11"
+USD_VERSION_SHORT="22.11"
 USD_VERSION_MIN="20.05"
 USD_VERSION_MEX="23.00"
 USD_FORCE_BUILD=false
@@ -1138,17 +1138,11 @@ 
_LLVM_SOURCE_ROOT="https://github.com/llvm/llvm-project/releases/download/llvmor
 LLVM_SOURCE=( "$_LLVM_SOURCE_ROOT/llvm-$LLVM_VERSION.src.tar.xz" )
 LLVM_CLANG_SOURCE=( "$_LLVM_SOURCE_ROOT/clang-$LLVM_VERSION.src.tar.xz" 
"$_LLVM_SOURCE_ROOT/cfe-$LLVM_VERSION.src.tar.xz" )
 
-OSL_USE_REPO=false
+OSL_USE_REPO=true
 OSL_SOURCE=( 
"https://github.com/imageworks/OpenShadingLanguage/archive/v$OSL_VERSION.tar.gz;
 )
-#~ OSL_SOURCE_REPO=( "https://github.com/imageworks/OpenShadingLanguage.git; )
-#~ OSL_SOURCE_REPO_BRANCH="master"
-#~ OSL_SOURCE_REPO_UID="85179714e1bc69cd25ecb6bb711c1a156685d395"
-#~ OSL_SOURCE=( 
"https://github.com/Nazg-Gul/OpenShadingLanguage/archive/Release-1.5.11.tar.gz; 
)
-#~ OSL_SOURCE_REPO=( "https://github.com/mont29/OpenShadingLanguage.git; )
-#~ OSL_SOURCE_REPO_UID="85179714e1bc69cd25ecb6bb711c1a156685d395"
-#~ OSL_SOURCE_REPO=( "https://github.com/Nazg-Gul/OpenShadingLanguage.git; )
-#~ OSL_SOURCE_REPO_UID="7d40ff5fe8e47b030042afb92d0e955f5aa96f48"
-#~ OSL_SOURCE_REPO_BRANCH="blender-fixes"
+OSL_SOURCE_REPO=( 
"https://github.com/AcademySoftwareFoundation/OpenShadingLanguage.git; )
+OSL_SOURCE_REPO_BRANCH="main"
+OSL_SOURCE_REPO_UID="1a7670600c8b08c2443a78d03c8c27e9a1149140"
 
 OSD_USE_REPO=false
 # Script foo to make the version string compliant with the archive name:

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


[Bf-blender-cvs] [9e332b113bf] master: install_deps.sh: Update OIIO, OpenVDB, OSD and OCIO for Blender 3.5.

2022-12-28 Thread Bastien Montagne
Commit: 9e332b113bf8ce893d1d85f8f6f4fbaaae46081c
Author: Bastien Montagne
Date:   Thu Dec 29 12:56:46 2022 +0900
Branches: master
https://developer.blender.org/rB9e332b113bf8ce893d1d85f8f6f4fbaaae46081c

install_deps.sh: Update OIIO, OpenVDB, OSD and OCIO for Blender 3.5.

OIIO: 2.4.6.0
OpenVDB: 10.0.0
OSD: 3.5.0
OCIO: 2.2.0

NOTE: Had to fight OpenVDB to force it to use 'deprecated' TBB 2020, it
really wants to use oneTBB when it can find it.

Re. T99618.

===

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 7aefa175f6c..cbb7e20cda6 100755
--- a/build_files/build_environment/install_deps.sh
+++ b/build_files/build_environment/install_deps.sh
@@ -479,8 +479,8 @@ TBB_FORCE_BUILD=false
 TBB_FORCE_REBUILD=false
 TBB_SKIP=false
 
-OCIO_VERSION="2.1.1"
-OCIO_VERSION_SHORT="2.1"
+OCIO_VERSION="2.2.0"
+OCIO_VERSION_SHORT="2.2"
 OCIO_VERSION_MIN="2.0"
 OCIO_VERSION_MEX="3.0"
 OCIO_FORCE_BUILD=false
@@ -505,10 +505,10 @@ OPENEXR_FORCE_REBUILD=false
 OPENEXR_SKIP=false
 _with_built_openexr=false
 
-OIIO_VERSION="2.3.20.0"
-OIIO_VERSION_SHORT="2.3"
-OIIO_VERSION_MIN="2.1.12"
-OIIO_VERSION_MEX="2.4.0"
+OIIO_VERSION="2.4.6.0"
+OIIO_VERSION_SHORT="2.4"
+OIIO_VERSION_MIN="2.2.0"
+OIIO_VERSION_MEX="2.5.0"
 OIIO_FORCE_BUILD=false
 OIIO_FORCE_REBUILD=false
 OIIO_SKIP=false
@@ -532,9 +532,9 @@ OSL_FORCE_REBUILD=false
 OSL_SKIP=false
 
 # OpenSubdiv needs to be compiled for now
-OSD_VERSION="3.4.4"
-OSD_VERSION_SHORT="3.4"
-OSD_VERSION_MIN="3.4"
+OSD_VERSION="3.5.0"
+OSD_VERSION_SHORT="3.5"
+OSD_VERSION_MIN="3.5"
 OSD_VERSION_MEX="4.0"
 OSD_FORCE_BUILD=false
 OSD_FORCE_REBUILD=false
@@ -543,10 +543,10 @@ OSD_SKIP=false
 # OpenVDB needs to be compiled for now
 OPENVDB_BLOSC_VERSION="1.21.1"
 
-OPENVDB_VERSION="9.0.0"
-OPENVDB_VERSION_SHORT="9.0"
-OPENVDB_VERSION_MIN="9.0"
-OPENVDB_VERSION_MEX="9.1"
+OPENVDB_VERSION="10.0.0"
+OPENVDB_VERSION_SHORT="10.0"
+OPENVDB_VERSION_MIN="10.0"
+OPENVDB_VERSION_MEX="11.0"
 OPENVDB_FORCE_BUILD=false
 OPENVDB_FORCE_REBUILD=false
 OPENVDB_SKIP=false
@@ -2969,6 +2969,9 @@ compile_OPENVDB() {
 fi
 if [ -d $INST/tbb ]; then
   cmake_d="$cmake_d -D TBB_ROOT=$INST/tbb"
+  # Work around until we use oneTBB, otherwise OpenVDB forcefully
+  # uses oneTBB if it can find it on the system.
+  cmake_d="$cmake_d -D Tbb_INCLUDE_DIR=$INST/tbb/include"
 fi
 
 if [ "$_with_built_imath" = true ]; then

___
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] [6347562fb01] master: install_deps.sh: Update python, numpy and boost for 3.5.

2022-12-28 Thread Bastien Montagne
Commit: 6347562fb0177eb5b3d4890d3719a91c4e783d8d
Author: Bastien Montagne
Date:   Thu Dec 29 11:03:51 2022 +0900
Branches: master
https://developer.blender.org/rB6347562fb0177eb5b3d4890d3719a91c4e783d8d

install_deps.sh: Update python, numpy and boost for 3.5.

- Python: 3.10.9
- NumPy: 1.23.5
- Boost: 1.80.0

Re. T99618

===

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 ed18e563f14..7aefa175f6c 100755
--- a/build_files/build_environment/install_deps.sh
+++ b/build_files/build_environment/install_deps.sh
@@ -394,7 +394,7 @@ CLANG_FORMAT_VERSION="10.0"
 CLANG_FORMAT_VERSION_MIN="6.0"
 CLANG_FORMAT_VERSION_MEX="14.0"
 
-PYTHON_VERSION="3.10.8"
+PYTHON_VERSION="3.10.9"
 PYTHON_VERSION_SHORT="3.10"
 PYTHON_VERSION_MIN="3.10"
 PYTHON_VERSION_MEX="3.12"
@@ -434,7 +434,7 @@ PYTHON_ZSTANDARD_VERSION_MIN="0.15.2"
 PYTHON_ZSTANDARD_VERSION_MEX="0.20.0"
 PYTHON_ZSTANDARD_NAME="zstandard"
 
-PYTHON_NUMPY_VERSION="1.22.0"
+PYTHON_NUMPY_VERSION="1.23.5"
 PYTHON_NUMPY_VERSION_MIN="1.14"
 PYTHON_NUMPY_VERSION_MEX="2.0"
 PYTHON_NUMPY_NAME="numpy"
@@ -462,8 +462,8 @@ PYTHON_MODULES_PIP=(
 )
 
 
-BOOST_VERSION="1.78.0"
-BOOST_VERSION_SHORT="1.78"
+BOOST_VERSION="1.80.0"
+BOOST_VERSION_SHORT="1.80"
 BOOST_VERSION_MIN="1.49"
 BOOST_VERSION_MEX="2.0"
 BOOST_FORCE_BUILD=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] [3176b113e40] master: Geometry Nodes: Reduce socket logging overhead

2022-12-28 Thread Hans Goudey
Commit: 3176b113e4087d771fa6ae90699c42de963fb685
Author: Hans Goudey
Date:   Wed Dec 28 20:37:16 2022 -0500
Branches: master
https://developer.blender.org/rB3176b113e4087d771fa6ae90699c42de963fb685

Geometry Nodes: Reduce socket logging overhead

Use socket indices to keep track of logged values instead of their
identifiers. This decreases memory pressure when there are many
sockets. In cases with many cheap nodes, this can give a relatively
large improvement to overall performance. We observed a 15% increase
in a case with many math nodes and a larger increase in an experimental
softbody node setup. The log is invalidated when we add/remove/move
sockets anyway.

===

M   source/blender/nodes/NOD_geometry_nodes_log.hh
M   source/blender/nodes/intern/geometry_nodes_log.cc

===

diff --git a/source/blender/nodes/NOD_geometry_nodes_log.hh 
b/source/blender/nodes/NOD_geometry_nodes_log.hh
index e2207338823..cfcecc31276 100644
--- a/source/blender/nodes/NOD_geometry_nodes_log.hh
+++ b/source/blender/nodes/NOD_geometry_nodes_log.hh
@@ -180,7 +180,7 @@ class GeoTreeLogger {
   };
   struct SocketValueLog {
 int32_t node_id;
-StringRefNull socket_identifier;
+int socket_index;
 destruct_ptr value;
   };
   struct NodeExecutionTime {
@@ -234,9 +234,9 @@ class GeoNodeLog {
* inside.
*/
   std::chrono::nanoseconds run_time{0};
-  /** Maps from socket identifiers to their values. */
-  Map input_values_;
-  Map output_values_;
+  /** Maps from socket indices to their values. */
+  Map input_values_;
+  Map output_values_;
   /** Maps from attribute name to their usage flags. */
   Map used_named_attributes;
   /** Messages that are used for debugging purposes during development. */
diff --git a/source/blender/nodes/intern/geometry_nodes_log.cc 
b/source/blender/nodes/intern/geometry_nodes_log.cc
index e8b65a3d319..eb2e9bd9015 100644
--- a/source/blender/nodes/intern/geometry_nodes_log.cc
+++ b/source/blender/nodes/intern/geometry_nodes_log.cc
@@ -151,8 +151,7 @@ void GeoTreeLogger::log_value(const bNode , const 
bNodeSocket , cons
   auto store_logged_value = [&](destruct_ptr value_log) {
 auto _values = socket.in_out == SOCK_IN ? this->input_socket_values 
:
  
this->output_socket_values;
-socket_values.append(
-{node.identifier, this->allocator->copy_string(socket.identifier), 
std::move(value_log)});
+socket_values.append({node.identifier, socket.index(), 
std::move(value_log)});
   };
 
   auto log_generic_value = [&](const CPPType , const void *value) {
@@ -252,11 +251,11 @@ void GeoTreeLog::ensure_socket_values()
   for (GeoTreeLogger *tree_logger : tree_loggers_) {
 for (const GeoTreeLogger::SocketValueLog _log_data : 
tree_logger->input_socket_values) {
   this->nodes.lookup_or_add_as(value_log_data.node_id)
-  .input_values_.add(value_log_data.socket_identifier, 
value_log_data.value.get());
+  .input_values_.add(value_log_data.socket_index, 
value_log_data.value.get());
 }
 for (const GeoTreeLogger::SocketValueLog _log_data : 
tree_logger->output_socket_values) {
   this->nodes.lookup_or_add_as(value_log_data.node_id)
-  .output_values_.add(value_log_data.socket_identifier, 
value_log_data.value.get());
+  .output_values_.add(value_log_data.socket_index, 
value_log_data.value.get());
 }
   }
   reduced_socket_values_ = true;
@@ -376,10 +375,8 @@ ValueLog *GeoTreeLog::find_socket_value_log(const 
bNodeSocket _socket)
 const bNode  = socket.owner_node();
 if (GeoNodeLog *node_log = this->nodes.lookup_ptr(node.identifier)) {
   ValueLog *value_log = socket.is_input() ?
-
node_log->input_values_.lookup_default(socket.identifier,
-   
nullptr) :
-
node_log->output_values_.lookup_default(socket.identifier,
-
nullptr);
+
node_log->input_values_.lookup_default(socket.index(), nullptr) :
+
node_log->output_values_.lookup_default(socket.index(), nullptr);
   if (value_log != nullptr) {
 return value_log;
   }

___
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] [c9b06505d8d] master: Cleanup: Grammar in comments

2022-12-28 Thread Hans Goudey
Commit: c9b06505d8d56e2b599cf60f47ee3baa413c31fa
Author: Hans Goudey
Date:   Wed Dec 28 20:39:14 2022 -0500
Branches: master
https://developer.blender.org/rBc9b06505d8d56e2b599cf60f47ee3baa413c31fa

Cleanup: Grammar in comments

"spend" is a verb, not a noun.

===

M   source/blender/blenkernel/BKE_subdiv.h
M   source/blender/depsgraph/intern/node/deg_node.h
M   source/blender/nodes/NOD_geometry_nodes_log.hh

===

diff --git a/source/blender/blenkernel/BKE_subdiv.h 
b/source/blender/blenkernel/BKE_subdiv.h
index 5a6e8cbb64a..97bcab8a3a2 100644
--- a/source/blender/blenkernel/BKE_subdiv.h
+++ b/source/blender/blenkernel/BKE_subdiv.h
@@ -88,9 +88,9 @@ typedef enum eSubdivStatsValue {
 typedef struct SubdivStats {
   union {
 struct {
-  /* Time spend on creating topology refiner, which includes time
+  /* Time spent on creating topology refiner, which includes time
* spend on conversion from Blender data to OpenSubdiv data, and
-   * time spend on topology orientation on OpenSubdiv C-API side. */
+   * time spent on topology orientation on OpenSubdiv C-API side. */
   double topology_refiner_creation_time;
   /* Total time spent in BKE_subdiv_to_mesh(). */
   double subdiv_to_mesh_time;
diff --git a/source/blender/depsgraph/intern/node/deg_node.h 
b/source/blender/depsgraph/intern/node/deg_node.h
index e31c1769a2a..c28897a5ad4 100644
--- a/source/blender/depsgraph/intern/node/deg_node.h
+++ b/source/blender/depsgraph/intern/node/deg_node.h
@@ -161,7 +161,7 @@ struct Node {
 /* Reset counters needed for the current graph evaluation, does not
  * touch averaging accumulators. */
 void reset_current();
-/* Time spend on this node during current graph evaluation. */
+/* Time spent on this node during current graph evaluation. */
 double current_time;
   };
   /* Relationships between nodes
diff --git a/source/blender/nodes/NOD_geometry_nodes_log.hh 
b/source/blender/nodes/NOD_geometry_nodes_log.hh
index cfcecc31276..d99dff21c6d 100644
--- a/source/blender/nodes/NOD_geometry_nodes_log.hh
+++ b/source/blender/nodes/NOD_geometry_nodes_log.hh
@@ -230,7 +230,7 @@ class GeoNodeLog {
   /** Warnings generated for that node. */
   Vector warnings;
   /**
-   * Time spend in that node. For node groups this is the sum of the run times 
of the nodes
+   * Time spent in this node. For node groups this is the sum of the run times 
of the nodes
* inside.
*/
   std::chrono::nanoseconds run_time{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] [8c6fe60844f] master: Cleanup: Use const parameters for node poll functions

2022-12-28 Thread Hans Goudey
Commit: 8c6fe60844f2f970c46500efa27fe9755b91b76d
Author: Hans Goudey
Date:   Wed Dec 28 20:15:41 2022 -0500
Branches: master
https://developer.blender.org/rB8c6fe60844f2f970c46500efa27fe9755b91b76d

Cleanup: Use const parameters for node poll functions

This requires a const cast in RNA, but it really is wrong
to change the nodes and node trees in these callbacks.

===

M   source/blender/blenkernel/BKE_node.h
M   source/blender/blenkernel/intern/node.cc
M   source/blender/makesrna/intern/rna_nodetree.c
M   source/blender/nodes/composite/node_composite_util.cc
M   source/blender/nodes/composite/node_composite_util.hh
M   source/blender/nodes/composite/nodes/node_composite_cryptomatte.cc
M   source/blender/nodes/composite/nodes/node_composite_image.cc
M   source/blender/nodes/function/node_function_util.cc
M   source/blender/nodes/geometry/node_geometry_util.cc
M   source/blender/nodes/geometry/node_geometry_util.hh
M   source/blender/nodes/intern/node_common.cc
M   source/blender/nodes/intern/node_common.h
M   source/blender/nodes/intern/node_register.cc
M   source/blender/nodes/shader/node_shader_util.cc
M   source/blender/nodes/shader/node_shader_util.hh
M   source/blender/nodes/texture/node_texture_util.cc
M   source/blender/nodes/texture/node_texture_util.hh

===

diff --git a/source/blender/blenkernel/BKE_node.h 
b/source/blender/blenkernel/BKE_node.h
index ff1128246f3..d247ee5eea0 100644
--- a/source/blender/blenkernel/BKE_node.h
+++ b/source/blender/blenkernel/BKE_node.h
@@ -299,12 +299,14 @@ typedef struct bNodeType {
* when it's not just a dummy, that is, if it 
actually wants to access
* the returned disabled-hint (null-check needed!).
*/
-  bool (*poll)(struct bNodeType *ntype, struct bNodeTree *nodetree, const char 
**r_disabled_hint);
+  bool (*poll)(const struct bNodeType *ntype,
+   const struct bNodeTree *nodetree,
+   const char **r_disabled_hint);
   /** Can this node be added to a node tree?
* \param r_disabled_hint: See `poll()`.
*/
-  bool (*poll_instance)(struct bNode *node,
-struct bNodeTree *nodetree,
+  bool (*poll_instance)(const struct bNode *node,
+const struct bNodeTree *nodetree,
 const char **r_disabled_hint);
 
   /* optional handling of link insertion */
diff --git a/source/blender/blenkernel/intern/node.cc 
b/source/blender/blenkernel/intern/node.cc
index 9fc2cbde1d5..097d14ae7b9 100644
--- a/source/blender/blenkernel/intern/node.cc
+++ b/source/blender/blenkernel/intern/node.cc
@@ -4034,14 +4034,16 @@ static void node_type_base_defaults(bNodeType *ntype)
 }
 
 /* allow this node for any tree type */
-static bool node_poll_default(bNodeType * /*ntype*/,
-  bNodeTree * /*ntree*/,
+static bool node_poll_default(const bNodeType * /*ntype*/,
+  const bNodeTree * /*ntree*/,
   const char ** /*disabled_hint*/)
 {
   return true;
 }
 
-static bool node_poll_instance_default(bNode *node, bNodeTree *ntree, const 
char **disabled_hint)
+static bool node_poll_instance_default(const bNode *node,
+   const bNodeTree *ntree,
+   const char **disabled_hint)
 {
   return node->typeinfo->poll(node->typeinfo, ntree, disabled_hint);
 }
diff --git a/source/blender/makesrna/intern/rna_nodetree.c 
b/source/blender/makesrna/intern/rna_nodetree.c
index fbc13229a3d..aa42e9422e2 100644
--- a/source/blender/makesrna/intern/rna_nodetree.c
+++ b/source/blender/makesrna/intern/rna_nodetree.c
@@ -1659,7 +1659,9 @@ char *rna_Node_ImageUser_path(const PointerRNA *ptr)
   return NULL;
 }
 
-static bool rna_Node_poll(bNodeType *ntype, bNodeTree *ntree, const char 
**UNUSED(r_disabled_hint))
+static bool rna_Node_poll(const bNodeType *ntype,
+  const bNodeTree *ntree,
+  const char **UNUSED(r_disabled_hint))
 {
   extern FunctionRNA rna_Node_poll_func;
 
@@ -1684,8 +1686,8 @@ static bool rna_Node_poll(bNodeType *ntype, bNodeTree 
*ntree, const char **UNUSE
   return visible;
 }
 
-static bool rna_Node_poll_instance(bNode *node,
-   bNodeTree *ntree,
+static bool rna_Node_poll_instance(const bNode *node,
+   const bNodeTree *ntree,
const char **UNUSED(disabled_info))
 {
   extern FunctionRNA rna_Node_poll_instance_func;
@@ -1696,7 +1698,7 @@ static bool rna_Node_poll_instance(bNode *node,
   void *ret;
   bool visible;
 
-  RNA_pointer_create(NULL, node->typeinfo->rna_ext.srna, node, ); /* dummy 
*/
+  RNA_pointer_create(NULL, node->typeinfo->rna_ext.srna, 

[Bf-blender-cvs] [921fc1e44ce] universal-scene-description: USD export: fix export parameter memory leak.

2022-12-28 Thread Michael Kowalski
Commit: 921fc1e44cedd595b4048c6e7476cdf54817f5e5
Author: Michael Kowalski
Date:   Wed Dec 28 17:58:01 2022 -0500
Branches: universal-scene-description
https://developer.blender.org/rB921fc1e44cedd595b4048c6e7476cdf54817f5e5

USD export:  fix export parameter memory leak.

Now freeing default_prim_custom_kind export option string.

===

M   source/blender/io/usd/intern/usd_capi_export.cc

===

diff --git a/source/blender/io/usd/intern/usd_capi_export.cc 
b/source/blender/io/usd/intern/usd_capi_export.cc
index 8c724e6c0be..9e69f9f6bdb 100644
--- a/source/blender/io/usd/intern/usd_capi_export.cc
+++ b/source/blender/io/usd/intern/usd_capi_export.cc
@@ -572,6 +572,7 @@ static void export_endjob(void *customdata)
   MEM_freeN(data->params.default_prim_path);
   MEM_freeN(data->params.root_prim_path);
   MEM_freeN(data->params.material_prim_path);
+  MEM_freeN(data->params.default_prim_custom_kind);
 
   if (data->was_canceled && BLI_exists(data->filepath)) {
 BLI_delete(data->filepath, false, 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] [91368f7b7dc] universal-scene-description: USD import: fix crash adding event notifiers.

2022-12-28 Thread Michael Kowalski
Commit: 91368f7b7dc5ec29a4f28d64ff59faf4ee575d01
Author: Michael Kowalski
Date:   Wed Dec 28 15:53:07 2022 -0500
Branches: universal-scene-description
https://developer.blender.org/rB91368f7b7dc5ec29a4f28d64ff59faf4ee575d01

USD import: fix crash adding event notifiers.

Fixed crash due to race condition adding event notifiers
when converting materials when the importer is invoked
in a background job.  Now acquiring the main thread lock
before reading object data, to avoid possible crashes
when event notifiers are added by timers for progress
updates in the main thread.

===

M   source/blender/io/usd/intern/usd_capi_import.cc

===

diff --git a/source/blender/io/usd/intern/usd_capi_import.cc 
b/source/blender/io/usd/intern/usd_capi_import.cc
index b0913db3d0f..ced906149f0 100644
--- a/source/blender/io/usd/intern/usd_capi_import.cc
+++ b/source/blender/io/usd/intern/usd_capi_import.cc
@@ -284,8 +284,25 @@ struct ImportJobData {
   bool was_canceled;
   bool import_ok;
   timeit::TimePoint start_time;
+
+  wmJob *wm_job;
 };
 
+static void main_thread_lock_acquire(ImportJobData *data)
+{
+  if (data->wm_job) {
+WM_job_main_thread_lock_acquire(data->wm_job);
+  }
+}
+
+static void main_thread_lock_release(ImportJobData *data)
+{
+  if (data->wm_job) {
+WM_job_main_thread_lock_release(data->wm_job);
+  }
+}
+
+
 static CacheFile *create_cache_file(const ImportJobData *data)
 {
   if (!data) {
@@ -505,6 +522,17 @@ static void import_startjob(void *customdata, bool *stop, 
bool *do_update, float
 }
   }
 
+  *data->do_update = true;
+  *data->progress = 0.5f;
+
+  /* Reading materials may trigger adding event notifiers, which
+   * isn't thread safe when the importer is invoked in a background
+   * job.  We therefore acquire the main thread lock before reading
+   * object data, to avoid possible crashes when events are added
+   * in job timers for progress updates in the main thread.
+   * (See wm_jobs_timer()). */
+  main_thread_lock_acquire(data);
+
   /* Setup parenthood and read actual object data. */
   i = 0;
   for (USDPrimReader *reader : archive->readers()) {
@@ -528,15 +556,22 @@ static void import_startjob(void *customdata, bool *stop, 
bool *do_update, float
   ob->parent = parent->object();
 }
 
-*data->progress = 0.5f + 0.5f * (++i / size);
-*data->do_update = true;
+if ((++i & 255) == 0) {
+  main_thread_lock_release(data);
+  *data->progress = 0.5f + 0.5f * (i / size);
+  *data->do_update = true;
+  main_thread_lock_acquire(data);
+}
 
 if (G.is_break) {
   data->was_canceled = true;
+  main_thread_lock_release(data);
   return;
 }
   }
 
+  main_thread_lock_release(data);
+
   if (data->params.import_skeletons) {
 archive->process_armature_modifiers();
   }
@@ -708,6 +743,8 @@ bool USD_import(struct bContext *C,
 WM_JOB_PROGRESS,
 WM_JOB_TYPE_ALEMBIC);
 
+job->wm_job = wm_job;
+
 /* setup job */
 WM_jobs_customdata_set(wm_job, job, import_freejob);
 WM_jobs_timer(wm_job, 0.1, NC_SCENE, NC_SCENE);

___
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] [c574ddc1044] microfacet_hair: Fix wrong interval numbers in composite Simpson's method

2022-12-28 Thread Weizhen Huang
Commit: c574ddc10445d2dc5bc3984b3f356c501464bda3
Author: Weizhen Huang
Date:   Wed Dec 28 12:41:33 2022 +0100
Branches: microfacet_hair
https://developer.blender.org/rBc574ddc10445d2dc5bc3984b3f356c501464bda3

Fix wrong interval numbers in composite Simpson's method

===

M   intern/cycles/kernel/closure/bsdf_hair_microfacet.h

===

diff --git a/intern/cycles/kernel/closure/bsdf_hair_microfacet.h 
b/intern/cycles/kernel/closure/bsdf_hair_microfacet.h
index 2392d03cbac..3216511a26d 100644
--- a/intern/cycles/kernel/closure/bsdf_hair_microfacet.h
+++ b/intern/cycles/kernel/closure/bsdf_hair_microfacet.h
@@ -398,23 +398,23 @@ ccl_device float3 
bsdf_microfacet_hair_eval_r_circular(ccl_private const ShaderC
 
 integral = roughness_squared * M_1_PI_F * 0.5f * (temp1 + temp2 + temp3 + 
temp4);
   }
-  else { /* falls back to numerical integration */
-/* initial sample resolution */
+  else { /* Falls back to numerical integration. */
+/* Maximal sample resolution. */
 float res = roughness * 0.7f;
-const float scale = (phi_m_max - phi_m_min) * 0.5f;
-size_t intervals = 2 * (size_t)ceilf(scale / res) + 1;
+/* Number of intervals should be even. */
+const size_t intervals = 2 * (size_t)ceilf((phi_m_max - phi_m_min) / res * 
0.5f);
 
-/* modified resolution based on integral domain */
+/* Modified resolution based on numbers of intervals. */
 res = (phi_m_max - phi_m_min) / float(intervals);
 
-/* integrate using Simpson's rule */
-for (size_t i = 0; i < intervals; i++) {
+/* Integrate using Simpson's rule. */
+for (size_t i = 0; i <= intervals; i++) {
 
   const float phi_m = phi_m_min + i * res;
   const float3 wm = sph_dir(tilt, phi_m);
 
   if (microfacet_visible(wi, wo, make_float3(wm.x, 0.0f, wm.z), wh)) {
-const float weight = (i == 0 || i == intervals - 1) ? 0.5f : (i % 2 + 
1);
+const float weight = (i == 0 || i == intervals) ? 0.5f : (i % 2 + 1);
 integral += weight * D(beckmann, roughness, wm, wh) *
 G(beckmann, roughness, wi, wo, wm, wh);
   }
@@ -458,14 +458,13 @@ ccl_device float3 
bsdf_microfacet_hair_eval_tt_trt_circular(KernelGlobals kg,
   const float3 mu_a = bsdf->sigma;
   const float inv_eta = 1.0f / eta;
 
-  float res = roughness * .8f;
-  const float scale = (phi_m_max - phi_m_min) * 0.5f;
-  size_t intervals = 2 * (size_t)ceilf(scale / res) + 1;
+  float res = roughness * 0.8f;
+  const size_t intervals = 2 * (size_t)ceilf((phi_m_max - phi_m_min) / res * 
0.5f);
   res = (phi_m_max - phi_m_min) / intervals;
 
   float3 S_tt = zero_float3();
   float3 S_trt = zero_float3();
-  for (size_t i = 0; i < intervals; i++) {
+  for (size_t i = 0; i <= intervals; i++) {
 
 const float phi_mi = phi_m_min + i * res;
 const float3 wmi = sph_dir(tilt, phi_mi);
@@ -495,7 +494,7 @@ ccl_device float3 
bsdf_microfacet_hair_eval_tt_trt_circular(KernelGlobals kg,
 }
 
 /* Simpson's rule weight */
-float weight = (i == 0 || i == intervals - 1) ? 0.5f : (i % 2 + 1);
+float weight = (i == 0 || i == intervals) ? 0.5f : (i % 2 + 1);
 
 float3 A_t = exp(mu_a * 2.0f * cosf(phi_t - phi_mi) / cos_theta(wt));
 
@@ -891,23 +890,23 @@ ccl_device float3 
bsdf_microfacet_hair_eval_r_elliptic(ccl_private const ShaderC
 gamma_m_max += M_2PI_F;
   }
 
-  /* initial sample resolution */
+  /* Maximal sample resolution. */
   float res = roughness * .7f;
-  const float scale = (gamma_m_max - gamma_m_min) * 0.5f;
-  size_t intervals = 2 * (size_t)ceilf(scale / res) + 1;
+  /* Number of intervals should be even. */
+  const size_t intervals = 2 * (size_t)ceilf((gamma_m_max - gamma_m_min) / res 
* 0.5f);
 
-  /* modified resolution based on integral domain */
+  /* Modified resolution based on numbers of intervals. */
   res = (gamma_m_max - gamma_m_min) / float(intervals);
 
-  /* integrate using Simpson's rule */
+  /* Integrate using Simpson's rule. */
   float integral = 0.0f;
-  for (size_t i = 0; i < intervals; i++) {
+  for (size_t i = 0; i <= intervals; i++) {
 
 const float gamma_m = gamma_m_min + i * res;
 const float3 wm = sphg_dir(tilt, gamma_m, a, b);
 
 if (microfacet_visible(wi, wo, make_float3(wm.x, 0.0f, wm.z), wh)) {
-  const float weight = (i == 0 || i == intervals - 1) ? 0.5f : (i % 2 + 1);
+  const float weight = (i == 0 || i == intervals) ? 0.5f : (i % 2 + 1);
   const float arc_length = sqrtf(1.0f - e2 * sqr(sinf(gamma_m)));
 
   integral += weight * D(beckmann, roughness, wm, wh) *
@@ -976,13 +975,12 @@ ccl_device float3 
bsdf_microfacet_hair_eval_tt_trt_elliptic(KernelGlobals kg,
   }
 
   float res = roughness * 0.8f;
-  const float scale = (gamma_m_max - gamma_m_min) * 0.5f;
-  size_t intervals = 2 * (size_t)ceilf(scale / res) + 1;
+  const size_t intervals = 2 * (size_t)ceilf((gamma_m_max - 

[Bf-blender-cvs] [9d171a9e1c9] gpencil-new-data-proposal: Merge branch 'master' into gpencil-new-data-proposal

2022-12-28 Thread Antonio Vazquez
Commit: 9d171a9e1c9c24d53d9ab73f972dbdcf8f726fbc
Author: Antonio Vazquez
Date:   Wed Dec 28 11:36:23 2022 +0100
Branches: gpencil-new-data-proposal
https://developer.blender.org/rB9d171a9e1c9c24d53d9ab73f972dbdcf8f726fbc

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

===



===



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


[Bf-blender-cvs] [9407cbd0cff] asset-lite-greasepencil: Merge branch 'master' into asset-lite-greasepencil

2022-12-28 Thread Antonio Vazquez
Commit: 9407cbd0cff2c6209f521f94b9c495d831bd2401
Author: Antonio Vazquez
Date:   Wed Dec 28 11:35:17 2022 +0100
Branches: asset-lite-greasepencil
https://developer.blender.org/rB9407cbd0cff2c6209f521f94b9c495d831bd2401

Merge branch 'master' into asset-lite-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