70 const float3 &snap_source_local,
74 float rotate_offset[3] = {0};
75 bool use_rotate_offset =
false;
91 original_normal = td->
axismtx[1];
94 original_normal = td->
axismtx[2];
109 use_rotate_offset =
true;
125 if (use_rotate_offset) {
131 float *gp_falloff =
static_cast<float *
>(td->
extra);
132 if (gp_falloff !=
nullptr) {
160 const int r_str_maxncpy,
198 float val = ival + dvec[0];
200 dvec[0] = val - ival;
225 for (
int i = 0;
i < 3;
i++) {
239 IFACE_(
"Proportional Size"),
262 "D: %s D: %s (%s)%s",
271 "D: %s D: %s D: %s (%s)%s",
295 "Dx: %s Dy: %s (%s)%s",
304 "Dx: %s Dy: %s Dz: %s (%s)%s",
383 add_v3_v3(r_val, absolute_grid_snap_offset);
386 t->
con.
applyVec(t,
nullptr,
nullptr, r_val, r_val);
426 float3 snap_source_local(0);
429 if (tc->use_local_mat) {
436 for (const int i : range) {
437 TransData *td = &tc->data[i];
438 if (td->flag & TD_SKIP) {
441 transdata_elem_translate(t, tc, td, snap_source_local, vec, rotate_mode);
446 custom_data->prev.rotate_mode = rotate_mode;
453 float base_offset[2] = {0.0f, 0.0f};
464 for (
TransData *td = tc->data; td < tc->
data + tc->data_len; td++) {
470 if (
min[0] < base_offset[0]) {
471 vec[0] += base_offset[0] -
min[0];
474 else if (
max[0] > base_offset[0] + t->
aspect[0]) {
475 vec[0] -=
max[0] - base_offset[0] - t->
aspect[0];
479 if (
min[1] < base_offset[1]) {
480 vec[1] += base_offset[1] -
min[1];
483 else if (
max[1] > base_offset[1] + t->
aspect[1]) {
484 vec[1] -=
max[1] - base_offset[1] - t->
aspect[1];
494 float global_dir[3] = {0.0f};
582 "Use 'Time_Translate' transform mode instead of 'Translation' mode "
583 "for translating keyframes in Dope Sheet Editor");
int BKE_image_find_nearest_tile_with_offset(const Image *image, const float co[2], float r_uv_offset[2]) ATTR_NONNULL(2
void BKE_report(ReportList *reports, eReportType type, const char *message)
size_t BKE_unit_value_as_string_scaled(char *str, int str_maxncpy, double value, int prec, int type, const UnitSettings &settings, bool pad)
void mul_m3_v3(const float M[3][3], float r[3])
void unit_m3(float m[3][3])
void mul_v3_m3v3(float r[3], const float M[3][3], const float a[3])
void rotation_between_vecs_to_mat3(float m[3][3], const float v1[3], const float v2[3])
MINLINE float len_squared_v3v3(const float a[3], const float b[3]) ATTR_WARN_UNUSED_RESULT
MINLINE void sub_v3_v3v3(float r[3], const float a[3], const float b[3])
MINLINE void mul_v3_fl(float r[3], float f)
MINLINE void copy_v3_v3(float r[3], const float a[3])
void minmax_v2v2_v2(float min[2], float max[2], const float vec[2])
MINLINE void add_v3_v3v3(float r[3], const float a[3], const float b[3])
MINLINE bool is_zero_v3(const float v[3]) ATTR_WARN_UNUSED_RESULT
MINLINE void copy_v3_fl(float r[3], float f)
MINLINE void zero_v3(float r[3])
MINLINE void mul_v3_v3fl(float r[3], const float a[3], float f)
MINLINE void add_v3_v3(float r[3], const float a[3])
MINLINE float len_v3(const float a[3]) ATTR_WARN_UNUSED_RESULT
size_t BLI_snprintf_rlen(char *__restrict dst, size_t dst_maxncpy, const char *__restrict format,...) ATTR_NONNULL(1
size_t BLI_snprintf(char *__restrict dst, size_t dst_maxncpy, const char *__restrict format,...) ATTR_NONNULL(1
char char size_t BLI_strncpy_rlen(char *__restrict dst, const char *__restrict src, size_t dst_maxncpy) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1
#define IN_RANGE_INCL(a, b, c)
@ SNODE_INSERTOFS_DIR_RIGHT
void ED_area_status_text(ScrArea *area, const char *str)
eV3DProjStatus ED_view3d_project_float_global(const ARegion *region, const float co[3], float r_co[2], eV3DProjTest flag)
Read Guarded memory(de)allocation.
BMesh const char void * data
void * MEM_callocN(size_t len, const char *str)
VecBase< T, 3 > transform_direction(const MatBase< T, 3, 3 > &mat, const VecBase< T, 3 > &direction)
VecBase< T, 3 > transform_point(const CartesianBasis &basis, const VecBase< T, 3 > &v)
void parallel_for(const IndexRange range, const int64_t grain_size, const Function &function, const TaskSizeHints &size_hints=detail::TaskSizeHints_Static(1))
MatBase< float, 4, 4 > float4x4
MatBase< float, 3, 3 > float3x3
VecBase< float, 3 > float3