155 if (mulx / divx < muly / divy) {
165 r_vec[0] = mulx * dx / divx;
166 r_vec[1] = muly * dy / divy;
178 const float xy_delta[2] = {(
float)dx, (
float)dy};
194 r_vec[0] *=
t->aspect[0];
195 r_vec[1] *=
t->aspect[1];
211 r_vec[0] *=
t->aspect[0];
212 r_vec[1] *=
t->aspect[1];
215 printf(
"%s: called in an invalid context\n", __func__);
226 adr[0] = (int)2140000000.0f;
227 adr[1] = (int)2140000000.0f;
237 v[0] = vec[0] /
t->aspect[0];
238 v[1] = vec[1] /
t->aspect[1];
254 v[0] = vec[0] /
t->aspect[0];
255 v[1] = vec[1] /
t->aspect[1];
302 v[0] = vec[0] /
t->aspect[0];
303 v[1] = vec[1] /
t->aspect[1];
320 v[0] = vec[0] /
t->aspect[0];
321 v[1] = vec[1] /
t->aspect[1];
340 switch (
t->spacetype) {
350 adr[0] =
t->region->winx / 2.0f;
351 adr[1] =
t->region->winy / 2.0f;
385 vec[0] /=
t->aspect[0];
386 vec[1] /=
t->aspect[1];
390 vec[0] /=
t->aspect[0];
391 vec[1] /=
t->aspect[1];
409 vec[0] *=
t->aspect[0];
410 vec[1] *=
t->aspect[1];
414 vec[0] *=
t->aspect[0];
415 vec[1] *=
t->aspect[1];
529 (
t->settings->uvcalc_flag & uvcalc_correct_flag)) {
539 allqueue(REDRAWBUTSOBJECT, 0);
540 allqueue(REDRAWVIEW3D, 0);
543 allqueue(REDRAWIMAGE, 0);
544 allqueue(REDRAWVIEW3D, 0);
547 allqueue(REDRAWVIEW3D, 0);
548 allqueue(REDRAWACTION, 0);
549 allqueue(REDRAWNLA, 0);
550 allqueue(REDRAWIPO, 0);
551 allqueue(REDRAWTIME, 0);
552 allqueue(REDRAWBUTSOBJECT, 0);
555 scrarea_queue_headredraw(curarea);
593 if (!
t->tsnap.selectedPoint) {
675 "PROPORTIONAL_SIZE_DOWN",
677 "Decrease Proportional Influence",
681 "AUTOIK_CHAIN_LEN_DOWN",
683 "Decrease Max AutoIK Chain Length",
689 "INSERTOFS_TOGGLE_DIR",
691 "Toggle Direction for Node Auto-Offset",
796 int constraint_curr = -1;
802 constraint_curr = -2;
809 const char *msg_2d =
"", *msg_3d =
"";
812 switch (modal_type) {
814 msg_2d =
TIP_(
"along X");
815 msg_3d =
TIP_(
"along %s X");
819 msg_2d =
TIP_(
"along Y");
820 msg_3d =
TIP_(
"along %s Y");
824 msg_2d =
TIP_(
"along Z");
825 msg_3d =
TIP_(
"along %s Z");
829 msg_3d =
TIP_(
"locking %s X");
833 msg_3d =
TIP_(
"locking %s Y");
837 msg_3d =
TIP_(
"locking %s Z");
855 short orient_index = 1;
856 if (
t->orient_curr == O_DEFAULT ||
ELEM(constraint_curr, -1, constraint_new)) {
858 orient_index = (short)((
t->orient_curr + 1) % (int)
ARRAY_SIZE(
t->orient));
862 if (orient_index != 0) {
865 constraint_curr = -1;
869 if (constraint_curr == constraint_new) {
877 short orient_index = 1;
878 if (
t->orient_curr == O_DEFAULT ||
ELEM(constraint_curr, -1, constraint_new)) {
880 orient_index = (short)((
t->orient_curr + 1) % (int)
ARRAY_SIZE(
t->orient));
884 if (orient_index == 0) {
897 bool handled =
false;
898 const int modifiers_prev =
t->modifiers;
899 const int mode_prev =
t->mode;
927 switch (event->
val) {
1074 float fac = 1.0f + 0.005f * (
event->xy[1] -
event->prev_xy[1]);
1075 t->prop_size *= fac;
1199 t->mouse.precision = 1;
1204 t->mouse.precision = 0;
1217 switch (event->
type) {
1293 switch (event->
type) {
1318 if (
t->handleEvent && (!handled ||
1321 t->redraw |=
t->handleEvent(
t, event);
1335 if (handled ||
t->redraw) {
1362 t->around = centerMode;
1364 if (
t->data_len_all == 0) {
1396 if (region ==
t->region) {
1425 if (region ==
t->region) {
1436 const char *printable =
IFACE_(
"Auto Keying On");
1437 float printable_size[2];
1446 xco = (rect->
xmax -
U.widget_unit) - (
int)printable_size[0];
1447 yco = (rect->
ymax -
U.widget_unit);
1460 xco -=
U.widget_unit;
1461 yco -= (int)printable_size[1] / 2;
1476 if (region ==
t->region) {
1487 if (region ==
t->region) {
1520 bool use_prop_edit =
false;
1521 int prop_edit_flag = 0;
1524 use_prop_edit =
true;
1554 if (use_prop_edit) {
1607 short *snap_flag_ptr;
1614 msg_key_params.
prop = &rna_ToolSettings_use_snap_node;
1618 msg_key_params.
prop = &rna_ToolSettings_use_snap_uv;
1622 msg_key_params.
prop = &rna_ToolSettings_use_snap_sequencer;
1626 msg_key_params.
prop = &rna_ToolSettings_use_snap;
1649 if (orient_axis != -1) {
1665 short orient_type_set, orient_type_curr;
1668 orient_type_curr =
t->orient[
t->orient_curr].type;
1672 orient_type_set = orient_type_curr;
1684 bool constraint_axis[3] = {
false,
false,
false};
1687 constraint_axis[0] =
true;
1690 constraint_axis[1] =
true;
1693 constraint_axis[2] =
true;
1703 const char *prop_id =
NULL;
1704 bool prop_state =
true;
1706 prop_id =
"use_even_offset";
1724 if (
t->region->regiondata) {
1725 View3D *v3d =
t->area->spacedata.first;
1727 r_snap[1] = r_snap[0] * 0.1f;
1732 View2D *v2d = &
t->region->v2d;
1740 r_snap[1] = r_snap[0] / 2.0f;
1744 r_snap[1] = 0.0625f;
1754 r_snap[0] = r_snap[1] = 1.0f;
1805 t->is_launch_event_drag =
event ? (
event->val ==
KM_CLICK_DRAG) :
false;
1819 else if (
ELEM(
t->spacetype,
1834 if (
t->data_len_all == 0) {
1846 bool has_selected_any =
false;
1849 has_selected_any =
true;
1854 if (!has_selected_any) {
1873 for (kmi =
t->keymap->items.first; kmi; kmi = kmi->
next) {
1911 bool use_accurate =
false;
1915 use_accurate =
true;
1964 bool do_skip =
false;
1980 else if (!do_skip) {
1982 if (preserve_clnor) {
2005 t->transform(
t,
t->mval);
2078 if (
t->transform_matrix !=
NULL) {
2079 t->transform_matrix(
t, mat);
2087 memcpy(value,
t->values_final,
sizeof(
float) * value_num);
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_color3ubv(int fontid, const unsigned char rgb[3])
void BLF_width_and_height(int fontid, const char *str, size_t str_len, float *r_width, float *r_height) ATTR_NONNULL()
#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()
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)
@ SCE_SNAP_TARGET_NOT_ACTIVE
@ SCE_SNAP_TARGET_NOT_NONEDITED
@ SCE_SNAP_TARGET_ONLY_SELECTABLE
@ SCE_SNAP_TARGET_NOT_EDITED
#define UVCALC_TRANSFORM_CORRECT_SLIDE
#define OBACT(_view_layer)
#define UVCALC_TRANSFORM_CORRECT
@ SCE_SNAP_MODE_INCREMENT
@ SNODE_INSERTOFS_DIR_RIGHT
@ SNODE_INSERTOFS_DIR_LEFT
#define SI_GRID_STEPS_LEN
@ V3D_AROUND_CENTER_BOUNDS
@ V3D_AROUND_LOCAL_ORIGINS
@ V3D_ORIENT_CUSTOM_MATRIX
#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)
float ED_space_image_increment_snap_value(int grid_dimesnions, const float grid_steps[SI_GRID_STEPS_LEN], float zoom_factor)
void ED_space_image_grid_steps(struct SpaceImage *sima, float grid_steps[SI_GRID_STEPS_LEN], int grid_dimension)
float ED_space_image_zoom_level(const struct View2D *v2d, int grid_dimension)
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
void ED_view3d_win_to_delta(const struct ARegion *region, const float xy_delta[2], float zfac, float r_out[3])
eV3DProjStatus ED_view3d_project_float_global(const struct ARegion *region, const float co[3], float r_co[2], eV3DProjTest flag)
eV3DProjStatus ED_view3d_project_int_global(const struct ARegion *region, const float co[3], int r_co[2], eV3DProjTest flag)
float ED_view3d_grid_view_scale(struct Scene *scene, struct View3D *v3d, struct ARegion *region, const char **r_grid_unit)
_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 width
_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.
Group Output data from inside of a node group A color picker Mix two input colors RGB to Convert a color s luminance to a grayscale value Generate a normal vector and a dot product Bright Control the brightness and contrast of the input color Vector Map an input vectors to used to fine tune the interpolation of the input Camera Retrieve information about the camera and how it relates to the current shading point s position Clamp a value between a minimum and a maximum Vector Perform vector math operation Invert a color
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)
ccl_device_inline float4 mask(const int4 &mask, const float4 &a)
static void area(int d1, int d2, int e1, int e2, float weights[2])
static const pxr::TfToken out("out", pxr::TfToken::Immortal)
float RNA_property_float_get(PointerRNA *ptr, PropertyRNA *prop)
bool RNA_property_array_check(PropertyRNA *prop)
void RNA_pointer_create(ID *id, StructRNA *type, void *data, PointerRNA *r_ptr)
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
void WM_paint_cursor_tag_redraw(wmWindow *win, ARegion *UNUSED(region))
void WM_event_drag_start_mval(const wmEvent *event, const ARegion *region, int r_mval[2])
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 ISMOUSE_MOTION(event_type)
wmKeyMap * WM_keymap_active(const wmWindowManager *wm, wmKeyMap *keymap)
wmKeyMap * WM_modalkeymap_ensure(wmKeyConfig *keyconf, const char *idname, const EnumPropertyItem *items)
void WM_msg_publish_rna_params(struct 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)