|
Blender V5.0
|
#include "WM_types.hh"Go to the source code of this file.
Namespaces | |
| namespace | blender |
| namespace | blender::bke |
| namespace | blender::bke::id |
Enumerations | |
| enum | SliderMode { SLIDER_MODE_PERCENT = 0 , SLIDER_MODE_FLOAT = 1 } |
Functions | |
| void | ED_editors_init_for_undo (Main *bmain) |
| void | ED_editors_init (bContext *C) |
| void | ED_editors_exit (Main *bmain, bool do_undo_system) |
| bool | ED_editors_flush_edits_for_object_ex (Main *bmain, Object *ob, bool for_render, bool check_needs_flush) |
| bool | ED_editors_flush_edits_for_object (Main *bmain, Object *ob) |
| bool | ED_editors_flush_edits_ex (Main *bmain, bool for_render, bool check_needs_flush) |
| bool | ED_editors_flush_edits (Main *bmain) |
| void | ED_spacedata_id_remap_single (ScrArea *area, SpaceLink *sl, ID *old_id, ID *new_id) |
| void | ED_spacedata_id_remap (ScrArea *area, SpaceLink *sl, const blender::bke::id::IDRemapper &mappings) |
| blender::Vector< PointerRNA > | ED_operator_single_id_from_context_as_vec (const bContext *C) |
| blender::Vector< PointerRNA > | ED_operator_get_ids_from_context_as_vec (const bContext *C) |
| void | ED_operatortypes_edutils () |
| void | ED_region_draw_mouse_line_cb (const bContext *C, ARegion *region, void *arg_info) |
| void | ED_region_image_metadata_draw (int x, int y, const ImBuf *ibuf, const rctf *frame, float zoomx, float zoomy) |
| void | ED_region_image_overlay_info_text_draw (const int render_size_x, const int render_size_y, const int viewer_size_x, const int viewer_size_y, const int draw_offset_x, const int draw_offset_y) |
| void | ED_region_image_render_region_draw (int x, int y, const rcti *frame, float zoomx, float zoomy, float passepartout_alpha) |
| tSlider * | ED_slider_create (bContext *C) |
| void | ED_slider_init (tSlider *slider, const wmEvent *event) |
| bool | ED_slider_modal (tSlider *slider, const wmEvent *event) |
| void | ED_slider_destroy (bContext *C, tSlider *slider) |
| void | ED_slider_status_string_get (const tSlider *slider, char *status_string, size_t size_of_status_string) |
| void | ED_slider_status_get (const tSlider *slider, WorkspaceStatus &status) |
| float | ED_slider_factor_get (const tSlider *slider) |
| void | ED_slider_factor_set (tSlider *slider, float factor) |
| void | ED_slider_increment_step_set (tSlider *slider, float increment_step) |
| void | ED_slider_allow_overshoot_set (tSlider *slider, bool lower, bool upper) |
| void | ED_slider_factor_bounds_set (tSlider *slider, float factor_bound_lower, float factor_bound_upper) |
| bool | ED_slider_allow_increments_get (const tSlider *slider) |
| void | ED_slider_allow_increments_set (tSlider *slider, bool value) |
| void | ED_slider_mode_set (tSlider *slider, SliderMode mode) |
| SliderMode | ED_slider_mode_get (const tSlider *slider) |
| void | ED_slider_unit_set (tSlider *slider, const char *unit) |
| void | ED_slider_property_label_set (tSlider *slider, const char *property_label) |
| void | apply_keyb_grid (bool shift, bool ctrl, float *val, float fac1, float fac2, float fac3, int invert) |
| void | unpack_menu (bContext *C, const char *opname, const char *id_name, const char *abs_name, const char *folder, PackedFile *pf) |
| enum SliderMode |
| Enumerator | |
|---|---|
| SLIDER_MODE_PERCENT | |
| SLIDER_MODE_FLOAT | |
Definition at line 95 of file ED_util.hh.
| void apply_keyb_grid | ( | bool | shift, |
| bool | ctrl, | ||
| float * | val, | ||
| float | fac1, | ||
| float | fac2, | ||
| float | fac3, | ||
| int | invert ) |
Now only used in 2D spaces, like time, f-curve, NLA, image, etc.
Definition at line 343 of file ed_util.cc.
References floorf, and invert().
Referenced by ed_marker_move_modal().
| void ED_editors_exit | ( | Main * | bmain, |
| bool | do_undo_system ) |
Frees all edit-mode stuff.
Definition at line 224 of file ed_util.cc.
References BKE_undosys_stack_destroy(), DEG_id_tag_update(), ED_mesh_mirror_spatial_table_end(), ED_mesh_mirror_topo_table_end(), blender::ed::object::editmode_free_ex(), G_MAIN, ID_RECALC_GEOMETRY, ID_RECALC_TRANSFORM, LISTBASE_FOREACH, and Main::objects.
Referenced by memfile_undosys_step_decode(), WM_exit_ex(), and wm_file_read_setup_wm_init().
| bool ED_editors_flush_edits | ( | Main * | bmain | ) |
Definition at line 336 of file ed_util.cc.
References ED_editors_flush_edits_ex().
Referenced by ed_flush_edits_exec(), scene_add(), WM_autosave_write(), WM_exit_ex(), wm_file_write(), and wm_homefile_write_exec().
| bool ED_editors_flush_edits_ex | ( | Main * | bmain, |
| bool | for_render, | ||
| bool | check_needs_flush ) |
Flush any temp data from object editing to DNA before writing files, rendering, copying, etc.
Definition at line 320 of file ed_util.cc.
References ED_editors_flush_edits_for_object_ex(), Main::is_memfile_undo_flush_needed, LISTBASE_FOREACH, and Main::objects.
Referenced by ED_editors_flush_edits(), memfile_undosys_step_encode(), and screen_render_invoke().
Definition at line 315 of file ed_util.cc.
References ED_editors_flush_edits_for_object_ex().
| bool ED_editors_flush_edits_for_object_ex | ( | Main * | bmain, |
| Object * | ob, | ||
| bool | for_render, | ||
| bool | check_needs_flush ) |
Definition at line 266 of file ed_util.cc.
References BKE_object_data_editmode_flush_ptr_get(), BKE_sculptsession_bm_to_me(), BKE_sculptsession_bm_to_me_for_render(), SculptSession::cache, Object::data, blender::ed::object::editmode_load(), Object::mode, multires_flush_sculpt_updates(), SculptSession::needs_flush_to_id, OB_MODE_EDIT, OB_MODE_SCULPT, and Object::sculpt.
Referenced by ED_editors_flush_edits_ex(), and ED_editors_flush_edits_for_object().
| void ED_editors_init | ( | bContext * | C | ) |
Definition at line 100 of file ed_util.cc.
References BKE_collection_has_object_recursive(), BKE_id_is_editable(), BKE_object_has_mode_data(), BKE_object_sculpt_data_create(), BKE_scene_has_object(), BLI_assert_unreachable, C, CTX_data_active_object(), CTX_data_expect_evaluated_depsgraph(), CTX_data_main(), CTX_data_scene(), CTX_wm_manager(), CTX_wm_reports(), DEG_id_tag_update(), depsgraph, ED_area_tag_redraw(), ED_object_posemode_enter_ex(), ED_object_vpaintmode_enter_ex(), ED_object_wpaintmode_enter_ex(), ED_screen_areas_iter, ED_space_image_paint_update(), blender::ed::object::editmode_enter_ex(), ReportList::flag, ID_RECALC_SYNC_TO_EVAL, LISTBASE_FOREACH, Scene::master_collection, blender::ed::object::mode_set(), OB_HIDE_VIEWPORT, OB_MODE_ALL_SCULPT, OB_MODE_EDIT, OB_MODE_OBJECT, OB_MODE_POSE, OB_MODE_SCULPT, OB_MODE_VERTEX_PAINT, OB_MODE_WEIGHT_PAINT, blender::ed::sculpt_paint::object_sculpt_mode_enter(), Main::objects, RPT_STORE, blender::ed::asset::list::storage_tag_main_data_dirty(), Object::type, and WM_window_get_active_screen().
Referenced by wm_file_read_post().
| void ED_editors_init_for_undo | ( | Main * | bmain | ) |
Definition at line 61 of file ed_util.cc.
References bScreen::animtimer, BKE_texpaint_slots_refresh_object(), BKE_view_layer_active_object_get(), BKE_view_layer_synced_ensure(), ED_paint_proj_mesh_data_check(), ED_screen_animation_playing(), ListBase::first, View3D_Runtime::flag, LISTBASE_FOREACH, View3D::localvd, Object::mode, OB_MODE_TEXTURE_PAINT, View3D::runtime, Main::screens, SPACE_VIEW3D, V3D_RUNTIME_LOCAL_MAYBE_EMPTY, wmWindowManager::windows, Main::wm, WM_event_timer_remove(), WM_window_get_active_scene(), and WM_window_get_active_view_layer().
Referenced by image_undosys_step_decode(), and memfile_undosys_step_decode().
| blender::Vector< PointerRNA > ED_operator_get_ids_from_context_as_vec | ( | const bContext * | C | ) |
Helper for context sensitive operations: Returns the "selected_ids" context member or, if none, the "id" context member as a PointerRNA vector. Batch operations can use this to get all IDs to act on, including a fallback to the active ID if there's no selection.
Definition at line 54 of file ed_util_ops.cc.
References C, CTX_data_selected_ids(), ED_operator_single_id_from_context_as_vec(), and blender::Vector< T, InlineBufferCapacity, Allocator >::is_empty().
Referenced by blender::ed::asset::ASSET_OT_clear(), blender::ed::asset::ASSET_OT_mark(), lib_id_batch_edit_previews(), and lib_id_batch_editing_preview_poll().
| blender::Vector< PointerRNA > ED_operator_single_id_from_context_as_vec | ( | const bContext * | C | ) |
Helper for context sensitive operations: Returns the "id" context member wrapped in a PointerRNA vector. Useful when the API uses vectors to also support acting on multiple IDs, e.g. as returned by ED_operator_get_ids_from_context_as_vec().
Definition at line 44 of file ed_util_ops.cc.
References blender::Vector< T, InlineBufferCapacity, Allocator >::append(), C, CTX_data_pointer_get_type(), and PointerRNA::data.
Referenced by blender::ed::asset::ASSET_OT_clear_single(), blender::ed::asset::ASSET_OT_mark_single(), and ED_operator_get_ids_from_context_as_vec().
| void ED_operatortypes_edutils | ( | ) |
Definition at line 573 of file ed_util_ops.cc.
References ED_OT_flush_edits(), ED_OT_lib_id_fake_user_toggle(), ED_OT_lib_id_generate_preview(), ED_OT_lib_id_generate_preview_from_object(), ED_OT_lib_id_load_custom_preview(), ED_OT_lib_id_override_editable_toggle(), ED_OT_lib_id_remove_preview(), ED_OT_lib_id_unlink(), ED_OT_redo(), ED_OT_undo(), ED_OT_undo_history(), ED_OT_undo_push(), ED_OT_undo_redo(), and WM_operatortype_append().
Referenced by ED_spacetypes_init().
Callback that draws a line between the mouse and a position given as the initial argument.
Definition at line 662 of file ed_draw.cc.
References C, CTX_wm_window(), wmWindow::eventstate, float, GPU_line_width(), GPU_PRIM_LINES, GPU_SHADER_3D_LINE_DASHED_UNIFORM_COLOR, GPU_vertformat_attr_add(), GPU_viewport_size_get_f(), immBegin(), immBindBuiltinProgram(), immEnd(), immUnbindProgram(), immUniform1f(), immUniform1i(), immUniform2f(), immUniformThemeColor3(), immVertex2fv(), immVertexFormat(), TH_VIEW_OVERLAY, UI_SCALE_FAC, ARegion::winrct, rcti::xmin, wmEvent::xy, and rcti::ymin.
Referenced by edbm_bevel_init(), and edbm_inset_init().
| void ED_region_image_metadata_draw | ( | int | x, |
| int | y, | ||
| const ImBuf * | ibuf, | ||
| const rctf * | frame, | ||
| float | zoomx, | ||
| float | zoomy ) |
Definition at line 1030 of file ed_draw.cc.
References BLF_CLIPPING, BLF_clipping(), BLF_disable(), BLF_enable(), blf_mono_font, BLF_size(), BLI_rctf_init(), GPU_matrix_pop(), GPU_matrix_push(), GPU_matrix_scale_2f(), GPU_matrix_translate_2f(), GPU_SHADER_3D_UNIFORM_COLOR, GPU_vertformat_attr_add(), immBindBuiltinProgram(), immRectf(), immUnbindProgram(), immUniformThemeColorAlpha(), immVertexFormat(), ImBuf::metadata, metadata_box_height_get(), metadata_draw_imbuf(), uiFontStyle::points, pos, TH_METADATA_BG, TH_METADATA_TEXT, UI_FontThemeColor(), UI_SCALE_FAC, UI_style_get_dpi(), uiStyle::widget, x, rctf::xmax, rctf::xmin, y, rctf::ymax, and rctf::ymin.
Referenced by draw_movieclip_buffer(), image_main_region_draw(), and blender::ed::vse::sequencer_preview_draw_overlays().
| void ED_region_image_overlay_info_text_draw | ( | const int | render_size_x, |
| const int | render_size_y, | ||
| const int | viewer_size_x, | ||
| const int | viewer_size_y, | ||
| const int | draw_offset_x, | ||
| const int | draw_offset_y ) |
Definition at line 942 of file ed_draw.cc.
References BLF_default(), BLF_set_default(), BLF_width(), max_ii(), MAX_NAME, uiFontStyle::points, text_info_row(), U, UI_SCALE_FAC, UI_style_get(), and uiStyle::widget.
Referenced by image_main_region_draw().
| void ED_region_image_render_region_draw | ( | int | x, |
| int | y, | ||
| const rcti * | frame, | ||
| float | zoomx, | ||
| float | zoomy, | ||
| float | passepartout_alpha ) |
Definition at line 982 of file ed_draw.cc.
References BLI_rcti_size_x(), BLI_rcti_size_y(), GPU_blend(), GPU_BLEND_ALPHA, GPU_BLEND_NONE, GPU_matrix_pop(), GPU_matrix_push(), GPU_matrix_scale_2f(), GPU_matrix_translate_2f(), GPU_SHADER_3D_UNIFORM_COLOR, GPU_vertformat_attr_add(), imm_draw_box_wire_2d(), immBindBuiltinProgram(), immRectf(), immUnbindProgram(), immUniformColor4f(), immVertexFormat(), pos, TH_WIRE_EDIT, UI_GetThemeColor3fv(), x, rcti::xmax, rcti::xmin, y, rcti::ymax, and rcti::ymin.
Referenced by image_main_region_draw().
| bool ED_slider_allow_increments_get | ( | const tSlider * | slider | ) |
Definition at line 622 of file ed_draw.cc.
References tSlider::allow_increments.
| void ED_slider_allow_increments_set | ( | tSlider * | slider, |
| bool | value ) |
Definition at line 627 of file ed_draw.cc.
References tSlider::allow_increments.
Referenced by poselib_blend_init_data().
| void ED_slider_allow_overshoot_set | ( | tSlider * | slider, |
| bool | lower, | ||
| bool | upper ) |
One bool value for each side of the slider. Allows to enable overshoot only on one side.
Definition at line 616 of file ed_draw.cc.
References tSlider::allow_overshoot_lower, and tSlider::allow_overshoot_upper.
Referenced by blend_to_ease_invoke(), btw_smooth_invoke(), decimate_invoke(), ease_invoke(), ease_modal(), gaussian_smooth_invoke(), match_slope_invoke(), and poselib_blend_init_data().
Definition at line 433 of file ed_draw.cc.
References tSlider::allow_increments, tSlider::allow_overshoot_lower, tSlider::allow_overshoot_upper, tSlider::area, C, CTX_data_scene(), CTX_wm_area(), CTX_wm_region(), tSlider::draw_handle, ED_area_status_text(), ED_region_draw_cb_activate(), tSlider::factor, tSlider::factor_bounds, G, tSlider::increment_step, LISTBASE_FOREACH, tSlider::raw_factor, REGION_DRAW_POST_PIXEL, tSlider::region_header, ScrArea::regionbase, RGN_TYPE_HEADER, tSlider::scene, slider_draw(), tSlider::slider_mode, SLIDER_MODE_PERCENT, and tSlider::unit_string.
Referenced by graph_slider_invoke(), pose_slide_init(), and poselib_blend_init_data().
Definition at line 579 of file ed_draw.cc.
References tSlider::area, C, tSlider::draw_handle, ED_area_status_text(), ED_region_draw_cb_exit(), ED_workspace_status_text(), tSlider::region_header, and ARegion::runtime.
Referenced by graph_slider_exit(), pose_slide_exit(), and poselib_blend_cleanup().
| void ED_slider_factor_bounds_set | ( | tSlider * | slider, |
| float | factor_bound_lower, | ||
| float | factor_bound_upper ) |
Set the soft limits for the slider, which are applied until the user enables overshooting.
Definition at line 632 of file ed_draw.cc.
References tSlider::factor_bounds.
Referenced by blend_offset_invoke(), blend_to_ease_invoke(), blend_to_neighbor_invoke(), breakdown_invoke(), btw_smooth_invoke(), ease_invoke(), ease_modal(), match_slope_invoke(), pose_slide_blend_rest_invoke(), poselib_blend_init_data(), push_pull_invoke(), scale_average_invoke(), scale_from_neighbor_invoke(), shear_invoke(), and time_offset_invoke().
Definition at line 592 of file ed_draw.cc.
References tSlider::factor.
Referenced by blend_to_default_modal_update(), pose_slide_apply_quat(), pose_slide_apply_val(), pose_slide_modal(), pose_slide_rest_pose_apply_other_rot(), pose_slide_rest_pose_apply_vec3(), poselib_blend_handle_event(), and slider_factor_get_and_remember().
Definition at line 597 of file ed_draw.cc.
References clamp_f(), tSlider::factor, tSlider::factor_bounds, tSlider::overshoot, and tSlider::raw_factor.
Referenced by blend_offset_invoke(), blend_to_default_invoke(), blend_to_ease_invoke(), blend_to_neighbor_invoke(), breakdown_invoke(), btw_smooth_invoke(), ease_invoke(), ease_modal(), gaussian_smooth_invoke(), graph_slider_modal(), match_slope_invoke(), pose_slide_blend_rest_invoke(), pose_slide_init(), pose_slide_modal(), poselib_blend_init_data(), push_pull_invoke(), scale_average_invoke(), scale_from_neighbor_invoke(), shear_invoke(), and time_offset_invoke().
By default the increment step is 0.1, which depending on the factor bounds might not be desired. Only has an effect if increment is allowed and enabled. See ED_slider_allow_increments_set.
| increment_step | cannot be 0. |
Definition at line 606 of file ed_draw.cc.
References BLI_assert_unreachable, and tSlider::increment_step.
Referenced by btw_smooth_invoke(), and time_offset_invoke().
For modal operations so the percentage doesn't pop on the first mouse movement.
Definition at line 477 of file ed_draw.cc.
References copy_v2fl_v2i(), tSlider::last_cursor, and wmEvent::xy.
Referenced by graph_slider_invoke(), pose_slide_invoke_common(), and poselib_blend_init_data().
Calculate slider factor based on mouse position.
Definition at line 482 of file ed_draw.cc.
References tSlider::allow_increments, tSlider::allow_overshoot_lower, tSlider::allow_overshoot_upper, ED_region_tag_redraw(), EVT_EKEY, EVT_LEFTCTRLKEY, EVT_LEFTSHIFTKEY, EVT_RIGHTCTRLKEY, EVT_RIGHTSHIFTKEY, tSlider::increments, KM_PRESS, MOUSEMOVE, tSlider::overshoot, tSlider::precision, tSlider::region_header, slider_update_factor(), and wmEvent::type.
Referenced by graph_slider_modal(), pose_slide_modal(), and poselib_blend_handle_event().
| SliderMode ED_slider_mode_get | ( | const tSlider * | slider | ) |
Definition at line 645 of file ed_draw.cc.
References tSlider::slider_mode.
Referenced by graph_slider_modal().
| void ED_slider_mode_set | ( | tSlider * | slider, |
| SliderMode | mode ) |
Definition at line 640 of file ed_draw.cc.
References tSlider::slider_mode.
Referenced by btw_smooth_invoke(), ease_modal(), and time_offset_invoke().
| void ED_slider_property_label_set | ( | tSlider * | slider, |
| const char * | property_label ) |
Definition at line 655 of file ed_draw.cc.
References tSlider::property_label.
Referenced by ease_invoke(), graph_slider_modal(), and pose_slide_draw_status().
| void ED_slider_status_get | ( | const tSlider * | slider, |
| WorkspaceStatus & | status ) |
Definition at line 563 of file ed_draw.cc.
References tSlider::allow_increments, tSlider::allow_overshoot_lower, tSlider::allow_overshoot_upper, IFACE_, tSlider::increments, tSlider::overshoot, tSlider::precision, and status.
Referenced by common_draw_status_header(), decimate_draw_status(), ease_draw_status_header(), pose_slide_draw_status(), poselib_blend_modal(), scale_from_neighbor_draw_status_header(), and shear_draw_status_header().
| void ED_slider_status_string_get | ( | const tSlider * | slider, |
| char * | status_string, | ||
| size_t | size_of_status_string ) |
Return string based on the current state of the slider.
Definition at line 515 of file ed_draw.cc.
References tSlider::allow_increments, tSlider::allow_overshoot_lower, tSlider::allow_overshoot_upper, BLI_snprintf_utf8(), IFACE_, tSlider::increments, tSlider::overshoot, tSlider::precision, and STRNCPY_UTF8.
| void ED_slider_unit_set | ( | tSlider * | slider, |
| const char * | unit ) |
Definition at line 650 of file ed_draw.cc.
References STRNCPY_UTF8, and tSlider::unit_string.
Referenced by btw_smooth_invoke(), ease_modal(), and time_offset_invoke().
| void ED_spacedata_id_remap | ( | ScrArea * | area, |
| SpaceLink * | sl, | ||
| const blender::bke::id::IDRemapper & | mappings ) |
Definition at line 464 of file ed_util.cc.
References BKE_spacetype_from_id(), SpaceType::id_remap, and SpaceLink::spacetype.
Referenced by WM_main_remap_editor_id_reference().
Use to free ID references within runtime data (stored outside of DNA)
| new_id | may be NULL to unlink old_id. |
Definition at line 474 of file ed_util.cc.
References blender::bke::id::IDRemapper::add(), BKE_spacetype_from_id(), SpaceType::id_remap, and SpaceLink::spacetype.
Referenced by WM_init().
| void unpack_menu | ( | bContext * | C, |
| const char * | opname, | ||
| const char * | id_name, | ||
| const char * | abs_name, | ||
| const char * | folder, | ||
| PackedFile * | pf ) |
Definition at line 368 of file ed_util.cc.
References BKE_main_blendfile_path(), BKE_packedfile_compare_to_file(), BLI_path_join, BLI_path_split_file_part(), C, CTX_data_main(), blender::wm::ExecDefault, FILE_MAX, FILE_MAXDIR, IFACE_, uiLayout::op(), ot, pf, PF_CMP_DIFFERS, PF_CMP_EQUAL, PF_CMP_NOFILE, PF_REMOVE, PF_USE_LOCAL, PF_USE_ORIGINAL, PF_WRITE_LOCAL, PF_WRITE_ORIGINAL, RNA_enum_set(), RNA_string_set(), SNPRINTF_UTF8, STREQ, UI_ITEM_NONE, UI_popup_menu_begin(), UI_popup_menu_end(), UI_popup_menu_layout(), and WM_operatortype_find().
Referenced by image_unpack_invoke(), and sound_unpack_invoke().