72 const float3 &snap_source_local,
76 float rotate_offset[3] = {0};
77 bool use_rotate_offset =
false;
93 original_normal = td->
axismtx[1];
96 original_normal = td->
axismtx[2];
111 use_rotate_offset =
true;
127 if (use_rotate_offset) {
133 float *gp_falloff =
static_cast<float *
>(td->
extra);
134 if (gp_falloff !=
nullptr) {
162 const int r_str_maxncpy,
172 r_str, r_str_maxncpy,
IN_RANGE_INCL(val, -1e10f, 1e10f) ?
"%.4f" :
"%.4e", val);
201 float val = ival + dvec[0];
203 dvec[0] = val - ival;
228 for (
int i = 0;
i < 3;
i++) {
242 IFACE_(
"Proportional Size"),
265 "D: %s D: %s (%s)%s",
274 "D: %s D: %s D: %s (%s)%s",
298 "Dx: %s Dy: %s (%s)%s",
307 "Dx: %s Dy: %s Dz: %s (%s)%s",
386 add_v3_v3(r_val, absolute_grid_snap_offset);
389 t->
con.
applyVec(t,
nullptr,
nullptr, r_val, r_val);
429 float3 snap_source_local(0);
432 if (tc->use_local_mat) {
439 for (const int i : range) {
440 TransData *td = &tc->data[i];
441 TransDataExtension *td_ext = tc->data_ext ? &tc->data_ext[i] : nullptr;
442 if (td->flag & TD_SKIP) {
445 transdata_elem_translate(t, tc, td, td_ext, snap_source_local, vec, rotate_mode);
450 custom_data->prev.rotate_mode = rotate_mode;
457 float base_offset[2] = {0.0f, 0.0f};
468 for (
TransData *td = tc->data; td < tc->
data + tc->data_len; td++) {
474 if (
min[0] < base_offset[0]) {
475 vec[0] += base_offset[0] -
min[0];
478 else if (
max[0] > base_offset[0] + t->
aspect[0]) {
479 vec[0] -=
max[0] - base_offset[0] - t->
aspect[0];
483 if (
min[1] < base_offset[1]) {
484 vec[1] += base_offset[1] -
min[1];
487 else if (
max[1] > base_offset[1] + t->
aspect[1]) {
488 vec[1] -=
max[1] - base_offset[1] - t->
aspect[1];
498 float global_dir[3] = {0.0f};
586 "Use 'Time_Translate' transform mode instead of 'Translation' mode "
587 "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 size_t size_t BLI_snprintf_utf8(char *__restrict dst, size_t dst_maxncpy, const char *__restrict format,...) ATTR_NONNULL(1
char size_t BLI_strncpy_utf8_rlen(char *__restrict dst, const char *__restrict src, size_t dst_maxncpy) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1
size_t BLI_snprintf_utf8_rlen(char *__restrict dst, size_t dst_maxncpy, const char *__restrict format,...) 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.
float UI_view2d_grid_resolution_x__frames_or_seconds(const View2D *v2d, const Scene *scene)
float UI_view2d_grid_resolution_y__values(const View2D *v2d, int base)
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