171 if (mulx / divx < muly / divy) {
181 r_vec[0] = mulx * dx / divx;
182 r_vec[1] = muly * dy / divy;
194 const float xy_delta[2] = {
float(dx),
float(dy)};
231 printf(
"%s: called in an invalid context\n", __func__);
248 bool changed =
false;
266 const bool no_shift =
true;
267 rctf viewborder = {0};
269 t->
scene, t->
depsgraph, region, v3d, rv3d, no_shift, &viewborder);
280 if (changed ==
false) {
281 adr[0] = region->
winx / 2.0f;
282 adr[1] = region->
winy / 2.0f;
292 adr[0] = int(2140000000.0f);
293 adr[1] = int(2140000000.0f);
774 return t->
vod !=
nullptr;
807 "PROPORTIONAL_SIZE_DOWN",
809 "Decrease Proportional Influence",
814 "AUTOIK_CHAIN_LEN_DOWN",
816 "Decrease Max AutoIK Chain Length",
819 "INSERTOFS_TOGGLE_DIR",
821 "Toggle Direction for Node Auto-Offset",
837 {0,
nullptr, 0,
nullptr,
nullptr},
934 int constraint_curr = -1;
940 constraint_curr = -2;
947 const char *msg_2d =
"", *msg_3d =
"";
950 switch (modal_type) {
952 msg_2d =
IFACE_(
"along X");
953 msg_3d =
IFACE_(
"along %s X");
957 msg_2d =
IFACE_(
"along Y");
958 msg_3d =
IFACE_(
"along %s Y");
962 msg_2d =
IFACE_(
"along Z");
963 msg_3d =
IFACE_(
"along %s Z");
967 msg_3d =
IFACE_(
"locking %s X");
971 msg_3d =
IFACE_(
"locking %s Y");
975 msg_3d =
IFACE_(
"locking %s Z");
993 short orient_index = 1;
1000 if (orient_index != 0) {
1003 constraint_curr = -1;
1007 if (constraint_curr == constraint_new) {
1015 short orient_index = 1;
1022 if (orient_index == 0) {
1040 short *snap_flag_ptr;
1045 (is_snap_enabled !=
bool(*snap_flag_ptr &
SCE_SNAP)))
1087 switch (event->
val) {
1228 float fac = 1.0f + 0.005f * (
event->xy[1] -
event->prev_xy[1]);
1358 if (is_navigating) {
1393 switch (event->
type) {
1446 switch (event->
type) {
1489 if (!is_navigating && t->
redraw) {
1549 if (region != t->
region) {
1618 const char *printable =
IFACE_(
"Auto Keying On");
1619 float printable_size[2];
1626 Scene *scene =
nullptr;
1646 offset =
U.gizmo_size_navigate_v3d;
1649 offset =
U.rvisize * std::min((
U.pixelsize /
U.scale_factor), 1.0f) * 2.5f;
1657 offset *=
U.scale_factor;
1659 xco = (rect->
xmax -
U.widget_unit) -
int(printable_size[0]) - offset;
1660 yco = (rect->
ymax -
U.widget_unit);
1666 float text_color[4], shadow_color[4];
1681 xco -=
U.widget_unit;
1682 yco -= int(printable_size[1]) / 2;
1697 if (region != t->
region) {
1725 bool use_prop_edit =
false;
1726 int prop_edit_flag = 0;
1735 use_prop_edit =
true;
1770 if (use_prop_edit) {
1866 if (orient_axis != -1) {
1883 short orient_type_set, orient_type_curr;
1890 orient_type_set = orient_type_curr;
1903 bool constraint_axis[3] = {
false,
false,
false};
1906 constraint_axis[0] =
true;
1909 constraint_axis[1] =
true;
1912 constraint_axis[2] =
true;
1922 const char *prop_id =
nullptr;
1923 bool prop_state =
true;
1925 prop_id =
"use_even_offset";
1997 if (!
G.background) {
2035 bool has_selected_any =
false;
2037 if (tc->data_len == 0) {
2041 if (!tc->sorted_index_map) {
2043 "Without sorted_index_map, all items are expected to be selected");
2044 has_selected_any =
true;
2048 const int first_selected_index = tc->sorted_index_map[0];
2049 TransData *td = &tc->data[first_selected_index];
2051 has_selected_any =
true;
2056 if (!has_selected_any) {
2134 bool use_accurate =
false;
2139 use_accurate =
true;
2182 bool do_skip =
false;
2198 else if (!do_skip) {
2200 if (preserve_clnor) {
2307 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)
Scene * CTX_data_sequencer_scene(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)
@ ADS_OVERLAY_SHOW_OVERLAYS
@ 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
@ SI_OVERLAY_SHOW_OVERLAYS
@ SNODE_INSERTOFS_DIR_RIGHT
@ SNODE_INSERTOFS_DIR_LEFT
@ USER_MINI_AXIS_TYPE_GIZMO
@ USER_MINI_AXIS_TYPE_MINIMAL
@ USER_MINI_AXIS_TYPE_NONE
@ V3D_GIZMO_HIDE_NAVIGATE
@ V3D_AROUND_CENTER_BOUNDS
@ V3D_AROUND_LOCAL_ORIGINS
@ V3D_ORIENT_CUSTOM_MATRIX
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], bool precise=false)
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_line_width(float width)
void GPU_blend(GPUBlend blend)
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
SpaceActionOverlays overlays
struct MovieClipUser user
SpaceImageOverlay overlay
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)