Changeset View
Changeset View
Standalone View
Standalone View
source/blender/editors/space_file/file_panels.c
| Show All 35 Lines | |||||
| #include "MEM_guardedalloc.h" | #include "MEM_guardedalloc.h" | ||||
| #include "RNA_access.h" | #include "RNA_access.h" | ||||
| #include "RNA_define.h" | #include "RNA_define.h" | ||||
| #include "ED_fileselect.h" | #include "ED_fileselect.h" | ||||
| #include "UI_interface.h" | #include "UI_interface.h" | ||||
| #include "UI_interface_icons.h" | |||||
| #include "UI_resources.h" | #include "UI_resources.h" | ||||
| #include "WM_api.h" | #include "WM_api.h" | ||||
| #include "WM_types.h" | #include "WM_types.h" | ||||
| #include "file_intern.h" | #include "file_intern.h" | ||||
| #include "filelist.h" | #include "filelist.h" | ||||
| #include "fsmenu.h" | #include "fsmenu.h" | ||||
| ▲ Show 20 Lines • Show All 189 Lines • ▼ Show 20 Lines | static void file_panel_asset_catalog_buttons_draw(const bContext *C, Panel *panel) | ||||
| uiLayout *col = uiLayoutColumn(panel->layout, false); | uiLayout *col = uiLayoutColumn(panel->layout, false); | ||||
| uiLayout *row = uiLayoutRow(col, true); | uiLayout *row = uiLayoutRow(col, true); | ||||
| PointerRNA params_ptr; | PointerRNA params_ptr; | ||||
| RNA_pointer_create(&screen->id, &RNA_FileAssetSelectParams, params, ¶ms_ptr); | RNA_pointer_create(&screen->id, &RNA_FileAssetSelectParams, params, ¶ms_ptr); | ||||
| uiItemR(row, ¶ms_ptr, "asset_library_ref", 0, "", ICON_NONE); | uiItemR(row, ¶ms_ptr, "asset_library_ref", 0, "", ICON_NONE); | ||||
| if (params->asset_library_ref.type != ASSET_LIBRARY_LOCAL) { | if (params->asset_library_ref.type == ASSET_LIBRARY_LOCAL) { | ||||
| uiItemO(row, "", ICON_FILE_REFRESH, "FILE_OT_asset_library_refresh"); | bContext *mutable_ctx = CTX_copy(C); | ||||
| if (WM_operator_name_poll(mutable_ctx, "asset.bundle_install")) { | |||||
| uiItemS(col); | |||||
| uiItemMenuEnumO(col, | |||||
| mutable_ctx, | |||||
| "asset.bundle_install", | |||||
| "asset_library_ref", | |||||
| "Copy Bundle to Asset Library...", | |||||
| ICON_IMPORT); | |||||
| } | |||||
| CTX_free(mutable_ctx); | |||||
| } | |||||
| else { | |||||
| uiItemO(row, "", ICON_FILE_REFRESH, "ASSET_OT_library_refresh"); | |||||
| } | } | ||||
| uiItemS(col); | uiItemS(col); | ||||
| file_create_asset_catalog_tree_view_in_layout(asset_library, col, sfile, params); | file_create_asset_catalog_tree_view_in_layout(asset_library, col, sfile, params); | ||||
| } | } | ||||
| void file_tools_region_panels_register(ARegionType *art) | void file_tools_region_panels_register(ARegionType *art) | ||||
| Show All 12 Lines | |||||