|
Blender V4.3
|
#include "MEM_guardedalloc.h"#include "BLI_math_matrix.h"#include "BLI_math_rotation.h"#include "BLI_math_vector.h"#include "BLI_math_vector_types.hh"#include "DNA_object_types.h"#include "DNA_screen_types.h"#include "DNA_sequence_types.h"#include "DNA_space_types.h"#include "DNA_view3d_types.h"#include "BKE_context.hh"#include "BKE_global.hh"#include "BKE_layer.hh"#include "RNA_access.hh"#include "UI_resources.hh"#include "UI_view2d.hh"#include "WM_api.hh"#include "WM_message.hh"#include "WM_types.hh"#include "ED_gizmo_library.hh"#include "ED_gizmo_utils.hh"#include "ED_image.hh"#include "ED_screen.hh"#include "ED_uvedit.hh"#include "SEQ_channels.hh"#include "SEQ_iterator.hh"#include "SEQ_sequencer.hh"#include "SEQ_transform.hh"#include "transform.hh"#include "transform_gizmo.hh"Go to the source code of this file.
Classes | |
| struct | GizmoGroup2D |
| struct | GizmoGroup_Resize2D |
| struct | GizmoGroup_Rotate2D |
| anonymous enum |
| Enumerator | |
|---|---|
| MAN2D_AXIS_TRANS_X | |
| MAN2D_AXIS_TRANS_Y | |
| MAN2D_AXIS_LAST | |
Definition at line 154 of file transform_gizmo_2d.cc.
| void ED_widgetgroup_gizmo2d_resize_callbacks_set | ( | wmGizmoGroupType * | gzgt | ) |
Definition at line 923 of file transform_gizmo_2d.cc.
References wmGizmoGroupType::draw_prepare, gizmo2d_generic_poll(), gizmo2d_resize_draw_prepare(), gizmo2d_resize_invoke_prepare(), gizmo2d_resize_message_subscribe(), gizmo2d_resize_refresh(), gizmo2d_resize_setup(), wmGizmoGroupType::invoke_prepare, wmGizmoGroupType::message_subscribe, wmGizmoGroupType::poll, wmGizmoGroupType::refresh, wmGizmoGroupType::setup, wmGizmoGroupType::setup_keymap, and WM_gizmogroup_setup_keymap_generic_maybe_drag().
Referenced by IMAGE_GGT_gizmo2d_resize(), and SEQUENCER_GGT_gizmo2d_resize().
| void ED_widgetgroup_gizmo2d_rotate_callbacks_set | ( | wmGizmoGroupType * | gzgt | ) |
Definition at line 1035 of file transform_gizmo_2d.cc.
References wmGizmoGroupType::draw_prepare, gizmo2d_generic_poll(), gizmo2d_rotate_draw_prepare(), gizmo2d_rotate_message_subscribe(), gizmo2d_rotate_refresh(), gizmo2d_rotate_setup(), wmGizmoGroupType::message_subscribe, wmGizmoGroupType::poll, wmGizmoGroupType::refresh, wmGizmoGroupType::setup, wmGizmoGroupType::setup_keymap, and WM_gizmogroup_setup_keymap_generic_maybe_drag().
Referenced by IMAGE_GGT_gizmo2d_rotate(), and SEQUENCER_GGT_gizmo2d_rotate().
| void ED_widgetgroup_gizmo2d_xform_callbacks_set | ( | wmGizmoGroupType * | gzgt | ) |
Definition at line 735 of file transform_gizmo_2d.cc.
References wmGizmoGroupType::draw_prepare, gizmo2d_generic_poll(), gizmo2d_xform_draw_prepare(), gizmo2d_xform_invoke_prepare(), gizmo2d_xform_refresh(), gizmo2d_xform_setup(), wmGizmoGroupType::invoke_prepare, wmGizmoGroupType::poll, wmGizmoGroupType::refresh, wmGizmoGroupType::setup, wmGizmoGroupType::setup_keymap, and WM_gizmogroup_setup_keymap_generic_maybe_drag().
Referenced by ED_widgetgroup_gizmo2d_xform_no_cage_callbacks_set(), IMAGE_GGT_gizmo2d(), and SEQUENCER_GGT_gizmo2d().
| void ED_widgetgroup_gizmo2d_xform_no_cage_callbacks_set | ( | wmGizmoGroupType * | gzgt | ) |
Definition at line 762 of file transform_gizmo_2d.cc.
References ED_widgetgroup_gizmo2d_xform_callbacks_set(), gizmo2d_xform_no_cage_message_subscribe(), gizmo2d_xform_setup_no_cage(), wmGizmoGroupType::message_subscribe, and wmGizmoGroupType::setup.
Referenced by IMAGE_GGT_gizmo2d_translate(), and SEQUENCER_GGT_gizmo2d_translate().
|
static |
Calculates origin in view space, use with gizmo2d_origin_to_region.
Definition at line 226 of file transform_gizmo_2d.cc.
References BKE_view_layer_array_from_objects_in_edit_mode_unique_data_with_uvs(), CTX_data_scene(), CTX_data_view_layer(), CTX_wm_area(), SpaceSeq::cursor, ED_uvedit_minmax_multi(), Sequence::flag, mid_v2_v2v2(), blender::VectorSet< Key, ProbingStrategy, Hash, IsEqual, Slot, Allocator >::remove_if(), SELECT, SEQ_active_seqbase_get(), SEQ_channels_displayed_get(), SEQ_editing_get(), SEQ_image_preview_unit_to_px(), SEQ_image_transform_bounding_box_from_collection(), SEQ_query_rendered_strips(), blender::VectorSet< Key, ProbingStrategy, Hash, IsEqual, Slot, Allocator >::size(), SPACE_IMAGE, SPACE_SEQ, V3D_AROUND_CURSOR, and zero_v2().
Referenced by gizmo2d_calc_transform_pivot(), and gizmo2d_xform_refresh().
Definition at line 316 of file transform_gizmo_2d.cc.
References CTX_data_scene(), CTX_wm_area(), Sequence::flag, blender::VectorSet< Key, ProbingStrategy, Hash, IsEqual, Slot, Allocator >::remove_if(), SELECT, SEQ_active_seqbase_get(), SEQ_channels_displayed_get(), SEQ_editing_get(), SEQ_image_transform_mirror_factor_get(), SEQ_query_rendered_strips(), blender::VectorSet< Key, ProbingStrategy, Hash, IsEqual, Slot, Allocator >::size(), SPACE_SEQ, Sequence::strip, and Strip::transform.
Referenced by gizmo2d_resize_refresh(), and gizmo2d_xform_refresh().
Definition at line 293 of file transform_gizmo_2d.cc.
References CTX_data_scene(), CTX_wm_area(), Sequence::flag, blender::VectorSet< Key, ProbingStrategy, Hash, IsEqual, Slot, Allocator >::remove_if(), SELECT, SEQ_active_seqbase_get(), SEQ_channels_displayed_get(), SEQ_editing_get(), SEQ_query_rendered_strips(), blender::VectorSet< Key, ProbingStrategy, Hash, IsEqual, Slot, Allocator >::size(), SPACE_SEQ, V3D_ORIENT_GLOBAL, and V3D_ORIENT_LOCAL.
Referenced by gizmo2d_resize_invoke_prepare(), and gizmo2d_xform_invoke_prepare().
Definition at line 368 of file transform_gizmo_2d.cc.
References SpaceImage::around, BLI_assert_msg, CTX_data_scene(), CTX_data_view_layer(), CTX_wm_area(), SpaceSeq::cursor, ED_uvedit_center_from_pivot_ex(), Sequence::flag, gizmo2d_calc_bounds(), blender::VectorSet< Key, ProbingStrategy, Hash, IsEqual, Slot, Allocator >::is_empty(), blender::VectorSet< Key, ProbingStrategy, Hash, IsEqual, Slot, Allocator >::remove_if(), SELECT, SEQ_active_seqbase_get(), SEQ_channels_displayed_get(), SEQ_editing_get(), seq_get_strip_pivot_median(), SEQ_image_preview_unit_to_px(), SEQ_query_rendered_strips(), SPACE_IMAGE, SPACE_SEQ, V3D_AROUND_CENTER_BOUNDS, and V3D_AROUND_CURSOR.
Referenced by gizmo2d_modal(), gizmo2d_resize_refresh(), gizmo2d_rotate_refresh(), and gizmo2d_xform_refresh().
|
static |
Definition at line 59 of file transform_gizmo_2d.cc.
References CTX_data_edit_object(), CTX_data_scene(), CTX_wm_area(), ED_gizmo_poll_or_unlink_delayed_from_tool(), ED_space_image_show_uvedit(), G, SpaceSeq::gizmo_flag, SpaceSeq::mainb, SEQ_DRAW_IMG_IMBUF, SEQ_editing_get(), SEQ_GIZMO_HIDE, SEQ_GIZMO_HIDE_TOOL, SPACE_IMAGE, SPACE_SEQ, and USER_GIZMO_DRAW.
Referenced by ED_widgetgroup_gizmo2d_resize_callbacks_set(), ED_widgetgroup_gizmo2d_rotate_callbacks_set(), and ED_widgetgroup_gizmo2d_xform_callbacks_set().
Definition at line 176 of file transform_gizmo_2d.cc.
References BLI_assert, copy_v4_v4(), MAN2D_AXIS_TRANS_X, MAN2D_AXIS_TRANS_Y, TH_AXIS_X, TH_AXIS_Y, and UI_GetThemeColor4fv().
Referenced by gizmo2d_resize_setup(), and gizmo2d_xform_setup().
|
static |
Custom handler for gizmo widgets
Definition at line 418 of file transform_gizmo_2d.cc.
References CTX_wm_region(), ED_region_tag_redraw_editor_overlays(), gizmo2d_calc_transform_pivot(), gizmo2d_origin_to_region(), OPERATOR_RUNNING_MODAL, and WM_gizmo_set_matrix_location().
Referenced by gizmo2d_resize_setup(), gizmo2d_rotate_setup(), and gizmo2d_xform_setup().
| BLI_INLINE void gizmo2d_origin_to_region | ( | ARegion * | region, |
| float * | r_origin ) |
Convert origin (or any other point) from view to region space.
Definition at line 410 of file transform_gizmo_2d.cc.
References UI_view2d_view_to_region_fl().
Referenced by gizmo2d_modal(), gizmo2d_resize_draw_prepare(), gizmo2d_rotate_draw_prepare(), and gizmo2d_xform_draw_prepare().
|
static |
Definition at line 109 of file transform_gizmo_2d.cc.
References SpaceImage::around, ARRAY_SIZE, wmMsgSubscribeValue::owner, wmGizmoGroup::parent_gzmap, ptr, RNA_pointer_create(), SPACE_IMAGE, V3D_AROUND_CURSOR, WM_gizmo_do_msg_notify_tag_refresh(), and WM_msg_subscribe_rna().
Referenced by gizmo2d_resize_message_subscribe(), gizmo2d_rotate_message_subscribe(), and gizmo2d_xform_no_cage_message_subscribe().
|
static |
Definition at line 821 of file transform_gizmo_2d.cc.
References ARRAY_SIZE, CTX_wm_region(), wmGizmoGroup::customdata, gizmo2d_origin_to_region(), GizmoGroup_Resize2D::gizmo_xy, GizmoGroup_Resize2D::origin, rotate_v3_v3v3fl(), GizmoGroup_Resize2D::rotation, UNPACK2, WM_gizmo_set_matrix_location(), and WM_gizmo_set_matrix_rotation_from_z_axis().
Referenced by ED_widgetgroup_gizmo2d_resize_callbacks_set().
|
static |
Definition at line 901 of file transform_gizmo_2d.cc.
References gizmo2d_calc_transform_orientation(), wmGizmoOpElem::ptr, RNA_enum_set(), and WM_gizmo_operator_get().
Referenced by ED_widgetgroup_gizmo2d_resize_callbacks_set().
|
static |
Definition at line 913 of file transform_gizmo_2d.cc.
References CTX_wm_area(), CTX_wm_region(), CTX_wm_screen(), and gizmo2d_pivot_point_message_subscribe().
Referenced by ED_widgetgroup_gizmo2d_resize_callbacks_set().
|
static |
Definition at line 801 of file transform_gizmo_2d.cc.
References ARRAY_SIZE, copy_v2_v2(), wmGizmoGroup::customdata, wmGizmo::flag, gizmo2d_calc_rotation(), gizmo2d_calc_transform_pivot(), GizmoGroup_Resize2D::gizmo_xy, GizmoGroup_Resize2D::origin, GizmoGroup_Resize2D::rotation, and WM_GIZMO_HIDDEN.
Referenced by ED_widgetgroup_gizmo2d_resize_callbacks_set().
|
static |
Definition at line 842 of file transform_gizmo_2d.cc.
References ARRAY_SIZE, copy_v4_v4(), wmGizmoGroup::customdata, ED_GIZMO_ARROW_STYLE_BOX, ED_GIZMO_BUTTON_SHOW_BACKDROP, gizmo2d_get_axis_color(), gizmo2d_modal(), GIZMO_AXIS_LINE_WIDTH, GizmoGroup_Resize2D::gizmo_xy, gizmogroup2d_resize_init(), ptr, wmGizmo::ptr, RNA_boolean_set(), RNA_boolean_set_array(), RNA_enum_set(), RNA_float_set(), RNA_property_enum_set(), RNA_struct_find_property(), TH_GIZMO_VIEW_ALIGN, UI_GetThemeColor4fv(), WM_gizmo_operator_set(), WM_gizmo_set_color(), WM_gizmo_set_color_highlight(), WM_gizmo_set_fn_custom_modal(), WM_gizmo_set_line_width(), WM_gizmo_set_scale(), and WM_operatortype_find().
Referenced by ED_widgetgroup_gizmo2d_resize_callbacks_set().
|
static |
Definition at line 977 of file transform_gizmo_2d.cc.
References CTX_wm_region(), wmGizmoGroup::customdata, GizmoGroup_Rotate2D::gizmo, gizmo2d_origin_to_region(), GizmoGroup_Rotate2D::origin, UNPACK2, and WM_gizmo_set_matrix_location().
Referenced by ED_widgetgroup_gizmo2d_rotate_callbacks_set().
|
static |
Definition at line 1025 of file transform_gizmo_2d.cc.
References CTX_wm_area(), CTX_wm_region(), CTX_wm_screen(), and gizmo2d_pivot_point_message_subscribe().
Referenced by ED_widgetgroup_gizmo2d_rotate_callbacks_set().
|
static |
Definition at line 962 of file transform_gizmo_2d.cc.
References copy_v2_v2(), wmGizmoGroup::customdata, wmGizmo::flag, GizmoGroup_Rotate2D::gizmo, gizmo2d_calc_transform_pivot(), GizmoGroup_Rotate2D::origin, and WM_GIZMO_HIDDEN.
Referenced by ED_widgetgroup_gizmo2d_rotate_callbacks_set().
|
static |
Definition at line 989 of file transform_gizmo_2d.cc.
References wmGizmoGroup::customdata, ED_GIZMO_BUTTON_SHOW_BACKDROP, GizmoGroup_Rotate2D::gizmo, gizmo2d_modal(), gizmogroup2d_rotate_init(), ptr, wmGizmo::ptr, RNA_boolean_set(), RNA_enum_set(), RNA_float_set(), RNA_property_enum_set(), RNA_struct_find_property(), TH_GIZMO_VIEW_ALIGN, UI_GetThemeColor4fv(), WM_gizmo_operator_set(), WM_gizmo_set_color(), WM_gizmo_set_color_highlight(), WM_gizmo_set_fn_custom_modal(), WM_gizmo_set_line_width(), WM_gizmo_set_scale(), and WM_operatortype_find().
Referenced by ED_widgetgroup_gizmo2d_rotate_callbacks_set().
|
static |
Definition at line 592 of file transform_gizmo_2d.cc.
References ARRAY_SIZE, GizmoGroup2D::cage, copy_v2_v2(), copy_v3_v3(), CTX_data_scene(), CTX_wm_area(), CTX_wm_region(), wmGizmoGroup::customdata, gizmo2d_origin_to_region(), wmGizmo::matrix_basis, wmGizmo::matrix_offset, wmGizmo::matrix_space, GizmoGroup2D::max, max_ff(), GizmoGroup2D::min, mul_m4_m4m4(), mul_v2_fl(), GizmoGroup2D::origin, rotate_m4(), GizmoGroup2D::rotation, seq_get_strip_pivot_median(), SPACE_SEQ, sub_v2_v2v2(), GizmoGroup2D::translate_xy, UI_view2d_view_to_region_m4(), unit_m4(), UNPACK2, WM_gizmo_set_matrix_location(), and WM_gizmo_set_matrix_offset_location().
Referenced by ED_widgetgroup_gizmo2d_xform_callbacks_set().
|
static |
Definition at line 638 of file transform_gizmo_2d.cc.
References axis_angle_to_mat3_single(), GizmoGroup2D::cage, CTX_data_scene(), CTX_wm_area(), wmGizmoGroup::customdata, e, ED_GIZMO_CAGE2D_PART_ROTATE, ED_GIZMO_CAGE2D_PART_SCALE_MAX_X, ED_GIZMO_CAGE2D_PART_SCALE_MAX_X_MAX_Y, ED_GIZMO_CAGE2D_PART_SCALE_MAX_X_MIN_Y, ED_GIZMO_CAGE2D_PART_SCALE_MAX_Y, ED_GIZMO_CAGE2D_PART_SCALE_MIN_X, ED_GIZMO_CAGE2D_PART_SCALE_MIN_X_MAX_Y, ED_GIZMO_CAGE2D_PART_SCALE_MIN_X_MIN_Y, ED_GIZMO_CAGE2D_PART_SCALE_MIN_Y, gizmo2d_calc_transform_orientation(), GizmoGroup2D::max, GizmoGroup2D::min, min, GizmoGroup2D::origin, wmGizmoOpElem::ptr, RNA_enum_set(), RNA_property_float_set_array(), RNA_struct_find_property(), rotate_around_center_v2(), GizmoGroup2D::rotation, seq_get_strip_pivot_median(), SPACE_SEQ, unit_m3(), w(), and WM_gizmo_operator_get().
Referenced by ED_widgetgroup_gizmo2d_xform_callbacks_set().
|
static |
Definition at line 752 of file transform_gizmo_2d.cc.
References CTX_wm_area(), CTX_wm_region(), CTX_wm_screen(), and gizmo2d_pivot_point_message_subscribe().
Referenced by ED_widgetgroup_gizmo2d_xform_no_cage_callbacks_set().
|
static |
Definition at line 553 of file transform_gizmo_2d.cc.
References ARRAY_SIZE, GizmoGroup2D::cage, wmGizmoGroup::customdata, equals_v2v2(), wmGizmo::flag, gizmo2d_calc_bounds(), gizmo2d_calc_rotation(), gizmo2d_calc_transform_pivot(), GizmoGroup2D::max, GizmoGroup2D::min, GizmoGroup2D::no_cage, GizmoGroup2D::origin, GizmoGroup2D::rotation, GizmoGroup2D::translate_xy, and WM_GIZMO_HIDDEN.
Referenced by ED_widgetgroup_gizmo2d_xform_callbacks_set().
|
static |
Definition at line 435 of file transform_gizmo_2d.cc.
References ARRAY_SIZE, GizmoGroup2D::cage, copy_v4_v4(), wmGizmoGroup::customdata, ED_GIZMO_BUTTON_SHOW_BACKDROP, ED_GIZMO_CAGE2D_PART_ROTATE, ED_GIZMO_CAGE2D_PART_SCALE_MAX_X, ED_GIZMO_CAGE2D_PART_SCALE_MAX_X_MAX_Y, ED_GIZMO_CAGE2D_PART_SCALE_MAX_X_MIN_Y, ED_GIZMO_CAGE2D_PART_SCALE_MAX_Y, ED_GIZMO_CAGE2D_PART_SCALE_MIN_X, ED_GIZMO_CAGE2D_PART_SCALE_MIN_X_MAX_Y, ED_GIZMO_CAGE2D_PART_SCALE_MIN_X_MIN_Y, ED_GIZMO_CAGE2D_PART_SCALE_MIN_Y, wmGizmo::flag, gizmo2d_get_axis_color(), gizmo2d_modal(), GIZMO_AXIS_LINE_WIDTH, gizmogroup2d_init(), ptr, wmGizmo::ptr, RNA_boolean_set(), RNA_boolean_set_array(), RNA_enum_set(), RNA_float_set(), RNA_property_boolean_set(), RNA_property_boolean_set_array(), RNA_property_enum_set(), RNA_struct_find_property(), TH_GIZMO_VIEW_ALIGN, GizmoGroup2D::translate_xy, UI_GetThemeColor4fv(), WM_GIZMO_DRAW_OFFSET_SCALE, WM_gizmo_operator_set(), WM_gizmo_set_color(), WM_gizmo_set_color_highlight(), WM_gizmo_set_fn_custom_modal(), WM_gizmo_set_line_width(), WM_gizmo_set_matrix_offset_location(), WM_gizmo_set_matrix_rotation_from_z_axis(), WM_gizmo_set_scale(), and WM_operatortype_find().
Referenced by ED_widgetgroup_gizmo2d_xform_callbacks_set(), and gizmo2d_xform_setup_no_cage().
|
static |
Definition at line 745 of file transform_gizmo_2d.cc.
References wmGizmoGroup::customdata, gizmo2d_xform_setup(), and GizmoGroup2D::no_cage.
Referenced by ED_widgetgroup_gizmo2d_xform_no_cage_callbacks_set().
|
static |
Definition at line 202 of file transform_gizmo_2d.cc.
References GizmoGroup2D::cage, ED_GIZMO_CAGE_XFORM_FLAG_ROTATE, ED_GIZMO_CAGE_XFORM_FLAG_SCALE, ED_GIZMO_CAGE_XFORM_FLAG_TRANSLATE, MEM_callocN, wmGizmo::ptr, RNA_enum_set(), GizmoGroup2D::translate_xy, WM_gizmo_new_ptr(), and WM_gizmotype_find().
Referenced by gizmo2d_xform_setup().
|
static |
Definition at line 786 of file transform_gizmo_2d.cc.
References GizmoGroup_Resize2D::gizmo_xy, MEM_callocN, WM_gizmo_new_ptr(), and WM_gizmotype_find().
Referenced by gizmo2d_resize_setup().
|
static |
Definition at line 950 of file transform_gizmo_2d.cc.
References GizmoGroup_Rotate2D::gizmo, MEM_callocN, WM_gizmo_new_ptr(), and WM_gizmotype_find().
Referenced by gizmo2d_rotate_setup().
|
static |
Definition at line 544 of file transform_gizmo_2d.cc.
References add_v2_v2(), rotate_v2_v2fl(), and sub_v2_v2v2().
Referenced by gizmo2d_xform_invoke_prepare().
Definition at line 344 of file transform_gizmo_2d.cc.
References add_v2_v2(), Sequence::flag, blender::VectorSet< Key, ProbingStrategy, Hash, IsEqual, Slot, Allocator >::is_empty(), mul_v2_fl(), blender::VectorSet< Key, ProbingStrategy, Hash, IsEqual, Slot, Allocator >::remove_if(), SELECT, SEQ_active_seqbase_get(), SEQ_channels_displayed_get(), SEQ_editing_get(), SEQ_image_transform_origin_offset_pixelspace_get(), SEQ_query_rendered_strips(), blender::VectorSet< Key, ProbingStrategy, Hash, IsEqual, Slot, Allocator >::size(), and zero_v2().
Referenced by gizmo2d_calc_transform_pivot(), gizmo2d_xform_draw_prepare(), and gizmo2d_xform_invoke_prepare().