[Bf-blender-cvs] [78952518e7c] master: Cleanup: format

2022-09-26 Thread Campbell Barton
Commit: 78952518e7c8fbb4a7866004d03f8004703f6934
Author: Campbell Barton
Date:   Tue Sep 27 16:36:27 2022 +1000
Branches: master
https://developer.blender.org/rB78952518e7c8fbb4a7866004d03f8004703f6934

Cleanup: format

===

M   release/scripts/startup/bl_ui/node_add_menu.py
M   release/scripts/startup/bl_ui/node_add_menu_geometry.py
M   release/scripts/startup/bl_ui/space_userpref.py
M   release/scripts/startup/nodeitems_builtins.py
M   source/blender/gpu/intern/gpu_codegen.cc

===

diff --git a/release/scripts/startup/bl_ui/node_add_menu.py 
b/release/scripts/startup/bl_ui/node_add_menu.py
index 17bff9a5087..31b84b8f08a 100644
--- a/release/scripts/startup/bl_ui/node_add_menu.py
+++ b/release/scripts/startup/bl_ui/node_add_menu.py
@@ -6,6 +6,7 @@ from bpy.app.translations import (
 contexts as i18n_contexts,
 )
 
+
 def add_node_type(layout, node_type, *, label=None):
 """Add a node type to a menu."""
 bl_rna = bpy.types.Node.bl_rna_get_subclass(node_type)
@@ -33,6 +34,7 @@ def draw_node_group_add_menu(context, layout):
 
 if node_tree:
 from nodeitems_builtins import node_tree_group_type
+
 def contains_group(nodetree, group):
 if nodetree == group:
 return True
@@ -42,9 +44,12 @@ def draw_node_group_add_menu(context, layout):
 return True
 return False
 
-groups = [group for group in context.blend_data.node_groups if 
group.bl_idname == node_tree.bl_idname and
-not 
contains_group(group, node_tree) and
-not 
group.name.startswith('.')]
+groups = [
+group for group in context.blend_data.node_groups
+if (group.bl_idname == node_tree.bl_idname and
+not contains_group(group, node_tree) and
+not group.name.startswith('.'))
+]
 if groups:
 layout.separator()
 for group in groups:
diff --git a/release/scripts/startup/bl_ui/node_add_menu_geometry.py 
b/release/scripts/startup/bl_ui/node_add_menu_geometry.py
index d164d0d2c83..8495dcfbe37 100644
--- a/release/scripts/startup/bl_ui/node_add_menu_geometry.py
+++ b/release/scripts/startup/bl_ui/node_add_menu_geometry.py
@@ -4,6 +4,7 @@ from bpy.types import Menu
 from bl_ui import node_add_menu
 from bpy.app.translations import pgettext_iface as iface_
 
+
 class NODE_MT_geometry_node_GEO_ATTRIBUTE(Menu):
 bl_idname = "NODE_MT_geometry_node_GEO_ATTRIBUTE"
 bl_label = "Attribute"
@@ -17,6 +18,7 @@ class NODE_MT_geometry_node_GEO_ATTRIBUTE(Menu):
 node_add_menu.add_node_type(layout, "GeometryNodeRemoveAttribute")
 node_add_menu.add_node_type(layout, "GeometryNodeStoreNamedAttribute")
 
+
 class NODE_MT_geometry_node_GEO_COLOR(Menu):
 bl_idname = "NODE_MT_geometry_node_GEO_COLOR"
 bl_label = "Color"
@@ -32,6 +34,7 @@ class NODE_MT_geometry_node_GEO_COLOR(Menu):
 node_add_menu.add_node_type(layout, "FunctionNodeSeparateColor")
 node_add_menu.add_node_type(layout, "FunctionNodeCombineColor")
 
+
 class NODE_MT_geometry_node_GEO_CURVE(Menu):
 bl_idname = "NODE_MT_geometry_node_GEO_CURVE"
 bl_label = "Curve"
@@ -69,6 +72,7 @@ class NODE_MT_geometry_node_GEO_CURVE(Menu):
 node_add_menu.add_node_type(layout, "GeometryNodeSetSplineResolution")
 node_add_menu.add_node_type(layout, "GeometryNodeCurveSplineType")
 
+
 class NODE_MT_geometry_node_GEO_PRIMITIVES_CURVE(Menu):
 bl_idname = "NODE_MT_geometry_node_GEO_PRIMITIVES_CURVE"
 bl_label = "Curve Primitives"
@@ -84,6 +88,7 @@ class NODE_MT_geometry_node_GEO_PRIMITIVES_CURVE(Menu):
 node_add_menu.add_node_type(layout, 
"GeometryNodeCurvePrimitiveQuadrilateral")
 node_add_menu.add_node_type(layout, 
"GeometryNodeCurvePrimitiveBezierSegment")
 
+
 class NODE_MT_geometry_node_GEO_GEOMETRY(Menu):
 bl_idname = "NODE_MT_geometry_node_GEO_GEOMETRY"
 bl_label = "Geometry"
@@ -108,6 +113,7 @@ class NODE_MT_geometry_node_GEO_GEOMETRY(Menu):
 node_add_menu.add_node_type(layout, "GeometryNodeSetID")
 node_add_menu.add_node_type(layout, "GeometryNodeSetPosition")
 
+
 class NODE_MT_geometry_node_GEO_INPUT(Menu):
 bl_idname = "NODE_MT_geometry_node_GEO_INPUT"
 bl_label = "Input"
@@ -134,6 +140,7 @@ class NODE_MT_geometry_node_GEO_INPUT(Menu):
 node_add_menu.add_node_type(layout, "GeometryNodeInputRadius")
 node_add_menu.add_node_type(layout, "GeometryNodeInputSceneTime")
 
+
 class NODE_MT_geometry_node_GEO_INSTANCE(Menu):
 bl_idname = "NODE_MT_geometry_node_GEO_INSTANCE"
 bl_label = "Instances"
@@ -150,6 +157,7 @@ class NODE_MT_geometry_node_GEO_INSTANCE(Menu):
 node_add_menu.add_node_type(layout, 

[Bf-blender-cvs] [cd7ec0dac6a] master: WM: batch rename action clips

2022-09-26 Thread Iyad Ahmed
Commit: cd7ec0dac6a8660411f21949674422d5aed4d256
Author: Iyad Ahmed
Date:   Mon Sep 26 21:11:23 2022 +1000
Branches: master
https://developer.blender.org/rBcd7ec0dac6a8660411f21949674422d5aed4d256

WM: batch rename action clips

Batch rename for action clips works in outliner and 3d view.

Reviewed By: campbellbarton

Ref D15819

===

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

===

diff --git a/release/scripts/startup/bl_operators/wm.py 
b/release/scripts/startup/bl_operators/wm.py
index f8cb57d638a..9d04cfd5bc8 100644
--- a/release/scripts/startup/bl_operators/wm.py
+++ b/release/scripts/startup/bl_operators/wm.py
@@ -2518,6 +2518,7 @@ class WM_OT_batch_rename(Operator):
 ('BONE', "Bones", ""),
 ('NODE', "Nodes", ""),
 ('SEQUENCE_STRIP', "Sequence Strips", ""),
+('ACTION_CLIP', "Action Clips", ""),
 ),
 description="Type of data to rename",
 )
@@ -2690,6 +2691,30 @@ class WM_OT_batch_rename(Operator):
 "name",
 iface_("Material(s)"),
 )
+elif data_type == "ACTION_CLIP":
+data = (
+(
+# Outliner.
+tuple(set(
+action for id in context.selected_ids
+if (((animation_data := id.animation_data) is not 
None) and
+((action := animation_data.action) is not 
None) and
+(action.library is None))
+))
+if space_type == 'OUTLINER' else
+# 3D View (default).
+tuple(set(
+action for ob in context.selected_objects
+if (((animation_data := ob.animation_data) is not 
None) and
+((action := animation_data.action) is not 
None) and
+(action.library is None))
+))
+)
+if only_selected else
+[id for id in bpy.data.actions if id.library is None],
+"name",
+iface_("Action(s)"),
+)
 elif data_type in object_data_type_attrs_map.keys():
 attr, descr, ty = object_data_type_attrs_map[data_type]
 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] [2edb8ab7394] master: Revert "Cleanup: remove redundant WITH_GHOST_WAYLAND check"

2022-09-26 Thread Campbell Barton
Commit: 2edb8ab7394580cfe00f838a3dab65d68c743c13
Author: Campbell Barton
Date:   Tue Sep 27 11:53:12 2022 +1000
Branches: master
https://developer.blender.org/rB2edb8ab7394580cfe00f838a3dab65d68c743c13

Revert "Cleanup: remove redundant WITH_GHOST_WAYLAND check"

This reverts commit 7fa7c7ceda3df8d522b8f5a407a697987669033c.

The check was not redundant, it accounted for wayland not being found.

===

M   build_files/cmake/platform/platform_unix.cmake

===

diff --git a/build_files/cmake/platform/platform_unix.cmake 
b/build_files/cmake/platform/platform_unix.cmake
index d8940a3a267..f640f7f7650 100644
--- a/build_files/cmake/platform/platform_unix.cmake
+++ b/build_files/cmake/platform/platform_unix.cmake
@@ -727,75 +727,78 @@ if(WITH_GHOST_WAYLAND)
 set(WITH_GHOST_WAYLAND OFF)
   endif()
 
-  if(WITH_GHOST_WAYLAND_DBUS)
-pkg_check_modules(dbus REQUIRED dbus-1)
-  endif()
-
-  if(WITH_GHOST_WAYLAND_LIBDECOR)
-pkg_check_modules(libdecor REQUIRED libdecor-0>=0.1)
-  endif()
-
-  list(APPEND PLATFORM_LINKLIBS
-${xkbcommon_LINK_LIBRARIES}
-  )
+  if(WITH_GHOST_WAYLAND)
+if(WITH_GHOST_WAYLAND_DBUS)
+  pkg_check_modules(dbus REQUIRED dbus-1)
+endif()
 
-  if(NOT WITH_GHOST_WAYLAND_DYNLOAD)
-list(APPEND PLATFORM_LINKLIBS
-  ${wayland-client_LINK_LIBRARIES}
-  ${wayland-egl_LINK_LIBRARIES}
-  ${wayland-cursor_LINK_LIBRARIES}
-)
-  endif()
+if(WITH_GHOST_WAYLAND_LIBDECOR)
+  pkg_check_modules(libdecor REQUIRED libdecor-0>=0.1)
+endif()
 
-  if(WITH_GHOST_WAYLAND_DBUS)
 list(APPEND PLATFORM_LINKLIBS
-  ${dbus_LINK_LIBRARIES}
+  ${xkbcommon_LINK_LIBRARIES}
 )
-add_definitions(-DWITH_GHOST_WAYLAND_DBUS)
-  endif()
 
-  if(WITH_GHOST_WAYLAND_LIBDECOR)
 if(NOT WITH_GHOST_WAYLAND_DYNLOAD)
   list(APPEND PLATFORM_LINKLIBS
-${libdecor_LIBRARIES}
+${wayland-client_LINK_LIBRARIES}
+${wayland-egl_LINK_LIBRARIES}
+${wayland-cursor_LINK_LIBRARIES}
   )
 endif()
-add_definitions(-DWITH_GHOST_WAYLAND_LIBDECOR)
-  endif()
 
-  pkg_get_variable(WAYLAND_SCANNER wayland-scanner wayland_scanner)
+if(WITH_GHOST_WAYLAND_DBUS)
+  list(APPEND PLATFORM_LINKLIBS
+${dbus_LINK_LIBRARIES}
+  )
+  add_definitions(-DWITH_GHOST_WAYLAND_DBUS)
+endif()
 
-  # When using dynamic loading, headers generated
-  # from older versions of `wayland-scanner` aren't compatible.
-  if(WITH_GHOST_WAYLAND_DYNLOAD)
-execute_process(
-  COMMAND ${WAYLAND_SCANNER} --version
-  # The version is written to the `stderr`.
-  ERROR_VARIABLE _wayland_scanner_out
-  ERROR_STRIP_TRAILING_WHITESPACE
-)
-if(NOT "${_wayland_scanner_out}" STREQUAL "")
-  string(
-REGEX REPLACE
-"^wayland-scanner[ \t]+([0-9]+)\.([0-9]+).*"
-"\\1.\\2"
-_wayland_scanner_ver
-"${_wayland_scanner_out}"
+if(WITH_GHOST_WAYLAND_LIBDECOR)
+  if(NOT WITH_GHOST_WAYLAND_DYNLOAD)
+list(APPEND PLATFORM_LINKLIBS
+  ${libdecor_LIBRARIES}
+)
+  endif()
+  add_definitions(-DWITH_GHOST_WAYLAND_LIBDECOR)
+endif()
+
+pkg_get_variable(WAYLAND_SCANNER wayland-scanner wayland_scanner)
+
+# When using dynamic loading, headers generated
+# from older versions of `wayland-scanner` aren't compatible.
+if(WITH_GHOST_WAYLAND_DYNLOAD)
+  execute_process(
+COMMAND ${WAYLAND_SCANNER} --version
+# The version is written to the `stderr`.
+ERROR_VARIABLE _wayland_scanner_out
+ERROR_STRIP_TRAILING_WHITESPACE
   )
-  if("${_wayland_scanner_ver}" VERSION_LESS "1.20")
-message(
-  FATAL_ERROR
-  "Found ${WAYLAND_SCANNER} version \"${_wayland_scanner_ver}\", "
-  "the minimum version is 1.20!"
+  if(NOT "${_wayland_scanner_out}" STREQUAL "")
+string(
+  REGEX REPLACE
+  "^wayland-scanner[ \t]+([0-9]+)\.([0-9]+).*"
+  "\\1.\\2"
+  _wayland_scanner_ver
+  "${_wayland_scanner_out}"
 )
+if("${_wayland_scanner_ver}" VERSION_LESS "1.20")
+  message(
+FATAL_ERROR
+"Found ${WAYLAND_SCANNER} version \"${_wayland_scanner_ver}\", "
+"the minimum version is 1.20!"
+  )
+endif()
+unset(_wayland_scanner_ver)
+  else()
+message(WARNING "Unable to access the version from ${WAYLAND_SCANNER}, 
continuing.")
   endif()
-  unset(_wayland_scanner_ver)
-else()
-  message(WARNING "Unable to access the version from ${WAYLAND_SCANNER}, 
continuing.")
+  unset(_wayland_scanner_out)
 endif()
-unset(_wayland_scanner_out)
+# End wayland-scanner version check.
+
   endif()
-  # End wayland-scanner version check.
 endif()
 
 if(WITH_GHOST_X11)

___
Bf-b

[Bf-blender-cvs] [4e1d32107b9] master: Build: add missing include for opencolorio

2022-09-26 Thread Campbell Barton
Commit: 4e1d32107b94519361eb3afeae054acecd513bde
Author: Campbell Barton
Date:   Tue Sep 27 11:12:06 2022 +1000
Branches: master
https://developer.blender.org/rB4e1d32107b94519361eb3afeae054acecd513bde

Build: add missing include for opencolorio

OpenColorIO failed to build on Linux+GCC-12.2 because of strlen() use.

===

M   build_files/build_environment/patches/opencolorio.diff

===

diff --git a/build_files/build_environment/patches/opencolorio.diff 
b/build_files/build_environment/patches/opencolorio.diff
index 2255cbc02ed..278dfe0d857 100644
--- a/build_files/build_environment/patches/opencolorio.diff
+++ b/build_files/build_environment/patches/opencolorio.diff
@@ -14,3 +14,15 @@ index 7b894a45..92618215 100644
  )
  if(CMAKE_TOOLCHAIN_FILE)
  set(pystring_CMAKE_ARGS
+--- a/src/OpenColorIO/FileRules.cpp
 b/src/OpenColorIO/FileRules.cpp
+@@ -7,6 +7,9 @@
+ #include 
+ #include 
+ 
++/* NOTE: this has been applied up-stream, this edit can be removed after 
upgrading OpenColorIO. */
++#include 
++
+ #include 
+ 
+ #include "CustomKeys.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] [7fa7c7ceda3] master: Cleanup: remove redundant WITH_GHOST_WAYLAND check

2022-09-26 Thread Campbell Barton
Commit: 7fa7c7ceda3df8d522b8f5a407a697987669033c
Author: Campbell Barton
Date:   Tue Sep 27 09:07:08 2022 +1000
Branches: master
https://developer.blender.org/rB7fa7c7ceda3df8d522b8f5a407a697987669033c

Cleanup: remove redundant WITH_GHOST_WAYLAND check

===

M   build_files/cmake/platform/platform_unix.cmake

===

diff --git a/build_files/cmake/platform/platform_unix.cmake 
b/build_files/cmake/platform/platform_unix.cmake
index f640f7f7650..d8940a3a267 100644
--- a/build_files/cmake/platform/platform_unix.cmake
+++ b/build_files/cmake/platform/platform_unix.cmake
@@ -727,78 +727,75 @@ if(WITH_GHOST_WAYLAND)
 set(WITH_GHOST_WAYLAND OFF)
   endif()
 
-  if(WITH_GHOST_WAYLAND)
-if(WITH_GHOST_WAYLAND_DBUS)
-  pkg_check_modules(dbus REQUIRED dbus-1)
-endif()
+  if(WITH_GHOST_WAYLAND_DBUS)
+pkg_check_modules(dbus REQUIRED dbus-1)
+  endif()
 
-if(WITH_GHOST_WAYLAND_LIBDECOR)
-  pkg_check_modules(libdecor REQUIRED libdecor-0>=0.1)
-endif()
+  if(WITH_GHOST_WAYLAND_LIBDECOR)
+pkg_check_modules(libdecor REQUIRED libdecor-0>=0.1)
+  endif()
 
+  list(APPEND PLATFORM_LINKLIBS
+${xkbcommon_LINK_LIBRARIES}
+  )
+
+  if(NOT WITH_GHOST_WAYLAND_DYNLOAD)
 list(APPEND PLATFORM_LINKLIBS
-  ${xkbcommon_LINK_LIBRARIES}
+  ${wayland-client_LINK_LIBRARIES}
+  ${wayland-egl_LINK_LIBRARIES}
+  ${wayland-cursor_LINK_LIBRARIES}
 )
+  endif()
 
-if(NOT WITH_GHOST_WAYLAND_DYNLOAD)
-  list(APPEND PLATFORM_LINKLIBS
-${wayland-client_LINK_LIBRARIES}
-${wayland-egl_LINK_LIBRARIES}
-${wayland-cursor_LINK_LIBRARIES}
-  )
-endif()
+  if(WITH_GHOST_WAYLAND_DBUS)
+list(APPEND PLATFORM_LINKLIBS
+  ${dbus_LINK_LIBRARIES}
+)
+add_definitions(-DWITH_GHOST_WAYLAND_DBUS)
+  endif()
 
-if(WITH_GHOST_WAYLAND_DBUS)
+  if(WITH_GHOST_WAYLAND_LIBDECOR)
+if(NOT WITH_GHOST_WAYLAND_DYNLOAD)
   list(APPEND PLATFORM_LINKLIBS
-${dbus_LINK_LIBRARIES}
+${libdecor_LIBRARIES}
   )
-  add_definitions(-DWITH_GHOST_WAYLAND_DBUS)
-endif()
-
-if(WITH_GHOST_WAYLAND_LIBDECOR)
-  if(NOT WITH_GHOST_WAYLAND_DYNLOAD)
-list(APPEND PLATFORM_LINKLIBS
-  ${libdecor_LIBRARIES}
-)
-  endif()
-  add_definitions(-DWITH_GHOST_WAYLAND_LIBDECOR)
 endif()
+add_definitions(-DWITH_GHOST_WAYLAND_LIBDECOR)
+  endif()
 
-pkg_get_variable(WAYLAND_SCANNER wayland-scanner wayland_scanner)
+  pkg_get_variable(WAYLAND_SCANNER wayland-scanner wayland_scanner)
 
-# When using dynamic loading, headers generated
-# from older versions of `wayland-scanner` aren't compatible.
-if(WITH_GHOST_WAYLAND_DYNLOAD)
-  execute_process(
-COMMAND ${WAYLAND_SCANNER} --version
-# The version is written to the `stderr`.
-ERROR_VARIABLE _wayland_scanner_out
-ERROR_STRIP_TRAILING_WHITESPACE
+  # When using dynamic loading, headers generated
+  # from older versions of `wayland-scanner` aren't compatible.
+  if(WITH_GHOST_WAYLAND_DYNLOAD)
+execute_process(
+  COMMAND ${WAYLAND_SCANNER} --version
+  # The version is written to the `stderr`.
+  ERROR_VARIABLE _wayland_scanner_out
+  ERROR_STRIP_TRAILING_WHITESPACE
+)
+if(NOT "${_wayland_scanner_out}" STREQUAL "")
+  string(
+REGEX REPLACE
+"^wayland-scanner[ \t]+([0-9]+)\.([0-9]+).*"
+"\\1.\\2"
+_wayland_scanner_ver
+"${_wayland_scanner_out}"
   )
-  if(NOT "${_wayland_scanner_out}" STREQUAL "")
-string(
-  REGEX REPLACE
-  "^wayland-scanner[ \t]+([0-9]+)\.([0-9]+).*"
-  "\\1.\\2"
-  _wayland_scanner_ver
-  "${_wayland_scanner_out}"
+  if("${_wayland_scanner_ver}" VERSION_LESS "1.20")
+message(
+  FATAL_ERROR
+  "Found ${WAYLAND_SCANNER} version \"${_wayland_scanner_ver}\", "
+  "the minimum version is 1.20!"
 )
-if("${_wayland_scanner_ver}" VERSION_LESS "1.20")
-  message(
-FATAL_ERROR
-"Found ${WAYLAND_SCANNER} version \"${_wayland_scanner_ver}\", "
-"the minimum version is 1.20!"
-  )
-endif()
-unset(_wayland_scanner_ver)
-  else()
-message(WARNING "Unable to access the version from ${WAYLAND_SCANNER}, 
continuing.")
   endif()
-  unset(_wayland_scanner_out)
+  unset(_wayland_scanner_ver)
+else()
+  message(WARNING "Unable to access the version from ${WAYLAND_SCANNER}, 
continuing.")
 endif()
-# End wayland-scanner version check.
-
+unset(_wayland_scanner_out)
   endif()
+  # End wayland-scanner version check.
 endif()
 
 if(WITH_GHOST_X11)

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

[Bf-blender-cvs] [8da253cfb64] master: Fix T101361: Collapsed multi-input sockets not collapsing noodles

2022-09-26 Thread Iliya Katueshenock
Commit: 8da253cfb64fe578bd8136a7a0a4c4aa74fb536b
Author: Iliya Katueshenock
Date:   Mon Sep 26 18:10:27 2022 -0500
Branches: master
https://developer.blender.org/rB8da253cfb64fe578bd8136a7a0a4c4aa74fb536b

Fix T101361: Collapsed multi-input sockets not collapsing noodles

Caused by 40d815dff651, which removed the check for "hidden" nodes.

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

===

M   source/blender/editors/space_node/drawnode.cc

===

diff --git a/source/blender/editors/space_node/drawnode.cc 
b/source/blender/editors/space_node/drawnode.cc
index 0b11aa37981..13d13b10339 100644
--- a/source/blender/editors/space_node/drawnode.cc
+++ b/source/blender/editors/space_node/drawnode.cc
@@ -1588,7 +1588,7 @@ void draw_nodespace_back_pix(const bContext &C,
 static float2 socket_link_connection_location(const bNodeSocket &socket, const 
bNodeLink &link)
 {
   const float2 socket_location(socket.locx, socket.locy);
-  if (socket.flag & SOCK_MULTI_INPUT && socket.in_out == SOCK_IN) {
+  if (socket.is_multi_input() && socket.is_input() && 
!(socket.owner_node().flag & NODE_HIDDEN)) {
 return node_link_calculate_multi_input_position(
 socket_location, link.multi_input_socket_index, socket.total_inputs);
   }

___
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] [dcd909122f9] master: Scew Modifier: Remove eager normal calculation

2022-09-26 Thread Hans Goudey
Commit: dcd909122f9ad644dcc11e49f565e58dabe276e2
Author: Hans Goudey
Date:   Mon Sep 26 17:59:44 2022 -0500
Branches: master
https://developer.blender.org/rBdcd909122f9ad644dcc11e49f565e58dabe276e2

Scew Modifier: Remove eager normal calculation

The screw modifier calculated normals eagerly (whether or not the
next modifier actually used them). However, this was incorrect and
set invalid normals. It isn't necessary because they can be calculated
later anyway. The potential performance improvement isn't worth the
complexity or maintenance burden.

Fixes T101075

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

===

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

===

diff --git a/source/blender/modifiers/intern/MOD_screw.c 
b/source/blender/modifiers/intern/MOD_screw.c
index 71ffe91f364..91f8947bbc3 100644
--- a/source/blender/modifiers/intern/MOD_screw.c
+++ b/source/blender/modifiers/intern/MOD_screw.c
@@ -58,8 +58,6 @@ typedef struct ScrewVertConnect {
   float dist_sq;
   /** Location relative to the transformed axis. */
   float co[3];
-  /** Calc normal of the vertex. */
-  float no[3];
   /** 2 verts on either side of this one. */
   uint v[2];
   /** Edges on either side, a bit of a waste since each edge ref's 2 edges. */
@@ -381,9 +379,6 @@ static Mesh *modifyMesh(ModifierData *md, const 
ModifierEvalContext *ctx, Mesh *
 
   /* The `screw_ofs` cannot change from now on. */
   const bool do_remove_doubles = (ltmd->flag & MOD_SCREW_MERGE) && (screw_ofs 
== 0.0f);
-  /* Only calculate normals if `do_remove_doubles` since removing doubles 
frees the normals. */
-  const bool do_normal_create = (ltmd->flag & MOD_SCREW_NORMAL_CALC) &&
-(do_remove_doubles == false);
 
   result = BKE_mesh_new_nomain_from_template(
   mesh, (int)maxVerts, (int)maxEdges, 0, (int)maxPolys * 4, (int)maxPolys);
@@ -479,9 +474,6 @@ static Mesh *modifyMesh(ModifierData *md, const 
ModifierEvalContext *ctx, Mesh *
 }
   }
 
-  float(*vert_normals_new)[3] = do_normal_create ? 
BKE_mesh_vertex_normals_for_write(result) :
-   NULL;
-
   if (ltmd->flag & MOD_SCREW_NORMAL_CALC) {
 
 /* Normal Calculation (for face flipping)
@@ -510,15 +502,7 @@ static Mesh *modifyMesh(ModifierData *md, const 
ModifierEvalContext *ctx, Mesh *
 vc = vert_connect;
 
 /* Copy Vert Locations */
-/* - We can do this in a later loop - only do here if no normal calc */
-if (!totedge) {
-  for (i = 0; i < totvert; i++, mv_orig++, mv_new++) {
-copy_v3_v3(mv_new->co, mv_orig->co);
-/* No edges: this is really a dummy normal. */
-normalize_v3_v3(vc->no, mv_new->co);
-  }
-}
-else {
+if (totedge != 0) {
   // printf("\n\n\n\n\nStarting Modifier\n");
   /* set edge users */
   med_new = medge_new;
@@ -770,77 +754,6 @@ static Mesh *modifyMesh(ModifierData *md, const 
ModifierEvalContext *ctx, Mesh *
 }
   }
 }
-
-/* *VERTEX NORMALS*
- * we know the surrounding edges are ordered correctly now
- * so its safe to create vertex normals.
- *
- * calculate vertex normals that can be propagated on lathing
- * use edge connectivity work this out */
-if (do_normal_create) {
-  if (SV_IS_VALID(vc->v[0])) {
-if (SV_IS_VALID(vc->v[1])) {
-  /* 2 edges connected. */
-  /* make 2 connecting vert locations relative to the middle vert 
*/
-  sub_v3_v3v3(tmp_vec1, mvert_new[vc->v[0]].co, mvert_new[i].co);
-  sub_v3_v3v3(tmp_vec2, mvert_new[vc->v[1]].co, mvert_new[i].co);
-  /* normalize so both edges have the same influence, no matter 
their length */
-  normalize_v3(tmp_vec1);
-  normalize_v3(tmp_vec2);
-
-  /* vc_no_tmp1 - this line is the average direction of both 
connecting edges
-   *
-   * Use the edge order to make the subtraction, flip the normal 
the right way
-   * edge should be there but check just in case... */
-  if (vc->e[0]->v1 == i) {
-sub_v3_v3(tmp_vec1, tmp_vec2);
-  }
-  else {
-sub_v3_v3v3(tmp_vec1, tmp_vec2, tmp_vec1);
-  }
-}
-else {
-  /* only 1 edge connected - same as above except
-   * don't need to average edge direction */
-  if (vc->e[0]->v2 == i) {
-sub_v3_v3v3(tmp_vec1, mvert_new[i].co, mvert_new[vc->v[0]].co);
-  }
-  else {
-sub_v3_v3v3(tmp_vec1, mvert_new[vc->v[0]].co, mvert_new[i].co);
-  }
-}
-
-/* tmp_vec2 - is a line 90d from the pivot to the vec
- * This is used so t

[Bf-blender-cvs] [b77ad0c82da] master: Cleanup: correct indentation of harvest.cmake

2022-09-26 Thread Campbell Barton
Commit: b77ad0c82da6ec0ba886e7e3f965371de29f6d8d
Author: Campbell Barton
Date:   Tue Sep 27 08:48:28 2022 +1000
Branches: master
https://developer.blender.org/rBb77ad0c82da6ec0ba886e7e3f965371de29f6d8d

Cleanup: correct indentation of harvest.cmake

===

M   build_files/build_environment/cmake/harvest.cmake

===

diff --git a/build_files/build_environment/cmake/harvest.cmake 
b/build_files/build_environment/cmake/harvest.cmake
index 0184259f365..37b25b1897e 100644
--- a/build_files/build_environment/cmake/harvest.cmake
+++ b/build_files/build_environment/cmake/harvest.cmake
@@ -11,191 +11,191 @@ message("HARVEST_TARGET = ${HARVEST_TARGET}")
 
 if(WIN32)
 
-if(BUILD_MODE STREQUAL Release)
-  add_custom_target(Harvest_Release_Results
-COMMAND # jpeg rename libfile + copy include
-${CMAKE_COMMAND} -E copy ${LIBDIR}/jpeg/lib/jpeg-static.lib 
${HARVEST_TARGET}/jpeg/lib/libjpeg.lib &&
-${CMAKE_COMMAND} -E copy_directory ${LIBDIR}/jpeg/include/ 
${HARVEST_TARGET}/jpeg/include/ &&
-# png
-${CMAKE_COMMAND} -E copy ${LIBDIR}/png/lib/libpng16_static.lib 
${HARVEST_TARGET}/png/lib/libpng.lib &&
-${CMAKE_COMMAND} -E copy_directory ${LIBDIR}/png/include/ 
${HARVEST_TARGET}/png/include/ &&
-# freeglut-> opengl
-${CMAKE_COMMAND} -E copy ${LIBDIR}/freeglut/lib/freeglut_static.lib 
${HARVEST_TARGET}/opengl/lib/freeglut_static.lib &&
-${CMAKE_COMMAND} -E copy_directory ${LIBDIR}/freeglut/include/ 
${HARVEST_TARGET}/opengl/include/ &&
-DEPENDS
-  )
-endif()
+  if(BUILD_MODE STREQUAL Release)
+add_custom_target(Harvest_Release_Results
+  COMMAND # jpeg rename libfile + copy include
+  ${CMAKE_COMMAND} -E copy ${LIBDIR}/jpeg/lib/jpeg-static.lib 
${HARVEST_TARGET}/jpeg/lib/libjpeg.lib &&
+  ${CMAKE_COMMAND} -E copy_directory ${LIBDIR}/jpeg/include/ 
${HARVEST_TARGET}/jpeg/include/ &&
+  # png
+  ${CMAKE_COMMAND} -E copy ${LIBDIR}/png/lib/libpng16_static.lib 
${HARVEST_TARGET}/png/lib/libpng.lib &&
+  ${CMAKE_COMMAND} -E copy_directory ${LIBDIR}/png/include/ 
${HARVEST_TARGET}/png/include/ &&
+  # freeglut-> opengl
+  ${CMAKE_COMMAND} -E copy ${LIBDIR}/freeglut/lib/freeglut_static.lib 
${HARVEST_TARGET}/opengl/lib/freeglut_static.lib &&
+  ${CMAKE_COMMAND} -E copy_directory ${LIBDIR}/freeglut/include/ 
${HARVEST_TARGET}/opengl/include/ &&
+  DEPENDS
+)
+  endif()
 
 else(WIN32)
 
-function(harvest from to)
-  set(pattern "")
-  foreach(f ${ARGN})
-set(pattern ${f})
-  endforeach()
+  function(harvest from to)
+set(pattern "")
+foreach(f ${ARGN})
+  set(pattern ${f})
+endforeach()
 
-  if(pattern STREQUAL "")
-get_filename_component(dirpath ${to} DIRECTORY)
-get_filename_component(filename ${to} NAME)
-install(
-  FILES ${LIBDIR}/${from}
-  DESTINATION ${HARVEST_TARGET}/${dirpath}
-  RENAME ${filename}
-)
-  else()
-install(
-  DIRECTORY ${LIBDIR}/${from}/
-  DESTINATION ${HARVEST_TARGET}/${to}
-  USE_SOURCE_PERMISSIONS
-  FILES_MATCHING PATTERN ${pattern}
-  PATTERN "pkgconfig" EXCLUDE
-  PATTERN "cmake" EXCLUDE
-  PATTERN "__pycache__" EXCLUDE
-  PATTERN "tests" EXCLUDE
-)
-  endif()
-endfunction()
+if(pattern STREQUAL "")
+  get_filename_component(dirpath ${to} DIRECTORY)
+  get_filename_component(filename ${to} NAME)
+  install(
+FILES ${LIBDIR}/${from}
+DESTINATION ${HARVEST_TARGET}/${dirpath}
+RENAME ${filename}
+  )
+else()
+  install(
+DIRECTORY ${LIBDIR}/${from}/
+DESTINATION ${HARVEST_TARGET}/${to}
+USE_SOURCE_PERMISSIONS
+FILES_MATCHING PATTERN ${pattern}
+PATTERN "pkgconfig" EXCLUDE
+PATTERN "cmake" EXCLUDE
+PATTERN "__pycache__" EXCLUDE
+PATTERN "tests" EXCLUDE
+  )
+endif()
+  endfunction()
 
-harvest(alembic/include alembic/include "*.h")
-harvest(alembic/lib/libAlembic.a alembic/lib/libAlembic.a)
-harvest(alembic/bin alembic/bin "*")
-harvest(brotli/include brotli/include "*.h")
-harvest(brotli/lib brotli/lib "*.a")
-harvest(boost/include boost/include "*")
-harvest(boost/lib boost/lib "*.a")
-harvest(imath/include imath/include "*.h")
-harvest(imath/lib imath/lib "*.a")
-harvest(ffmpeg/include ffmpeg/include "*.h")
-harvest(ffmpeg/lib ffmpeg/lib "*.a")
-harvest(fftw3/include fftw3/include "*.h")
-harvest(fftw3/lib fftw3/lib "*.a")
-harvest(flac/lib sndfile/lib "libFLAC.a")
-harvest(freetype/include freetype/include "*.h")
-harvest(freetype/lib/libfreetype2ST.a freetype/lib/libfreetype.a)
-harvest(epoxy/include epoxy/include "*.h")
-harvest(epoxy/lib epoxy/lib "*.a")
-harvest(gmp/include gmp/include "*.h")
-harvest(gmp/lib gmp/lib "*.a")
-harvest(jemalloc/include jemalloc/include "*.h")
-harvest(jemalloc/lib jemalloc/lib "*.a")
-harvest(jpeg/include jpeg/inclu

[Bf-blender-cvs] [408a8edf89d] master: Cleanup: remove unnecessary argument to else() in CMake

2022-09-26 Thread Campbell Barton
Commit: 408a8edf89dc4d2601e39bf5316aecd5643c185c
Author: Campbell Barton
Date:   Tue Sep 27 08:42:52 2022 +1000
Branches: master
https://developer.blender.org/rB408a8edf89dc4d2601e39bf5316aecd5643c185c

Cleanup: remove unnecessary argument to else() in CMake

We have moved away from duplicating arguments in else() and endif()
commands.

===

M   build_files/build_environment/cmake/harvest.cmake
M   build_files/build_environment/cmake/jpeg.cmake
M   build_files/build_environment/cmake/options.cmake
M   build_files/cmake/packaging.cmake

===

diff --git a/build_files/build_environment/cmake/harvest.cmake 
b/build_files/build_environment/cmake/harvest.cmake
index 37b25b1897e..e18c22fc4ad 100644
--- a/build_files/build_environment/cmake/harvest.cmake
+++ b/build_files/build_environment/cmake/harvest.cmake
@@ -26,7 +26,7 @@ if(WIN32)
 )
   endif()
 
-else(WIN32)
+else()
 
   function(harvest from to)
 set(pattern "")
diff --git a/build_files/build_environment/cmake/jpeg.cmake 
b/build_files/build_environment/cmake/jpeg.cmake
index 39388ad466b..118785d859b 100644
--- a/build_files/build_environment/cmake/jpeg.cmake
+++ b/build_files/build_environment/cmake/jpeg.cmake
@@ -1,7 +1,7 @@
 # SPDX-License-Identifier: GPL-2.0-or-later
 
 if(WIN32)
-  # cmake for windows
+  # CMAKE for MS-Windows.
   set(JPEG_EXTRA_ARGS
 -DNASM=${NASM_PATH}
 -DWITH_JPEG8=ON
@@ -33,8 +33,8 @@ if(WIN32)
 )
   endif()
 
-else(WIN32)
-  # cmake for unix
+else()
+  # CMAKE for UNIX.
   set(JPEG_EXTRA_ARGS
 -DWITH_JPEG8=ON
 -DENABLE_STATIC=ON
diff --git a/build_files/build_environment/cmake/options.cmake 
b/build_files/build_environment/cmake/options.cmake
index 9015ef9ac7c..299b82f6d05 100644
--- a/build_files/build_environment/cmake/options.cmake
+++ b/build_files/build_environment/cmake/options.cmake
@@ -15,7 +15,7 @@ message("BuildMode = ${BUILD_MODE}")
 
 if(BUILD_MODE STREQUAL "Debug")
   set(LIBDIR ${CMAKE_CURRENT_BINARY_DIR}/Debug)
-else(BUILD_MODE STREQUAL "Debug")
+else()
   set(LIBDIR ${CMAKE_CURRENT_BINARY_DIR}/Release)
 endif()
 
diff --git a/build_files/cmake/packaging.cmake 
b/build_files/cmake/packaging.cmake
index 2f2e90dc934..f178317fc36 100644
--- a/build_files/cmake/packaging.cmake
+++ b/build_files/cmake/packaging.cmake
@@ -48,7 +48,7 @@ if(MSVC)
   else()
 set(PACKAGE_ARCH windows32)
   endif()
-else(MSVC)
+else()
   set(PACKAGE_ARCH ${CMAKE_SYSTEM_PROCESSOR})
 endif()

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


[Bf-blender-cvs] [fb1f756bd15] universal-scene-description: USD export to USDZ.

2022-09-26 Thread Michael Kowalski
Commit: fb1f756bd1591d6033f6ef0bcf068f13681feb29
Author: Michael Kowalski
Date:   Mon Sep 26 18:19:42 2022 -0400
Branches: universal-scene-description
https://developer.blender.org/rBfb1f756bd1591d6033f6ef0bcf068f13681feb29

USD export to USDZ.

USDZ export code developed by Sonny Campbell in
patch D15623, which is currently under review.

Charles added USDZ Texture downsample export functionality
and a switch for creating ARKit assets during USDZ export.

===

M   release/scripts/startup/bl_ui/space_topbar.py
M   source/blender/blenkernel/BKE_image.h
M   source/blender/blenkernel/intern/cachefile.c
M   source/blender/blenkernel/intern/image.cc
M   source/blender/blenlib/BLI_fileops.h
M   source/blender/blenlib/intern/fileops.c
M   source/blender/blenlib/intern/storage.c
M   source/blender/editors/io/io_usd.c
M   source/blender/editors/space_file/filelist.c
M   source/blender/io/usd/intern/usd_capi_export.cc
M   source/blender/io/usd/usd.h

===

diff --git a/release/scripts/startup/bl_ui/space_topbar.py 
b/release/scripts/startup/bl_ui/space_topbar.py
index da089ea23b0..9583e54e7c3 100644
--- a/release/scripts/startup/bl_ui/space_topbar.py
+++ b/release/scripts/startup/bl_ui/space_topbar.py
@@ -453,7 +453,7 @@ class TOPBAR_MT_file_import(Menu):
 self.layout.operator("wm.alembic_import", text="Alembic (.abc)")
 if bpy.app.build_options.usd:
 self.layout.operator(
-"wm.usd_import", text="Universal Scene Description (.usd, 
.usdc, .usda)")
+"wm.usd_import", text="Universal Scene Description (.usd*)")
 
 if bpy.app.build_options.io_gpencil:
 self.layout.operator("wm.gpencil_import_svg", text="SVG as Grease 
Pencil")
@@ -476,7 +476,7 @@ class TOPBAR_MT_file_export(Menu):
 self.layout.operator("wm.alembic_export", text="Alembic (.abc)")
 if bpy.app.build_options.usd:
 self.layout.operator(
-"wm.usd_export", text="Universal Scene Description (.usd, 
.usdc, .usda)")
+"wm.usd_export", text="Universal Scene Description (.usd*)")
 
 if bpy.app.build_options.io_gpencil:
 # Pugixml lib dependency
diff --git a/source/blender/blenkernel/BKE_image.h 
b/source/blender/blenkernel/BKE_image.h
index eb43ce823ac..8d186e967f2 100644
--- a/source/blender/blenkernel/BKE_image.h
+++ b/source/blender/blenkernel/BKE_image.h
@@ -165,6 +165,7 @@ void BKE_image_alpha_mode_from_extension(struct Image 
*image);
 /**
  * Returns a new image or NULL if it can't load.
  */
+struct Image *BKE_image_load_ex(struct Main *bmain, const char *filepath, int 
flag);
 struct Image *BKE_image_load(struct Main *bmain, const char *filepath);
 /**
  * Returns existing Image when filename/type is same.
diff --git a/source/blender/blenkernel/intern/cachefile.c 
b/source/blender/blenkernel/intern/cachefile.c
index fd83ac50cad..b8ee2a1d20b 100644
--- a/source/blender/blenkernel/intern/cachefile.c
+++ b/source/blender/blenkernel/intern/cachefile.c
@@ -366,7 +366,7 @@ void BKE_cachefile_eval(Main *bmain, Depsgraph *depsgraph, 
CacheFile *cache_file
   }
 #endif
 #ifdef WITH_USD
-  if (BLI_path_extension_check_glob(filepath, "*.usd;*.usda;*.usdc")) {
+  if (BLI_path_extension_check_glob(filepath, "*.usd;*.usda;*.usdc;*.usdz")) {
 cache_file->type = CACHEFILE_TYPE_USD;
 cache_file->handle = USD_create_handle(bmain, filepath, 
&cache_file->object_paths);
 BLI_strncpy(cache_file->handle_filepath, filepath, FILE_MAX);
diff --git a/source/blender/blenkernel/intern/image.cc 
b/source/blender/blenkernel/intern/image.cc
index ae24383e5b9..d57ec83ae61 100644
--- a/source/blender/blenkernel/intern/image.cc
+++ b/source/blender/blenkernel/intern/image.cc
@@ -666,11 +666,11 @@ static void image_init(Image *ima, short source, short 
type)
   ima->stereo3d_format = MEM_cnew("Image Stereo Format");
 }
 
-static Image *image_alloc(Main *bmain, const char *name, short source, short 
type)
+static Image *image_alloc_ex(Main *bmain, const char *name, short source, 
short type, int flag)
 {
   Image *ima;
 
-  ima = static_cast(BKE_libblock_alloc(bmain, ID_IM, name, 0));
+  ima = static_cast(BKE_libblock_alloc(bmain, ID_IM, name, flag));
   if (ima) {
 image_init(ima, source, type);
   }
@@ -678,6 +678,11 @@ static Image *image_alloc(Main *bmain, const char *name, 
short source, short typ
   return ima;
 }
 
+static Image *image_alloc(Main *bmain, const char *name, short source, short 
type)
+{
+  return image_alloc_ex(bmain, name, source, type, 0);
+}
+
 /**
  * Get the ibuf from an image cache by its index and entry.
  * Local use here only.
@@ -1006,7 +1011,7 @@ void BKE_image_alpha_mode_from_extension(Image *image)
   image->alpha_mode = BKE_image_alpha_mode_from_extension_ex(image->filepath);
 }
 
-Image *BKE_image_load(Main 

[Bf-blender-cvs] [90e1c892b7a] universal-scene-description: USD Export: Save Blender file path to metadata.

2022-09-26 Thread Michael Kowalski
Commit: 90e1c892b7a1cc80de05260e7a71e2d2916ecb4d
Author: Michael Kowalski
Date:   Mon Sep 19 16:03:11 2022 -0400
Branches: universal-scene-description
https://developer.blender.org/rB90e1c892b7a1cc80de05260e7a71e2d2916ecb4d

USD Export: Save Blender file path to metadata.

Write source Blender file path to stage customData.

===

M   source/blender/editors/io/io_usd.c
M   source/blender/io/usd/intern/usd_capi_export.cc
M   source/blender/io/usd/usd.h

===

diff --git a/source/blender/editors/io/io_usd.c 
b/source/blender/editors/io/io_usd.c
index 924a4b18619..09d796fc315 100644
--- a/source/blender/editors/io/io_usd.c
+++ b/source/blender/editors/io/io_usd.c
@@ -303,6 +303,8 @@ static int wm_usd_export_exec(bContext *C, wmOperator *op)
 
   const bool export_blendshapes = RNA_boolean_get(op->ptr, 
"export_blendshapes");
 
+  const bool export_blender_metadata = RNA_boolean_get(op->ptr, 
"export_blender_metadata");
+
   struct USDExportParams params = {RNA_int_get(op->ptr, "start"),
RNA_int_get(op->ptr, "end"),
export_animation,
@@ -359,7 +361,8 @@ static int wm_usd_export_exec(bContext *C, wmOperator *op)
xform_op_mode,
fix_skel_root,
overwrite_textures,
-   export_blendshapes};
+   export_blendshapes,
+   export_blender_metadata};
 
   /* Take some defaults from the scene, if not specified explicitly. */
   Scene *scene = CTX_data_scene(C);
@@ -424,6 +427,7 @@ static void wm_usd_export_draw(bContext *C, wmOperator *op)
 
   box = uiLayoutBox(layout);
   uiItemL(box, IFACE_("Attributes:"), ICON_NONE);
+  uiItemR(box, ptr, "export_blender_metadata", 0, NULL, ICON_NONE);
   uiItemR(box, ptr, "export_custom_properties", 0, NULL, ICON_NONE);
   if (RNA_boolean_get(ptr, "export_custom_properties")) {
 uiItemR(box, ptr, "add_properties_namespace", 0, NULL, ICON_NONE);
@@ -517,6 +521,7 @@ static void wm_usd_export_draw(bContext *C, wmOperator *op)
   uiItemL(box, IFACE_("Experimental:"), ICON_NONE);
   uiItemR(box, ptr, "use_instancing", 0, NULL, ICON_NONE);
   uiItemR(box, ptr, "fix_skel_root", 0, NULL, ICON_NONE);
+
 }
 
 static bool wm_usd_export_check(bContext *UNUSED(C), wmOperator *op)
@@ -915,6 +920,12 @@ void WM_OT_usd_export(struct wmOperatorType *ot)
   "Relative Paths",
   "Use relative paths to reference external files (i.e. 
textures, volumes) in "
   "USD, otherwise use absolute paths");
+
+  RNA_def_boolean(ot->srna,
+  "export_blender_metadata",
+  true,
+  "Export Blender Metadata",
+  "Write Blender-specific information to the Stage's 
customLayerData");
 }
 
 /* == USD Import == */
diff --git a/source/blender/io/usd/intern/usd_capi_export.cc 
b/source/blender/io/usd/intern/usd_capi_export.cc
index 645b4b12a5e..d7f719e114b 100644
--- a/source/blender/io/usd/intern/usd_capi_export.cc
+++ b/source/blender/io/usd/intern/usd_capi_export.cc
@@ -288,6 +288,25 @@ static void export_startjob(void *customdata,
   usd_stage->GetRootLayer()->SetDocumentation(std::string("Blender v") +
   BKE_blender_version_string());
 
+  /* Add any Blender-specific custom export data */
+  if (data->params.export_blender_metadata && strlen(data->bmain->filepath)) {
+auto root_layer = usd_stage->GetRootLayer();
+char full_path[1024];
+strcpy(full_path, data->bmain->filepath);
+
+// make all paths uniformly unix-like
+BLI_str_replace_char(full_path + 2, SEP, ALTSEP);
+
+char basename[128];
+strcpy(basename, BLI_path_basename(full_path));
+BLI_split_dir_part(full_path, full_path, 1024);
+
+pxr::VtDictionary custom_data;
+custom_data.SetValueAtPath(std::string("sourceFilename"), 
pxr::VtValue(basename));
+custom_data.SetValueAtPath(std::string("sourceDirPath"), 
pxr::VtValue(full_path));
+root_layer->SetCustomLayerData(custom_data);
+  }
+
   /* Set up the stage for animated data. */
   if (data->params.export_animation) {
 usd_stage->SetTimeCodesPerSecond(FPS);
diff --git a/source/blender/io/usd/usd.h b/source/blender/io/usd/usd.h
index 3829bbda8f4..0f32968705e 100644
--- a/source/blender/io/usd/usd.h
+++ b/source/blender/io/usd/usd.h
@@ -121,6 +121,7 @@ struct USDExportParams {
   bool fix_skel_root;
   bool overwrite_textures;
   bool export_blendshapes;
+  bool export_blender_metadata;
 };
 
 struct USDImportParams {

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

[Bf-blender-cvs] [66a863e3019] master: Build: add OpenPGL as to deps builds

2022-09-26 Thread Sebastian Herhoz
Commit: 66a863e30197990e20a1e9a45923af6331935b21
Author: Sebastian Herhoz
Date:   Wed Sep 21 17:41:41 2022 +0200
Branches: master
https://developer.blender.org/rB66a863e30197990e20a1e9a45923af6331935b21

Build: add OpenPGL as to deps builds

Ref T92571, D15286

===

M   build_files/build_environment/CMakeLists.txt
M   build_files/build_environment/cmake/download.cmake
M   build_files/build_environment/cmake/harvest.cmake
A   build_files/build_environment/cmake/openpgl.cmake
M   build_files/build_environment/cmake/versions.cmake

===

diff --git a/build_files/build_environment/CMakeLists.txt 
b/build_files/build_environment/CMakeLists.txt
index ee8a9a26c53..8c427c63944 100644
--- a/build_files/build_environment/CMakeLists.txt
+++ b/build_files/build_environment/CMakeLists.txt
@@ -94,6 +94,7 @@ include(cmake/pugixml.cmake)
 include(cmake/ispc.cmake)
 include(cmake/openimagedenoise.cmake)
 include(cmake/embree.cmake)
+include(cmake/openpgl.cmake)
 include(cmake/fmt.cmake)
 include(cmake/robinmap.cmake)
 if(NOT APPLE)
diff --git a/build_files/build_environment/cmake/download.cmake 
b/build_files/build_environment/cmake/download.cmake
index 6f0dd80ea6a..82f5d8260b7 100644
--- a/build_files/build_environment/cmake/download.cmake
+++ b/build_files/build_environment/cmake/download.cmake
@@ -101,6 +101,7 @@ download_source(FMT)
 download_source(ROBINMAP)
 download_source(IMATH)
 download_source(PYSTRING)
+download_source(OPENPGL)
 download_source(LEVEL_ZERO)
 download_source(DPCPP)
 download_source(VCINTRINSICS)
diff --git a/build_files/build_environment/cmake/harvest.cmake 
b/build_files/build_environment/cmake/harvest.cmake
index 6ed98398fde..0184259f365 100644
--- a/build_files/build_environment/cmake/harvest.cmake
+++ b/build_files/build_environment/cmake/harvest.cmake
@@ -137,6 +137,9 @@ harvest(openimagedenoise/include openimagedenoise/include 
"*")
 harvest(openimagedenoise/lib openimagedenoise/lib "*.a")
 harvest(embree/include embree/include "*.h")
 harvest(embree/lib embree/lib "*.a")
+harvest(openpgl/include openpgl/include "*.h")
+harvest(openpgl/lib openpgl/lib "*.a")
+harvest(openpgl/lib/cmake/openpgl-${OPENPGL_SHORT_VERSION} 
openpgl/lib/cmake/openpgl "*.cmake")
 harvest(openjpeg/include/openjpeg-${OPENJPEG_SHORT_VERSION} openjpeg/include 
"*.h")
 harvest(openjpeg/lib openjpeg/lib "*.a")
 harvest(opensubdiv/include opensubdiv/include "*.h")
diff --git a/build_files/build_environment/cmake/openpgl.cmake 
b/build_files/build_environment/cmake/openpgl.cmake
new file mode 100644
index 000..e6b0cd8eb4a
--- /dev/null
+++ b/build_files/build_environment/cmake/openpgl.cmake
@@ -0,0 +1,49 @@
+# SPDX-License-Identifier: GPL-2.0-or-later
+
+# Note the utility apps may use png/tiff/gif system libraries, but the
+# library itself does not depend on them, so should give no problems.
+
+set(OPENPGL_EXTRA_ARGS
+-DOPENPGL_BUILD_PYTHON=OFF
+-DOPENPGL_BUILD_STATIC=ON
+-DOPENPGL_TBB_ROOT=${LIBDIR}/tbb
+-DTBB_ROOT=${LIBDIR}/tbb
+-Dembree_DIR=${LIBDIR}/embree/lib/cmake/embree-${EMBREE_VERSION}
+-DCMAKE_DEBUG_POSTFIX=_d
+)
+
+if(TBB_STATIC_LIBRARY)
+  set(OPENPGL_EXTRA_ARGS
+${OPENPGL_EXTRA_ARGS}
+-DOPENPGL_TBB_COMPONENT=tbb_static
+  )
+endif()
+
+ExternalProject_Add(external_openpgl
+URL file://${PACKAGE_DIR}/${OPENPGL_FILE}
+DOWNLOAD_DIR ${DOWNLOAD_DIR}
+URL_HASH ${OPENPGL_HASH_TYPE}=${OPENPGL_HASH}
+PREFIX ${BUILD_DIR}/openpgl
+CMAKE_ARGS -DCMAKE_INSTALL_PREFIX=${LIBDIR}/openpgl ${DEFAULT_CMAKE_FLAGS} 
${OPENPGL_EXTRA_ARGS}
+INSTALL_DIR ${LIBDIR}/openpgl
+)
+
+add_dependencies(
+external_openpgl
+external_tbb
+external_embree
+)
+
+if(WIN32)
+  if(BUILD_MODE STREQUAL Release)
+ExternalProject_Add_Step(external_openpgl after_install
+  COMMAND ${CMAKE_COMMAND} -E copy_directory ${LIBDIR}/openpgl 
${HARVEST_TARGET}/openpgl
+  DEPENDEES install
+)
+  else()
+  ExternalProject_Add_Step(external_openpgl after_install
+  COMMAND ${CMAKE_COMMAND} -E copy ${LIBDIR}/openpgl/lib/openpgl_d.lib 
${HARVEST_TARGET}/openpgl/lib/openpgl_d.lib
+  DEPENDEES install
+)
+  endif()
+endif()
diff --git a/build_files/build_environment/cmake/versions.cmake 
b/build_files/build_environment/cmake/versions.cmake
index 95425300923..a03adcbad7b 100644
--- a/build_files/build_environment/cmake/versions.cmake
+++ b/build_files/build_environment/cmake/versions.cmake
@@ -500,6 +500,13 @@ set(BROTLI_HASH 
f9e8d81d0405ba66d181529af42a3354f838c939095ff99930da6aa9cdf6fe46
 set(BROTLI_HASH_TYPE SHA256)
 set(BROTLI_FILE brotli-${BROTLI_VERSION}.tar.gz)
 
+set(OPENPGL_VERSION v0.3.1-beta)
+set(OPENPGL_SHORT_VERSION 0.3.1)
+set(OPENPGL_URI 
https://github.com/OpenPathGuidingLibrary/openpgl/archive/refs/tags/${OPENPGL_VERSION}.tar.gz)
+set(OPENPGL_HASH 
3830098c485c962018932766199527aab453a8029528dbbc04d4454d8243

[Bf-blender-cvs] [753dea79a37] blender-v3.3-release: UI: add preference to disable touchpad multitouch gestures

2022-09-26 Thread Brecht Van Lommel
Commit: 753dea79a37fd40122e57ec8c291d202a3aebd1c
Author: Brecht Van Lommel
Date:   Mon Sep 26 22:56:14 2022 +0200
Branches: blender-v3.3-release
https://developer.blender.org/rB753dea79a37fd40122e57ec8c291d202a3aebd1c

UI: add preference to disable touchpad multitouch gestures

Available on Windows and macOS, where such gestures are supported.
For Windows, disabling this option restores touchpad behavior to
match Blender 3.2.

Ref T97925

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

===

M   intern/ghost/GHOST_C-api.h
M   intern/ghost/GHOST_ISystem.h
M   intern/ghost/intern/GHOST_C-api.cpp
M   intern/ghost/intern/GHOST_System.cpp
M   intern/ghost/intern/GHOST_System.h
M   intern/ghost/intern/GHOST_SystemCocoa.mm
M   intern/ghost/intern/GHOST_SystemWin32.cpp
M   release/scripts/startup/bl_ui/space_userpref.py
M   source/blender/blenloader/intern/versioning_userdef.c
M   source/blender/makesdna/DNA_userdef_types.h
M   source/blender/makesrna/intern/rna_userdef.c
M   source/blender/windowmanager/WM_api.h
M   source/blender/windowmanager/intern/wm_files.c
M   source/blender/windowmanager/intern/wm_window.c

===

diff --git a/intern/ghost/GHOST_C-api.h b/intern/ghost/GHOST_C-api.h
index 4cbc0d65b11..22e8c6225e7 100644
--- a/intern/ghost/GHOST_C-api.h
+++ b/intern/ghost/GHOST_C-api.h
@@ -739,6 +739,13 @@ extern unsigned int 
GHOST_GetContextDefaultOpenGLFramebuffer(GHOST_ContextHandle
  */
 extern unsigned int GHOST_GetDefaultOpenGLFramebuffer(GHOST_WindowHandle 
windowhandle);
 
+/**
+ * Use multitouch gestures if supported.
+ * \param systemhandle: The handle to the system.
+ * \param use: Enable or disable.
+ */
+extern void GHOST_SetMultitouchGestures(GHOST_SystemHandle systemhandle, const 
bool use);
+
 /**
  * Set which tablet API to use. Only affects Windows, other platforms have a 
single API.
  * \param systemhandle: The handle to the system.
diff --git a/intern/ghost/GHOST_ISystem.h b/intern/ghost/GHOST_ISystem.h
index 91cf1c4c558..540fd3d554b 100644
--- a/intern/ghost/GHOST_ISystem.h
+++ b/intern/ghost/GHOST_ISystem.h
@@ -420,6 +420,12 @@ class GHOST_ISystem {
*/
   virtual GHOST_TSuccess getButtonState(GHOST_TButton mask, bool &isDown) 
const = 0;
 
+  /**
+   * Enable multitouch gestures if supported.
+   * \param use: Enable or disable.
+   */
+  virtual void setMultitouchGestures(const bool use) = 0;
+
   /**
* Set which tablet API to use. Only affects Windows, other platforms have a 
single API.
* \param api: Enum indicating which API to use.
diff --git a/intern/ghost/intern/GHOST_C-api.cpp 
b/intern/ghost/intern/GHOST_C-api.cpp
index 65e7de707ec..e1c766bf1fc 100644
--- a/intern/ghost/intern/GHOST_C-api.cpp
+++ b/intern/ghost/intern/GHOST_C-api.cpp
@@ -735,6 +735,12 @@ GHOST_TSuccess GHOST_InvalidateWindow(GHOST_WindowHandle 
windowhandle)
   return window->invalidate();
 }
 
+void GHOST_SetMultitouchGestures(GHOST_SystemHandle systemhandle, const bool 
use)
+{
+  GHOST_ISystem *system = GHOST_ISystem::getSystem();
+  return system->setMultitouchGestures(use);
+}
+
 void GHOST_SetTabletAPI(GHOST_SystemHandle systemhandle, GHOST_TTabletAPI api)
 {
   GHOST_ISystem *system = (GHOST_ISystem *)systemhandle;
diff --git a/intern/ghost/intern/GHOST_System.cpp 
b/intern/ghost/intern/GHOST_System.cpp
index cf04287af9f..2b0e44665f8 100644
--- a/intern/ghost/intern/GHOST_System.cpp
+++ b/intern/ghost/intern/GHOST_System.cpp
@@ -30,6 +30,7 @@ GHOST_System::GHOST_System()
 #ifdef WITH_INPUT_NDOF
   m_ndofManager(0),
 #endif
+  m_multitouchGestures(true),
   m_tabletAPI(GHOST_kTabletAutomatic),
   m_is_debug_enabled(false)
 {
@@ -307,6 +308,11 @@ GHOST_TSuccess GHOST_System::getButtonState(GHOST_TButton 
mask, bool &isDown) co
   return success;
 }
 
+void GHOST_System::setMultitouchGestures(const bool use)
+{
+  m_multitouchGestures = use;
+}
+
 void GHOST_System::setTabletAPI(GHOST_TTabletAPI api)
 {
   m_tabletAPI = api;
diff --git a/intern/ghost/intern/GHOST_System.h 
b/intern/ghost/intern/GHOST_System.h
index d5558be3444..a13e961019c 100644
--- a/intern/ghost/intern/GHOST_System.h
+++ b/intern/ghost/intern/GHOST_System.h
@@ -240,6 +240,12 @@ class GHOST_System : public GHOST_ISystem {
*/
   GHOST_TSuccess getButtonState(GHOST_TButton mask, bool &isDown) const;
 
+  /**
+   * Enable multitouch gestures if supported.
+   * \param use: Enable or disable.
+   */
+  void setMultitouchGestures(const bool use);
+
   /**
* Set which tablet API to use. Only affects Windows, other platforms have a 
single API.
* \param api: Enum indicating which API to use.
@@ -404,6 +410,9 @@ class GHOST_System : public GHOST_ISystem {
   /** Settings of the display before the display went fullscreen. */
   GHOST_DisplaySetting m_preFullScreenSetting;
 
+  /* Use multitouch gestures? */
+  bool 

[Bf-blender-cvs] [cd7e9a1ad5b] master: Cleanup: use the system-handle arg for GHOST_SetMultitouchGestures

2022-09-26 Thread Campbell Barton
Commit: cd7e9a1ad5b4f60934c4d95d81968788331db94a
Author: Campbell Barton
Date:   Tue Sep 27 07:03:58 2022 +1000
Branches: master
https://developer.blender.org/rBcd7e9a1ad5b4f60934c4d95d81968788331db94a

Cleanup: use the system-handle arg for GHOST_SetMultitouchGestures

There was an unused argument warning, quiet by using the argument.

===

M   intern/ghost/intern/GHOST_C-api.cpp

===

diff --git a/intern/ghost/intern/GHOST_C-api.cpp 
b/intern/ghost/intern/GHOST_C-api.cpp
index 1dc23a68cea..0026a33bfc2 100644
--- a/intern/ghost/intern/GHOST_C-api.cpp
+++ b/intern/ghost/intern/GHOST_C-api.cpp
@@ -745,7 +745,7 @@ GHOST_TSuccess GHOST_InvalidateWindow(GHOST_WindowHandle 
windowhandle)
 
 void GHOST_SetMultitouchGestures(GHOST_SystemHandle systemhandle, const bool 
use)
 {
-  GHOST_ISystem *system = GHOST_ISystem::getSystem();
+  GHOST_ISystem *system = (GHOST_ISystem *)systemhandle;
   return system->setMultitouchGestures(use);
 }

___
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] [bcb7b119ae5] master: Cleanup: remove workarounds and version checks for unsupported compilers

2022-09-26 Thread Campbell Barton
Commit: bcb7b119ae5240632b7f8b07f926c230f3c48daf
Author: Campbell Barton
Date:   Mon Sep 26 12:26:48 2022 +1000
Branches: master
https://developer.blender.org/rBbcb7b119ae5240632b7f8b07f926c230f3c48daf

Cleanup: remove workarounds and version checks for unsupported compilers

Match minimum supported versions from the WIKI [0] by raising them to:

- GCC 9.3.1
- CLANG 8.0
- MVCS 2019 (16.9.16 / 1928)

Details:

- Add CMake checks that ensure supported compiler versions early on.
- Previously GCC per-processor version checks served to exclude
  `__clang__`, in some cases this has been replaced by explicitly
  excluding `__clang__`. This was needed as CLANG treated some of these
  flags differently to GCC, causing the build to fail.
- Remove USE_APPLE_OMP_FIX GCC-4.2 OpenMP workaround.
- Remove linking error workaround for old MSVC versions.

[0]: https://wiki.blender.org/wiki/Building_Blender

Reviewed by: brecht, LazyDodo

Ref D16068

===

M   CMakeLists.txt
M   build_files/cmake/macros.cmake
M   build_files/cmake/platform/platform_unix.cmake
M   build_files/cmake/platform/platform_win32.cmake
M   extern/gflags/CMakeLists.txt
M   intern/atomic/intern/atomic_ops_utils.h
M   intern/atomic/tests/atomic_test.cc
M   source/blender/blenlib/BLI_assert.h
M   source/blender/blenlib/BLI_compiler_attrs.h
M   source/blender/blenlib/BLI_endian_switch_inline.h
M   source/blender/blenlib/BLI_math_inline.h
M   source/blender/blenlib/BLI_strict_flags.h
M   source/blender/blenlib/BLI_winstuff.h
M   source/blender/blenlib/intern/threads.cc
M   source/blender/imbuf/intern/openexr/openexr_api.cpp

===

diff --git a/CMakeLists.txt b/CMakeLists.txt
index 7a48caa4eae..ef3309ded48 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -111,6 +111,25 @@ blender_project_hack_post()
 enable_testing()
 
 
+# -
+# Test Compiler Support
+#
+# Keep in sync with: https://wiki.blender.org/wiki/Building_Blender
+
+if(CMAKE_COMPILER_IS_GNUCC)
+  if("${CMAKE_C_COMPILER_VERSION}" VERSION_LESS "9.3.1")
+message(FATAL_ERROR "The minimum supported version of GCC is 9.3.1")
+  endif()
+elseif(CMAKE_C_COMPILER_ID MATCHES "Clang")
+  if(CMAKE_COMPILER_IS_GNUCC AND ("${CMAKE_C_COMPILER_VERSION}" VERSION_LESS 
"8.0"))
+message(FATAL_ERROR "The minimum supported version of CLANG is 8.0")
+  endif()
+elseif(CMAKE_CXX_COMPILER_ID MATCHES MSVC)
+  if(MSVC_VERSION VERSION_LESS "1928")
+message(FATAL_ERROR "The minimum supported version of MSVC is 2019 
(16.9.16)")
+  endif()
+endif()
+
 # -
 # Test Compiler/Library Features
 
@@ -1428,22 +1447,13 @@ if(CMAKE_COMPILER_IS_GNUCC)
   add_check_c_compiler_flag(C_WARNINGS C_WARN_NO_NULL -Wnonnull)
   add_check_c_compiler_flag(C_WARNINGS C_WARN_ABSOLUTE_VALUE -Wabsolute-value)
 
-  # gcc 4.2 gives annoying warnings on every file with this
-  if(NOT "${CMAKE_C_COMPILER_VERSION}" VERSION_LESS "4.3")
-add_check_c_compiler_flag(C_WARNINGS C_WARN_UNINITIALIZED -Wuninitialized)
-add_check_cxx_compiler_flag(CXX_WARNINGS CXX_WARN_UNINITIALIZED 
-Wuninitialized)
-  endif()
+  add_check_c_compiler_flag(C_WARNINGS C_WARN_UNINITIALIZED -Wuninitialized)
+  add_check_cxx_compiler_flag(CXX_WARNINGS CXX_WARN_UNINITIALIZED 
-Wuninitialized)
 
-  # versions before gcc4.6 give many BLI_math warnings
-  if(NOT "${CMAKE_C_COMPILER_VERSION}" VERSION_LESS "4.6")
-add_check_c_compiler_flag(C_WARNINGS C_WARN_REDUNDANT_DECLS   
-Wredundant-decls)
-add_check_cxx_compiler_flag(CXX_WARNINGS CXX_WARN_REDUNDANT_DECLS 
-Wredundant-decls)
-  endif()
+  add_check_c_compiler_flag(C_WARNINGS C_WARN_REDUNDANT_DECLS   
-Wredundant-decls)
+  add_check_cxx_compiler_flag(CXX_WARNINGS CXX_WARN_REDUNDANT_DECLS 
-Wredundant-decls)
 
-  # versions before gcc4.8 include global name-space.
-  if(NOT "${CMAKE_C_COMPILER_VERSION}" VERSION_LESS "4.8")
-add_check_c_compiler_flag(C_WARNINGS C_WARN_SHADOW -Wshadow)
-  endif()
+  add_check_c_compiler_flag(C_WARNINGS C_WARN_SHADOW -Wshadow)
 
   # disable because it gives warnings for printf() & friends.
   # add_check_c_compiler_flag(C_WARNINGS C_WARN_DOUBLE_PROMOTION 
-Wdouble-promotion -Wno-error=double-promotion)
@@ -1470,11 +1480,7 @@ if(CMAKE_COMPILER_IS_GNUCC)
   add_check_cxx_compiler_flag(CXX_WARNINGS CXX_WARN_FORMAT_SIGN 
-Wformat-signedness)
   add_check_cxx_compiler_flag(CXX_WARNINGS CXX_WARN_RESTRICT -Wrestrict)
   add_check_cxx_compiler_flag(CXX_WARNINGS CXX_WARN_NO_SUGGEST_OVERRIDE  
-Wno-suggest-override)
-
-  # gcc 4.2 gives annoying warnings on every file with this
-  if(NOT "${CMAKE_C_COMPILER_VERSION}" VERSION_LESS "4.3")
-add_check_cxx_compiler_flag(CXX_WARNINGS CXX_WARN_UNINITIALIZED 
-Wuninitialized)
-  endif()
+  add_chec

[Bf-blender-cvs] [84ddb8b3cc9] master: UI: add preference to disable touchpad multitouch gestures

2022-09-26 Thread recht Van Lommel
Commit: 84ddb8b3cc9989c2d5569bf2fa381a585f99d20f
Author: recht Van Lommel
Date:   Mon Sep 26 22:56:14 2022 +0200
Branches: master
https://developer.blender.org/rB84ddb8b3cc9989c2d5569bf2fa381a585f99d20f

UI: add preference to disable touchpad multitouch gestures

Available on Windows and macOS, where such gestures are supported.
For Windows, disabling this option restores touchpad behavior to
match Blender 3.2.

Ref T97925

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

===

M   intern/ghost/GHOST_C-api.h
M   intern/ghost/GHOST_ISystem.h
M   intern/ghost/intern/GHOST_C-api.cpp
M   intern/ghost/intern/GHOST_System.cpp
M   intern/ghost/intern/GHOST_System.h
M   intern/ghost/intern/GHOST_SystemCocoa.mm
M   intern/ghost/intern/GHOST_SystemWin32.cpp
M   release/scripts/startup/bl_ui/space_userpref.py
M   source/blender/blenloader/intern/versioning_userdef.c
M   source/blender/makesdna/DNA_userdef_types.h
M   source/blender/makesrna/intern/rna_userdef.c
M   source/blender/windowmanager/WM_api.h
M   source/blender/windowmanager/intern/wm_files.c
M   source/blender/windowmanager/intern/wm_window.c

===

diff --git a/intern/ghost/GHOST_C-api.h b/intern/ghost/GHOST_C-api.h
index 399ee67a8fa..9da7d314052 100644
--- a/intern/ghost/GHOST_C-api.h
+++ b/intern/ghost/GHOST_C-api.h
@@ -740,6 +740,13 @@ extern unsigned int 
GHOST_GetContextDefaultOpenGLFramebuffer(GHOST_ContextHandle
  */
 extern unsigned int GHOST_GetDefaultOpenGLFramebuffer(GHOST_WindowHandle 
windowhandle);
 
+/**
+ * Use multitouch gestures if supported.
+ * \param systemhandle: The handle to the system.
+ * \param use: Enable or disable.
+ */
+extern void GHOST_SetMultitouchGestures(GHOST_SystemHandle systemhandle, const 
bool use);
+
 /**
  * Set which tablet API to use. Only affects Windows, other platforms have a 
single API.
  * \param systemhandle: The handle to the system.
diff --git a/intern/ghost/GHOST_ISystem.h b/intern/ghost/GHOST_ISystem.h
index d9be1454cea..da6233456c3 100644
--- a/intern/ghost/GHOST_ISystem.h
+++ b/intern/ghost/GHOST_ISystem.h
@@ -420,6 +420,12 @@ class GHOST_ISystem {
*/
   virtual GHOST_TSuccess getButtonState(GHOST_TButton mask, bool &isDown) 
const = 0;
 
+  /**
+   * Enable multitouch gestures if supported.
+   * \param use: Enable or disable.
+   */
+  virtual void setMultitouchGestures(const bool use) = 0;
+
   /**
* Set which tablet API to use. Only affects Windows, other platforms have a 
single API.
* \param api: Enum indicating which API to use.
diff --git a/intern/ghost/intern/GHOST_C-api.cpp 
b/intern/ghost/intern/GHOST_C-api.cpp
index 1ec7d2f926c..1dc23a68cea 100644
--- a/intern/ghost/intern/GHOST_C-api.cpp
+++ b/intern/ghost/intern/GHOST_C-api.cpp
@@ -743,6 +743,12 @@ GHOST_TSuccess GHOST_InvalidateWindow(GHOST_WindowHandle 
windowhandle)
   return window->invalidate();
 }
 
+void GHOST_SetMultitouchGestures(GHOST_SystemHandle systemhandle, const bool 
use)
+{
+  GHOST_ISystem *system = GHOST_ISystem::getSystem();
+  return system->setMultitouchGestures(use);
+}
+
 void GHOST_SetTabletAPI(GHOST_SystemHandle systemhandle, GHOST_TTabletAPI api)
 {
   GHOST_ISystem *system = (GHOST_ISystem *)systemhandle;
diff --git a/intern/ghost/intern/GHOST_System.cpp 
b/intern/ghost/intern/GHOST_System.cpp
index 714565568dc..94d021fd822 100644
--- a/intern/ghost/intern/GHOST_System.cpp
+++ b/intern/ghost/intern/GHOST_System.cpp
@@ -30,6 +30,7 @@ GHOST_System::GHOST_System()
 #ifdef WITH_INPUT_NDOF
   m_ndofManager(0),
 #endif
+  m_multitouchGestures(true),
   m_tabletAPI(GHOST_kTabletAutomatic),
   m_is_debug_enabled(false)
 {
@@ -305,6 +306,11 @@ GHOST_TSuccess GHOST_System::getButtonState(GHOST_TButton 
mask, bool &isDown) co
   return success;
 }
 
+void GHOST_System::setMultitouchGestures(const bool use)
+{
+  m_multitouchGestures = use;
+}
+
 void GHOST_System::setTabletAPI(GHOST_TTabletAPI api)
 {
   m_tabletAPI = api;
diff --git a/intern/ghost/intern/GHOST_System.h 
b/intern/ghost/intern/GHOST_System.h
index 83f8cb254ce..7a22e2aa259 100644
--- a/intern/ghost/intern/GHOST_System.h
+++ b/intern/ghost/intern/GHOST_System.h
@@ -239,6 +239,12 @@ class GHOST_System : public GHOST_ISystem {
*/
   GHOST_TSuccess getButtonState(GHOST_TButton mask, bool &isDown) const;
 
+  /**
+   * Enable multitouch gestures if supported.
+   * \param use: Enable or disable.
+   */
+  void setMultitouchGestures(const bool use);
+
   /**
* Set which tablet API to use. Only affects Windows, other platforms have a 
single API.
* \param api: Enum indicating which API to use.
@@ -402,6 +408,9 @@ class GHOST_System : public GHOST_ISystem {
   /** Settings of the display before the display went full-screen. */
   GHOST_DisplaySetting m_preFullScreenSetting;
 
+  /* Use multitouch gestures? */
+  bool m_multitouchGe

[Bf-blender-cvs] [57ea827bfb2] master: Fix: Incorrect handling for crease layers

2022-09-26 Thread Hans Goudey
Commit: 57ea827bfb28eb697b74dbc606facbc133e10fab
Author: Hans Goudey
Date:   Mon Sep 26 15:42:20 2022 -0500
Branches: master
https://developer.blender.org/rB57ea827bfb28eb697b74dbc606facbc133e10fab

Fix: Incorrect handling for crease layers

First, there can only be one crease layer, so remove the "default name",
since apparently that's how CustomData tests for that
(see `CustomData_layertype_is_singleton`).

Second, always propagate crease data because it can be used in arbitrary
situations by geometry nodes. That also has to be done for all generic
attribute layers.

Fixes T101340, T101373

===

M   source/blender/blenkernel/intern/customdata.cc
M   source/blender/blenkernel/intern/object_update.c

===

diff --git a/source/blender/blenkernel/intern/customdata.cc 
b/source/blender/blenkernel/intern/customdata.cc
index 3acd7bb0c80..66b929d7c55 100644
--- a/source/blender/blenkernel/intern/customdata.cc
+++ b/source/blender/blenkernel/intern/customdata.cc
@@ -1869,7 +1869,7 @@ static const LayerTypeInfo LAYERTYPEINFO[CD_NUMTYPES] = {
 /* 29: CD_BWEIGHT */
 {sizeof(MFloatProperty), "MFloatProperty", 1, nullptr, nullptr, nullptr, 
layerInterp_bweight},
 /* 30: CD_CREASE */
-{sizeof(float), "", 0, N_("SubSurfCrease"), nullptr, nullptr, 
layerInterp_propFloat},
+{sizeof(float), "", 0, nullptr, nullptr, nullptr, layerInterp_propFloat},
 /* 31: CD_ORIGSPACE_MLOOP */
 {sizeof(OrigSpaceLoop),
  "OrigSpaceLoop",
diff --git a/source/blender/blenkernel/intern/object_update.c 
b/source/blender/blenkernel/intern/object_update.c
index 91170060fee..3fe8b95e656 100644
--- a/source/blender/blenkernel/intern/object_update.c
+++ b/source/blender/blenkernel/intern/object_update.c
@@ -141,9 +141,10 @@ void BKE_object_handle_data_update(Depsgraph *depsgraph, 
Scene *scene, Object *o
   CustomData_MeshMasks cddata_masks = scene->customdata_mask;
   CustomData_MeshMasks_update(&cddata_masks, &CD_MASK_BAREMESH);
   /* Custom attributes should not be removed automatically. They might be 
used by the render
-   * engine or scripts. They can still be removed explicitly using 
geometry nodes. */
-  cddata_masks.vmask |= CD_MASK_PROP_ALL;
-  cddata_masks.emask |= CD_MASK_PROP_ALL;
+   * engine or scripts. They can still be removed explicitly using 
geometry nodes.
+   * Crease can be be used in generic situations with geometry nodes as 
well. */
+  cddata_masks.vmask |= CD_MASK_PROP_ALL | CD_MASK_CREASE;
+  cddata_masks.emask |= CD_MASK_PROP_ALL | CD_MASK_CREASE;
   cddata_masks.fmask |= CD_MASK_PROP_ALL;
   cddata_masks.pmask |= CD_MASK_PROP_ALL;
   cddata_masks.lmask |= CD_MASK_PROP_ALL;

___
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] [6012deddfea] blender-v3.3-release: Fix T101365: saving second view layer as (non-Multilayer) OpenEXR does not work

2022-09-26 Thread Brecht Van Lommel
Commit: 6012deddfea4a9526fe2acf02c591892867c32d7
Author: Brecht Van Lommel
Date:   Mon Sep 26 22:24:39 2022 +0200
Branches: blender-v3.3-release
https://developer.blender.org/rB6012deddfea4a9526fe2acf02c591892867c32d7

Fix T101365: saving second view layer as (non-Multilayer) OpenEXR does not work

===

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

===

diff --git a/source/blender/blenkernel/intern/image_save.cc 
b/source/blender/blenkernel/intern/image_save.cc
index 7d7d49275ba..c24731efb41 100644
--- a/source/blender/blenkernel/intern/image_save.cc
+++ b/source/blender/blenkernel/intern/image_save.cc
@@ -791,8 +791,10 @@ bool BKE_image_render_write_exr(ReportList *reports,
   LISTBASE_FOREACH (RenderLayer *, rl, &rr->layers) {
 /* Skip other render layers if requested. */
 if (!multi_layer && nr != layer) {
+  nr++;
   continue;
 }
+nr++;
 
 LISTBASE_FOREACH (RenderPass *, rp, &rl->passes) {
   /* Skip non-RGBA and Z passes if not using multi layer. */

___
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] [8d49a4f36ea] master: Fix T101365: saving second view layer as (non-Multilayer) OpenEXR does not work

2022-09-26 Thread Brecht Van Lommel
Commit: 8d49a4f36ea4409b53fa571f39ae1c27c3444ff1
Author: Brecht Van Lommel
Date:   Mon Sep 26 22:24:39 2022 +0200
Branches: master
https://developer.blender.org/rB8d49a4f36ea4409b53fa571f39ae1c27c3444ff1

Fix T101365: saving second view layer as (non-Multilayer) OpenEXR does not work

===

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

===

diff --git a/source/blender/blenkernel/intern/image_save.cc 
b/source/blender/blenkernel/intern/image_save.cc
index 74582446315..41a5f88f677 100644
--- a/source/blender/blenkernel/intern/image_save.cc
+++ b/source/blender/blenkernel/intern/image_save.cc
@@ -798,8 +798,10 @@ bool BKE_image_render_write_exr(ReportList *reports,
   LISTBASE_FOREACH (RenderLayer *, rl, &rr->layers) {
 /* Skip other render layers if requested. */
 if (!multi_layer && nr != layer) {
+  nr++;
   continue;
 }
+nr++;
 
 LISTBASE_FOREACH (RenderPass *, rp, &rl->passes) {
   /* Skip non-RGBA and Z passes if not using multi layer. */

___
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] [cc1105f01b0] blender-v3.3-release: Fix T101354: Cycles crash with baking and adaptive sampling

2022-09-26 Thread Brecht Van Lommel
Commit: cc1105f01b0294a4a9758559f8b4e4d2f86a5117
Author: Brecht Van Lommel
Date:   Mon Sep 26 21:13:23 2022 +0200
Branches: blender-v3.3-release
https://developer.blender.org/rBcc1105f01b0294a4a9758559f8b4e4d2f86a5117

Fix T101354: Cycles crash with baking and adaptive sampling

===

M   intern/cycles/session/tile.cpp

===

diff --git a/intern/cycles/session/tile.cpp b/intern/cycles/session/tile.cpp
index f4930cbb945..362372f1d7b 100644
--- a/intern/cycles/session/tile.cpp
+++ b/intern/cycles/session/tile.cpp
@@ -7,6 +7,7 @@
 
 #include "graph/node.h"
 #include "scene/background.h"
+#include "scene/bake.h"
 #include "scene/film.h"
 #include "scene/integrator.h"
 #include "scene/scene.h"
@@ -367,7 +368,9 @@ void TileManager::update(const BufferParams ¶ms, const 
Scene *scene)
 node_to_image_spec_atttributes(
 &write_state_.image_spec, &denoise_params, ATTR_DENOISE_SOCKET_PREFIX);
 
-if (adaptive_sampling.use) {
+/* Not adaptive sampling overscan yet for baking, would need overscan also
+ * for buffers read from the output driver. */
+if (adaptive_sampling.use && !scene->bake_manager->get_baking()) {
   overscan_ = 4;
 }
 else {

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


[Bf-blender-cvs] [ddf6f70049e] master: Fix build errors and warnings after recent changes, when not using Unity build

2022-09-26 Thread Brecht Van Lommel
Commit: ddf6f70049e5a9f537ce15a5412bb67b4229ef43
Author: Brecht Van Lommel
Date:   Mon Sep 26 21:11:44 2022 +0200
Branches: master
https://developer.blender.org/rBddf6f70049e5a9f537ce15a5412bb67b4229ef43

Fix build errors and warnings after recent changes, when not using Unity build

===

M   source/blender/compositor/intern/COM_ChunkOrder.h
M   source/blender/editors/transform/transform.c
M   source/blender/freestyle/intern/system/RandGen.cpp

===

diff --git a/source/blender/compositor/intern/COM_ChunkOrder.h 
b/source/blender/compositor/intern/COM_ChunkOrder.h
index 927eab97ccd..ef65d90dd3a 100644
--- a/source/blender/compositor/intern/COM_ChunkOrder.h
+++ b/source/blender/compositor/intern/COM_ChunkOrder.h
@@ -7,20 +7,22 @@
 #  include "MEM_guardedalloc.h"
 #endif
 
+#include "BLI_sys_types.h"
+
 #include "COM_ChunkOrderHotspot.h"
 
 namespace blender::compositor {
 
 /** Helper to determine the order how chunks are prioritized during execution. 
*/
 struct ChunkOrder {
-  unsigned int index = 0;
+  uint index = 0;
   int x = 0;
   int y = 0;
   double distance = 0.0;
 
   friend bool operator<(const ChunkOrder &a, const ChunkOrder &b);
 
-  void update_distance(ChunkOrderHotspot *hotspots, unsigned int len_hotspots);
+  void update_distance(ChunkOrderHotspot *hotspots, uint len_hotspots);
 
 #ifdef WITH_CXX_GUARDEDALLOC
   MEM_CXX_CLASS_ALLOC_FUNCS("COM:ChunkOrderHotspot")
diff --git a/source/blender/editors/transform/transform.c 
b/source/blender/editors/transform/transform.c
index 716005333c8..a0934ae27aa 100644
--- a/source/blender/editors/transform/transform.c
+++ b/source/blender/editors/transform/transform.c
@@ -1579,10 +1579,10 @@ void saveTransform(bContext *C, TransInfo *t, 
wmOperator *op)
   }
 
   /* Save snapping settings. */
-  if (prop = RNA_struct_find_property(op->ptr, "snap")) {
+  if ((prop = RNA_struct_find_property(op->ptr, "snap"))) {
 RNA_property_boolean_set(op->ptr, prop, (t->modifiers & MOD_SNAP) != 0);
 
-if (prop = RNA_struct_find_property(op->ptr, "snap_elements")) {
+if ((prop = RNA_struct_find_property(op->ptr, "snap_elements"))) {
   RNA_property_enum_set(op->ptr, prop, t->tsnap.mode);
   RNA_boolean_set(op->ptr, "use_snap_project", t->tsnap.project);
   RNA_enum_set(op->ptr, "snap_target", t->tsnap.source_select);
diff --git a/source/blender/freestyle/intern/system/RandGen.cpp 
b/source/blender/freestyle/intern/system/RandGen.cpp
index 21ae863723a..b2161480c74 100644
--- a/source/blender/freestyle/intern/system/RandGen.cpp
+++ b/source/blender/freestyle/intern/system/RandGen.cpp
@@ -7,6 +7,8 @@
 
 #include "RandGen.h"
 
+#include "BLI_sys_types.h"
+
 namespace Freestyle {
 
 //

___
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] [d4fc451b90b] master: Fix T101354: Cycles crash with baking and adaptive sampling

2022-09-26 Thread Brecht Van Lommel
Commit: d4fc451b90be4b3bbb9d93713c1cca36e3ee42d5
Author: Brecht Van Lommel
Date:   Mon Sep 26 21:13:23 2022 +0200
Branches: master
https://developer.blender.org/rBd4fc451b90be4b3bbb9d93713c1cca36e3ee42d5

Fix T101354: Cycles crash with baking and adaptive sampling

===

M   intern/cycles/session/tile.cpp

===

diff --git a/intern/cycles/session/tile.cpp b/intern/cycles/session/tile.cpp
index f4930cbb945..362372f1d7b 100644
--- a/intern/cycles/session/tile.cpp
+++ b/intern/cycles/session/tile.cpp
@@ -7,6 +7,7 @@
 
 #include "graph/node.h"
 #include "scene/background.h"
+#include "scene/bake.h"
 #include "scene/film.h"
 #include "scene/integrator.h"
 #include "scene/scene.h"
@@ -367,7 +368,9 @@ void TileManager::update(const BufferParams ¶ms, const 
Scene *scene)
 node_to_image_spec_atttributes(
 &write_state_.image_spec, &denoise_params, ATTR_DENOISE_SOCKET_PREFIX);
 
-if (adaptive_sampling.use) {
+/* Not adaptive sampling overscan yet for baking, would need overscan also
+ * for buffers read from the output driver. */
+if (adaptive_sampling.use && !scene->bake_manager->get_baking()) {
   overscan_ = 4;
 }
 else {

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


[Bf-blender-cvs] [c15a7615245] master: Geometry Nodes: Miscellaneous changes in control point neighbors node

2022-09-26 Thread Hans Goudey
Commit: c15a761524546faa5b82d7da6e7f614efd2ad89a
Author: Hans Goudey
Date:   Mon Sep 26 13:23:07 2022 -0500
Branches: master
https://developer.blender.org/rBc15a761524546faa5b82d7da6e7f614efd2ad89a

Geometry Nodes: Miscellaneous changes in control point neighbors node

- Use const and whitespace more consistently
- Fix "Offset Valid" output only working on point domain
- Use the smallest output array that can contain the result.
- Consistent include ordering
- Use "data-block" term instead of "object" in tooltip
- Remove unnecessary call to set default output values

===

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

===

diff --git 
a/source/blender/nodes/geometry/nodes/node_geo_input_control_point_neighbors.cc 
b/source/blender/nodes/geometry/nodes/node_geo_input_control_point_neighbors.cc
index 33b15e0056e..b5d0c8cdd74 100644
--- 
a/source/blender/nodes/geometry/nodes/node_geo_input_control_point_neighbors.cc
+++ 
b/source/blender/nodes/geometry/nodes/node_geo_input_control_point_neighbors.cc
@@ -2,10 +2,10 @@
 
 #include "BLI_task.hh"
 
-#include "node_geometry_util.hh"
-
 #include "BKE_curves.hh"
 
+#include "node_geometry_util.hh"
+
 namespace blender::nodes::node_geo_input_control_point_neighbors_cc {
 
 static void node_declare(NodeDeclarationBuilder &b)
@@ -25,7 +25,7 @@ static void node_declare(NodeDeclarationBuilder &b)
   b.add_output(N_("Point Index"))
   .field_source()
   .description(N_("The index of the control point plus the offset within 
the entire "
-  "curves object"));
+  "curves data-block"));
 }
 
 static int apply_offset_in_cyclic_range(const IndexRange range,
@@ -53,33 +53,34 @@ static Array build_parent_curves(const 
bke::CurvesGeometry &curves)
 
 class ControlPointNeighborFieldInput final : public bke::CurvesFieldInput {
  private:
-  Field index_;
-  Field offset_;
+  const Field index_;
+  const Field offset_;
 
  public:
   ControlPointNeighborFieldInput(Field index, Field offset)
-  : CurvesFieldInput(CPPType::get(), "Control Point Neighbors node"),
-index_(index),
-offset_(offset)
+  : CurvesFieldInput(CPPType::get(), "Control Point Neighbors"),
+index_(std::move(index)),
+offset_(std::move(offset))
   {
 category_ = Category::Generated;
   }
 
   GVArray get_varray_for_context(const bke::CurvesGeometry &curves,
  const eAttrDomain domain,
- IndexMask mask) const final
+ const IndexMask mask) const final
   {
 const VArray cyclic = curves.cyclic();
 const Array parent_curves = build_parent_curves(curves);
-bke::CurvesFieldContext context{curves, domain};
+
+const bke::CurvesFieldContext context{curves, domain};
 fn::FieldEvaluator evaluator{context, &mask};
 evaluator.add(index_);
 evaluator.add(offset_);
 evaluator.evaluate();
 const VArray indices = evaluator.get_evaluated(0);
 const VArray offsets = evaluator.get_evaluated(1);
-Array output(curves.points_num());
 
+Array output(mask.min_array_size());
 for (const int i_selection : mask) {
   const int i_point = std::clamp(indices[i_selection], 0, 
curves.points_num() - 1);
   const int i_curve = parent_curves[i_point];
@@ -91,7 +92,7 @@ class ControlPointNeighborFieldInput final : public 
bke::CurvesFieldInput {
 curve_points, i_point, offsets[i_selection]);
 continue;
   }
-  output[i_selection] = std::clamp(offset_point, 0, 
int(curves.points_num() - 1));
+  output[i_selection] = std::clamp(offset_point, 0, curves.points_num() - 
1);
 }
 
 return VArray::ForContainer(std::move(output));
@@ -100,12 +101,14 @@ class ControlPointNeighborFieldInput final : public 
bke::CurvesFieldInput {
 
 class OffsetValidFieldInput final : public bke::CurvesFieldInput {
  private:
-  Field index_;
-  Field offset_;
+  const Field index_;
+  const Field offset_;
 
  public:
   OffsetValidFieldInput(Field index, Field offset)
-  : CurvesFieldInput(CPPType::get(), "Offset Valid"), index_(index), 
offset_(offset)
+  : CurvesFieldInput(CPPType::get(), "Offset Valid"),
+index_(std::move(index)),
+offset_(std::move(offset))
   {
 category_ = Category::Generated;
   }
@@ -114,24 +117,25 @@ class OffsetValidFieldInput final : public 
bke::CurvesFieldInput {
  const eAttrDomain domain,
  const IndexMask mask) const final
   {
-bke::CurvesFieldContext context{curves, ATTR_DOMAIN_POINT};
+const VArray cyclic = curves.cyclic();
+const Array parent_curves = build_parent_curves(curves);
+
+const bke::CurvesFieldContext context{curves, domain};
 fn::FieldEvaluator evaluator{context, &mask};

[Bf-blender-cvs] [837144b4577] master: Nodes: Use plain menus for geometry nodes add menu

2022-09-26 Thread Hans Goudey
Commit: 837144b4577f161baf1625f8a5478c83a088ea0f
Author: Hans Goudey
Date:   Mon Sep 26 12:36:13 2022 -0500
Branches: master
https://developer.blender.org/rB837144b4577f161baf1625f8a5478c83a088ea0f

Nodes: Use plain menus for geometry nodes add menu

At the cost of slightly more boilerplate code, we can avoid the `NodeItem`
and `NodeCategory` abstractions used to build the node add menu.
This makes the menus more flexible and more obvious, which will
make them easier to extend with assets.

The identifiers for the new menu types are inconsistent with regular
class naming for backwards compatibility with the old "category"
menu naming.

Also adds an item for the "Self Object" node missed in dd5131bd700c.

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

===

M   release/scripts/startup/bl_ui/__init__.py
A   release/scripts/startup/bl_ui/node_add_menu.py
A   release/scripts/startup/bl_ui/node_add_menu_geometry.py
M   release/scripts/startup/bl_ui/space_node.py
M   release/scripts/startup/nodeitems_builtins.py

===

diff --git a/release/scripts/startup/bl_ui/__init__.py 
b/release/scripts/startup/bl_ui/__init__.py
index a57a2cc5a4c..eaf61b58e6d 100644
--- a/release/scripts/startup/bl_ui/__init__.py
+++ b/release/scripts/startup/bl_ui/__init__.py
@@ -9,6 +9,8 @@ if "bpy" in locals():
 del reload
 
 _modules = [
+"node_add_menu",
+"node_add_menu_geometry",
 "properties_animviz",
 "properties_constraint",
 "properties_data_armature",
diff --git a/release/scripts/startup/bl_ui/node_add_menu.py 
b/release/scripts/startup/bl_ui/node_add_menu.py
new file mode 100644
index 000..17bff9a5087
--- /dev/null
+++ b/release/scripts/startup/bl_ui/node_add_menu.py
@@ -0,0 +1,63 @@
+# SPDX-License-Identifier: GPL-2.0-or-later
+import bpy
+from bpy.types import Menu
+from bpy.app.translations import (
+pgettext_iface as iface_,
+contexts as i18n_contexts,
+)
+
+def add_node_type(layout, node_type, *, label=None):
+"""Add a node type to a menu."""
+bl_rna = bpy.types.Node.bl_rna_get_subclass(node_type)
+if not label:
+label = bl_rna.name if bl_rna else iface_("Unknown")
+translation_context = bl_rna.translation_context if bl_rna else 
i18n_contexts.default
+props = layout.operator("node.add_node", text=label, 
text_ctxt=translation_context)
+props.type = node_type
+props.use_transform = True
+return props
+
+
+def draw_node_group_add_menu(context, layout):
+"""Add items to the layout used for interacting with node groups."""
+space_node = context.space_data
+node_tree = space_node.edit_tree
+all_node_groups = context.blend_data.node_groups
+
+layout.operator("node.group_make")
+layout.operator("node.group_ungroup")
+if node_tree in all_node_groups.values():
+layout.separator()
+add_node_type(layout, "NodeGroupInput")
+add_node_type(layout, "NodeGroupOutput")
+
+if node_tree:
+from nodeitems_builtins import node_tree_group_type
+def contains_group(nodetree, group):
+if nodetree == group:
+return True
+for node in nodetree.nodes:
+if node.bl_idname in node_tree_group_type.values() and 
node.node_tree is not None:
+if contains_group(node.node_tree, group):
+return True
+return False
+
+groups = [group for group in context.blend_data.node_groups if 
group.bl_idname == node_tree.bl_idname and
+not 
contains_group(group, node_tree) and
+not 
group.name.startswith('.')]
+if groups:
+layout.separator()
+for group in groups:
+props = add_node_type(layout, 
node_tree_group_type[group.bl_idname], label=group.name)
+ops = props.settings.add()
+ops.name = "node_tree"
+ops.value = "bpy.data.node_groups[%r]" % group.name
+
+
+classes = (
+)
+
+if __name__ == "__main__":  # only for live edit.
+from bpy.utils import register_class
+for cls in classes:
+register_class(cls)
diff --git a/release/scripts/startup/bl_ui/node_add_menu_geometry.py 
b/release/scripts/startup/bl_ui/node_add_menu_geometry.py
new file mode 100644
index 000..d164d0d2c83
--- /dev/null
+++ b/release/scripts/startup/bl_ui/node_add_menu_geometry.py
@@ -0,0 +1,395 @@
+# SPDX-License-Identifier: GPL-2.0-or-later
+import bpy
+from bpy.types import Menu
+from bl_ui import node_add_menu
+from bpy.app.translations import pgettext_iface as iface_
+
+class NODE_MT_geometry_node_GEO_ATTRIBUTE(Menu):
+bl_idname = "NODE_MT_geometry_node_GEO_ATTRIBUTE"
+bl_label = "Attribute"
+
+def draw(self, _context)

[Bf-blender-cvs] [8a6dc0fac71] master: Geometry Nodes: Control Point Neighbors Node

2022-09-26 Thread Johnny Matthews
Commit: 8a6dc0fac71cc5eb6fc945295b9c1f51f72cc407
Author: Johnny Matthews
Date:   Mon Sep 26 13:03:28 2022 -0500
Branches: master
https://developer.blender.org/rB8a6dc0fac71cc5eb6fc945295b9c1f51f72cc407

Geometry Nodes: Control Point Neighbors Node

This node allows access to the indices of neighboring control points
within a curve via an offset. This includes taking into consideration
curves that are cyclic.

Differential Revision: D13373

===

M   release/scripts/startup/nodeitems_builtins.py
M   source/blender/blenkernel/BKE_node.h
M   source/blender/blenkernel/intern/node.cc
M   source/blender/nodes/NOD_geometry.h
M   source/blender/nodes/NOD_static_types.h
M   source/blender/nodes/geometry/CMakeLists.txt
A   
source/blender/nodes/geometry/nodes/node_geo_input_control_point_neighbors.cc

===

diff --git a/release/scripts/startup/nodeitems_builtins.py 
b/release/scripts/startup/nodeitems_builtins.py
index 95bb9fd7e40..38629c18ca0 100644
--- a/release/scripts/startup/nodeitems_builtins.py
+++ b/release/scripts/startup/nodeitems_builtins.py
@@ -82,6 +82,7 @@ def curve_node_items(context):
 yield NodeItem("GeometryNodeSubdivideCurve")
 yield NodeItem("GeometryNodeTrimCurve")
 yield NodeItemCustom(draw=lambda self, layout, context: layout.separator())
+yield NodeItem("GeometryNodeInputControlPointNeighbors")
 yield NodeItem("GeometryNodeInputCurveHandlePositions")
 yield NodeItem("GeometryNodeInputTangent")
 yield NodeItem("GeometryNodeInputCurveTilt")
diff --git a/source/blender/blenkernel/BKE_node.h 
b/source/blender/blenkernel/BKE_node.h
index 14cf8164b79..625c4d87bcd 100644
--- a/source/blender/blenkernel/BKE_node.h
+++ b/source/blender/blenkernel/BKE_node.h
@@ -1531,6 +1531,7 @@ struct TexResult;
 #define GEO_NODE_SAMPLE_INDEX 1174
 #define GEO_NODE_SAMPLE_NEAREST 1175
 #define GEO_NODE_SAMPLE_NEAREST_SURFACE 1176
+#define GEO_NODE_INPUT_CONTROL_POINT_NEIGHBORS 1177
 
 /** \} */
 
diff --git a/source/blender/blenkernel/intern/node.cc 
b/source/blender/blenkernel/intern/node.cc
index 4ed0bf12cb6..0dcb2aa3139 100644
--- a/source/blender/blenkernel/intern/node.cc
+++ b/source/blender/blenkernel/intern/node.cc
@@ -4743,6 +4743,7 @@ static void registerGeometryNodes()
   register_node_type_geo_flip_faces();
   register_node_type_geo_geometry_to_instance();
   register_node_type_geo_image_texture();
+  register_node_type_geo_input_control_point_neighbors();
   register_node_type_geo_input_curve_handles();
   register_node_type_geo_input_curve_tilt();
   register_node_type_geo_input_id();
diff --git a/source/blender/nodes/NOD_geometry.h 
b/source/blender/nodes/NOD_geometry.h
index d02bbeb67f7..4ead6326295 100644
--- a/source/blender/nodes/NOD_geometry.h
+++ b/source/blender/nodes/NOD_geometry.h
@@ -61,6 +61,7 @@ void register_node_type_geo_field_at_index(void);
 void register_node_type_geo_flip_faces(void);
 void register_node_type_geo_geometry_to_instance(void);
 void register_node_type_geo_image_texture(void);
+void register_node_type_geo_input_control_point_neighbors(void);
 void register_node_type_geo_input_curve_handles(void);
 void register_node_type_geo_input_curve_tilt(void);
 void register_node_type_geo_input_id(void);
diff --git a/source/blender/nodes/NOD_static_types.h 
b/source/blender/nodes/NOD_static_types.h
index 2db8be661c3..574a8dcab96 100644
--- a/source/blender/nodes/NOD_static_types.h
+++ b/source/blender/nodes/NOD_static_types.h
@@ -319,6 +319,7 @@ DefNode(GeometryNode, GEO_NODE_FLIP_FACES, 0, "FLIP_FACES", 
FlipFaces, "Flip Fac
 DefNode(GeometryNode, GEO_NODE_GEOMETRY_TO_INSTANCE, 0, 
"GEOMETRY_TO_INSTANCE", GeometryToInstance, "Geometry to Instance", "Convert 
each input geometry into an instance, which can be much faster than the Join 
Geometry node when the inputs are large")
 DefNode(GeometryNode, GEO_NODE_IMAGE_TEXTURE, def_geo_image_texture, 
"IMAGE_TEXTURE", ImageTexture, "Image Texture", "Sample values from an image 
texture")
 DefNode(GeometryNode, GEO_NODE_INPUT_CURVE_HANDLES, 0, 
"INPUT_CURVE_HANDLES",InputCurveHandlePositions,"Curve Handle Positions", 
"Retrieve the position of each Bézier control point's handles")
+DefNode(GeometryNode, GEO_NODE_INPUT_CONTROL_POINT_NEIGHBORS, 0, 
"INPUT_CONTROL_POINT_NEIGHBORS", InputControlPointNeighbors, "Control Point 
Neighbors", "Offset a control point index within its curve")
 DefNode(GeometryNode, GEO_NODE_INPUT_CURVE_TILT, 0, "INPUT_CURVE_TILT", 
InputCurveTilt, "Curve Tilt", "Retrieve the angle at each control point used to 
twist the curve's normal around its tangent")
 DefNode(GeometryNode, GEO_NODE_INPUT_ID, 0, "INPUT_ID", InputID, "ID", 
"Retrieve a stable random identifier value from the \"id\" attribute on the 
point domain, or the index if the attribute does not exist")
 DefNode(GeometryNode, GEO_NODE_INPUT_INDEX, 0, "INDEX", InputIndex, "Index",

[Bf-blender-cvs] [46cfd345e47] master: Fix typo and and incorrect property initialization

2022-09-26 Thread Germano Cavalcante
Commit: 46cfd345e475bb05caf029502f6c9c3a4e2cc469
Author: Germano Cavalcante
Date:   Mon Sep 26 14:23:11 2022 -0300
Branches: master
https://developer.blender.org/rB46cfd345e475bb05caf029502f6c9c3a4e2cc469

Fix typo and and incorrect property initialization

Error in rB236fda7faf58

===

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

===

diff --git a/source/blender/editors/transform/transform.c 
b/source/blender/editors/transform/transform.c
index 6ca33a591cc..716005333c8 100644
--- a/source/blender/editors/transform/transform.c
+++ b/source/blender/editors/transform/transform.c
@@ -1578,7 +1578,7 @@ void saveTransform(bContext *C, TransInfo *t, wmOperator 
*op)
 }
   }
 
-  /* Save sanpping settings. */
+  /* Save snapping settings. */
   if (prop = RNA_struct_find_property(op->ptr, "snap")) {
 RNA_property_boolean_set(op->ptr, prop, (t->modifiers & MOD_SNAP) != 0);
 
diff --git a/source/blender/editors/transform/transform_ops.c 
b/source/blender/editors/transform/transform_ops.c
index f15ad99dbc3..dbda9a26bbf 100644
--- a/source/blender/editors/transform/transform_ops.c
+++ b/source/blender/editors/transform/transform_ops.c
@@ -684,7 +684,7 @@ void Transform_Properties(struct wmOperatorType *ot, int 
flags)
   prop = RNA_def_boolean(ot->srna, "use_snap_nonedit", true, "Target: 
Include Non-Edited", "");
   RNA_def_property_flag(prop, PROP_HIDDEN);
   prop = RNA_def_boolean(
-  ot->srna, "use_snap_selectable", true, "Target: Exclude 
Non-Selectable", "");
+  ot->srna, "use_snap_selectable", false, "Target: Exclude 
Non-Selectable", "");
   RNA_def_property_flag(prop, PROP_HIDDEN);
 
   prop = RNA_def_float_vector(

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


[Bf-blender-cvs] [236fda7faf5] master: Fix T101343: useless Snapping menu in transform operators

2022-09-26 Thread Germano Cavalcante
Commit: 236fda7faf58921f9f4b6d0d0300313b0ab1976a
Author: Germano Cavalcante
Date:   Mon Sep 26 14:18:29 2022 -0300
Branches: master
https://developer.blender.org/rB236fda7faf58921f9f4b6d0d0300313b0ab1976a

Fix T101343: useless Snapping menu in transform operators

Changes:
- Use the "snap_elements" property only for operators that support snapping to 
geometry.
- Remove unused properties:
  - "use_snap_to_same_target",
  - "snap_face_nearest_steps").
- Fix property with wrong name "use_snap_selectable_only" -> 
"use_snap_selectable"
- Fix use of dependent property flags.
- Remove redundant initialization of variables
- Simplify `poll_propety`. Only the "use_snap_project" is not hidden.

>>! In rBc484599687ba it's said:
>  These options are needed for Python tools to control snapping without 
> requiring the tool settings to be adjusted.
If that's the case, there doesn't seem to be any need to display them in the 
redo panel.  Therefore:
- Hide snapping properties in redo panel.

Many properties have been added that can be independent of ToolSettings. 
Therefore:
- Save snapping properties in the operator itself. For Redo.

===

M   source/blender/editors/transform/transform.c
M   source/blender/editors/transform/transform_ops.c
M   source/blender/editors/transform/transform_snap.c

===

diff --git a/source/blender/editors/transform/transform.c 
b/source/blender/editors/transform/transform.c
index 85bb8c1b31a..6ca33a591cc 100644
--- a/source/blender/editors/transform/transform.c
+++ b/source/blender/editors/transform/transform.c
@@ -1578,40 +1578,59 @@ void saveTransform(bContext *C, TransInfo *t, 
wmOperator *op)
 }
   }
 
-  if (t->flag & T_MODAL) {
-/* do we check for parameter? */
-if (transformModeUseSnap(t)) {
-  if (!(t->modifiers & MOD_SNAP) != !(t->tsnap.flag & SCE_SNAP)) {
-/* Type is #eSnapFlag, but type must match various snap attributes in 
#ToolSettings. */
-short *snap_flag_ptr;
+  /* Save sanpping settings. */
+  if (prop = RNA_struct_find_property(op->ptr, "snap")) {
+RNA_property_boolean_set(op->ptr, prop, (t->modifiers & MOD_SNAP) != 0);
 
-wmMsgParams_RNA msg_key_params = {{0}};
-RNA_pointer_create(&t->scene->id, &RNA_ToolSettings, ts, 
&msg_key_params.ptr);
+if (prop = RNA_struct_find_property(op->ptr, "snap_elements")) {
+  RNA_property_enum_set(op->ptr, prop, t->tsnap.mode);
+  RNA_boolean_set(op->ptr, "use_snap_project", t->tsnap.project);
+  RNA_enum_set(op->ptr, "snap_target", t->tsnap.source_select);
 
-if (t->spacetype == SPACE_NODE) {
-  snap_flag_ptr = &ts->snap_flag_node;
-  msg_key_params.prop = &rna_ToolSettings_use_snap_node;
-}
-else if (t->spacetype == SPACE_IMAGE) {
-  snap_flag_ptr = &ts->snap_uv_flag;
-  msg_key_params.prop = &rna_ToolSettings_use_snap_uv;
-}
-else if (t->spacetype == SPACE_SEQ) {
-  snap_flag_ptr = &ts->snap_flag_seq;
-  msg_key_params.prop = &rna_ToolSettings_use_snap_sequencer;
-}
-else {
-  snap_flag_ptr = &ts->snap_flag;
-  msg_key_params.prop = &rna_ToolSettings_use_snap;
-}
+  eSnapTargetSelect target = t->tsnap.target_select;
+  RNA_boolean_set(op->ptr, "use_snap_self", (target & 
SCE_SNAP_TARGET_NOT_ACTIVE) != 0);
+  RNA_boolean_set(op->ptr, "use_snap_edit", (target & 
SCE_SNAP_TARGET_NOT_EDITED) != 0);
+  RNA_boolean_set(op->ptr, "use_snap_nonedit", (target & 
SCE_SNAP_TARGET_NOT_NONEDITED) != 0);
+  RNA_boolean_set(
+  op->ptr, "use_snap_selectable", (target & 
SCE_SNAP_TARGET_ONLY_SELECTABLE) != 0);
+}
 
-if (t->modifiers & MOD_SNAP) {
-  *snap_flag_ptr |= SCE_SNAP;
-}
-else {
-  *snap_flag_ptr &= ~SCE_SNAP;
+/* Update `ToolSettings` for properties that change during modal. */
+if (t->flag & T_MODAL) {
+  /* Do we check for parameter? */
+  if (transformModeUseSnap(t)) {
+if (!(t->modifiers & MOD_SNAP) != !(t->tsnap.flag & SCE_SNAP)) {
+  /* Type is #eSnapFlag, but type must match various snap attributes 
in #ToolSettings. */
+  short *snap_flag_ptr;
+
+  wmMsgParams_RNA msg_key_params = {{0}};
+  RNA_pointer_create(&t->scene->id, &RNA_ToolSettings, ts, 
&msg_key_params.ptr);
+
+  if (t->spacetype == SPACE_NODE) {
+snap_flag_ptr = &ts->snap_flag_node;
+msg_key_params.prop = &rna_ToolSettings_use_snap_node;
+  }
+  else if (t->spacetype == SPACE_IMAGE) {
+snap_flag_ptr = &ts->snap_uv_flag;
+msg_key_params.prop = &rna_ToolSettings_use_snap_uv;
+  }
+  else if (t->spacetype == SPACE_SEQ) {
+snap_flag_ptr = &ts->snap_flag_seq;
+msg_key_params.prop = &rna_ToolSettings_use_snap_seq

[Bf-blender-cvs] [125ac1f9143] master: Cycles: increase min-supported driver version for Intel GPUs

2022-09-26 Thread Xavier Hallade
Commit: 125ac1f91433344e5b3948ee4c9b3c95ddaaf8a0
Author: Xavier Hallade
Date:   Mon Sep 26 07:41:47 2022 -0700
Branches: master
https://developer.blender.org/rB125ac1f91433344e5b3948ee4c9b3c95ddaaf8a0

Cycles: increase min-supported driver version for Intel GPUs

Windows drivers 101.3430 fix an important GUI-related crash and it's
best to prevent users from running into it.
Linux drivers weren't affected but still had relevant gpu binary
compatibility fixes, so it makes sense to keep the min-supported version
aligned across OSes.

===

M   intern/cycles/blender/addon/properties.py
M   intern/cycles/kernel/device/oneapi/kernel.cpp

===

diff --git a/intern/cycles/blender/addon/properties.py 
b/intern/cycles/blender/addon/properties.py
index 699c90183fe..cd263e5b9c4 100644
--- a/intern/cycles/blender/addon/properties.py
+++ b/intern/cycles/blender/addon/properties.py
@@ -1558,9 +1558,9 @@ class CyclesPreferences(bpy.types.AddonPreferences):
 import sys
 col.label(text="Requires Intel GPU with Xe-HPG architecture", 
icon='BLANK1')
 if sys.platform.startswith("win"):
-col.label(text="and Windows driver version 101.3268 or 
newer", icon='BLANK1')
+col.label(text="and Windows driver version 101.3430 or 
newer", icon='BLANK1')
 elif sys.platform.startswith("linux"):
-col.label(text="and Linux driver version xx.xx.23570 or 
newer", icon='BLANK1')
+col.label(text="and Linux driver version xx.xx.23904 or 
newer", icon='BLANK1')
 elif device_type == 'METAL':
 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')
diff --git a/intern/cycles/kernel/device/oneapi/kernel.cpp 
b/intern/cycles/kernel/device/oneapi/kernel.cpp
index 097d21b963f..3c7a9960588 100644
--- a/intern/cycles/kernel/device/oneapi/kernel.cpp
+++ b/intern/cycles/kernel/device/oneapi/kernel.cpp
@@ -668,9 +668,9 @@ bool oneapi_enqueue_kernel(KernelContext *kernel_context,
 /* Compute-runtime (ie. NEO) version is what gets returned by sycl/L0 on 
Windows
  * since Windows driver 101.3268. */
 /* The same min compute-runtime version is currently required across Windows 
and Linux.
- * For Windows driver 101.3268, compute-runtime version is 23570. */
-static const int lowest_supported_driver_version_win = 1013268;
-static const int lowest_supported_driver_version_neo = 23570;
+ * For Windows driver 101.3430, compute-runtime version is 23904. */
+static const int lowest_supported_driver_version_win = 1013430;
+static const int lowest_supported_driver_version_neo = 23904;
 
 static int parse_driver_build_version(const sycl::device &device)
 {

___
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] [2522ca03d20] master: Asset Browser: Add slider UI to pose blending

2022-09-26 Thread Angus Stanton
Commit: 2522ca03d20648bbe0160e52b1eead2e212200b6
Author: Angus Stanton
Date:   Mon Sep 26 16:04:22 2022 +0200
Branches: master
https://developer.blender.org/rB2522ca03d20648bbe0160e52b1eead2e212200b6

Asset Browser: Add slider UI to pose blending

Add the Slider UI to pose blending. This adds a slider with percentages,
and controls for precision control and incremental control.

Reviewed By: sybren

Maniphest Tasks: T90182

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

===

M   source/blender/editors/armature/pose_lib_2.c
M   source/blender/editors/util/ed_draw.c

===

diff --git a/source/blender/editors/armature/pose_lib_2.c 
b/source/blender/editors/armature/pose_lib_2.c
index d866062cec0..e3189eacdd5 100644
--- a/source/blender/editors/armature/pose_lib_2.c
+++ b/source/blender/editors/armature/pose_lib_2.c
@@ -41,6 +41,7 @@
 #include "ED_asset.h"
 #include "ED_keyframing.h"
 #include "ED_screen.h"
+#include "ED_util.h"
 
 #include "armature_intern.h"
 
@@ -58,10 +59,8 @@ typedef struct PoseBlendData {
 
   struct {
 bool use_release_confirm;
-int drag_start_xy[2];
 int init_event_type;
 
-bool cursor_wrap_enabled;
   } release_confirm_info;
 
   /* For temp-loading the Action from the pose library. */
@@ -78,6 +77,8 @@ typedef struct PoseBlendData {
   Scene *scene;  /* For auto-keying. */
   ScrArea *area; /* For drawing status text. */
 
+  struct tSlider *slider; /* Slider UI and event handling. */
+
   /** Info-text to print in header. */
   char headerstr[UI_MAX_DRAW_STR];
 } PoseBlendData;
@@ -146,22 +147,6 @@ static void poselib_blend_apply(bContext *C, wmOperator 
*op)
 {
   PoseBlendData *pbd = (PoseBlendData *)op->customdata;
 
-  if (pbd->state == POSE_BLEND_BLENDING) {
-BLI_snprintf(pbd->headerstr,
- sizeof(pbd->headerstr),
- TIP_("PoseLib blending: \"%s\" at %3.0f%%"),
- pbd->act->id.name + 2,
- pbd->blend_factor * 100);
-ED_area_status_text(pbd->area, pbd->headerstr);
-
-ED_workspace_status_text(
-C, TIP_("Tab: show original pose; Horizontal mouse movement: change 
blend percentage"));
-  }
-  else {
-ED_area_status_text(pbd->area, TIP_("PoseLib showing original pose"));
-ED_workspace_status_text(C, TIP_("Tab: show blended pose"));
-  }
-
   if (!pbd->needs_redraw) {
 return;
   }
@@ -192,27 +177,16 @@ static void poselib_blend_set_factor(PoseBlendData *pbd, 
const float new_factor)
   pbd->needs_redraw = true;
 }
 
-static void poselib_slide_mouse_update_blendfactor(PoseBlendData *pbd, const 
wmEvent *event)
-{
-  if (pbd->release_confirm_info.use_release_confirm) {
-/* Release confirm calculates factor based on where the dragging was 
started from. */
-const float range = 300 * U.pixelsize;
-const float new_factor = (event->xy[0] - 
pbd->release_confirm_info.drag_start_xy[0]) / range;
-poselib_blend_set_factor(pbd, new_factor);
-  }
-  else {
-const float new_factor = (event->xy[0] - pbd->area->v1->vec.x) / 
((float)pbd->area->winx);
-poselib_blend_set_factor(pbd, new_factor);
-  }
-}
-
 /* Return operator return value. */
 static int poselib_blend_handle_event(bContext *UNUSED(C), wmOperator *op, 
const wmEvent *event)
 {
   PoseBlendData *pbd = op->customdata;
 
+  ED_slider_modal(pbd->slider, event);
+  const float factor = ED_slider_factor_get(pbd->slider);
+  poselib_blend_set_factor(pbd, factor);
+
   if (event->type == MOUSEMOVE) {
-poselib_slide_mouse_update_blendfactor(pbd, event);
 return OPERATOR_RUNNING_MODAL;
   }
 
@@ -257,18 +231,6 @@ static int poselib_blend_handle_event(bContext *UNUSED(C), 
wmOperator *op, const
   return OPERATOR_RUNNING_MODAL;
 }
 
-static void poselib_blend_cursor_update(bContext *C, wmOperator *op)
-{
-  PoseBlendData *pbd = op->customdata;
-
-  /* Ensure cursor-grab (continuous grabbing) is enabled when using 
release-confirm. */
-  if (pbd->release_confirm_info.use_release_confirm &&
-  !pbd->release_confirm_info.cursor_wrap_enabled) {
-WM_cursor_grab_enable(CTX_wm_window(C), WM_CURSOR_WRAP_XY, true, NULL);
-pbd->release_confirm_info.cursor_wrap_enabled = true;
-  }
-}
-
 /*  */
 
 static Object *get_poselib_object(bContext *C)
@@ -363,11 +325,14 @@ static bool poselib_blend_init_data(bContext *C, 
wmOperator *op, const wmEvent *
 pbd->release_confirm_info.use_release_confirm = (release_confirm_prop != 
NULL) &&
 
RNA_property_boolean_get(op->ptr,
  
release_confirm_prop);
+pbd->slider = ED_slider_create(C);
+ED_slider_init(pbd->slider, event);
+ED_slider_factor_set(pbd->slider, pbd->blend_factor);
+ED_slider_allow_overshoot_set(pbd->slider, false);
   }
 
   if (pbd->rele

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

2022-09-26 Thread Antonio Vazquez
Commit: c2faacfb7d3096e7161ec91584856f39ed17a049
Author: Antonio Vazquez
Date:   Mon Sep 26 16:11:20 2022 +0200
Branches: asset-lite-greasepencil
https://developer.blender.org/rBc2faacfb7d3096e7161ec91584856f39ed17a049

Merge branch 'master' into asset-lite-greasepencil

===



===



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


[Bf-blender-cvs] [aee93f60712] temp-T97352-3d-texturing-seam-bleeding-b2: Removed TODO.

2022-09-26 Thread Jeroen Bakker
Commit: aee93f6071277a23ac4e04354b33964ac725aad4
Author: Jeroen Bakker
Date:   Mon Sep 26 15:07:20 2022 +0200
Branches: temp-T97352-3d-texturing-seam-bleeding-b2
https://developer.blender.org/rBaee93f6071277a23ac4e04354b33964ac725aad4

Removed TODO.

===

M   source/blender/makesdna/DNA_image_types.h

===

diff --git a/source/blender/makesdna/DNA_image_types.h 
b/source/blender/makesdna/DNA_image_types.h
index 0e6900a64fe..4327d0c397f 100644
--- a/source/blender/makesdna/DNA_image_types.h
+++ b/source/blender/makesdna/DNA_image_types.h
@@ -165,8 +165,6 @@ typedef struct Image {
   short gpu_view;
 
   /* Number of iterations to perform to extract a mask for uv seam fixing. */
-  // TODO: unit in 1/256 of the resolution each iteration performs a dilate. 
This should be changed
-  // in the final implementation to actual pixels or something else. This need 
more thought.
   short seamfix_iter;
 
   char _pad2[2];

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


[Bf-blender-cvs] [f9d3cd51876] temp-T97352-3d-texturing-seam-bleeding-b2: Moved versioncode to next subversion bump code-block.

2022-09-26 Thread Jeroen Bakker
Commit: f9d3cd518763e41ea4d951161f478a4eabf1c6d2
Author: Jeroen Bakker
Date:   Mon Sep 26 15:05:47 2022 +0200
Branches: temp-T97352-3d-texturing-seam-bleeding-b2
https://developer.blender.org/rBf9d3cd518763e41ea4d951161f478a4eabf1c6d2

Moved versioncode to next subversion bump code-block.

===

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

===

diff --git a/source/blender/blenloader/intern/versioning_300.cc 
b/source/blender/blenloader/intern/versioning_300.cc
index b0fb8066530..d7a8e1c58e2 100644
--- a/source/blender/blenloader/intern/versioning_300.cc
+++ b/source/blender/blenloader/intern/versioning_300.cc
@@ -3498,13 +3498,6 @@ void blo_do_versions_300(FileData *fd, Library 
*UNUSED(lib), Main *bmain)
 }
   }
 }
-
-/* UVSeam fixing distance. */
-if (!DNA_struct_elem_find(fd->filesdna, "Image", "short", "seamfix_iter")) 
{
-  LISTBASE_FOREACH (Image *, image, &bmain->images) {
-image->seamfix_iter = 8;
-  }
-}
   }
 
   if (!MAIN_VERSION_ATLEAST(bmain, 303, 6)) {
@@ -3593,5 +3586,12 @@ void blo_do_versions_300(FileData *fd, Library 
*UNUSED(lib), Main *bmain)
*/
   {
 /* Keep this block, even when empty. */
+
+/* UVSeam fixing distance. */
+if (!DNA_struct_elem_find(fd->filesdna, "Image", "short", "seamfix_iter")) 
{
+  LISTBASE_FOREACH (Image *, image, &bmain->images) {
+image->seamfix_iter = 8;
+  }
+}
   }
 }

___
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] [fc816de31fa] temp-T97352-3d-texturing-seam-bleeding-b2: Move BKE_uv_islands to pbvh namespace.

2022-09-26 Thread Jeroen Bakker
Commit: fc816de31faed78a27d689f2dd090001eeeb275c
Author: Jeroen Bakker
Date:   Mon Sep 26 14:59:20 2022 +0200
Branches: temp-T97352-3d-texturing-seam-bleeding-b2
https://developer.blender.org/rBfc816de31faed78a27d689f2dd090001eeeb275c

Move BKE_uv_islands to pbvh namespace.

===

M   source/blender/blenkernel/CMakeLists.txt
M   source/blender/blenkernel/intern/pbvh_pixels.cc
R099source/blender/blenkernel/intern/uv_islands.cc  
source/blender/blenkernel/intern/pbvh_uv_islands.cc
R098source/blender/blenkernel/BKE_uv_islands.hh 
source/blender/blenkernel/intern/pbvh_uv_islands.hh

===

diff --git a/source/blender/blenkernel/CMakeLists.txt 
b/source/blender/blenkernel/CMakeLists.txt
index 8a335172949..e4bc70987d0 100644
--- a/source/blender/blenkernel/CMakeLists.txt
+++ b/source/blender/blenkernel/CMakeLists.txt
@@ -251,6 +251,7 @@ set(SRC
   intern/pbvh.cc
   intern/pbvh_bmesh.c
   intern/pbvh_pixels.cc
+  intern/pbvh_uv_islands.cc
   intern/pointcache.c
   intern/pointcloud.cc
   intern/preferences.c
@@ -295,7 +296,6 @@ set(SRC
   intern/type_conversions.cc
   intern/undo_system.c
   intern/unit.c
-  intern/uv_islands.cc
   intern/vfont.c
   intern/vfontdata_freetype.c
   intern/volume.cc
diff --git a/source/blender/blenkernel/intern/pbvh_pixels.cc 
b/source/blender/blenkernel/intern/pbvh_pixels.cc
index 60272d08a34..2f65f6b02ab 100644
--- a/source/blender/blenkernel/intern/pbvh_pixels.cc
+++ b/source/blender/blenkernel/intern/pbvh_pixels.cc
@@ -16,11 +16,11 @@
 #include "BLI_task.h"
 
 #include "BKE_image_wrappers.hh"
-#include "BKE_uv_islands.hh"
 
 #include "bmesh.h"
 
 #include "pbvh_intern.h"
+#include "pbvh_uv_islands.hh"
 
 namespace blender::bke::pbvh::pixels {
 
diff --git a/source/blender/blenkernel/intern/uv_islands.cc 
b/source/blender/blenkernel/intern/pbvh_uv_islands.cc
similarity index 99%
rename from source/blender/blenkernel/intern/uv_islands.cc
rename to source/blender/blenkernel/intern/pbvh_uv_islands.cc
index 8efd69e0a86..4c9b52ac958 100644
--- a/source/blender/blenkernel/intern/uv_islands.cc
+++ b/source/blender/blenkernel/intern/pbvh_uv_islands.cc
@@ -1,10 +1,10 @@
 /* SPDX-License-Identifier: GPL-2.0-or-later */
 
-#include "BKE_uv_islands.hh"
+#include "pbvh_uv_islands.hh"
 
 #include 
 
-namespace blender::bke::uv_islands {
+namespace blender::bke::pbvh::uv_islands {
 
 static void uv_edge_append_to_uv_vertices(UVEdge &uv_edge)
 {
@@ -1466,4 +1466,4 @@ bool UVIslandsMask::is_masked(const uint16_t 
island_index, const float2 uv) cons
 
 /** \} */
 
-}  // namespace blender::bke::uv_islands
+}  // namespace blender::bke::pbvh::uv_islands
diff --git a/source/blender/blenkernel/BKE_uv_islands.hh 
b/source/blender/blenkernel/intern/pbvh_uv_islands.hh
similarity index 98%
rename from source/blender/blenkernel/BKE_uv_islands.hh
rename to source/blender/blenkernel/intern/pbvh_uv_islands.hh
index a3a49d019df..78250c6e840 100644
--- a/source/blender/blenkernel/BKE_uv_islands.hh
+++ b/source/blender/blenkernel/intern/pbvh_uv_islands.hh
@@ -27,7 +27,7 @@
 
 #include "DNA_meshdata_types.h"
 
-namespace blender::bke::uv_islands {
+namespace blender::bke::pbvh::uv_islands {
 
 struct MeshEdge;
 struct MeshPrimitive;
@@ -324,4 +324,4 @@ struct UVIslandsMask {
   void dilate(int max_iterations);
 };
 
-}  // namespace blender::bke::uv_islands
+}  // namespace blender::bke::pbvh::uv_islands

___
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] [97c52306603] temp-T97352-3d-texturing-seam-bleeding-b2: Fix crash when texturing on really dense mesh.

2022-09-26 Thread Jeroen Bakker
Commit: 97c5230660328b5672338d215b1960256520829f
Author: Jeroen Bakker
Date:   Mon Sep 26 14:38:36 2022 +0200
Branches: temp-T97352-3d-texturing-seam-bleeding-b2
https://developer.blender.org/rB97c5230660328b5672338d215b1960256520829f

Fix crash when texturing on really dense mesh.

===

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

===

diff --git a/source/blender/blenkernel/intern/uv_islands.cc 
b/source/blender/blenkernel/intern/uv_islands.cc
index 8fea0a4aa69..8efd69e0a86 100644
--- a/source/blender/blenkernel/intern/uv_islands.cc
+++ b/source/blender/blenkernel/intern/uv_islands.cc
@@ -860,26 +860,28 @@ static void extend_at_vert(UVIsland &island, 
UVBorderCorner &corner, float min_u
   current_edge->get_other_uv_vertex(uv_vertex->vertex)->vertex;
   MeshPrimitive *fill_primitive = find_fill_border(
   *uv_vertex->vertex, *shared_edge_vertex, 
*corner.second->get_uv_vertex(1)->vertex);
-  BLI_assert(fill_primitive);
-  MeshVertex *other_prim_vertex =
-  fill_primitive->get_other_uv_vertex(uv_vertex->vertex, 
shared_edge_vertex)->vertex;
-
-  UVVertex uv_vertex_template;
-  uv_vertex_template.vertex = uv_vertex->vertex;
-  uv_vertex_template.uv = uv_vertex->uv;
-  UVVertex *vertex_1_ptr = island.lookup_or_create(uv_vertex_template);
-  uv_vertex_template.vertex = shared_edge_vertex;
-  uv_vertex_template.uv = old_uv;
-  UVVertex *vertex_2_ptr = island.lookup_or_create(uv_vertex_template);
-  uv_vertex_template.vertex = other_prim_vertex;
-  uv_vertex_template.uv = corner.second->get_uv_vertex(1)->uv;
-  UVVertex *vertex_3_ptr = island.lookup_or_create(uv_vertex_template);
-  add_uv_primitive_fill(island, *vertex_1_ptr, *vertex_2_ptr, 
*vertex_3_ptr, *fill_primitive);
-
-  UVPrimitive &new_prim = island.uv_primitives.last();
-  UVBorderEdge new_border(new_prim.get_uv_edge(shared_edge_vertex, 
other_prim_vertex),
-  &new_prim);
-  new_border_edges.append(new_border);
+  if (fill_primitive) {
+MeshVertex *other_prim_vertex =
+fill_primitive->get_other_uv_vertex(uv_vertex->vertex, 
shared_edge_vertex)->vertex;
+
+UVVertex uv_vertex_template;
+uv_vertex_template.vertex = uv_vertex->vertex;
+uv_vertex_template.uv = uv_vertex->uv;
+UVVertex *vertex_1_ptr = island.lookup_or_create(uv_vertex_template);
+uv_vertex_template.vertex = shared_edge_vertex;
+uv_vertex_template.uv = old_uv;
+UVVertex *vertex_2_ptr = island.lookup_or_create(uv_vertex_template);
+uv_vertex_template.vertex = other_prim_vertex;
+uv_vertex_template.uv = corner.second->get_uv_vertex(1)->uv;
+UVVertex *vertex_3_ptr = island.lookup_or_create(uv_vertex_template);
+add_uv_primitive_fill(
+island, *vertex_1_ptr, *vertex_2_ptr, *vertex_3_ptr, 
*fill_primitive);
+
+UVPrimitive &new_prim = island.uv_primitives.last();
+UVBorderEdge new_border(new_prim.get_uv_edge(shared_edge_vertex, 
other_prim_vertex),
+&new_prim);
+new_border_edges.append(new_border);
+  }
 }
 
 int border_insert = corner.first->index;
@@ -1052,10 +1054,10 @@ void UVBorder::remove(int64_t index)
 /** \name UVBorderCorner
  * \{ */
 
-  UVBorderCorner::UVBorderCorner(UVBorderEdge *first, UVBorderEdge *second, 
float angle)
-  : first(first), second(second), angle(angle)
-  {
-  }
+UVBorderCorner::UVBorderCorner(UVBorderEdge *first, UVBorderEdge *second, 
float angle)
+: first(first), second(second), angle(angle)
+{
+}
 
 float2 UVBorderCorner::uv(float factor, float min_uv_distance)
 {

___
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] [5d0529b3c00] temp-T97352-3d-texturing-seam-bleeding-b2: Merge branch 'master' into temp-T97352-3d-texturing-seam-bleeding-b2

2022-09-26 Thread Jeroen Bakker
Commit: 5d0529b3c0099d39e59bbc02486f45093ccd8838
Author: Jeroen Bakker
Date:   Mon Sep 26 14:05:27 2022 +0200
Branches: temp-T97352-3d-texturing-seam-bleeding-b2
https://developer.blender.org/rB5d0529b3c0099d39e59bbc02486f45093ccd8838

Merge branch 'master' into temp-T97352-3d-texturing-seam-bleeding-b2

===



===



___
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] [2356afc7af9] master: Cleanup: format, ensure trailing newlines

2022-09-26 Thread Campbell Barton
Commit: 2356afc7af9ab53d727cb191f7515643746865a5
Author: Campbell Barton
Date:   Mon Sep 26 21:52:40 2022 +1000
Branches: master
https://developer.blender.org/rB2356afc7af9ab53d727cb191f7515643746865a5

Cleanup: format, ensure trailing newlines

===

M   release/scripts/modules/sys_info.py
M   source/blender/draw/engines/eevee_next/eevee_cryptomatte.cc
M   
source/blender/draw/engines/overlay/shaders/overlay_armature_shape_outline_vert_no_geom.glsl
M   
source/blender/draw/engines/overlay/shaders/overlay_edit_curve_handle_vert_no_geom.glsl
M   
source/blender/draw/engines/overlay/shaders/overlay_edit_mesh_vert_no_geom.glsl
M   
source/blender/draw/engines/overlay/shaders/overlay_motion_path_line_vert_no_geom.glsl
M   source/blender/gpu/shaders/gpu_shader_3D_polyline_vert_no_geom.glsl

===

diff --git a/release/scripts/modules/sys_info.py 
b/release/scripts/modules/sys_info.py
index f50a109f533..026c39908c0 100644
--- a/release/scripts/modules/sys_info.py
+++ b/release/scripts/modules/sys_info.py
@@ -198,9 +198,12 @@ def write_sysinfo(filepath):
 output.write("Maximum Pipeline Image Units:\t%d\n" % 
gpu.capabilities.max_textures_get())
 
 output.write("\nFeatures:\n")
-output.write("Compute Shader Support:   \t%d\n" % 
gpu.capabilities.compute_shader_support_get())
-output.write("Shader Storage Buffer Objects Support:\t%d\n" % 
gpu.capabilities.shader_storage_buffer_objects_support_get())
-output.write("Image Load/Store Support: \t%d\n" % 
gpu.capabilities.shader_image_load_store_support_get())
+output.write("Compute Shader Support:   \t%d\n" %
+ gpu.capabilities.compute_shader_support_get())
+output.write("Shader Storage Buffer Objects Support:\t%d\n" %
+ 
gpu.capabilities.shader_storage_buffer_objects_support_get())
+output.write("Image Load/Store Support: \t%d\n" %
+ 
gpu.capabilities.shader_image_load_store_support_get())
 
 if bpy.app.build_options.cycles:
 import cycles
diff --git a/source/blender/draw/engines/eevee_next/eevee_cryptomatte.cc 
b/source/blender/draw/engines/eevee_next/eevee_cryptomatte.cc
index 10be121f533..db888df1973 100644
--- a/source/blender/draw/engines/eevee_next/eevee_cryptomatte.cc
+++ b/source/blender/draw/engines/eevee_next/eevee_cryptomatte.cc
@@ -129,4 +129,4 @@ void Cryptomatte::store_metadata(RenderResult 
*render_result)
   }
 }
 
-}  // namespace blender::eevee
\ No newline at end of file
+}  // namespace blender::eevee
diff --git 
a/source/blender/draw/engines/overlay/shaders/overlay_armature_shape_outline_vert_no_geom.glsl
 
b/source/blender/draw/engines/overlay/shaders/overlay_armature_shape_outline_vert_no_geom.glsl
index 191a9f98f02..12749e5b3a7 100644
--- 
a/source/blender/draw/engines/overlay/shaders/overlay_armature_shape_outline_vert_no_geom.glsl
+++ 
b/source/blender/draw/engines/overlay/shaders/overlay_armature_shape_outline_vert_no_geom.glsl
@@ -179,4 +179,4 @@ void main()
 world_clip_planes_calc_clip_distance(wPos[2].xyz);
 #endif
   }
-}
\ No newline at end of file
+}
diff --git 
a/source/blender/draw/engines/overlay/shaders/overlay_edit_curve_handle_vert_no_geom.glsl
 
b/source/blender/draw/engines/overlay/shaders/overlay_edit_curve_handle_vert_no_geom.glsl
index 82b88a14961..8b4b7afb996 100644
--- 
a/source/blender/draw/engines/overlay/shaders/overlay_edit_curve_handle_vert_no_geom.glsl
+++ 
b/source/blender/draw/engines/overlay/shaders/overlay_edit_curve_handle_vert_no_geom.glsl
@@ -13,4 +13,4 @@ void main()
   vert.flag = data;
 
   view_clipping_distances(world_pos);
-}
\ No newline at end of file
+}
diff --git 
a/source/blender/draw/engines/overlay/shaders/overlay_edit_mesh_vert_no_geom.glsl
 
b/source/blender/draw/engines/overlay/shaders/overlay_edit_mesh_vert_no_geom.glsl
index 81ca7480bee..82f0d535508 100644
--- 
a/source/blender/draw/engines/overlay/shaders/overlay_edit_mesh_vert_no_geom.glsl
+++ 
b/source/blender/draw/engines/overlay/shaders/overlay_edit_mesh_vert_no_geom.glsl
@@ -233,4 +233,4 @@ void main()
 #endif
 do_vertex(final_color, pos1, -half_size, -edge_ofs.xy);
   }
-}
\ No newline at end of file
+}
diff --git 
a/source/blender/draw/engines/overlay/shaders/overlay_motion_path_line_vert_no_geom.glsl
 
b/source/blender/draw/engines/overlay/shaders/overlay_motion_path_line_vert_no_geom.glsl
index 731c384803e..89878a63c4b 100644
--- 
a/source/blender/draw/engines/overlay/shaders/overlay_motion_path_line_vert_no_geom.glsl
+++ 
b/source/blender/draw/engines/overlay/shaders/overlay_motion_path_line_vert_no_geom.glsl
@@ -185,4 +185,4 @@ void main()
 t = edge_dir * (line_size * (is_persp ? out_po

[Bf-blender-cvs] [03eac69c619] master: Cleanup: restore parenthesis removed in recent commit

2022-09-26 Thread Campbell Barton
Commit: 03eac69c619e6e7949fe8d3961d15afda8059989
Author: Campbell Barton
Date:   Mon Sep 26 21:49:31 2022 +1000
Branches: master
https://developer.blender.org/rB03eac69c619e6e7949fe8d3961d15afda8059989

Cleanup: restore parenthesis removed in recent commit

Partial revert [0], removed by accident because the -fpermissive
flag was enabled with collada.

[0]: 34477bbfcde34d0b27f04ecc0a093d8be1c0

===

M   source/blender/io/collada/ArmatureImporter.cpp

===

diff --git a/source/blender/io/collada/ArmatureImporter.cpp 
b/source/blender/io/collada/ArmatureImporter.cpp
index a742ee3a1dd..1310337f501 100644
--- a/source/blender/io/collada/ArmatureImporter.cpp
+++ b/source/blender/io/collada/ArmatureImporter.cpp
@@ -1022,7 +1022,7 @@ bool ArmatureImporter::get_joint_bind_mat(float m[4][4], 
COLLADAFW::Node *joint)
   bool found = false;
   for (it = skin_by_data_uid.begin(); it != skin_by_data_uid.end(); it++) {
 SkinInfo &skin = it->second;
-if (found = skin.get_joint_inv_bind_matrix(m, joint)) {
+if ((found = skin.get_joint_inv_bind_matrix(m, joint))) {
   invert_m4(m);
   break;
 }

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


[Bf-blender-cvs] [5a83ff379fa] temp-T97352-3d-texturing-seam-bleeding-b2: Increase seam-fix default value to 8.

2022-09-26 Thread Jeroen Bakker
Commit: 5a83ff379fa38bc9e4ef5504fe730e8f556bdafb
Author: Jeroen Bakker
Date:   Mon Sep 26 13:36:05 2022 +0200
Branches: temp-T97352-3d-texturing-seam-bleeding-b2
https://developer.blender.org/rB5a83ff379fa38bc9e4ef5504fe730e8f556bdafb

Increase seam-fix default value to 8.

===

M   source/blender/blenloader/intern/versioning_300.cc
M   source/blender/makesdna/DNA_image_defaults.h
M   source/blender/makesrna/intern/rna_image.c

===

diff --git a/source/blender/blenloader/intern/versioning_300.cc 
b/source/blender/blenloader/intern/versioning_300.cc
index e401fd58afb..b0fb8066530 100644
--- a/source/blender/blenloader/intern/versioning_300.cc
+++ b/source/blender/blenloader/intern/versioning_300.cc
@@ -3502,7 +3502,7 @@ void blo_do_versions_300(FileData *fd, Library 
*UNUSED(lib), Main *bmain)
 /* UVSeam fixing distance. */
 if (!DNA_struct_elem_find(fd->filesdna, "Image", "short", "seamfix_iter")) 
{
   LISTBASE_FOREACH (Image *, image, &bmain->images) {
-image->seamfix_iter = 2;
+image->seamfix_iter = 8;
   }
 }
   }
diff --git a/source/blender/makesdna/DNA_image_defaults.h 
b/source/blender/makesdna/DNA_image_defaults.h
index 83a9c249d5c..a68a1751d58 100644
--- a/source/blender/makesdna/DNA_image_defaults.h
+++ b/source/blender/makesdna/DNA_image_defaults.h
@@ -24,7 +24,7 @@
 .gpuframenr = INT_MAX, \
 .gpu_pass = SHRT_MAX, \
 .gpu_layer = SHRT_MAX, \
-.seamfix_iter = 2, \
+.seamfix_iter = 8, \
   }
 
 /** \} */
diff --git a/source/blender/makesrna/intern/rna_image.c 
b/source/blender/makesrna/intern/rna_image.c
index ecdbc08e295..1532a4c9554 100644
--- a/source/blender/makesrna/intern/rna_image.c
+++ b/source/blender/makesrna/intern/rna_image.c
@@ -1374,11 +1374,11 @@ static void rna_def_image(BlenderRNA *brna)
   RNA_def_property_update(prop, NC_IMAGE | ND_DISPLAY, 
"rna_Image_gpu_texture_update");
 
   prop = RNA_def_property(srna, "seamfix_iter", PROP_INT, PROP_NONE);
-  RNA_def_property_ui_text(prop,
-   "Seam-fix",
-   "Number of iterations to perform when extracting 
additional pixels "
-   "during UV seam fixing. Each iteration will dilate 
the previous mask. "
-   "Resolution of the mask is 256x256");
+  RNA_def_property_ui_text(
+  prop,
+  "Seam-fix",
+  "Number of dilate iterations when extracting masks for UV Islands. 
Higher "
+  "number would improve seam-fixes for mipmaps, but decreases 
performance");
   RNA_def_property_ui_range(prop, 1, 100, 1, 1);
 
   /* multiview */

___
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] [19868fcdefc] temp-T97352-3d-texturing-seam-bleeding-b2: Merge branch 'master' into temp-T97352-3d-texturing-seam-bleeding-b2

2022-09-26 Thread Jeroen Bakker
Commit: 19868fcdefc21ef929f708fd89c4f42ece36c895
Author: Jeroen Bakker
Date:   Mon Sep 26 13:27:28 2022 +0200
Branches: temp-T97352-3d-texturing-seam-bleeding-b2
https://developer.blender.org/rB19868fcdefc21ef929f708fd89c4f42ece36c895

Merge branch 'master' into temp-T97352-3d-texturing-seam-bleeding-b2

===



===

diff --cc source/blender/blenlib/BLI_vector.hh
index d2f8a67d5c4,cba58945546..6bc785c322a
--- a/source/blender/blenlib/BLI_vector.hh
+++ b/source/blender/blenlib/BLI_vector.hh
@@@ -905,14 -915,9 +915,14 @@@ class Vector 
 */
int64_t capacity() const
{
- return static_cast(capacity_end_ - begin_);
+ return int64_t(capacity_end_ - begin_);
}
  
 +  bool is_at_capacity() const
 +  {
 +return end_ == capacity_end_;
 +  }
 +
/**
 * Get an index range that makes looping over all indices more convenient 
and less error prone.
 * Obviously, this should only be used when you actually need the index in 
the loop.
diff --cc source/blender/blenlib/CMakeLists.txt
index cc3b3730f4a,e0d05f8c36a..dea53d1aa9a
--- a/source/blender/blenlib/CMakeLists.txt
+++ b/source/blender/blenlib/CMakeLists.txt
@@@ -332,8 -333,6 +333,7 @@@ set(SR
BLI_uuid.h
BLI_uvproject.h
BLI_vector.hh
-   BLI_vector_adaptor.hh
 +  BLI_vector_list.hh
BLI_vector_set.hh
BLI_vector_set_slots.hh
BLI_virtual_array.hh

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


[Bf-blender-cvs] [b2115407836] master: Fix: bump subversion to avoid corrupted files

2022-09-26 Thread Jacques Lucke
Commit: b211540783651000b7a13e11b6a40a2f0b5a808e
Author: Jacques Lucke
Date:   Mon Sep 26 12:06:30 2022 +0200
Branches: master
https://developer.blender.org/rBb211540783651000b7a13e11b6a40a2f0b5a808e

Fix: bump subversion to avoid corrupted files

Replacing the transfer node breaks forward compatibility, so a version
bump is necessary to get a warning in older versions.

===

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

===

diff --git a/source/blender/blenkernel/BKE_blender_version.h 
b/source/blender/blenkernel/BKE_blender_version.h
index 46d6c97e1ff..244c5d4609f 100644
--- a/source/blender/blenkernel/BKE_blender_version.h
+++ b/source/blender/blenkernel/BKE_blender_version.h
@@ -25,13 +25,13 @@ extern "C" {
 
 /* Blender file format version. */
 #define BLENDER_FILE_VERSION BLENDER_VERSION
-#define BLENDER_FILE_SUBVERSION 0
+#define BLENDER_FILE_SUBVERSION 1
 
 /* Minimum Blender version that supports reading file written with the current
  * version. Older Blender versions will test this and show a warning if the 
file
  * was written with too new a version. */
 #define BLENDER_FILE_MIN_VERSION 304
-#define BLENDER_FILE_MIN_SUBVERSION 0
+#define BLENDER_FILE_MIN_SUBVERSION 1
 
 /** User readable version string. */
 const char *BKE_blender_version_string(void);
diff --git a/source/blender/blenloader/intern/versioning_300.cc 
b/source/blender/blenloader/intern/versioning_300.cc
index f2aa07b6678..f0ebc6c7942 100644
--- a/source/blender/blenloader/intern/versioning_300.cc
+++ b/source/blender/blenloader/intern/versioning_300.cc
@@ -3519,19 +3519,7 @@ void blo_do_versions_300(FileData *fd, Library 
*UNUSED(lib), Main *bmain)
 
 BKE_main_namemap_validate_and_fix(bmain);
   }
-
-  /**
-   * Versioning code until next subversion bump goes here.
-   *
-   * \note Be sure to check when bumping the version:
-   * - "versioning_userdef.c", #blo_do_versions_userdef
-   * - "versioning_userdef.c", #do_versions_theme
-   *
-   * \note Keep this message at the bottom of the function.
-   */
-  {
-/* Keep this block, even when empty. */
-
+  if (!MAIN_VERSION_ATLEAST(bmain, 304, 1)) {
 /* Image generation information transferred to tiles. */
 if (!DNA_struct_elem_find(fd->filesdna, "ImageTile", "int", "gen_x")) {
   LISTBASE_FOREACH (Image *, ima, &bmain->images) {
@@ -3586,4 +3574,17 @@ void blo_do_versions_300(FileData *fd, Library 
*UNUSED(lib), Main *bmain)
 }
 FOREACH_NODETREE_END;
   }
+
+  /**
+   * Versioning code until next subversion bump goes here.
+   *
+   * \note Be sure to check when bumping the version:
+   * - "versioning_userdef.c", #blo_do_versions_userdef
+   * - "versioning_userdef.c", #do_versions_theme
+   *
+   * \note Keep this message at the bottom of the function.
+   */
+  {
+/* Keep this block, even when empty. */
+  }
 }

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


[Bf-blender-cvs] [fa1c214c5b2] master: Fix crash in Solidify modifier with Inner Crease

2022-09-26 Thread Sergey Sharybin
Commit: fa1c214c5b2147f0127e6abf6aa844530fd4b9a2
Author: Sergey Sharybin
Date:   Mon Sep 26 11:51:04 2022 +0200
Branches: master
https://developer.blender.org/rBfa1c214c5b2147f0127e6abf6aa844530fd4b9a2

Fix crash in Solidify modifier with Inner Crease

Since a8a454287a27 the simple case would crash:

- Add place
- Add Solidify modifier
- Set Inner Crease to something non-zero

Seems to be a mistake in the logic which was trying to access
existing custom data layer on a clean result while it is more
logical to create the layer.

Was initially reported by the studio who could not open
production files after the change.

===

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

===

diff --git a/source/blender/modifiers/intern/MOD_solidify_extrude.c 
b/source/blender/modifiers/intern/MOD_solidify_extrude.c
index f1758b91a91..a662d729f52 100644
--- a/source/blender/modifiers/intern/MOD_solidify_extrude.c
+++ b/source/blender/modifiers/intern/MOD_solidify_extrude.c
@@ -1034,7 +1034,8 @@ Mesh *MOD_solidify_extrude_modifyMesh(ModifierData *md, 
const ModifierEvalContex
 
 float *result_edge_crease = NULL;
 if (crease_rim || crease_outer || crease_inner) {
-  result_edge_crease = (float *)CustomData_get_layer(&result->edata, 
CD_CREASE);
+  result_edge_crease = (float *)CustomData_add_layer(
+  &result->edata, CD_CREASE, CD_SET_DEFAULT, NULL, result->totedge);
 }
 
 /* add faces & edges */

___
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] [530b9841ee7] master: Fix T101370: GPencil Grab Sculpt crash after bake transform animation

2022-09-26 Thread Antonio Vazquez
Commit: 530b9841ee7cc8365b58d322978cb91c9c2feb52
Author: Antonio Vazquez
Date:   Mon Sep 26 11:09:49 2022 +0200
Branches: master
https://developer.blender.org/rB530b9841ee7cc8365b58d322978cb91c9c2feb52

Fix T101370: GPencil Grab Sculpt crash after bake transform animation

The problem was the duplicated strokes had wrong pointers 
to the original stroke.

===

M   source/blender/editors/gpencil/gpencil_bake_animation.cc

===

diff --git a/source/blender/editors/gpencil/gpencil_bake_animation.cc 
b/source/blender/editors/gpencil/gpencil_bake_animation.cc
index 50d5b43822a..38621c50ae8 100644
--- a/source/blender/editors/gpencil/gpencil_bake_animation.cc
+++ b/source/blender/editors/gpencil/gpencil_bake_animation.cc
@@ -298,6 +298,7 @@ static int 
gpencil_bake_grease_pencil_animation_exec(bContext *C, wmOperator *op
 BLI_addtail(&gpl_dst->frames, gpf_dst);
 
 LISTBASE_FOREACH (bGPDstroke *, gps, &gpf_dst->strokes) {
+  gps->runtime.gps_orig = NULL;
   /* Create material of the stroke. */
   Material *ma_src = BKE_object_material_get(elem->ob, gps->mat_nr + 
1);
   bool found = false;
@@ -320,6 +321,8 @@ static int 
gpencil_bake_grease_pencil_animation_exec(bContext *C, wmOperator *op
   /* Update point location to new object space. */
   for (int j = 0; j < gps->totpoints; j++) {
 bGPDspoint *pt = &gps->points[j];
+pt->runtime.idx_orig = 0;
+pt->runtime.pt_orig = NULL;
 mul_m4_v3(ob_eval->obmat, &pt->x);
 mul_m4_v3(invmat, &pt->x);
   }

___
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] [333e41eac6d] master: Cleanup: replace C-style casts with functional casts for numeric types

2022-09-26 Thread Campbell Barton
Commit: 333e41eac6daf60c6aa9df0496a39c57d74b9c87
Author: Campbell Barton
Date:   Mon Sep 26 17:38:25 2022 +1000
Branches: master
https://developer.blender.org/rB333e41eac6daf60c6aa9df0496a39c57d74b9c87

Cleanup: replace C-style casts with functional casts for numeric types

Use function style casts in C++ headers & source.

===

M   intern/ghost/intern/GHOST_ContextGLX.cpp
M   intern/ghost/intern/GHOST_XrAction.cpp
M   intern/mikktspace/mikktspace.hh
M   intern/sky/source/sky_nishita.cpp
M   source/blender/blenkernel/BKE_attribute_math.hh
M   source/blender/blenkernel/BKE_cryptomatte.hh
M   source/blender/blenkernel/BKE_curves.hh
M   source/blender/blenkernel/intern/subdiv_mesh.cc
M   source/blender/blenlib/BLI_cpp_type.hh
M   source/blender/blenlib/BLI_cpp_type_make.hh
M   source/blender/blenlib/BLI_dot_export.hh
M   source/blender/blenlib/BLI_hash_tables.hh
M   source/blender/blenlib/BLI_linear_allocator.hh
M   source/blender/blenlib/BLI_map.hh
M   source/blender/blenlib/BLI_math_vector.hh
M   source/blender/blenlib/BLI_memory_utils.hh
M   source/blender/blenlib/BLI_set.hh
M   source/blender/blenlib/BLI_string_ref.hh
M   source/blender/blenlib/tests/BLI_exception_safety_test_utils.hh
M   source/blender/blenlib/tests/BLI_vector_test.cc
M   source/blender/compositor/operations/COM_DoubleEdgeMaskOperation.cc
M   source/blender/draw/engines/eevee_next/eevee_material.hh
M   source/blender/draw/engines/image/image_drawing_mode.hh
M   source/blender/draw/intern/draw_cache_impl_subdivision.cc
M   source/blender/draw/intern/draw_command.hh
M   source/blender/draw/intern/draw_pass.hh
M   source/blender/draw/intern/mesh_extractors/extract_mesh_vbo_edit_data.cc
M   
source/blender/draw/intern/mesh_extractors/extract_mesh_vbo_edituv_data.cc
M   source/blender/editors/interface/interface.cc
M   source/blender/editors/interface/interface_region_tooltip.cc
M   source/blender/editors/object/object_transform.cc
M   source/blender/editors/sculpt_paint/paint_image.cc
M   source/blender/editors/space_view3d/view3d_select.cc
M   source/blender/functions/FN_field.hh
M   source/blender/gpu/intern/gpu_framebuffer_private.hh
M   source/blender/gpu/metal/mtl_context.hh
M   source/blender/gpu/metal/mtl_pso_descriptor_state.hh
M   source/blender/gpu/metal/mtl_texture.hh
M   source/blender/gpu/opengl/gl_index_buffer.hh
M   source/blender/gpu/opengl/gl_vertex_buffer.cc
M   source/blender/io/alembic/exporter/abc_archive.cc
M   source/blender/io/alembic/exporter/abc_export_capi.cc
M   source/blender/io/alembic/exporter/abc_writer_curves.cc
M   source/blender/io/alembic/intern/abc_reader_camera.cc
M   source/blender/io/alembic/intern/abc_reader_curves.cc
M   source/blender/io/alembic/intern/abc_reader_mesh.cc
M   source/blender/io/alembic/intern/abc_reader_object.cc
M   source/blender/io/alembic/intern/abc_util.cc
M   source/blender/io/alembic/intern/alembic_capi.cc
M   source/blender/io/usd/intern/usd_reader_curve.h
M   source/blender/io/usd/intern/usd_reader_nurbs.h
M   source/blender/io/usd/intern/usd_reader_volume.h
M   source/blender/io/wavefront_obj/exporter/obj_export_mtl.hh
M   source/blender/io/wavefront_obj/importer/obj_import_objects.hh

===

diff --git a/intern/ghost/intern/GHOST_ContextGLX.cpp 
b/intern/ghost/intern/GHOST_ContextGLX.cpp
index e5f2e707f32..4c1e2705b50 100644
--- a/intern/ghost/intern/GHOST_ContextGLX.cpp
+++ b/intern/ghost/intern/GHOST_ContextGLX.cpp
@@ -320,7 +320,7 @@ GHOST_TSuccess GHOST_ContextGLX::getSwapInterval(int 
&intervalOut)
 
 ::glXQueryDrawable(m_display, m_window, GLX_SWAP_INTERVAL_EXT, &interval);
 
-intervalOut = static_cast(interval);
+intervalOut = int(interval);
 
 return GHOST_kSuccess;
   }
diff --git a/intern/ghost/intern/GHOST_XrAction.cpp 
b/intern/ghost/intern/GHOST_XrAction.cpp
index 0e725bf4075..9fbe033ade9 100644
--- a/intern/ghost/intern/GHOST_XrAction.cpp
+++ b/intern/ghost/intern/GHOST_XrAction.cpp
@@ -528,7 +528,7 @@ void *GHOST_XrActionSet::getCustomdata()
 
 uint32_t GHOST_XrActionSet::getActionCount() const
 {
-  return (uint32_t)m_actions.size();
+  return uint32_t(m_actions.size());
 }
 
 void GHOST_XrActionSet::getActionCustomdataArray(void **r_customdata_array)
diff --git a/intern/mikktspace/mikktspace.hh b/intern/mikktspace/mikktspace.hh
index 93e22658a56..2e5b0b065a8 100644
--- a/intern/mikktspace/mikktspace.hh
+++ b/intern/mikktspace/mikktspace.hh
@@ -151,7 +151,7 @@ template class Mikktspace {
 
   void genTangSpace()
   {
-nrFaces = (uint)mesh.GetNumFaces();
+nrFaces = uint(mesh.GetNumFaces());
 
 #ifdef WITH_TBB
 nrThreads = tbb::this_task_arena::max_concurrency();
@@ -276,7 +276,7 @@ template class

[Bf-blender-cvs] [0210c4df179] master: GPU: Disable SSBO support from commandline.

2022-09-26 Thread Jeroen Bakker
Commit: 0210c4df1793799a09a35e44be286dfca88769dc
Author: Jeroen Bakker
Date:   Mon Sep 26 09:41:50 2022 +0200
Branches: master
https://developer.blender.org/rB0210c4df1793799a09a35e44be286dfca88769dc

GPU: Disable SSBO support from commandline.

In heavy scenes containing many hairs/curves and volumetrics
using SSBO can overwrite the binding information of the volumetric
resolve shader. This has been detected during project Heist and is
only reproducable on NVIDIA platform.

This patch adds an debug option to disable SSBOs from the command
line to replace the --debug-gpu-force-workarounds that has been
used as a workaround on the render farm. Reason is that
force workarounds will also add other limitations as well (number
of texture binds for example)

===

M   source/blender/blenkernel/BKE_global.h
M   source/blender/gpu/opengl/gl_backend.cc
M   source/creator/creator_args.c

===

diff --git a/source/blender/blenkernel/BKE_global.h 
b/source/blender/blenkernel/BKE_global.h
index e28c87cd7d6..f3acb7d3746 100644
--- a/source/blender/blenkernel/BKE_global.h
+++ b/source/blender/blenkernel/BKE_global.h
@@ -189,15 +189,16 @@ enum {
  * assigned to ID datablocks */
   G_DEBUG_DEPSGRAPH = (G_DEBUG_DEPSGRAPH_BUILD | G_DEBUG_DEPSGRAPH_EVAL | 
G_DEBUG_DEPSGRAPH_TAG |
G_DEBUG_DEPSGRAPH_TIME | G_DEBUG_DEPSGRAPH_UUID),
-  G_DEBUG_SIMDATA = (1 << 15),   /* sim debug data display */
-  G_DEBUG_GPU = (1 << 16),   /* gpu debug */
-  G_DEBUG_IO = (1 << 17),/* IO Debugging (for Collada, 
...). */
-  G_DEBUG_GPU_FORCE_WORKAROUNDS = (1 << 18), /* force gpu workarounds 
bypassing detections. */
-  G_DEBUG_XR = (1 << 19),/* XR/OpenXR messages */
-  G_DEBUG_XR_TIME = (1 << 20),   /* XR/OpenXR timing messages */
-
-  G_DEBUG_GHOST = (1 << 21),  /* Debug GHOST module. */
-  G_DEBUG_WINTAB = (1 << 22), /* Debug Wintab. */
+  G_DEBUG_SIMDATA = (1 << 15),/* sim debug data display */
+  G_DEBUG_GPU = (1 << 16),/* gpu debug */
+  G_DEBUG_IO = (1 << 17), /* IO Debugging (for Collada, 
...). */
+  G_DEBUG_GPU_FORCE_WORKAROUNDS = (1 << 18),  /* force gpu workarounds 
bypassing detections. */
+  G_DEBUG_GPU_FORCE_DISABLE_SSBO = (1 << 19), /* force disabling usage of 
SSBO's */
+  G_DEBUG_XR = (1 << 20), /* XR/OpenXR messages */
+  G_DEBUG_XR_TIME = (1 << 21),/* XR/OpenXR timing messages */
+
+  G_DEBUG_GHOST = (1 << 22),  /* Debug GHOST module. */
+  G_DEBUG_WINTAB = (1 << 23), /* Debug Wintab. */
 };
 
 #define G_DEBUG_ALL \
diff --git a/source/blender/gpu/opengl/gl_backend.cc 
b/source/blender/gpu/opengl/gl_backend.cc
index 9051003bcd5..49a2321af98 100644
--- a/source/blender/gpu/opengl/gl_backend.cc
+++ b/source/blender/gpu/opengl/gl_backend.cc
@@ -431,6 +431,12 @@ static void detect_workarounds()
   /* Minimum Per-Vertex stride is 1 byte for OpenGL. */
   GCaps.minimum_per_vertex_stride = 1;
 
+  /* Force disable per feature. */
+  if (G.debug & G_DEBUG_GPU_FORCE_DISABLE_SSBO) {
+printf("\n");
+printf("GL: Force disabling SSBO support from commandline arguments.\n");
+GCaps.shader_storage_buffer_objects_support = false;
+  }
 }  // namespace blender::gpu
 
 /** Internal capabilities. */
diff --git a/source/creator/creator_args.c b/source/creator/creator_args.c
index fe2e14e0367..e0fea8a4686 100644
--- a/source/creator/creator_args.c
+++ b/source/creator/creator_args.c
@@ -579,6 +579,7 @@ static int arg_handle_print_help(int UNUSED(argc), const 
char **UNUSED(argv), vo
   BLI_args_print_arg_doc(ba, "--debug-wintab");
   BLI_args_print_arg_doc(ba, "--debug-gpu");
   BLI_args_print_arg_doc(ba, "--debug-gpu-force-workarounds");
+  BLI_args_print_arg_doc(ba, "--debug-gpu-disable-ssbo");
   BLI_args_print_arg_doc(ba, "--debug-wm");
 #  ifdef WITH_XR_OPENXR
   BLI_args_print_arg_doc(ba, "--debug-xr");
@@ -990,6 +991,9 @@ static const char 
arg_handle_debug_mode_generic_set_doc_depsgraph_uuid[] =
 static const char 
arg_handle_debug_mode_generic_set_doc_gpu_force_workarounds[] =
 "\n\t"
 "Enable workarounds for typical GPU issues and disable all GPU 
extensions.";
+static const char arg_handle_debug_mode_generic_set_doc_gpu_disable_ssbo[] =
+"\n\t"
+"Disable usage of shader storage buffer objects.";
 
 static int arg_handle_debug_mode_generic_set(int UNUSED(argc),
  const char **UNUSED(argv),
@@ -2212,6 +2216,11 @@ void main_args_setup(bContext *C, bArgs *ba)
"--debug-gpu-force-workarounds",
CB_EX(arg_handle_debug_mode_generic_set, gpu_force_workarounds),
(void *)G_DEBUG_GPU_FORCE_WORKAROUNDS);
+  BLI_args_add(ba,
+   NULL,
+   "