170 if (mulx / divx < muly / divy) {
180 r_vec[0] = mulx * dx / divx;
181 r_vec[1] = muly * dy / divy;
193 const float xy_delta[2] = {float(dx), float(dy)};
230 printf(
"%s: called in an invalid context\n", __func__);
247 bool changed =
false;
265 const bool no_shift =
true;
266 rctf viewborder = {0};
268 t->
scene, t->
depsgraph, region, v3d, rv3d, no_shift, &viewborder);
279 if (changed ==
false) {
280 adr[0] = region->
winx / 2.0f;
281 adr[1] = region->
winy / 2.0f;
291 adr[0] = int(2140000000.0f);
292 adr[1] = int(2140000000.0f);
773 return t->
vod !=
nullptr;
801 "PROPORTIONAL_SIZE_DOWN",
803 "Decrease Proportional Influence",
808 "AUTOIK_CHAIN_LEN_DOWN",
810 "Decrease Max AutoIK Chain Length",
813 "INSERTOFS_TOGGLE_DIR",
815 "Toggle Direction for Node Auto-Offset",
830 {0,
nullptr, 0,
nullptr,
nullptr},
927 int constraint_curr = -1;
933 constraint_curr = -2;
940 const char *msg_2d =
"", *msg_3d =
"";
943 switch (modal_type) {
945 msg_2d =
IFACE_(
"along X");
946 msg_3d =
IFACE_(
"along %s X");
950 msg_2d =
IFACE_(
"along Y");
951 msg_3d =
IFACE_(
"along %s Y");
955 msg_2d =
IFACE_(
"along Z");
956 msg_3d =
IFACE_(
"along %s Z");
960 msg_3d =
IFACE_(
"locking %s X");
964 msg_3d =
IFACE_(
"locking %s Y");
968 msg_3d =
IFACE_(
"locking %s Z");
986 short orient_index = 1;
993 if (orient_index != 0) {
996 constraint_curr = -1;
1000 if (constraint_curr == constraint_new) {
1008 short orient_index = 1;
1015 if (orient_index == 0) {
1063 switch (event->
val) {
1203 float fac = 1.0f + 0.005f * (
event->xy[1] -
event->prev_xy[1]);
1333 if (is_navigating) {
1364 switch (event->
type) {
1417 switch (event->
type) {
1460 if (!is_navigating && t->
redraw) {
1521 if (region == t->
region) {
1573 const char *printable =
IFACE_(
"Auto Keying On");
1574 float printable_size[2];
1581 Scene *scene =
nullptr;
1601 offset =
U.gizmo_size_navigate_v3d;
1604 offset =
U.rvisize * std::min((
U.pixelsize /
U.scale_factor), 1.0f) * 2.5f;
1612 offset *=
U.scale_factor;
1614 xco = (rect->
xmax -
U.widget_unit) -
int(printable_size[0]) - offset;
1615 yco = (rect->
ymax -
U.widget_unit);
1621 float text_color[4], shadow_color[4];
1636 xco -=
U.widget_unit;
1637 yco -= int(printable_size[1]) / 2;
1652 if (region == t->
region) {
1664 if (region == t->
region) {
1680 bool use_prop_edit =
false;
1681 int prop_edit_flag = 0;
1690 use_prop_edit =
true;
1722 if (use_prop_edit) {
1791 short *snap_flag_ptr;
1796 (is_snap_enabled !=
bool(*snap_flag_ptr &
SCE_SNAP)))
1828 if (orient_axis != -1) {
1844 short orient_type_set, orient_type_curr;
1851 orient_type_set = orient_type_curr;
1864 bool constraint_axis[3] = {
false,
false,
false};
1867 constraint_axis[0] =
true;
1870 constraint_axis[1] =
true;
1873 constraint_axis[2] =
true;
1883 const char *prop_id =
nullptr;
1884 bool prop_state =
true;
1886 prop_id =
"use_even_offset";
1958 if (!
G.background) {
1996 bool has_selected_any =
false;
1998 if (tc->data_len == 0) {
2002 if (!tc->sorted_index_map) {
2004 "Without sorted_index_map, all items are expected to be selected");
2005 has_selected_any =
true;
2009 const int first_selected_index = tc->sorted_index_map[0];
2010 TransData *td = &tc->data[first_selected_index];
2012 has_selected_any =
true;
2017 if (!has_selected_any) {
2095 bool use_accurate =
false;
2100 use_accurate =
true;
2143 bool do_skip =
false;
2159 else if (!do_skip) {
2161 if (preserve_clnor) {
2268 memcpy(value, t->
values_final,
sizeof(
float) * value_num);
Functions to insert, delete or modify keyframes.
WorkSpace * CTX_wm_workspace(const bContext *C)
Mask * CTX_data_edit_mask(const bContext *C)
wmWindow * CTX_wm_window(const bContext *C)
ToolSettings * CTX_data_tool_settings(const bContext *C)
wmWindowManager * CTX_wm_manager(const bContext *C)
BMEditMesh * BKE_editmesh_from_object(Object *ob)
Return the BMEditMesh for a given object.
void BKE_editmesh_lnorspace_update(BMEditMesh *em)
void BKE_view_layer_synced_ensure(const Scene *scene, ViewLayer *view_layer)
Object * BKE_view_layer_active_object_get(const ViewLayer *view_layer)
Object * BKE_view_layer_edit_object_get(const ViewLayer *view_layer)
void BKE_mask_coord_to_image(struct Image *image, struct ImageUser *iuser, float r_co[2], const float co[2])
void BKE_mask_coord_to_movieclip(struct MovieClip *clip, struct MovieClipUser *user, float r_co[2], const float co[2])
void BKE_workspace_status_clear(WorkSpace *workspace)
void BLF_shadow(int fontid, FontShadowType type, const float rgba[4]=nullptr)
void BLF_width_and_height(int fontid, const char *str, size_t str_len, float *r_width, float *r_height) ATTR_NONNULL()
void BLF_color4fv(int fontid, const float rgba[4])
#define BLF_DRAW_STR_DUMMY_MAX
void BLF_draw_default(float x, float y, float z, const char *str, size_t str_len) ATTR_NONNULL()
#define BLI_assert_msg(a, msg)
#define LISTBASE_FOREACH(type, var, list)
MINLINE float max_ff(float a, float b)
MINLINE float min_ff(float a, float b)
void unit_m3(float m[3][3])
void copy_m4_m4(float m1[4][4], const float m2[4][4])
void unit_m4(float m[4][4])
MINLINE void sub_v3_v3v3(float r[3], const float a[3], const float b[3])
MINLINE void copy_v2_v2(float r[2], const float a[2])
MINLINE void copy_v3_v3(float r[3], const float a[3])
MINLINE void copy_v3_fl(float r[3], float f)
MINLINE void zero_v3(float r[3])
MINLINE float normalize_v3(float n[3])
BLI_INLINE int BLI_rcti_size_y(const struct rcti *rct)
BLI_INLINE float BLI_rctf_cent_y(const struct rctf *rct)
BLI_INLINE float BLI_rctf_cent_x(const struct rctf *rct)
BLI_INLINE int BLI_rcti_size_x(const struct rcti *rct)
BLI_INLINE float BLI_rctf_size_x(const struct rctf *rct)
BLI_INLINE float BLI_rctf_size_y(const struct rctf *rct)
#define SET_FLAG_FROM_TEST(value, test, flag)
@ UVCALC_TRANSFORM_CORRECT_SLIDE
@ UVCALC_TRANSFORM_CORRECT
@ SCE_SNAP_TARGET_NOT_ACTIVE
@ SCE_SNAP_TARGET_NOT_NONEDITED
@ SCE_SNAP_TARGET_ONLY_SELECTABLE
@ SCE_SNAP_TARGET_NOT_EDITED
@ SCE_SNAP_INDIVIDUAL_PROJECT
@ SNODE_INSERTOFS_DIR_RIGHT
@ SNODE_INSERTOFS_DIR_LEFT
@ USER_MINI_AXIS_TYPE_GIZMO
@ USER_MINI_AXIS_TYPE_MINIMAL
@ USER_MINI_AXIS_TYPE_NONE
@ V3D_AROUND_CENTER_BOUNDS
@ V3D_AROUND_LOCAL_ORIGINS
@ V3D_ORIENT_CUSTOM_MATRIX
@ V3D_GIZMO_HIDE_NAVIGATE
MovieClip * ED_space_clip_get_clip(const SpaceClip *sc)
bool ED_space_clip_check_show_trackedit(const SpaceClip *sc)
bool ED_space_clip_check_show_maskedit(const SpaceClip *sc)
void ED_space_clip_get_aspect(const SpaceClip *sc, float *r_aspx, float *r_aspy)
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?...
void ED_space_clip_get_aspect_dimension_aware(const SpaceClip *sc, float *r_aspx, float *r_aspy)
void ED_space_image_get_size(SpaceImage *sima, int *r_width, int *r_height)
void ED_space_image_get_uv_aspect(SpaceImage *sima, float *r_aspx, float *r_aspy)
void ED_space_image_get_aspect(SpaceImage *sima, float *r_aspx, float *r_aspy)
void ED_image_point_pos__reverse(SpaceImage *sima, const ARegion *region, const float co[2], float r_co[2])
void ED_area_tag_redraw(ScrArea *area)
void ED_area_status_text(ScrArea *area, const char *str)
const rcti * ED_region_visible_rect(ARegion *region)
void ED_workspace_status_text(bContext *C, const char *str)
void * ED_region_draw_cb_activate(ARegionType *art, void(*draw)(const bContext *, ARegion *, void *), void *customdata, int type)
#define REGION_DRAW_POST_VIEW
#define REGION_DRAW_POST_PIXEL
bool ED_uvedit_live_unwrap_timer_check(const wmTimer *timer)
void ED_view3d_win_to_delta(const ARegion *region, const float xy_delta[2], float zfac, float r_out[3])
void ED_view3d_calc_camera_border(const Scene *scene, const Depsgraph *depsgraph, const ARegion *region, const View3D *v3d, const RegionView3D *rv3d, bool no_shift, rctf *r_viewborder)
void ED_view3d_text_colors_get(const Scene *scene, const View3D *v3d, float r_text_color[4], float r_shadow_color[4])
eV3DProjStatus ED_view3d_project_int_global(const ARegion *region, const float co[3], int r_co[2], eV3DProjTest flag)
eV3DProjStatus ED_view3d_project_float_global(const ARegion *region, const float co[3], float r_co[2], eV3DProjTest flag)
void GPU_blend(eGPUBlend blend)
void GPU_line_width(float width)
void UI_icon_draw(float x, float y, int icon_id)
void UI_GetThemeColor4fv(int colorid, float col[4])
void UI_view2d_view_to_region(const View2D *v2d, float x, float y, int *r_region_x, int *r_region_y) ATTR_NONNULL()
#define ND_SPACE_NODE_VIEW
void BM_lnorspace_invalidate(BMesh *bm, const bool do_invalidate_all)
void BM_lnorspace_rebuild(BMesh *bm, bool preserve_clnor)
ATTR_WARN_UNUSED_RESULT const BMVert * v
CCL_NAMESPACE_BEGIN struct Options options
void * MEM_callocN(size_t len, const char *str)
void MEM_freeN(void *vmemh)
ccl_device_inline float2 mask(const MaskType mask, const float2 a)
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)
VecBase< float, 2 > float2
float RNA_property_float_get(PointerRNA *ptr, PropertyRNA *prop)
bool RNA_property_array_check(PropertyRNA *prop)
PropertyRNA * RNA_struct_find_property(PointerRNA *ptr, const char *identifier)
void RNA_boolean_set(PointerRNA *ptr, const char *name, bool value)
bool RNA_property_is_set(PointerRNA *ptr, PropertyRNA *prop)
void RNA_property_enum_set(PointerRNA *ptr, PropertyRNA *prop, int value)
bool RNA_property_boolean_get(PointerRNA *ptr, PropertyRNA *prop)
void RNA_property_boolean_set(PointerRNA *ptr, PropertyRNA *prop, bool value)
void RNA_float_set(PointerRNA *ptr, const char *name, float value)
void RNA_property_float_set_array(PointerRNA *ptr, PropertyRNA *prop, const float *values)
int RNA_property_enum_get(PointerRNA *ptr, PropertyRNA *prop)
void RNA_property_float_set(PointerRNA *ptr, PropertyRNA *prop, float value)
void RNA_enum_set(PointerRNA *ptr, const char *name, int value)
void RNA_float_set_array(PointerRNA *ptr, const char *name, const float *values)
PointerRNA RNA_pointer_create_discrete(ID *id, StructRNA *type, void *data)
void RNA_property_unset(PointerRNA *ptr, PropertyRNA *prop)
void RNA_property_boolean_set_array(PointerRNA *ptr, PropertyRNA *prop, const bool *values)
ARegionRuntimeHandle * runtime
struct MovieClipUser user
wmEventModifierFlag modifier
bool(* poll_modal_item)(const struct wmOperator *op, int value)
struct wmOperatorType * type
void WM_paint_cursor_tag_redraw(wmWindow *win, ARegion *)
int WM_userdef_event_type_from_keymap_type(int kmitype)
void WM_window_status_area_tag_redraw(wmWindow *win)
void WM_main_add_notifier(uint type, void *reference)
void WM_event_add_notifier(const bContext *C, uint type, void *reference)
#define ISMOUSE_MOTION(event_type)
wmKeyMap * WM_modalkeymap_ensure(wmKeyConfig *keyconf, const char *idname, const EnumPropertyItem *items)
wmKeyMap * WM_keymap_active(const wmWindowManager *wm, wmKeyMap *keymap)
void WM_msg_publish_rna_params(wmMsgBus *mbus, const wmMsgParams_RNA *msg_key_params)
wmPaintCursor * WM_paint_cursor_activate(short space_type, short region_type, bool(*poll)(bContext *C), wmPaintCursorDraw draw, void *customdata)