Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJulian Eisel <julian@blender.org>2021-07-21 20:30:31 +0300
committerJulian Eisel <julian@blender.org>2021-07-21 20:35:39 +0300
commite850c2b06d18e4292110d3fe9cdf5ebc7c281daa (patch)
tree6a29c978067573d2e99049f9056a6cf310650d67 /source/blender/makesrna/intern/rna_workspace.c
parent10e28bd27017664064b1fb93f1ed347d6b404ae6 (diff)
Cleanup: Centralize/unify asset library reference from/to enum code
This was an open TODO, I wanted to have code for translating asset library references from and to enum values in a central place, and access that in the same way from both the Asset Browser and the Workspace RNA code. * Adds own file for the related functions. * Adds doxygen comments. * Updates RNA callbacks to properly use these functions. * Let these functions call each other, avoid duplicating logic.
Diffstat (limited to 'source/blender/makesrna/intern/rna_workspace.c')
-rw-r--r--source/blender/makesrna/intern/rna_workspace.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/source/blender/makesrna/intern/rna_workspace.c b/source/blender/makesrna/intern/rna_workspace.c
index f23ce1dd12f..95f62d7de16 100644
--- a/source/blender/makesrna/intern/rna_workspace.c
+++ b/source/blender/makesrna/intern/rna_workspace.c
@@ -45,6 +45,8 @@
# include "DNA_screen_types.h"
# include "DNA_space_types.h"
+# include "ED_asset.h"
+
# include "RNA_access.h"
# include "WM_toolsystem.h"
@@ -110,13 +112,13 @@ static void rna_WorkSpace_owner_ids_clear(WorkSpace *workspace)
static int rna_WorkSpace_asset_library_get(PointerRNA *ptr)
{
const WorkSpace *workspace = ptr->data;
- return rna_asset_library_reference_get(&workspace->asset_library);
+ return ED_asset_library_reference_to_enum_value(&workspace->asset_library);
}
static void rna_WorkSpace_asset_library_set(PointerRNA *ptr, int value)
{
WorkSpace *workspace = ptr->data;
- rna_asset_library_reference_set(&workspace->asset_library, value);
+ workspace->asset_library = ED_asset_library_reference_from_enum_value(value);
}
static bToolRef *rna_WorkSpace_tools_from_tkey(WorkSpace *workspace,