71 float v1[3],
v2[3], v3[3];
145 t->view_layer = view_layer;
156 t->obedit_type = obact->
type;
163 if (
t->data_container ==
NULL) {
164 t->data_container =
MEM_callocN(
sizeof(*
t->data_container), __func__);
165 t->data_container_len = 1;
182 t->handleEvent =
NULL;
192 t->orient_axis_ortho = 1;
204 t->remove_on_cancel =
false;
209 t->remove_on_cancel =
true;
229 t->spacetype =
area->spacetype;
234 const char *prop_id =
NULL;
236 prop_id =
"use_even_offset";
260 t->around =
t->scene->toolsettings->transform_pivot_point;
272 if ((
t->obedit_type != -1) && !use_island) {
304 t->view = ®ion->
v2d;
323 t->view = ®ion->
v2d;
328 t->view = ®ion->
v2d;
333 t->view = ®ion->
v2d;
346 t->view = ®ion->
v2d;
357 bool t_values_set_is_array =
false;
361 float values[4] = {0};
364 t_values_set_is_array =
true;
382 bool constraint_axis[3] = {
false,
false,
false};
386 constraint_axis[0] = constraint_axis[1] = constraint_axis[2] =
true;
392 if (constraint_axis[0] || constraint_axis[1] || constraint_axis[2]) {
395 if (constraint_axis[0]) {
398 if (constraint_axis[1]) {
401 if (constraint_axis[2]) {
408 short orient_types[3];
409 float custom_matrix[3][3];
412 int orient_type_default = -1;
413 int orient_type_set = -1;
414 int orient_type_matrix_set = -1;
418 orient_type_scene = orient_slot->
type;
421 orient_type_scene += index_custom;
449 else if (orient_type_set == -1) {
454 orient_type_default = orient_type_scene;
456 if (orient_type_set != -1) {
459 orient_type_default = orient_type_set;
460 t->is_orient_default_overwrite =
true;
463 else if (orient_type_matrix_set != -1) {
464 orient_type_set = orient_type_matrix_set;
467 orient_type_default = orient_type_set;
468 t->is_orient_default_overwrite =
true;
472 orient_type_set = orient_type_scene;
482 if (orient_type_matrix_set == orient_type_set) {
487 orient_types[O_DEFAULT] = (short)orient_type_default;
488 orient_types[O_SCENE] = (short)orient_type_scene;
489 orient_types[O_SET] = (short)orient_type_set;
491 for (
int i = 0; i < 3; i++) {
494 for (j = 0; j < i; j++) {
495 if (orient_types[j] == orient_types[i]) {
496 memcpy(&
t->orient[i], &
t->orient[j],
sizeof(*
t->orient));
502 C,
t, orient_types[i], custom_matrix,
t->orient[i].matrix);
555 bool use_prop_edit =
false;
594 if (
t->prop_size <= 0.00001f) {
595 printf(
"Proportional size (%f) under 0.00001, resetting to 1!\n",
t->prop_size);
619 char automerge =
t->scene->toolsettings->automerge;
632 t->flag &= ~T_MIRROR;
653 custom_data->
free_cb(
t, tc, custom_data);
689 if (
t->draw_handle_view) {
692 if (
t->draw_handle_apply) {
695 if (
t->draw_handle_pixel) {
698 if (
t->draw_handle_cursor) {
713 if (
t->data_len_all != 0) {
718 for (
int a = 0;
a < tc->data_len;
a++, td++) {
733 t->data_container =
NULL;
749 View3D *v3d =
t->area->spacedata.first;
760 if (
t->rng !=
NULL) {
834 for (td = tc->data; td < tc->
data + tc->data_len; td++) {
838 for (tdm = tc->data_mirror; tdm < tc->data_mirror + tc->data_mirror_len; tdm++) {
842 for (td2d = tc->data_2d; tc->data_2d && td2d < tc->data_2d + tc->data_len; td2d++) {
844 td2d->
h1[0] = td2d->
ih1[0];
845 td2d->
h1[1] = td2d->
ih1[1];
848 td2d->
h2[0] = td2d->
ih2[0];
849 td2d->
h2[1] = td2d->
ih2[1];
870 if (tc->use_local_mat) {
871 mul_v3_m4v3(tc->center_local, tc->imat, center_global);
881 const float *cursor =
t->scene->cursor.location;
888 r_center[0] =
t->region->winx / 2.0f;
889 r_center[1] =
t->region->winy / 2.0f;
897 const float *cursor =
NULL;
905 cursor = space_clip->
cursor;
924 r_center[0] = co[0] *
t->aspect[0];
925 r_center[1] = co[1] *
t->aspect[1];
934 r_center[0] = cursor[0] *
t->aspect[0];
935 r_center[1] = cursor[1] *
t->aspect[1];
976 float partial[3] = {0.0f, 0.0f, 0.0f};
981 for (
int i = 0; i < tc->data_len; i++) {
987 for (
int i = 0; i < tc->data_mirror_len; i++) {
1003 bool changed =
false;
1007 for (
int i = 0; i < tc->data_len; i++) {
1013 for (
int i = 0; i < tc->data_mirror_len; i++) {
1128 axis[0] =
t->center_global[0] - 6.0f * axis[0];
1129 axis[1] =
t->center_global[1] - 6.0f * axis[1];
1130 axis[2] =
t->center_global[2] - 6.0f * axis[2];
1167 t->proptext[0] =
'\0';
1170 const char *pet_id =
NULL;
1173 for (i = 0; i < tc->data_len; i++, td++) {
1178 (connected == 0 && td->
rdist >
t->prop_size)) {
1185 dist = (
t->prop_size - td->
dist) /
t->prop_size;
1188 dist = (
t->prop_size - td->
rdist) /
t->prop_size;
1200 switch (
t->prop_mode) {
1202 td->
factor = dist * dist;
1205 td->
factor = 3.0f * dist * dist - 2.0f * dist * dist * dist;
1220 if (
t->rng ==
NULL) {
1228 td->
factor = dist * (2.0f - dist);
1238 switch (
t->prop_mode) {
1240 pet_id =
N_(
"(Sharp)");
1243 pet_id =
N_(
"(Smooth)");
1246 pet_id =
N_(
"(Root)");
1249 pet_id =
N_(
"(Linear)");
1252 pet_id =
N_(
"(Constant)");
1255 pet_id =
N_(
"(Sphere)");
1258 pet_id =
N_(
"(Random)");
1261 pet_id =
N_(
"(InvSquare)");
1274 for (i = 0; i < tc->data_len; i++, td++) {
1294 float dmat_inv[3][3];
1342 float axis[3],
angle;
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 ViewLayer * CTX_data_view_layer(const bContext *C)
struct bGPdata * CTX_data_gpencil_data(const bContext *C)
struct wmMsgBus * CTX_wm_message_bus(const bContext *C)
struct ARegion * CTX_wm_region(const bContext *C)
struct Depsgraph * CTX_data_depsgraph_pointer(const bContext *C)
struct ToolSettings * CTX_data_tool_settings(const bContext *C)
struct wmWindow * CTX_wm_window(const bContext *C)
struct Base * BKE_view_layer_base_find(struct ViewLayer *view_layer, struct Object *ob)
void BKE_mask_coord_from_image(struct Image *image, struct ImageUser *iuser, float r_co[2], const float co[2])
void BKE_mask_coord_from_movieclip(struct MovieClip *clip, struct MovieClipUser *user, float r_co[2], const float co[2])
struct Object * BKE_modifiers_is_deformed_by_armature(struct Object *ob)
struct Paint * BKE_paint_get_active(struct Scene *sce, struct ViewLayer *view_layer)
struct Paint * BKE_paint_get_active_from_context(const struct bContext *C)
void void BLI_freelistN(struct ListBase *listbase) ATTR_NONNULL(1)
void unit_m3(float m[3][3])
void mul_m4_v3(const float M[4][4], float r[3])
bool invert_m3_m3(float R[3][3], const float A[3][3])
void mul_v3_m4v3(float r[3], const float M[4][4], const float v[3])
void mul_m3_m3m3(float R[3][3], const float A[3][3], const float B[3][3])
void mat3_to_quat(float q[4], const float mat[3][3])
float normalize_qt_qt(float r[4], const float q[4])
void mat3_to_axis_angle(float axis[3], float *angle, const float M[3][3])
void eulO_to_mat3(float mat[3][3], const float eul[3], const short order)
void axis_angle_to_mat3(float R[3][3], const float axis[3], const float angle)
void copy_qt_qt(float q[4], const float a[4])
void quat_to_mat3(float mat[3][3], const float q[4])
void mat3_to_compatible_eulO(float eul[3], const float old[3], const short order, const float mat[3][3])
MINLINE void copy_v4_v4(float r[4], const float a[4])
void minmax_v3v3_v3(float min[3], float max[3], const float vec[3])
MINLINE float normalize_v3(float r[3])
MINLINE void mul_v3_v3(float r[3], const float a[3])
MINLINE void sub_v3_v3v3(float r[3], const float a[3], const float b[3])
MINLINE bool is_zero_v4(const float a[4]) ATTR_WARN_UNUSED_RESULT
MINLINE void mul_v3_fl(float r[3], float f)
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 bool is_zero_v3(const float a[3]) ATTR_WARN_UNUSED_RESULT
MINLINE void add_v3_v3v3(float r[3], const float a[3], const float b[3])
void mid_v3_v3v3(float r[3], const float a[3], const float b[3])
MINLINE void zero_v3(float r[3])
MINLINE void add_v3_v3(float r[3], const float a[3])
void BLI_rng_free(struct RNG *rng) ATTR_NONNULL(1)
struct RNG * BLI_rng_new(unsigned int seed)
float BLI_rng_get_float(struct RNG *rng) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1)
char * BLI_strncpy(char *__restrict dst, const char *__restrict src, const size_t maxncpy) ATTR_NONNULL()
#define INIT_MINMAX(min, max)
#define SET_FLAG_FROM_TEST(value, test, flag)
#define GPENCIL_EDIT_MODE(gpd)
#define OB_MODE_ALL_PAINT
#define OB_MODE_ALL_WEIGHT_PAINT
#define UVCALC_TRANSFORM_CORRECT_SLIDE
#define BASACT(_view_layer)
#define OBACT(_view_layer)
#define BASE_VISIBLE(v3d, base)
@ V3D_ORIENT_CUSTOM_MATRIX
@ V3D_AROUND_CENTER_BOUNDS
@ V3D_AROUND_CENTER_MEDIAN
@ V3D_AROUND_LOCAL_ORIGINS
bool ED_space_clip_check_show_trackedit(struct SpaceClip *sc)
bool ED_space_clip_check_show_maskedit(struct SpaceClip *sc)
bool ED_space_image_show_uvedit(struct SpaceImage *sima, struct Object *obedit)
bool ED_object_calc_active_center_for_posemode(struct Object *ob, const bool select_only, float r_center[3])
bool ED_object_calc_active_center_for_editmode(struct Object *obedit, const bool select_only, float r_center[3])
bScreen * ED_screen_animation_playing(const struct wmWindowManager *wm)
void ED_region_draw_cb_exit(struct ARegionType *, void *)
void ED_uvedit_live_unwrap_end(short cancel)
eV3DProjStatus ED_view3d_project_float_global(const struct ARegion *region, const float co[3], float r_co[2], const eV3DProjTest flag)
float ED_view3d_calc_zfac(const struct RegionView3D *rv3d, const float co[3], bool *r_flip)
NSNotificationCenter * center
_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
_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 v1
void GPU_matrix_pop(void)
void GPU_matrix_push(void)
@ GPU_SHADER_3D_UNIFORM_COLOR
Read Guarded memory(de)allocation.
Platform independent time functions.
void UI_make_axis_color(const unsigned char *src_col, unsigned char *dst_col, const char axis)
void UI_GetThemeColor3ubv(int colorid, unsigned char col[3])
float UI_view2d_view_to_region_x(const struct View2D *v2d, float x)
float UI_view2d_view_to_region_y(const struct View2D *v2d, float y)
ATTR_WARN_UNUSED_RESULT const BMVert * v2
SIMD_FORCE_INLINE btScalar angle(const btVector3 &v) const
Return the angle between this and another vector.
CCL_NAMESPACE_BEGIN struct Options options
void(* MEM_freeN)(void *vmemh)
void *(* MEM_callocN)(size_t len, const char *str)
MINLINE void zero_v2_int(int r[2])
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_property_float_get_array(PointerRNA *ptr, PropertyRNA *prop, float *values)
bool RNA_property_is_set(PointerRNA *ptr, PropertyRNA *prop)
void RNA_property_boolean_get_array(PointerRNA *ptr, PropertyRNA *prop, bool *values)
PropertyRNA * RNA_struct_find_property(PointerRNA *ptr, const char *identifier)
void RNA_float_get_array(PointerRNA *ptr, const char *name, float *values)
bool RNA_property_boolean_get(PointerRNA *ptr, PropertyRNA *prop)
void RNA_property_boolean_set(PointerRNA *ptr, PropertyRNA *prop, bool value)
float RNA_float_get(PointerRNA *ptr, const char *name)
int RNA_property_enum_get(PointerRNA *ptr, PropertyRNA *prop)
bool RNA_boolean_get(PointerRNA *ptr, const char *name)
struct PaintCurve * paint_curve
struct ToolSettings * toolsettings
struct MovieClipUser user
TransCustomData first_elem
void(* free_cb)(struct TransInfo *, struct TransDataContainer *tc, struct TransCustomData *custom_data)
TransDataCurveHandleFlags * hdata
struct wmTimer * animtimer
struct ReportList * reports
long int PIL_check_seconds_timer_i(void)
void WM_cursor_modal_restore(wmWindow *win)
#define ISMOUSE(event_type)
bool WM_paint_cursor_end(wmPaintCursor *handle)