|
Blender V4.3
|
Inherits blender::ui::TreeViewItemDropTarget.
Public Member Functions | |
| AssetCatalogDropTarget (AssetCatalogTreeViewItem &item, const AssetCatalogTreeItem &catalog_item) | |
| bool | can_drop (const wmDrag &drag, const char **r_disabled_hint) const override |
| std::string | drop_tooltip (const ui::DragInfo &drag_info) const override |
| bool | on_drop (bContext *C, const ui::DragInfo &drag_info) const override |
| asset_system::AssetLibrary & | get_asset_library () const |
Public Member Functions inherited from blender::ui::TreeViewItemDropTarget | |
| TreeViewItemDropTarget (AbstractTreeViewItem &view_item, DropBehavior behavior=DropBehavior::Insert) | |
| std::optional< DropLocation > | choose_drop_location (const ARegion ®ion, const wmEvent &event) const override |
| template<class ViewType > | |
| ViewType & | get_view () const |
Public Member Functions inherited from blender::ui::DropTargetInterface | |
| DropTargetInterface ()=default | |
| virtual | ~DropTargetInterface ()=default |
Static Public Member Functions | |
| static AssetCatalog * | get_drag_catalog (const wmDrag &drag, const asset_system::AssetLibrary &asset_library) |
| static bool | has_droppable_asset (const wmDrag &drag, const char **r_disabled_hint) |
| static bool | can_modify_catalogs (const asset_system::AssetLibrary &asset_library, const char **r_disabled_hint) |
| static bool | drop_assets_into_catalog (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 | |
Protected Attributes inherited from blender::ui::TreeViewItemDropTarget | |
| AbstractTreeViewItem & | view_item_ |
| const DropBehavior | behavior_ |
Definition at line 109 of file asset_catalog_tree_view.cc.
| blender::ed::asset_browser::AssetCatalogDropTarget::AssetCatalogDropTarget | ( | AssetCatalogTreeViewItem & | item, |
| const AssetCatalogTreeItem & | catalog_item ) |
Definition at line 361 of file asset_catalog_tree_view.cc.
|
overridevirtual |
Check if the data dragged with drag can be dropped on the element this drop target is for.
| r_disabled_hint | Return a static string to display to the user, explaining why dropping isn't possible on this UI element. 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::DropTargetInterface.
Definition at line 367 of file asset_catalog_tree_view.cc.
References can_modify_catalogs(), blender::asset_system::AssetCatalogTreeItem::catalog_path(), get_asset_library(), get_drag_catalog(), has_droppable_asset(), blender::asset_system::AssetCatalogPath::is_contained_in(), blender::asset_system::AssetCatalogPath::parent(), blender::asset_system::AssetCatalog::path, RPT_, wmDrag::type, WM_DRAG_ASSET_CATALOG, and WM_DRAG_ASSET_LIST.
|
static |
Definition at line 528 of file asset_catalog_tree_view.cc.
References blender::ed::asset::catalogs_read_only(), and RPT_.
Referenced by can_drop().
|
static |
| drop_catalog_id | Can be unset to drop into the root level of the tree. |
Definition at line 450 of file asset_catalog_tree_view.cc.
References blender::ed::asset_browser::AssetCatalogTreeView::activate_catalog_by_id(), BLI_assert, blender::ed::asset::catalog_move(), wmDragAssetCatalog::drag_catalog_id, 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 464 of file asset_catalog_tree_view.cc.
References BKE_asset_metadata_catalog_id_set(), BLI_assert, 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_ASSET, NC_SPACE, ND_ASSET_CATALOGS, 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 the element using this drop target. Should explain what happens when dropping the data onto this UI element. Will only be used if #DropTargetInterface::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::DropTargetInterface.
Definition at line 396 of file asset_catalog_tree_view.cc.
References blender::ui::DragInfo::drag_data, wmDrag::type, and WM_DRAG_ASSET_CATALOG.
| asset_system::AssetLibrary & blender::ed::asset_browser::AssetCatalogDropTarget::get_asset_library | ( | ) | const |
Definition at line 538 of file asset_catalog_tree_view.cc.
References blender::ui::TreeViewItemDropTarget::get_view().
Referenced by can_drop().
|
static |
Definition at line 500 of file asset_catalog_tree_view.cc.
References blender::asset_system::AssetLibrary::catalog_service(), wmDragAssetCatalog::drag_catalog_id, blender::asset_system::AssetCatalogService::find_catalog(), wmDrag::type, WM_DRAG_ASSET_CATALOG, and WM_drag_get_asset_catalog_data().
Referenced by can_drop().
|
static |
Definition at line 512 of file asset_catalog_tree_view.cc.
References LISTBASE_FOREACH, RPT_, 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 UI element this drop target is for.
Implements blender::ui::DropTargetInterface.
Definition at line 436 of file asset_catalog_tree_view.cc.
References blender::ui::DragInfo::drag_data, drop_asset_catalog_into_catalog(), drop_assets_into_catalog(), blender::asset_system::AssetCatalogTreeItem::get_catalog_id(), blender::asset_system::AssetCatalogTreeItem::get_simple_name(), blender::ui::TreeViewItemDropTarget::get_view(), wmDrag::type, and WM_DRAG_ASSET_CATALOG.