Blender V5.3
blender::AssetShelfType Struct Reference

#include <BKE_screen.hh>

Public Attributes

char idname [BKE_ST_MAXNAME]
int space_type
uint64_t id_types_prefilter
std::string activate_operator
std::string drag_operator
AssetShelfTypeFlag flag
short default_preview_size
bool(*) poll (const bContext *C, const AssetShelfType *shelf_type)
bool(*) asset_poll (const AssetShelfType *shelf_type, const asset_system::AssetRepresentation *asset)
void(*) draw_context_menu (const bContext *C, const AssetShelfType *shelf_type, const asset_system::AssetRepresentation *asset, ui::Layout &layout)
const AssetWeakReference *(*) get_active_asset (const AssetShelfType *shelf_type)
ExtensionRNA rna_ext

Detailed Description

Definition at line 837 of file BKE_screen.hh.

Member Data Documentation

◆ activate_operator

std::string blender::AssetShelfType::activate_operator

Operator to call when activating a grid view item.

Definition at line 855 of file BKE_screen.hh.

Referenced by blender::ed::asset::shelf::AssetViewItem::build_grid_tile(), and blender::ed::asset::shelf::AssetViewItem::on_activate().

◆ asset_poll

bool(*) blender::AssetShelfType::asset_poll(const AssetShelfType *shelf_type, const asset_system::AssetRepresentation *asset)

Determine if an individual asset should be visible or not. Don't use directly, use #ed::asset::shelf::type_asset_poll() (does additional pre-filtering based on the ID-type).

Definition at line 871 of file BKE_screen.hh.

Referenced by blender::ed::asset::shelf::type_asset_poll().

◆ default_preview_size

short blender::AssetShelfType::default_preview_size

Definition at line 861 of file BKE_screen.hh.

Referenced by blender::ed::asset::shelf::create_shelf_from_type().

◆ drag_operator

std::string blender::AssetShelfType::drag_operator

◆ draw_context_menu

void(*) blender::AssetShelfType::draw_context_menu(const bContext *C, const AssetShelfType *shelf_type, const asset_system::AssetRepresentation *asset, ui::Layout &layout)

Asset shelves can define their own context menu via this layout definition callback.

Definition at line 875 of file BKE_screen.hh.

Referenced by blender::ed::asset::shelf::AssetViewItem::build_context_menu().

◆ flag

AssetShelfTypeFlag blender::AssetShelfType::flag

Definition at line 859 of file BKE_screen.hh.

◆ get_active_asset

const AssetWeakReference *(*) blender::AssetShelfType::get_active_asset(const AssetShelfType *shelf_type)

◆ id_types_prefilter

uint64_t blender::AssetShelfType::id_types_prefilter

FILTER_ID_ bit-flags to pre-filter ID types to include in the asset shelf, as if asset_poll() returned false for non-matching IDs. If this isn't set (== 0), no pre-filtering will be done.

For bigger asset libraries, many assets can usually be excluded cheaply this way. Calling asset_poll() on many assets isn't cheap, so doing the ID type check only in there can cause performance issues.

Definition at line 852 of file BKE_screen.hh.

Referenced by blender::ed::asset::shelf::type_asset_poll().

◆ idname

char blender::AssetShelfType::idname[BKE_ST_MAXNAME]

◆ poll

bool(*) blender::AssetShelfType::poll(const bContext *C, const AssetShelfType *shelf_type)

Determine if asset shelves of this type should be available in current context or not.

Definition at line 864 of file BKE_screen.hh.

Referenced by blender::ed::asset::shelf::type_poll_no_spacetype_check().

◆ rna_ext

ExtensionRNA blender::AssetShelfType::rna_ext

RNA integration.

Definition at line 883 of file BKE_screen.hh.

◆ space_type

int blender::AssetShelfType::space_type

Definition at line 841 of file BKE_screen.hh.

Referenced by blender::ed::asset::shelf::type_poll_for_non_popup().


The documentation for this struct was generated from the following file: