[Bf-blender-cvs] [14dd207b759] master: License headers: use SPDX for remaining files in Cycles

2022-02-14 Thread Campbell Barton
Commit: 14dd207b759593b9b4ae2f720044397b7c52
Author: Campbell Barton
Date:   Tue Feb 15 17:52:38 2022 +1100
Branches: master
https://developer.blender.org/rB14dd207b759593b9b4ae2f720044397b7c52

License headers: use SPDX for remaining files in Cycles

===

M   intern/cycles/kernel/geom/patch.h
M   intern/cycles/subd/patch_table.cpp

===

diff --git a/intern/cycles/kernel/geom/patch.h 
b/intern/cycles/kernel/geom/patch.h
index 432618aa243..9a006baf7bf 100644
--- a/intern/cycles/kernel/geom/patch.h
+++ b/intern/cycles/kernel/geom/patch.h
@@ -1,27 +1,8 @@
-/*
- * Based on code from OpenSubdiv released under this license:
- *
- * Copyright 2013 Pixar
- *
- * Licensed under the Apache License, Version 2.0 (the "Apache License")
- * with the following modification; you may not use this file except in
- * compliance with the Apache License and the following modification to it:
- * Section 6. Trademarks. is deleted and replaced with:
- *
- * 6. Trademarks. This License does not grant permission to use the trade
- *   names, trademarks, service marks, or product names of the Licensor
- *   and its affiliates, except as required to comply with Section 4(c) of
- *   the License and to reproduce the content of the NOTICE file.
- *
- * You may obtain a copy of the Apache License at
- *
- *http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the Apache License with the above modification is
- * distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the Apache License for the specific
- * language governing permissions and limitations under the Apache License.
+/* SPDX-License-Identifier: Apache-2.0
+ * Copyright 2013 Pixar. */
+
+/** \file
+ * Based on code from OpenSubdiv.
  */
 
 #pragma once
diff --git a/intern/cycles/subd/patch_table.cpp 
b/intern/cycles/subd/patch_table.cpp
index d215dfaa1dd..a2dff0d0889 100644
--- a/intern/cycles/subd/patch_table.cpp
+++ b/intern/cycles/subd/patch_table.cpp
@@ -1,27 +1,8 @@
-/*
- * Based on code from OpenSubdiv released under this license:
- *
- * Copyright 2014 DreamWorks Animation LLC.
- *
- * Licensed under the Apache License, Version 2.0 (the "Apache License")
- * with the following modification; you may not use this file except in
- * compliance with the Apache License and the following modification to it:
- * Section 6. Trademarks. is deleted and replaced with:
- *
- * 6. Trademarks. This License does not grant permission to use the trade
- *   names, trademarks, service marks, or product names of the Licensor
- *   and its affiliates, except as required to comply with Section 4(c) of
- *   the License and to reproduce the content of the NOTICE file.
- *
- * You may obtain a copy of the Apache License at
- *
- *http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the Apache License with the above modification is
- * distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the Apache License for the specific
- * language governing permissions and limitations under the Apache License.
+/* SPDX-License-Identifier: Apache-2.0
+ * Copyright 2014 DreamWorks Animation LLC. */
+
+/** \file
+ * Based on code from OpenSubdiv.
  */
 
 #include "subd/patch_table.h"

___
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] [88b6e5571e1] master: License headers: use SPDX for remaining CMake find modules & gtests

2022-02-14 Thread Campbell Barton
Commit: 88b6e5571e123b449b754788f99cfbd766cf96d2
Author: Campbell Barton
Date:   Tue Feb 15 17:41:32 2022 +1100
Branches: master
https://developer.blender.org/rB88b6e5571e123b449b754788f99cfbd766cf96d2

License headers: use SPDX for remaining CMake find modules & gtests

===

M   build_files/cmake/Modules/FindGflags.cmake
M   build_files/cmake/Modules/FindGlog.cmake
M   tests/gtests/testing/mock_log.h

===

diff --git a/build_files/cmake/Modules/FindGflags.cmake 
b/build_files/cmake/Modules/FindGflags.cmake
index e6da056925f..b1b1597ccaa 100644
--- a/build_files/cmake/Modules/FindGflags.cmake
+++ b/build_files/cmake/Modules/FindGflags.cmake
@@ -1,33 +1,8 @@
-# Ceres Solver - A fast non-linear least squares minimizer
+# SPDX-License-Identifier: BSD-3-Clause
 # Copyright 2015 Google Inc. All rights reserved.
-# http://ceres-solver.org/
-#
-# Redistribution and use in source and binary forms, with or without
-# modification, are permitted provided that the following conditions are met:
-#
-# * Redistributions of source code must retain the above copyright notice,
-#   this list of conditions and the following disclaimer.
-# * Redistributions in binary form must reproduce the above copyright notice,
-#   this list of conditions and the following disclaimer in the documentation
-#   and/or other materials provided with the distribution.
-# * Neither the name of Google Inc. nor the names of its contributors may be
-#   used to endorse or promote products derived from this software without
-#   specific prior written permission.
-#
-# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
-# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
-# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
-# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
-# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
-# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
-# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
-# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
-# POSSIBILITY OF SUCH DAMAGE.
-#
-# Author: alexs@gmail.com (Alex Stewart)
-#
+
+# Ceres Solver - A fast non-linear least squares minimizer 
http://ceres-solver.org/
+# Author: Alex Stewart 
 
 # FindGflags.cmake - Find Google gflags logging library.
 #
diff --git a/build_files/cmake/Modules/FindGlog.cmake 
b/build_files/cmake/Modules/FindGlog.cmake
index bd1480dbaf1..74c92f23315 100644
--- a/build_files/cmake/Modules/FindGlog.cmake
+++ b/build_files/cmake/Modules/FindGlog.cmake
@@ -1,33 +1,8 @@
-# Ceres Solver - A fast non-linear least squares minimizer
+# SPDX-License-Identifier: BSD-3-Clause
 # Copyright 2015 Google Inc. All rights reserved.
-# http://ceres-solver.org/
-#
-# Redistribution and use in source and binary forms, with or without
-# modification, are permitted provided that the following conditions are met:
-#
-# * Redistributions of source code must retain the above copyright notice,
-#   this list of conditions and the following disclaimer.
-# * Redistributions in binary form must reproduce the above copyright notice,
-#   this list of conditions and the following disclaimer in the documentation
-#   and/or other materials provided with the distribution.
-# * Neither the name of Google Inc. nor the names of its contributors may be
-#   used to endorse or promote products derived from this software without
-#   specific prior written permission.
-#
-# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
-# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
-# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
-# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
-# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
-# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
-# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
-# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
-# POSSIBILITY OF SUCH DAMAGE.
-#
-# Author: alexs@gmail.com (Alex Stewart)
-#
+
+# Ceres Solver - A fast non-linear least squares minimizer 
http://ceres-solver.org/
+# Author: Alex Stewart 
 
 # FindGlog.cmake - Find Google glog logging library.
 #
diff --git a/tests/gtests/testing/mock_log.h b/tests/gtests/testing/mock_log.h
index 7d0a94a4971..045dbc9e3c2 100644
--- 

[Bf-blender-cvs] [fa7bd4c0695] master: Cleanup: move utility to create a frame path into a static method

2022-02-14 Thread Campbell Barton
Commit: fa7bd4c06954a9d5e9345000ca1d3f929ce67de1
Author: Campbell Barton
Date:   Tue Feb 15 16:50:08 2022 +1100
Branches: master
https://developer.blender.org/rBfa7bd4c06954a9d5e9345000ca1d3f929ce67de1

Cleanup: move utility to create a frame path into a static method

Add PlayRenderedAnim._frame_path_with_number_char since mixing
this logic inline made the code harder to follow.

===

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

===

diff --git a/release/scripts/startup/bl_operators/screen_play_rendered_anim.py 
b/release/scripts/startup/bl_operators/screen_play_rendered_anim.py
index 1c7b014992a..7ad3cacb395 100644
--- a/release/scripts/startup/bl_operators/screen_play_rendered_anim.py
+++ b/release/scripts/startup/bl_operators/screen_play_rendered_anim.py
@@ -44,6 +44,23 @@ class PlayRenderedAnim(Operator):
 bl_label = "Play Rendered Animation"
 bl_options = {'REGISTER'}
 
+@staticmethod
+def _frame_path_with_number_char(rd, ch, **kwargs):
+# Replace the number with `ch`.
+
+# NOTE: make an api call for this would be nice, however this isn't 
needed in many places.
+file_a = rd.frame_path(frame=0, **kwargs)
+
+frame_tmp = 9
+file_b = rd.frame_path(frame=frame_tmp, **kwargs)
+
+while len(file_a) == len(file_b):
+frame_tmp = (frame_tmp * 10) + 9
+file_b = rd.frame_path(frame=frame_tmp, **kwargs)
+file_b = rd.frame_path(frame=int(frame_tmp / 10), **kwargs)
+
+return ("".join((c if file_b[i] == c else ch) for i, c in 
enumerate(file_a)))
+
 def execute(self, context):
 import os
 import subprocess
@@ -71,21 +88,7 @@ class PlayRenderedAnim(Operator):
 player_path = guess_player_path(preset)
 
 if is_movie is False and preset in {'FRAMECYCLER', 'RV', 'MPLAYER'}:
-# replace the number with '#'
-file_a = rd.frame_path(frame=0, view=view_suffix)
-
-# TODO, make an api call for this
-frame_tmp = 9
-file_b = rd.frame_path(frame=frame_tmp, view=view_suffix)
-
-while len(file_a) == len(file_b):
-frame_tmp = (frame_tmp * 10) + 9
-file_b = rd.frame_path(frame=frame_tmp, view=view_suffix)
-file_b = rd.frame_path(frame=int(frame_tmp / 10), view=view_suffix)
-
-file = ("".join((c if file_b[i] == c else "#")
-for i, c in enumerate(file_a)))
-del file_a, file_b, frame_tmp
+file = PlayRenderedAnim._frame_path_with_number_char(rd, "#", 
view=view_suffix)
 file = bpy.path.abspath(file)  # expand '//'
 else:
 path_valid = 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] [fcac0b6fea7] master: Fix playing image-sequences with frames containing 9 or more numbers

2022-02-14 Thread Campbell Barton
Commit: fcac0b6fea79608850a3cf69e81f60c580c585df
Author: Campbell Barton
Date:   Tue Feb 15 17:06:43 2022 +1100
Branches: master
https://developer.blender.org/rBfcac0b6fea79608850a3cf69e81f60c580c585df

Fix playing image-sequences with frames containing 9 or more numbers

The path calculation method for animation players: frame-cycler, rv &
mplayer would fail when the number of digits exceeded the range of a
32bit int causing RenderData.frame_path() to raise a ValueError.

Use a simpler method of extracting the range that uses the sign to
detect the beginning of the number.

===

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

===

diff --git a/release/scripts/startup/bl_operators/screen_play_rendered_anim.py 
b/release/scripts/startup/bl_operators/screen_play_rendered_anim.py
index 7ad3cacb395..78efe9c4af0 100644
--- a/release/scripts/startup/bl_operators/screen_play_rendered_anim.py
+++ b/release/scripts/startup/bl_operators/screen_play_rendered_anim.py
@@ -50,16 +50,19 @@ class PlayRenderedAnim(Operator):
 
 # NOTE: make an api call for this would be nice, however this isn't 
needed in many places.
 file_a = rd.frame_path(frame=0, **kwargs)
+file_b = rd.frame_path(frame=-1, **kwargs)
+assert len(file_b) == len(file_a) + 1
 
-frame_tmp = 9
-file_b = rd.frame_path(frame=frame_tmp, **kwargs)
+for number_beg in range(len(file_a)):
+if file_a[number_beg] != file_b[number_beg]:
+break
 
-while len(file_a) == len(file_b):
-frame_tmp = (frame_tmp * 10) + 9
-file_b = rd.frame_path(frame=frame_tmp, **kwargs)
-file_b = rd.frame_path(frame=int(frame_tmp / 10), **kwargs)
+for number_end in range(-1, -(len(file_a) + 1), -1):
+if file_a[number_end] != file_b[number_end]:
+break
 
-return ("".join((c if file_b[i] == c else ch) for i, c in 
enumerate(file_a)))
+number_end += len(file_a) + 1
+return file_a[:number_beg] + (ch * (number_end - number_beg)) + 
file_a[number_end:]
 
 def execute(self, context):
 import os

___
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] [c146d75808f] master: readme.html: replace IRC with blender.chat, fix typo

2022-02-14 Thread Ankit Meel
Commit: c146d75808f84fddeffb0059b31e572845a3bc49
Author: Ankit Meel
Date:   Tue Feb 15 11:09:40 2022 +0530
Branches: master
https://developer.blender.org/rBc146d75808f84fddeffb0059b31e572845a3bc49

readme.html: replace IRC with blender.chat, fix typo

- Replace IRC links and channels with blender.chat ones.
- Fix mismatch in text vs link of "GIT and Bug Tracker".
- http -> https for blender links

===

M   release/text/readme.html

===

diff --git a/release/text/readme.html b/release/text/readme.html
index 6048dd78e6b..37fe43a5abc 100644
--- a/release/text/readme.html
+++ b/release/text/readme.html
@@ -33,7 +33,7 @@ It's free and open-source software, released under the GNU 
GPL licence.
 The entire source code is available on our website.
 
 
-For more information, visit http://www.blender.org/;>blender.org.
+For more information, visit https://www.blender.org/;>blender.org.
 
 
 @BLENDER_VERSION@
@@ -79,27 +79,27 @@ download an addon as a .py or .zip file, then press the 
"Install Addon" button a
 Links
 Users:
 
-General information http://www.blender.org/;>
+General information https://www.blender.org/;>
 www.blender.org 
 Release Notes https://wiki.blender.org/wiki/Reference/Release_Notes/@BLENDER_VERSION@;>
 wiki.blender.org/wiki/Reference/Release_Notes/@BLENDER_VERSION@
-Tutorials http://www.blender.org/support/tutorials/;>
+Tutorials https://www.blender.org/support/tutorials/;>
 www.blender.org/support/tutorials/ 
 Manual https://docs.blender.org/manual/en/latest/;>https://docs.blender.org/manual/en/latest/
-User Forum http://www.blenderartists.org/;>
+User Forum https://www.blenderartists.org/;>
 www.blenderartists.org
-IRC 
-#blenderchat or 
-#blender on irc.freenode.net
+Chat https://blender.chat/channel/today;>
+#today or https://blender.chat/channel/support;>
+#support on blender.chat
 
 Developers:
 
-Development http://www.blender.org/get-involved/developers/;>
+Development https://www.blender.org/get-involved/developers/;>
 www.blender.org/get-involved/developers/
-GIT and Bug Tracker http://developer.blender.org/;>
-www.blender.org/get-involved/
-IRC 
-#blendercoders on irc.freenode.net
+GIT and Bug Tracker https://developer.blender.org/;>
+developer.blender.org
+Chat https://blender.chat/channel/blender-coders;>
+#blender-coders on blender.chat
 
 
 

___
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] [14d98d03880] master: CMake: create readme.html with configure_file

2022-02-14 Thread Ankit Meel
Commit: 14d98d0388043f7e49451e31fcc1cbb46a214fa9
Author: Ankit Meel
Date:   Tue Feb 15 10:14:35 2022 +0530
Branches: master
https://developer.blender.org/rB14d98d0388043f7e49451e31fcc1cbb46a214fa9

CMake: create readme.html with configure_file

Since the output file stays unmodified for most developer builds,
install step installed it redundantly.

Create readme.html using `configure_file`:
- Now it's modified only if final output changes (handled by CMake).
- If input file (from git) or blender version changes,
  it //will// be modified.

Also don't re-implement what CMake can do.

Reviewed By: campbellbarton, LazyDodo
Differential Revision: https://developer.blender.org/D13863

===

M   release/text/readme.html
M   source/creator/CMakeLists.txt

===

diff --git a/release/text/readme.html b/release/text/readme.html
index 3972f137d8e..6048dd78e6b 100644
--- a/release/text/readme.html
+++ b/release/text/readme.html
@@ -18,7 +18,7 @@
   
 
 
-Blender BLENDER_VERSION
+Blender @BLENDER_VERSION@
 
 About
 
@@ -36,10 +36,10 @@ The entire source code is available on our website.
 For more information, visit http://www.blender.org/;>blender.org.
 
 
-BLENDER_VERSION
+@BLENDER_VERSION@
 
-The Blender Foundation and online developer community is proud to present 
Blender BLENDER_VERSION.
-https://wiki.blender.org/wiki/Reference/Release_Notes/BLENDER_VERSION;>
+The Blender Foundation and online developer community is proud to present 
Blender @BLENDER_VERSION@.
+https://wiki.blender.org/wiki/Reference/Release_Notes/@BLENDER_VERSION@;>
 More information about this release.
 
 
@@ -81,8 +81,8 @@ download an addon as a .py or .zip file, then press the 
"Install Addon" button a
 
 General information http://www.blender.org/;>
 www.blender.org 
-Release Notes https://wiki.blender.org/wiki/Reference/Release_Notes/BLENDER_VERSION;>
-wiki.blender.org/wiki/Reference/Release_Notes/BLENDER_VERSION
+Release Notes https://wiki.blender.org/wiki/Reference/Release_Notes/@BLENDER_VERSION@;>
+wiki.blender.org/wiki/Reference/Release_Notes/@BLENDER_VERSION@
 Tutorials http://www.blender.org/support/tutorials/;>
 www.blender.org/support/tutorials/ 
 Manual https://docs.blender.org/manual/en/latest/;>https://docs.blender.org/manual/en/latest/
diff --git a/source/creator/CMakeLists.txt b/source/creator/CMakeLists.txt
index e804db05687..e6e122508a9 100644
--- a/source/creator/CMakeLists.txt
+++ b/source/creator/CMakeLists.txt
@@ -1130,15 +1130,9 @@ endif()
 
 if(DEFINED BLENDER_TEXT_FILES_DESTINATION)
 
-  install(
-CODE
-"
-file(READ \"${CMAKE_SOURCE_DIR}/release/text/readme.html\" DATA_SRC)
-string(REGEX REPLACE \"BLENDER_VERSION\" \"${BLENDER_VERSION}\" DATA_DST 
\"\${DATA_SRC}\")
-file(WRITE \"${CMAKE_BINARY_DIR}/release/text/readme.html\" 
\"\${DATA_DST}\")
-unset(DATA_SRC)
-unset(DATA_DST)
-"
+  configure_file(${CMAKE_SOURCE_DIR}/release/text/readme.html
+ ${CMAKE_BINARY_DIR}/release/text/readme.html
+ @ONLY
   )
   list(APPEND BLENDER_TEXT_FILES
 ${CMAKE_BINARY_DIR}/release/text/readme.html

___
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] [ee813f5ab76] tmp_lib_update_32: Deps: OIDN turn off OIDN_FILTER_RTLIGHTMAP

2022-02-14 Thread Ray Molenkamp
Commit: ee813f5ab76ee7be440646bda3ee7ef698e14029
Author: Ray Molenkamp
Date:   Mon Feb 14 21:39:11 2022 -0700
Branches: tmp_lib_update_32
https://developer.blender.org/rBee813f5ab76ee7be440646bda3ee7ef698e14029

Deps: OIDN turn off OIDN_FILTER_RTLIGHTMAP

we were not using it and it shaves off 7 megs
off our binary size.

===

M   build_files/build_environment/cmake/openimagedenoise.cmake

===

diff --git a/build_files/build_environment/cmake/openimagedenoise.cmake 
b/build_files/build_environment/cmake/openimagedenoise.cmake
index 8b528de7ee4..3612e91a690 100644
--- a/build_files/build_environment/cmake/openimagedenoise.cmake
+++ b/build_files/build_environment/cmake/openimagedenoise.cmake
@@ -8,6 +8,7 @@ set(OIDN_EXTRA_ARGS
   -DOIDN_STATIC_LIB=ON
   -DOIDN_STATIC_RUNTIME=OFF
   -DISPC_EXECUTABLE=${LIBDIR}/ispc/bin/ispc
+  -DOIDN_FILTER_RTLIGHTMAP=OFF
 )
 
 if(WIN32)

___
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] [ba52ead3a7e] tmp_lib_update_32: deps: TBB 2020U3

2022-02-14 Thread Ray Molenkamp
Commit: ba52ead3a7e1158226e87eda7422804671dec98f
Author: Ray Molenkamp
Date:   Mon Feb 14 21:37:34 2022 -0700
Branches: tmp_lib_update_32
https://developer.blender.org/rBba52ead3a7e1158226e87eda7422804671dec98f

deps: TBB 2020U3

===

M   build_files/build_environment/cmake/versions.cmake

===

diff --git a/build_files/build_environment/cmake/versions.cmake 
b/build_files/build_environment/cmake/versions.cmake
index 267a3c8f12a..bd1e9092f81 100644
--- a/build_files/build_environment/cmake/versions.cmake
+++ b/build_files/build_environment/cmake/versions.cmake
@@ -205,9 +205,9 @@ set(PYTHON_HASH 14e8c22458ed7779a1957b26cde01db9)
 set(PYTHON_HASH_TYPE MD5)
 set(PYTHON_FILE Python-${PYTHON_VERSION}.tar.xz)
 
-set(TBB_VERSION 2020_U2)
+set(TBB_VERSION 2020_U3)
 set(TBB_URI https://github.com/oneapi-src/oneTBB/archive/${TBB_VERSION}.tar.gz)
-set(TBB_HASH 1b711ae956524855088df3bbf5ec65dc)
+set(TBB_HASH 55ec8df6eae5ed6364a47f0e671e460c)
 set(TBB_HASH_TYPE MD5)
 set(TBB_FILE oneTBB-${TBB_VERSION}.tar.gz)

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


[Bf-blender-cvs] [9d01358a681] master: Cleanup: unused argument warnings

2022-02-14 Thread Campbell Barton
Commit: 9d01358a68143ab76ac2f5eed09b370c4eb21a59
Author: Campbell Barton
Date:   Tue Feb 15 13:04:22 2022 +1100
Branches: master
https://developer.blender.org/rB9d01358a68143ab76ac2f5eed09b370c4eb21a59

Cleanup: unused argument warnings

===

M   source/blender/draw/intern/draw_cache_impl_subdivision.cc

===

diff --git a/source/blender/draw/intern/draw_cache_impl_subdivision.cc 
b/source/blender/draw/intern/draw_cache_impl_subdivision.cc
index 3c1c8ffd4fc..7efd0de7a44 100644
--- a/source/blender/draw/intern/draw_cache_impl_subdivision.cc
+++ b/source/blender/draw/intern/draw_cache_impl_subdivision.cc
@@ -1762,9 +1762,9 @@ static bool draw_subdiv_create_requested_buffers(const 
Scene *scene,
  const float obmat[4][4],
  const bool do_final,
  const bool do_uvedit,
- const bool use_subsurf_fdots,
+ const bool 
UNUSED(use_subsurf_fdots),
  const ToolSettings *ts,
- const bool use_hide,
+ const bool UNUSED(use_hide),
  OpenSubdiv_EvaluatorCache 
*evaluator_cache)
 {
   SubsurfModifierData *smd = BKE_object_get_last_subsurf_modifier(ob);

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


[Bf-blender-cvs] [e3a18a890d7] master: Cleanup: minor changes to Python argument parsing loop

2022-02-14 Thread Campbell Barton
Commit: e3a18a890d794538f82ccce3d56c595b33f1a4d9
Author: Campbell Barton
Date:   Tue Feb 15 12:51:31 2022 +1100
Branches: master
https://developer.blender.org/rBe3a18a890d794538f82ccce3d56c595b33f1a4d9

Cleanup: minor changes to Python argument parsing loop

- Increment the argument index at the end of the loop.
  Otherwise using the index after incrementing required subtracting 1.
- Move error prefix creation into a function: `pyrna_func_error_prefix`
  so it's possible to create an error prefix without duplicate code.

This simplifies further changes for argument parsing from D14047.

===

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

===

diff --git a/source/blender/python/intern/bpy_rna.c 
b/source/blender/python/intern/bpy_rna.c
index 3654dbbcf29..2e0dfc515d1 100644
--- a/source/blender/python/intern/bpy_rna.c
+++ b/source/blender/python/intern/bpy_rna.c
@@ -6017,6 +6017,36 @@ static PyObject *small_dict_get_item_string(PyObject 
*dict, const char *key_look
   return NULL;
 }
 
+/**
+ * \param parm_index: The argument index or -1 for keyword arguments.
+ */
+static void pyrna_func_error_prefix(BPy_FunctionRNA *self,
+PropertyRNA *parm,
+const int parm_index,
+char *error,
+const size_t error_size)
+{
+  PointerRNA *self_ptr = >ptr;
+  FunctionRNA *self_func = self->func;
+  if (parm_index == -1) {
+BLI_snprintf(error,
+ error_size,
+ "%.200s.%.200s(): error with keyword argument \"%.200s\" - ",
+ RNA_struct_identifier(self_ptr->type),
+ RNA_function_identifier(self_func),
+ RNA_property_identifier(parm));
+  }
+  else {
+BLI_snprintf(error,
+ error_size,
+ "%.200s.%.200s(): error with argument %d, \"%.200s\" - ",
+ RNA_struct_identifier(self_ptr->type),
+ RNA_function_identifier(self_func),
+ parm_index + 1,
+ RNA_property_identifier(parm));
+  }
+}
+
 static PyObject *pyrna_func_call(BPy_FunctionRNA *self, PyObject *args, 
PyObject *kw)
 {
   /* NOTE: both BPy_StructRNA and BPy_PropertyRNA can be used here. */
@@ -6143,8 +6173,6 @@ static PyObject *pyrna_func_call(BPy_FunctionRNA *self, 
PyObject *args, PyObject
   kw_arg = true;
 }
 
-i++; /* Current argument. */
-
 if (item == NULL) {
   if (flag_parameter & PARM_REQUIRED) {
 PyErr_Format(PyExc_TypeError,
@@ -6156,46 +6184,33 @@ static PyObject *pyrna_func_call(BPy_FunctionRNA *self, 
PyObject *args, PyObject
 break;
   }
   /* PyDict_GetItemString won't raise an error. */
-  continue;
 }
+else {
 
 #ifdef DEBUG_STRING_FREE
-if (item) {
-  if (PyUnicode_Check(item)) {
-PyList_APPEND(string_free_ls, 
PyUnicode_FromString(PyUnicode_AsUTF8(item)));
+  if (item) {
+if (PyUnicode_Check(item)) {
+  PyList_APPEND(string_free_ls, 
PyUnicode_FromString(PyUnicode_AsUTF8(item)));
+}
   }
-}
 #endif
-err = pyrna_py_to_prop(, parm, iter.data, item, "");
 
-if (err != 0) {
   /* the error generated isn't that useful, so generate it again with a 
useful prefix
* could also write a function to prepend to error messages */
   char error_prefix[512];
-  PyErr_Clear(); /* Re-raise. */
 
-  if (kw_arg == true) {
-BLI_snprintf(error_prefix,
- sizeof(error_prefix),
- "%.200s.%.200s(): error with keyword argument \"%.200s\" 
- ",
- RNA_struct_identifier(self_ptr->type),
- RNA_function_identifier(self_func),
- RNA_property_identifier(parm));
-  }
-  else {
-BLI_snprintf(error_prefix,
- sizeof(error_prefix),
- "%.200s.%.200s(): error with argument %d, \"%.200s\" - ",
- RNA_struct_identifier(self_ptr->type),
- RNA_function_identifier(self_func),
- i,
- RNA_property_identifier(parm));
-  }
+  err = pyrna_py_to_prop(, parm, iter.data, item, "");
 
-  pyrna_py_to_prop(, parm, iter.data, item, error_prefix);
+  if (err != 0) {
+PyErr_Clear(); /* Re-raise. */
+pyrna_func_error_prefix(self, parm, kw_arg ? -1 : i, error_prefix, 
sizeof(error_prefix));
+pyrna_py_to_prop(, parm, iter.data, item, error_prefix);
 
-  break;
+break;
+  }
 }
+
+i++; /* Current argument. */
   }
 
   RNA_parameter_list_end();

___
Bf-blender-cvs mailing list
Bf-blender-cvs@blender.org
List details, subscription details or unsubscribe:

[Bf-blender-cvs] [a9a05d55979] master: Merge branch 'blender-v3.1-release'

2022-02-14 Thread Brecht Van Lommel
Commit: a9a05d559798d9378f57d923dd18c9e63d7145ef
Author: Brecht Van Lommel
Date:   Tue Feb 15 01:05:47 2022 +0100
Branches: master
https://developer.blender.org/rBa9a05d559798d9378f57d923dd18c9e63d7145ef

Merge branch 'blender-v3.1-release'

===



===



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


[Bf-blender-cvs] [facd9d82682] blender-v3.1-release: Cleanup: clang-format

2022-02-14 Thread Brecht Van Lommel
Commit: facd9d82682b30e14e3a7db8fe6af830428d65cc
Author: Brecht Van Lommel
Date:   Tue Feb 15 00:59:26 2022 +0100
Branches: blender-v3.1-release
https://developer.blender.org/rBfacd9d82682b30e14e3a7db8fe6af830428d65cc

Cleanup: clang-format

===

M   intern/cycles/kernel/device/gpu/kernel.h
M   intern/cycles/kernel/device/gpu/parallel_active_index.h

===

diff --git a/intern/cycles/kernel/device/gpu/kernel.h 
b/intern/cycles/kernel/device/gpu/kernel.h
index 7ebf8777b91..c0679e28e65 100644
--- a/intern/cycles/kernel/device/gpu/kernel.h
+++ b/intern/cycles/kernel/device/gpu/kernel.h
@@ -296,7 +296,10 @@ 
ccl_gpu_kernel_threads(GPU_PARALLEL_ACTIVE_INDEX_DEFAULT_BLOCK_SIZE)
   ccl_gpu_kernel_lambda_pass.kernel_index = kernel_index;
 
   gpu_parallel_active_index_array(GPU_PARALLEL_ACTIVE_INDEX_DEFAULT_BLOCK_SIZE,
-  num_states, indices, num_indices, ccl_gpu_kernel_lambda_pass);
+  num_states,
+  indices,
+  num_indices,
+  ccl_gpu_kernel_lambda_pass);
 }
 
 ccl_gpu_kernel_threads(GPU_PARALLEL_ACTIVE_INDEX_DEFAULT_BLOCK_SIZE)
@@ -311,7 +314,10 @@ 
ccl_gpu_kernel_threads(GPU_PARALLEL_ACTIVE_INDEX_DEFAULT_BLOCK_SIZE)
   ccl_gpu_kernel_lambda_pass.kernel_index = kernel_index;
 
   gpu_parallel_active_index_array(GPU_PARALLEL_ACTIVE_INDEX_DEFAULT_BLOCK_SIZE,
-  num_states, indices, num_indices, ccl_gpu_kernel_lambda_pass);
+  num_states,
+  indices,
+  num_indices,
+  ccl_gpu_kernel_lambda_pass);
 }
 
 ccl_gpu_kernel_threads(GPU_PARALLEL_ACTIVE_INDEX_DEFAULT_BLOCK_SIZE)
@@ -323,7 +329,10 @@ 
ccl_gpu_kernel_threads(GPU_PARALLEL_ACTIVE_INDEX_DEFAULT_BLOCK_SIZE)
   ccl_gpu_kernel_lambda(INTEGRATOR_STATE(state, path, queued_kernel) != 0);
 
   gpu_parallel_active_index_array(GPU_PARALLEL_ACTIVE_INDEX_DEFAULT_BLOCK_SIZE,
-  num_states, indices, num_indices, ccl_gpu_kernel_lambda_pass);
+  num_states,
+  indices,
+  num_indices,
+  ccl_gpu_kernel_lambda_pass);
 }
 
 ccl_gpu_kernel_threads(GPU_PARALLEL_ACTIVE_INDEX_DEFAULT_BLOCK_SIZE)
@@ -336,7 +345,10 @@ 
ccl_gpu_kernel_threads(GPU_PARALLEL_ACTIVE_INDEX_DEFAULT_BLOCK_SIZE)
   ccl_gpu_kernel_lambda(INTEGRATOR_STATE(state, path, queued_kernel) == 0);
 
   gpu_parallel_active_index_array(GPU_PARALLEL_ACTIVE_INDEX_DEFAULT_BLOCK_SIZE,
-  num_states, indices + indices_offset, num_indices, 
ccl_gpu_kernel_lambda_pass);
+  num_states,
+  indices + indices_offset,
+  num_indices,
+  ccl_gpu_kernel_lambda_pass);
 }
 
 ccl_gpu_kernel_threads(GPU_PARALLEL_ACTIVE_INDEX_DEFAULT_BLOCK_SIZE)
@@ -349,7 +361,10 @@ 
ccl_gpu_kernel_threads(GPU_PARALLEL_ACTIVE_INDEX_DEFAULT_BLOCK_SIZE)
   ccl_gpu_kernel_lambda(INTEGRATOR_STATE(state, shadow_path, queued_kernel) == 
0);
 
   gpu_parallel_active_index_array(GPU_PARALLEL_ACTIVE_INDEX_DEFAULT_BLOCK_SIZE,
-  num_states, indices + indices_offset, num_indices, 
ccl_gpu_kernel_lambda_pass);
+  num_states,
+  indices + indices_offset,
+  num_indices,
+  ccl_gpu_kernel_lambda_pass);
 }
 
 ccl_gpu_kernel_threads(GPU_PARALLEL_SORTED_INDEX_DEFAULT_BLOCK_SIZE)
@@ -392,7 +407,10 @@ 
ccl_gpu_kernel_threads(GPU_PARALLEL_ACTIVE_INDEX_DEFAULT_BLOCK_SIZE)
   ccl_gpu_kernel_lambda_pass.num_active_paths = num_active_paths;
 
   gpu_parallel_active_index_array(GPU_PARALLEL_ACTIVE_INDEX_DEFAULT_BLOCK_SIZE,
-  num_states, indices, num_indices, ccl_gpu_kernel_lambda_pass);
+  num_states,
+  indices,
+  num_indices,
+  ccl_gpu_kernel_lambda_pass);
 }
 
 ccl_gpu_kernel_threads(GPU_PARALLEL_SORTED_INDEX_DEFAULT_BLOCK_SIZE)
@@ -425,7 +443,10 @@ 
ccl_gpu_kernel_threads(GPU_PARALLEL_ACTIVE_INDEX_DEFAULT_BLOCK_SIZE)
   ccl_gpu_kernel_lambda_pass.num_active_paths = num_active_paths;
 
   gpu_parallel_active_index_array(GPU_PARALLEL_ACTIVE_INDEX_DEFAULT_BLOCK_SIZE,
-  num_states, indices, num_indices, ccl_gpu_kernel_lambda_pass);
+  num_states,
+  indices,
+  num_indices,
+  ccl_gpu_kernel_lambda_pass);
 }
 
 ccl_gpu_kernel_threads(GPU_PARALLEL_SORTED_INDEX_DEFAULT_BLOCK_SIZE)
diff --git 

[Bf-blender-cvs] [3d1e9782571] master: Merge branch 'blender-v3.1-release'

2022-02-14 Thread Hans Goudey
Commit: 3d1e97825712bdaadf4038ba99fa7a0a87f7294c
Author: Hans Goudey
Date:   Mon Feb 14 18:01:52 2022 -0600
Branches: master
https://developer.blender.org/rB3d1e97825712bdaadf4038ba99fa7a0a87f7294c

Merge branch 'blender-v3.1-release'

===



===



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


[Bf-blender-cvs] [1f7f7ca14e5] blender-v3.1-release: Fix T95720: Spreadsheet missing volume grid info

2022-02-14 Thread Hans Goudey
Commit: 1f7f7ca14e50be457810efb109a03d98f78726fc
Author: Hans Goudey
Date:   Mon Feb 14 18:00:45 2022 -0600
Branches: blender-v3.1-release
https://developer.blender.org/rB1f7f7ca14e50be457810efb109a03d98f78726fc

Fix T95720: Spreadsheet missing volume grid info

The cell drawing code in 474adc6f883c2d5a854d7 was missing an
implementation for virtual arrays of strings.

===

M   source/blender/editors/space_spreadsheet/spreadsheet_layout.cc

===

diff --git a/source/blender/editors/space_spreadsheet/spreadsheet_layout.cc 
b/source/blender/editors/space_spreadsheet/spreadsheet_layout.cc
index f4b5ff819ed..29c3c7f5644 100644
--- a/source/blender/editors/space_spreadsheet/spreadsheet_layout.cc
+++ b/source/blender/editors/space_spreadsheet/spreadsheet_layout.cc
@@ -247,6 +247,23 @@ class SpreadsheetLayoutDrawer : public SpreadsheetDrawer {
 }
   }
 }
+else if (data.type().is()) {
+  uiDefIconTextBut(params.block,
+   UI_BTYPE_LABEL,
+   0,
+   ICON_NONE,
+   data.get(real_index).c_str(),
+   params.xmin,
+   params.ymin,
+   params.width,
+   params.height,
+   nullptr,
+   0,
+   0,
+   0,
+   0,
+   nullptr);
+}
   }
 
   void draw_float_vector(const CellDrawParams , const Span 
values) const

___
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] [6ca2f388e1c] temp-sculpt-colors: temp-sculpt-colors: more changes

2022-02-14 Thread Joseph Eagar
Commit: 6ca2f388e1cb2c8f943d7db01987b15319ce742b
Author: Joseph Eagar
Date:   Mon Feb 14 15:54:48 2022 -0800
Branches: temp-sculpt-colors
https://developer.blender.org/rB6ca2f388e1cb2c8f943d7db01987b15319ce742b

temp-sculpt-colors: more changes

Also, part of the wm_toolsystem bugfix was
missing, include it.

===

M   release/datafiles/locale
M   release/scripts/addons
M   source/blender/blenkernel/BKE_attribute.h
M   source/blender/blenkernel/intern/attribute.c
M   source/blender/blenloader/intern/versioning_300.c
M   source/blender/windowmanager/intern/wm_toolsystem.c
M   source/tools

===

diff --git a/release/datafiles/locale b/release/datafiles/locale
index 93612eddc7c..2d12637a69d 16
--- a/release/datafiles/locale
+++ b/release/datafiles/locale
@@ -1 +1 @@
-Subproject commit 93612eddc7cdfa82d1e7c31c362df0988388629b
+Subproject commit 2d12637a69df7643484a8a3655b7eeb6faa170a7
diff --git a/release/scripts/addons b/release/scripts/addons
index 9207696bbfa..e1d44bf3750 16
--- a/release/scripts/addons
+++ b/release/scripts/addons
@@ -1 +1 @@
-Subproject commit 9207696bbfac648c299f29f031ab5f18d8fa0077
+Subproject commit e1d44bf37501eb19a05bd0b0ba4484773531
diff --git a/source/blender/blenkernel/BKE_attribute.h 
b/source/blender/blenkernel/BKE_attribute.h
index f7e2dc1b816..bf383c8a82b 100644
--- a/source/blender/blenkernel/BKE_attribute.h
+++ b/source/blender/blenkernel/BKE_attribute.h
@@ -81,7 +81,7 @@ void BKE_id_attributes_active_set(struct ID *id, struct 
CustomDataLayer *layer);
 int *BKE_id_attributes_active_index_p(struct ID *id);
 
 CustomData *BKE_id_attributes_iterator_next_domain(struct ID *id, struct 
CustomDataLayer *layers);
-CustomDataLayer *BKE_id_attribute_from_index(const struct ID *id,
+CustomDataLayer *BKE_id_attribute_from_index(struct ID *id,
  int lookup_index,
  AttributeDomainMask domain_mask,
  CustomDataMask layer_mask);
diff --git a/source/blender/blenkernel/intern/attribute.c 
b/source/blender/blenkernel/intern/attribute.c
index 00fad8d2f5a..0bbb4d6d1b2 100644
--- a/source/blender/blenkernel/intern/attribute.c
+++ b/source/blender/blenkernel/intern/attribute.c
@@ -432,7 +432,7 @@ CustomData *BKE_id_attributes_iterator_next_domain(ID *id, 
CustomDataLayer *laye
   return NULL;
 }
 
-CustomDataLayer *BKE_id_attribute_from_index(const ID *id,
+CustomDataLayer *BKE_id_attribute_from_index(ID *id,
  int lookup_index,
  AttributeDomainMask domain_mask,
  CustomDataMask layer_mask)
diff --git a/source/blender/blenloader/intern/versioning_300.c 
b/source/blender/blenloader/intern/versioning_300.c
index 36910f9df5e..c88288aabc6 100644
--- a/source/blender/blenloader/intern/versioning_300.c
+++ b/source/blender/blenloader/intern/versioning_300.c
@@ -1959,20 +1959,6 @@ void blo_do_versions_300(FileData *fd, Library 
*UNUSED(lib), Main *bmain)
 }
   }
 
-  if (!MAIN_VERSION_ATLEAST(bmain, 302, 0)) {
-LISTBASE_FOREACH (Brush *, br, >brushes) {
-  /* buggy code in wm_toolsystem broke smear in old files,
- reset to defaults*/
-  if (br->sculpt_tool == SCULPT_TOOL_SMEAR) {
-br->alpha = 1.0f;
-br->spacing = 5;
-br->flag &= ~BRUSH_ALPHA_PRESSURE;
-br->flag &= ~BRUSH_SPACE_ATTEN;
-br->curve_preset = BRUSH_CURVE_SPHERE;
-  }
-}
-  }
-
   if (!MAIN_VERSION_ATLEAST(bmain, 300, 23)) {
 for (bScreen *screen = bmain->screens.first; screen; screen = 
screen->id.next) {
   LISTBASE_FOREACH (ScrArea *, area, >areabase) {
@@ -2370,42 +2356,6 @@ void blo_do_versions_300(FileData *fd, Library 
*UNUSED(lib), Main *bmain)
 }
   }
 
-  /* rebuild active/render color attribute references*/
-  if (!MAIN_VERSION_ATLEAST(bmain, 302, 3)) {
-LISTBASE_FOREACH (Mesh *, me, >meshes) {
-  for (int step = 0; step < 2; step++) {
-CustomDataLayer *actlayer = NULL;
-
-int vact1, vact2;
-
-if (step) {
-  vact1 = CustomData_get_render_layer_index(>vdata, CD_PROP_COLOR);
-  vact2 = CustomData_get_render_layer_index(>ldata, CD_MLOOPCOL);
-}
-else {
-  vact1 = CustomData_get_active_layer_index(>vdata, CD_PROP_COLOR);
-  vact2 = CustomData_get_active_layer_index(>ldata, CD_MLOOPCOL);
-}
-
-if (vact1 != -1) {
-  actlayer = me->vdata.layers + vact1;
-}
-else if (vact2 != -1) {
-  actlayer = me->ldata.layers + vact2;
-}
-
-if (actlayer) {
-  if (step) {
-BKE_id_attributes_render_color_set(>id, actlayer);
-  }
-  else {
-

[Bf-blender-cvs] [cceb8dd3edf] temp-sculpt-colors: Merge branch 'master' into temp-sculpt-colors

2022-02-14 Thread Joseph Eagar
Commit: cceb8dd3edf9167b7b9bec1a17e28bb3418223e6
Author: Joseph Eagar
Date:   Mon Feb 14 15:21:40 2022 -0800
Branches: temp-sculpt-colors
https://developer.blender.org/rBcceb8dd3edf9167b7b9bec1a17e28bb3418223e6

Merge branch 'master' into temp-sculpt-colors

===



===



___
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] [94ef9f09c99] temp-sculpt-colors: temp-sculpt-colors: Requested patch changes

2022-02-14 Thread Joseph Eagar
Commit: 94ef9f09c994144d3b6ccf6eb5227e9cd6573475
Author: Joseph Eagar
Date:   Mon Feb 14 15:20:20 2022 -0800
Branches: temp-sculpt-colors
https://developer.blender.org/rB94ef9f09c994144d3b6ccf6eb5227e9cd6573475

temp-sculpt-colors: Requested patch changes

===

M   source/blender/blenkernel/BKE_attribute.h
M   source/blender/draw/intern/mesh_extractors/extract_mesh_vbo_vcol.cc
M   source/blender/makesdna/DNA_mesh_types.h

===

diff --git a/source/blender/blenkernel/BKE_attribute.h 
b/source/blender/blenkernel/BKE_attribute.h
index a1a8506057f..f7e2dc1b816 100644
--- a/source/blender/blenkernel/BKE_attribute.h
+++ b/source/blender/blenkernel/BKE_attribute.h
@@ -52,9 +52,6 @@ typedef enum AttributeDomainMask {
 bool BKE_id_attributes_supported(struct ID *id);
 
 /**  Create a new attribute layer
- *
- *   \param list_mask restricts unique name check to certain customdata types,
- *  if in doubt just pass CD_MASK_PROP_ALL
  */
 struct CustomDataLayer *BKE_id_attribute_new(
 struct ID *id, const char *name, int type, AttributeDomain domain, struct 
ReportList *reports);
diff --git 
a/source/blender/draw/intern/mesh_extractors/extract_mesh_vbo_vcol.cc 
b/source/blender/draw/intern/mesh_extractors/extract_mesh_vbo_vcol.cc
index 34883d65640..d8dfad5b2cc 100644
--- a/source/blender/draw/intern/mesh_extractors/extract_mesh_vbo_vcol.cc
+++ b/source/blender/draw/intern/mesh_extractors/extract_mesh_vbo_vcol.cc
@@ -146,7 +146,7 @@ static void extract_vcol_init(const MeshRenderData *mr,
 
   Mesh query_mesh = *mr->me;
   BKE_id_attribute_copy_domains_temp(
-  reinterpret_cast(_mesh), cd_vdata, nullptr, cd_ldata, 
nullptr, nullptr);
+  _mesh.id, cd_vdata, nullptr, cd_ldata, nullptr, nullptr);
 
   CustomDataLayer *active_color = 
BKE_id_attributes_active_color_get(_mesh.id);
   CustomDataLayer *render_color = 
BKE_id_attributes_render_color_get(_mesh.id);
diff --git a/source/blender/makesdna/DNA_mesh_types.h 
b/source/blender/makesdna/DNA_mesh_types.h
index 85e4f5899ef..f242be855c8 100644
--- a/source/blender/makesdna/DNA_mesh_types.h
+++ b/source/blender/makesdna/DNA_mesh_types.h
@@ -139,11 +139,6 @@ typedef struct Mesh_Runtime {
 
 } Mesh_Runtime;
 
-typedef struct AttributeRef {
-  int domain, type;
-  char name[64];
-} AttributeRef;
-
 typedef struct Mesh {
   ID id;
   /** Animation data (must be immediately after id for utilities to use it). */

___
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] [ad1f8a50b02] master: Cleanup: Use C++ math functions

2022-02-14 Thread Hans Goudey
Commit: ad1f8a50b02652e52e44ef06e24d2825c677be4e
Author: Hans Goudey
Date:   Mon Feb 14 15:48:46 2022 -0600
Branches: master
https://developer.blender.org/rBad1f8a50b02652e52e44ef06e24d2825c677be4e

Cleanup: Use C++ math functions

Use functions from the `math` and `std` namespaces instead
of from `BLI_math_vector.h`.

===

M   source/blender/blenlib/intern/noise.cc

===

diff --git a/source/blender/blenlib/intern/noise.cc 
b/source/blender/blenlib/intern/noise.cc
index 27e074fc3c1..24af186c1d5 100644
--- a/source/blender/blenlib/intern/noise.cc
+++ b/source/blender/blenlib/intern/noise.cc
@@ -581,7 +581,7 @@ float perlin_fractal(float4 position, float octaves, float 
roughness)
  * positions to act as a seed since the noise functions don't have seed values.
  * The offset's components are in the range [100, 200], not too high to cause
  * bad precision and not too small to be noticeable. We use float seed because
- * OSL only support float hashes and we need to maintain compatibility with it.
+ * OSL only supports float hashes and we need to maintain compatibility with 
it.
  */
 
 BLI_INLINE float random_float_offset(float seed)
@@ -727,7 +727,7 @@ float musgrave_fBm(const float co,
   float p = co;
   float value = 0.0f;
   float pwr = 1.0f;
-  const float pwHL = powf(lacunarity, -H);
+  const float pwHL = std::pow(lacunarity, -H);
   const float octaves = CLAMPIS(octaves_unclamped, 0.0f, 15.0f);
 
   for (int i = 0; i < (int)octaves; i++) {
@@ -752,7 +752,7 @@ float musgrave_multi_fractal(const float co,
   float p = co;
   float value = 1.0f;
   float pwr = 1.0f;
-  const float pwHL = powf(lacunarity, -H);
+  const float pwHL = std::pow(lacunarity, -H);
   const float octaves = CLAMPIS(octaves_unclamped, 0.0f, 15.0f);
 
   for (int i = 0; i < (int)octaves; i++) {
@@ -776,11 +776,11 @@ float musgrave_hetero_terrain(const float co,
   const float offset)
 {
   float p = co;
-  const float pwHL = powf(lacunarity, -H);
+  const float pwHL = std::pow(lacunarity, -H);
   float pwr = pwHL;
   const float octaves = CLAMPIS(octaves_unclamped, 0.0f, 15.0f);
 
-  /* first unscaled octave of function; later octaves are scaled */
+  /* First unscaled octave of function; later octaves are scaled. */
   float value = offset + perlin_signed(p);
   p *= lacunarity;
 
@@ -808,7 +808,7 @@ float musgrave_hybrid_multi_fractal(const float co,
 const float gain)
 {
   float p = co;
-  const float pwHL = powf(lacunarity, -H);
+  const float pwHL = std::pow(lacunarity, -H);
   float pwr = pwHL;
 
   float value = perlin_signed(p) + offset;
@@ -845,10 +845,10 @@ float musgrave_ridged_multi_fractal(const float co,
 const float gain)
 {
   float p = co;
-  const float pwHL = powf(lacunarity, -H);
+  const float pwHL = std::pow(lacunarity, -H);
   float pwr = pwHL;
 
-  float signal = offset - fabsf(perlin_signed(p));
+  float signal = offset - std::abs(perlin_signed(p));
   signal *= signal;
   float value = signal;
   float weight = 1.0f;
@@ -858,7 +858,7 @@ float musgrave_ridged_multi_fractal(const float co,
   for (int i = 1; i < (int)octaves; i++) {
 p *= lacunarity;
 weight = CLAMPIS(signal * gain, 0.0f, 1.0f);
-signal = offset - fabsf(perlin_signed(p));
+signal = offset - std::abs(perlin_signed(p));
 signal *= signal;
 signal *= weight;
 value += signal * pwr;
@@ -878,7 +878,7 @@ float musgrave_fBm(const float2 co,
   float2 p = co;
   float value = 0.0f;
   float pwr = 1.0f;
-  const float pwHL = powf(lacunarity, -H);
+  const float pwHL = std::pow(lacunarity, -H);
   const float octaves = CLAMPIS(octaves_unclamped, 0.0f, 15.0f);
 
   for (int i = 0; i < (int)octaves; i++) {
@@ -903,7 +903,7 @@ float musgrave_multi_fractal(const float2 co,
   float2 p = co;
   float value = 1.0f;
   float pwr = 1.0f;
-  const float pwHL = powf(lacunarity, -H);
+  const float pwHL = std::pow(lacunarity, -H);
   const float octaves = CLAMPIS(octaves_unclamped, 0.0f, 15.0f);
 
   for (int i = 0; i < (int)octaves; i++) {
@@ -927,10 +927,10 @@ float musgrave_hetero_terrain(const float2 co,
   const float offset)
 {
   float2 p = co;
-  const float pwHL = powf(lacunarity, -H);
+  const float pwHL = std::pow(lacunarity, -H);
   float pwr = pwHL;
 
-  /* first unscaled octave of function; later octaves are scaled */
+  /* First unscaled octave of function; later octaves are scaled. */
   float value = offset + perlin_signed(p);
   p *= lacunarity;
 
@@ -960,7 +960,7 @@ float musgrave_hybrid_multi_fractal(const float2 co,
 const float gain)
 {
   float2 p = co;
-  const float pwHL = powf(lacunarity, -H);
+  const float pwHL = std::pow(lacunarity, -H);
   float pwr = pwHL;
 
   float value = perlin_signed(p) + offset;
@@ -997,10 

[Bf-blender-cvs] [761274fc196] master: Merge branch 'blender-v3.1-release'

2022-02-14 Thread Hans Goudey
Commit: 761274fc196c957ed52455e2426779ab77ca777e
Author: Hans Goudey
Date:   Mon Feb 14 12:35:33 2022 -0600
Branches: master
https://developer.blender.org/rB761274fc196c957ed52455e2426779ab77ca777e

Merge branch 'blender-v3.1-release'

===



===



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


[Bf-blender-cvs] [33d5ecd5b5e] blender-v3.1-release: Fix T95252: Move duplicate node doesn't do edge-panning

2022-02-14 Thread Hans Goudey
Commit: 33d5ecd5b5e073c230a1960010110c5f11adb5ab
Author: Hans Goudey
Date:   Mon Feb 14 12:34:54 2022 -0600
Branches: blender-v3.1-release
https://developer.blender.org/rB33d5ecd5b5e073c230a1960010110c5f11adb5ab

Fix T95252: Move duplicate node doesn't do edge-panning

Set "view2d_edge_pan" to true for the NODE_OT_translate_attach operator,
which is used by the duplication operator. This is done in the keymap so
that it's not hard-coded.

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

===

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

===

diff --git a/release/scripts/presets/keyconfig/keymap_data/blender_default.py 
b/release/scripts/presets/keyconfig/keymap_data/blender_default.py
index 5367d9b33f9..5e6145723f4 100644
--- a/release/scripts/presets/keyconfig/keymap_data/blender_default.py
+++ b/release/scripts/presets/keyconfig/keymap_data/blender_default.py
@@ -2029,8 +2029,10 @@ def km_node_editor(params):
 ("node.link_make", {"type": 'F', "value": 'PRESS', "shift": True},
  {"properties": [("replace", True)]}),
 op_menu("NODE_MT_add", {"type": 'A', "value": 'PRESS', "shift": True}),
-("node.duplicate_move", {"type": 'D', "value": 'PRESS', "shift": 
True}, None),
-("node.duplicate_move_keep_inputs", {"type": 'D', "value": 'PRESS', 
"shift": True, "ctrl": True}, None),
+("node.duplicate_move", {"type": 'D', "value": 'PRESS', "shift": True},
+ {"properties": [("NODE_OT_translate_attach", 
[("TRANSFORM_OT_translate", [("view2d_edge_pan", True)])])]}),
+("node.duplicate_move_keep_inputs", {"type": 'D', "value": 'PRESS', 
"shift": True, "ctrl": True},
+ {"properties": [("NODE_OT_translate_attach", 
[("TRANSFORM_OT_translate", [("view2d_edge_pan", True)])])]}),
 ("node.parent_set", {"type": 'P', "value": 'PRESS', "ctrl": True}, 
None),
 ("node.detach", {"type": 'P', "value": 'PRESS', "alt": True}, None),
 ("node.join", {"type": 'J', "value": 'PRESS', "ctrl": True}, None),
diff --git 
a/release/scripts/presets/keyconfig/keymap_data/industry_compatible_data.py 
b/release/scripts/presets/keyconfig/keymap_data/industry_compatible_data.py
index 3019322d340..d0f764c7252 100644
--- a/release/scripts/presets/keyconfig/keymap_data/industry_compatible_data.py
+++ b/release/scripts/presets/keyconfig/keymap_data/industry_compatible_data.py
@@ -1126,7 +1126,8 @@ def km_node_editor(params):
  {"properties": [("replace", False)]}),
 ("node.link_make", {"type": 'L', "value": 'PRESS', "shift": True},
  {"properties": [("replace", True)]}),
-("node.duplicate_move", {"type": 'D', "value": 'PRESS', "ctrl": True}, 
None),
+("node.duplicate_move", {"type": 'D', "value": 'PRESS', "ctrl": True},
+ {"properties": [("NODE_OT_translate_attach", 
[("TRANSFORM_OT_translate", [("view2d_edge_pan", True)])])]}),
 ("node.parent_set", {"type": 'P', "value": 'PRESS'}, None),
 ("node.join", {"type": 'J', "value": 'PRESS', "ctrl": True}, None),
 ("node.hide_toggle", {"type": 'H', "value": 'PRESS', "ctrl": True}, 
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] [7773393d35a] master: Cleanup: Pass const Scene to mesh evaluation

2022-02-14 Thread Hans Goudey
Commit: 7773393d35ac0c43643786754f04d860c3c329fc
Author: Hans Goudey
Date:   Mon Feb 14 12:05:54 2022 -0600
Branches: master
https://developer.blender.org/rB7773393d35ac0c43643786754f04d860c3c329fc

Cleanup: Pass const Scene to mesh evaluation

===

M   source/blender/blenkernel/BKE_DerivedMesh.h
M   source/blender/blenkernel/BKE_mesh_runtime.h
M   source/blender/blenkernel/BKE_paint.h
M   source/blender/blenkernel/intern/DerivedMesh.cc
M   source/blender/blenkernel/intern/paint.c

===

diff --git a/source/blender/blenkernel/BKE_DerivedMesh.h 
b/source/blender/blenkernel/BKE_DerivedMesh.h
index f1c523c6cd2..fea5f515db8 100644
--- a/source/blender/blenkernel/BKE_DerivedMesh.h
+++ b/source/blender/blenkernel/BKE_DerivedMesh.h
@@ -299,22 +299,22 @@ void mesh_get_mapped_verts_coords(struct Mesh *me_eval, 
float (*r_cos)[3], int t
  * Same as above but won't use render settings.
  */
 struct Mesh *editbmesh_get_eval_cage(struct Depsgraph *depsgraph,
- struct Scene *scene,
- struct Object *,
+ const struct Scene *scene,
+ struct Object *obedit,
  struct BMEditMesh *em,
  const struct CustomData_MeshMasks 
*dataMask);
 struct Mesh *editbmesh_get_eval_cage_from_orig(struct Depsgraph *depsgraph,
-   struct Scene *scene,
+   const struct Scene *scene,
struct Object *obedit,
const struct 
CustomData_MeshMasks *dataMask);
 
 float (*editbmesh_vert_coords_alloc(struct BMEditMesh *em, int 
*r_vert_len))[3];
-bool editbmesh_modifier_is_enabled(struct Scene *scene,
+bool editbmesh_modifier_is_enabled(const struct Scene *scene,
const struct Object *ob,
struct ModifierData *md,
bool has_prev_mesh);
 void makeDerivedMesh(struct Depsgraph *depsgraph,
- struct Scene *scene,
+ const struct Scene *scene,
  struct Object *ob,
  const struct CustomData_MeshMasks *dataMask);
 
diff --git a/source/blender/blenkernel/BKE_mesh_runtime.h 
b/source/blender/blenkernel/BKE_mesh_runtime.h
index a007e04f066..0e78f9d7e15 100644
--- a/source/blender/blenkernel/BKE_mesh_runtime.h
+++ b/source/blender/blenkernel/BKE_mesh_runtime.h
@@ -72,26 +72,26 @@ void BKE_mesh_runtime_verttri_from_looptri(struct MVertTri 
*r_verttri,
  * For now keep the names similar to avoid confusion. */
 
 struct Mesh *mesh_get_eval_final(struct Depsgraph *depsgraph,
- struct Scene *scene,
+ const struct Scene *scene,
  struct Object *ob,
  const struct CustomData_MeshMasks *dataMask);
 
 struct Mesh *mesh_get_eval_deform(struct Depsgraph *depsgraph,
-  struct Scene *scene,
+  const struct Scene *scene,
   struct Object *ob,
   const struct CustomData_MeshMasks *dataMask);
 
 struct Mesh *mesh_create_eval_final(struct Depsgraph *depsgraph,
-struct Scene *scene,
+const struct Scene *scene,
 struct Object *ob,
 const struct CustomData_MeshMasks 
*dataMask);
 
 struct Mesh *mesh_create_eval_no_deform(struct Depsgraph *depsgraph,
-struct Scene *scene,
+const struct Scene *scene,
 struct Object *ob,
 const struct CustomData_MeshMasks 
*dataMask);
 struct Mesh *mesh_create_eval_no_deform_render(struct Depsgraph *depsgraph,
-   struct Scene *scene,
+   const struct Scene *scene,
struct Object *ob,
const struct 
CustomData_MeshMasks *dataMask);
 
diff --git a/source/blender/blenkernel/BKE_paint.h 
b/source/blender/blenkernel/BKE_paint.h
index f38152af327..1f37e95a023 100644
--- a/source/blender/blenkernel/BKE_paint.h
+++ b/source/blender/blenkernel/BKE_paint.h
@@ -661,7 +661,8 @@ void BKE_sculpt_update_object_after_eval(struct Depsgraph 
*depsgraph, struct Obj
  * Sculpt mode handles multi-res differently from regular meshes, 

[Bf-blender-cvs] [e26194e80d9] master: Merge branch 'blender-v3.1-release'

2022-02-14 Thread Sergey Sharybin
Commit: e26194e80d95c345c1292d9879c24703df0d89c2
Author: Sergey Sharybin
Date:   Mon Feb 14 18:31:19 2022 +0100
Branches: master
https://developer.blender.org/rBe26194e80d95c345c1292d9879c24703df0d89c2

Merge branch 'blender-v3.1-release'

===



===



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


[Bf-blender-cvs] [6ae08da5c8a] blender-v3.1-release: Fix T95756: Crash inserting geometry node after linking modifier

2022-02-14 Thread Sergey Sharybin
Commit: 6ae08da5c8a1b39cfba0c8c3bd567321d0768f28
Author: Sergey Sharybin
Date:   Mon Feb 14 18:19:13 2022 +0100
Branches: blender-v3.1-release
https://developer.blender.org/rB6ae08da5c8a1b39cfba0c8c3bd567321d0768f28

Fix T95756: Crash inserting geometry node after linking modifier

The root issue was caused by a mistake in modifier copy data which was
wrongly re-generating source modifier data identifier.

The c8cca8885181 simply exposed a bug in code which always was there
since the modifiers session UUID was introduced.

Shows an importance of const qualifier :)

===

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

===

diff --git a/source/blender/blenkernel/intern/modifier.c 
b/source/blender/blenkernel/intern/modifier.c
index 4f170535d18..d2fadbbd8ac 100644
--- a/source/blender/blenkernel/intern/modifier.c
+++ b/source/blender/blenkernel/intern/modifier.c
@@ -391,7 +391,7 @@ void BKE_modifier_copydata_ex(ModifierData *md, 
ModifierData *target, const int
   }
   else {
 /* In the case copyData made full byte copy force UUID to be re-generated. 
*/
-BKE_modifier_session_uuid_generate(md);
+BKE_modifier_session_uuid_generate(target);
   }
 }

___
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] [8f48dd8f721] asset-browser-grid-view: Merge branch 'master' into asset-browser-grid-view

2022-02-14 Thread Julian Eisel
Commit: 8f48dd8f721e69c325d90c6ca0ddb20dede124f8
Author: Julian Eisel
Date:   Mon Feb 14 17:57:52 2022 +0100
Branches: asset-browser-grid-view
https://developer.blender.org/rB8f48dd8f721e69c325d90c6ca0ddb20dede124f8

Merge branch 'master' into asset-browser-grid-view

===



===



___
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] [d46357dd25a] asset-browser-grid-view: Merge branch 'master' into asset-browser-grid-view

2022-02-14 Thread Julian Eisel
Commit: d46357dd25a9f58a8abb660983286cf3e1ef6b64
Author: Julian Eisel
Date:   Mon Feb 14 17:57:16 2022 +0100
Branches: asset-browser-grid-view
https://developer.blender.org/rBd46357dd25a9f58a8abb660983286cf3e1ef6b64

Merge branch 'master' into asset-browser-grid-view

===



===



___
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] [696295f8494] asset-browser-grid-view: Support active item

2022-02-14 Thread Julian Eisel
Commit: 696295f84944da8e830c757a8c00126723024c5b
Author: Julian Eisel
Date:   Mon Feb 14 17:48:51 2022 +0100
Branches: asset-browser-grid-view
https://developer.blender.org/rB696295f84944da8e830c757a8c00126723024c5b

Support active item

Makes activating assets in the Asset Browser work. The active item is only
stored at the UI level now, so it's not stored in files, not accessible via
context and is lost when changing editors. The Asset Browser itself will have
to get a way to store that.

===

M   source/blender/editors/include/UI_grid_view.hh
M   source/blender/editors/include/UI_interface.h
M   source/blender/editors/interface/grid_view.cc
M   source/blender/editors/interface/interface.c
M   source/blender/editors/interface/interface_handlers.c
M   source/blender/editors/interface/interface_intern.h
M   source/blender/editors/interface/interface_view.cc
M   source/blender/editors/interface/tree_view.cc

===

diff --git a/source/blender/editors/include/UI_grid_view.hh 
b/source/blender/editors/include/UI_grid_view.hh
index fc0de424ef0..e00dabd4cda 100644
--- a/source/blender/editors/include/UI_grid_view.hh
+++ b/source/blender/editors/include/UI_grid_view.hh
@@ -49,6 +49,8 @@ class AbstractGridViewItem {
 
   const AbstractGridView *view_;
 
+  bool is_active_ = false;
+
  protected:
   /** This label is used as the default way to identifying an item in the 
view. */
   std::string label_{};
@@ -60,8 +62,6 @@ class AbstractGridViewItem {
 
   virtual void build_grid_tile(uiLayout ) const = 0;
 
-  const AbstractGridView _view() const;
-
   /**
* Compare this item to \a other to check if they represent the same data.
* Used to recognize an item from a previous redraw, to be able to keep its 
state (e.g. active,
@@ -70,9 +70,36 @@ class AbstractGridViewItem {
*/
   virtual bool matches(const AbstractGridViewItem ) const;
 
+  const AbstractGridView _view() const;
+
+  /**
+   * Requires the tree to have completed reconstruction, see 
#is_reconstructed(). Otherwise we
+   * can't be sure about the item state.
+   */
+  bool is_active() const;
+
  protected:
   AbstractGridViewItem() = default;
 
+  /** Called when the item's state changes from inactive to active. */
+  virtual void on_activate();
+
+  /**
+   * Copy persistent state (e.g. active, selection, etc.) from a matching item 
of
+   * the last redraw to this item. If sub-classes introduce more advanced 
state they should
+   * override this and make it update their state accordingly.
+   */
+  virtual void update_from_old(const AbstractGridViewItem );
+
+  /**
+   * Activates this item, deactivates other items, and calls the
+   * #AbstractGridViewItem::on_activate() function.
+   * Requires the tree to have completed reconstruction, see 
#is_reconstructed(). Otherwise the
+   * actual item state is unknown, possibly calling state-change update 
functions incorrectly.
+   */
+  void activate();
+  void deactivate();
+
  private:
   static void grid_tile_click_fn(bContext *, void *but_arg1, void *);
   void add_grid_tile_button(uiBlock );
@@ -91,12 +118,14 @@ struct GridViewStyle {
 };
 
 class AbstractGridView {
+  friend class AbstractGridViewItem;
   friend class GridViewBuilder;
   friend class GridViewLayoutBuilder;
 
  protected:
   Vector> items_;
   GridViewStyle style_;
+  bool is_reconstructed_ = false;
 
  public:
   AbstractGridView();
@@ -128,7 +157,22 @@ class AbstractGridView {
  protected:
   virtual void build_items() = 0;
 
+  /**
+   * Check if the view is fully (re-)constructed. That means, both 
#build_items() and
+   * #update_from_old() have finished.
+   */
+  bool is_reconstructed() const;
+
  private:
+  /**
+   * Match the grid-view against an earlier version of itself (if any) and 
copy the old UI state
+   * (e.g. active, selected, renaming, etc.) to the new one. See
+   * #AbstractGridViewItem.update_from_old().
+   */
+  void update_from_old(uiBlock _block);
+  AbstractGridViewItem *find_matching_item(const AbstractGridViewItem 
_item,
+   const AbstractGridView ) const;
+
   /**
* Add an already constructed item, moving ownership to the grid-view.
* All items must be added through this, it handles important invariants!
@@ -169,7 +213,6 @@ class GridViewBuilder {
  */
 class PreviewGridItem : public AbstractGridViewItem {
  public:
-  std::string label{};
   int preview_icon_id = ICON_NONE;
 
   PreviewGridItem(StringRef label, int preview_icon_id);
diff --git a/source/blender/editors/include/UI_interface.h 
b/source/blender/editors/include/UI_interface.h
index cf8233d565d..a32774eb717 100644
--- a/source/blender/editors/include/UI_interface.h
+++ b/source/blender/editors/include/UI_interface.h
@@ -3165,6 +3165,7 @@ void UI_interface_tag_script_reload(void);
 void UI_block_views_listen(const uiBlock 

[Bf-blender-cvs] [c9c332f4224] asset-browser-grid-view: Fix failed assert with small region size

2022-02-14 Thread Julian Eisel
Commit: c9c332f42240f488ddb568041ba376ed37efd969
Author: Julian Eisel
Date:   Mon Feb 14 16:15:29 2022 +0100
Branches: asset-browser-grid-view
https://developer.blender.org/rBc9c332f42240f488ddb568041ba376ed37efd969

Fix failed assert with small region size

If there's not enough space to draw at least one item per row, there would be a
failed assert in the code to skip drawing items scrolled out of view.

===

M   source/blender/editors/interface/grid_view.cc

===

diff --git a/source/blender/editors/interface/grid_view.cc 
b/source/blender/editors/interface/grid_view.cc
index 47b654ba583..85c3a32c10f 100644
--- a/source/blender/editors/interface/grid_view.cc
+++ b/source/blender/editors/interface/grid_view.cc
@@ -184,9 +184,10 @@ IndexRange 
BuildOnlyVisibleButtonsHelper::get_visible_range() const
   }
 
   const float view_height = BLI_rctf_size_y(_.cur);
-  const int count_rows_in_view = round_fl_to_int(view_height / 
style_.tile_height);
+  const int count_rows_in_view = std::max(round_fl_to_int(view_height / 
style_.tile_height), 1);
   max_items_in_view = (count_rows_in_view + 1) * cols_per_row_;
 
+  BLI_assert(max_items_in_view > 0);
   return IndexRange(first_idx_in_view, max_items_in_view);
 }
 
@@ -285,7 +286,7 @@ void GridViewLayoutBuilder::build_from_view(const 
AbstractGridView _view,
   uiLayout  = *uiLayoutColumn(current_layout(), false);
   const GridViewStyle  = grid_view.get_style();
 
-  const int cols_per_row = uiLayoutGetWidth() / style.tile_width;
+  const int cols_per_row = std::max(uiLayoutGetWidth() / 
style.tile_width, 1);
 
   BuildOnlyVisibleButtonsHelper build_visible_helper(v2d, grid_view, 
cols_per_row);

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

2022-02-14 Thread Thomas Dinges
Commit: 19403fc852224b2c29df3e5f1f2106ba91f105a2
Author: Thomas Dinges
Date:   Mon Feb 14 17:48:52 2022 +0100
Branches: master
https://developer.blender.org/rB19403fc852224b2c29df3e5f1f2106ba91f105a2

Merge branch 'blender-v3.1-release'

===



===



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


[Bf-blender-cvs] [a5edff4b73b] blender-v3.1-release: Fix T95778, the macOS minimum versions have been increased for Metal.

2022-02-14 Thread Thomas Dinges
Commit: a5edff4b73ba74155dcad93103e2fef2c59df67f
Author: Thomas Dinges
Date:   Mon Feb 14 17:47:35 2022 +0100
Branches: blender-v3.1-release
https://developer.blender.org/rBa5edff4b73ba74155dcad93103e2fef2c59df67f

Fix T95778, the macOS minimum versions have been increased for Metal.

===

M   intern/cycles/blender/addon/properties.py

===

diff --git a/intern/cycles/blender/addon/properties.py 
b/intern/cycles/blender/addon/properties.py
index 01e73d7ed03..ef686fc0c70 100644
--- a/intern/cycles/blender/addon/properties.py
+++ b/intern/cycles/blender/addon/properties.py
@@ -1498,7 +1498,8 @@ class CyclesPreferences(bpy.types.AddonPreferences):
 if sys.platform[:3] == "win":
 col.label(text="and AMD Radeon Pro 21.Q4 driver or newer", 
icon='BLANK1')
 elif device_type == 'METAL':
-col.label(text="Requires Apple Silicon and macOS 12.0 or 
newer", icon='BLANK1')
+col.label(text="Requires Apple Silicon with macOS 12.2 or 
newer", icon='BLANK1')
+col.label(text="or AMD with macOS 12.3 or newer", 
icon='BLANK1')
 return
 
 for device in devices:

___
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] [d8e2f612ec5] master: Cleaunp: Modify comment

2022-02-14 Thread Antonio Vazquez
Commit: d8e2f612ec52ce0272cbc8a5e9ff0c6b89ce16a6
Author: Antonio Vazquez
Date:   Mon Feb 14 16:39:06 2022 +0100
Branches: master
https://developer.blender.org/rBd8e2f612ec52ce0272cbc8a5e9ff0c6b89ce16a6

Cleaunp: Modify comment

===

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

===

diff --git a/source/blender/editors/gpencil/gpencil_fill.c 
b/source/blender/editors/gpencil/gpencil_fill.c
index 8095cc479bc..8be34a35ca9 100644
--- a/source/blender/editors/gpencil/gpencil_fill.c
+++ b/source/blender/editors/gpencil/gpencil_fill.c
@@ -1239,7 +1239,7 @@ static bool contract_shape(ImBuf *ibuf)
   const float clear[4] = {0.0f, 0.0f, 0.0f, 0.0f};
   const int max_size = (ibuf->x * ibuf->y) - 1;
 
-  /* detect pixels and expand into red areas */
+  /* Detect if pixel is near of no green pixels and mark green to be cleared. 
*/
   for (int row = 0; row < ibuf->y; row++) {
 if (!is_row_filled(ibuf, row)) {
   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] [3b142248819] master: GPencil: Fill Dilate using negative values contract the fill area

2022-02-14 Thread Antonio Vazquez
Commit: 3b14224881958297d88b70050ddae93d19c3f244
Author: Antonio Vazquez
Date:   Mon Feb 14 16:30:09 2022 +0100
Branches: master
https://developer.blender.org/rB3b14224881958297d88b70050ddae93d19c3f244

GPencil: Fill Dilate using negative values contract the fill area

This is requested by artist for some animation styles where is necessary to 
fill the area, but create a gap between fill and stroke.

Also some code cleanup and fix a bug in dilate for top area.

Reviewed By: pepeland, mendio

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

===

M   source/blender/editors/gpencil/gpencil_fill.c
M   source/blender/makesrna/intern/rna_brush.c

===

diff --git a/source/blender/editors/gpencil/gpencil_fill.c 
b/source/blender/editors/gpencil/gpencil_fill.c
index 5eca3a4eb6c..8095cc479bc 100644
--- a/source/blender/editors/gpencil/gpencil_fill.c
+++ b/source/blender/editors/gpencil/gpencil_fill.c
@@ -1004,7 +1004,6 @@ static void gpencil_invert_image(tGPDfill *tgpf)
   ibuf = BKE_image_acquire_ibuf(tgpf->ima, NULL, );
 
   const int maxpixel = (ibuf->x * ibuf->y) - 1;
-  const int center = ibuf->x / 2;
 
   for (int v = maxpixel; v != 0; v--) {
 float color[4];
@@ -1016,15 +1015,6 @@ static void gpencil_invert_image(tGPDfill *tgpf)
 /* Red->Green */
 else if (color[0] == 1.0f) {
   set_pixel(ibuf, v, fill_col[1]);
-  /* Add thickness of 2 pixels to avoid too thin lines, but avoid extremes 
of the pixel line.
-   */
-  int row = v / ibuf->x;
-  int lowpix = row * ibuf->x;
-  int highpix = lowpix + ibuf->x - 1;
-  if ((v > lowpix) && (v < highpix)) {
-int offset = (v % ibuf->x < center) ? 1 : -1;
-set_pixel(ibuf, v + offset, fill_col[1]);
-  }
 }
 else {
   /* Set to Transparent. */
@@ -1120,11 +1110,14 @@ static void gpencil_erase_processed_area(tGPDfill *tgpf)
  */
 static bool dilate_shape(ImBuf *ibuf)
 {
+#define IS_RED (color[0] == 1.0f)
+#define IS_GREEN (color[1] == 1.0f)
+
   bool done = false;
 
   BLI_Stack *stack = BLI_stack_new(sizeof(int), __func__);
   const float green[4] = {0.0f, 1.0f, 0.0f, 1.0f};
-  // const int maxpixel = (ibuf->x * ibuf->y) - 1;
+  const int max_size = (ibuf->x * ibuf->y) - 1;
   /* detect pixels and expand into red areas */
   for (int row = 0; row < ibuf->y; row++) {
 if (!is_row_filled(ibuf, row)) {
@@ -1137,7 +1130,7 @@ static bool dilate_shape(ImBuf *ibuf)
   float color[4];
   int index;
   get_pixel(ibuf, v, color);
-  if (color[1] == 1.0f) {
+  if (IS_GREEN) {
 int tp = 0;
 int bm = 0;
 int lt = 0;
@@ -1147,7 +1140,7 @@ static bool dilate_shape(ImBuf *ibuf)
 if (v - 1 >= 0) {
   index = v - 1;
   get_pixel(ibuf, index, color);
-  if (color[0] == 1.0f) {
+  if (IS_RED) {
 BLI_stack_push(stack, );
 lt = index;
   }
@@ -1156,25 +1149,25 @@ static bool dilate_shape(ImBuf *ibuf)
 if (v + 1 <= maxpixel) {
   index = v + 1;
   get_pixel(ibuf, index, color);
-  if (color[0] == 1.0f) {
+  if (IS_RED) {
 BLI_stack_push(stack, );
 rt = index;
   }
 }
 /* pixel top */
-if (v + (ibuf->x * 1) <= maxpixel) {
-  index = v + (ibuf->x * 1);
+if (v + ibuf->x <= max_size) {
+  index = v + ibuf->x;
   get_pixel(ibuf, index, color);
-  if (color[0] == 1.0f) {
+  if (IS_RED) {
 BLI_stack_push(stack, );
 tp = index;
   }
 }
 /* pixel bottom */
-if (v - (ibuf->x * 1) >= 0) {
-  index = v - (ibuf->x * 1);
+if (v - ibuf->x >= 0) {
+  index = v - ibuf->x;
   get_pixel(ibuf, index, color);
-  if (color[0] == 1.0f) {
+  if (IS_RED) {
 BLI_stack_push(stack, );
 bm = index;
   }
@@ -1183,7 +1176,7 @@ static bool dilate_shape(ImBuf *ibuf)
 if (tp && lt) {
   index = tp - 1;
   get_pixel(ibuf, index, color);
-  if (color[0] == 1.0f) {
+  if (IS_RED) {
 BLI_stack_push(stack, );
   }
 }
@@ -1191,7 +1184,7 @@ static bool dilate_shape(ImBuf *ibuf)
 if (tp && rt) {
   index = tp + 1;
   get_pixel(ibuf, index, color);
-  if (color[0] == 1.0f) {
+  if (IS_RED) {
 BLI_stack_push(stack, );
   }
 }
@@ -1199,7 +1192,7 @@ static bool dilate_shape(ImBuf *ibuf)
 if (bm && lt) {
   index = bm - 1;
   get_pixel(ibuf, index, color);
-  if (color[0] == 1.0f) {
+  if (IS_RED) {
 BLI_stack_push(stack, );
   }
 }
@@ -1207,7 +1200,7 @@ static bool dilate_shape(ImBuf *ibuf)
 if (bm && rt) {
   index 

[Bf-blender-cvs] [65d4c58060e] blender-v3.1-release: Fix Cycles assert in debug mode after recent changes

2022-02-14 Thread Brecht Van Lommel
Commit: 65d4c58060eae4f544e4e483a38ca2b8d30bd707
Author: Brecht Van Lommel
Date:   Mon Feb 14 15:33:47 2022 +0100
Branches: blender-v3.1-release
https://developer.blender.org/rB65d4c58060eae4f544e4e483a38ca2b8d30bd707

Fix Cycles assert in debug mode after recent changes

We sometimes call start() on already started renders, just do nothing then.

Ref D14086

===

M   intern/cycles/session/session.cpp

===

diff --git a/intern/cycles/session/session.cpp 
b/intern/cycles/session/session.cpp
index f6e06f20aba..8fcb5c9ac96 100644
--- a/intern/cycles/session/session.cpp
+++ b/intern/cycles/session/session.cpp
@@ -110,7 +110,10 @@ void Session::start()
   {
 /* Signal session thread to start rendering. */
 thread_scoped_lock session_thread_lock(session_thread_mutex_);
-assert(session_thread_state_ == SESSION_THREAD_WAIT);
+if (session_thread_state_ == SESSION_THREAD_RENDER) {
+  /* Already rendering, nothing to do. */
+  return;
+}
 session_thread_state_ = SESSION_THREAD_RENDER;
   }

___
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] [06a492cfdc7] master: Fix (studio reported) crash in new resync code.

2022-02-14 Thread Bastien Montagne
Commit: 06a492cfdc78049adff6923636faa5d13b90cc57
Author: Bastien Montagne
Date:   Mon Feb 14 13:26:42 2022 +0100
Branches: master
https://developer.blender.org/rB06a492cfdc78049adff6923636faa5d13b90cc57

Fix (studio reported) crash in new resync code.

We do not always resync/replace the root ID of a hierarchy now that we
do partial resync.

===

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

===

diff --git a/source/blender/blenkernel/intern/lib_override.c 
b/source/blender/blenkernel/intern/lib_override.c
index f53780d1cbb..02cdd6fcd20 100644
--- a/source/blender/blenkernel/intern/lib_override.c
+++ b/source/blender/blenkernel/intern/lib_override.c
@@ -1696,10 +1696,12 @@ static bool lib_override_library_resync(Main *bmain,
 
   BKE_id_multi_tagged_delete(bmain);
 
-  /* At this point, `id_root` has very likely been deleted, we need to update 
it to its new
-   * version.
+  /* At this point, `id_root` may have been resynced, therefore deleted. In 
that case we need to
+   * update it to its new version.
*/
-  id_root = id_root_reference->newid;
+  if (id_root_reference->newid != NULL) {
+id_root = id_root_reference->newid;
+  }
 
   if (user_edited_overrides_deletion_count > 0) {
 BKE_reportf(reports != NULL ? reports->reports : 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] [c32d3a175de] master: Merge branch 'blender-v3.1-release'

2022-02-14 Thread Bastien Montagne
Commit: c32d3a175de20ab8865cac5ff3c40adf503432f6
Author: Bastien Montagne
Date:   Mon Feb 14 12:07:59 2022 +0100
Branches: master
https://developer.blender.org/rBc32d3a175de20ab8865cac5ff3c40adf503432f6

Merge branch 'blender-v3.1-release'

===



===



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


[Bf-blender-cvs] [3a9a37d6dcc] blender-v3.1-release: Fix T95601: Missing handling of keyingsets ID pointers in lib_query/foreach_id code.

2022-02-14 Thread Bastien Montagne
Commit: 3a9a37d6dccb0a981b1fad0cda977b4a445341a1
Author: Bastien Montagne
Date:   Mon Feb 14 12:05:11 2022 +0100
Branches: blender-v3.1-release
https://developer.blender.org/rB3a9a37d6dccb0a981b1fad0cda977b4a445341a1

Fix T95601: Missing handling of keyingsets ID pointers in lib_query/foreach_id 
code.

This will have to be backported to 2.93 and possibly 2.83 if possible.

===

M   source/blender/blenkernel/BKE_animsys.h
M   source/blender/blenkernel/intern/anim_sys.c
M   source/blender/blenkernel/intern/scene.c

===

diff --git a/source/blender/blenkernel/BKE_animsys.h 
b/source/blender/blenkernel/BKE_animsys.h
index 4845807de39..77e0de611d3 100644
--- a/source/blender/blenkernel/BKE_animsys.h
+++ b/source/blender/blenkernel/BKE_animsys.h
@@ -39,6 +39,7 @@ struct FCurve;
 struct ID;
 struct KS_Path;
 struct KeyingSet;
+struct LibraryForeachIDData;
 struct ListBase;
 struct Main;
 struct NlaKeyframingContext;
@@ -102,6 +103,9 @@ struct KS_Path *BKE_keyingset_find_path(struct KeyingSet 
*ks,
 /* Copy all KeyingSets in the given list */
 void BKE_keyingsets_copy(struct ListBase *newlist, const struct ListBase 
*list);
 
+/** Process the ID pointers inside a scene's keyingsets, in see 
`BKE_lib_query.h` for details. */
+void BKE_keyingsets_foreach_id(struct LibraryForeachIDData *data, const struct 
ListBase *keyingsets);
+
 /* Free the given Keying Set path */
 void BKE_keyingset_free_path(struct KeyingSet *ks, struct KS_Path *ksp);
 
diff --git a/source/blender/blenkernel/intern/anim_sys.c 
b/source/blender/blenkernel/intern/anim_sys.c
index b5ea68aaadc..0698311ba4b 100644
--- a/source/blender/blenkernel/intern/anim_sys.c
+++ b/source/blender/blenkernel/intern/anim_sys.c
@@ -57,6 +57,7 @@
 #include "BKE_fcurve.h"
 #include "BKE_global.h"
 #include "BKE_lib_id.h"
+#include "BKE_lib_query.h"
 #include "BKE_main.h"
 #include "BKE_material.h"
 #include "BKE_nla.h"
@@ -265,6 +266,15 @@ void BKE_keyingsets_copy(ListBase *newlist, const ListBase 
*list)
   }
 }
 
+void BKE_keyingsets_foreach_id(LibraryForeachIDData *data, const ListBase 
*keyingsets)
+{
+  for (KeyingSet *ksn = keyingsets->first; ksn; ksn = ksn->next) {
+for (KS_Path *kspn = ksn->paths.first; kspn; kspn = kspn->next) {
+  BKE_LIB_FOREACHID_PROCESS_ID(data, kspn->id, IDWALK_CB_NOP);
+}
+  }
+}
+
 /* Freeing Tools --- */
 
 void BKE_keyingset_free(KeyingSet *ks)
diff --git a/source/blender/blenkernel/intern/scene.c 
b/source/blender/blenkernel/intern/scene.c
index ed9f10aaa91..203676d0dd8 100644
--- a/source/blender/blenkernel/intern/scene.c
+++ b/source/blender/blenkernel/intern/scene.c
@@ -816,6 +816,9 @@ static void scene_foreach_id(ID *id, LibraryForeachIDData 
*data)
 data, SEQ_for_each_callback(>ed->seqbase, 
seq_foreach_member_id_cb, data));
   }
 
+  BKE_LIB_FOREACHID_PROCESS_FUNCTION_CALL(data,
+  BKE_keyingsets_foreach_id(data, 
>keyingsets));
+
   /* This pointer can be NULL during old files reading, better be safe than 
sorry. */
   if (scene->master_collection != NULL) {
 BKE_LIB_FOREACHID_PROCESS_FUNCTION_CALL(

___
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] [4b40e9dbf93] temp-viewport-compositor-compiler: Viewport Compositor: Complete texture pool class

2022-02-14 Thread Omar Emara
Commit: 4b40e9dbf931b71551344ab9e7f0a17361c60253
Author: Omar Emara
Date:   Mon Feb 14 12:18:49 2022 +0200
Branches: temp-viewport-compositor-compiler
https://developer.blender.org/rB4b40e9dbf931b71551344ab9e7f0a17361c60253

Viewport Compositor: Complete texture pool class

This patch adds reference counting support to the texture pool,
separates the allocation implementation to a pure virtual method, and
implements a concrete class for the compositor engine based on the DRW
texture pool.

===

M   source/blender/draw/engines/compositor/compositor_engine.cc
M   source/blender/gpu/GPU_texture.h
M   source/blender/gpu/intern/gpu_texture.cc
M   source/blender/nodes/NOD_compositor_execute.hh
M   source/blender/nodes/intern/node_compositor_execute.cc

===

diff --git a/source/blender/draw/engines/compositor/compositor_engine.cc 
b/source/blender/draw/engines/compositor/compositor_engine.cc
index 4d25f72b1d6..74086dc6eb8 100644
--- a/source/blender/draw/engines/compositor/compositor_engine.cc
+++ b/source/blender/draw/engines/compositor/compositor_engine.cc
@@ -36,6 +36,14 @@
 
 namespace blender::compositor {
 
+class DRWTexturePool : public TexturePool {
+  GPUTexture *allocate_texture(int width, int height, eGPUTextureFormat 
format) override
+  {
+DrawEngineType *owner = (DrawEngineType *)this;
+return DRW_texture_pool_query_2d(width, height, format, owner);
+  }
+};
+
 class DRWCompositorContext : public CompositorContext {
   GPUTexture *get_viewport_texture() override
   {
diff --git a/source/blender/gpu/GPU_texture.h b/source/blender/gpu/GPU_texture.h
index 6fae4a13918..fd58071c6e5 100644
--- a/source/blender/gpu/GPU_texture.h
+++ b/source/blender/gpu/GPU_texture.h
@@ -280,6 +280,9 @@ void GPU_texture_clear(GPUTexture *tex, eGPUDataFormat 
data_format, const void *
 void GPU_texture_free(GPUTexture *tex);
 
 void GPU_texture_ref(GPUTexture *tex);
+void GPU_texture_set_reference_count(GPUTexture *texture, int count);
+int GPU_texture_get_reference_count(GPUTexture *texture);
+
 void GPU_texture_bind(GPUTexture *tex, int unit);
 void GPU_texture_bind_ex(GPUTexture *tex, eGPUSamplerState state, int unit, 
bool set_number);
 void GPU_texture_unbind(GPUTexture *tex);
diff --git a/source/blender/gpu/intern/gpu_texture.cc 
b/source/blender/gpu/intern/gpu_texture.cc
index 1b8b28bf04c..a20aa5bf6bb 100644
--- a/source/blender/gpu/intern/gpu_texture.cc
+++ b/source/blender/gpu/intern/gpu_texture.cc
@@ -523,6 +523,16 @@ void GPU_texture_ref(GPUTexture *tex)
   reinterpret_cast(tex)->refcount++;
 }
 
+void GPU_texture_set_reference_count(GPUTexture *texture, int count)
+{
+  reinterpret_cast(texture)->refcount = count;
+}
+
+int GPU_texture_get_reference_count(GPUTexture *texture)
+{
+  return reinterpret_cast(texture)->refcount;
+}
+
 int GPU_texture_width(const GPUTexture *tex)
 {
   return reinterpret_cast(tex)->width_get();
diff --git a/source/blender/nodes/NOD_compositor_execute.hh 
b/source/blender/nodes/NOD_compositor_execute.hh
index 95c95d020c3..ff93b5954f4 100644
--- a/source/blender/nodes/NOD_compositor_execute.hh
+++ b/source/blender/nodes/NOD_compositor_execute.hh
@@ -16,12 +16,88 @@
 
 #pragma once
 
+#include "BLI_hash.hh"
+#include "BLI_map.hh"
+#include "BLI_vector.hh"
+
 #include "DNA_scene_types.h"
 
 #include "GPU_texture.h"
 
 namespace blender::compositor {
 
+/* 
+ * Texture Pool.
+ */
+
+/* A key structure used to identify a texture specification in a texture pool. 
Defines a hash and
+ * an equality operator for use in a hash map. */
+class TexturePoolKey {
+ public:
+  int width;
+  int height;
+  eGPUTextureFormat format;
+
+  TexturePoolKey(int width, int height, eGPUTextureFormat format);
+  TexturePoolKey(const GPUTexture *texture);
+
+  uint64_t hash() const;
+};
+
+inline TexturePoolKey::TexturePoolKey(int width, int height, eGPUTextureFormat 
format)
+: width(width), height(height), format(format)
+{
+}
+
+inline TexturePoolKey::TexturePoolKey(const GPUTexture *texture)
+{
+  width = GPU_texture_width(texture);
+  height = GPU_texture_height(texture);
+  format = GPU_texture_format(texture);
+}
+
+inline uint64_t TexturePoolKey::hash() const
+{
+  return get_default_hash_3(width, height, format);
+}
+
+inline bool operator==(const TexturePoolKey , const TexturePoolKey )
+{
+  return a.width == b.width && a.height == b.height && a.format == b.format;
+}
+
+/* A pool of textures that can be allocated and reused transparently 
throughout the evaluation of
+ * the node tree. The textures can be reference counted and will only be 
effectively released back
+ * into the pool when their reference count reaches one. Concrete derived 
classes are expected to
+ * free the textures once the pool is no longer in use. */
+class TexturePool {
+ private:
+  /* The set of 

[Bf-blender-cvs] [7e225823772] temp-viewport-compositor-compiler: Viewport Compositor: Move components to bf_nodes

2022-02-14 Thread Omar Emara
Commit: 7e22582377203538d24ff693359aed2f6359bfe4
Author: Omar Emara
Date:   Mon Feb 14 10:11:12 2022 +0200
Branches: temp-viewport-compositor-compiler
https://developer.blender.org/rB7e22582377203538d24ff693359aed2f6359bfe4

Viewport Compositor: Move components to bf_nodes

We want to avoid directly linking bf_nodes to bf_draw, so we should
start reorganizing implementation files. All components are moved to
bf_nodes, this is also where interfaces are defined to be implemented in
the compositor engine.

===

M   source/blender/draw/engines/compositor/compositor_engine.cc
M   source/blender/nodes/CMakeLists.txt
M   source/blender/nodes/NOD_compositor_execute.hh
A   source/blender/nodes/intern/node_compositor_execute.cc

===

diff --git a/source/blender/draw/engines/compositor/compositor_engine.cc 
b/source/blender/draw/engines/compositor/compositor_engine.cc
index 340f9310f08..4d25f72b1d6 100644
--- a/source/blender/draw/engines/compositor/compositor_engine.cc
+++ b/source/blender/draw/engines/compositor/compositor_engine.cc
@@ -22,315 +22,30 @@
  * Engine processing the render buffer using GLSL to apply the scene 
compositing node tree.
  */
 
-#include "DRW_render.h"
-
-#include "BLI_hash.hh"
-#include "BLI_map.hh"
-#include "BLI_set.hh"
-#include "BLI_string_ref.hh"
-#include "BLI_utildefines.h"
-#include "BLI_vector.hh"
-#include "BLI_vector_set.hh"
-
-#include "DNA_node_types.h"
 #include "DNA_scene_types.h"
 
-#include "GPU_texture.h"
+#include "DRW_render.h"
 
 #include "IMB_colormanagement.h"
 
 #include "NOD_compositor_execute.hh"
-#include "NOD_derived_node_tree.hh"
+
+#include "GPU_texture.h"
 
 #include "compositor_shader.hh"
 
 namespace blender::compositor {
 
-using nodes::CompositorContext;
-using namespace nodes::derived_node_tree_types;
-
-/* A key structure used to identify a texture in a texture pool. Defines a 
hash and an equality
- * operator for use in a hash map. */
-class TexturePoolKey {
- public:
-  int width;
-  int height;
-  eGPUTextureFormat format;
-
-  TexturePoolKey(int width, int height, eGPUTextureFormat format)
-  : width(width), height(height), format(format)
-  {
-  }
-
-  TexturePoolKey(const GPUTexture *texture)
-  {
-width = GPU_texture_width(texture);
-height = GPU_texture_height(texture);
-format = GPU_texture_format(texture);
-  }
-
-  uint64_t hash() const
-  {
-return get_default_hash_3(width, height, format);
-  }
-};
-
-inline bool operator==(const TexturePoolKey , const TexturePoolKey )
-{
-  return a.width == b.width && a.height == b.height && a.format == b.format;
-}
-
-/* A pool of textures that can be reused transparently throughout the 
evaluation of the node tree.
- * Uses the DRW texture pool as a base for allocation. The acquired textures 
are uncleared and are
- * expected to contain garbage data. */
-class TexturePool {
- private:
-  /* The set of textures in the pool that are currently in use. */
-  Set in_use_textures_;
-  /* The set of textures in the pool that are available to acquire. */
-  Map available_textures_;
-
- public:
-  /* Check if there is an available texture with the given specification in 
the pool, if such
-   * texture exists, return it, otherwise, get a new texture from the DRW 
texture pool. */
-  GPUTexture *acquire(int width, int height, eGPUTextureFormat format)
-  {
-const TexturePoolKey key = TexturePoolKey(width, height, format);
-std::optional available_texture = 
available_textures_.pop_try(key);
-if (available_texture) {
-  return *available_texture;
-}
-DrawEngineType *owner = (DrawEngineType *)this;
-GPUTexture *new_texture = DRW_texture_pool_query_2d(width, height, format, 
owner);
-in_use_textures_.add_new(new_texture);
-return new_texture;
-  }
-
-  /* Move the texture from the in-use textures set to the available textures 
set, potentially to be
-   * acquired later by another user. */
-  void release(GPUTexture *texture)
-  {
-in_use_textures_.remove_contained(texture);
-available_textures_.add_new(TexturePoolKey(texture), texture);
-  }
-};
-
 class DRWCompositorContext : public CompositorContext {
- private:
-  /* The node currently being executed. */
-  DNode node_;
-  /* A map associating output sockets with the textures storing their 
contents. The map only stores
-   * the textures that were already computed by a dependency node and are 
still needed by one or
-   * more dependent nodes, so the node currently executing can get its inputs 
and outputs from this
-   * member. See get_input_texture and get_output_texture. */
-  const Map _textures_;
-
- public:
-  DRWCompositorContext(DNode node, const Map 
_textures)
-  : node_(node), allocated_textures_(allocated_textures)
-  {
-  }
-
-  const GPUTexture *get_input_texture(StringRef identifier) override
-  {
-/* Find the output socket 

[Bf-blender-cvs] [48e2bf3638e] master: Merge branch 'blender-v3.1-release'

2022-02-14 Thread Jeroen Bakker
Commit: 48e2bf3638e1d96d8cbfbc74d29c347ccfcad576
Author: Jeroen Bakker
Date:   Mon Feb 14 11:00:30 2022 +0100
Branches: master
https://developer.blender.org/rB48e2bf3638e1d96d8cbfbc74d29c347ccfcad576

Merge branch 'blender-v3.1-release'

===



===



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


[Bf-blender-cvs] [1236d2aea8d] blender-v3.1-release: Cleanup use c style comments.

2022-02-14 Thread Jeroen Bakker
Commit: 1236d2aea8d55c7d98409fc76968bad297a53007
Author: Jeroen Bakker
Date:   Mon Feb 14 10:58:45 2022 +0100
Branches: blender-v3.1-release
https://developer.blender.org/rB1236d2aea8d55c7d98409fc76968bad297a53007

Cleanup use c style comments.

===

M   source/blender/draw/engines/image/image_drawing_mode.hh

===

diff --git a/source/blender/draw/engines/image/image_drawing_mode.hh 
b/source/blender/draw/engines/image/image_drawing_mode.hh
index 0c638ef15c2..795f0c0c45e 100644
--- a/source/blender/draw/engines/image/image_drawing_mode.hh
+++ b/source/blender/draw/engines/image/image_drawing_mode.hh
@@ -468,20 +468,20 @@ template class 
ScreenSpaceDrawingMode : public AbstractD
 instance_data->partial_update.ensure_image(image);
 instance_data->clear_dirty_flag();
 
-// Step: Find out which screen space textures are needed to draw on the 
screen. Remove the
-// screen space textures that aren't needed.
+/* Step: Find out which screen space textures are needed to draw on the 
screen. Remove the
+ * screen space textures that aren't needed. */
 const ARegion *region = draw_ctx->region;
 method.update_screen_space_bounds(region);
 method.update_screen_uv_bounds();
 
-// Check for changes in the image user compared to the last time.
+/* Check for changes in the image user compared to the last time. */
 instance_data->update_image_user(iuser);
 
-// Step: Update the GPU textures based on the changes in the image.
+/* Step: Update the GPU textures based on the changes in the image. */
 instance_data->update_gpu_texture_allocations();
 update_textures(*instance_data, image, iuser);
 
-// Step: Add the GPU textures to the shgroup.
+/* Step: Add the GPU textures to the shgroup. */
 instance_data->update_batches();
 add_depth_shgroups(*instance_data, image, iuser);
 add_shgroups(instance_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] [ab71d833c77] blender-v3.1-release: Phase out IMA_GPU_REFRESH.

2022-02-14 Thread Jeroen Bakker
Commit: ab71d833c775dce9efa25398ad3079729d404951
Author: Jeroen Bakker
Date:   Mon Feb 14 10:33:56 2022 +0100
Branches: blender-v3.1-release
https://developer.blender.org/rBab71d833c775dce9efa25398ad3079729d404951

Phase out IMA_GPU_REFRESH.

IMA_GPU_REFRESH is replaced by
BKE_image_partial_update_mark_full_update and should not be used
anymore.

===

M   source/blender/blenkernel/intern/image.c
M   source/blender/blenkernel/intern/image_gpu.cc
M   source/blender/editors/render/render_opengl.cc
M   source/blender/editors/space_image/image_edit.c
M   source/blender/makesdna/DNA_image_types.h
M   source/blender/makesrna/intern/rna_image.c

===

diff --git a/source/blender/blenkernel/intern/image.c 
b/source/blender/blenkernel/intern/image.c
index 040257fe976..bf6ede77a79 100644
--- a/source/blender/blenkernel/intern/image.c
+++ b/source/blender/blenkernel/intern/image.c
@@ -4377,7 +4377,7 @@ RenderResult *BKE_image_acquire_renderresult(Scene 
*scene, Image *ima)
 }
 else {
   rr = BKE_image_get_renderslot(ima, ima->render_slot)->render;
-  ima->gpuflag |= IMA_GPU_REFRESH;
+  BKE_image_partial_update_mark_full_update(ima);
 }
 
 /* set proper views */
@@ -5745,7 +5745,7 @@ void BKE_image_user_frame_calc(Image *ima, ImageUser 
*iuser, int cfra)
   /* NOTE: a single texture and refresh doesn't really work when
* multiple image users may use different frames, this is to
* be improved with perhaps a GPU texture cache. */
-  ima->gpuflag |= IMA_GPU_REFRESH;
+  BKE_image_partial_update_mark_full_update(ima);
   ima->gpuframenr = iuser->framenr;
 }
 
diff --git a/source/blender/blenkernel/intern/image_gpu.cc 
b/source/blender/blenkernel/intern/image_gpu.cc
index eaee1fd2c30..c43df7e157e 100644
--- a/source/blender/blenkernel/intern/image_gpu.cc
+++ b/source/blender/blenkernel/intern/image_gpu.cc
@@ -405,18 +405,9 @@ static GPUTexture *image_get_gpu_texture(Image *ima,
 ima->gpu_pass = requested_pass;
 ima->gpu_layer = requested_layer;
 ima->gpu_view = requested_view;
-ima->gpuflag |= IMA_GPU_REFRESH;
   }
 #undef GPU_FLAGS_TO_CHECK
 
-  /* TODO(jbakker): We should replace the IMA_GPU_REFRESH flag with a call to
-   * BKE_image-partial_update_mark_full_update. Although the flag is quicker 
it leads to double
-   * administration. */
-  if ((ima->gpuflag & IMA_GPU_REFRESH) != 0) {
-BKE_image_partial_update_mark_full_update(ima);
-ima->gpuflag &= ~IMA_GPU_REFRESH;
-  }
-
   if (ima->runtime.partial_update_user == nullptr) {
 ima->runtime.partial_update_user = BKE_image_partial_update_create(ima);
   }
diff --git a/source/blender/editors/render/render_opengl.cc 
b/source/blender/editors/render/render_opengl.cc
index 8bd0244c899..4a012e63952 100644
--- a/source/blender/editors/render/render_opengl.cc
+++ b/source/blender/editors/render/render_opengl.cc
@@ -525,7 +525,7 @@ static void screen_opengl_render_apply(const bContext *C, 
OGLRender *oglrender)
 ibuf->userflags |= IB_DISPLAY_BUFFER_INVALID;
   }
   BKE_image_release_ibuf(oglrender->ima, ibuf, lock);
-  oglrender->ima->gpuflag |= IMA_GPU_REFRESH;
+  BKE_image_partial_update_mark_full_update(oglrender->ima);
 
   if (oglrender->write_still) {
 screen_opengl_render_write(oglrender);
diff --git a/source/blender/editors/space_image/image_edit.c 
b/source/blender/editors/space_image/image_edit.c
index 470cff20718..d75dbd542a6 100644
--- a/source/blender/editors/space_image/image_edit.c
+++ b/source/blender/editors/space_image/image_edit.c
@@ -404,7 +404,7 @@ bool ED_image_slot_cycle(struct Image *image, int direction)
   }
 
   if ((cur != image->render_slot)) {
-image->gpuflag |= IMA_GPU_REFRESH;
+BKE_image_partial_update_mark_full_update(image);
   }
   return (cur != image->render_slot);
 }
diff --git a/source/blender/makesdna/DNA_image_types.h 
b/source/blender/makesdna/DNA_image_types.h
index 7a789227128..9da0fabf52d 100644
--- a/source/blender/makesdna/DNA_image_types.h
+++ b/source/blender/makesdna/DNA_image_types.h
@@ -253,15 +253,13 @@ enum {
 
 /* Image.gpuflag */
 enum {
-  /** GPU texture needs to be refreshed. */
-  IMA_GPU_REFRESH = (1 << 0),
   /** All mipmap levels in OpenGL texture set? */
-  IMA_GPU_MIPMAP_COMPLETE = (1 << 1),
+  IMA_GPU_MIPMAP_COMPLETE = (1 << 0),
   /* Reuse the max resolution textures as they fit in the limited scale. */
-  IMA_GPU_REUSE_MAX_RESOLUTION = (1 << 2),
+  IMA_GPU_REUSE_MAX_RESOLUTION = (1 << 1),
   /* Has any limited scale textures been allocated.
* Adds additional checks to reuse max resolution images when they fit 
inside limited scale. */
-  IMA_GPU_HAS_LIMITED_SCALE_TEXTURES = (1 << 3),
+  IMA_GPU_HAS_LIMITED_SCALE_TEXTURES = (1 << 2),
 };
 
 /* Image.source, where the image comes from */
diff --git a/source/blender/makesrna/intern/rna_image.c 

[Bf-blender-cvs] [d23cf42ba76] blender-v3.1-release: Fix T95725: Changing render slot doesn't update displayed image.

2022-02-14 Thread Jeroen Bakker
Commit: d23cf42ba761a0d387c693f1f9d421447adc2c03
Author: Jeroen Bakker
Date:   Mon Feb 14 10:54:21 2022 +0100
Branches: blender-v3.1-release
https://developer.blender.org/rBd23cf42ba761a0d387c693f1f9d421447adc2c03

Fix T95725: Changing render slot doesn't update displayed image.

Fixed by checking the requested pass, layer and view against the
previous used one.

===

M   source/blender/draw/engines/image/image_drawing_mode.hh
M   source/blender/draw/engines/image/image_instance_data.hh

===

diff --git a/source/blender/draw/engines/image/image_drawing_mode.hh 
b/source/blender/draw/engines/image/image_drawing_mode.hh
index 0aaf0ca9f24..0c638ef15c2 100644
--- a/source/blender/draw/engines/image/image_drawing_mode.hh
+++ b/source/blender/draw/engines/image/image_drawing_mode.hh
@@ -474,6 +474,9 @@ template class 
ScreenSpaceDrawingMode : public AbstractD
 method.update_screen_space_bounds(region);
 method.update_screen_uv_bounds();
 
+// Check for changes in the image user compared to the last time.
+instance_data->update_image_user(iuser);
+
 // Step: Update the GPU textures based on the changes in the image.
 instance_data->update_gpu_texture_allocations();
 update_textures(*instance_data, image, iuser);
diff --git a/source/blender/draw/engines/image/image_instance_data.hh 
b/source/blender/draw/engines/image/image_instance_data.hh
index 77b771a9110..a2367c687b5 100644
--- a/source/blender/draw/engines/image/image_instance_data.hh
+++ b/source/blender/draw/engines/image/image_instance_data.hh
@@ -40,6 +40,8 @@ constexpr int SCREEN_SPACE_DRAWING_MODE_TEXTURE_LEN = 1;
 
 struct IMAGE_InstanceData {
   struct Image *image;
+  /** Copy of the last image user to detect iuser differences that require a 
full update. */
+  struct ImageUser last_image_user;
 
   PartialImageUpdater partial_update;
 
@@ -108,6 +110,27 @@ struct IMAGE_InstanceData {
 }
   }
 
+  void update_image_user(const ImageUser *image_user)
+  {
+short requested_pass = image_user ? image_user->pass : 0;
+short requested_layer = image_user ? image_user->layer : 0;
+short requested_view = image_user ? image_user->multi_index : 0;
+/* There is room for 2 multiview textures. When a higher number is 
requested we should always
+ * target the first view slot. This is fine as multi view images aren't 
used together. */
+if (requested_view < 2) {
+  requested_view = 0;
+}
+
+if (last_image_user.pass != requested_pass || last_image_user.layer != 
requested_layer ||
+last_image_user.multi_index != requested_view) {
+
+  last_image_user.pass = requested_pass;
+  last_image_user.layer = requested_layer;
+  last_image_user.multi_index = requested_view;
+  reset_dirty_flag(true);
+}
+  }
+
  private:
   /** \brief Set dirty flag of all texture slots to the given value. */
   void reset_dirty_flag(bool new_value)

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

2022-02-14 Thread Jeroen Bakker
Commit: efac4db166292229e4e2ab7afa6034d637893bd6
Author: Jeroen Bakker
Date:   Mon Feb 14 09:42:03 2022 +0100
Branches: master
https://developer.blender.org/rBefac4db166292229e4e2ab7afa6034d637893bd6

Merge branch 'blender-v3.1-release'

===



===

diff --cc source/blender/draw/engines/image/image_drawing_mode.hh
index 61b7993c6b0,0aaf0ca9f24..d0dbc799c31
--- a/source/blender/draw/engines/image/image_drawing_mode.hh
+++ b/source/blender/draw/engines/image/image_drawing_mode.hh
@@@ -461,14 -468,13 +452,13 @@@ template class 
  instance_data->partial_update.ensure_image(image);
  instance_data->clear_dirty_flag();
  
 -// Step: Find out which screen space textures are needed to draw on the 
screen. Remove the
 -// screen space textures that aren't needed.
 +/* Step: Find out which screen space textures are needed to draw on the 
screen. Remove the
 + * screen space textures that aren't needed. */
  const ARegion *region = draw_ctx->region;
  method.update_screen_space_bounds(region);
- method.update_region_uv_bounds(region);
  method.update_screen_uv_bounds();
  
 -// Step: Update the GPU textures based on the changes in the image.
 +/* Step: Update the GPU textures based on the changes in the image. */
  instance_data->update_gpu_texture_allocations();
  update_textures(*instance_data, image, iuser);

___
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] [f663a1dc09a] blender-v3.1-release: Image Engine: Remove region_uv_bounds.

2022-02-14 Thread Jeroen Bakker
Commit: f663a1dc09af4eed4846f861017db59456469ff8
Author: Jeroen Bakker
Date:   Mon Feb 14 09:18:10 2022 +0100
Branches: blender-v3.1-release
https://developer.blender.org/rBf663a1dc09af4eed4846f861017db59456469ff8

Image Engine: Remove region_uv_bounds.

They have been replaced by clipping_uv_bounds. Using region_uv_bounds
could lead to problems when drawing the compositor backdrop.

===

M   source/blender/draw/engines/image/image_drawing_mode.hh
M   source/blender/draw/engines/image/image_texture_info.hh

===

diff --git a/source/blender/draw/engines/image/image_drawing_mode.hh 
b/source/blender/draw/engines/image/image_drawing_mode.hh
index b56f3062901..0aaf0ca9f24 100644
--- a/source/blender/draw/engines/image/image_drawing_mode.hh
+++ b/source/blender/draw/engines/image/image_drawing_mode.hh
@@ -62,20 +62,6 @@ struct OneTextureMethod {
 }
   }
 
-  void update_region_uv_bounds(const ARegion *region)
-  {
-TextureInfo  = instance_data->texture_infos[0];
-if (!BLI_rctf_compare(_uv_bounds, >v2d.cur, 
EPSILON_UV_BOUNDS)) {
-  info.region_uv_bounds = region->v2d.cur;
-  info.dirty = true;
-}
-
-/* Mark the other textures as invalid. */
-for (int i = 1; i < SCREEN_SPACE_DRAWING_MODE_TEXTURE_LEN; i++) {
-  BLI_rctf_init_minmax(_data->texture_infos[i].clipping_bounds);
-}
-  }
-
   void update_screen_uv_bounds()
   {
 for (int i = 0; i < SCREEN_SPACE_DRAWING_MODE_TEXTURE_LEN; i++) {
@@ -92,7 +78,13 @@ struct OneTextureMethod {
 float4x4 mat_inv = mat.inverted();
 float3 min_uv = mat_inv * float3(0.0f, 0.0f, 0.0f);
 float3 max_uv = mat_inv * float3(1.0f, 1.0f, 0.0f);
-BLI_rctf_init(_uv_bounds, min_uv[0], max_uv[0], min_uv[1], 
max_uv[1]);
+rctf new_clipping_bounds;
+BLI_rctf_init(_clipping_bounds, min_uv[0], max_uv[0], min_uv[1], 
max_uv[1]);
+
+if (!BLI_rctf_compare(_uv_bounds, _clipping_bounds, 
EPSILON_UV_BOUNDS)) {
+  info.clipping_uv_bounds = new_clipping_bounds;
+  info.dirty = true;
+}
   }
 };
 
@@ -268,7 +260,7 @@ template class 
ScreenSpaceDrawingMode : public AbstractD
   
static_cast(iterator.tile_data.tile_buffer->y) +
   tile_offset_y);
 rctf changed_overlapping_region_in_uv_space;
-const bool region_overlap = BLI_rctf_isect(_uv_bounds,
+const bool region_overlap = BLI_rctf_isect(_uv_bounds,
_region_in_uv_space,

_overlapping_region_in_uv_space);
 if (!region_overlap) {
@@ -280,14 +272,14 @@ template class 
ScreenSpaceDrawingMode : public AbstractD
 rcti gpu_texture_region_to_update;
 BLI_rcti_init(
 _texture_region_to_update,
-floor((changed_overlapping_region_in_uv_space.xmin - 
info.region_uv_bounds.xmin) *
-  texture_width / BLI_rctf_size_x(_uv_bounds)),
-floor((changed_overlapping_region_in_uv_space.xmax - 
info.region_uv_bounds.xmin) *
-  texture_width / BLI_rctf_size_x(_uv_bounds)),
-ceil((changed_overlapping_region_in_uv_space.ymin - 
info.region_uv_bounds.ymin) *
- texture_height / BLI_rctf_size_y(_uv_bounds)),
-ceil((changed_overlapping_region_in_uv_space.ymax - 
info.region_uv_bounds.ymin) *
- texture_height / BLI_rctf_size_y(_uv_bounds)));
+floor((changed_overlapping_region_in_uv_space.xmin - 
info.clipping_uv_bounds.xmin) *
+  texture_width / BLI_rctf_size_x(_uv_bounds)),
+floor((changed_overlapping_region_in_uv_space.xmax - 
info.clipping_uv_bounds.xmin) *
+  texture_width / BLI_rctf_size_x(_uv_bounds)),
+ceil((changed_overlapping_region_in_uv_space.ymin - 
info.clipping_uv_bounds.ymin) *
+ texture_height / BLI_rctf_size_y(_uv_bounds)),
+ceil((changed_overlapping_region_in_uv_space.ymax - 
info.clipping_uv_bounds.ymin) *
+ texture_height / BLI_rctf_size_y(_uv_bounds)));
 
 rcti tile_region_to_extract;
 BLI_rcti_init(
@@ -311,13 +303,13 @@ template class 
ScreenSpaceDrawingMode : public AbstractD
 for (int y = gpu_texture_region_to_update.ymin; y < 
gpu_texture_region_to_update.ymax;
  y++) {
   float yf = y / (float)texture_height;
-  float v = info.region_uv_bounds.ymax * yf + 
info.region_uv_bounds.ymin * (1.0 - yf) -
+  float v = info.clipping_uv_bounds.ymax * yf + 
info.clipping_uv_bounds.ymin * (1.0 - yf) -
 tile_offset_y;
   for (int x = gpu_texture_region_to_update.xmin; x < 
gpu_texture_region_to_update.xmax;
x++) {
 float xf = x / (float)texture_width;
-float u = info.region_uv_bounds.xmax * xf + 

[Bf-blender-cvs] [f0e32ef4ff3] blender-v3.1-release: Fix T95699: Compostior backdrop not updated.

2022-02-14 Thread Jeroen Bakker
Commit: f0e32ef4ff34f8cf8ff85706fd863a858f5849b6
Author: Jeroen Bakker
Date:   Mon Feb 14 09:20:59 2022 +0100
Branches: blender-v3.1-release
https://developer.blender.org/rBf0e32ef4ff34f8cf8ff85706fd863a858f5849b6

Fix T95699: Compostior backdrop not updated.

The Viewer marked the gpu texture to be out of date. But it should have used
the mark_full_update as the gpu textures
are only used by the render/draw engines.

The image/node editor uses the image engine that have its own GPU textures.

===

M   source/blender/compositor/operations/COM_ViewerOperation.cc

===

diff --git a/source/blender/compositor/operations/COM_ViewerOperation.cc 
b/source/blender/compositor/operations/COM_ViewerOperation.cc
index 205596b46d1..bdaca44820d 100644
--- a/source/blender/compositor/operations/COM_ViewerOperation.cc
+++ b/source/blender/compositor/operations/COM_ViewerOperation.cc
@@ -215,7 +215,10 @@ void ViewerOperation::update_image(const rcti *rect)
 rect->ymin,
 rect->xmax,
 rect->ymax);
-  image_->gpuflag |= IMA_GPU_REFRESH;
+
+  /* This could be improved to use partial updates. For now disabled as the 
full frame compositor
+   * would not use partial frames anymore and the image engine requires more 
testing.*/
+  BKE_image_partial_update_mark_full_update(image_);
   this->update_draw();
 }

___
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] [fe9b3dd5f9a] blender-v3.1-release: Image Engine: Limit the number of interal textures.

2022-02-14 Thread Jeroen Bakker
Commit: fe9b3dd5f9af186cc04ce3e5bbbc08d993b9cf8a
Author: Jeroen Bakker
Date:   Mon Feb 14 09:16:06 2022 +0100
Branches: blender-v3.1-release
https://developer.blender.org/rBfe9b3dd5f9af186cc04ce3e5bbbc08d993b9cf8a

Image Engine: Limit the number of interal textures.

Currently one a single texture slot is used to update the screen.
Current design is implemented to use multiple textures.
for now limit the number of texture slots to 1.

===

M   source/blender/draw/engines/image/image_instance_data.hh

===

diff --git a/source/blender/draw/engines/image/image_instance_data.hh 
b/source/blender/draw/engines/image/image_instance_data.hh
index 1a7a20b8b9a..77b771a9110 100644
--- a/source/blender/draw/engines/image/image_instance_data.hh
+++ b/source/blender/draw/engines/image/image_instance_data.hh
@@ -36,7 +36,7 @@
  *
  * 4 textures are used to reduce uploading screen space textures when 
translating the image.
  */
-constexpr int SCREEN_SPACE_DRAWING_MODE_TEXTURE_LEN = 4;
+constexpr int SCREEN_SPACE_DRAWING_MODE_TEXTURE_LEN = 1;
 
 struct IMAGE_InstanceData {
   struct Image *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] [08882ddfc2b] master: Merge branch 'blender-v3.1-release'

2022-02-14 Thread Jacques Lucke
Commit: 08882ddfc2ba8aced32c97275a72234223249c43
Author: Jacques Lucke
Date:   Mon Feb 14 09:09:37 2022 +0100
Branches: master
https://developer.blender.org/rB08882ddfc2ba8aced32c97275a72234223249c43

Merge branch 'blender-v3.1-release'

===



===



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


[Bf-blender-cvs] [33dde170cec] blender-v3.1-release: Fix T95749: missing update when normal node changes

2022-02-14 Thread Jacques Lucke
Commit: 33dde170cecf04b97597e02281e28bd98bb26b3f
Author: Jacques Lucke
Date:   Mon Feb 14 09:08:54 2022 +0100
Branches: blender-v3.1-release
https://developer.blender.org/rB33dde170cecf04b97597e02281e28bd98bb26b3f

Fix T95749: missing update when normal node changes

This node is a bit of a weird case, because it uses the value stored in an
output socket as an input. So when we want to determine if the Dot
changed, we also have to check if the Normal output changed.

A cleaner solution would be to refactor this by either storing the normal
on the node directly (instead of in an output socket), or by exposing it
by a separate input. This refactor should be done separately though.

===

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

===

diff --git a/source/blender/blenkernel/intern/node_tree_update.cc 
b/source/blender/blenkernel/intern/node_tree_update.cc
index bea73ec8065..711aee57b5a 100644
--- a/source/blender/blenkernel/intern/node_tree_update.cc
+++ b/source/blender/blenkernel/intern/node_tree_update.cc
@@ -1482,7 +1482,8 @@ class NodeTreeMainUpdater {
 
 while (!sockets_to_check.is_empty()) {
   const SocketRef _out_socket = *sockets_to_check.pop();
-  const bNode  = *in_out_socket.node().bnode();
+  const NodeRef  = in_out_socket.node();
+  const bNode  = *node.bnode();
   const bNodeSocket  = *in_out_socket.bsocket();
   if (bsocket.changed_flag != NTREE_CHANGED_NOTHING) {
 return true;
@@ -1507,7 +1508,7 @@ class NodeTreeMainUpdater {
   }
   else {
 const OutputSocketRef  = in_out_socket.as_output();
-for (const InputSocketRef *input_socket : socket.node().inputs()) {
+for (const InputSocketRef *input_socket : node.inputs()) {
   if (input_socket->is_available()) {
 bool  = pushed_by_socket_id[input_socket->id()];
 if (!pushed) {
@@ -1516,6 +1517,18 @@ class NodeTreeMainUpdater {
 }
   }
 }
+/* The Normal node has a special case, because the value stored in the 
first output socket
+ * is used as input in the node. */
+if (bnode.type == SH_NODE_NORMAL && socket.index() == 1) {
+  BLI_assert(socket.name() == "Dot");
+  const OutputSocketRef _output = node.output(0);
+  BLI_assert(normal_output.name() == "Normal");
+  bool  = pushed_by_socket_id[normal_output.id()];
+  if (!pushed) {
+sockets_to_check.push(_output);
+pushed = true;
+  }
+}
   }
 }
 return false;

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