Assets: Rename workspace active asset library DNA variable
This new variable was introduced with 7898089de3
. We don't usually use
an `active` prefix variable. Plus, this makes the name match the one of
the Asset Browser active library variable, so we can use the
`rna_def_asset_library_reference_common()` helper for both.
This will cause Asset Views to open with the default "Current File"
Asset Library. We could avoid that, but it's a minor issue really.
This commit is contained in:
parent
952ded57de
commit
8de2b6a020
|
@ -58,7 +58,7 @@ static void workspace_init_data(ID *id)
|
|||
{
|
||||
WorkSpace *workspace = (WorkSpace *)id;
|
||||
|
||||
BKE_asset_library_reference_init_default(&workspace->active_asset_library);
|
||||
BKE_asset_library_reference_init_default(&workspace->asset_library);
|
||||
}
|
||||
|
||||
static void workspace_free_data(ID *id)
|
||||
|
|
|
@ -531,15 +531,6 @@ void blo_do_versions_300(FileData *fd, Library *UNUSED(lib), Main *bmain)
|
|||
}
|
||||
}
|
||||
FOREACH_NODETREE_END;
|
||||
|
||||
{
|
||||
if (!DNA_struct_elem_find(
|
||||
fd->filesdna, "WorkSpace", "AssetLibraryReference", "active_asset_library")) {
|
||||
LISTBASE_FOREACH (WorkSpace *, workspace, &bmain->workspaces) {
|
||||
BKE_asset_library_reference_init_default(&workspace->active_asset_library);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (!MAIN_VERSION_ATLEAST(bmain, 300, 10)) {
|
||||
|
@ -582,5 +573,12 @@ void blo_do_versions_300(FileData *fd, Library *UNUSED(lib), Main *bmain)
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (!DNA_struct_elem_find(
|
||||
fd->filesdna, "WorkSpace", "AssetLibraryReference", "asset_library")) {
|
||||
LISTBASE_FOREACH (WorkSpace *, workspace, &bmain->workspaces) {
|
||||
BKE_asset_library_reference_init_default(&workspace->asset_library);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1031,7 +1031,7 @@ static eContextResult screen_ctx_asset_library(const bContext *C, bContextDataRe
|
|||
{
|
||||
WorkSpace *workspace = CTX_wm_workspace(C);
|
||||
CTX_data_pointer_set(
|
||||
result, &workspace->id, &RNA_AssetLibraryReference, &workspace->active_asset_library);
|
||||
result, &workspace->id, &RNA_AssetLibraryReference, &workspace->asset_library);
|
||||
return CTX_RESULT_OK;
|
||||
}
|
||||
|
||||
|
|
|
@ -139,7 +139,7 @@ typedef struct WorkSpace {
|
|||
|
||||
/** Workspace-wide active asset library, for asset UIs to use (e.g. asset view UI template). The
|
||||
* Asset Browser has its own and doesn't use this. */
|
||||
AssetLibraryReference active_asset_library;
|
||||
AssetLibraryReference asset_library;
|
||||
} WorkSpace;
|
||||
|
||||
/**
|
||||
|
|
|
@ -382,7 +382,7 @@ PropertyRNA *rna_def_asset_library_reference_common(struct StructRNA *srna,
|
|||
const char *get,
|
||||
const char *set)
|
||||
{
|
||||
PropertyRNA *prop = RNA_def_property(srna, "active_asset_library", PROP_ENUM, PROP_NONE);
|
||||
PropertyRNA *prop = RNA_def_property(srna, "asset_library", PROP_ENUM, PROP_NONE);
|
||||
RNA_def_property_enum_items(prop, DummyRNA_NULL_items);
|
||||
RNA_def_property_enum_funcs(prop, get, set, "rna_asset_library_reference_itemf");
|
||||
|
||||
|
|
|
@ -107,16 +107,16 @@ static void rna_WorkSpace_owner_ids_clear(WorkSpace *workspace)
|
|||
WM_main_add_notifier(NC_OBJECT | ND_MODIFIER | NA_REMOVED, workspace);
|
||||
}
|
||||
|
||||
static int rna_WorkSpace_active_asset_library_get(PointerRNA *ptr)
|
||||
static int rna_WorkSpace_asset_library_get(PointerRNA *ptr)
|
||||
{
|
||||
const WorkSpace *workspace = ptr->data;
|
||||
return rna_asset_library_reference_get(&workspace->active_asset_library);
|
||||
return rna_asset_library_reference_get(&workspace->asset_library);
|
||||
}
|
||||
|
||||
static void rna_WorkSpace_active_asset_library_set(PointerRNA *ptr, int value)
|
||||
static void rna_WorkSpace_asset_library_set(PointerRNA *ptr, int value)
|
||||
{
|
||||
WorkSpace *workspace = ptr->data;
|
||||
rna_asset_library_reference_set(&workspace->active_asset_library, value);
|
||||
rna_asset_library_reference_set(&workspace->asset_library, value);
|
||||
}
|
||||
|
||||
static bToolRef *rna_WorkSpace_tools_from_tkey(WorkSpace *workspace,
|
||||
|
@ -420,7 +420,7 @@ static void rna_def_workspace(BlenderRNA *brna)
|
|||
RNA_def_property_update(prop, 0, "rna_window_update_all");
|
||||
|
||||
prop = rna_def_asset_library_reference_common(
|
||||
srna, "rna_WorkSpace_active_asset_library_get", "rna_WorkSpace_active_asset_library_set");
|
||||
srna, "rna_WorkSpace_asset_library_get", "rna_WorkSpace_asset_library_set");
|
||||
RNA_def_property_ui_text(prop,
|
||||
"Asset Library",
|
||||
"Active asset library to show in the UI, not used by the Asset Browser "
|
||||
|
|
Loading…
Reference in New Issue