41#include "RNA_prototypes.hh"
53#define USE_KEYMAP_ADD_HACK
68 if (!final_data_path.has_value()) {
73 IDProperty *prop = bke::idprop::create_group(__func__).release();
74 IDP_AddToGroup(prop, bke::idprop::create(
"data_path", final_data_path.value()).release());
95 if (*r_prop ==
nullptr) {
98 return "WM_OT_context_toggle";
103 if (*r_prop ==
nullptr) {
106 return "WM_OT_context_menu_enum";
111 IDProperty *prop = bke::idprop::create_group(__func__).release();
112 IDP_AddToGroup(prop, bke::idprop::create(
"name", mt->idname).release());
114 return "WM_OT_call_menu";
119 IDP_AddToGroup(prop, bke::idprop::create(
"name", *asset_shelf_idname).release());
121 return "WM_OT_call_asset_shelf_popover";
126 IDP_AddToGroup(prop, bke::idprop::create(
"name", pt->idname).release());
128 return "WM_OT_call_panel";
148 if (idname ==
nullptr) {
182 U.runtime.is_dirty =
true;
214#ifdef USE_KEYMAP_ADD_HACK
235 const int kmi_id = kmi->
id;
242 U.runtime.is_dirty =
true;
269#ifdef USE_KEYMAP_ADD_HACK
283#ifdef USE_KEYMAP_ADD_HACK
288 int kmi_id = WM_key_event_operator_id(C, idname, but->
opcontext, prop,
true, &km);
313 U.runtime.is_dirty =
true;
328 if (data_path.has_value()) {
356 if (
UNLIKELY(!member_id_data_path.has_value())) {
366 &um->
items, member_id_data_path->c_str(), prop_id.c_str(), but->
rnaindex);
396 if (drawstr[0] ==
'\0') {
403 const char *expr_imports[] = {
"bpy",
"bl_ui",
nullptr};
406 "bl_ui.space_toolsystem_common.item_from_id("
408 "bpy.context.space_data.type, "
411 char *expr_result =
nullptr;
413 drawstr = expr_result;
442 if (!member_id_data_path.has_value()) {
453 &um->
items,
"", member_id_data_path->c_str(), prop_id.c_str(), but->
rnaindex);
576 const bool is_array_component = (is_array && but->
rnaindex != -1);
577 const bool is_whole_array = (is_array && but->
rnaindex == -1);
590 if (is_array_component) {
594 "ANIM_OT_keyframe_insert_button",
600 "ANIM_OT_keyframe_insert_button",
606 "ANIM_OT_keyframe_delete_button",
612 "ANIM_OT_keyframe_delete_button",
620 "ANIM_OT_keyframe_insert_button",
626 "ANIM_OT_keyframe_delete_button",
638 if (is_array_component) {
642 "ANIM_OT_keyframe_insert_button",
648 "ANIM_OT_keyframe_insert_button",
656 "ANIM_OT_keyframe_insert_button",
663 if (is_array_component) {
667 "ANIM_OT_keyframe_clear_button",
673 "ANIM_OT_keyframe_clear_button",
681 "ANIM_OT_keyframe_clear_button",
689 if (is_array_component) {
735 if (is_array_component) {
739 "ANIM_OT_driver_button_remove",
745 "ANIM_OT_driver_button_remove",
753 "ANIM_OT_driver_button_remove",
758 if (is_whole_array) {
762 "UI_OT_copy_driver_to_selected_button",
770 "ANIM_OT_copy_driver_button");
775 "ANIM_OT_paste_driver_button");
780 "UI_OT_copy_driver_to_selected_button",
783 if (is_array_component) {
788 "UI_OT_copy_driver_to_selected_button",
796 "ANIM_OT_driver_button_edit");
802 "SCREEN_OT_drivers_editor_show");
813 "ANIM_OT_driver_button_add");
815 if (!is_whole_array) {
820 "ANIM_OT_paste_driver_button");
827 "SCREEN_OT_drivers_editor_show");
835 if (is_array_component) {
839 "ANIM_OT_keyingset_button_add",
845 "ANIM_OT_keyingset_button_add",
851 "ANIM_OT_keyingset_button_remove");
857 "ANIM_OT_keyingset_button_add",
863 "ANIM_OT_keyingset_button_remove");
867 if (is_overridable) {
874 if (is_array_component) {
882 "Single Override Type",
893 "UI_OT_override_remove_button",
899 "UI_OT_override_remove_button",
906 "UI_OT_override_type_set_button",
918 "UI_OT_override_remove_button",
924 if (is_array_component) {
947 "UI_OT_override_type_set_button",
966 if (is_array_component) {
970 "UI_OT_reset_default_button",
976 "UI_OT_reset_default_button",
984 "UI_OT_reset_default_button",
993 "UI_OT_assign_default_button");
998 if (is_array_component) {
1002 "UI_OT_copy_to_selected_button",
1008 "UI_OT_copy_to_selected_button",
1016 "UI_OT_copy_to_selected_button",
1024 "UI_OT_copy_data_path_button");
1028 "UI_OT_copy_data_path_button",
1038 "UI_OT_copy_as_driver_button");
1084 if (view_item_but) {
1106 if (asset::can_mark_single_from_context(C)) {
1117 "ASSET_OT_mark_single");
1123 "ASSET_OT_clear_single");
1128 if (mt_idtemplate_liboverride && mt_idtemplate_liboverride->
poll(C, mt_idtemplate_liboverride))
1130 uiItemM_ptr(layout, mt_idtemplate_liboverride,
IFACE_(
"Library Override"), ICON_NONE);
1147 "UI_OT_jump_to_target_button");
1156 bool item_found =
false;
1160 for (
int um_index = 0; um_index < um_array_len; um_index++) {
1162 if (um ==
nullptr) {
1166 if (umi !=
nullptr) {
1183 U.runtime.is_dirty =
true;
1206 TIP_(
"Add to a user defined context menu (stored in the user preferences)"));
1209 U.runtime.is_dirty =
true;
1220 if (idname !=
nullptr) {
1267 IFACE_(
"Non-Keyboard Shortcut"),
1275 TIP_(
"Only keyboard shortcuts can be edited that way, "
1276 "please use User Preferences otherwise"));
1331 "WM_OT_doc_view_manual_ui_context");
1348 uiItemO(layout,
nullptr, ICON_NONE,
"UI_OT_copy_python_command_button");
1378 IFACE_(
"Navigation Bar"),
1392 const bool is_inside_listrow = is_inside_listbox ?
1395 if (is_inside_listrow) {
1424 const bool any_item_visible = has_panel_category;
1426 if (!any_item_visible) {
1441 if (has_panel_category) {
bScreen * CTX_wm_screen(const bContext *C)
ARegion * CTX_wm_region_popup(const bContext *C)
PointerRNA CTX_data_pointer_get_type(const bContext *C, const char *member, StructRNA *type)
Main * CTX_data_main(const bContext *C)
const bContextStore * CTX_store_get(const bContext *C)
void CTX_store_set(bContext *C, const bContextStore *store)
ARegion * CTX_wm_region(const bContext *C)
wmWindowManager * CTX_wm_manager(const bContext *C)
void IDP_FreeProperty(IDProperty *prop)
bool IDP_AddToGroup(IDProperty *group, IDProperty *prop) ATTR_NONNULL()
IDProperty * IDP_CopyProperty(const IDProperty *prop) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL()
#define BLI_assert_unreachable()
File and directory operations.
int BLI_exists(const char *path) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL()
bool BLI_is_file(const char *path) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL()
void BLI_path_split_dir_file(const char *filepath, char *dir, size_t dir_maxncpy, char *file, size_t file_maxncpy) ATTR_NONNULL(1
void void BLI_path_split_dir_part(const char *filepath, char *dir, size_t dir_maxncpy) ATTR_NONNULL(1
int BLI_path_slash_ensure(char *path, size_t path_maxncpy) ATTR_NONNULL(1)
#define STRNCPY(dst, src)
#define SNPRINTF(dst, format,...)
#define UNUSED_VARS_NDEBUG(...)
#define CTX_IFACE_(context, msgid)
#define BLT_I18NCONTEXT_OPERATOR_DEFAULT
bool bool bool bool BPY_run_string_as_string(bContext *C, const char *imports[], const char *expr, BPy_RunErrInfo *err_info, char **r_value) ATTR_NONNULL(1
bUserMenu * ED_screen_user_menu_ensure(bContext *C)
void ED_screens_footer_tools_menu_create(bContext *C, uiLayout *layout, void *arg)
bUserMenu ** ED_screen_user_menus_find(const bContext *C, uint *r_len)
bUserMenuItem_Op * ED_screen_user_menu_item_find_operator(ListBase *lb, const wmOperatorType *ot, IDProperty *prop, const char *op_prop_enum, wmOperatorCallContext opcontext)
bUserMenuItem_Prop * ED_screen_user_menu_item_find_prop(ListBase *lb, const char *context_data_path, const char *prop_id, int prop_index)
void ED_screen_user_menu_item_add_operator(ListBase *lb, const char *ui_name, const wmOperatorType *ot, const IDProperty *prop, const char *op_prop_enum, wmOperatorCallContext opcontext)
void ED_screen_user_menu_item_add_prop(ListBase *lb, const char *ui_name, const char *context_data_path, const char *prop_id, int prop_index)
void ED_screen_user_menu_item_add_menu(ListBase *lb, const char *ui_name, const MenuType *mt)
ScrArea void ED_screens_header_tools_menu_create(bContext *C, uiLayout *layout, void *arg)
void ED_screens_region_flip_menu_create(bContext *C, uiLayout *layout, void *arg)
void ED_screen_user_menu_item_remove(ListBase *lb, bUserMenuItem *umi)
bUserMenuItem_Menu * ED_screen_user_menu_item_find_menu(ListBase *lb, const MenuType *mt)
Read Guarded memory(de)allocation.
@ RNA_OVERRIDE_STATUS_OVERRIDABLE
void UI_but_func_set(uiBut *but, std::function< void(bContext &)> func)
void uiItemBooleanO(uiLayout *layout, const char *name, int icon, const char *opname, const char *propname, int value)
bool UI_panel_can_be_pinned(const Panel *panel)
void uiLayoutSetEnabled(uiLayout *layout, bool enabled)
@ UI_BLOCK_MOVEMOUSE_QUIT
void UI_block_bounds_set_popup(uiBlock *block, int addval, const int bounds_offset[2])
void uiItemL(uiLayout *layout, const char *name, int icon)
void uiItemFullO(uiLayout *layout, const char *opname, const char *name, int icon, IDProperty *properties, wmOperatorCallContext context, eUI_Item_Flag flag, PointerRNA *r_opptr)
void UI_popup_block_invoke(bContext *C, uiBlockCreateFunc func, void *arg, uiFreeArgFunc arg_free)
MenuType * UI_but_menutype_get(const uiBut *but)
uiBlock * uiLayoutGetBlock(uiLayout *layout)
uiLayout * UI_block_layout(uiBlock *block, int dir, int type, int x, int y, int size, int em, int padding, const uiStyle *style)
const uiStyle * UI_style_get_dpi()
bool UI_panel_category_is_visible(const ARegion *region)
void UI_popup_block_ex(bContext *C, uiBlockCreateFunc func, uiBlockHandleFunc popup_func, uiBlockCancelFunc cancel_func, void *arg, wmOperator *op)
void UI_popup_menu_end(bContext *C, uiPopupMenu *pup)
std::string UI_but_context_menu_title_from_button(uiBut &but)
uiBlock * UI_block_begin(const bContext *C, ARegion *region, std::string name, eUIEmbossType emboss)
void UI_block_func_handle_set(uiBlock *block, uiBlockHandleFunc func, void *arg)
void uiItemS(uiLayout *layout)
uiBut * uiDefIconTextBut(uiBlock *block, int type, int retval, int icon, blender::StringRef str, int x, int y, short width, short height, void *poin, float min, float max, const char *tip)
void uiItemFullO_ptr(uiLayout *layout, wmOperatorType *ot, const char *name, int icon, IDProperty *properties, wmOperatorCallContext context, eUI_Item_Flag flag, PointerRNA *r_opptr)
uiPopupMenu * UI_popup_menu_begin(bContext *C, const char *title, int icon) ATTR_NONNULL()
uiBut * uiDefBlockBut(uiBlock *block, uiBlockCreateFunc func, void *arg, blender::StringRef str, int x, int y, short width, short height, const char *tip)
void uiItemM_ptr(uiLayout *layout, MenuType *mt, const char *name, int icon)
std::optional< std::string > UI_but_online_manual_id(const uiBut *but) ATTR_WARN_UNUSED_RESULT
void UI_menutype_draw(bContext *C, MenuType *mt, uiLayout *layout)
uiLayout * UI_popup_menu_layout(uiPopupMenu *pup)
PanelType * UI_but_paneltype_get(const uiBut *but)
bool UI_popup_menu_end_or_cancel(bContext *C, uiPopupMenu *pup)
int uiLayoutGetWidth(uiLayout *layout)
void uiItemO(uiLayout *layout, const char *name, int icon, const char *opname)
void uiLayoutSetContextFromBut(uiLayout *layout, uiBut *but)
uiLayout * uiLayoutColumn(uiLayout *layout, bool align)
void UI_block_direction_set(uiBlock *block, char direction)
void uiItemMenuF(uiLayout *layout, const char *name, int icon, uiMenuCreateFunc func, void *arg)
void UI_block_flag_enable(uiBlock *block, int flag)
void uiLayoutSetOperatorContext(uiLayout *layout, wmOperatorCallContext opcontext)
bContextStore * uiLayoutGetContextStore(uiLayout *layout)
bool UI_but_is_tool(const uiBut *but)
void uiLayoutContextCopy(uiLayout *layout, const bContextStore *context)
void UI_but_flag_enable(uiBut *but, int flag)
std::optional< blender::StringRefNull > UI_but_asset_shelf_type_idname_get(const uiBut *but)
void uiItemR(uiLayout *layout, PointerRNA *ptr, const char *propname, eUI_Item_Flag flag, const char *name, int icon)
wmOperatorType * UI_but_operatortype_get_from_enum_menu(uiBut *but, PropertyRNA **r_prop)
SIMD_FORCE_INLINE const btScalar & w() const
Return the w value.
virtual void build_context_menu(bContext &C, uiLayout &column) const
bool ANIM_driver_can_paste()
draw_view push_constant(Type::INT, "radiance_src") .push_constant(Type capture_info_buf storage_buf(1, Qualifier::READ, "ObjectBounds", "bounds_buf[]") .push_constant(Type draw_view int
void ui_but_add_shortcut(uiBut *but, const char *shortcut_str, const bool do_strip)
uiBut * ui_view_item_find_mouse_over(const ARegion *region, const int xy[2]) ATTR_NONNULL(1
bool ui_jump_to_target_button_poll(bContext *C)
bool ui_block_is_popup_any(const uiBlock *block) ATTR_WARN_UNUSED_RESULT
bool ui_block_is_menu(const uiBlock *block) ATTR_WARN_UNUSED_RESULT
uiBut * ui_list_find_mouse_over(const ARegion *region, const wmEvent *event) ATTR_WARN_UNUSED_RESULT
blender::StringRef ui_but_drawstr_without_sep_char(const uiBut *but) ATTR_NONNULL()
uiBut * ui_list_row_find_mouse_over(const ARegion *region, const int xy[2]) ATTR_NONNULL(1
void ui_rna_collection_search_update_fn(const bContext *C, void *arg, const char *str, uiSearchItems *items, bool is_first)
void MEM_freeN(void *vmemh)
std::unique_ptr< IDProperty, IDPropertyDeleter > create_group(StringRefNull prop_name, eIDPropertyFlag flags={})
Allocate a new IDProperty of type IDP_GROUP.
bool RNA_property_path_from_ID_check(PointerRNA *ptr, PropertyRNA *prop)
void RNA_string_set(PointerRNA *ptr, const char *name, const char *value)
PropertyRNA * RNA_struct_find_property(PointerRNA *ptr, const char *identifier)
void RNA_boolean_set(PointerRNA *ptr, const char *name, bool value)
PropertyType RNA_property_type(PropertyRNA *prop)
void RNA_string_get(PointerRNA *ptr, const char *name, char *value)
bool RNA_property_anim_editable(const PointerRNA *ptr, PropertyRNA *prop_orig)
int RNA_property_array_length(PointerRNA *ptr, PropertyRNA *prop)
bool RNA_property_is_idprop(const PropertyRNA *prop)
std::string RNA_property_string_get(PointerRNA *ptr, PropertyRNA *prop)
PropertySubType RNA_property_subtype(PropertyRNA *prop)
bool RNA_struct_property_is_set(PointerRNA *ptr, const char *identifier)
PointerRNA RNA_pointer_create(ID *id, StructRNA *type, void *data)
const char * RNA_property_identifier(const PropertyRNA *prop)
eRNAOverrideStatus RNA_property_override_library_status(Main *bmain, PointerRNA *ptr, PropertyRNA *prop, const int index)
std::string RNA_path_property_py(const PointerRNA *ptr, PropertyRNA *prop, int index)
blender::ui::AbstractViewItem * view_item
wmOperatorCallContext opcontext
std::function< void(bContext &)> apply_func
uiMenuCreateFunc menu_create_func
const bContextStore * context
std::function< std::string(const uiBut *)> tip_label_func
#define EVT_TYPE_MASK_HOTKEY_INCLUDE
#define ISNDOF_BUTTON(event_type)
#define ISKEYBOARD(event_type)
#define EVT_TYPE_MASK_HOTKEY_EXCLUDE
#define EVT_TYPE_MASK_ALL
wmKeyMapItem * WM_key_event_operator(const bContext *C, const char *opname, wmOperatorCallContext opcontext, IDProperty *properties, const short include_mask, const short exclude_mask, wmKeyMap **r_keymap)
void WM_keyconfig_update(wmWindowManager *wm)
wmKeyMapItem * WM_keymap_item_find_id(wmKeyMap *keymap, int id)
void WM_keymap_item_properties_reset(wmKeyMapItem *kmi, IDProperty *properties)
std::optional< std::string > WM_key_event_operator_string(const bContext *C, const char *opname, wmOperatorCallContext opcontext, IDProperty *properties, const bool is_strict)
wmKeyMapItem * WM_keymap_add_item(wmKeyMap *keymap, const char *idname, const KeyMapItem_Params *params)
void WM_keymap_remove_item(wmKeyMap *keymap, wmKeyMapItem *kmi)
wmKeyMap * WM_keymap_guess_opname(const bContext *C, const char *opname)
std::string WM_operatortype_name(wmOperatorType *ot, PointerRNA *properties)
wmOperatorType * WM_operatortype_find(const char *idname, bool quiet)
std::optional< std::string > WM_context_path_resolve_property_full(const bContext *C, const PointerRNA *ptr, PropertyRNA *prop, int index)
std::optional< std::string > WM_context_path_resolve_full(bContext *C, const PointerRNA *ptr)