RNA/BPY: Replace `asset_library_ref` with `asset_library_reference`

This is a compatibility breaking change to rename all usages of the name
`asset_library_ref` with `asset_library_reference`. Brecht recently
suggested that such abbreviations should be avoided in public API names.
This commit is contained in:
Julian Eisel 2023-09-19 16:27:07 +02:00
parent ca58f97cda
commit 974d70918b
8 changed files with 14 additions and 14 deletions

View File

@ -24,7 +24,7 @@ class FILEBROWSER_HT_header(Header):
layout.separator_spacer()
if params.asset_library_ref not in {'LOCAL', 'ESSENTIALS'}:
if params.asset_library_reference not in {'LOCAL', 'ESSENTIALS'}:
layout.prop(params, "import_type", text="")
layout.separator_spacer()

View File

@ -1484,7 +1484,7 @@ bool CTX_data_editable_gpencil_strokes(const bContext *C, ListBase *list)
const AssetLibraryReference *CTX_wm_asset_library_ref(const bContext *C)
{
return static_cast<AssetLibraryReference *>(ctx_data_pointer_get(C, "asset_library_ref"));
return static_cast<AssetLibraryReference *>(ctx_data_pointer_get(C, "asset_library_reference"));
}
static AssetHandle ctx_wm_asset_handle(const bContext *C, bool *r_is_valid)

View File

@ -817,7 +817,7 @@ static void ASSET_OT_bundle_install(wmOperatorType *ot)
ot->invoke = asset_bundle_install_invoke;
ot->poll = asset_bundle_install_poll;
ot->prop = RNA_def_property(ot->srna, "asset_library_ref", PROP_ENUM, PROP_NONE);
ot->prop = RNA_def_property(ot->srna, "asset_library_reference", PROP_ENUM, PROP_NONE);
RNA_def_property_flag(ot->prop, PROP_HIDDEN);
RNA_def_enum_funcs(ot->prop, rna_asset_library_reference_itemf);
@ -840,7 +840,7 @@ static bool could_be_asset_bundle(const Main *bmain)
static const bUserAssetLibrary *selected_asset_library(wmOperator *op)
{
const int enum_value = RNA_enum_get(op->ptr, "asset_library_ref");
const int enum_value = RNA_enum_get(op->ptr, "asset_library_reference");
const AssetLibraryReference lib_ref = ED_asset_library_reference_from_enum_value(enum_value);
const bUserAssetLibrary *lib = BKE_preferences_asset_library_find_index(
&U, lib_ref.custom_library_index);
@ -857,7 +857,7 @@ static bool is_contained_in_selected_asset_library(wmOperator *op, const char *f
}
/**
* Set the "filepath" RNA property based on selected "asset_library_ref".
* Set the "filepath" RNA property based on selected "asset_library_reference".
* \return true if ok, false if error.
*/
static bool set_filepath_for_asset_lib(const Main *bmain, wmOperator *op)

View File

@ -508,7 +508,7 @@ int ED_asset_shelf_context(const bContext *C, const char *member, bContextDataRe
{
static const char *context_dir[] = {
"asset_shelf",
"asset_library_ref",
"asset_library_reference",
"active_file", /* XXX yuk... */
nullptr,
};
@ -544,7 +544,7 @@ int ED_asset_shelf_context(const bContext *C, const char *member, bContextDataRe
return CTX_RESULT_OK;
}
if (CTX_data_equals(member, "asset_library_ref")) {
if (CTX_data_equals(member, "asset_library_reference")) {
CTX_data_pointer_set(result,
&screen->id,
&RNA_AssetLibraryReference,

View File

@ -114,7 +114,7 @@ const char *screen_context_dir[] = {
"selected_editable_keyframes",
"ui_list",
"property",
"asset_library_ref",
"asset_library_reference",
nullptr,
};
@ -1380,7 +1380,7 @@ static void ensure_ed_screen_context_functions()
register_context_function("selected_visible_fcurves", screen_ctx_selected_visible_fcurves);
register_context_function("active_editable_fcurve", screen_ctx_active_editable_fcurve);
register_context_function("selected_editable_keyframes", screen_ctx_selected_editable_keyframes);
register_context_function("asset_library_ref", screen_ctx_asset_library);
register_context_function("asset_library_reference", screen_ctx_asset_library);
register_context_function("ui_list", screen_ctx_ui_list);
register_context_function("property", screen_ctx_property);
}

View File

@ -19,7 +19,7 @@
const char *file_context_dir[] = {
"active_file",
"selected_files",
"asset_library_ref",
"asset_library_reference",
"selected_assets",
"id",
"selected_ids",
@ -69,7 +69,7 @@ int /*eContextResult*/ file_context(const bContext *C,
return CTX_RESULT_OK;
}
if (CTX_data_equals(member, "asset_library_ref")) {
if (CTX_data_equals(member, "asset_library_reference")) {
FileAssetSelectParams *asset_params = ED_fileselect_get_asset_params(sfile);
if (!asset_params) {
return CTX_RESULT_NO_DATA;

View File

@ -234,7 +234,7 @@ static void file_panel_asset_catalog_buttons_draw(const bContext *C, Panel *pane
PointerRNA params_ptr = RNA_pointer_create(&screen->id, &RNA_FileAssetSelectParams, params);
uiItemR(row, &params_ptr, "asset_library_ref", UI_ITEM_NONE, "", ICON_NONE);
uiItemR(row, &params_ptr, "asset_library_reference", UI_ITEM_NONE, "", ICON_NONE);
if (params->asset_library_ref.type == ASSET_LIBRARY_LOCAL) {
bContext *mutable_ctx = CTX_copy(C);
if (WM_operator_name_poll(mutable_ctx, "asset.bundle_install")) {
@ -242,7 +242,7 @@ static void file_panel_asset_catalog_buttons_draw(const bContext *C, Panel *pane
uiItemMenuEnumO(col,
C,
"asset.bundle_install",
"asset_library_ref",
"asset_library_reference",
"Copy Bundle to Asset Library...",
ICON_IMPORT);
}

View File

@ -675,7 +675,7 @@ PropertyRNA *rna_def_asset_library_reference_common(StructRNA *srna,
const char *get,
const char *set)
{
PropertyRNA *prop = RNA_def_property(srna, "asset_library_ref", PROP_ENUM, PROP_NONE);
PropertyRNA *prop = RNA_def_property(srna, "asset_library_reference", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_items(prop, rna_enum_dummy_NULL_items);
RNA_def_property_enum_funcs(prop, get, set, "rna_asset_library_reference_itemf");