165 if (mulx / divx < muly / divy) {
175 r_vec[0] = mulx * dx / divx;
176 r_vec[1] = muly * dy / divy;
188 const float mval_f[2] = {(
float)dx, (
float)dy};
204 r_vec[0] *=
t->aspect[0];
205 r_vec[1] *=
t->aspect[1];
221 r_vec[0] *=
t->aspect[0];
222 r_vec[1] *=
t->aspect[1];
225 printf(
"%s: called in an invalid context\n", __func__);
236 adr[0] = (int)2140000000.0f;
237 adr[1] = (int)2140000000.0f;
247 v[0] = vec[0] /
t->aspect[0];
248 v[1] = vec[1] /
t->aspect[1];
264 v[0] = vec[0] /
t->aspect[0];
265 v[1] = vec[1] /
t->aspect[1];
312 v[0] = vec[0] /
t->aspect[0];
313 v[1] = vec[1] /
t->aspect[1];
330 v[0] = vec[0] /
t->aspect[0];
331 v[1] = vec[1] /
t->aspect[1];
350 switch (
t->spacetype) {
360 adr[0] =
t->region->winx / 2.0f;
361 adr[1] =
t->region->winy / 2.0f;
395 vec[0] /=
t->aspect[0];
396 vec[1] /=
t->aspect[1];
400 vec[0] /=
t->aspect[0];
401 vec[1] /=
t->aspect[1];
419 vec[0] *=
t->aspect[0];
420 vec[1] *=
t->aspect[1];
424 vec[0] *=
t->aspect[0];
425 vec[1] *=
t->aspect[1];
538 if ((
t->data_type ==
TC_MESH_VERTS) && (
t->settings->uvcalc_flag & uvcalc_correct_flag)) {
548 allqueue(REDRAWBUTSOBJECT, 0);
549 allqueue(REDRAWVIEW3D, 0);
552 allqueue(REDRAWIMAGE, 0);
553 allqueue(REDRAWVIEW3D, 0);
556 allqueue(REDRAWVIEW3D, 0);
557 allqueue(REDRAWACTION, 0);
558 allqueue(REDRAWNLA, 0);
559 allqueue(REDRAWIPO, 0);
560 allqueue(REDRAWTIME, 0);
561 allqueue(REDRAWBUTSOBJECT, 0);
564 scrarea_queue_headredraw(curarea);
678 "PROPORTIONAL_SIZE_DOWN",
680 "Decrease Proportional Influence",
684 "AUTOIK_CHAIN_LEN_DOWN",
686 "Decrease Max AutoIK Chain Length",
692 "INSERTOFS_TOGGLE_DIR",
694 "Toggle Direction for Node Auto-Offset",
738 int constraint_curr = -1;
744 constraint_curr = -2;
751 const char *msg_2d =
"", *msg_3d =
"";
754 switch (modal_type) {
756 msg_2d =
TIP_(
"along X");
757 msg_3d =
TIP_(
"along %s X");
761 msg_2d =
TIP_(
"along Y");
762 msg_3d =
TIP_(
"along %s Y");
766 msg_2d =
TIP_(
"along Z");
767 msg_3d =
TIP_(
"along %s Z");
771 msg_3d =
TIP_(
"locking %s X");
775 msg_3d =
TIP_(
"locking %s Y");
779 msg_3d =
TIP_(
"locking %s Z");
792 if (constraint_curr == constraint_new) {
800 short orient_index = 1;
801 if (
t->orient_curr == O_DEFAULT ||
ELEM(constraint_curr, -1, constraint_new)) {
803 orient_index = (short)((
t->orient_curr + 1) % (int)
ARRAY_SIZE(
t->orient));
807 if (orient_index == 0) {
820 bool handled =
false;
821 const int modifiers_prev =
t->modifiers;
822 const int mode_prev =
t->mode;
854 switch (event->
val) {
1002 float fac = 1.0f + 0.005f * (
event->y -
event->prevy);
1003 t->prop_size *= fac;
1117 t->mouse.precision = 1;
1122 t->mouse.precision = 0;
1135 switch (event->
type) {
1211 switch (event->
type) {
1236 if (
t->handleEvent && (!handled ||
1239 t->redraw |=
t->handleEvent(
t, event);
1253 if (handled ||
t->redraw) {
1280 t->around = centerMode;
1282 if (
t->data_len_all == 0) {
1314 if (region ==
t->region) {
1343 if (region ==
t->region) {
1357 const char *printable =
IFACE_(
"Auto Keying On");
1358 float printable_size[2];
1367 xco = (rect->
xmax -
U.widget_unit) - (
int)printable_size[0];
1368 yco = (rect->
ymax -
U.widget_unit);
1376 #ifdef WITH_INTERNATIONAL
1385 xco -=
U.widget_unit;
1386 yco -= (int)printable_size[1] / 2;
1401 if (region ==
t->region) {
1412 if (region ==
t->region) {
1445 bool use_prop_edit =
false;
1446 int prop_edit_flag = 0;
1449 use_prop_edit =
true;
1482 if (use_prop_edit) {
1535 if (orient_axis != -1) {
1551 short orient_type_set, orient_type_curr;
1554 orient_type_curr =
t->orient[
t->orient_curr].type;
1558 orient_type_set = orient_type_curr;
1570 bool constraint_axis[3] = {
false,
false,
false};
1573 constraint_axis[0] =
true;
1576 constraint_axis[1] =
true;
1579 constraint_axis[2] =
true;
1589 const char *prop_id =
NULL;
1590 bool prop_state =
true;
1592 prop_id =
"use_even_offset";
1610 if (
t->region->regiondata) {
1611 View3D *v3d =
t->area->spacedata.first;
1613 r_snap[1] = r_snap[0] * 0.1f;
1617 r_snap[0] = 0.0625f;
1618 r_snap[1] = 0.03125f;
1622 r_snap[1] = 0.0625f;
1632 r_snap[0] = r_snap[1] = 1.0f;
1681 t->is_launch_event_tweak =
event ?
ISTWEAK(event->
type) :
false;
1686 if (
t->launch_event == 0) {
1737 if (
t->data_len_all == 0) {
1749 bool has_selected_any =
false;
1752 has_selected_any =
true;
1757 if (!has_selected_any) {
1776 for (kmi =
t->keymap->items.first; kmi; kmi = kmi->
next) {
1812 bool use_accurate =
false;
1816 use_accurate =
true;
1857 bool do_skip =
false;
1873 else if (!do_skip) {
1875 if (preserve_clnor) {
1898 t->transform(
t,
t->mval);
typedef float(TangentPoint)[2]
struct ScrArea * CTX_wm_area(const bContext *C)
struct Scene * CTX_data_scene(const bContext *C)
struct wmWindowManager * CTX_wm_manager(const bContext *C)
struct Mask * CTX_data_edit_mask(const bContext *C)
struct ToolSettings * CTX_data_tool_settings(const bContext *C)
struct wmWindow * CTX_wm_window(const bContext *C)
void BKE_editmesh_lnorspace_update(BMEditMesh *em, struct Mesh *me)
BMEditMesh * BKE_editmesh_from_object(struct Object *ob)
Return the BMEditMesh for a given object.
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 BLF_draw_default(float x, float y, float z, const char *str, size_t len) ATTR_NONNULL()
void BLF_color3ubv(int fontid, const unsigned char rgb[3])
void BLF_width_and_height(int fontid, const char *str, size_t len, float *r_width, float *r_height) ATTR_NONNULL()
#define BLF_DRAW_STR_DUMMY_MAX
void BLF_draw_default_ascii(float x, float y, float z, const char *str, size_t len) ATTR_NONNULL()
MINLINE float max_ff(float a, float b)
MINLINE float min_ff(float a, float b)
void unit_m3(float m[3][3])
void unit_m4(float m[4][4])
void copy_m4_m4(float m1[4][4], const float m2[4][4])
MINLINE void copy_v2_v2(float r[2], const float a[2])
MINLINE void copy_v2_v2_int(int r[2], const int 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])
BLI_INLINE int BLI_rcti_size_y(const struct rcti *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)
void DEG_id_tag_update(struct ID *id, int flag)
#define OBEDIT_FROM_VIEW_LAYER(view_layer)
#define UVCALC_TRANSFORM_CORRECT_SLIDE
#define OBACT(_view_layer)
#define UVCALC_TRANSFORM_CORRECT
#define SCE_SNAP_MODE_GRID
#define SCE_SNAP_MODE_INCREMENT
@ SNODE_INSERTOFS_DIR_RIGHT
@ SNODE_INSERTOFS_DIR_LEFT
@ V3D_ORIENT_CUSTOM_MATRIX
@ V3D_AROUND_CENTER_BOUNDS
@ V3D_AROUND_LOCAL_ORIGINS
#define V3D_HIDE_OVERLAYS
void ED_clip_point_stable_pos__reverse(struct SpaceClip *sc, struct 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(struct SpaceClip *sc, float *aspx, float *aspy)
bool ED_space_clip_check_show_trackedit(struct SpaceClip *sc)
void ED_space_clip_get_aspect_dimension_aware(struct SpaceClip *sc, float *aspx, float *aspy)
bool ED_space_clip_check_show_maskedit(struct SpaceClip *sc)
struct MovieClip * ED_space_clip_get_clip(struct SpaceClip *sc)
void ED_space_image_get_uv_aspect(struct SpaceImage *sima, float *r_aspx, float *r_aspy)
void ED_image_point_pos__reverse(struct SpaceImage *sima, const struct ARegion *region, const float co[2], float r_co[2])
void ED_space_image_get_size(struct SpaceImage *sima, int *r_width, int *r_height)
void ED_space_image_get_aspect(struct SpaceImage *sima, float *r_aspx, float *r_aspy)
#define IS_AUTOKEY_ON(scene)
float ED_node_grid_size(void)
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)
#define REGION_DRAW_POST_VIEW
void * ED_region_draw_cb_activate(struct ARegionType *art, void(*draw)(const struct bContext *, struct ARegion *, void *), void *customdata, int type)
#define REGION_DRAW_POST_PIXEL
#define REGION_DRAW_PRE_VIEW
eV3DProjStatus ED_view3d_project_int_global(const struct ARegion *region, const float co[3], int r_co[2], const eV3DProjTest flag)
void ED_view3d_win_to_delta(const struct ARegion *region, const float mval[2], float out[3], const float zfac)
float ED_view3d_grid_view_scale(struct Scene *scene, struct View3D *v3d, struct ARegion *region, const char **r_grid_unit)
eV3DProjStatus ED_view3d_project_float_global(const struct ARegion *region, const float co[3], float r_co[2], const eV3DProjTest flag)
_GL_VOID GLfloat value _GL_VOID_RET _GL_VOID const GLuint GLboolean *residences _GL_BOOL_RET _GL_VOID GLsizei GLfloat GLfloat GLfloat GLfloat const GLubyte *bitmap _GL_VOID_RET _GL_VOID GLenum const void *lists _GL_VOID_RET _GL_VOID const GLdouble *equation _GL_VOID_RET _GL_VOID GLdouble GLdouble blue _GL_VOID_RET _GL_VOID GLfloat GLfloat blue _GL_VOID_RET _GL_VOID GLint GLint blue _GL_VOID_RET _GL_VOID GLshort GLshort blue _GL_VOID_RET _GL_VOID GLubyte GLubyte blue _GL_VOID_RET _GL_VOID GLuint GLuint blue _GL_VOID_RET _GL_VOID GLushort GLushort blue _GL_VOID_RET _GL_VOID GLbyte GLbyte GLbyte alpha _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble alpha _GL_VOID_RET _GL_VOID GLfloat GLfloat GLfloat alpha _GL_VOID_RET _GL_VOID GLint GLint GLint alpha _GL_VOID_RET _GL_VOID GLshort GLshort GLshort alpha _GL_VOID_RET _GL_VOID GLubyte GLubyte GLubyte alpha _GL_VOID_RET _GL_VOID GLuint GLuint GLuint alpha _GL_VOID_RET _GL_VOID GLushort GLushort GLushort alpha _GL_VOID_RET _GL_VOID GLenum mode _GL_VOID_RET _GL_VOID GLint GLsizei width
_GL_VOID GLfloat value _GL_VOID_RET _GL_VOID const GLuint GLboolean *residences _GL_BOOL_RET _GL_VOID GLsizei height
_GL_VOID GLfloat value _GL_VOID_RET _GL_VOID const GLuint GLboolean *residences _GL_BOOL_RET _GL_VOID GLsizei GLfloat GLfloat GLfloat GLfloat const GLubyte *bitmap _GL_VOID_RET _GL_VOID GLenum const void *lists _GL_VOID_RET _GL_VOID const GLdouble *equation _GL_VOID_RET _GL_VOID GLdouble GLdouble blue _GL_VOID_RET _GL_VOID GLfloat GLfloat blue _GL_VOID_RET _GL_VOID GLint GLint blue _GL_VOID_RET _GL_VOID GLshort GLshort blue _GL_VOID_RET _GL_VOID GLubyte GLubyte blue _GL_VOID_RET _GL_VOID GLuint GLuint blue _GL_VOID_RET _GL_VOID GLushort GLushort blue _GL_VOID_RET _GL_VOID GLbyte GLbyte GLbyte alpha _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble alpha _GL_VOID_RET _GL_VOID GLfloat GLfloat GLfloat alpha _GL_VOID_RET _GL_VOID GLint GLint GLint alpha _GL_VOID_RET _GL_VOID GLshort GLshort GLshort alpha _GL_VOID_RET _GL_VOID GLubyte GLubyte GLubyte alpha _GL_VOID_RET _GL_VOID GLuint GLuint GLuint alpha _GL_VOID_RET _GL_VOID GLushort GLushort GLushort alpha _GL_VOID_RET _GL_VOID GLenum mode _GL_VOID_RET _GL_VOID GLint GLsizei GLsizei GLenum type _GL_VOID_RET _GL_VOID GLsizei GLenum GLenum const void *pixels _GL_VOID_RET _GL_VOID const void *pointer _GL_VOID_RET _GL_VOID GLdouble v _GL_VOID_RET _GL_VOID GLfloat v _GL_VOID_RET _GL_VOID GLint GLint i2 _GL_VOID_RET _GL_VOID GLint j _GL_VOID_RET _GL_VOID GLfloat param _GL_VOID_RET _GL_VOID GLint param _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble GLdouble GLdouble zFar _GL_VOID_RET _GL_UINT GLdouble *equation _GL_VOID_RET _GL_VOID GLenum GLint *params _GL_VOID_RET _GL_VOID GLenum GLfloat *v _GL_VOID_RET _GL_VOID GLenum GLfloat *params _GL_VOID_RET _GL_VOID GLfloat *values _GL_VOID_RET _GL_VOID GLushort *values _GL_VOID_RET _GL_VOID GLenum GLfloat *params _GL_VOID_RET _GL_VOID GLenum GLdouble *params _GL_VOID_RET _GL_VOID GLenum GLint *params _GL_VOID_RET _GL_VOID GLsizei const void *pointer _GL_VOID_RET _GL_VOID GLsizei const void *pointer _GL_VOID_RET _GL_BOOL GLfloat param _GL_VOID_RET _GL_VOID GLint param _GL_VOID_RET _GL_VOID GLenum GLfloat param _GL_VOID_RET _GL_VOID GLenum GLint param _GL_VOID_RET _GL_VOID GLushort pattern _GL_VOID_RET _GL_VOID GLdouble GLdouble GLint GLint const GLdouble *points _GL_VOID_RET _GL_VOID GLdouble GLdouble GLint GLint GLdouble GLdouble GLint GLint const GLdouble *points _GL_VOID_RET _GL_VOID GLdouble GLdouble u2 _GL_VOID_RET _GL_VOID GLdouble GLdouble GLint GLdouble GLdouble v2 _GL_VOID_RET _GL_VOID GLenum GLfloat param _GL_VOID_RET _GL_VOID GLenum GLint param _GL_VOID_RET _GL_VOID GLenum mode _GL_VOID_RET _GL_VOID GLdouble GLdouble nz _GL_VOID_RET _GL_VOID GLfloat GLfloat nz _GL_VOID_RET _GL_VOID GLint GLint nz _GL_VOID_RET _GL_VOID GLshort GLshort nz _GL_VOID_RET _GL_VOID GLsizei const void *pointer _GL_VOID_RET _GL_VOID GLsizei const GLfloat *values _GL_VOID_RET _GL_VOID GLsizei const GLushort *values _GL_VOID_RET _GL_VOID GLint param _GL_VOID_RET _GL_VOID const GLuint const GLclampf *priorities _GL_VOID_RET _GL_VOID GLdouble y _GL_VOID_RET _GL_VOID GLfloat y _GL_VOID_RET _GL_VOID GLint y _GL_VOID_RET _GL_VOID GLshort y _GL_VOID_RET _GL_VOID GLdouble GLdouble z _GL_VOID_RET _GL_VOID GLfloat GLfloat z _GL_VOID_RET _GL_VOID GLint GLint z _GL_VOID_RET _GL_VOID GLshort GLshort z _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble w _GL_VOID_RET _GL_VOID GLfloat GLfloat GLfloat w _GL_VOID_RET _GL_VOID GLint GLint GLint w _GL_VOID_RET _GL_VOID GLshort GLshort GLshort w _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble y2 _GL_VOID_RET _GL_VOID GLfloat GLfloat GLfloat y2 _GL_VOID_RET _GL_VOID GLint GLint GLint y2 _GL_VOID_RET _GL_VOID GLshort GLshort GLshort y2 _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble z _GL_VOID_RET _GL_VOID GLdouble GLdouble z _GL_VOID_RET _GL_VOID GLuint *buffer _GL_VOID_RET _GL_VOID GLdouble t _GL_VOID_RET _GL_VOID GLfloat t _GL_VOID_RET _GL_VOID GLint t _GL_VOID_RET _GL_VOID GLshort t _GL_VOID_RET _GL_VOID GLdouble t
void GPU_blend(eGPUBlend blend)
void GPU_line_width(float width)
Read Guarded memory(de)allocation.
void UI_icon_draw(float x, float y, int icon_id)
void UI_GetThemeColorShade3ubv(int colorid, int offset, unsigned char col[3])
void UI_view2d_view_to_region(const struct View2D *v2d, float x, float y, int *r_region_x, int *r_region_y) ATTR_NONNULL()
#define ND_TRANSFORM_DONE
#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
bGPdata * ED_gpencil_data_get_active(const bContext *C)
bool autokeyframe_cfra_can_key(const Scene *scene, ID *id)
void(* MEM_freeN)(void *vmemh)
void *(* MEM_callocN)(size_t len, const char *str)
static void area(int d1, int d2, int e1, int e2, float weights[2])
float RNA_property_float_get(PointerRNA *ptr, PropertyRNA *prop)
bool RNA_property_array_check(PropertyRNA *prop)
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)
PropertyRNA * RNA_struct_find_property(PointerRNA *ptr, const char *identifier)
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)
void RNA_property_unset(PointerRNA *ptr, PropertyRNA *prop)
void RNA_property_boolean_set_array(PointerRNA *ptr, PropertyRNA *prop, const bool *values)
struct MovieClipUser user
struct wmKeyMapItem * next
bool(* poll_modal_item)(const struct wmOperator *op, int value)
struct wmKeyMap * modalkeymap
struct wmOperatorType * type
ccl_device_inline float4 mask(const int4 &mask, const float4 &a)
void WM_paint_cursor_tag_redraw(wmWindow *win, ARegion *UNUSED(region))
int WM_userdef_event_type_from_keymap_type(int kmitype)
void WM_window_status_area_tag_redraw(wmWindow *win)
void WM_main_add_notifier(unsigned int type, void *reference)
void WM_event_add_notifier(const bContext *C, uint type, void *reference)
#define ISTWEAK(event_type)
wmKeyMap * WM_keymap_active(const wmWindowManager *wm, wmKeyMap *keymap)
wmKeyMap * WM_modalkeymap_ensure(wmKeyConfig *keyconf, const char *idname, const EnumPropertyItem *items)
#define WM_msg_publish_rna_prop(mbus, id_, data_, type_, prop_)
wmPaintCursor * WM_paint_cursor_activate(short space_type, short region_type, bool(*poll)(bContext *C), wmPaintCursorDraw draw, void *customdata)