[Bf-blender-cvs] [01f9ac24edf] blender-projects-basics: Adapt to changes in master, fixes all compile errors
Julian Eisel
noreply at git.blender.org
Fri Jan 6 17:20:52 CET 2023
Commit: 01f9ac24edfbc6e016e08eaa7206e4836289e4e4
Author: Julian Eisel
Date: Fri Jan 6 17:20:03 2023 +0100
Branches: blender-projects-basics
https://developer.blender.org/rB01f9ac24edfbc6e016e08eaa7206e4836289e4e4
Adapt to changes in master, fixes all compile errors
===================================================================
M source/blender/asset_system/intern/asset_library.cc
M source/blender/asset_system/intern/asset_library_service.cc
M source/blender/blenkernel/intern/context.cc
M source/blender/editors/asset/intern/asset_list.cc
M source/blender/editors/asset/intern/asset_ops.cc
M source/blender/editors/project/project_ops.cc
M source/blender/editors/space_project_settings/space_project_settings.cc
===================================================================
diff --git a/source/blender/asset_system/intern/asset_library.cc b/source/blender/asset_system/intern/asset_library.cc
index 9a6b73ef501..096c74947d1 100644
--- a/source/blender/asset_system/intern/asset_library.cc
+++ b/source/blender/asset_system/intern/asset_library.cc
@@ -12,8 +12,8 @@
#include "AS_asset_library.hh"
#include "AS_asset_representation.hh"
+#include "BKE_asset_library_custom.h"
#include "BKE_main.h"
-#include "BKE_preferences.h"
#include "BLI_fileops.h"
#include "BLI_path_util.h"
@@ -68,8 +68,8 @@ bool AS_asset_library_has_any_unsaved_catalogs()
std::string AS_asset_library_find_suitable_root_path_from_path(
const blender::StringRefNull input_path)
{
- if (bUserAssetLibrary *preferences_lib = BKE_preferences_asset_library_containing_path(
- &U, input_path.c_str())) {
+ if (CustomAssetLibraryDefinition *preferences_lib = BKE_asset_library_custom_containing_path(
+ &U.asset_libraries, input_path.c_str())) {
return preferences_lib->path;
}
@@ -243,15 +243,17 @@ Vector<AssetLibraryReference> all_valid_asset_library_refs()
{
Vector<AssetLibraryReference> result;
int i;
- LISTBASE_FOREACH_INDEX (const bUserAssetLibrary *, asset_library, &U.asset_libraries, i) {
+ LISTBASE_FOREACH_INDEX (
+ const CustomAssetLibraryDefinition *, asset_library, &U.asset_libraries, i) {
if (!BLI_is_dir(asset_library->path)) {
continue;
}
AssetLibraryReference library_ref{};
library_ref.custom_library_index = i;
- library_ref.type = ASSET_LIBRARY_CUSTOM;
+ library_ref.type = ASSET_LIBRARY_CUSTOM_FROM_PREFERENCES;
result.append(library_ref);
}
+ /* TODO project libraries */
AssetLibraryReference library_ref{};
library_ref.custom_library_index = -1;
diff --git a/source/blender/asset_system/intern/asset_library_service.cc b/source/blender/asset_system/intern/asset_library_service.cc
index 79097ac8cd2..41d44867d7e 100644
--- a/source/blender/asset_system/intern/asset_library_service.cc
+++ b/source/blender/asset_system/intern/asset_library_service.cc
@@ -4,8 +4,8 @@
* \ingroup asset_system
*/
+#include "BKE_asset_library_custom.h"
#include "BKE_blender.h"
-#include "BKE_preferences.h"
#include "BLI_string_ref.hh"
@@ -67,14 +67,15 @@ AssetLibrary *AssetLibraryService::get_asset_library(
return get_asset_library_on_disk(root_path);
}
- if (library_reference.type == ASSET_LIBRARY_CUSTOM) {
- bUserAssetLibrary *user_library = BKE_preferences_asset_library_find_from_index(
- &U, library_reference.custom_library_index);
+ if (library_reference.type == ASSET_LIBRARY_CUSTOM_FROM_PREFERENCES) {
+ CustomAssetLibraryDefinition *user_library = BKE_asset_library_custom_find_from_index(
+ &U.asset_libraries, library_reference.custom_library_index);
if (user_library) {
return get_asset_library_on_disk(user_library->path);
}
}
+ /* TODO project libraries */
return nullptr;
}
diff --git a/source/blender/blenkernel/intern/context.cc b/source/blender/blenkernel/intern/context.cc
index 4105aa40358..c7b27e3c93d 100644
--- a/source/blender/blenkernel/intern/context.cc
+++ b/source/blender/blenkernel/intern/context.cc
@@ -939,9 +939,9 @@ SpaceProjectSettings *CTX_wm_space_project_settings(const bContext *C)
{
ScrArea *area = CTX_wm_area(C);
if (area && area->spacetype == SPACE_PROJECT_SETTINGS) {
- return area->spacedata.first;
+ return static_cast<SpaceProjectSettings *>(area->spacedata.first);
}
- return NULL;
+ return nullptr;
}
void CTX_wm_manager_set(bContext *C, wmWindowManager *wm)
diff --git a/source/blender/editors/asset/intern/asset_list.cc b/source/blender/editors/asset/intern/asset_list.cc
index 86c9539f317..8bb078ded74 100644
--- a/source/blender/editors/asset/intern/asset_list.cc
+++ b/source/blender/editors/asset/intern/asset_list.cc
@@ -12,11 +12,11 @@
#include <optional>
#include <string>
-#include "BKE_asset_library_custom.h"
#include "BKE_blender_project.h"
#include "BKE_context.h"
#include "BLI_map.hh"
+#include "BLI_path_util.h"
#include "BLI_utility_mixins.hh"
#include "DNA_space_types.h"
diff --git a/source/blender/editors/asset/intern/asset_ops.cc b/source/blender/editors/asset/intern/asset_ops.cc
index 3b3d9ad88da..36305210047 100644
--- a/source/blender/editors/asset/intern/asset_ops.cc
+++ b/source/blender/editors/asset/intern/asset_ops.cc
@@ -7,7 +7,7 @@
#include "AS_asset_library.h"
#include "AS_asset_library.hh"
-#include "BKE_blender_project.hh"
+#include "BKE_asset_library_custom.h"
#include "BKE_bpath.h"
#include "BKE_context.h"
#include "BKE_lib_id.h"
diff --git a/source/blender/editors/project/project_ops.cc b/source/blender/editors/project/project_ops.cc
index b9398aa9e95..45315b5178c 100644
--- a/source/blender/editors/project/project_ops.cc
+++ b/source/blender/editors/project/project_ops.cc
@@ -13,6 +13,7 @@
#include "BKE_report.h"
#include "BLI_path_util.h"
+
#include "BLT_translation.h"
#include "DNA_space_types.h"
@@ -76,7 +77,7 @@ static int new_project_exec(bContext *C, wmOperator *op)
return OPERATOR_FINISHED;
}
-static int new_project_invoke(bContext *C, wmOperator *op, const wmEvent *UNUSED(event))
+static int new_project_invoke(bContext *C, wmOperator *op, const wmEvent * /*event*/)
{
const Main *bmain = CTX_data_main(C);
const char *blendfile_path = BKE_main_blendfile_path(bmain);
@@ -123,7 +124,7 @@ static void PROJECT_OT_new(wmOperatorType *ot)
/** \name Write Project Settings Operator
* \{ */
-static int save_settings_exec(bContext *UNUSED(C), wmOperator *UNUSED(op))
+static int save_settings_exec(bContext * /*C*/, wmOperator * /*op*/)
{
BlenderProject *active_project = CTX_wm_project();
@@ -187,7 +188,7 @@ static void PROJECT_OT_delete_setup(wmOperatorType *ot)
/** \name Add Custom Asset Library
* \{ */
-static int custom_asset_library_add_exec(bContext *UNUSED(C), wmOperator *op)
+static int custom_asset_library_add_exec(bContext * /*C*/, wmOperator *op)
{
BlenderProject *project = CTX_wm_project();
@@ -213,9 +214,7 @@ static int custom_asset_library_add_exec(bContext *UNUSED(C), wmOperator *op)
return OPERATOR_FINISHED;
}
-static int custom_asset_library_add_invoke(bContext *C,
- wmOperator *op,
- const wmEvent *UNUSED(event))
+static int custom_asset_library_add_invoke(bContext *C, wmOperator *op, const wmEvent * /*event*/)
{
if (!RNA_struct_property_is_set(op->ptr, "directory")) {
WM_event_add_fileselect(C, op);
@@ -253,7 +252,7 @@ static void PROJECT_OT_custom_asset_library_add(wmOperatorType *ot)
/** \name Remove Custom Asset Library
* \{ */
-static int custom_asset_library_remove_exec(bContext *UNUSED(C), wmOperator *op)
+static int custom_asset_library_remove_exec(bContext * /*C*/, wmOperator *op)
{
const int index = RNA_int_get(op->ptr, "index");
diff --git a/source/blender/editors/space_project_settings/space_project_settings.cc b/source/blender/editors/space_project_settings/space_project_settings.cc
index 3c62bbaf3e4..f79ed77b944 100644
--- a/source/blender/editors/space_project_settings/space_project_settings.cc
+++ b/source/blender/editors/space_project_settings/space_project_settings.cc
@@ -22,7 +22,7 @@
using namespace blender;
-static SpaceLink *project_settings_create(const ScrArea *area, const Scene *UNUSED(scene))
+static SpaceLink *project_settings_create(const ScrArea *area, const Scene * /*scene*/)
{
SpaceProjectSettings *project_settings_space = MEM_cnew<SpaceProjectSettings>(
"project settings space");
@@ -68,11 +68,11 @@ static SpaceLink *project_settings_create(const ScrArea *area, const Scene *UNUS
return reinterpret_cast<SpaceLink *>(project_settings_space);
}
-static void project_settings_free(SpaceLink *UNUSED(sl))
+static void project_settings_free(SpaceLink * /*sl*/)
{
}
-static void project_settings_init(wmWindowManager *UNUSED(wm), ScrArea *UNUSED(area))
+static void project_settings_init(wmWindowManager * /*wm*/, ScrArea * /*area*/)
{
}
@@ -101,7 +101,7 @@ static void project_settings_operatortypes(void)
{
}
-static void project_settings_keymap(struct wmKeyConfig *UNUSED(keyconf))
+static void project_settings_keymap(struct wmKeyConfig * /*keyconf*/)
{
}
@@ -150,16 +150,16 @@ static void project_settings_main_region_layout(const bContext *C, ARegion *regi
ED_region_panels_layout_ex(C, region, ®ion->type->paneltypes, contexts, NULL);
}
-static void project_settings_main_region_listener(const wmRegionListenerParams *UNUSED(params))
+static void project_settings_main_region_listener(const wmRegionListenerParams * /*params*/)
{
}
-static void project_settings_header_region_init(wmWindowManager *UNUSED(wm), ARegion *region)
+static void project_settings_header_region_init(wmWindowManager * /*wm*/, ARegion *region)
{
ED_region_header_init(region);
}
-static void project_settings_header_region_listener(const wmRegionListenerParams *UNUSED(params))
+static void project_settings_header_region_listener(const wmRegionListenerParams * /*params*/)
{
}
@@ -176,8 +176,7 @@ static void project_settings_navigation_region_draw(const bContext *C, ARegion *
ED_region_panels(C, region);
}
-static void project_settings_navigation_region_listener(
- const wmRegionListenerParams *UNUSED(params))
+static void project_settings_navigation_region_listener(const wmRegionListenerParams * /*params*/)
{
}
@@ -188,7 +187,7 @@ static void project_settings_execute_region_init(wmWindowManager *wm, ARegion *r
region->v2d.keepzoom |= V2D_LOCKZOOM_X | V2D_LOCKZOOM_Y;
}
-static void project_settings_execute_region_listener(const wmRegionListenerParams *UNUSED(params))
+static void project_settings_execute_region_listener(const wmRegionListenerParams * /*params*/)
{
}
More information about the Bf-blender-cvs
mailing list