176 if (mulx / divx < muly / divy) {
186 r_vec[0] = mulx * dx / divx;
187 r_vec[1] = muly * dy / divy;
199 const float xy_delta[2] = {
float(dx),
float(dy)};
236 printf(
"%s: called in an invalid context\n", __func__);
245 if (region ==
nullptr) [[unlikely]] {
253 bool changed =
false;
271 const bool no_shift =
true;
272 rctf viewborder = {0};
292 if (changed ==
false) {
293 adr[0] = region->
winx / 2.0f;
294 adr[1] = region->
winy / 2.0f;
304 adr[0] = int(2140000000.0f);
305 adr[1] = int(2140000000.0f);
336 static_cast<const View2D *
>(t->
view),
v[0],
v[1], &adr[0], &adr[1]);
410 static_cast<const View2D *
>(t->
view),
v[0],
v[1], &adr[0], &adr[1]);
813 return t->
vod !=
nullptr;
860 "PROPORTIONAL_SIZE_DOWN",
862 "Decrease Proportional Influence",
867 "AUTOIK_CHAIN_LEN_DOWN",
869 "Decrease Max AutoIK Chain Length",
872 "INSERTOFS_TOGGLE_DIR",
874 "Toggle Direction for Node Auto-Offset",
894 {0,
nullptr, 0,
nullptr,
nullptr},
997 int constraint_curr = -1;
1003 constraint_curr = -2;
1010 const char *msg_2d =
"", *msg_3d =
"";
1013 switch (modal_type) {
1015 msg_2d =
IFACE_(
"along X");
1016 msg_3d =
IFACE_(
"along %s X");
1020 msg_2d =
IFACE_(
"along Y");
1021 msg_3d =
IFACE_(
"along %s Y");
1025 msg_2d =
IFACE_(
"along Z");
1026 msg_3d =
IFACE_(
"along %s Z");
1030 msg_3d =
IFACE_(
"locking %s X");
1034 msg_3d =
IFACE_(
"locking %s Y");
1038 msg_3d =
IFACE_(
"locking %s Z");
1056 short orient_index = 1;
1063 if (orient_index != 0) {
1066 constraint_curr = -1;
1070 if (constraint_curr == constraint_new) {
1078 short orient_index = 1;
1085 if (orient_index == 0) {
1107 (is_snap_enabled !=
bool(*snap_flag_ptr &
SCE_SNAP)))
1150 switch (event->
val) {
1291 float fac = 1.0f + 0.005f * (
event->xy[1] -
event->prev_xy[1]);
1421 if (is_navigating) {
1484 switch (event->
type) {
1537 switch (event->
type) {
1580 if (!is_navigating && t->
redraw) {
1652 if (region != t->
region) {
1724 const char *printable =
IFACE_(
"Auto Keying On");
1725 float printable_size[2];
1732 Scene *scene =
nullptr;
1752 offset =
U.gizmo_size_navigate_v3d;
1755 offset =
U.rvisize * std::min((
U.pixelsize /
U.scale_factor), 1.0f) * 2.5f;
1763 offset *=
U.scale_factor;
1765 xco = (rect->
xmax -
U.widget_unit) -
int(printable_size[0]) - offset;
1766 yco = (rect->
ymax -
U.widget_unit);
1772 float text_color[4], shadow_color[4];
1787 xco -=
U.widget_unit;
1788 yco -= int(printable_size[1]) / 2;
1803 if (region != t->
region) {
1837 bool use_prop_edit =
false;
1838 int prop_edit_flag = 0;
1847 use_prop_edit =
true;
1882 if (use_prop_edit) {
1985 if (orient_axis != -1) {
2001 short orient_type_set, orient_type_curr;
2008 orient_type_set = orient_type_curr;
2021 bool constraint_axis[3] = {
false,
false,
false};
2024 constraint_axis[0] =
true;
2027 constraint_axis[1] =
true;
2030 constraint_axis[2] =
true;
2040 const char *prop_id =
nullptr;
2041 bool prop_state =
true;
2043 prop_id =
"use_even_offset";
2062 if (scene !=
nullptr) {
2129 if (!
G.background) {
2167 bool has_selected_any =
false;
2169 if (tc->data_len == 0) {
2173 if (!tc->sorted_index_map) {
2175 "Without sorted_index_map, all items are expected to be selected");
2176 has_selected_any =
true;
2180 const int first_selected_index = tc->sorted_index_map[0];
2181 TransData *td = &tc->data[first_selected_index];
2183 has_selected_any =
true;
2188 if (!has_selected_any) {
2250 bool use_accurate =
false;
2255 use_accurate =
true;
2298 bool do_skip =
false;
2314 else if (!do_skip) {
2316 if (preserve_clnor) {
2436 memcpy(value, t->
values_final,
sizeof(
float) * value_num);
Functions to insert, delete or modify keyframes.
Camera data-block and utility functions.
#define BLF_DRAW_STR_DUMMY_MAX
#define REGION_DRAW_POST_VIEW
#define REGION_DRAW_POST_PIXEL
#define ND_SPACE_NODE_VIEW
#define SET_FLAG_FROM_TEST(value, test, flag)
#define BLI_assert_msg(a, msg)
CCL_NAMESPACE_BEGIN struct Options options
bool is_autokey_on(const Scene *scene)
bool autokeyframe_cfra_can_key(const Scene *scene, ID *id)
float2 image_preview_unit_to_px(const Scene *scene, const float2 co_src)
SequencerToolSettings * tool_settings_ensure(Scene *scene)
eSeqRippleFlag tool_settings_ripple_flag_get(Scene *scene)
void tool_settings_overlap_mode_set(Scene *scene, eSeqOverlapMode overlap_mode)
eSeqOverlapMode tool_settings_overlap_mode_get(Scene *scene)
void get_color_4fv(int colorid, float col[4])
void view2d_view_to_region(const View2D *v2d, float x, float y, int *r_region_x, int *r_region_y) ATTR_NONNULL()
void icon_draw(float x, float y, int icon_id)
MINLINE float min_ff(float a, float b)
void WM_main_add_notifier(uint type, void *reference)
eV3DProjStatus ED_view3d_project_int_global(const ARegion *region, const float co[3], int r_co[2], eV3DProjTest flag)
BLI_assert(slot->slot_subtype.map==BMO_OP_SLOT_SUBTYPE_MAP_FLT)
void RNA_float_set_array(PointerRNA *ptr, const char *name, const float *values)
@ UVCALC_TRANSFORM_CORRECT_SLIDE
@ UVCALC_TRANSFORM_CORRECT
Object * BKE_view_layer_active_object_get(const ViewLayer *view_layer)
Scene * CTX_data_sequencer_scene(const bContext *C)
PropertyRNA * RNA_struct_find_property(PointerRNA *ptr, const char *identifier)
BMesh * BKE_editmesh_bmesh_get_for_write(Mesh *mesh)
MINLINE void copy_v3_v3(float r[3], const float a[3])
void ED_space_image_get_aspect(SpaceImage *sima, float *r_aspx, float *r_aspy)
bool handleNumInput(bContext *C, NumInput *n, const wmEvent *event)
WorkSpace * CTX_wm_workspace(const bContext *C)
@ V3D_ORIENT_CUSTOM_MATRIX
void BLF_shadow(int fontid, FontShadowType type, const float rgba[4]=nullptr)
void RNA_property_float_set(PointerRNA *ptr, PropertyRNA *prop, float value)
MINLINE void copy_v2_v2(float r[2], const float a[2])
int RNA_property_enum_get(PointerRNA *ptr, PropertyRNA *prop)
void ED_space_image_get_size(SpaceImage *sima, int *r_width, int *r_height)
@ V3D_AROUND_CENTER_BOUNDS
@ V3D_AROUND_LOCAL_ORIGINS
bool ED_uvedit_live_unwrap_timer_check(const wmTimer *timer)
void ED_clip_point_stable_pos__reverse(const SpaceClip *sc, const ARegion *region, const float co[2], float r_co[2])
the reverse of ED_clip_point_stable_pos(), gets the marker region coords. better name here?...
bool hasNumInput(const NumInput *n)
bool is_negative_m4(const float mat[4][4])
wmWindow * CTX_wm_window(const bContext *C)
void RNA_enum_set(PointerRNA *ptr, const char *name, int value)
void RNA_property_float_set_array(PointerRNA *ptr, PropertyRNA *prop, const float *values)
void RNA_property_boolean_set_array(PointerRNA *ptr, PropertyRNA *prop, const bool *values)
ATTR_WARN_UNUSED_RESULT const BMVert * v
@ SI_OVERLAY_SHOW_OVERLAYS
const rcti * ED_region_visible_rect(ARegion *region)
bool ED_space_clip_check_show_trackedit(const SpaceClip *sc)
@ ADS_OVERLAY_SHOW_OVERLAYS
void GPU_line_width(float width)
void ED_space_clip_get_aspect(const SpaceClip *sc, float *r_aspx, float *r_aspy)
bool RNA_property_boolean_get(PointerRNA *ptr, PropertyRNA *prop)
bool RNA_property_array_check(PropertyRNA *prop)
@ USER_MINI_AXIS_TYPE_GIZMO
@ USER_MINI_AXIS_TYPE_MINIMAL
@ USER_MINI_AXIS_TYPE_NONE
void BKE_mask_coord_to_movieclip(MovieClip *clip, MovieClipUser *user, float r_co[2], const float co[2])
@ SCE_SNAP_TARGET_NOT_ACTIVE
@ SCE_SNAP_TARGET_NOT_NONEDITED
@ SCE_SNAP_TARGET_ONLY_SELECTABLE
@ SCE_SNAP_TARGET_NOT_EDITED
BLI_INLINE int BLI_rcti_size_y(const struct rcti *rct)
void * ED_region_draw_cb_activate(ARegionType *art, void(*draw)(const bContext *, ARegion *, void *), void *customdata, int type)
VecBase< float, 2 > float2
void * MEM_new_zeroed(size_t len, const char *str) ATTR_WARN_UNUSED_RESULT ATTR_ALLOC_SIZE(1) ATTR_NONNULL(2)
Object * BKE_view_layer_edit_object_get(const ViewLayer *view_layer)
BLI_INLINE float BLI_rctf_size_y(const struct rctf *rct)
rctf BKE_camera_view_border(const struct Scene *scene, const struct Depsgraph *depsgraph, const struct View3D *v3d, const struct RegionView3D *rv3d, int winx, int winy, bool no_shift, bool no_zoom, bool no_roll)
eV3DProjStatus ED_view3d_project_float_global(const ARegion *region, const float co[3], float r_co[2], eV3DProjTest flag)
bool ED_space_clip_check_show_maskedit(const SpaceClip *sc)
@ SCE_SNAP_INDIVIDUAL_PROJECT
void RNA_property_unset(PointerRNA *ptr, PropertyRNA *prop)
void ED_space_clip_get_aspect_dimension_aware(const SpaceClip *sc, float *r_aspx, float *r_aspy)
constexpr size_t ARRAY_SIZE(const T(&arg)[N]) noexcept
bool BKE_view_layer_synced_ensure(const Main &bmain, const Scene *scene, ViewLayer *view_layer)
void unit_m4(float m[4][4])
PointerRNA RNA_pointer_create_discrete(ID *id, StructRNA *type, void *data)
Mask * CTX_data_edit_mask(const bContext *C)
void WM_window_status_area_tag_redraw(wmWindow *win)
void ED_area_status_text(ScrArea *area, const char *str)
ToolSettings * CTX_data_tool_settings(const bContext *C)
MINLINE void zero_v3(float r[3])
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_float_set(PointerRNA *ptr, const char *name, float value)
void RNA_boolean_set(PointerRNA *ptr, const char *name, bool value)
bool WM_event_modifier_flag_match_kmi_press(const wmEventModifierFlag event_modifier, const wmKeyMapItem *kmi)
wmPaintCursor * WM_paint_cursor_activate(short space_type, short region_type, wmPaintCursorPoll poll, wmPaintCursorDraw draw, void *customdata)
@ SEQ_RIPPLE_ALL_CHANNELS
float RNA_property_float_get(PointerRNA *ptr, PropertyRNA *prop)
MINLINE float normalize_v3(float n[3])
void BLF_draw_default(float x, float y, float z, const char *str, size_t str_len) ATTR_NONNULL()
void BKE_editmesh_lnorspace_update(BMesh *bm)
MINLINE void sub_v3_v3v3(float r[3], const float a[3], const float b[3])
void BKE_workspace_status_clear(WorkSpace *workspace)
void unit_m3(float m[3][3])
MovieClip * ED_space_clip_get_clip(const SpaceClip *sc)
MINLINE void copy_v3_fl(float r[3], float f)
BLI_INLINE float BLI_rctf_size_x(const struct rctf *rct)
MINLINE float max_ff(float a, float b)
void ED_space_image_get_uv_aspect(SpaceImage *sima, float *r_aspx, float *r_aspy)
BLI_INLINE float BLI_rctf_cent_y(const struct rctf *rct)
void RNA_property_enum_set(PointerRNA *ptr, PropertyRNA *prop, int value)
void RNA_property_boolean_set(PointerRNA *ptr, PropertyRNA *prop, bool value)
void BKE_mask_coord_to_image(Image *image, ImageUser *iuser, float r_co[2], const float co[2])
@ SNODE_INSERTOFS_DIR_LEFT
@ SNODE_INSERTOFS_DIR_RIGHT
wmKeyMap * WM_modalkeymap_ensure(wmKeyConfig *keyconf, const char *idname, const EnumPropertyItem *items)
void GPU_blend(GPUBlend blend)
void copy_m4_m4(float m1[4][4], const float m2[4][4])
void ED_view3d_text_colors_get(const Scene *scene, const View3D *v3d, float r_text_color[4], float r_shadow_color[4])
int WM_userdef_event_type_from_keymap_type(int kmitype)
void BLF_width_and_height(int fontid, const char *str, size_t str_len, float *r_width, float *r_height) ATTR_NONNULL()
void ED_image_point_pos__reverse(SpaceImage *sima, const ARegion *region, const float co[2], float r_co[2])
void BM_lnorspace_rebuild(BMesh *bm, bool preserve_clnor)
void ED_workspace_status_text(bContext *C, const char *str)
@ V3D_GIZMO_HIDE_NAVIGATE
BLI_INLINE float BLI_rctf_cent_x(const struct rctf *rct)
void WM_msg_publish_rna_params(wmMsgBus *mbus, const wmMsgParams_RNA *msg_key_params)
void ED_view3d_win_to_delta(const ARegion *region, const float xy_delta[2], float zfac, float r_out[3], bool precise=false)
bool RNA_property_is_set(PointerRNA *ptr, PropertyRNA *prop)
void WM_paint_cursor_tag_redraw(wmWindow *win, ARegion *)
void BLF_color4fv(int fontid, const float rgba[4])
void ED_area_tag_redraw(ScrArea *area)
void BM_lnorspace_invalidate(BMesh *bm, const bool do_invalidate_all)
KERNEL_FEATURE_LIGHT_PASSES KERNEL_FEATURE_PATH_GUIDING float
bke::ARegionRuntime * runtime
eRegionView3D_Persp persp
ListBaseT< SpaceLink > spacedata
SpaceActionOverlays_Flag flag
SpaceActionOverlays overlays
struct MovieClipUser user
struct SpaceClipOverlay overlay
eSpaceImageOverlay_Flag flag
SpaceImageOverlay overlay
eSpaceNode_InsertOffsetDir insert_ofs_dir
eView3D_GizmoFlag gizmo_flag
struct ARegionType * type
wmEventModifierFlag modifier
bool(*) poll_modal_item(const struct wmOperator *op, int value)
ListBaseT< wmKeyMapItem > items
#define ISMOUSE_MOTION(event_type)