34 {int(wmOpCallContext::InvokeDefault),
"INVOKE_DEFAULT", 0,
"Invoke Default",
""},
35 {int(wmOpCallContext::InvokeRegionWin),
"INVOKE_REGION_WIN", 0,
"Invoke Region Window",
""},
36 {int(wmOpCallContext::InvokeRegionChannels),
"INVOKE_REGION_CHANNELS", 0,
"Invoke Region Channels",
""},
37 {int(wmOpCallContext::InvokeRegionPreview),
"INVOKE_REGION_PREVIEW", 0,
"Invoke Region Preview",
""},
38 {int(wmOpCallContext::InvokeArea),
"INVOKE_AREA", 0,
"Invoke Area",
""},
39 {int(wmOpCallContext::InvokeScreen),
"INVOKE_SCREEN", 0,
"Invoke Screen",
""},
40 {int(wmOpCallContext::ExecDefault),
"EXEC_DEFAULT", 0,
"Exec Default",
""},
41 {int(wmOpCallContext::ExecRegionWin),
"EXEC_REGION_WIN", 0,
"Exec Region Window",
""},
42 {int(wmOpCallContext::ExecRegionChannels),
"EXEC_REGION_CHANNELS", 0,
"Exec Region Channels",
""},
43 {int(wmOpCallContext::ExecRegionPreview),
"EXEC_REGION_PREVIEW", 0,
"Exec Region Preview",
""},
44 {int(wmOpCallContext::ExecArea),
"EXEC_AREA", 0,
"Exec Area",
""},
45 {int(wmOpCallContext::ExecScreen),
"EXEC_SCREEN", 0,
"Exec Screen",
""},
46 {0,
nullptr, 0,
nullptr,
nullptr},
53 {0,
nullptr, 0,
nullptr,
nullptr},
112 func = &rna_Panel_poll_func;
119 visible = *(
bool *)
ret;
135 func = &rna_Panel_draw_func;
153 func = &rna_Panel_draw_header_func;
162static void panel_draw_header_preset(
const bContext *
C,
Panel *panel)
164 extern FunctionRNA rna_Panel_draw_header_preset_func;
171 func = &rna_Panel_draw_header_preset_func;
180static void panel_type_clear_recursive(
Panel *panel,
const PanelType *type)
182 if (panel->
type == type) {
183 panel->
type =
nullptr;
187 panel_type_clear_recursive(child_panel, type);
191static bool rna_Panel_unregister(
Main *bmain,
StructRNA *type)
216 child_pt->
parent =
nullptr;
222 ListBase *regionbase = (sl == area->spacedata.first) ? &area->regionbase : &sl->regionbase;
225 panel_type_clear_recursive(panel, pt);
246 const char *identifier,
251 const char *error_prefix =
RPT_(
"Registering panel class:");
253 PanelType *pt, *parent =
nullptr, dummy_pt = {
nullptr};
254 Panel dummy_panel = {
nullptr};
255 bool have_function[4];
256 size_t over_alloc = 0;
258 size_t description_size = 0;
261 dummy_panel.
type = &dummy_pt;
262 _panel_descr[0] =
'\0';
270 if (validate(&dummy_panel_ptr,
data, have_function) != 0) {
274 if (strlen(identifier) >=
sizeof(dummy_pt.idname)) {
277 "%s '%s' is too long, maximum length is %d",
280 int(
sizeof(dummy_pt.idname)));
285 if (dummy_pt.category[0] ==
'\0') {
289 printf(
"%s '%s' misses category, please update the script\n", error_prefix, dummy_pt.idname);
294 if (dummy_pt.category[0] !=
'\0') {
298 "%s '%s' has category '%s'",
307 if (!(art = region_type_find(reports, dummy_pt.space_type, dummy_pt.region_type))) {
319 "%s '%s', bl_idname '%s' has been registered before, unregistering previous",
323 if (!rna_Panel_unregister(bmain, srna)) {
326 "%s '%s', bl_idname '%s' could not be unregistered",
337 if (dummy_pt.parent_id[0] && (parent ==
nullptr)) {
338 for (pt = pt_next; pt; pt = pt->
next) {
349 if (dummy_pt.parent_id[0] &&
STREQ(pt->
idname, dummy_pt.parent_id)) {
360 if (dummy_pt.parent_id[0] && !parent) {
363 "%s parent '%s' for '%s' not found",
371 if (_panel_descr[0]) {
372 description_size = strlen(_panel_descr) + 1;
373 over_alloc += description_size;
377 memcpy(pt, &dummy_pt,
sizeof(dummy_pt));
379 if (_panel_descr[0]) {
380 char *buf = (
char *)(pt + 1);
381 memcpy(buf, _panel_descr, description_size);
396 pt->
poll = (have_function[0]) ? panel_poll :
nullptr;
404 for (; pt_iter; pt_iter = pt_iter->
prev) {
420 for (; pt_child_iter; pt_child_iter = pt_child_iter->
prev) {
447 return (menu->type && menu->type->rna_ext.srna) ? menu->type->rna_ext.srna : &RNA_Panel;
466static int rna_UIList_filter_const_FILTER_ITEM_get(
PointerRNA * )
471static int rna_UIList_item_never_show(
PointerRNA * )
479 return &ui_list->properties;
482static void rna_UIList_list_id_get(
PointerRNA *
ptr,
char *value)
485 if (!ui_list->type) {
496 if (!ui_list->type) {
503static void uilist_draw_item(
uiList *ui_list,
510 const char *active_propname,
521 func = &rna_UIList_draw_item_func;
547 func = &rna_UIList_draw_filter_func;
557static void uilist_filter_items(
uiList *ui_list,
560 const char *propname)
569 int *filter_flags, *filter_neworder;
576 func = &rna_UIList_filter_items_func;
588 printf(
"%s: Error, py func returned %d items in %s, %d or none were expected.\n",
594 filter_flags =
nullptr;
598 filter_flags = (
int *)ret1;
604 printf(
"%s: Error, py func returned %d items in %s, %d or none were expected.\n",
610 filter_neworder =
nullptr;
614 filter_neworder = (
int *)ret2;
624 if (filter_neworder) {
628 int items_shown, shown_idx;
629 int t_idx, t_ni, prev_ni;
631 for (
i = 0, shown_idx = 0;
i <
len;
i++) {
633 filter_neworder[shown_idx++] = filter_neworder[
i];
641 for (shown_idx = 0, prev_ni = -1; shown_idx < items_shown; shown_idx++) {
642 for (
i = 0, t_ni =
len, t_idx = -1;
i < items_shown;
i++) {
643 int ni = filter_neworder[
i];
644 if (ni > prev_ni && ni < t_ni) {
658 for (
i = 0;
i <
len;
i++) {
668 if (filter_neworder) {
678static bool rna_UIList_unregister(
Main *bmain,
StructRNA *type)
699 const char *identifier,
704 const char *error_prefix =
"Registering uilist class:";
706 uiList dummy_uilist = {
nullptr};
707 bool have_function[3];
710 dummy_uilist.
type = &dummy_ult;
714 if (validate(&dummy_ul_ptr,
data, have_function) != 0) {
718 if (strlen(identifier) >=
sizeof(dummy_ult.
idname)) {
721 "%s '%s' is too long, maximum length is %d",
724 int(
sizeof(dummy_ult.
idname)));
733 "%s '%s', bl_idname '%s' has been registered before, unregistering previous",
739 if (!(srna && rna_UIList_unregister(bmain, srna))) {
742 "%s '%s', bl_idname '%s' %s",
746 srna ?
"is built-in" :
"could not be unregistered");
759 memcpy(ult, &dummy_ult,
sizeof(dummy_ult));
797 func = &rna_Header_draw_func;
831 const char *identifier,
836 const char *error_prefix =
"Registering header class:";
839 Header dummy_header = {
nullptr};
840 bool have_function[1];
843 dummy_header.
type = &dummy_ht;
848 if (validate(&dummy_header_ptr,
data, have_function) != 0) {
852 if (strlen(identifier) >=
sizeof(dummy_ht.
idname)) {
855 "%s '%s' is too long, maximum length is %d",
858 int(
sizeof(dummy_ht.
idname)));
872 "%s '%s', bl_idname '%s' has been registered before, unregistering previous",
878 if (!(srna && rna_Header_unregister(bmain, srna))) {
881 "%s '%s', bl_idname '%s' %s",
885 srna ?
"is built-in" :
"could not be unregistered");
899 memcpy(ht, &dummy_ht,
sizeof(dummy_ht));
907 ht->
draw = (have_function[0]) ? header_draw :
nullptr;
935 func = &rna_Menu_poll_func;
942 visible = *(
bool *)
ret;
958 func = &rna_Menu_draw_func;
988 const char *identifier,
993 const char *error_prefix =
"Registering menu class:";
995 Menu dummy_menu = {
nullptr};
996 bool have_function[2];
997 size_t over_alloc = 0;
998 size_t description_size = 0;
1002 dummy_menu.
type = &dummy_mt;
1003 _menu_descr[0] =
'\0';
1011 if (validate(&dummy_menu_ptr,
data, have_function) != 0) {
1015 if (strlen(identifier) >=
sizeof(dummy_mt.
idname)) {
1018 "%s '%s' is too long, maximum length is %d",
1021 int(
sizeof(dummy_mt.
idname)));
1030 "%s '%s', bl_idname '%s' has been registered before, unregistering previous",
1036 if (!(srna && rna_Menu_unregister(bmain, srna))) {
1039 "%s '%s', bl_idname '%s' %s",
1043 srna ?
"is built-in" :
"could not be unregistered");
1055 if (_menu_descr[0]) {
1056 description_size = strlen(_menu_descr) + 1;
1057 over_alloc += description_size;
1061 memcpy(mt, &dummy_mt,
sizeof(dummy_mt));
1063 if (_menu_descr[0]) {
1064 char *buf = (
char *)(mt + 1);
1065 memcpy(buf, _menu_descr, description_size);
1080 mt->
poll = (have_function[0]) ? menu_poll :
nullptr;
1081 mt->
draw = (have_function[1]) ? menu_draw :
nullptr;
1106static bool asset_shelf_asset_poll(
const AssetShelfType *shelf_type,
1109 extern FunctionRNA rna_AssetShelf_asset_poll_func;
1113 FunctionRNA *func = &rna_AssetShelf_asset_poll_func;
1123 const bool is_visible = *(
bool *)
ret;
1146 const bool is_visible = *(
bool *)
ret;
1155 extern FunctionRNA rna_AssetShelf_get_active_asset_func;
1160 FunctionRNA *func = &rna_AssetShelf_get_active_asset_func;
1173 return active_asset;
1176static void asset_shelf_draw_context_menu(
const bContext *
C,
1181 extern FunctionRNA rna_AssetShelf_draw_context_menu_func;
1186 FunctionRNA *func = &rna_AssetShelf_draw_context_menu_func;
1199static bool rna_AssetShelf_unregister(
Main *bmain,
StructRNA *type)
1223 const char *identifier,
1228 std::unique_ptr<AssetShelfType> shelf_type = std::make_unique<AssetShelfType>();
1232 dummy_shelf.
type = shelf_type.get();
1235 bool have_function[4];
1238 if (validate(&dummy_shelf_ptr,
data, have_function) != 0) {
1242 if (strlen(identifier) >=
sizeof(shelf_type->idname)) {
1245 "Registering asset shelf class: '%s' is too long, maximum length is %d",
1247 int(
sizeof(shelf_type->idname)));
1254 shelf_type->idname);
1255 if (existing_shelf_type && existing_shelf_type->
rna_ext.
srna) {
1258 "Registering asset shelf class: '%s' has been registered before, "
1259 "unregistering previous",
1260 shelf_type->idname);
1262 rna_AssetShelf_unregister(bmain, existing_shelf_type->
rna_ext.
srna);
1275 shelf_type->rna_ext.data =
data;
1276 shelf_type->rna_ext.call = call;
1277 shelf_type->rna_ext.free =
free;
1280 shelf_type->poll = have_function[0] ? asset_shelf_poll :
nullptr;
1281 shelf_type->asset_poll = have_function[1] ? asset_shelf_asset_poll :
nullptr;
1282 shelf_type->get_active_asset = have_function[2] ? asset_shelf_get_active_asset :
nullptr;
1283 shelf_type->draw_context_menu = have_function[3] ? asset_shelf_draw_context_menu :
nullptr;
1285 StructRNA *srna = shelf_type->rna_ext.srna;
1295static void rna_AssetShelf_activate_operator_get(
PointerRNA *
ptr,
char *value)
1301static int rna_AssetShelf_activate_operator_length(
PointerRNA *
ptr)
1307static void rna_AssetShelf_activate_operator_set(
PointerRNA *
ptr,
const char *value)
1313static void rna_AssetShelf_drag_operator_get(
PointerRNA *
ptr,
char *value)
1319static int rna_AssetShelf_drag_operator_length(
PointerRNA *
ptr)
1325static void rna_AssetShelf_drag_operator_set(
PointerRNA *
ptr,
const char *value)
1344static void rna_AssetShelf_asset_library_set(
PointerRNA *
ptr,
int value)
1360static void rna_Panel_bl_description_set(
PointerRNA *
ptr,
const char *value)
1363 char *
str = (
char *)
data->type->description;
1368 BLI_assert_msg(0,
"setting the bl_description on a non-builtin panel");
1372static void rna_Menu_bl_description_set(
PointerRNA *
ptr,
const char *value)
1375 char *
str = (
char *)
data->type->description;
1380 BLI_assert_msg(0,
"setting the bl_description on a non-builtin menu");
1391static void rna_UILayout_active_set(
PointerRNA *
ptr,
bool value)
1393 static_cast<uiLayout *
>(
ptr->data)->active_set(value);
1398 return static_cast<uiLayout *
>(
ptr->data)->active_default();
1401static void rna_UILayout_active_default_set(
PointerRNA *
ptr,
bool value)
1403 static_cast<uiLayout *
>(
ptr->data)->active_default_set(value);
1408 return static_cast<uiLayout *
>(
ptr->data)->activate_init();
1411static void rna_UILayout_activate_init_set(
PointerRNA *
ptr,
bool value)
1413 static_cast<uiLayout *
>(
ptr->data)->activate_init_set(value);
1418 return static_cast<uiLayout *
>(
ptr->data)->red_alert();
1421static void rna_UILayout_alert_set(
PointerRNA *
ptr,
bool value)
1423 static_cast<uiLayout *
>(
ptr->data)->red_alert_set(value);
1426static void rna_UILayout_op_context_set(
PointerRNA *
ptr,
int value)
1441static void rna_UILayout_enabled_set(
PointerRNA *
ptr,
bool value)
1443 static_cast<uiLayout *
>(
ptr->data)->enabled_set(value);
1449 return static_cast<uiLayout *
>(
ptr->data)->red_alert();
1452static void rna_UILayout_red_alert_set(
PointerRNA *
ptr,
bool value)
1454 static_cast<uiLayout *
>(
ptr->data)->red_alert_set(value);
1463static void rna_UILayout_alignment_set(
PointerRNA *
ptr,
int value)
1475 return static_cast<uiLayout *
>(
ptr->data)->scale_x();
1478static void rna_UILayout_scale_x_set(
PointerRNA *
ptr,
float value)
1480 static_cast<uiLayout *
>(
ptr->data)->scale_x_set(value);
1485 return static_cast<uiLayout *
>(
ptr->data)->scale_y();
1488static void rna_UILayout_scale_y_set(
PointerRNA *
ptr,
float value)
1490 static_cast<uiLayout *
>(
ptr->data)->scale_y_set(value);
1495 return static_cast<uiLayout *
>(
ptr->data)->ui_units_x();
1498static void rna_UILayout_units_x_set(
PointerRNA *
ptr,
float value)
1500 static_cast<uiLayout *
>(
ptr->data)->ui_units_x_set(value);
1505 return static_cast<uiLayout *
>(
ptr->data)->ui_units_y();
1508static void rna_UILayout_units_y_set(
PointerRNA *
ptr,
float value)
1510 static_cast<uiLayout *
>(
ptr->data)->ui_units_y_set(value);
1518static void rna_UILayout_emboss_set(
PointerRNA *
ptr,
int value)
1525 return static_cast<const uiLayout *
>(
ptr->data)->use_property_split();
1528static void rna_UILayout_property_split_set(
PointerRNA *
ptr,
bool value)
1530 static_cast<uiLayout *
>(
ptr->data)->use_property_split_set(value);
1533static bool rna_UILayout_property_decorate_get(
PointerRNA *
ptr)
1535 return static_cast<const uiLayout *
>(
ptr->data)->use_property_decorate();
1538static void rna_UILayout_property_decorate_set(
PointerRNA *
ptr,
bool value)
1540 static_cast<uiLayout *
>(
ptr->data)->use_property_decorate_set(value);
1545static bool file_handler_poll_drop(
const bContext *
C,
1548 extern FunctionRNA rna_FileHandler_poll_drop_func;
1551 nullptr, file_handler_type->
rna_ext.
srna,
nullptr);
1552 FunctionRNA *func = &rna_FileHandler_poll_drop_func;
1562 const bool is_usable = *(
bool *)
ret;
1569static bool rna_FileHandler_unregister(
Main * ,
StructRNA *type)
1575 if (!file_handler_type) {
1590 const char *identifier,
1599 dummy_file_handler.
type = &dummy_file_handler_type;
1603 nullptr, &RNA_FileHandler, &dummy_file_handler);
1605 bool have_function[1];
1608 if (validate(&dummy_file_handler_ptr,
data, have_function) != 0) {
1612 if (strlen(identifier) >=
sizeof(dummy_file_handler_type.
idname)) {
1615 "Registering file handler class: '%s' is too long, maximum length is %d",
1617 (
int)
sizeof(dummy_file_handler_type.
idname));
1623 if (registered_file_handler) {
1624 rna_FileHandler_unregister(bmain, registered_file_handler->rna_ext.srna);
1635 auto file_handler_type = std::make_unique<bke::FileHandlerType>();
1636 *file_handler_type = dummy_file_handler_type;
1645 file_handler_type->
poll_drop = have_function[0] ? file_handler_poll_drop :
nullptr;
1656 return (file_handler->type && file_handler->type->rna_ext.srna) ?
1657 file_handler->type->rna_ext.srna :
1673 {0,
nullptr, 0,
nullptr,
nullptr},
1679 {0,
nullptr, 0,
nullptr,
nullptr},
1687 "Draw standard button emboss style"},
1693 "Draw pull-down menu style"},
1699 "Draw with no emboss unless the button has a coloring status like an animation state"},
1700 {0,
nullptr, 0,
nullptr,
nullptr},
1714 prop,
"rna_UILayout_active_default_get",
"rna_UILayout_active_default_set");
1718 "When true, an operator button defined after this will be activated when pressing return"
1719 "(use with popup dialogs)");
1723 prop,
"rna_UILayout_activate_init_get",
"rna_UILayout_activate_init_set");
1727 "When true, buttons defined in popups will be activated on first display "
1728 "(use so you can type into a field without having to click on it first)");
1733 prop,
"rna_UILayout_op_context_get",
"rna_UILayout_op_context_set",
nullptr);
1736 "Typically set to 'INVOKE_REGION_WIN', except some cases "
1737 "in :class:`bpy.types.Menu` when it's set to 'EXEC_REGION_WIN'.");
1749 prop,
"rna_UILayout_alignment_get",
"rna_UILayout_alignment_set",
nullptr);
1758 prop,
"rna_UILayout_scale_x_get",
"rna_UILayout_scale_x_set",
nullptr);
1760 prop,
"Scale X",
"Scale factor along the X for items in this (sub)layout");
1764 prop,
"rna_UILayout_scale_y_get",
"rna_UILayout_scale_y_set",
nullptr);
1766 prop,
"Scale Y",
"Scale factor along the Y for items in this (sub)layout");
1770 prop,
"rna_UILayout_units_x_get",
"rna_UILayout_units_x_set",
nullptr);
1772 prop,
"Units X",
"Fixed size along the X for items in this (sub)layout");
1776 prop,
"rna_UILayout_units_y_get",
"rna_UILayout_units_y_set",
nullptr);
1778 prop,
"Units Y",
"Fixed size along the Y for items in this (sub)layout");
1787 prop,
"rna_UILayout_property_split_get",
"rna_UILayout_property_split_set");
1791 prop,
"rna_UILayout_property_decorate_get",
"rna_UILayout_property_decorate_set");
1806 "Defines if the panel has to be open or collapsed at the time of its creation"},
1811 "If set to False, the panel shows a header, which contains a clickable "
1812 "arrow to collapse the panel and the label (see bl_label)"},
1817 "Multiple panels with this type can be used as part of a list depending on data external "
1818 "to the UI. Used to create panels for the modifiers and other stacks."},
1820 "HEADER_LAYOUT_EXPAND",
1822 "Expand Header Layout",
1823 "Allow buttons in the header to stretch and shrink to fill the entire layout width"},
1824 {0,
nullptr, 0,
nullptr,
nullptr},
1838 func,
"If this method returns a non-null output, then the panel can be drawn");
1875 prop,
"rna_Panel_custom_data_get",
nullptr,
"rna_Panel_custom_data_typef",
nullptr);
1885 "If this is set, the panel gets a custom ID, otherwise it takes the "
1886 "name of the class used to define the panel. For example, if the "
1887 "class name is \"OBJECT_PT_hello\", and bl_idname is not set by the "
1888 "script, then bl_idname = \"OBJECT_PT_hello\".");
1895 "The panel label, shows up in the panel header at the right of the "
1896 "triangle used to collapse the panel");
1904 "Specific translation context, only define when the label needs to be "
1905 "disambiguated from others using the exact same label");
1922 prop,
"",
"The category (tab) in which the panel will be displayed, when applicable");
1940 prop,
"Region Type",
"The region where the panel is going to be used in");
1948 "The context in which the panel belongs to. (TODO: explain the "
1949 "possible combinations bl_context/bl_region_type/bl_space_type)");
1961 prop,
"Parent ID Name",
"If this is set, the panel becomes a sub-panel");
1974 "Panels with lower numbers are default ordered before panels with higher numbers");
2009 "If this is set, the uilist gets a custom ID, otherwise it takes the "
2010 "name of the class used to define the uilist (for example, if the "
2011 "class name is \"OBJECT_UL_vgroups\", and bl_idname is not set by the "
2012 "script, then bl_idname = \"OBJECT_UL_vgroups\")");
2020 prop,
"rna_UIList_list_id_get",
"rna_UIList_list_id_length",
nullptr);
2023 "Identifier of the list, if any was passed to the \"list_id\" "
2024 "parameter of \"template_list()\"");
2039 prop,
"Filter by Name",
"Only show items matching this name (use '*' as wildcard)");
2063 prop,
"Lock Order",
"Lock the order of shown items (user cannot change it)");
2069 "Draw an item in the list (NOTE: when you define your own draw_item "
2070 "function, you may want to check given 'item' is of the right type...)");
2074 parm =
RNA_def_pointer(func,
"layout",
"UILayout",
"",
"Layout to draw the item");
2077 func,
"data",
"AnyType",
"",
"Data from which to take Collection property");
2079 parm =
RNA_def_pointer(func,
"item",
"AnyType",
"",
"Item of the collection property");
2082 func,
"icon", 0, 0, INT_MAX,
"",
"Icon of the item in the collection", 0, INT_MAX);
2088 "Data from which to take property for the active element");
2095 "Identifier of property in active_data, for the active element");
2098 func,
"index", 0, 0, INT_MAX,
"",
"Index of the item in the collection", 0, INT_MAX);
2110 parm =
RNA_def_pointer(func,
"layout",
"UILayout",
"",
"Layout to draw the item");
2117 "Filter and/or re-order items of the collection (output filter results in "
2118 "filter_flags, and reorder results in filter_neworder arrays)");
2123 func,
"data",
"AnyType",
"",
"Data from which to take Collection property");
2126 func,
"property",
nullptr, 0,
"",
"Identifier of property in data, for the collection");
2133 "An array of filter flags, one for each item in the collection (NOTE: "
2134 "The upper 16 bits, including FILTER_ITEM, are reserved, only use the "
2135 "lower 16 bits for custom usages)");
2143 "An array of indices, one for each item in the collection, mapping the org "
2144 "index to the new one");
2154 "The value of the reserved bitflag 'FILTER_ITEM' (in filter_flags values)");
2198 "If this is set, the header gets a custom ID, otherwise it takes the "
2199 "name of the class used to define the header; for example, if the "
2200 "class name is \"OBJECT_HT_hello\", and bl_idname is not set by the "
2201 "script, then bl_idname = \"OBJECT_HT_hello\"");
2208 prop,
"Space Type",
"The space where the header is going to be used in");
2217 "The region where the header is going to be used in "
2218 "(defaults to header region)");
2232 "SEARCH_ON_KEY_PRESS",
2234 "Search on Key Press",
2235 "Open a menu search when a key pressed while the menu is open"},
2236 {0,
nullptr, 0,
nullptr,
nullptr},
2250 func,
"If this method returns a non-null output, then the menu can be drawn");
2276 "If this is set, the menu gets a custom ID, otherwise it takes the "
2277 "name of the class used to define the menu (for example, if the "
2278 "class name is \"OBJECT_MT_hello\", and bl_idname is not set by the "
2279 "script, then bl_idname = \"OBJECT_MT_hello\")");
2321 "No Asset Dragging",
2322 "Disable the default asset dragging on drag events. Useful for implementing custom "
2323 "dragging via custom key-map items."},
2327 "Visible by Default",
2328 "Unhide the asset shelf when it's available for the first time, otherwise it will be "
2331 "STORE_ENABLED_CATALOGS_IN_PREFERENCES",
2333 "Store Enabled Catalogs in Preferences",
2334 "Store the shelf's enabled catalogs in the preferences rather than the local asset shelf "
2337 "ACTIVATE_FOR_CONTEXT_MENU",
2340 "When spawning a context menu for an asset, activate the asset and call "
2341 "`bl_activate_operator` if present, rather than just highlighting the asset"},
2342 {0,
nullptr, 0,
nullptr,
nullptr},
2349 srna,
"rna_AssetShelf_register",
"rna_AssetShelf_unregister",
nullptr);
2360 "If this is set, the asset gets a custom ID, otherwise it takes the "
2361 "name of the class used to define the asset (for example, if the "
2362 "class name is \"OBJECT_AST_hello\", and bl_idname is not set by the "
2363 "script, then bl_idname = \"OBJECT_AST_hello\")");
2371 "The space where the asset shelf will show up in. Ignored for popup "
2372 "asset shelves which can be displayed in any space.");
2382 "rna_AssetShelf_activate_operator_get",
2383 "rna_AssetShelf_activate_operator_length",
2384 "rna_AssetShelf_activate_operator_set");
2388 "Activate Operator",
2389 "Operator to call when activating an item with asset reference properties");
2393 "rna_AssetShelf_drag_operator_get",
2394 "rna_AssetShelf_drag_operator_length",
2395 "rna_AssetShelf_drag_operator_set");
2400 "Operator to call when dragging an item with asset reference properties");
2407 prop,
"Default Preview Size",
"Default size of the asset preview thumbnails in pixels");
2414 func,
"If this method returns a non-null output, the asset shelf will be visible");
2423 "Determine if an asset should be visible in the asset shelf. If this method returns a "
2424 "non-null output, the asset will be visible.");
2433 "Return a reference to the asset that should be highlighted as active in the asset shelf");
2438 "AssetWeakReference",
2440 "The weak reference to the asset to be highlighted as active, or None");
2445 func,
"Draw UI elements into the context menu UI layout displayed on right click");
2455 srna,
"rna_AssetShelf_asset_library_get",
"rna_AssetShelf_asset_library_set");
2457 prop,
"Asset Library",
"Choose the asset library to display assets from");
2464 "Show the asset name together with the preview. Otherwise only the "
2465 "preview will be visible.");
2489 "File Handler Type",
2490 "Extends functionality to operators that manages files, such as adding "
2491 "drag and drop support");
2494 srna,
"rna_FileHandler_register",
"rna_FileHandler_unregister",
nullptr);
2507 "If this is set, the file handler gets a custom ID, otherwise it takes the "
2508 "name of the class used to define the file handler (for example, if the "
2509 "class name is \"OBJECT_FH_hello\", and bl_idname is not set by the "
2510 "script, then bl_idname = \"OBJECT_FH_hello\")");
2518 "Operator that can handle import for files with the extensions given in bl_file_extensions");
2525 "Operator that can handle export for files with the extensions given in bl_file_extensions");
2538 "Formatted string of file extensions supported by the file handler, each extension should "
2539 "start with a \".\" and be separated by \";\"."
2540 "\nFor Example: ``\".blend;.ble\"``");
2548 "If this method returns True, can be used to handle the drop of a drag-and-drop action");
bScreen * CTX_wm_screen(const bContext *C)
void BKE_reportf(ReportList *reports, eReportType type, const char *format,...) ATTR_PRINTF_FORMAT(3
void BKE_report(ReportList *reports, eReportType type, const char *message)
@ ASSET_SHELF_TYPE_FLAG_ACTIVATE_FOR_CONTEXT_MENU
@ ASSET_SHELF_TYPE_FLAG_NO_ASSET_DRAG
@ ASSET_SHELF_TYPE_FLAG_STORE_CATALOGS_IN_PREFS
@ ASSET_SHELF_TYPE_FLAG_DEFAULT_VISIBLE
#define ASSET_SHELF_PREVIEW_SIZE_DEFAULT
SpaceType * BKE_spacetype_from_id(int spaceid)
@ PANEL_TYPE_DEFAULT_CLOSED
@ PANEL_TYPE_HEADER_EXPAND
#define BLI_assert_msg(a, msg)
A dynamically sized string ADT.
void BLI_kdtree_nd_ free(KDTree *tree)
LinkData * BLI_genericNodeN(void *data)
#define LISTBASE_FOREACH(type, var, list)
void * BLI_findstring(const ListBase *listbase, const char *id, int offset) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1)
void BLI_freelinkN(ListBase *listbase, void *vlink) ATTR_NONNULL(1)
void void BLI_freelistN(ListBase *listbase) ATTR_NONNULL(1)
void BLI_addtail(ListBase *listbase, void *vlink) ATTR_NONNULL(1)
void BLI_insertlinkafter(ListBase *listbase, void *vprevlink, void *vnewlink) ATTR_NONNULL(1)
void * BLI_findptr(const struct ListBase *listbase, const void *ptr, int offset) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1)
char * STRNCPY(char(&dst)[N], const char *src)
char * BLI_strncpy_utf8(char *__restrict dst, const char *__restrict src, size_t dst_maxncpy) ATTR_NONNULL(1
#define BLT_I18NCONTEXT_DEFAULT_BPYRNA
@ LAYOUT_PANEL_STATE_FLAG_OPEN
@ UILST_FLT_ITEM_NEVER_SHOW
#define RGN_TYPE_HAS_CATEGORY_MASK
#define PNL_CATEGORY_FALLBACK
struct AssetRepresentationHandle AssetRepresentationHandle
Read Guarded memory(de)allocation.
static void panel_draw(const bContext *, Panel *panel)
#define RNA_DYN_DESCR_MAX
@ PARM_PYFUNC_REGISTER_OPTIONAL
@ STRUCT_NO_DATABLOCK_IDPROPERTIES
@ STRUCT_PUBLIC_NAMESPACE_INHERIT
int(*)(PointerRNA *ptr, void *data, bool *have_function) StructValidateFunc
int(*)(bContext *C, PointerRNA *ptr, FunctionRNA *func, ParameterList *list) StructCallbackFunc
void(*)(void *data) StructFreeFunc
void UI_panels_free_instanced(const bContext *C, ARegion *region)
bool UI_list_item_index_is_filtered_visible(const struct uiList *ui_list, int item_idx)
PointerRNA * UI_panel_custom_data_get(const Panel *panel)
#define ND_REGIONS_ASSET_SHELF
BMesh const char void * data
void * MEM_callocN(size_t len, const char *str)
void * MEM_malloc_arrayN(size_t len, size_t size, const char *str)
FileHandlerType * file_handler_find(StringRef idname)
void file_handler_add(std::unique_ptr< FileHandlerType > file_handler)
void file_handler_remove(FileHandlerType *file_handler)
AssetShelfType * type_find_from_idname(StringRef idname)
void type_unregister(const AssetShelfType &shelf_type)
void type_unlink(const Main &bmain, const AssetShelfType &shelf_type)
void type_register(std::unique_ptr< AssetShelfType > type)
int library_reference_to_enum_value(const AssetLibraryReference *library)
AssetLibraryReference library_reference_from_enum_value(int value)
void RNA_parameter_get(ParameterList *parms, PropertyRNA *parm, void **r_value)
int RNA_collection_length(PointerRNA *ptr, const char *name)
bool RNA_struct_available_or_report(ReportList *reports, const char *identifier)
void RNA_struct_blender_type_set(StructRNA *srna, void *blender_type)
void * RNA_struct_blender_type_get(StructRNA *srna)
void RNA_parameter_list_free(ParameterList *parms)
void RNA_parameter_set_lookup(ParameterList *parms, const char *identifier, const void *value)
const char * RNA_struct_state_owner_get()
int RNA_parameter_dynamic_length_get(ParameterList *parms, PropertyRNA *parm)
ParameterList * RNA_parameter_list_create(ParameterList *parms, PointerRNA *, FunctionRNA *func)
bool RNA_struct_bl_idname_ok_or_report(ReportList *reports, const char *identifier, const char *sep)
PointerRNA RNA_pointer_create_discrete(ID *id, StructRNA *type, void *data)
void RNA_parameter_get_lookup(ParameterList *parms, const char *identifier, void **r_value)
PropertyRNA * RNA_function_find_parameter(PointerRNA *, FunctionRNA *func, const char *identifier)
PropertyRNA * rna_def_asset_library_reference_common(StructRNA *srna, const char *get, const char *set)
void RNA_def_property_boolean_sdna(PropertyRNA *prop, const char *structname, const char *propname, int64_t booleanbit)
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 RNA_def_struct_refine_func(StructRNA *srna, const char *refine)
void RNA_def_property_pointer_sdna(PropertyRNA *prop, const char *structname, const char *propname)
void RNA_def_struct_system_idprops_func(StructRNA *srna, const char *system_idproperties)
void RNA_def_struct_flag(StructRNA *srna, int flag)
void RNA_def_property_string_funcs(PropertyRNA *prop, const char *get, const char *length, const char *set)
void RNA_def_function_return(FunctionRNA *func, PropertyRNA *ret)
void RNA_def_property_enum_default(PropertyRNA *prop, int value)
void RNA_def_property_float_funcs(PropertyRNA *prop, const char *get, const char *set, const char *range)
void RNA_define_verify_sdna(bool verify)
void RNA_def_property_ui_text(PropertyRNA *prop, const char *name, const char *description)
void RNA_def_property_string_sdna(PropertyRNA *prop, const char *structname, const char *propname)
void RNA_def_property_ui_icon(PropertyRNA *prop, int icon, int consecutive)
void RNA_def_struct_ui_text(StructRNA *srna, const char *name, const char *description)
void RNA_def_property_boolean_funcs(PropertyRNA *prop, const char *get, const char *set)
void RNA_def_struct_register_funcs(StructRNA *srna, const char *reg, const char *unreg, const char *instance)
void RNA_def_property_enum_items(PropertyRNA *prop, const EnumPropertyItem *item)
void RNA_def_struct_sdna(StructRNA *srna, const char *structname)
FunctionRNA * RNA_def_function(StructRNA *srna, const char *identifier, const char *call)
void RNA_def_property_array(PropertyRNA *prop, int length)
void RNA_def_property_range(PropertyRNA *prop, double min, double max)
PropertyRNA * RNA_def_pointer(StructOrFunctionRNA *cont_, const char *identifier, const char *type, const char *ui_name, const char *ui_description)
void RNA_def_property_string_maxlength(PropertyRNA *prop, int maxlength)
void RNA_def_property_struct_type(PropertyRNA *prop, const char *type)
void RNA_def_function_ui_description(FunctionRNA *func, const char *description)
void RNA_def_property_update(PropertyRNA *prop, int noteflag, const char *func)
PropertyRNA * RNA_def_property(StructOrFunctionRNA *cont_, const char *identifier, int type, int subtype)
void RNA_def_property_enum_funcs(PropertyRNA *prop, const char *get, const char *set, const char *item)
StructRNA * RNA_def_struct_ptr(BlenderRNA *brna, const char *identifier, StructRNA *srnafrom)
StructRNA * RNA_def_struct(BlenderRNA *brna, const char *identifier, const char *from)
void RNA_def_function_flag(FunctionRNA *func, int flag)
void RNA_def_property_clear_flag(PropertyRNA *prop, PropertyFlag flag)
void RNA_struct_free_extension(StructRNA *srna, ExtensionRNA *rna_ext)
void RNA_def_property_pointer_funcs(PropertyRNA *prop, const char *get, const char *set, const char *type_fn, const char *poll)
void RNA_def_property_enum_sdna(PropertyRNA *prop, const char *structname, const char *propname)
void RNA_def_property_int_funcs(PropertyRNA *prop, const char *get, const char *set, const char *range)
void RNA_def_property_string_default(PropertyRNA *prop, const char *value)
PropertyRNA * RNA_def_boolean(StructOrFunctionRNA *cont_, const char *identifier, const bool default_value, const char *ui_name, const char *ui_description)
void RNA_struct_free(BlenderRNA *brna, StructRNA *srna)
void RNA_def_function_output(FunctionRNA *, PropertyRNA *ret)
void RNA_def_property_flag(PropertyRNA *prop, PropertyFlag flag)
void RNA_def_property_int_sdna(PropertyRNA *prop, const char *structname, const char *propname)
void RNA_def_struct_translation_context(StructRNA *srna, const char *context)
void RNA_def_property_int_default_func(PropertyRNA *prop, const char *get_default)
PropertyRNA * RNA_def_int(StructOrFunctionRNA *cont_, const char *identifier, 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 RNA_def_parameter_flags(PropertyRNA *prop, PropertyFlag flag_property, ParameterFlag flag_parameter)
void RNA_api_ui_layout(StructRNA *srna)
const EnumPropertyItem rna_enum_region_type_items[]
const EnumPropertyItem rna_enum_space_type_items[]
const EnumPropertyItem rna_enum_operator_context_items[]
static void rna_def_header(BlenderRNA *brna)
const EnumPropertyItem rna_enum_uilist_layout_type_items[]
blender::wm::OpCallContext wmOpCallContext
static void rna_def_uilist(BlenderRNA *brna)
static void rna_def_asset_shelf(BlenderRNA *brna)
static void rna_def_ui_layout(BlenderRNA *brna)
static void rna_def_file_handler(BlenderRNA *brna)
static void rna_def_menu(BlenderRNA *brna)
static void rna_def_layout_panel_state(BlenderRNA *brna)
static void rna_def_panel(BlenderRNA *brna)
void RNA_def_ui(BlenderRNA *brna)
AssetLibraryReference asset_library_reference
short default_preview_size
std::string activate_operator
std::string drag_operator
struct AssetShelfType * type
AssetShelfSettings settings
FileHandlerTypeHandle * type
void(* draw)(const bContext *C, Panel *panel)
char idname[BKE_ST_MAXNAME]
bool(* poll)(const bContext *C, PanelType *pt)
char translation_context[BKE_ST_MAXNAME]
void(* draw_header_preset)(const bContext *C, Panel *panel)
void(* draw_header)(const bContext *C, Panel *panel)
char idname[OP_MAX_TYPENAME]
bool(* poll_drop)(const bContext *C, FileHandlerType *file_handle_type)
blender::ui::LayoutDirection local_direction() const
blender::wm::OpCallContext operator_context() const
blender::ui::LayoutAlign alignment() const
blender::ui::EmbossType emboss() const
int * items_filter_neworder
char idname[BKE_ST_MAXNAME]
uiListFilterItemsFunc filter_items
uiListDrawFilterFunc draw_filter
uiListDrawItemFunc draw_item
void WM_main_add_notifier(uint type, void *reference)
bool WM_paneltype_add(PanelType *pt)
void WM_paneltype_remove(PanelType *pt)
bool WM_uilisttype_add(uiListType *ult)
uiListType * WM_uilisttype_find(const StringRef idname, bool quiet)
const char * WM_uilisttype_list_id_get(const uiListType *ult, uiList *list)
void WM_uilisttype_remove_ptr(Main *bmain, uiListType *ult)