Public paste
Undefined
By: Guest | Date: Apr 25 2023 18:43 | Format: None | Expires: never | Size: 3.07 KB | Hits: 142

  1. diff --git a/source/blender/CMakeLists.txt b/source/blender/CMakeLists.txt
  2. index 679496ee783..ac9fcd9c80a 100644
  3. --- a/source/blender/CMakeLists.txt
  4. +++ b/source/blender/CMakeLists.txt
  5. @@ -120,6 +120,7 @@ set(SRC_DNA_DEFAULTS_INC
  6.    ${CMAKE_CURRENT_SOURCE_DIR}/makesdna/DNA_space_defaults.h
  7.    ${CMAKE_CURRENT_SOURCE_DIR}/makesdna/DNA_speaker_defaults.h
  8.    ${CMAKE_CURRENT_SOURCE_DIR}/makesdna/DNA_texture_defaults.h
  9. +  ${CMAKE_CURRENT_SOURCE_DIR}/makesdna/DNA_userdef_defaults.h
  10.    ${CMAKE_CURRENT_SOURCE_DIR}/makesdna/DNA_vec_defaults.h
  11.    ${CMAKE_CURRENT_SOURCE_DIR}/makesdna/DNA_view3d_defaults.h
  12.    ${CMAKE_CURRENT_SOURCE_DIR}/makesdna/DNA_volume_defaults.h
  13. diff --git a/source/blender/blenkernel/intern/preferences.c b/source/blender/blenkernel/intern/preferences.c
  14. index 02169cd4535..771cfa6f51d 100644
  15. --- a/source/blender/blenkernel/intern/preferences.c
  16. +++ b/source/blender/blenkernel/intern/preferences.c
  17. @@ -46,7 +46,6 @@ bUserAssetLibrary *BKE_preferences_asset_library_add(UserDef *userdef,
  18.    if (path) {
  19.      BLI_strncpy(library->path, path, sizeof(library->path));
  20.    }
  21. -  library->import_method = ASSET_IMPORT_APPEND_REUSE;
  22.  
  23.    return library;
  24.  }
  25. diff --git a/source/blender/makesdna/DNA_userdef_defaults.h b/source/blender/makesdna/DNA_userdef_defaults.h
  26. new file mode 100644
  27. index 00000000000..500abd73696
  28. --- /dev/null
  29. +++ b/source/blender/makesdna/DNA_userdef_defaults.h
  30. @@ -0,0 +1,28 @@
  31. +/* SPDX-License-Identifier: GPL-2.0-or-later */
  32. +
  33. +/** \file
  34. + * \ingroup DNA
  35. + */
  36. +
  37. +#pragma once
  38. +
  39. +#include "DNA_asset_types.h"
  40. +
  41. +/* Struct members on own line. */
  42. +/* clang-format off */
  43. +
  44. +/* -------------------------------------------------------------------- */
  45. +/** \name bUserAssetLibrary Struct
  46. + * \{ */
  47. +
  48. +#define _DNA_DEFAULT_bUserAssetLibrary \
  49. +  { \
  50. +    .import_method = ASSET_IMPORT_APPEND_REUSE, \
  51. +    .flag = ASSET_LIBRARY_RELATIVE_PATH, \
  52. +  }
  53. +
  54. +/** \} */
  55. +
  56. +/* clang-format off */
  57. +
  58. +/** \} */
  59. diff --git a/source/blender/makesdna/intern/dna_defaults.c b/source/blender/makesdna/intern/dna_defaults.c
  60. index 9ad3fd27974..456306d196d 100644
  61. --- a/source/blender/makesdna/intern/dna_defaults.c
  62. +++ b/source/blender/makesdna/intern/dna_defaults.c
  63. @@ -132,6 +132,7 @@
  64.  #include "DNA_space_defaults.h"
  65.  #include "DNA_speaker_defaults.h"
  66.  #include "DNA_texture_defaults.h"
  67. +#include "DNA_userdef_defaults.h"
  68.  #include "DNA_volume_defaults.h"
  69.  #include "DNA_world_defaults.h"
  70.  
  71. @@ -222,6 +223,9 @@ SDNA_DEFAULT_DECL_STRUCT(Speaker);
  72.  /* DNA_texture_defaults.h */
  73.  SDNA_DEFAULT_DECL_STRUCT(Tex);
  74.  
  75. +/* DNA_userdef_types.h */
  76. +SDNA_DEFAULT_DECL_STRUCT(bUserAssetLibrary);
  77. +
  78.  /* DNA_view3d_defaults.h */
  79.  SDNA_DEFAULT_DECL_STRUCT(View3D);
  80.  
  81. @@ -461,6 +465,7 @@ const void *DNA_default_table[SDNA_TYPE_MAX] = {
  82.      SDNA_DEFAULT_DECL_EX(UserDef_SpaceData, UserDef.space_data),
  83.      SDNA_DEFAULT_DECL_EX(UserDef_FileSpaceData, UserDef.file_space_data),
  84.      SDNA_DEFAULT_DECL_EX(WalkNavigation, UserDef.walk_navigation),
  85. +    SDNA_DEFAULT_DECL(bUserAssetLibrary),
  86.  
  87.      /* DNA_view3d_defaults.h */
  88.      SDNA_DEFAULT_DECL(View3D),