[Bf-blender-cvs] [db6b3801b37] master: Update command line argument description for --addons

2021-09-09 Thread Jon Denning
Commit: db6b3801b37adb2b0b5859dac70e8936234fca32
Author: Jon Denning
Date:   Fri Sep 10 14:34:29 2021 +1000
Branches: master
https://developer.blender.org/rBdb6b3801b37adb2b0b5859dac70e8936234fca32

Update command line argument description for --addons

Changed doc string for Blender `--addons` command line argument
to explain what it does rather than just describing what it expects.

Reviewed By: Blendify

Ref D12445

===

M   source/creator/creator_args.c

===

diff --git a/source/creator/creator_args.c b/source/creator/creator_args.c
index 85ba4eca307..943646daa81 100644
--- a/source/creator/creator_args.c
+++ b/source/creator/creator_args.c
@@ -1920,7 +1920,7 @@ static int arg_handle_python_use_system_env_set(int 
UNUSED(argc),
 
 static const char arg_handle_addons_set_doc[] =
 "\n"
-"\tComma separated list of add-ons (no spaces).";
+"\tComma separated list (no spaces) of add-ons to enable in addition to 
any default add-ons.";
 static int arg_handle_addons_set(int argc, const char **argv, void *data)
 {
   /* workaround for scripts not getting a bpy.context.scene, causes internal 
errors elsewhere */

___
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] [82ab2c16784] master: XR: Re-enable SteamVR OpenGL backend for AMD gpus

2021-09-09 Thread Peter Kim
Commit: 82ab2c167844627ccda4ac0e439f322fcea07173
Author: Peter Kim
Date:   Fri Sep 10 13:01:14 2021 +0900
Branches: master
https://developer.blender.org/rB82ab2c167844627ccda4ac0e439f322fcea07173

XR: Re-enable SteamVR OpenGL backend for AMD gpus

Addresses T76082.

Since the DirectX backend does not work for AMD gpus
(wglDXRegisterObjectNV() fails to register the shared OpenGL-DirectX
render buffer, displaying a pink screen to the user), the original
solution was to use SteamVR's OpenGL backend, which, as tested
recently, seems to work without any issues on AMD hardware.

However, the SteamVR OpenGL backend (on Windows) was disabled in
fe492d922d6d since it resulted in crashes with NVIDIA gpus (and still
crashes, as tested recently), so SteamVR would always use the
AMD-incompatible DirectX backend (on Windows).

This patch restores use of the SteamVR OpenGL backend for non-NVIDIA
(AMD, etc.) gpus while maintaining the DirectX workaround for NVIDIA
gpus. In this way, issues are still resolved on the NVIDIA side but
AMD users can once again use the SteamVR runtime, which may be their
only viable option of using Blender in VR.

Reviewed By: Julian Eisel

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

===

M   intern/ghost/GHOST_Types.h
M   intern/ghost/intern/GHOST_XrContext.cpp
M   intern/ghost/intern/GHOST_XrContext.h
M   source/blender/windowmanager/xr/intern/wm_xr.c

===

diff --git a/intern/ghost/GHOST_Types.h b/intern/ghost/GHOST_Types.h
index e46f712cb64..221fa140f70 100644
--- a/intern/ghost/GHOST_Types.h
+++ b/intern/ghost/GHOST_Types.h
@@ -652,6 +652,11 @@ typedef struct {
 enum {
   GHOST_kXrContextDebug = (1 << 0),
   GHOST_kXrContextDebugTime = (1 << 1),
+#  ifdef WIN32
+  /* Needed to avoid issues with the SteamVR OpenGL graphics binding (use 
DirectX fallback
+ instead). */
+  GHOST_kXrContextGpuNVIDIA = (1 << 2),
+#  endif
 };
 
 typedef struct {
diff --git a/intern/ghost/intern/GHOST_XrContext.cpp 
b/intern/ghost/intern/GHOST_XrContext.cpp
index 98c87232882..f6b3caa3ec7 100644
--- a/intern/ghost/intern/GHOST_XrContext.cpp
+++ b/intern/ghost/intern/GHOST_XrContext.cpp
@@ -99,7 +99,7 @@ void GHOST_XrContext::initialize(const 
GHOST_XrContextCreateInfo *create_info)
   storeInstanceProperties();
 
   /* Multiple bindings may be enabled. Now that we know the runtime in use, 
settle for one. */
-  m_gpu_binding_type = 
determineGraphicsBindingTypeToUse(graphics_binding_types);
+  m_gpu_binding_type = 
determineGraphicsBindingTypeToUse(graphics_binding_types, create_info);
 
   printInstanceInfo();
   if (isDebugMode()) {
@@ -473,14 +473,16 @@ std::vector 
GHOST_XrContext::determineGraphicsBindingT
 }
 
 GHOST_TXrGraphicsBinding GHOST_XrContext::determineGraphicsBindingTypeToUse(
-const std::vector &enabled_types)
+const std::vector &enabled_types,
+const GHOST_XrContextCreateInfo *create_info)
 {
   /* Return the first working type. */
   for (GHOST_TXrGraphicsBinding type : enabled_types) {
 #ifdef WIN32
-/* The SteamVR OpenGL backend fails currently. Disable it and allow 
falling back to the DirectX
- * one. */
-if ((m_runtime_id == OPENXR_RUNTIME_STEAMVR) && (type == 
GHOST_kXrGraphicsOpenGL)) {
+/* The SteamVR OpenGL backend currently fails for NVIDIA gpus. Disable it 
and allow falling
+ * back to the DirectX one. */
+if ((m_runtime_id == OPENXR_RUNTIME_STEAMVR) && (type == 
GHOST_kXrGraphicsOpenGL) &&
+((create_info->context_flag & GHOST_kXrContextGpuNVIDIA) != 0)) {
   continue;
 }
 #endif
diff --git a/intern/ghost/intern/GHOST_XrContext.h 
b/intern/ghost/intern/GHOST_XrContext.h
index 26fc374b957..479b50e1537 100644
--- a/intern/ghost/intern/GHOST_XrContext.h
+++ b/intern/ghost/intern/GHOST_XrContext.h
@@ -139,5 +139,6 @@ class GHOST_XrContext : public GHOST_IXrContext {
   std::vector determineGraphicsBindingTypesToEnable(
   const GHOST_XrContextCreateInfo *create_info);
   GHOST_TXrGraphicsBinding determineGraphicsBindingTypeToUse(
-  const std::vector &enabled_types);
+  const std::vector &enabled_types,
+  const GHOST_XrContextCreateInfo *create_info);
 };
diff --git a/source/blender/windowmanager/xr/intern/wm_xr.c 
b/source/blender/windowmanager/xr/intern/wm_xr.c
index 297205d1e79..8891840cb75 100644
--- a/source/blender/windowmanager/xr/intern/wm_xr.c
+++ b/source/blender/windowmanager/xr/intern/wm_xr.c
@@ -35,6 +35,8 @@
 
 #include "GHOST_C-api.h"
 
+#include "GPU_platform.h"
+
 #include "WM_api.h"
 
 #include "wm_surface.h"
@@ -91,6 +93,11 @@ bool wm_xr_init(wmWindowManager *wm)
 if (G.debug & G_DEBUG_XR_TIME) {
   create_info.context_flag |= GHOST_kXrContextDebugTime;
 }
+#ifdef WIN32
+if (GPU_type_matches(GPU_DEVICE_NVIDIA, GPU_OS_WIN, GPU_DRIVER_ANY)) {
+  create_info.context_flag |= GHOST_kXrContextGpuNVIDIA;
+}
+#endif
 

[Bf-blender-cvs] [ffa078a0796] temp-usd-latest-master: Merge remote-tracking branch 'blender_org/master' into temp-usd-latest-master

2021-09-09 Thread Michael Kowalski
Commit: ffa078a0796ffce22870832bc4fd3ff179d30832
Author: Michael Kowalski
Date:   Thu Sep 9 22:24:54 2021 -0400
Branches: temp-usd-latest-master
https://developer.blender.org/rBffa078a0796ffce22870832bc4fd3ff179d30832

Merge remote-tracking branch 'blender_org/master' into temp-usd-latest-master

===



===

diff --cc source/blender/editors/io/io_usd.c
index abcc1955318,d0007d9e5be..7fd550a1254
--- a/source/blender/editors/io/io_usd.c
+++ b/source/blender/editors/io/io_usd.c
@@@ -215,143 -125,23 +215,143 @@@ static int wm_usd_export_exec(bContext 
const bool visible_objects_only = RNA_boolean_get(op->ptr, 
"visible_objects_only");
const bool export_animation = RNA_boolean_get(op->ptr, "export_animation");
const bool export_hair = RNA_boolean_get(op->ptr, "export_hair");
 +  const bool export_vertices = RNA_boolean_get(op->ptr, "export_vertices");
 +  const bool export_vertex_colors = RNA_boolean_get(op->ptr, 
"export_vertex_colors");
 +  const bool export_vertex_groups = RNA_boolean_get(op->ptr, 
"export_vertex_groups");
 +  const bool export_face_maps = RNA_boolean_get(op->ptr, "export_face_maps");
const bool export_uvmaps = RNA_boolean_get(op->ptr, "export_uvmaps");
const bool export_normals = RNA_boolean_get(op->ptr, "export_normals");
 +  const bool export_transforms = RNA_boolean_get(op->ptr, 
"export_transforms");
const bool export_materials = RNA_boolean_get(op->ptr, "export_materials");
 +  const bool export_meshes = RNA_boolean_get(op->ptr, "export_meshes");
 +  const bool export_lights = RNA_boolean_get(op->ptr, "export_lights");
 +  const bool export_cameras = RNA_boolean_get(op->ptr, "export_cameras");
 +  const bool export_curves = RNA_boolean_get(op->ptr, "export_curves");
 +  const bool export_particles = RNA_boolean_get(op->ptr, "export_particles");
const bool use_instancing = RNA_boolean_get(op->ptr, "use_instancing");
const bool evaluation_mode = RNA_enum_get(op->ptr, "evaluation_mode");
 +  const bool generate_preview_surface = RNA_boolean_get(op->ptr, 
"generate_preview_surface");
 +  const bool convert_uv_to_st = RNA_boolean_get(op->ptr, "convert_uv_to_st");
 +  const bool convert_orientation = RNA_boolean_get(op->ptr, 
"convert_orientation");
 +  const bool export_child_particles = RNA_boolean_get(op->ptr, 
"export_child_particles");
 +  const bool export_as_overs = RNA_boolean_get(op->ptr, "export_as_overs");
 +  const bool merge_transform_and_shape = RNA_boolean_get(op->ptr, 
"merge_transform_and_shape");
 +  const bool export_custom_properties = RNA_boolean_get(op->ptr, 
"export_custom_properties");
 +  const bool export_identity_transforms = RNA_boolean_get(op->ptr, 
"export_identity_transforms");
 +  const bool apply_subdiv = RNA_boolean_get(op->ptr, "apply_subdiv");
 +  const bool author_blender_name = RNA_boolean_get(op->ptr, 
"author_blender_name");
 +  const bool vertex_data_as_face_varying = RNA_boolean_get(op->ptr, 
"vertex_data_as_face_varying");
 +  const float frame_step = RNA_float_get(op->ptr, "frame_step");
 +
 +  const bool override_shutter = RNA_boolean_get(op->ptr, "override_shutter");
 +  const double shutter_open = (double)RNA_float_get(op->ptr, "shutter_open");
 +  const double shutter_close = (double)RNA_float_get(op->ptr, 
"shutter_close");
 +
 +  // This default prim path is not sanitized. This happens in usd_capi.cc
-   char *default_prim_path = RNA_string_get_alloc(op->ptr, 
"default_prim_path", NULL, 0);
++  char *default_prim_path = RNA_string_get_alloc(op->ptr, 
"default_prim_path", NULL, 0, NULL);
 +
 +  default_prim_path = usd_ensure_prim_path(default_prim_path);
 +
-   char *root_prim_path = RNA_string_get_alloc(op->ptr, "root_prim_path", 
NULL, 0);
++  char *root_prim_path = RNA_string_get_alloc(op->ptr, "root_prim_path", 
NULL, 0, NULL);
 +
 +  // Do not allow / path
 +  if (root_prim_path[0] == '/' && strlen(root_prim_path) == 1)
 +root_prim_path[0] = '\0';
 +
 +  root_prim_path = usd_ensure_prim_path(root_prim_path);
 +
-   char *material_prim_path = RNA_string_get_alloc(op->ptr, 
"material_prim_path", NULL, 0);
++  char *material_prim_path = RNA_string_get_alloc(op->ptr, 
"material_prim_path", NULL, 0, NULL);
 +
 +  int global_forward = RNA_enum_get(op->ptr, 
"export_global_forward_selection");
 +  int global_up = RNA_enum_get(op->ptr, "export_global_up_selection");
 +
 +  bool export_textures = RNA_boolean_get(op->ptr, "export_textures");
  
 -  struct USDExportParams params = {
 -  export_animation,
 -  export_hair,
 -  export_uvmaps,
 -  export_normals,
 -  export_materials,
 -  selected_objects_only,
 -  visible_objects_only,
 -  use_instancing,
 -  evaluation_mode,
 -  };
 +  bool relative_texture_paths = RNA_boolean_get(op->ptr, 
"relative_texture_paths");
 +
 +  const bool backward_compatible = true;
 +
 +  const float light_intensity_scale = 

[Bf-blender-cvs] [0562c8b250c] temp-usd-latest-master: USD export: redundant call to set stage units

2021-09-09 Thread Michael Kowalski
Commit: 0562c8b250c8f0de2aedafd905932180647ae4e8
Author: Michael Kowalski
Date:   Thu Sep 9 16:02:08 2021 -0400
Branches: temp-usd-latest-master
https://developer.blender.org/rB0562c8b250c8f0de2aedafd905932180647ae4e8

USD export: redundant call to set stage units

Setting the stage meters per unit metadata was being called
in two places unnecessarily. Removed redundant call.

===

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

===

diff --git a/source/blender/io/usd/intern/usd_capi_export.cc 
b/source/blender/io/usd/intern/usd_capi_export.cc
index 4eb79b1583d..e8014fed7b2 100644
--- a/source/blender/io/usd/intern/usd_capi_export.cc
+++ b/source/blender/io/usd/intern/usd_capi_export.cc
@@ -196,8 +196,6 @@ static void export_startjob(void *customdata,
   }
 
   usd_stage->SetMetadata(pxr::UsdGeomTokens->upAxis, upAxis);
-  usd_stage->SetMetadata(pxr::UsdGeomTokens->metersPerUnit,
- pxr::VtValue(scene->unit.scale_length));
   usd_stage->GetRootLayer()->SetDocumentation(std::string("Blender ") +
   BKE_blender_version_string());
 
@@ -265,7 +263,8 @@ static void export_startjob(void *customdata,
 }
   }
 
-  // Set Scale
+  /* Set unit scale.
+   * TODO(makowalsk): Add an option to use scene->unit.scale_length as well? */
   double meters_per_unit = data->params.convert_to_cm ? 
pxr::UsdGeomLinearUnits::centimeters :
 
pxr::UsdGeomLinearUnits::meters;
   pxr::UsdGeomSetStageMetersPerUnit(usd_stage, meters_per_unit);

___
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] [ee3b4e84209] master: Windows: Fix VS2022 detection

2021-09-09 Thread Ray Molenkamp
Commit: ee3b4e8420928a03e9158489a87d5daa34ee302f
Author: Ray Molenkamp
Date:   Thu Sep 9 17:19:58 2021 -0600
Branches: master
https://developer.blender.org/rBee3b4e8420928a03e9158489a87d5daa34ee302f

Windows: Fix VS2022 detection

VS2019 had a compiler update moving it into the
range that was used to detect VS2022. This patch
updates the detection to the current VS2022
preview compiler version.

Reported by Jesse Y on chat.

===

M   build_files/cmake/platform/platform_win32.cmake

===

diff --git a/build_files/cmake/platform/platform_win32.cmake 
b/build_files/cmake/platform/platform_win32.cmake
index e3183fe5b7f..cb4d196d43f 100644
--- a/build_files/cmake/platform/platform_win32.cmake
+++ b/build_files/cmake/platform/platform_win32.cmake
@@ -259,7 +259,7 @@ if(NOT DEFINED LIBDIR)
   else()
 message(FATAL_ERROR "32 bit compiler detected, blender no longer provides 
pre-build libraries for 32 bit windows, please set the LIBDIR cmake variable to 
your own library folder")
   endif()
-  if(CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 19.29.30130)
+  if(CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 19.30.30423)
 message(STATUS "Visual Studio 2022 detected.")
 set(LIBDIR ${CMAKE_SOURCE_DIR}/../lib/${LIBDIR_BASE}_vc15)
   elseif(MSVC_VERSION GREATER 1919)

___
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] [c9347b9a7f5] master: UI: File Browser Options Fix

2021-09-09 Thread Harley Acheson
Commit: c9347b9a7f579b191038ad6b457b07eb4cb2d4a9
Author: Harley Acheson
Date:   Thu Sep 9 14:43:34 2021 -0700
Branches: master
https://developer.blender.org/rBc9347b9a7f579b191038ad6b457b07eb4cb2d4a9

UI: File Browser Options Fix

With D12436 two File Browser properties were renamed but two references
not changed in space_filebrowser.py

See D12449 for details.

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

Reviewed by Hans Goudey

===

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

===

diff --git a/release/scripts/startup/bl_ui/space_filebrowser.py 
b/release/scripts/startup/bl_ui/space_filebrowser.py
index ca018216a5a..8ba82a7d407 100644
--- a/release/scripts/startup/bl_ui/space_filebrowser.py
+++ b/release/scripts/startup/bl_ui/space_filebrowser.py
@@ -267,7 +267,7 @@ class FILEBROWSER_PT_bookmarks_system(Panel):
 @classmethod
 def poll(cls, context):
 return (
-not context.preferences.filepaths.hide_system_bookmarks and
+context.preferences.filepaths.show_system_bookmarks and
 panel_poll_is_upper_region(context.region) and
 not panel_poll_is_asset_browsing(context)
 )
@@ -345,7 +345,7 @@ class FILEBROWSER_PT_bookmarks_recents(Panel):
 @classmethod
 def poll(cls, context):
 return (
-not context.preferences.filepaths.hide_recent_locations and
+context.preferences.filepaths.show_recent_locations and
 panel_poll_is_upper_region(context.region) and
 not panel_poll_is_asset_browsing(context)
 )

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


[Bf-blender-cvs] [d1f8f8b4a4b] cycles-x: Fix Cycles X use of uninitialized memory for AO and bevel nodes

2021-09-09 Thread Brecht Van Lommel
Commit: d1f8f8b4a4bdeead3d6b36167b7804cd0825bd4d
Author: Brecht Van Lommel
Date:   Thu Sep 9 21:14:18 2021 +0200
Branches: cycles-x
https://developer.blender.org/rBd1f8f8b4a4bdeead3d6b36167b7804cd0825bd4d

Fix Cycles X use of uninitialized memory for AO and bevel nodes

Always write to the SVM stack also in cases where no actual AO or bevel
ray-tracing can be performed.

===

M   intern/cycles/kernel/svm/svm.h
M   intern/cycles/kernel/svm/svm_ao.h
M   intern/cycles/kernel/svm/svm_bevel.h

===

diff --git a/intern/cycles/kernel/svm/svm.h b/intern/cycles/kernel/svm/svm.h
index 35d7cc96c59..4aee1ef11b3 100644
--- a/intern/cycles/kernel/svm/svm.h
+++ b/intern/cycles/kernel/svm/svm.h
@@ -545,14 +545,10 @@ ccl_device void 
svm_eval_nodes(INTEGRATOR_STATE_CONST_ARGS,
 break;
 #ifdef __SHADER_RAYTRACE__
   case NODE_BEVEL:
-if (KERNEL_NODES_FEATURE(RAYTRACE)) {
-  svm_node_bevel(INTEGRATOR_STATE_PASS, sd, stack, node);
-}
+svm_node_bevel(INTEGRATOR_STATE_PASS, sd, stack, 
node);
 break;
   case NODE_AMBIENT_OCCLUSION:
-if (KERNEL_NODES_FEATURE(RAYTRACE)) {
-  svm_node_ao(INTEGRATOR_STATE_PASS, sd, stack, node);
-}
+svm_node_ao(INTEGRATOR_STATE_PASS, sd, stack, node);
 break;
 #endif
 
diff --git a/intern/cycles/kernel/svm/svm_ao.h 
b/intern/cycles/kernel/svm/svm_ao.h
index 74617f9bb9e..34ac2cb8fbf 100644
--- a/intern/cycles/kernel/svm/svm_ao.h
+++ b/intern/cycles/kernel/svm/svm_ao.h
@@ -20,12 +20,16 @@ CCL_NAMESPACE_BEGIN
 
 #ifdef __SHADER_RAYTRACE__
 
+#  ifdef __KERNEL_OPTIX__
+extern "C" __device__ float 
__direct_callable__svm_node_ao(INTEGRATOR_STATE_CONST_ARGS,
+#  else
 ccl_device float svm_ao(INTEGRATOR_STATE_CONST_ARGS,
-ShaderData *sd,
-float3 N,
-float max_dist,
-int num_samples,
-int flags)
+#  endif
+   ShaderData *sd,
+   float3 N,
+   float max_dist,
+   int num_samples,
+   int flags)
 {
   if (flags & NODE_AO_GLOBAL_RADIUS) {
 max_dist = kernel_data.integrator.ao_bounces_distance;
@@ -85,6 +89,7 @@ ccl_device float svm_ao(INTEGRATOR_STATE_CONST_ARGS,
   return ((float)unoccluded) / num_samples;
 }
 
+template
 #  if defined(__KERNEL_OPTIX__)
 ccl_device_inline
 #  else
@@ -93,16 +98,6 @@ ccl_device_noinline
 void
 svm_node_ao(INTEGRATOR_STATE_CONST_ARGS, ShaderData *sd, float *stack, 
uint4 node)
 {
-#  if defined(__KERNEL_OPTIX__)
-  optixDirectCall(0, INTEGRATOR_STATE_PASS, sd, stack, node);
-}
-
-extern "C" __device__ void 
__direct_callable__svm_node_ao(INTEGRATOR_STATE_CONST_ARGS,
-  ShaderData *sd,
-  float *stack,
-  uint4 node)
-{
-#  endif
   uint flags, dist_offset, normal_offset, out_ao_offset;
   svm_unpack_node_uchar4(node.y, &flags, &dist_offset, &normal_offset, 
&out_ao_offset);
 
@@ -111,7 +106,16 @@ extern "C" __device__ void 
__direct_callable__svm_node_ao(INTEGRATOR_STATE_CONST
 
   float dist = stack_load_float_default(stack, dist_offset, node.w);
   float3 normal = stack_valid(normal_offset) ? stack_load_float3(stack, 
normal_offset) : sd->N;
-  float ao = svm_ao(INTEGRATOR_STATE_PASS, sd, normal, dist, samples, flags);
+
+  float ao = 1.0f;
+
+  if (KERNEL_NODES_FEATURE(RAYTRACE)) {
+#  ifdef __KERNEL_OPTIX__
+ao = optixDirectCall(0, INTEGRATOR_STATE_PASS, sd, normal, dist, 
samples, flags);
+#  else
+ao = svm_ao(INTEGRATOR_STATE_PASS, sd, normal, dist, samples, flags);
+#  endif
+  }
 
   if (stack_valid(out_ao_offset)) {
 stack_store_float(stack, out_ao_offset, ao);
diff --git a/intern/cycles/kernel/svm/svm_bevel.h 
b/intern/cycles/kernel/svm/svm_bevel.h
index ab2b3e110d3..aab089d19ea 100644
--- a/intern/cycles/kernel/svm/svm_bevel.h
+++ b/intern/cycles/kernel/svm/svm_bevel.h
@@ -95,10 +95,14 @@ ccl_device void svm_bevel_cubic_sample(const float radius, 
float xi, float *r, f
  * http://library.imageworks.com/pdfs/imageworks-library-BSSRDF-sampling.pdf
  */
 
+#  ifdef __KERNEL_OPTIX__
+extern "C" __device__ float3 
__direct_callable__svm_node_bevel(INTEGRATOR_STATE_CONST_ARGS,
+#  else
 ccl_device float3 svm_bevel(INTEGRATOR_STATE_CONST_ARGS,
-ShaderData *sd,
-float radius,
-int num_samples)
+#  endif
+   ShaderData *s

[Bf-blender-cvs] [604fb50cf35] cycles-x: Fix T90848: Cycles X correlation artifact in subsurface scattering

2021-09-09 Thread Brecht Van Lommel
Commit: 604fb50cf35cf30c02b6e9ad16b51f57ff96f51b
Author: Brecht Van Lommel
Date:   Thu Sep 9 20:38:11 2021 +0200
Branches: cycles-x
https://developer.blender.org/rB604fb50cf35cf30c02b6e9ad16b51f57ff96f51b

Fix T90848: Cycles X correlation artifact in subsurface scattering

===

M   intern/cycles/kernel/integrator/integrator_subsurface.h

===

diff --git a/intern/cycles/kernel/integrator/integrator_subsurface.h 
b/intern/cycles/kernel/integrator/integrator_subsurface.h
index 73375c06089..c22575c29bb 100644
--- a/intern/cycles/kernel/integrator/integrator_subsurface.h
+++ b/intern/cycles/kernel/integrator/integrator_subsurface.h
@@ -585,6 +585,9 @@ ccl_device_inline bool 
subsurface_scatter(INTEGRATOR_STATE_ARGS)
   integrator_state_write_isect(INTEGRATOR_STATE_PASS, &ss_isect.hits[0]);
   integrator_state_write_ray(INTEGRATOR_STATE_PASS, &ray);
 
+  /* Advanced random number offset for bounce. */
+  INTEGRATOR_STATE_WRITE(path, rng_offset) += PRNG_BOUNCE_NUM;
+
   const int shader = intersection_get_shader(kg, &ss_isect.hits[0]);
   const int shader_flags = kernel_tex_fetch(__shaders, shader).flags;
   if ((shader_flags & SD_HAS_RAYTRACE) || (kernel_data.film.pass_ao != 
PASS_UNUSED)) {

___
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] [f52a03dd713] temp_bmesh_multires: Sculpt dyntopo: Added a 'hard edge mode' option to forcibly set autosmooth_fset_slide to zero (i.e. treat face set boundaries as hard edges and not

2021-09-09 Thread Joseph Eagar
Commit: f52a03dd713e7396a948b1ca3207d57fca5610e9
Author: Joseph Eagar
Date:   Thu Sep 9 10:06:24 2021 -0800
Branches: temp_bmesh_multires
https://developer.blender.org/rBf52a03dd713e7396a948b1ca3207d57fca5610e9

Sculpt dyntopo: Added a 'hard edge mode' option
to forcibly set autosmooth_fset_slide to zero
(i.e. treat face set boundaries as hard edges
and not project them on the surface).

===

M   release/scripts/startup/bl_ui/properties_paint_common.py
M   source/blender/blenkernel/BKE_blender_version.h
M   source/blender/blenkernel/BKE_brush.h
M   source/blender/blenkernel/intern/brush.c
M   source/blender/blenloader/intern/versioning_280.c
M   source/blender/blenloader/intern/versioning_300.c
M   source/blender/editors/sculpt_paint/sculpt_smooth.c
M   source/blender/makesdna/DNA_brush_enums.h
M   source/blender/makesdna/DNA_scene_defaults.h
M   source/blender/makesdna/DNA_scene_types.h
M   source/blender/makesrna/intern/rna_brush.c
M   source/blender/makesrna/intern/rna_scene.c

===

diff --git a/release/scripts/startup/bl_ui/properties_paint_common.py 
b/release/scripts/startup/bl_ui/properties_paint_common.py
index dd8873b84c5..bc76f338c38 100644
--- a/release/scripts/startup/bl_ui/properties_paint_common.py
+++ b/release/scripts/startup/bl_ui/properties_paint_common.py
@@ -549,7 +549,17 @@ def brush_settings(layout, context, brush, popover=False):
 if context.preferences.experimental.use_sculpt_tools_tilt and 
capabilities.has_tilt:
 layout.prop(brush, "tilt_strength_factor", slider=True)
 
+UnifiedPaintPanel.prop_unified(
+layout,
+context,
+brush,
+"hard_edge_mode",
+slider=True,
+unified_name="use_unified_hard_edge_mode",
+ )
+
 row = layout.row(align=True)
+
 row.prop(brush, "hardness", slider=True)
 row.prop(brush, "invert_hardness_pressure", text="")
 row.prop(brush, "use_hardness_pressure", text="")
diff --git a/source/blender/blenkernel/BKE_blender_version.h 
b/source/blender/blenkernel/BKE_blender_version.h
index e2788020628..d71cb559911 100644
--- a/source/blender/blenkernel/BKE_blender_version.h
+++ b/source/blender/blenkernel/BKE_blender_version.h
@@ -39,7 +39,7 @@ extern "C" {
 
 /* Blender file format version. */
 #define BLENDER_FILE_VERSION BLENDER_VERSION
-#define BLENDER_FILE_SUBVERSION 21
+#define BLENDER_FILE_SUBVERSION 22
 
 /* 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
diff --git a/source/blender/blenkernel/BKE_brush.h 
b/source/blender/blenkernel/BKE_brush.h
index bf3d45d318c..4e8873f2cac 100644
--- a/source/blender/blenkernel/BKE_brush.h
+++ b/source/blender/blenkernel/BKE_brush.h
@@ -155,6 +155,11 @@ void BKE_brush_debug_print_state(struct Brush *br);
 
 void BKE_brush_get_dyntopo(struct Brush *brush, struct Sculpt *sd, struct 
DynTopoSettings *out);
 
+bool BKE_brush_hard_edge_mode_get(const struct Scene *scene, const struct 
Brush *brush);
+void BKE_brush_hard_edge_mode_set(struct Scene *scene, struct Brush *brush, 
bool val);
+
+float BKE_brush_fset_slide_get(const struct Scene *scene, const struct Brush 
*brush);
+
 #ifdef __cplusplus
 }
 #endif
diff --git a/source/blender/blenkernel/intern/brush.c 
b/source/blender/blenkernel/intern/brush.c
index 7c27648161e..2e2f89ea8a2 100644
--- a/source/blender/blenkernel/intern/brush.c
+++ b/source/blender/blenkernel/intern/brush.c
@@ -2755,3 +2755,36 @@ void BKE_brush_get_dyntopo(Brush *brush, Sculpt *sd, 
DynTopoSettings *out)
 }
   }
 };
+
+bool BKE_brush_hard_edge_mode_get(const Scene *scene, const Brush *brush)
+{
+  UnifiedPaintSettings *ups = &scene->toolsettings->unified_paint_settings;
+  bool ret = (ups->flag & UNIFIED_PAINT_FLAG_HARD_EDGE_MODE) ? 
ups->hard_edge_mode :
+   brush->flag2 & 
BRUSH_HARD_EDGE_MODE;
+
+  return ret;
+}
+
+void BKE_brush_hard_edge_mode_set(Scene *scene, Brush *brush, bool val)
+{
+  UnifiedPaintSettings *ups = &scene->toolsettings->unified_paint_settings;
+
+  if (ups->flag & UNIFIED_PAINT_FLAG_HARD_EDGE_MODE) {
+ups->hard_edge_mode = val;
+  }
+  else {
+if (val) {
+  brush->flag2 |= BRUSH_HARD_EDGE_MODE;
+}
+else {
+  brush->flag2 &= ~BRUSH_HARD_EDGE_MODE;
+}
+  }
+}
+
+float BKE_brush_fset_slide_get(const Scene *scene, const Brush *brush)
+{
+  UnifiedPaintSettings *ups = &scene->toolsettings->unified_paint_settings;
+
+  return BKE_brush_hard_edge_mode_get(scene, brush) ? 0.0f : 
brush->autosmooth_fset_slide;
+}
diff --git a/source/blender/blenloader/intern/versioning_280.c 
b/source/blender/blenloader/intern/versioning_280.c
index 2598c53a5e0..e87e201368

[Bf-blender-cvs] [d1313ab74e1] cycles-x: Merge branch 'master' into cycles-x

2021-09-09 Thread Brecht Van Lommel
Commit: d1313ab74e15e77d815867374bedc6588688ca82
Author: Brecht Van Lommel
Date:   Thu Sep 9 19:47:52 2021 +0200
Branches: cycles-x
https://developer.blender.org/rBd1313ab74e15e77d815867374bedc6588688ca82

Merge branch 'master' into cycles-x

===



===

diff --cc intern/cycles/render/nodes.h
index d8ab997a9ea,3013e9b1866..22bdb06b059
--- a/intern/cycles/render/nodes.h
+++ b/intern/cycles/render/nodes.h
@@@ -1373,7 -1549,12 +1373,7 @@@ class CurvesNode : public ShaderNode 
explicit CurvesNode(const NodeType *node_type);
SHADER_NODE_BASE_CLASS(CurvesNode)
  
-   NODE_SOCKET_API(array, curves)
 -  virtual int get_group()
 -  {
 -return NODE_GROUP_LEVEL_3;
 -  }
 -
+   NODE_SOCKET_API_ARRAY(array, curves)
NODE_SOCKET_API(float, min_x)
NODE_SOCKET_API(float, max_x)
NODE_SOCKET_API(float, fac)
@@@ -1402,9 -1583,13 +1402,9 @@@ class RGBRampNode : public ShaderNode 
   public:
SHADER_NODE_CLASS(RGBRampNode)
void constant_fold(const ConstantFolder &folder);
 -  virtual int get_group()
 -  {
 -return NODE_GROUP_LEVEL_1;
 -  }
  
-   NODE_SOCKET_API(array, ramp)
-   NODE_SOCKET_API(array, ramp_alpha)
+   NODE_SOCKET_API_ARRAY(array, ramp)
+   NODE_SOCKET_API_ARRAY(array, ramp_alpha)
NODE_SOCKET_API(float, fac)
NODE_SOCKET_API(bool, interpolate)
  };

___
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] [4c574a62db2] cycles-x: Fix image slot switching during render not working

2021-09-09 Thread Brecht Van Lommel
Commit: 4c574a62db2120889d2cd9bfd635ce632404c737
Author: Brecht Van Lommel
Date:   Thu Sep 9 17:31:45 2021 +0200
Branches: cycles-x
https://developer.blender.org/rB4c574a62db2120889d2cd9bfd635ce632404c737

Fix image slot switching during render not working

===

M   source/blender/draw/engines/external/external_engine.c

===

diff --git a/source/blender/draw/engines/external/external_engine.c 
b/source/blender/draw/engines/external/external_engine.c
index 3042fb95f1b..d5bed24a570 100644
--- a/source/blender/draw/engines/external/external_engine.c
+++ b/source/blender/draw/engines/external/external_engine.c
@@ -515,6 +515,10 @@ bool DRW_engine_external_use_for_image_editor(void)
 return false;
   }
 
+  if (image->render_slot != image->last_render_slot) {
+return false;
+  }
+
   RenderEngine *engine = external_engine_get();
   if (engine == NULL) {
 return false;

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


[Bf-blender-cvs] [f13eb692692] master: Revert "Depsgraph: release GIL when evaluating the depsgraph"

2021-09-09 Thread Brecht Van Lommel
Commit: f13eb692692f9c622783a465e114c4e8c046782a
Author: Brecht Van Lommel
Date:   Thu Sep 9 19:16:18 2021 +0200
Branches: master
https://developer.blender.org/rBf13eb692692f9c622783a465e114c4e8c046782a

Revert "Depsgraph: release GIL when evaluating the depsgraph"

It is causing crashes in rendering, when releasing the GIL in render threads
while the main thread is holding it.

Ref T91046

This reverts commit fc460351170478e712740ae1917a2e24803eba3b.

===

M   source/blender/depsgraph/CMakeLists.txt
M   source/blender/depsgraph/intern/eval/deg_eval.cc

===

diff --git a/source/blender/depsgraph/CMakeLists.txt 
b/source/blender/depsgraph/CMakeLists.txt
index 41253117096..3ad26c6f4db 100644
--- a/source/blender/depsgraph/CMakeLists.txt
+++ b/source/blender/depsgraph/CMakeLists.txt
@@ -161,13 +161,6 @@ set(LIB
   bf_blenkernel
 )
 
-if(WITH_PYTHON)
-  add_definitions(-DWITH_PYTHON)
-  list(APPEND INC
-../python
-  )
-endif()
-
 blender_add_lib(bf_depsgraph "${SRC}" "${INC}" "${INC_SYS}" "${LIB}")
 
 if(WITH_GTESTS)
diff --git a/source/blender/depsgraph/intern/eval/deg_eval.cc 
b/source/blender/depsgraph/intern/eval/deg_eval.cc
index c816c7b8db5..ad88cf656ad 100644
--- a/source/blender/depsgraph/intern/eval/deg_eval.cc
+++ b/source/blender/depsgraph/intern/eval/deg_eval.cc
@@ -41,10 +41,6 @@
 #include "DEG_depsgraph.h"
 #include "DEG_depsgraph_query.h"
 
-#ifdef WITH_PYTHON
-#  include "BPY_extern.h"
-#endif
-
 #include "atomic_ops.h"
 
 #include "intern/depsgraph.h"
@@ -379,11 +375,6 @@ void deg_evaluate_on_refresh(Depsgraph *graph)
 
   graph->debug.begin_graph_evaluation();
 
-#ifdef WITH_PYTHON
-  /* Release the GIL so that Python drivers can be evaluated. See T91046. */
-  BPy_BEGIN_ALLOW_THREADS;
-#endif
-
   graph->is_evaluating = true;
   depsgraph_ensure_view_layer(graph);
   /* Set up evaluation state. */
@@ -424,10 +415,6 @@ void deg_evaluate_on_refresh(Depsgraph *graph)
   deg_graph_clear_tags(graph);
   graph->is_evaluating = false;
 
-#ifdef WITH_PYTHON
-  BPy_END_ALLOW_THREADS;
-#endif
-
   graph->debug.end_graph_evaluation();
 }

___
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] [508ba523e92] temp-asset-browser-catalogs-ui: Attempt to fix build error on macOS buildbot

2021-09-09 Thread Julian Eisel
Commit: 508ba523e928929074f7a2fa6464f8696193f878
Author: Julian Eisel
Date:   Thu Sep 9 19:14:45 2021 +0200
Branches: temp-asset-browser-catalogs-ui
https://developer.blender.org/rB508ba523e928929074f7a2fa6464f8696193f878

Attempt to fix build error on macOS buildbot

Couldn't recreate this on my macOS machine even though it uses the same minimum
deployment target version of 10.13.

===

M   source/blender/editors/include/UI_interface.hh
M   source/blender/editors/interface/interface_view.cc
M   source/blender/editors/space_file/asset_catalog_tree_view.cc

===

diff --git a/source/blender/editors/include/UI_interface.hh 
b/source/blender/editors/include/UI_interface.hh
index 07a0a555f81..bdd743b5d8a 100644
--- a/source/blender/editors/include/UI_interface.hh
+++ b/source/blender/editors/include/UI_interface.hh
@@ -29,7 +29,7 @@ namespace blender::ui {
 class uiAbstractTreeView;
 }
 
-blender::ui::uiAbstractTreeView &UI_block_add_view(
+blender::ui::uiAbstractTreeView *UI_block_add_view(
 uiBlock *block,
 blender::StringRef idname,
 std::unique_ptr tree_view);
diff --git a/source/blender/editors/interface/interface_view.cc 
b/source/blender/editors/interface/interface_view.cc
index 3877eea6424..c7bf34d2098 100644
--- a/source/blender/editors/interface/interface_view.cc
+++ b/source/blender/editors/interface/interface_view.cc
@@ -38,10 +38,11 @@ struct uiViewLink : public Link {
   using TreeViewPtr = std::unique_ptr;
 
   std::string idname;
+  /* Note: Can't use std::get() on this until minimum macOS deployment target 
is 10.14. */
   std::variant view;
 };
 
-uiAbstractTreeView &UI_block_add_view(uiBlock *block,
+uiAbstractTreeView *UI_block_add_view(uiBlock *block,
   StringRef idname,
   std::unique_ptr 
tree_view)
 {
@@ -51,7 +52,8 @@ uiAbstractTreeView &UI_block_add_view(uiBlock *block,
   view_link->view = std::move(tree_view);
   view_link->idname = idname;
 
-  return *std::get(view_link->view);
+  auto view = std::get_if(&view_link->view);
+  return view ? view->get() : nullptr;
 }
 
 void ui_block_free_views(uiBlock *block)
diff --git a/source/blender/editors/space_file/asset_catalog_tree_view.cc 
b/source/blender/editors/space_file/asset_catalog_tree_view.cc
index 0c68f96cbe7..388f9b4208a 100644
--- a/source/blender/editors/space_file/asset_catalog_tree_view.cc
+++ b/source/blender/editors/space_file/asset_catalog_tree_view.cc
@@ -110,9 +110,9 @@ void 
file_draw_asset_catalog_tree_view_in_layout(::AssetLibrary *asset_library_c
   bke::AssetLibrary *asset_library = 
reinterpret_cast(
   asset_library_c);
 
-  uiAbstractTreeView &tree_view = UI_block_add_view(
+  uiAbstractTreeView *tree_view = UI_block_add_view(
   block, "asset catalog tree view", 
std::make_unique(asset_library));
 
-  tree_view.build_tree();
-  tree_view.build_layout_from_tree(uiTreeViewLayoutBuilder(*block));
+  tree_view->build_tree();
+  tree_view->build_layout_from_tree(uiTreeViewLayoutBuilder(*block));
 }

___
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] [efcf46fb6d8] master: Fix T90317: Confusing File Browser Preferences

2021-09-09 Thread Harley Acheson
Commit: efcf46fb6d87f1eb22ce2c0b5c9314d31269b648
Author: Harley Acheson
Date:   Thu Sep 9 09:49:45 2021 -0700
Branches: master
https://developer.blender.org/rBefcf46fb6d87f1eb22ce2c0b5c9314d31269b648

Fix T90317: Confusing File Browser Preferences

Preferences / File Browser section made less confusing.

See D12436 for details and comparisons.

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

Reviewed by Campbell Barton and Julian Eisel

===

M   release/scripts/startup/bl_ui/space_userpref.py
M   source/blender/makesrna/intern/rna_userdef.c

===

diff --git a/release/scripts/startup/bl_ui/space_userpref.py 
b/release/scripts/startup/bl_ui/space_userpref.py
index 0d1cbc424d7..1711519bce1 100644
--- a/release/scripts/startup/bl_ui/space_userpref.py
+++ b/release/scripts/startup/bl_ui/space_userpref.py
@@ -1455,13 +1455,11 @@ class USERPREF_PT_saveload_file_browser(SaveLoadPanel, 
CenterAlignMixIn, Panel):
 prefs = context.preferences
 paths = prefs.filepaths
 
-col = layout.column()
+col = layout.column(heading="Defaults")
 col.prop(paths, "use_filter_files")
-
-col = layout.column(heading="Hide")
-col.prop(paths, "show_hidden_files_datablocks", text="Dot File & 
Data-Blocks")
-col.prop(paths, "hide_recent_locations", text="Recent Locations")
-col.prop(paths, "hide_system_bookmarks", text="System Bookmarks")
+col.prop(paths, "show_hidden_files_datablocks")
+col.prop(paths, "show_recent_locations")
+col.prop(paths, "show_system_bookmarks")
 
 
 # -
diff --git a/source/blender/makesrna/intern/rna_userdef.c 
b/source/blender/makesrna/intern/rna_userdef.c
index 0a328c3b068..b3a3d0198fe 100644
--- a/source/blender/makesrna/intern/rna_userdef.c
+++ b/source/blender/makesrna/intern/rna_userdef.c
@@ -6073,26 +6073,25 @@ static void rna_def_userdef_filepaths(BlenderRNA *brna)
   RNA_def_struct_ui_text(srna, "File Paths", "Default paths for external 
files");
 
   prop = RNA_def_property(srna, "show_hidden_files_datablocks", PROP_BOOLEAN, 
PROP_NONE);
-  RNA_def_property_boolean_sdna(prop, NULL, "uiflag", USER_HIDE_DOT);
+  RNA_def_property_boolean_negative_sdna(prop, NULL, "uiflag", USER_HIDE_DOT);
   RNA_def_property_ui_text(prop,
-   "Hide Dot Files/Data-Blocks",
-   "Hide files and data-blocks if their name start 
with a dot (.*)");
+   "Show Hidden Files/Data-Blocks",
+   "Show files and data-blocks that are normally 
hidden");
 
   prop = RNA_def_property(srna, "use_filter_files", PROP_BOOLEAN, PROP_NONE);
   RNA_def_property_boolean_sdna(prop, NULL, "uiflag", USER_FILTERFILEEXTS);
-  RNA_def_property_ui_text(prop,
-   "Filter File Extensions",
-   "Display only files with extensions in the image 
select window");
+  RNA_def_property_ui_text(
+  prop, "Filter Files", "Enable filtering of files in the File Browser");
 
-  prop = RNA_def_property(srna, "hide_recent_locations", PROP_BOOLEAN, 
PROP_NONE);
-  RNA_def_property_boolean_sdna(prop, NULL, "uiflag", USER_HIDE_RECENT);
+  prop = RNA_def_property(srna, "show_recent_locations", PROP_BOOLEAN, 
PROP_NONE);
+  RNA_def_property_boolean_negative_sdna(prop, NULL, "uiflag", 
USER_HIDE_RECENT);
   RNA_def_property_ui_text(
-  prop, "Hide Recent Locations", "Hide recent locations in the file 
selector");
+  prop, "Show Recent Locations", "Show Recent locations list in the File 
Browser");
 
-  prop = RNA_def_property(srna, "hide_system_bookmarks", PROP_BOOLEAN, 
PROP_NONE);
-  RNA_def_property_boolean_sdna(prop, NULL, "uiflag", 
USER_HIDE_SYSTEM_BOOKMARKS);
+  prop = RNA_def_property(srna, "show_system_bookmarks", PROP_BOOLEAN, 
PROP_NONE);
+  RNA_def_property_boolean_negative_sdna(prop, NULL, "uiflag", 
USER_HIDE_SYSTEM_BOOKMARKS);
   RNA_def_property_ui_text(
-  prop, "Hide System Bookmarks", "Hide system bookmarks in the file 
selector");
+  prop, "Show System Locations", "Show System locations list in the File 
Browser");
 
   prop = RNA_def_property(srna, "use_relative_paths", PROP_BOOLEAN, PROP_NONE);
   RNA_def_property_boolean_sdna(prop, NULL, "flag", USER_RELPATHS);

___
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] [84d03a1298c] master: Fix T88755: Reuse Temp Windows by Type not Title

2021-09-09 Thread Harley Acheson
Commit: 84d03a1298c170a3cd61c8c7f9a0177da8fcfc35
Author: Harley Acheson
Date:   Thu Sep 9 09:26:44 2021 -0700
Branches: master
https://developer.blender.org/rB84d03a1298c170a3cd61c8c7f9a0177da8fcfc35

Fix T88755: Reuse Temp Windows by Type not Title

Reuse temporary windows when they share the same single area type, not
because they share the same title.

See D12401 for more details.

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

Reviewed by Campbell Barton

===

M   source/blender/windowmanager/intern/wm_window.c

===

diff --git a/source/blender/windowmanager/intern/wm_window.c 
b/source/blender/windowmanager/intern/wm_window.c
index 004a845c667..0402b0d778a 100644
--- a/source/blender/windowmanager/intern/wm_window.c
+++ b/source/blender/windowmanager/intern/wm_window.c
@@ -808,16 +808,17 @@ wmWindow *WM_window_open(bContext *C,
   /* changes rect to fit within desktop */
   wm_window_check_size(&rect);
 
-  /* Reuse temporary windows when they share the same title. */
+  /* Reuse temporary windows when they share the same single area. */
   wmWindow *win = NULL;
   if (temp) {
 LISTBASE_FOREACH (wmWindow *, win_iter, &wm->windows) {
-  if (WM_window_is_temp_screen(win_iter)) {
-char *wintitle = GHOST_GetTitle(win_iter->ghostwin);
-if (STREQ(title, wintitle)) {
+  const bScreen *screen = WM_window_get_active_screen(win_iter);
+  if (screen && screen->temp && BLI_listbase_is_single(&screen->areabase)) 
{
+ScrArea *area = screen->areabase.first;
+if (space_type == (area->butspacetype ? area->butspacetype : 
area->spacetype)) {
   win = win_iter;
+  break;
 }
-free(wintitle);
   }
 }
   }

___
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] [5daec72808d] cycles-x: Fix empty result on cancel in Cycles X

2021-09-09 Thread Sergey Sharybin
Commit: 5daec72808dae87f5b408751e4252e38ac5fd486
Author: Sergey Sharybin
Date:   Thu Sep 9 18:15:04 2021 +0200
Branches: cycles-x
https://developer.blender.org/rB5daec72808dae87f5b408751e4252e38ac5fd486

Fix empty result on cancel in Cycles X

===

M   intern/cycles/integrator/render_scheduler.cpp

===

diff --git a/intern/cycles/integrator/render_scheduler.cpp 
b/intern/cycles/integrator/render_scheduler.cpp
index 9ef8a795afb..d996aefa766 100644
--- a/intern/cycles/integrator/render_scheduler.cpp
+++ b/intern/cycles/integrator/render_scheduler.cpp
@@ -227,9 +227,19 @@ void 
RenderScheduler::render_work_reschedule_on_cancel(RenderWork &render_work)
   /* Un-schedule samples: they will not be rendered and should not be counted. 
*/
   state_.num_rendered_samples -= render_work.path_trace.num_samples;
 
+  const bool has_rendered_samples = get_num_rendered_samples() != 0;
+
+  /* Reset all fields of the previous work, canelling things like adaptive 
sampling filtering and
+   * denoising.
+   * However, need to preserve write requests, since those will not be 
possible to recover and
+   * writes are only to happen once. */
+  const bool tile_write = render_work.tile.write;
+  const bool full_write = render_work.full.write;
+
   render_work = RenderWork();
 
-  const bool has_rendered_samples = get_num_rendered_samples() != 0;
+  render_work.tile.write = tile_write;
+  render_work.full.write = full_write;
 
   /* Do not write tile if it has zero samples it it, treat it similarly to all 
other tiles which
* got cancelled. */

___
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] [67c13974e38] cycles-x: Fix Cycles X crash when GPUDisplay OpenGL context is failed to be created

2021-09-09 Thread Sergey Sharybin
Commit: 67c13974e38cb74bf4d43d859f0e57defe73bafb
Author: Sergey Sharybin
Date:   Thu Sep 9 18:25:12 2021 +0200
Branches: cycles-x
https://developer.blender.org/rB67c13974e38cb74bf4d43d859f0e57defe73bafb

Fix Cycles X crash when GPUDisplay OpenGL context is failed to be created

Better to display empty render result while rendering than to crash
and loose data.

===

M   intern/cycles/blender/blender_gpu_display.cpp

===

diff --git a/intern/cycles/blender/blender_gpu_display.cpp 
b/intern/cycles/blender/blender_gpu_display.cpp
index 3bcd44f2aa2..48c7f67087f 100644
--- a/intern/cycles/blender/blender_gpu_display.cpp
+++ b/intern/cycles/blender/blender_gpu_display.cpp
@@ -494,11 +494,18 @@ void BlenderGPUDisplay::gl_context_create()
   const bool drw_state = DRW_opengl_context_release();
 
   gl_context_ = WM_opengl_context_create_from_thread();
-  if (!gl_context_) {
+
+  if (gl_context_) {
+/* Context creation leaves it active. Need to release it so that it can be 
bound from another
+ * thread. */
+/* TODO(sergey): Need to look again into it: seems on Windoes this 
generates invalid handle
+ * error in `wglMakeCurrent()`. */
+WM_opengl_context_release(gl_context_);
+  }
+  else {
 LOG(ERROR) << "Error creating OpenGL context.";
   }
 
-  WM_opengl_context_release(gl_context_);
   DRW_opengl_context_activate(drw_state);
 }

___
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] [2cf9589bb41] temp-asset-browser-catalogs-ui: Merge branch 'temp-asset-browser-catalogs' into temp-asset-browser-catalogs-ui

2021-09-09 Thread Julian Eisel
Commit: 2cf9589bb41c0c166ab17973025f559d879f0977
Author: Julian Eisel
Date:   Thu Sep 9 17:49:33 2021 +0200
Branches: temp-asset-browser-catalogs-ui
https://developer.blender.org/rB2cf9589bb41c0c166ab17973025f559d879f0977

Merge branch 'temp-asset-browser-catalogs' into temp-asset-browser-catalogs-ui

===



===



___
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] [28a76c56b43] temp-asset-browser-catalogs-ui: Merge branch 'master' into temp-asset-browser-catalogs

2021-09-09 Thread Julian Eisel
Commit: 28a76c56b43e27dbd50b1efff9df46fff6186086
Author: Julian Eisel
Date:   Thu Sep 9 17:49:05 2021 +0200
Branches: temp-asset-browser-catalogs-ui
https://developer.blender.org/rB28a76c56b43e27dbd50b1efff9df46fff6186086

Merge branch 'master' into temp-asset-browser-catalogs

===



===



___
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] [2118a14982e] temp-asset-browser-catalogs-ui: Merge branch 'master' into temp-asset-browser-catalogs-ui

2021-09-09 Thread Julian Eisel
Commit: 2118a14982e5dc91a986c468d330896b012f37f5
Author: Julian Eisel
Date:   Thu Sep 9 17:31:48 2021 +0200
Branches: temp-asset-browser-catalogs-ui
https://developer.blender.org/rB2118a14982e5dc91a986c468d330896b012f37f5

Merge branch 'master' into temp-asset-browser-catalogs-ui

===



===



___
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] [ed4ef77f496] master: DNA: allow initializing defaults for deprecated struct members

2021-09-09 Thread Brecht Van Lommel
Commit: ed4ef77f496e5da6bf20cfbc4165274c67b26822
Author: Brecht Van Lommel
Date:   Thu Sep 9 16:35:04 2021 +0200
Branches: master
https://developer.blender.org/rBed4ef77f496e5da6bf20cfbc4165274c67b26822

DNA: allow initializing defaults for deprecated struct members

This can be useful for better forward compatibility.

===

M   source/blender/makesdna/intern/dna_defaults.c

===

diff --git a/source/blender/makesdna/intern/dna_defaults.c 
b/source/blender/makesdna/intern/dna_defaults.c
index a573e2f9e8c..3570f5a6a6f 100644
--- a/source/blender/makesdna/intern/dna_defaults.c
+++ b/source/blender/makesdna/intern/dna_defaults.c
@@ -68,6 +68,8 @@
  *   #BLO_update_defaults_startup_blend & #blo_do_versions_userdef.
  */
 
+#define DNA_DEPRECATED_ALLOW
+
 #include 
 #include 
 #include 

___
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] [45c44a5b5b6] master: Fix compiler warnings about virtual functions but non-virtual destructor

2021-09-09 Thread Brecht Van Lommel
Commit: 45c44a5b5b6251835cfd21f64c59ee23472941de
Author: Brecht Van Lommel
Date:   Thu Sep 9 17:10:09 2021 +0200
Branches: master
https://developer.blender.org/rB45c44a5b5b6251835cfd21f64c59ee23472941de

Fix compiler warnings about virtual functions but non-virtual destructor

===

M   source/blender/functions/FN_field.hh

===

diff --git a/source/blender/functions/FN_field.hh 
b/source/blender/functions/FN_field.hh
index 25188531580..79a6faf499b 100644
--- a/source/blender/functions/FN_field.hh
+++ b/source/blender/functions/FN_field.hh
@@ -69,7 +69,7 @@ class FieldNode {
   {
   }
 
-  ~FieldNode() = default;
+  virtual ~FieldNode() = default;
 
   virtual const CPPType &output_cpp_type(int output_index) const = 0;

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


[Bf-blender-cvs] [fb6d553bbac] cycles-x: Merge branch 'master' into cycles-x

2021-09-09 Thread Brecht Van Lommel
Commit: fb6d553bbacdd2aa9ee0dd8bf576203e3e1340e5
Author: Brecht Van Lommel
Date:   Thu Sep 9 16:46:22 2021 +0200
Branches: cycles-x
https://developer.blender.org/rBfb6d553bbacdd2aa9ee0dd8bf576203e3e1340e5

Merge branch 'master' into cycles-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] [0cd4ac3d8f0] cycles-x: DNA: allow initializing defaults for deprecated struct members

2021-09-09 Thread Brecht Van Lommel
Commit: 0cd4ac3d8f0aad96b68a31f0dacb1745363d0abe
Author: Brecht Van Lommel
Date:   Thu Sep 9 16:35:04 2021 +0200
Branches: cycles-x
https://developer.blender.org/rB0cd4ac3d8f0aad96b68a31f0dacb1745363d0abe

DNA: allow initializing defaults for deprecated struct members

This can be useful for better forward compatibility.

===

M   source/blender/makesdna/intern/dna_defaults.c

===

diff --git a/source/blender/makesdna/intern/dna_defaults.c 
b/source/blender/makesdna/intern/dna_defaults.c
index a573e2f9e8c..3570f5a6a6f 100644
--- a/source/blender/makesdna/intern/dna_defaults.c
+++ b/source/blender/makesdna/intern/dna_defaults.c
@@ -68,6 +68,8 @@
  *   #BLO_update_defaults_startup_blend & #blo_do_versions_userdef.
  */
 
+#define DNA_DEPRECATED_ALLOW
+
 #include 
 #include 
 #include 

___
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] [b4fd8750f96] master: Geometry Nodes: Allow exposing color sockets to the modifier

2021-09-09 Thread Hans Goudey
Commit: b4fd8750f96d42a53bbccf4952bab1b6f018d78f
Author: Hans Goudey
Date:   Thu Sep 9 09:43:00 2021 -0500
Branches: master
https://developer.blender.org/rBb4fd8750f96d42a53bbccf4952bab1b6f018d78f

Geometry Nodes: Allow exposing color sockets to the modifier

This commit allows connecting color sockets to the group input and
changing the input values in the modifier. Before there was an error
since this was more complicated to support with the previous IDProperty
UI data storage method.

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

===

M   source/blender/modifiers/intern/MOD_nodes.cc

===

diff --git a/source/blender/modifiers/intern/MOD_nodes.cc 
b/source/blender/modifiers/intern/MOD_nodes.cc
index ba557c3976c..f6d145bfdd7 100644
--- a/source/blender/modifiers/intern/MOD_nodes.cc
+++ b/source/blender/modifiers/intern/MOD_nodes.cc
@@ -88,6 +88,7 @@
 #include "FN_field.hh"
 #include "FN_multi_function.hh"
 
+using blender::ColorGeometry4f;
 using blender::destruct_ptr;
 using blender::float3;
 using blender::FunctionRef;
@@ -335,6 +336,22 @@ static IDProperty *id_property_create_from_socket(const 
bNodeSocket &socket)
   }
   return property;
 }
+case SOCK_RGBA: {
+  bNodeSocketValueRGBA *value = (bNodeSocketValueRGBA 
*)socket.default_value;
+  IDPropertyTemplate idprop = {0};
+  idprop.array.len = 4;
+  idprop.array.type = IDP_FLOAT;
+  IDProperty *property = IDP_New(IDP_ARRAY, &idprop, socket.identifier);
+  copy_v4_v4((float *)IDP_Array(property), value->value);
+  IDPropertyUIDataFloat *ui_data = (IDPropertyUIDataFloat 
*)IDP_ui_data_ensure(property);
+  ui_data->base.rna_subtype = PROP_COLOR;
+  ui_data->default_array = (double *)MEM_mallocN(sizeof(double[4]), 
__func__);
+  ui_data->default_array_len = 4;
+  for (const int i : IndexRange(4)) {
+ui_data->default_array[i] = double(value->value[i]);
+  }
+  return property;
+}
 case SOCK_BOOLEAN: {
   bNodeSocketValueBoolean *value = (bNodeSocketValueBoolean 
*)socket.default_value;
   IDPropertyTemplate idprop = {0};
@@ -391,6 +408,8 @@ static bool id_property_type_matches_socket(const 
bNodeSocket &socket, const IDP
   return property.type == IDP_INT;
 case SOCK_VECTOR:
   return property.type == IDP_ARRAY && property.subtype == IDP_FLOAT && 
property.len == 3;
+case SOCK_RGBA:
+  return property.type == IDP_ARRAY && property.subtype == IDP_FLOAT && 
property.len == 4;
 case SOCK_BOOLEAN:
   return property.type == IDP_INT;
 case SOCK_STRING:
@@ -432,6 +451,12 @@ static void init_socket_cpp_value_from_property(const 
IDProperty &property,
   new (r_value) 
blender::fn::Field(blender::fn::make_constant_field(value));
   break;
 }
+case SOCK_RGBA: {
+  blender::ColorGeometry4f value;
+  copy_v4_v4((float *)value, (const float *)IDP_Array(&property));
+  new (r_value) 
blender::fn::Field(blender::fn::make_constant_field(value));
+  break;
+}
 case SOCK_BOOLEAN: {
   bool value = IDP_Int(&property) != 0;
   new (r_value) 
blender::fn::Field(blender::fn::make_constant_field(value));

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


[Bf-blender-cvs] [541ff54793f] cycles-x: Fix T91279: incorrect mist and other passes with subsurface scattering

2021-09-09 Thread Brecht Van Lommel
Commit: 541ff54793f50474559ac7a33d2c6d91ef5cc6e7
Author: Brecht Van Lommel
Date:   Thu Sep 9 15:57:10 2021 +0200
Branches: cycles-x
https://developer.blender.org/rB541ff54793f50474559ac7a33d2c6d91ef5cc6e7

Fix T91279: incorrect mist and other passes with subsurface scattering

===

M   intern/cycles/kernel/integrator/integrator_subsurface.h

===

diff --git a/intern/cycles/kernel/integrator/integrator_subsurface.h 
b/intern/cycles/kernel/integrator/integrator_subsurface.h
index a4f173e3009..73375c06089 100644
--- a/intern/cycles/kernel/integrator/integrator_subsurface.h
+++ b/intern/cycles/kernel/integrator/integrator_subsurface.h
@@ -55,7 +55,8 @@ ccl_device int subsurface_bounce(INTEGRATOR_STATE_ARGS, 
ShaderData *sd, const Sh
   INTEGRATOR_STATE_WRITE(isect, object) = sd->object;
 
   /* Pass BSSRDF parameters. */
-  INTEGRATOR_STATE_WRITE(path, flag) |= PATH_RAY_SUBSURFACE;
+  const uint32_t path_flag = INTEGRATOR_STATE_WRITE(path, flag);
+  INTEGRATOR_STATE_WRITE(path, flag) = (path_flag & ~PATH_RAY_CAMERA) | 
PATH_RAY_SUBSURFACE;
   INTEGRATOR_STATE_WRITE(path, throughput) *= shader_bssrdf_sample_weight(sd, 
sc);
 
   if (kernel_data.kernel_features & KERNEL_FEATURE_LIGHT_PASSES) {

___
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] [3eb6569b38d] master: Fix build error on Linux

2021-09-09 Thread Peter Kim
Commit: 3eb6569b38d7c84ac084117221e475f5a328bf0d
Author: Peter Kim
Date:   Thu Sep 9 23:21:19 2021 +0900
Branches: master
https://developer.blender.org/rB3eb6569b38d7c84ac084117221e475f5a328bf0d

Fix build error on Linux

07c6af413617 was missing include.

===

M   intern/ghost/intern/GHOST_XrContext.cpp

===

diff --git a/intern/ghost/intern/GHOST_XrContext.cpp 
b/intern/ghost/intern/GHOST_XrContext.cpp
index 88da39914e7..98c87232882 100644
--- a/intern/ghost/intern/GHOST_XrContext.cpp
+++ b/intern/ghost/intern/GHOST_XrContext.cpp
@@ -20,6 +20,7 @@
  * Abstraction for XR (VR, AR, MR, ..) access via OpenXR.
  */
 
+#include 
 #include 
 #include 
 #include 

___
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] [c5d59f64d3f] cycles-x: Fix warning building on macOS Arm

2021-09-09 Thread Brecht Van Lommel
Commit: c5d59f64d3f9842091591033ef07042917225edd
Author: Brecht Van Lommel
Date:   Thu Sep 9 03:36:28 2021 +0200
Branches: cycles-x
https://developer.blender.org/rBc5d59f64d3f9842091591033ef07042917225edd

Fix warning building on macOS Arm

===

M   intern/cycles/util/util_math.h

===

diff --git a/intern/cycles/util/util_math.h b/intern/cycles/util/util_math.h
index 8c186e5e11f..6d728dde679 100644
--- a/intern/cycles/util/util_math.h
+++ b/intern/cycles/util/util_math.h
@@ -797,7 +797,7 @@ ccl_device_inline uint32_t reverse_integer_bits(uint32_t x)
 {
   /* Use a native instruction if it exists. */
 #if defined(__arm__) || defined(__aarch64__)
-  __asm__("rbit %0, %1" : "=r"(x) : "r"(x));
+  __asm__("rbit %w0, %w1" : "=r"(x) : "r"(x));
   return x;
 #elif defined(__KERNEL_CUDA__)
   return __brev(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] [bf47fb40fd6] master: Geometry Nodes: fields and anonymous attributes

2021-09-09 Thread Jacques Lucke
Commit: bf47fb40fd6f0ee9386e9936cf213a1049c55b61
Author: Jacques Lucke
Date:   Thu Sep 9 12:54:20 2021 +0200
Branches: master
https://developer.blender.org/rBbf47fb40fd6f0ee9386e9936cf213a1049c55b61

Geometry Nodes: fields and anonymous attributes

This implements the initial core framework for fields and anonymous
attributes (also see T91274).

The new functionality is hidden behind the "Geometry Nodes Fields"
feature flag. When enabled in the user preferences, the following
new nodes become available: `Position`, `Index`, `Normal`,
`Set Position` and `Attribute Capture`.

Socket inspection has not been updated to work with fields yet.

Besides these changes at the user level, this patch contains the
ground work for:
* building and evaluating fields at run-time (`FN_fields.hh`) and
* creating and accessing anonymous attributes on geometry
  (`BKE_anonymous_attribute.h`).

For evaluating fields we use a new so called multi-function procedure
(`FN_multi_function_procedure.hh`). It allows composing multi-functions
in arbitrary ways and supports efficient evaluation as is required by
fields. See `FN_multi_function_procedure.hh` for more details on how
this evaluation mechanism can be used.

A new `AttributeIDRef` has been added which allows handling named
and anonymous attributes in the same way in many places.

Hans and I worked on this patch together.

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

===

M   release/scripts/startup/bl_ui/space_userpref.py
M   release/scripts/startup/nodeitems_builtins.py
A   source/blender/blenkernel/BKE_anonymous_attribute.h
A   source/blender/blenkernel/BKE_anonymous_attribute.hh
M   source/blender/blenkernel/BKE_attribute_access.hh
M   source/blender/blenkernel/BKE_customdata.h
M   source/blender/blenkernel/BKE_geometry_set.hh
M   source/blender/blenkernel/BKE_geometry_set_instances.hh
M   source/blender/blenkernel/BKE_node.h
M   source/blender/blenkernel/CMakeLists.txt
A   source/blender/blenkernel/intern/anonymous_attribute.cc
M   source/blender/blenkernel/intern/attribute_access.cc
M   source/blender/blenkernel/intern/attribute_access_intern.hh
M   source/blender/blenkernel/intern/curve_eval.cc
M   source/blender/blenkernel/intern/customdata.c
M   source/blender/blenkernel/intern/geometry_component_curve.cc
M   source/blender/blenkernel/intern/geometry_component_mesh.cc
M   source/blender/blenkernel/intern/geometry_set_instances.cc
M   source/blender/blenkernel/intern/node.cc
M   
source/blender/editors/space_spreadsheet/spreadsheet_data_source_geometry.cc
M   source/blender/functions/CMakeLists.txt
A   source/blender/functions/FN_field.hh
A   source/blender/functions/FN_field_cpp_type.hh
M   source/blender/functions/FN_multi_function_builder.hh
M   source/blender/functions/FN_multi_function_params.hh
A   source/blender/functions/FN_multi_function_procedure.hh
A   source/blender/functions/FN_multi_function_procedure_builder.hh
A   source/blender/functions/FN_multi_function_procedure_executor.hh
M   source/blender/functions/intern/cpp_types.cc
A   source/blender/functions/intern/field.cc
M   source/blender/functions/intern/multi_function_builder.cc
A   source/blender/functions/intern/multi_function_procedure.cc
A   source/blender/functions/intern/multi_function_procedure_builder.cc
A   source/blender/functions/intern/multi_function_procedure_executor.cc
A   source/blender/functions/tests/FN_field_test.cc
A   source/blender/functions/tests/FN_multi_function_procedure_test.cc
M   source/blender/makesdna/DNA_customdata_types.h
M   source/blender/makesdna/DNA_node_types.h
M   source/blender/makesdna/DNA_userdef_types.h
M   source/blender/makesrna/intern/rna_nodetree.c
M   source/blender/makesrna/intern/rna_userdef.c
M   source/blender/modifiers/intern/MOD_nodes.cc
M   source/blender/modifiers/intern/MOD_nodes_evaluator.cc
M   source/blender/nodes/CMakeLists.txt
M   source/blender/nodes/NOD_geometry.h
M   source/blender/nodes/NOD_geometry_exec.hh
M   source/blender/nodes/NOD_static_types.h
M   source/blender/nodes/geometry/node_geometry_util.hh
A   source/blender/nodes/geometry/nodes/node_geo_attribute_capture.cc
M   source/blender/nodes/geometry/nodes/node_geo_curve_endpoints.cc
M   source/blender/nodes/geometry/nodes/node_geo_curve_resample.cc
M   source/blender/nodes/geometry/nodes/node_geo_curve_reverse.cc
M   source/blender/nodes/geometry/nodes/node_geo_curve_spline_type.cc
M   source/blender/nodes/geometry/nodes/node_geo_curve_subdivide.cc
M   source/blender/nodes/geometry/nodes/node_geo_curve_to_points.cc
M   source/blender/nodes/geometry/nodes/node_geo_curve_trim.cc
M   source/blender/nodes/geometry/nodes/node_geo_delete_geometry.cc
A   source/blender/nodes/geome

[Bf-blender-cvs] [36a573c09df] cycles-x: Cycles X: Don't cache Pass info as a field

2021-09-09 Thread Sergey Sharybin
Commit: 36a573c09df80522b7906b94d97101fa1511944f
Author: Sergey Sharybin
Date:   Wed Sep 8 18:24:10 2021 +0200
Branches: cycles-x
https://developer.blender.org/rB36a573c09df80522b7906b94d97101fa1511944f

Cycles X: Don't cache Pass info as a field

Avoiding such caching makes the Pass to fit generic nodes much
better: no need to worry about maintaining the information in
sync with the socket values.

The PassInfo construction is cheap, so the change should not
cause any time penalties.

No functional changes, just making Pass more re-usable outside
of Scene/Film for an upcoming development.

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

===

M   intern/cycles/render/film.cpp
M   intern/cycles/render/pass.cpp
M   intern/cycles/render/pass.h

===

diff --git a/intern/cycles/render/film.cpp b/intern/cycles/render/film.cpp
index 53854668783..014e9172c15 100644
--- a/intern/cycles/render/film.cpp
+++ b/intern/cycles/render/film.cpp
@@ -637,11 +637,9 @@ void Film::finalize_passes(Scene *scene, const bool 
use_denoise)
   vector new_passes;
 
   for (Pass *pass : scene->passes) {
-pass->info_ = Pass::get_info(pass->type, pass->include_albedo);
-
 /* Disable denoising on passes if denoising is disabled, or if the
  * pass does not support it. */
-pass->mode = (use_denoise && pass->info_.support_denoise) ? pass->mode : 
PassMode::NOISY;
+pass->mode = (use_denoise && pass->get_info().support_denoise) ? 
pass->mode : PassMode::NOISY;
 
 /* Merge duplicate passes. */
 bool duplicate_found = false;
diff --git a/intern/cycles/render/pass.cpp b/intern/cycles/render/pass.cpp
index 799cd6c5cec..8e3f82a9f95 100644
--- a/intern/cycles/render/pass.cpp
+++ b/intern/cycles/render/pass.cpp
@@ -144,14 +144,14 @@ Pass::Pass() : Node(get_node_type()), is_auto_(false)
 {
 }
 
-const PassInfo &Pass::get_info() const
+PassInfo Pass::get_info() const
 {
-  return info_;
+  return get_info(type, include_albedo);
 }
 
 bool Pass::is_written() const
 {
-  return info_.is_written;
+  return get_info().is_written;
 }
 
 PassInfo Pass::get_info(const PassType type, const bool include_albedo)
diff --git a/intern/cycles/render/pass.h b/intern/cycles/render/pass.h
index b2846942e5d..18348990045 100644
--- a/intern/cycles/render/pass.h
+++ b/intern/cycles/render/pass.h
@@ -69,7 +69,7 @@ class Pass : public Node {
 
   Pass();
 
-  const PassInfo &get_info() const;
+  PassInfo get_info() const;
 
   /* The pass is written by the render pipeline (kernel or denoiser). If the 
pass is written it
* will have pixels allocated in a RenderBuffer. Passes which are not 
written do not have their
@@ -77,8 +77,6 @@ class Pass : public Node {
   bool is_written() const;
 
  protected:
-  PassInfo info_;
-
   /* The has been created automatically as a requirement to various rendering 
functionality (such
* as adaptive sampling). */
   bool is_auto_;

___
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] [5283b647b7b] studio-sprite-fright: Fix T91255: IDProperty UI as_dict() returns step as default value

2021-09-09 Thread Hans Goudey
Commit: 5283b647b7bfaffeb7a43cdd2390368fc828c98a
Author: Hans Goudey
Date:   Wed Sep 8 15:46:02 2021 -0500
Branches: studio-sprite-fright
https://developer.blender.org/rB5283b647b7bfaffeb7a43cdd2390368fc828c98a

Fix T91255: IDProperty UI as_dict() returns step as default value

Another typo in this section of code.

===

M   source/blender/python/generic/idprop_py_ui_api.c

===

diff --git a/source/blender/python/generic/idprop_py_ui_api.c 
b/source/blender/python/generic/idprop_py_ui_api.c
index 42856d88472..7827bd48dfe 100644
--- a/source/blender/python/generic/idprop_py_ui_api.c
+++ b/source/blender/python/generic/idprop_py_ui_api.c
@@ -468,7 +468,7 @@ static void idprop_ui_data_to_dict_int(IDProperty 
*property, PyObject *dict)
 Py_DECREF(list);
   }
   else {
-PyDict_SetItemString(dict, "default", item = 
PyLong_FromLong(ui_data->step));
+PyDict_SetItemString(dict, "default", item = 
PyLong_FromLong(ui_data->default_value));
 Py_DECREF(item);
   }
 }
@@ -499,7 +499,7 @@ static void idprop_ui_data_to_dict_float(IDProperty 
*property, PyObject *dict)
 Py_DECREF(list);
   }
   else {
-PyDict_SetItemString(dict, "default", item = 
PyFloat_FromDouble(ui_data->step));
+PyDict_SetItemString(dict, "default", item = 
PyFloat_FromDouble(ui_data->default_value));
 Py_DECREF(item);
   }
 }

___
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] [29704854dfd] temp-geometry-nodes-fields: hide new nodes behind feature flag

2021-09-09 Thread Jacques Lucke
Commit: 29704854dfd7940409edf4c9f6709f3f30a3595a
Author: Jacques Lucke
Date:   Thu Sep 9 11:40:09 2021 +0200
Branches: temp-geometry-nodes-fields
https://developer.blender.org/rB29704854dfd7940409edf4c9f6709f3f30a3595a

hide new nodes behind feature flag

===

M   release/scripts/startup/bl_ui/space_userpref.py
M   release/scripts/startup/nodeitems_builtins.py
M   source/blender/makesdna/DNA_userdef_types.h
M   source/blender/makesrna/intern/rna_userdef.c

===

diff --git a/release/scripts/startup/bl_ui/space_userpref.py 
b/release/scripts/startup/bl_ui/space_userpref.py
index 1ac19d020d8..0d1cbc424d7 100644
--- a/release/scripts/startup/bl_ui/space_userpref.py
+++ b/release/scripts/startup/bl_ui/space_userpref.py
@@ -2254,6 +2254,7 @@ class 
USERPREF_PT_experimental_new_features(ExperimentalPanel, Panel):
 ({"property": "use_sculpt_tools_tilt"}, "T82877"),
 ({"property": "use_extended_asset_browser"}, 
("project/view/130/", "Project Page")),
 ({"property": "use_override_templates"}, ("T73318", "Milestone 
4")),
+({"property": "use_geometry_nodes_fields"}, "T91274"),
 ),
 )
 
diff --git a/release/scripts/startup/nodeitems_builtins.py 
b/release/scripts/startup/nodeitems_builtins.py
index b2aefd63a78..114e654e22b 100644
--- a/release/scripts/startup/nodeitems_builtins.py
+++ b/release/scripts/startup/nodeitems_builtins.py
@@ -180,6 +180,10 @@ def object_eevee_cycles_shader_nodes_poll(context):
 eevee_cycles_shader_nodes_poll(context))
 
 
+def geometry_nodes_fields_poll(context):
+return context.preferences.experimental.use_geometry_nodes_fields
+
+
 # All standard node categories currently used in nodes.
 
 shader_node_categories = [
@@ -478,7 +482,7 @@ geometry_node_categories = [
 GeometryNodeCategory("GEO_ATTRIBUTE", "Attribute", items=[
 NodeItem("GeometryNodeAttributeRandomize"),
 NodeItem("GeometryNodeAttributeMath"),
-NodeItem("GeometryNodeAttributeCapture"),
+NodeItem("GeometryNodeAttributeCapture", 
poll=geometry_nodes_fields_poll),
 NodeItem("GeometryNodeAttributeClamp"),
 NodeItem("GeometryNodeAttributeCompare"),
 NodeItem("GeometryNodeAttributeConvert"),
@@ -535,7 +539,7 @@ geometry_node_categories = [
 NodeItem("GeometryNodeJoinGeometry"),
 NodeItem("GeometryNodeSeparateComponents"),
 NodeItem("GeometryNodeRaycast"),
-NodeItem("GeometryNodeSetPosition"),
+NodeItem("GeometryNodeSetPosition", poll=geometry_nodes_fields_poll),
 ]),
 GeometryNodeCategory("GEO_INPUT", "Input", items=[
 NodeItem("GeometryNodeObjectInfo"),
@@ -546,9 +550,9 @@ geometry_node_categories = [
 NodeItem("FunctionNodeInputVector"),
 NodeItem("GeometryNodeInputMaterial"),
 NodeItem("GeometryNodeIsViewport"),
-NodeItem("GeometryNodeInputPosition"),
-NodeItem("GeometryNodeInputIndex"),
-NodeItem("GeometryNodeInputNormal"),
+NodeItem("GeometryNodeInputPosition", poll=geometry_nodes_fields_poll),
+NodeItem("GeometryNodeInputIndex", poll=geometry_nodes_fields_poll),
+NodeItem("GeometryNodeInputNormal", poll=geometry_nodes_fields_poll),
 ]),
 GeometryNodeCategory("GEO_MATERIAL", "Material", items=[
 NodeItem("GeometryNodeMaterialAssign"),
diff --git a/source/blender/makesdna/DNA_userdef_types.h 
b/source/blender/makesdna/DNA_userdef_types.h
index 1cb561ddd9f..7160d2c3751 100644
--- a/source/blender/makesdna/DNA_userdef_types.h
+++ b/source/blender/makesdna/DNA_userdef_types.h
@@ -646,7 +646,8 @@ typedef struct UserDef_Experimental {
   char use_sculpt_tools_tilt;
   char use_extended_asset_browser;
   char use_override_templates;
-  char _pad[5];
+  char use_geometry_nodes_fields;
+  char _pad[4];
   /** `makesdna` does not allow empty structs. */
 } UserDef_Experimental;
 
diff --git a/source/blender/makesrna/intern/rna_userdef.c 
b/source/blender/makesrna/intern/rna_userdef.c
index fe1b0757690..0a328c3b068 100644
--- a/source/blender/makesrna/intern/rna_userdef.c
+++ b/source/blender/makesrna/intern/rna_userdef.c
@@ -6300,6 +6300,10 @@ static void rna_def_userdef_experimental(BlenderRNA 
*brna)
   RNA_def_property_boolean_sdna(prop, NULL, "use_override_templates", 1);
   RNA_def_property_ui_text(
   prop, "Override Templates", "Enable library override template in the 
python API");
+
+  prop = RNA_def_property(srna, "use_geometry_nodes_fields", PROP_BOOLEAN, 
PROP_NONE);
+  RNA_def_property_boolean_sdna(prop, NULL, "use_geometry_nodes_fields", 1);
+  RNA_def_property_ui_text(prop, "Geometry Nodes Fields", "Enable field nodes 
in geometry nodes");
 }
 
 static void rna_def_userdef_addon_collection(BlenderRNA *brna, PropertyRNA 
*cprop)

___
Bf

[Bf-blender-cvs] [0c0e5a84204] master: IDmanagement: makelocal: Fix mistake in recent commit.

2021-09-09 Thread Bastien Montagne
Commit: 0c0e5a84204bda817c1e77a82cc7099aca4cf5be
Author: Bastien Montagne
Date:   Thu Sep 9 10:48:26 2021 +0200
Branches: master
https://developer.blender.org/rB0c0e5a84204bda817c1e77a82cc7099aca4cf5be

IDmanagement: makelocal: Fix mistake in recent commit.

rB8cc3d2d6f51f introduced option to force make_local code to either copy
or actually make a linked ID local, but logic of boolean options
handling was broken.

This commit simplifies logic here and fixes the issue.

NOTE: Since those new options were not used yet this was a harmless bug.

===

M   source/blender/blenkernel/intern/brush.c
M   source/blender/blenkernel/intern/lib_id.c
M   source/blender/blenkernel/intern/object.c

===

diff --git a/source/blender/blenkernel/intern/brush.c 
b/source/blender/blenkernel/intern/brush.c
index 56c22df3b02..50264f348e9 100644
--- a/source/blender/blenkernel/intern/brush.c
+++ b/source/blender/blenkernel/intern/brush.c
@@ -148,8 +148,8 @@ static void brush_make_local(Main *bmain, ID *id, const int 
flags)
 
   Brush *brush = (Brush *)id;
   const bool lib_local = (flags & LIB_ID_MAKELOCAL_FULL_LIBRARY) != 0;
-  const bool force_local = (flags & LIB_ID_MAKELOCAL_FORCE_LOCAL) != 0;
-  const bool force_copy = (flags & LIB_ID_MAKELOCAL_FORCE_COPY) != 0;
+  bool force_local = (flags & LIB_ID_MAKELOCAL_FORCE_LOCAL) != 0;
+  bool force_copy = (flags & LIB_ID_MAKELOCAL_FORCE_COPY) != 0;
   BLI_assert(force_copy == false || force_copy != force_local);
 
   bool is_local = false, is_lib = false;
@@ -166,27 +166,33 @@ static void brush_make_local(Main *bmain, ID *id, const 
int flags)
 
   if (!force_local && !force_copy) {
 BKE_library_ID_test_usages(bmain, brush, &is_local, &is_lib);
+if (lib_local || is_local) {
+  if (!is_lib) {
+force_local = true;
+  }
+  else {
+force_copy = true;
+  }
+}
   }
 
-  if (lib_local || is_local || force_copy || force_local) {
-if (!is_lib || force_local) {
-  BKE_lib_id_clear_library_data(bmain, &brush->id);
-  BKE_lib_id_expand_local(bmain, &brush->id);
+  if (force_local) {
+BKE_lib_id_clear_library_data(bmain, &brush->id);
+BKE_lib_id_expand_local(bmain, &brush->id);
 
-  /* enable fake user by default */
-  id_fake_user_set(&brush->id);
-}
-else {
-  Brush *brush_new = (Brush *)BKE_id_copy(bmain, &brush->id); /* Ensures 
FAKE_USER is set */
+/* enable fake user by default */
+id_fake_user_set(&brush->id);
+  }
+  else if (force_copy) {
+Brush *brush_new = (Brush *)BKE_id_copy(bmain, &brush->id); /* Ensures 
FAKE_USER is set */
 
-  brush_new->id.us = 0;
+brush_new->id.us = 0;
 
-  /* setting newid is mandatory for complex make_lib_local logic... */
-  ID_NEW_SET(brush, brush_new);
+/* setting newid is mandatory for complex make_lib_local logic... */
+ID_NEW_SET(brush, brush_new);
 
-  if (!lib_local) {
-BKE_libblock_remap(bmain, brush, brush_new, 
ID_REMAP_SKIP_INDIRECT_USAGE);
-  }
+if (!lib_local) {
+  BKE_libblock_remap(bmain, brush, brush_new, 
ID_REMAP_SKIP_INDIRECT_USAGE);
 }
   }
 }
diff --git a/source/blender/blenkernel/intern/lib_id.c 
b/source/blender/blenkernel/intern/lib_id.c
index cd0c3635dac..66b83272769 100644
--- a/source/blender/blenkernel/intern/lib_id.c
+++ b/source/blender/blenkernel/intern/lib_id.c
@@ -411,8 +411,8 @@ void BKE_lib_id_make_local_generic(Main *bmain, ID *id, 
const int flags)
   }
 
   const bool lib_local = (flags & LIB_ID_MAKELOCAL_FULL_LIBRARY) != 0;
-  const bool force_local = (flags & LIB_ID_MAKELOCAL_FORCE_LOCAL) != 0;
-  const bool force_copy = (flags & LIB_ID_MAKELOCAL_FORCE_COPY) != 0;
+  bool force_local = (flags & LIB_ID_MAKELOCAL_FORCE_LOCAL) != 0;
+  bool force_copy = (flags & LIB_ID_MAKELOCAL_FORCE_COPY) != 0;
   BLI_assert(force_copy == false || force_copy != force_local);
 
   bool is_local = false, is_lib = false;
@@ -426,43 +426,49 @@ void BKE_lib_id_make_local_generic(Main *bmain, ID *id, 
const int flags)
 
   if (!force_copy && !force_local) {
 BKE_library_ID_test_usages(bmain, id, &is_local, &is_lib);
+if (lib_local || is_local) {
+  if (!is_lib) {
+force_local = true;
+  }
+  else {
+force_copy = true;
+  }
+}
   }
 
-  if (lib_local || is_local || force_copy || force_local) {
-if (!is_lib || force_local) {
-  BKE_lib_id_clear_library_data(bmain, id);
-  BKE_lib_id_expand_local(bmain, id);
-}
-else {
-  ID *id_new = BKE_id_copy(bmain, id);
-
-  /* Should not fail in expected use cases,
-   * but a few ID types cannot be copied (LIB, WM, SCR...). */
-  if (id_new != NULL) {
-id_new->us = 0;
-
-/* setting newid is mandatory for complex make_lib_local logic... */
-ID_NEW_SET(id, id_new);
-Key *key = BKE_key_from_id(id), *key_new = BKE_

[Bf-blender-cvs] [0f6be4e1520] master: Cleanup: Readfile: cleanup some logic checks.

2021-09-09 Thread Bastien Montagne
Commit: 0f6be4e1520087bfe6d1dc98b61d65686ae09b3f
Author: Bastien Montagne
Date:   Thu Sep 9 10:51:39 2021 +0200
Branches: master
https://developer.blender.org/rB0f6be4e1520087bfe6d1dc98b61d65686ae09b3f

Cleanup: Readfile: cleanup some logic checks.

===

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

===

diff --git a/source/blender/blenloader/intern/readfile.c 
b/source/blender/blenloader/intern/readfile.c
index 3e9ea8db758..9704e8bb413 100644
--- a/source/blender/blenloader/intern/readfile.c
+++ b/source/blender/blenloader/intern/readfile.c
@@ -4500,7 +4500,8 @@ static void add_loose_objects_to_scene(Main *mainvar,
* or for a collection when *lib has been set. */
   LISTBASE_FOREACH (Object *, ob, &mainvar->objects) {
 bool do_it = (ob->id.tag & LIB_TAG_DOIT) != 0;
-if (do_it || ((ob->id.tag & LIB_TAG_INDIRECT) && (ob->id.tag & 
LIB_TAG_PRE_EXISTING) == 0)) {
+if (do_it ||
+((ob->id.tag & LIB_TAG_INDIRECT) != 0 && (ob->id.tag & 
LIB_TAG_PRE_EXISTING) == 0)) {
   if (do_append) {
 if (ob->id.us == 0) {
   do_it = true;
@@ -4648,7 +4649,7 @@ static void add_collections_to_scene(Main *mainvar,
 LISTBASE_FOREACH (CollectionObject *, coll_ob, &collection->gobject) {
   Object *ob = coll_ob->ob;
   if ((ob->id.tag & (LIB_TAG_PRE_EXISTING | LIB_TAG_DOIT | 
LIB_TAG_INDIRECT)) == 0 &&
-  (ob->id.lib == lib) && (object_in_any_scene(bmain, ob) == 0)) {
+  (ob->id.lib == lib) && (object_in_any_scene(bmain, ob) == 
false)) {
 do_add_collection = true;
 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] [f5b2b50f4dc] cycles-x: Merge branch 'master' into cycles-x

2021-09-09 Thread Sergey Sharybin
Commit: f5b2b50f4dc74996c44ca45fc2df9b66be21d2fa
Author: Sergey Sharybin
Date:   Thu Sep 9 10:43:44 2021 +0200
Branches: cycles-x
https://developer.blender.org/rBf5b2b50f4dc74996c44ca45fc2df9b66be21d2fa

Merge branch 'master' into cycles-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] [f8ead736a01] master: Fix FONT objects cannot use Object Font anymore

2021-09-09 Thread Philipp Oeser
Commit: f8ead736a017a013777bd9e20a76b461bd990dad
Author: Philipp Oeser
Date:   Thu Sep 9 09:16:03 2021 +0200
Branches: master
https://developer.blender.org/rBf8ead736a017a013777bd9e20a76b461bd990dad

Fix FONT objects cannot use Object Font anymore

Mistake in {rB459974896228}.

To use Object Fonts, (vertex) instancing needs to be enabled.
So bring back the instancing panel and improve the instancing choice
(similar to rB6c0c766bcaa0) by just giving the 'Vertex' choice (or
'None') and explain this is only used for Object Fonts on characters.

Was reported in D11348 itself.

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

===

M   release/scripts/startup/bl_ui/properties_object.py
M   source/blender/makesrna/intern/rna_object.c

===

diff --git a/release/scripts/startup/bl_ui/properties_object.py 
b/release/scripts/startup/bl_ui/properties_object.py
index 52af4fafd09..81a641a20cf 100644
--- a/release/scripts/startup/bl_ui/properties_object.py
+++ b/release/scripts/startup/bl_ui/properties_object.py
@@ -267,7 +267,8 @@ class OBJECT_PT_instancing(ObjectButtonsPanel, Panel):
 @classmethod
 def poll(cls, context):
 ob = context.object
-return (ob.type in {'MESH', 'EMPTY', 'POINTCLOUD'})
+# FONT objects need (vertex) instancing for the 'Object Font' feature
+return (ob.type in {'MESH', 'EMPTY', 'POINTCLOUD', 'FONT'})
 
 def draw(self, context):
 layout = self.layout
diff --git a/source/blender/makesrna/intern/rna_object.c 
b/source/blender/makesrna/intern/rna_object.c
index d3cd3158db1..99865078cbe 100644
--- a/source/blender/makesrna/intern/rna_object.c
+++ b/source/blender/makesrna/intern/rna_object.c
@@ -224,6 +224,12 @@ static EnumPropertyItem instance_items_empty[] = {
 INSTANCE_ITEM_COLLECTION,
 {0, NULL, 0, NULL, NULL},
 };
+
+static EnumPropertyItem instance_items_font[] = {
+{0, "NONE", 0, "None", ""},
+{OB_DUPLIVERTS, "VERTS", 0, "Vertices", "Use Object Font on characters"},
+{0, NULL, 0, NULL, NULL},
+};
 #endif
 #undef INSTANCE_ITEMS_SHARED
 #undef INSTANCE_ITEM_COLLECTION
@@ -762,6 +768,9 @@ static const EnumPropertyItem 
*rna_Object_instance_type_itemf(bContext *UNUSED(C
   else if (ob->type == OB_POINTCLOUD) {
 item = instance_items_pointcloud;
   }
+  else if (ob->type == OB_FONT) {
+item = instance_items_font;
+  }
   else {
 item = instance_items_nogroup;
   }

___
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] [a52f89a4465] temp_bmesh_multires: Add more int casts for linux

2021-09-09 Thread Joseph Eagar
Commit: a52f89a446566381c28804f0b1150aa71b245d59
Author: Joseph Eagar
Date:   Wed Sep 8 23:21:57 2021 -0800
Branches: temp_bmesh_multires
https://developer.blender.org/rBa52f89a446566381c28804f0b1150aa71b245d59

Add more int casts for linux

===

M   source/blender/bmesh/intern/bmesh_log.c

===

diff --git a/source/blender/bmesh/intern/bmesh_log.c 
b/source/blender/bmesh/intern/bmesh_log.c
index 486d61af377..2664ef542c1 100644
--- a/source/blender/bmesh/intern/bmesh_log.c
+++ b/source/blender/bmesh/intern/bmesh_log.c
@@ -2776,17 +2776,17 @@ static int bmlog_entry_memsize(BMLogEntry *entry)
 ret += entry->pdata.pool ? (int)BLI_mempool_get_size(entry->pdata.pool) : 
0;
 
 // estimate ghash memory usage
-ret += BLI_ghash_len(entry->added_verts) * (int)sizeof(void *) * 4;
-ret += BLI_ghash_len(entry->added_edges) * (int)sizeof(void *) * 4;
-ret += BLI_ghash_len(entry->added_faces) * (int)sizeof(void *) * 4;
+ret += (int)BLI_ghash_len(entry->added_verts) * (int)sizeof(void *) * 4;
+ret += (int)BLI_ghash_len(entry->added_edges) * (int)sizeof(void *) * 4;
+ret += (int)BLI_ghash_len(entry->added_faces) * (int)sizeof(void *) * 4;
 
-ret += BLI_ghash_len(entry->modified_verts) * (int)sizeof(void *) * 4;
-ret += BLI_ghash_len(entry->modified_edges) * (int)sizeof(void *) * 4;
-ret += BLI_ghash_len(entry->modified_faces) * (int)sizeof(void *) * 4;
+ret += (int)BLI_ghash_len(entry->modified_verts) * (int)sizeof(void *) * 4;
+ret += (int)BLI_ghash_len(entry->modified_edges) * (int)sizeof(void *) * 4;
+ret += (int)BLI_ghash_len(entry->modified_faces) * (int)sizeof(void *) * 4;
 
-ret += BLI_ghash_len(entry->deleted_verts) * (int)sizeof(void *) * 4;
-ret += BLI_ghash_len(entry->deleted_edges) * (int)sizeof(void *) * 4;
-ret += BLI_ghash_len(entry->deleted_faces) * (int)sizeof(void *) * 4;
+ret += (int)BLI_ghash_len(entry->deleted_verts) * (int)sizeof(void *) * 4;
+ret += (int)BLI_ghash_len(entry->deleted_edges) * (int)sizeof(void *) * 4;
+ret += (int)BLI_ghash_len(entry->deleted_faces) * (int)sizeof(void *) * 4;
   }
   else if (entry->type == LOG_ENTRY_FULL_MESH) {
 Mesh *me = entry->full_copy_mesh;

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


[Bf-blender-cvs] [9f3bafc4ab7] temp_bmesh_multires: Sculpt dyntopo

2021-09-09 Thread Joseph Eagar
Commit: 9f3bafc4ab7cc0ba83c51a7147f63f5c5a9341d8
Author: Joseph Eagar
Date:   Wed Sep 8 23:18:07 2021 -0800
Branches: temp_bmesh_multires
https://developer.blender.org/rB9f3bafc4ab7cc0ba83c51a7147f63f5c5a9341d8

Sculpt dyntopo

* Non-manifold "fins" are now detected and automatically
  deleted.
* Fixed compile error on linux.

===

M   source/blender/blenkernel/intern/dyntopo.c
M   source/blender/blenkernel/intern/pbvh_bmesh.c
M   source/blender/bmesh/intern/bmesh_log.c
M   source/blender/makesrna/intern/rna_brush.c

===

diff --git a/source/blender/blenkernel/intern/dyntopo.c 
b/source/blender/blenkernel/intern/dyntopo.c
index 35f242f2d22..211a35a3abd 100644
--- a/source/blender/blenkernel/intern/dyntopo.c
+++ b/source/blender/blenkernel/intern/dyntopo.c
@@ -161,7 +161,6 @@ static void pbvh_bmesh_verify(PBVH *pbvh);
 
 struct EdgeQueueContext;
 
-static bool check_for_flaps(PBVH *pbvh, BMVert *v);
 static bool check_face_is_tri(PBVH *pbvh, BMFace *f);
 static bool check_vert_fan_are_tris(PBVH *pbvh, BMVert *v);
 static void pbvh_split_edges(struct EdgeQueueContext *eq_ctx,
@@ -2205,121 +2204,192 @@ static bool check_face_is_tri(PBVH *pbvh, BMFace *f)
   return false;
 }
 
-static bool check_for_flaps(PBVH *pbvh, BMVert *v)
+static bool destroy_nonmanifold_fins(PBVH *pbvh, BMEdge *e_root)
 {
-  const int updateflag = DYNVERT_NEED_VALENCE | DYNVERT_NEED_DISK_SORT | 
DYNVERT_NEED_BOUNDARY;
+  static int max_faces = 64;
+  BMFace **stack = NULL;
+  BLI_array_staticdeclare(stack, 32);
 
-  bool ret = false;
+  BMLoop *l = e_root->l;
+  BMLoop **ls = NULL;
+  BMFace **fs = NULL;
+  BLI_array_staticdeclare(ls, 5);
+  int minfs = INT_MAX;
 
-  if (!v->e) {
+  if (!l) {
 return false;
   }
 
-  BMEdge *e = v->e;
-  BMEdge *enext;
   do {
-enext = BM_DISK_EDGE_NEXT(e, v);
+BLI_array_append(ls, l);
+  } while ((l = l->radial_next) != e_root->l);
 
-BMLoop *l = e->l;
-BMLoop *lnext;
+  for (int i = 0; i < BLI_array_len(ls); i++) {
+SmallHash visit;
+BLI_smallhash_init(&visit);
 
-bool ok = !l;
-ok = ok || (l == l->radial_next->radial_next);
+BMLoop *l = ls[i];
+BMFace *f = l->f;
+BMFace **fs2 = NULL;
+BLI_array_staticdeclare(fs2, 32);
 
-if (false) {  //! l) {
-  BMVert *v2 = BM_edge_other_vert(e, v);
+BLI_array_clear(stack);
+BLI_array_append(stack, f);
+BLI_array_append(fs2, f);
 
-  MDynTopoVert *mv1 = BKE_PBVH_DYNVERT(pbvh->cd_dyn_vert, v);
-  mv1->flag |= updateflag;
+BLI_smallhash_insert(&visit, (uintptr_t)f, NULL);
 
-  MDynTopoVert *mv2 = BKE_PBVH_DYNVERT(pbvh->cd_dyn_vert, v2);
-  mv2->flag |= updateflag;
+bool bad = false;
 
-  BM_log_edge_removed(pbvh->bm_log, e);
-  BM_edge_kill(pbvh->bm, e);
+while (BLI_array_len(stack) > 0) {
+  f = BLI_array_pop(stack);
+  BMLoop *l = f->l_first;
 
-#if 0
-  if (!v2->e) {
-pbvh_bmesh_vert_remove(pbvh, v2);
-BM_log_vert_removed(pbvh->bm_log, v2, pbvh->cd_vert_mask_offset);
-BM_vert_kill(pbvh->bm, v2);
-  }
-#endif
+  do {
+if (l->radial_next == l || l->radial_next->radial_next != l) {
+  continue;
+}
 
-  return true;
-  if (!v->e) {
-break;
-  }
+void **val = NULL;
+BMFace *f2 = l->radial_next->f;
 
-  enext = BM_DISK_EDGE_NEXT(v->e, v);
+if (!BLI_smallhash_ensure_p(&visit, (uintptr_t)f2, &val)) {
+  if (BLI_array_len(fs2) > max_faces) {
+bad = true;
+break;
+  }
 
-  continue;
+  *val = NULL;
+  BLI_array_append(stack, f2);
+  BLI_array_append(fs2, f2);
+}
+  } while ((l = l->next) != f->l_first);
+
+  if (bad) {
+break;
+  }
 }
 
-if (ok) {
-  continue;
+if (!bad && BLI_array_len(fs2) < minfs) {
+  minfs = BLI_array_len(fs2);
+  fs = BLI_array_alloca(fs, BLI_array_len(fs2));
+  memcpy(fs, fs2, sizeof(*fs) * BLI_array_len(fs2));
 }
 
-do {
-  lnext = l->radial_next;
+BLI_array_free(fs2);
+BLI_smallhash_release(&visit);
+  }
 
-  bool ok2 = l->f->len == 3;
-  // ok2 = ok2 && l->next->radial_next == l->next;
-  // ok2 = ok2 && l->prev->radial_next == l->prev;
+  int nupdateflag = PBVH_UpdateOtherVerts | PBVH_UpdateDrawBuffers | 
PBVH_UpdateBB |
+PBVH_UpdateTriAreas;
+  nupdateflag = nupdateflag | PBVH_UpdateNormals | PBVH_UpdateTris | 
PBVH_RebuildDrawBuffers;
 
-  if (ok2) {
-ret = true;
-printf("destroying non-manifold triangle\n");
+  if (!fs) {
+return false;
+  }
 
-BMVert *delv = l->prev->v;
+  if (fs) {
+printf("manifold fin size: %d\n", minfs);
+const int tag = BM_ELEM_TAG_ALT;
 
-// pbvh_bmesh_vert_remove(pbvh, delv);
-// BM_log_vert_removed(pbvh->bm_log, delv, pbvh->cd_ve