12#include <fmt/format.h>
52#include "RNA_prototypes.hh"
93 ID *
id =
static_cast<ID *
>(ptr.data);
107 const char *msg_single =
N_(
108 "Data-block does not support asset operations - must be a "
109 "Brush, Collection, Node Group, Object, Pose Action, Scene, or World");
110 const char *msg_multiple =
N_(
111 "No data-block selected that supports asset operations - select at least one "
112 "Brush, Collection, Node Group, Object, Pose Action, Scene, or World");
113 return is_single ? msg_single : msg_multiple;
128 int tot_already_asset = 0;
129 ID *last_id =
nullptr;
140 ID *
id =
static_cast<ID *
>(ptr.data);
141 if (
id->asset_data) {
142 stats.tot_already_asset++;
157 return stats.tot_created > 0;
164 if (stats.tot_already_asset > 0) {
167 "Selected data-blocks are already assets (or do not support use as assets)");
172 "No data-blocks to create assets for found (or do not support use as assets)");
176 else if (stats.tot_created == 1) {
178 BKE_reportf(&reports,
RPT_INFO,
"Data-block '%s' is now an asset", stats.last_id->name + 2);
190 mark_helper(*
C, ids);
217 ot->
name =
"Mark as Asset";
219 "Enable easier reuse of selected data-blocks through the Asset Browser, with the help of "
220 "customizable metadata (like previews, descriptions and tags)";
221 ot->
idname =
"ASSET_OT_mark";
238 ot->
name =
"Mark as Single Asset";
240 "Enable easier reuse of a data-block through the Asset Browser, with the help of "
241 "customizable metadata (like previews, descriptions and tags)";
242 ot->
idname =
"ASSET_OT_mark_single";
257 const bool set_fake_user_;
270 ID *last_id =
nullptr;
281 ID *
id =
static_cast<ID *
>(ptr.data);
282 if (!
id->asset_data) {
290 if (set_fake_user_) {
309 "No asset data-blocks from the current file selected (assets must be stored in "
310 "the current file to be able to edit or clear them)");
316 else if (stats.tot_cleared == 1) {
319 &reports,
RPT_INFO,
"Data-block '%s' is not an asset anymore", stats.last_id->name + 2);
322 BKE_reportf(&reports,
RPT_INFO,
"%i data-blocks are not assets anymore", stats.tot_cleared);
328 return stats.tot_cleared > 0;
355 const char *msg_single =
N_(
"Data-block is not marked as asset");
356 const char *msg_multiple =
N_(
"No data-block selected that is marked as asset");
373 if (!set_fake_user) {
377 "Delete all asset metadata, turning the selected asset data-blocks back into normal "
378 "data-blocks, and set Fake User to ensure the data-blocks will still be saved");
386 ot->
name =
"Clear Asset";
388 "Delete all asset metadata and turn the selected asset data-blocks back into normal "
391 ot->
idname =
"ASSET_OT_clear";
406 "Ensure the data-block is saved, even when it is no longer marked as asset");
411 ot->
name =
"Clear Single Asset";
413 "Delete all asset metadata and turn the asset data-block back into a normal data-block";
415 ot->
idname =
"ASSET_OT_clear_single";
430 "Ensure the data-block is saved, even when it is no longer marked as asset");
480 const std::optional<AssetLibraryReference> library_ref = asset_lib->
library_reference();
485 return {{asset_lib, *library_ref}};
498 return {{asset_lib, *library_ref}};
512 if (!asset_lib_and_ref ||
516 op->
reports,
RPT_ERROR,
"This asset library does not have a remote listing to download");
521 asset_lib_and_ref->library->force_remote_listing_download();
534 if (!asset_lib_and_ref ||
555 ot->
name =
"Reload Remote Asset Library Listing";
557 "Re-download the asset listing of a remote library. Only supported when the active "
558 "asset library is remote or has a remote component (the Essentials library)";
559 ot->
idname =
"ASSET_OT_library_reload_listing";
593 return "Re-download the asset listing of a remote library. Only supported when the active "
594 "asset library is remote or has a remote component (the Essentials library)";
598 return "Reread assets and asset catalogs from the asset library on disk.\n"
599 "Shift-click: re-download the asset listing of a remote library";
608 ot->
name =
"Refresh Asset Library";
609 ot->
description =
"Reread assets and asset catalogs from the asset library on disk";
610 ot->
idname =
"ASSET_OT_library_refresh";
621 "use_remote_listing",
624 "Re-download the asset listing of a remote library. Only supported when the active asset "
625 "library is remote or has a remote component (the Essentials library)");
629 "use_shift_for_remote_listing",
631 "Use Shift for Remote Listing",
632 "When this operator is invoked and the Shift key is pressed, download "
633 "the remote asset library listing");
646 if (!asset_library) {
663 asset_library,
DATA_(
"Catalog"), parent_path);
678 ot->
name =
"New Asset Catalog";
679 ot->
description =
"Create a new catalog to put assets in";
680 ot->
idname =
"ASSET_OT_catalog_new";
691 "Optional path defining the location to put the new catalog under");
715 ot->
name =
"Delete Asset Catalog";
717 "Remove an asset catalog from the asset library (contained assets will not be affected and "
718 "show up as unassigned)";
719 ot->
idname =
"ASSET_OT_catalog_delete";
725 RNA_def_string(ot->
srna,
"catalog_id",
nullptr, 0,
"Catalog ID",
"ID of the catalog to delete");
746 if (!catalog_service) {
750 catalog_service->
undo();
764 ot->
name =
"Undo Catalog Edits";
765 ot->
description =
"Undo the last edit to the asset catalogs";
766 ot->
idname =
"ASSET_OT_catalog_undo";
776 if (!catalog_service) {
780 catalog_service->
redo();
794 ot->
name =
"Redo Catalog Edits";
795 ot->
description =
"Redo the last undone edit to the asset catalogs";
796 ot->
idname =
"ASSET_OT_catalog_redo";
806 if (!catalog_service) {
822 ot->
name =
"Store undo snapshot for asset catalog edits";
823 ot->
description =
"Store the current state of the asset catalogs in the undo buffer";
824 ot->
idname =
"ASSET_OT_catalog_undo_push";
872 ot->
name =
"Save Asset Catalogs";
874 "Make any edits to any catalogs permanent by writing the current set up to the asset "
876 ot->
idname =
"ASSET_OT_catalogs_save";
895 if (sfile ==
nullptr) {
946 const size_t len = strlen(filepath);
977 return operator_result;
981 BLI_assert_msg(lib,
"If the asset library is not known, how did we get here?");
984 R
"(Saved "%s" to asset library "%s")",
1008 ot->
name =
"Copy to Asset Library";
1010 "Copy the current .blend file into an Asset Library. Only works on standalone .blend files "
1011 "(i.e. when no other files are referenced)";
1012 ot->
idname =
"ASSET_OT_bundle_install";
1038 return fnmatch(
"*_bundle.blend", bmain->
filepath, FNM_CASEFOLD) == 0;
1043 const int enum_value =
RNA_enum_get(op->
ptr,
"asset_library_reference");
1067 if (lib ==
nullptr) {
1073 if (blend_filename ==
nullptr || blend_filename[0] ==
'\0') {
1092 const char *path_src)
1134 "Unable to copy bundle due to external dependency: \"%s\"",
1143 "Unable to copy bundle due to %zu external dependencies; more details on the console",
1145 printf(
"Unable to copy bundle due to %zu external dependencies:\n",
1148 printf(
" \"%s\"\n", path.c_str());
1174 std::swap(p1.x, p2.x);
1177 std::swap(p1.y, p2.y);
1185 return {
clamp_i(point.x, 0, win_size.x - 1),
clamp_i(point.y, 0, win_size.y - 1)};
1193 const int2 delta = p2 - p1;
1196 const int dir_x = (delta.x >= 0) ? 1 : -1;
1197 const int dir_y = (delta.y >= 0) ? 1 : -1;
1199 const int size_x = std::abs(delta.x);
1200 const int size_y = std::abs(delta.y);
1201 int square_size = std::max(size_x, size_y);
1205 const int max_size_x = (dir_x > 0) ? win_size.x - p1.x - 1 : p1.x;
1206 const int max_size_y = (dir_y > 0) ? win_size.y - p1.y - 1 : p1.y;
1209 square_size = std::min({square_size, max_size_x, max_size_y});
1212 p2.x = p1.x + dir_x * square_size;
1213 p2.y = p1.y + dir_y * square_size;
1223 int width = image_buffer->
x;
1224 int height = image_buffer->
y;
1234 if (max_size == 0) {
1242 if (image_buffer->
x > image_buffer->
y) {
1244 height = image_buffer->
y * (width /
float(image_buffer->
x));
1246 else if (image_buffer->
y > image_buffer->
x) {
1248 width = image_buffer->
x * (height /
float(image_buffer->
y));
1251 width = height = max_size;
1257 MEM_dupalloc(scaled_imbuf->
byte_data()));
1271 int dumprect_size[2];
1276 rcti safe_rect = crop_rect;
1284 MEM_delete(dumprect);
1295 return image_buffer;
1318 constexpr int min_side = 16;
1319 if (p2.x - p1.x < min_side || p2.y - p1.y < min_side) {
1321 op->
reports,
RPT_ERROR,
"Screenshot cannot be smaller than %i pixels on a side", min_side);
1325 ImBuf *image_buffer;
1333 bool render_offscreen =
false;
1339 const char *engine_name = scene->
r.
engine;
1340 render_offscreen =
STR_ELEM(engine_name,
1346 render_offscreen =
true;
1349 if (render_offscreen) {
1357 char err_out[256] =
"unknown";
1384 const rcti crop_rect = {p1.x, p2.x + 1, p1.y, p2.y + 1};
1386 if (!image_buffer) {
1393 BLI_assert_msg(asset_handle !=
nullptr,
"This is ensured by poll");
1398 *bmain, asset_handle->
get_id_type(), asset_reference);
1399 if (
id ==
nullptr) {
1437 if (
data->force_square) {
1444 const rctf screenshot_rect = {
1448 float4 mask_color = {1, 1, 1, 0.25};
1450 const rctf mask_rect_bottom = {0,
float(win_size.x), 0, screenshot_rect.
ymin};
1452 const rctf mask_rect_top = {0,
float(win_size.x), screenshot_rect.
ymax,
float(win_size.y)};
1454 const rctf mask_rect_left = {
1455 0, screenshot_rect.
xmin, screenshot_rect.
ymin, screenshot_rect.
ymax};
1457 const rctf mask_rect_right = {
1458 screenshot_rect.
xmax,
float(win_size.x), screenshot_rect.
ymin, screenshot_rect.
ymax};
1489 const int2 screen_space_cursor = {
1493 switch (event->
type) {
1495 switch (event->
val) {
1497 data->is_mouse_down =
true;
1498 data->crossed_threshold =
false;
1499 data->drag_start = screen_space_cursor;
1502 data->is_mouse_down =
false;
1528 switch (event->
val) {
1530 data->shift_area =
true;
1533 data->shift_area =
false;
1544 switch (event->
val) {
1546 data->force_square =
false;
1549 data->force_square =
true;
1559 if (
data->shift_area) {
1560 const int2 delta = screen_space_cursor -
data->last_cursor;
1561 const int2 new_p1 =
data->p1 + delta;
1562 const int2 new_p2 =
data->p2 + delta;
1564 auto is_within_window = [win](
const int2 &pt) ->
bool {
1566 return pt.x >= 0 && pt.x < win_size.x && pt.y >= 0 && pt.y < win_size.y;
1570 if (is_within_window(new_p1) && is_within_window(new_p2)) {
1575 else if (
data->is_mouse_down) {
1578 if (!
data->crossed_threshold) {
1583 data->crossed_threshold =
true;
1588 if (
data->crossed_threshold) {
1594 data->last_cursor = screen_space_cursor;
1603 if (
data->is_mouse_down) {
1604 status.
item(
IFACE_(
"Cancel"), ICON_EVENT_ESC, ICON_MOUSE_RMB);
1607 status.
item(
IFACE_(
"Start"), ICON_MOUSE_LMB_DRAG);
1609 status.
item(
IFACE_(
"Confirm"), ICON_MOUSE_LMB, ICON_EVENT_RETURN);
1610 status.
item(
IFACE_(
"Move"), ICON_EVENT_SPACEKEY);
1611 status.
item(
IFACE_(
"Unlock Aspect Ratio"), ICON_EVENT_SHIFT);
1626 data->is_mouse_down =
false;
1630 data->shift_area =
false;
1631 data->crossed_threshold =
false;
1647 if (!asset_handle) {
1666 ot->
name =
"Capture Screenshot Preview";
1667 ot->
description =
"Capture a screenshot to use as a preview for the selected asset";
1668 ot->
idname =
"ASSET_OT_screenshot_preview";
1682 "First point of the screenshot in screenspace",
1692 "Second point of the screenshot in screenspace",
1699 "If enabled, the screenshot will have the same height as width");
1721 assets.
append(active_asset);
1731 C,
"Internet access is disabled (can be enabled in the Preferences, System tab)");
1756 const bool has_downloadable_asset = [&]() {
1758 if (
asset->needs_download()) {
1765 if (!has_downloadable_asset) {
1778 if (
asset->needs_download()) {
1789 ot->
name =
"Download Assets";
1790 ot->
description =
"Download the selected asset(s)";
1791 ot->
idname =
"ASSET_OT_assets_download";
1806 const std::string asset_relpath =
RNA_string_get(op->
ptr,
"relative_asset_identifier");
1809 "Asset could not be found (relative identifier: '%s')",
1810 asset_relpath.c_str());
1814 if (!
asset->needs_download()) {
1831 ot->
name =
"Download Asset";
1832 ot->
description =
"Make the asset available without internet access";
1833 ot->
idname =
"ASSET_OT_asset_download";
1847 if (!asset_handle) {
1873 *bmain,
asset->get_id_type(), asset_reference);
1874 if (asset_id ==
nullptr) {
1880 if (!user_asset_lib) {
1892 std::optional<AssetLibraryReference> asset_lib_ref =
1893 asset->owner_asset_library().library_reference();
1894 if (asset_lib_ref) {
1916 ot->
name =
"Rename Asset";
1918 "Change the name of this asset. Note that this cannot be un-done via the undo system";
1919 ot->
idname =
"ASSET_OT_external_asset_rename";
Main runtime representation of an asset.
#define ICON_RENDER_DEFAULT_HEIGHT
#define BLI_path_join(...)
#define PREVIEW_RENDER_LARGE_HEIGHT
#define ND_ASSET_LIST_READING
#define ND_SPACE_ASSET_PARAMS
#define ND_ASSET_CATALOGS
#define BLI_assert_unreachable()
#define BLI_assert_msg(a, msg)
constexpr int64_t size() const
void append(const T &value)
IndexRange index_range() const
void item(std::string text, int icon1, int icon2=0)
bool is_undo_possbile() const
void prepare_to_merge_on_write()
bool is_redo_possbile() const
const CatalogID catalog_id
AssetCatalogService & catalog_service() const
virtual std::optional< AssetLibraryReference > library_reference() const =0
bool is_potentially_editable_asset_blend() const
ID_Type get_id_type() const
AssetWeakReference make_weak_reference() const
void reportResults(const bContext *C, ReportList &reports) const
void operator()(Span< PointerRNA > ids)
AssetClearHelper(const bool set_fake_user)
bool wasSuccessful() const
bool wasSuccessful() const
void operator()(const bContext &C, Span< PointerRNA > ids)
void reportResults(ReportList &reports) const
ccl_device_inline dual1 len(const ccl_private dual< T > &a)
bool is_or_contains_remote_libraries(const AssetLibraryReference &reference)
void remote_library_request_asset_download(const bContext &C, const AssetRepresentation &asset, ReportList *reports)
ID * asset_edit_id_from_weak_reference(Main &global_main, ID_Type id_type, const AssetWeakReference &weak_ref)
bool asset_edit_id_save(Main &global_main, ID &id, ReportList &reports)
bool asset_edit_id_rename(Main &global_main, ID &id, StringRefNull new_name, const bUserAssetLibrary &user_library, ReportList &reports)
bool asset_edit_id_is_writable(const ID &id)
void storage_tag_main_data_dirty()
bool has_asset_browser_storage_for_library(const AssetLibraryReference *library_reference, const bContext *C)
asset_system::AssetLibrary * library_get_once_available(const AssetLibraryReference &library_reference)
void clear(const AssetLibraryReference *library_reference, const bContext *C)
bool has_list_storage_for_library(const AssetLibraryReference *library_reference)
static bool asset_catalogs_save_poll(bContext *C)
static bool could_be_asset_bundle(const Main *bmain)
void catalog_remove(asset_system::AssetLibrary *library, const asset_system::CatalogID &catalog_id)
static void generate_previewimg_from_buffer(ID *id, const ImBuf *image_buffer)
bool catalogs_read_only(const asset_system::AssetLibrary &library)
static bool asset_catalog_undo_push_poll(bContext *C)
static std::optional< AssetLibraryAndRef > asset_library_from_context(bContext *C)
static bool external_file_check_callback(BPathForeachPathData *bpath_data, char *, size_t, const char *path_src)
static void ASSET_OT_clear(wmOperatorType *ot)
static wmOperatorStatus asset_catalogs_save_exec(bContext *C, wmOperator *)
void catalogs_save_from_main_path(asset_system::AssetLibrary *library, const Main *bmain)
static void ASSET_OT_catalog_redo(wmOperatorType *ot)
static bool external_asset_rename_poll(bContext *C)
AssetLibraryReference library_reference_from_enum_value(int value)
static std::string asset_clear_get_description(bContext *, wmOperatorType *, PointerRNA *ptr)
static void ASSET_OT_catalog_new(wmOperatorType *ot)
static bool asset_catalog_redo_poll(bContext *C)
static void ASSET_OT_clear_single(wmOperatorType *ot)
static void ASSET_OT_catalog_delete(wmOperatorType *ot)
static bool assets_download_poll(bContext *C)
static wmOperatorStatus asset_bundle_install_invoke(bContext *C, wmOperator *op, const wmEvent *)
static IDVecStats asset_operation_get_id_vec_stats_from_ids(const Span< PointerRNA > id_pointers)
asset_system::AssetCatalog * catalog_add(asset_system::AssetLibrary *library, StringRefNull name, StringRef parent_path=nullptr)
static void ASSET_OT_mark_single(wmOperatorType *ot)
static bool is_contained_in_selected_asset_library(wmOperator *op, const char *filepath)
static wmOperatorStatus asset_library_refresh_exec(bContext *C, wmOperator *op)
void operator_asset_reference_props_register(StructRNA &srna)
static wmOperatorStatus asset_library_reload_listing_exec(bContext *C, wmOperator *op)
static bool asset_clear_poll(bContext *C, const Span< PointerRNA > ids)
static int2 clamp_point_to_window(const int2 &point, const wmWindow *window)
static wmOperatorStatus asset_catalog_new_exec(bContext *C, wmOperator *op)
static bool asset_bundle_install_poll(bContext *C)
static wmOperatorStatus asset_download_exec(bContext *C, wmOperator *op)
void operatortypes_asset()
static wmOperatorStatus asset_library_refresh_invoke(bContext *C, wmOperator *op, const wmEvent *event)
static void screenshot_preview_draw(const wmWindow *window, void *operator_data)
const EnumPropertyItem * custom_libraries_rna_enum_itemf()
static void ASSET_OT_catalog_undo_push(wmOperatorType *ot)
static bool set_filepath_for_asset_lib(const Main *bmain, wmOperator *op)
static wmOperatorStatus screenshot_preview_exec(bContext *C, wmOperator *op)
static void ASSET_OT_assets_download(wmOperatorType *ot)
static wmOperatorStatus asset_catalog_redo_exec(bContext *C, wmOperator *)
static ImBuf * take_screenshot_crop(bContext *C, const rcti &crop_rect)
static wmOperatorStatus external_asset_rename_invoke(bContext *C, wmOperator *op, const wmEvent *)
static wmOperatorStatus screenshot_preview_modal(bContext *C, wmOperator *op, const wmEvent *event)
static void ASSET_OT_external_asset_rename(wmOperatorType *ot)
void generate_preview(const bContext *C, ID *id)
static Vector< const asset_system::AssetRepresentation * > selected_or_active_assets(const bContext *C)
constexpr int DRAG_THRESHOLD
static void ASSET_OT_bundle_install(wmOperatorType *ot)
static bool screenshot_preview_poll(bContext *C)
static const char * asset_operation_unsupported_type_msg(const bool is_single)
static bool asset_catalog_undo_poll(bContext *C)
const asset_system::AssetRepresentation * operator_asset_reference_props_get_asset_from_all_library(const bContext &C, PointerRNA &ptr, ReportList *reports)
static void screenshot_preview_exit(bContext *C, wmOperator *op)
static bool asset_mark_poll(bContext *C, const Span< PointerRNA > ids)
static void ASSET_OT_mark(wmOperatorType *ot)
static wmOperatorStatus asset_catalog_delete_exec(bContext *C, wmOperator *op)
static void ASSET_OT_catalog_undo(wmOperatorType *ot)
void refresh_asset_library_from_asset(const bContext *C, const asset_system::AssetRepresentation &asset)
static std::string asset_library_refresh_get_description(bContext *, wmOperatorType *ot, PointerRNA *ptr)
static bool asset_library_refresh_poll(bContext *C)
static asset_system::AssetCatalogService * get_catalog_service(bContext *C)
static void ASSET_OT_screenshot_preview(wmOperatorType *ot)
static void sort_points(int2 &p1, int2 &p2)
static wmOperatorStatus external_asset_rename_exec(bContext *C, wmOperator *op)
static wmOperatorStatus asset_catalog_undo_exec(bContext *C, wmOperator *)
static void do_asset_library_refresh(bContext *C)
static wmOperatorStatus screenshot_preview_invoke(bContext *C, wmOperator *op, const wmEvent *)
static void square_points_clamp_to_window(const int2 &p1, int2 &p2, const wmWindow *window)
static const bUserAssetLibrary * selected_asset_library(wmOperator *op)
static wmOperatorStatus asset_clear_exec(const bContext *C, const wmOperator *op, const Span< PointerRNA > ids)
static wmOperatorStatus asset_bundle_install_exec(bContext *C, wmOperator *op)
static wmOperatorStatus assets_download_exec(bContext *C, wmOperator *op)
static void screenshot_area_transfer_to_rna(wmOperator *op, ScreenshotOperatorData *data)
static bool assets_download_any_poll(bContext *C)
static void ASSET_OT_asset_download(wmOperatorType *ot)
static wmOperatorStatus asset_mark_exec(const bContext *C, const wmOperator *op, const Span< PointerRNA > ids)
static void ASSET_OT_library_refresh(wmOperatorType *ot)
bool id_type_is_supported(const ID *id)
static bool asset_library_reload_listing_poll(bContext *C)
static void ASSET_OT_catalogs_save(wmOperatorType *ot)
static bool has_external_files(Main *bmain, ReportList *reports)
static wmOperatorStatus asset_catalog_undo_push_exec(bContext *C, wmOperator *)
static void ASSET_OT_library_reload_listing(wmOperatorType *ot)
static const EnumPropertyItem * rna_asset_library_reference_itemf(bContext *, PointerRNA *, PropertyRNA *, bool *r_free)
static bool asset_catalog_operator_poll(bContext *C)
void get_color_4fv(int colorid, float col[4])
void draw_roundbox_aa(const rctf *rect, bool filled, float rad, const float color[4])
void WM_main_add_notifier(uint type, void *reference)
bool BLI_rcti_is_valid(const struct rcti *rect)
BLI_assert(slot->slot_subtype.map==BMO_OP_SLOT_SUBTYPE_MAP_FLT)
void WM_operatortype_append(void(*opfunc)(wmOperatorType *))
void RNA_def_enum_funcs(PropertyRNA *prop, EnumPropertyItemFunc itemfunc)
Vector< PointerRNA > CTX_data_collection_get(const bContext *C, const char *member)
ImBuf * ED_view3d_draw_offscreen_imbuf(Depsgraph *depsgraph, Scene *scene, eDrawType drawtype, View3D *v3d, ARegion *region, int sizex, int sizey, ImBufFlags imbuf_flag, int alpha_mode, const char *viewname, bool restore_rv3d_mats, GPUOffScreen *ofs, GPUViewport *viewport, bool use_camera_view_bounds, char err_out[256])
int RNA_enum_get(PointerRNA *ptr, const char *name)
void ED_preview_kill_jobs_for_id(wmWindowManager *wm, const ID *id)
PropertyRNA * RNA_def_string(StructOrFunctionRNA *cont_, const char *identifier, const char *default_value, const int maxlen, const char *ui_name, const char *ui_description)
void BKE_previewimg_clear(PreviewImage *prv)
void WM_event_add_notifier_ex(wmWindowManager *wm, const wmWindow *win, uint type, void *reference)
void RNA_def_property_enum_default(PropertyRNA *prop, int value)
class asset_system::AssetRepresentation * CTX_wm_asset(const bContext *C)
void RNA_string_set(PointerRNA *ptr, const char *name, const char *value)
void BKE_bpath_foreach_path_main(BPathForeachPathData *bpath_data)
void WM_cursor_modal_set(wmWindow *win, int val)
struct bUserAssetLibrary * BKE_preferences_asset_library_find_index(const struct UserDef *userdef, int index) ATTR_NONNULL() ATTR_WARN_UNUSED_RESULT
wmWindow * CTX_wm_window(const bContext *C)
bool AS_asset_library_has_any_unsaved_catalogs()
uint8_t * WM_window_pixels_read(bContext *C, wmWindow *win, int r_size[2])
MINLINE int max_ii(int a, int b)
bool ED_operator_asset_browsing_active(bContext *C)
void id_fake_user_set(ID *id)
const char * RE_engine_id_BLENDER_WORKBENCH
void WM_operator_properties_filesel(wmOperatorType *ot, const int filter, const short type, const eFileSel_Action action, const eFileSel_Flag flag, const short display, const short sort)
void IMB_crop(ImBuf *ibuf, const int2 &rect_pos, const int2 &rect_size)
Vector< PointerRNA > ED_operator_get_ids_from_context_as_vec(const bContext *C)
void ED_fileselect_activate_asset_catalog(const SpaceFile *sfile, bUUID catalog_id)
const char * RE_engine_id_BLENDER_EEVEE
VecBase< float, 4 > float4
void WM_draw_cb_exit(wmWindow *win, void *handle)
PropertyRNA * RNA_def_property(StructOrFunctionRNA *cont_, const char *identifier_c_str, int type, int subtype)
void void void const char * BLI_path_basename(const char *path) ATTR_NONNULL(1) ATTR_WARN_UNUSED_RESULT
BLI_INLINE int BLI_rcti_size_y(const struct rcti *rct)
void RNA_int_set_array(PointerRNA *ptr, const char *name, const int *values)
void CTX_wm_operator_poll_msg_set(bContext *C, const char *msg)
void IMB_freeImBuf(ImBuf *ibuf)
VecBase< int32_t, 2 > int2
void * MEM_new_zeroed(size_t len, const char *str) ATTR_WARN_UNUSED_RESULT ATTR_ALLOC_SIZE(1) ATTR_NONNULL(2)
void BKE_report(ReportList *reports, eReportType type, const char *message)
BMesh const char void * data
void RNA_int_get_array(PointerRNA *ptr, const char *name, int *values)
wmWindowManager * CTX_wm_manager(const bContext *C)
Depsgraph * CTX_data_ensure_evaluated_depsgraph(const bContext *C, bool rna_write_check=false)
PreviewImage * BKE_previewimg_id_ensure(ID *id)
void WM_cursor_modal_restore(wmWindow *win)
wmOperatorStatus WM_operator_props_dialog_popup(bContext *C, wmOperator *op, int width, std::optional< std::string > title, std::optional< std::string > confirm_text, const bool cancel_default, std::optional< std::string > message, const bool show_icon)
wmOperatorStatus WM_operator_name_call(bContext *C, const char *opstring, wm::OpCallContext context, PointerRNA *properties, const wmEvent *event)
bool RNA_boolean_get(PointerRNA *ptr, const char *name)
BLI_INLINE int BLI_rcti_size_x(const struct rcti *rct)
void WM_event_add_notifier(const bContext *C, uint type, void *reference)
void RNA_boolean_set(PointerRNA *ptr, const char *name, bool value)
bool RNA_struct_is_ID(const StructRNA *type)
ImBuf * IMB_allocImBuf(unsigned int x, unsigned int y, ImBufFlags flags)
bool ED_fileselect_is_file_browser(const SpaceFile *sfile)
ScrArea * ED_area_find_under_cursor(const bContext *C, int spacetype, const int event_xy[2])
ARegion * BKE_area_find_region_type(const ScrArea *area, int region_type)
@ BKE_BPATH_FOREACH_PATH_SKIP_PACKED
@ BKE_BPATH_FOREACH_PATH_SKIP_MULTIFILE
@ BKE_BPATH_TRAVERSE_SKIP_WEAK_REFERENCES
wmEventHandler_Op * WM_event_add_modal_handler(bContext *C, wmOperator *op)
bool BLI_uuid_parse_string(bUUID *uuid, const char *buffer) ATTR_NONNULL()
void RNA_def_property_flag(PropertyRNA *prop, PropertyFlag flag)
void BKE_reportf(ReportList *reports, eReportType type, const char *format,...) ATTR_PRINTF_FORMAT(3
bool WM_operator_winactive(bContext *C)
Main * CTX_data_main(const bContext *C)
int2 WM_window_native_pixel_size(const wmWindow *win)
asset_system::AssetLibrary * ED_fileselect_active_asset_library_get(const SpaceFile *sfile)
bool BLI_path_contains(const char *container_path, const char *containee_path) ATTR_NONNULL(1
PropertyRNA * RNA_def_int_array(StructOrFunctionRNA *cont_, const char *identifier, const int len, const int *default_value, const int hardmin, const int hardmax, const char *ui_name, const char *ui_description, const int softmin, const int softmax)
void BKE_previewimg_ensure(PreviewImage *prv, int size)
SpaceFile * CTX_wm_space_file(const bContext *C)
Scene * CTX_data_scene(const bContext *C)
bScreen * CTX_wm_screen(const bContext *C)
std::string RNA_string_get(PointerRNA *ptr, const char *name)
const char * RE_engine_id_BLENDER_EEVEE_NEXT
void * WM_draw_cb_activate(wmWindow *win, void(*draw)(const wmWindow *win, void *customdata), void *customdata)
PropertyRNA * RNA_def_boolean(StructOrFunctionRNA *cont_, const char *identifier, const bool default_value, const char *ui_name, const char *ui_description)
bool ED_fileselect_is_local_asset_library(const SpaceFile *sfile)
ImBuf * IMB_scale_into_new(const ImBuf *ibuf, int2 new_size, IMBScaleFilter filter, bool threaded=true)
void WM_cursor_wait(bool val)
MINLINE int min_ii(int a, int b)
MINLINE int clamp_i(int value, int min, int max)
Vector< PointerRNA > ED_operator_single_id_from_context_as_vec(const bContext *C)
ARegion * CTX_wm_region(const bContext *C)
void ED_workspace_status_text(bContext *C, const char *str)
void WM_event_add_fileselect(bContext *C, wmOperator *op)
struct bUserAssetLibrary * BKE_preferences_asset_library_containing_path(const struct UserDef *userdef, const char *path) ATTR_NONNULL() ATTR_WARN_UNUSED_RESULT
const AssetLibraryReference * CTX_wm_asset_library_ref(const bContext *C)
KERNEL_FEATURE_LIGHT_PASSES KERNEL_FEATURE_PATH_GUIDING float
const uint8_t * byte_data() const
void assign_byte_data(uint8_t *data)
ListBaseT< SpaceLink > spacedata
char resolved_dirpath[1024]
AssetLibraryReference reference
const asset_system::AssetLibrary * library
Set< std::string > external_files
wmEventModifierFlag modifier
wmOperatorStatus(*) exec(bContext *C, wmOperator *op) ATTR_WARN_UNUSED_RESULT
bool(*) poll(bContext *C) ATTR_WARN_UNUSED_RESULT
wmOperatorStatus(*) invoke(bContext *C, wmOperator *op, const wmEvent *event) ATTR_WARN_UNUSED_RESULT
wmOperatorStatus(*) modal(bContext *C, wmOperator *op, const wmEvent *event) ATTR_WARN_UNUSED_RESULT
std::string(*) get_description(bContext *C, wmOperatorType *ot, PointerRNA *ptr)
struct ReportList * reports