Blender
V3.3
|
Public Member Functions | |
AssetCatalogDropController (AssetCatalogTreeView &tree_view, AssetCatalogTreeItem &catalog_item) | |
bool | can_drop (const wmDrag &drag, const char **r_disabled_hint) const override |
std::string | drop_tooltip (const wmDrag &drag) const override |
bool | on_drop (struct bContext *C, const wmDrag &drag) override |
::AssetLibrary & | get_asset_library () const |
![]() | |
virtual | ~AbstractViewItemDropController ()=default |
AbstractViewItemDropController (AbstractView &view) | |
template<class ViewType > | |
ViewType & | get_view () const |
Static Public Member Functions | |
static AssetCatalog * | get_drag_catalog (const wmDrag &drag, const ::AssetLibrary &asset_library) |
static bool | has_droppable_asset (const wmDrag &drag, const char **r_disabled_hint) |
static bool | drop_assets_into_catalog (struct bContext *C, const AssetCatalogTreeView &tree_view, const wmDrag &drag, CatalogID catalog_id, StringRefNull simple_name="") |
static bool | drop_asset_catalog_into_catalog (const wmDrag &drag, AssetCatalogTreeView &tree_view, const std::optional< CatalogID > drop_catalog_id=std::nullopt) |
Additional Inherited Members | |
![]() | |
AbstractView & | view_ |
Definition at line 106 of file asset_catalog_tree_view.cc.
blender::ed::asset_browser::AssetCatalogDropController::AssetCatalogDropController | ( | AssetCatalogTreeView & | tree_view, |
AssetCatalogTreeItem & | catalog_item | ||
) |
Definition at line 352 of file asset_catalog_tree_view.cc.
|
overridevirtual |
Check if the data dragged with drag can be dropped on the item this controller is for.
r_disabled_hint | Return a static string to display to the user, explaining why dropping isn't possible on this item. Shouldn't be done too aggressively, e.g. don't set this if the drag-type can't be dropped here; only if it can but there's another reason it can't be dropped. Can assume this is a non-null pointer. |
Implements blender::ui::AbstractViewItemDropController.
Definition at line 358 of file asset_catalog_tree_view.cc.
References blender::bke::AssetCatalogTreeItem::catalog_path(), get_asset_library(), get_drag_catalog(), has_droppable_asset(), blender::bke::AssetCatalogPath::is_contained_in(), blender::bke::AssetCatalogPath::parent(), blender::bke::AssetCatalog::path, wmDrag::type, WM_DRAG_ASSET_CATALOG, and WM_DRAG_ASSET_LIST.
|
static |
drop_catalog_id | Can be unset to drop into the root level of the tree. |
Definition at line 434 of file asset_catalog_tree_view.cc.
References blender::ed::asset_browser::AssetCatalogTreeView::activate_catalog_by_id(), BLI_assert, wmDragAssetCatalog::drag_catalog_id, ED_asset_catalog_move(), NC_ASSET, ND_ASSET_CATALOGS, wmDrag::type, WM_DRAG_ASSET_CATALOG, WM_drag_get_asset_catalog_data(), and WM_main_add_notifier().
Referenced by on_drop().
|
static |
Definition at line 448 of file asset_catalog_tree_view.cc.
References BKE_asset_metadata_catalog_id_set(), BLI_assert, C, blender::StringRefNull::c_str(), ED_undo_push(), FILE_SEL_HIGHLIGHTED, FILE_SEL_SELECTED, file_select_deselect_all(), filelist_tag_needs_filtering(), SpaceFile::files, LISTBASE_FOREACH, NC_SPACE, ND_SPACE_FILE_LIST, wmDrag::type, WM_DRAG_ASSET_LIST, WM_drag_asset_list_get(), and WM_main_add_notifier().
Referenced by on_drop().
|
overridevirtual |
Custom text to display when dragging over a view item. Should explain what happens when dropping the data onto this item. Will only be used if #AbstractViewItem::can_drop() returns true, so the implementing override doesn't have to check that again. The returned value must be a translated string.
Implements blender::ui::AbstractViewItemDropController.
Definition at line 381 of file asset_catalog_tree_view.cc.
References wmDrag::type, and WM_DRAG_ASSET_CATALOG.
AssetLibrary & blender::ed::asset_browser::AssetCatalogDropController::get_asset_library | ( | ) | const |
Definition at line 513 of file asset_catalog_tree_view.cc.
Referenced by can_drop().
|
static |
Definition at line 483 of file asset_catalog_tree_view.cc.
References BKE_asset_library_get_catalog_service(), wmDragAssetCatalog::drag_catalog_id, blender::bke::AssetCatalogService::find_catalog(), wmDrag::type, WM_DRAG_ASSET_CATALOG, and WM_drag_get_asset_catalog_data().
Referenced by can_drop().
|
static |
Definition at line 496 of file asset_catalog_tree_view.cc.
References LISTBASE_FOREACH, TIP_, and WM_drag_asset_list_get().
Referenced by can_drop().
|
overridevirtual |
Execute the logic to apply a drop of the data dragged with drag onto/into the item this controller is for.
Implements blender::ui::AbstractViewItemDropController.
Definition at line 421 of file asset_catalog_tree_view.cc.
References C, drop_asset_catalog_into_catalog(), drop_assets_into_catalog(), blender::bke::AssetCatalogTreeItem::get_catalog_id(), blender::bke::AssetCatalogTreeItem::get_simple_name(), wmDrag::type, and WM_DRAG_ASSET_CATALOG.