73 return static_cast<void *
>(v3d);
76 return static_cast<void *
>(&t->
region->
v2d);
244 if (area ==
nullptr) {
248 else if (((region ==
nullptr) || (region->
regiondata ==
nullptr)) &&
262 const char *prop_id =
nullptr;
264 prop_id =
"use_even_offset";
364 bool t_values_set_is_array =
false;
369 float values[4] = {0};
372 t_values_set_is_array =
true;
389 bool constraint_axis[3] = {
false,
false,
false};
393 constraint_axis[0] = constraint_axis[1] = constraint_axis[2] =
true;
399 if (constraint_axis[0] || constraint_axis[1] || constraint_axis[2]) {
402 if (constraint_axis[0]) {
405 if (constraint_axis[1]) {
408 if (constraint_axis[2]) {
417 float custom_matrix[3][3];
420 int orient_type_default = -1;
421 int orient_type_set = -1;
422 int orient_type_matrix_set = -1;
426 orient_type_scene = orient_slot->
type;
429 orient_type_scene += index_custom;
468 else if (orient_type_set == -1) {
473 orient_type_default = orient_type_scene;
475 if (orient_type_set != -1) {
478 orient_type_default = orient_type_set;
482 else if (orient_type_matrix_set != -1) {
483 orient_type_set = orient_type_matrix_set;
486 orient_type_default = orient_type_set;
491 if (orient_type_set == -1) {
504 orient_type_apply =
O_SET;
508 if (orient_type_matrix_set == orient_type_set) {
517 for (
int i = 0; i < 3; i++) {
520 for (j = 0; j < i; j++) {
521 if (orient_types[j] == orient_types[i]) {
528 C, t, orient_types[i], custom_matrix, t->
orient[i].matrix);
533 for (
int i = 0; i < 3; i++) {
534 const int type = t->
orient[i].type;
594 bool use_prop_edit =
false;
637 printf(
"Proportional size (%f) under 0.00001, resetting to 1!\n", t->
prop_size);
682 t->
flag &= ~T_MIRROR;
707 kmi_passthrough = &kmi;
736 custom_data->
free_cb(t, tc, custom_data);
739 else if ((custom_data->
data !=
nullptr) && custom_data->
use_free) {
741 custom_data->
data =
nullptr;
744 custom_data->
free_cb =
nullptr;
794 for (
int a = 0; a < tc->data_len; a++, td++) {
796 MEM_delete(td->
hdata);
800 MEM_delete(tc->data);
802 MEM_SAFE_DELETE(tc->data_mirror);
803 MEM_SAFE_DELETE(tc->data_ext);
804 MEM_SAFE_DELETE(tc->data_2d);
805 MEM_SAFE_DELETE(tc->sorted_index_map);
830 if (t->
rng !=
nullptr) {
850 if (td_basic->
val && td_basic->
val != td_basic->
loc) {
851 *td_basic->
val = td_basic->
ival;
873 for (td = tc->data; td < tc->
data + tc->data_len; td++) {
877 for (tdm = tc->data_mirror; tdm < tc->data_mirror + tc->data_mirror_len; tdm++) {
882 for (
int i = 0; i < tc->data_len; i++) {
907 for (td2d = tc->data_2d; tc->data_2d && td2d < tc->data_2d + tc->data_len; td2d++) {
909 td2d->
h1[0] = td2d->
ih1[0];
910 td2d->
h1[1] = td2d->
ih1[1];
913 td2d->
h2[0] = td2d->
ih2[0];
914 td2d->
h2[1] = td2d->
ih2[1];
935 if (tc->use_local_mat) {
936 mul_v3_m4v3(tc->center_local, tc->imat, center_global);
962 float cursor_local_buf[2];
963 const float *cursor =
nullptr;
973 cursor = cursor_local_buf;
977 cursor = space_clip->
cursor;
996 r_center[0] = co[0] * t->
aspect[0];
997 r_center[1] = co[1] * t->
aspect[1];
1006 r_center[0] = cursor[0] * t->
aspect[0];
1007 r_center[1] = cursor[1] * t->
aspect[1];
1023 r_center[0] =
float(scene->r.cfra);
1048 float partial[3] = {0.0f, 0.0f, 0.0f};
1053 for (
int i = 0; i < tc->data_len; i++) {
1059 for (
int i = 0; i < tc->data_mirror_len; i++) {
1069 mul_v3_fl(partial, 1.0f /
float(total));
1077 bool changed =
false;
1081 for (
int i = 0; i < tc->data_len; i++) {
1087 for (
int i = 0; i < tc->data_mirror_len; i++) {
1124 mul_m4_v3(ob->object_to_world().ptr(), r_center);
1211 t->
zfac = 1.0f / zoomx;
1254 float zoom_prev = t->
zfac;
1299 const char *pet_id =
nullptr;
1302 for (i = 0; i < tc->data_len; i++, td++) {
1324 dist = std::max(dist, 0.0f);
1328 td->
factor = dist * dist;
1333 td->
factor = std::min(1.0f, 3.0f * dist * dist - 2.0f * dist * dist * dist);
1348 if (t->
rng ==
nullptr) {
1356 td->
factor = dist * (2.0f - dist);
1370 pet_id =
N_(
"(Sharp)");
1373 pet_id =
N_(
"(Smooth)");
1376 pet_id =
N_(
"(Root)");
1379 pet_id =
N_(
"(Linear)");
1382 pet_id =
N_(
"(Constant)");
1385 pet_id =
N_(
"(Sphere)");
1388 pet_id =
N_(
"(Random)");
1391 pet_id =
N_(
"(InvSquare)");
1404 for (i = 0; i < tc->data_len; i++, td++) {
1421 float dmat_inv[3][3];
1468 float axis[3],
angle;
1536 return std::nullopt;
1542 return std::nullopt;
1550 dir =
float3(delta.x, delta.y, 0.0f);
1556 return std::nullopt;
#define STRNCPY_UTF8(dst, src)
Platform independent time functions.
#define OB_MODE_ALL_PAINT_MESH
#define OB_MODE_ALL_WEIGHT_PAINT
#define BASE_VISIBLE(v3d, base)
#define INIT_MINMAX(min, max)
#define SET_FLAG_FROM_TEST(value, test, flag)
#define BLI_assert_msg(a, msg)
SIMD_FORCE_INLINE btScalar angle(const btVector3 &v) const
Return the angle between this and another vector.
bool calc_active_center_for_editmode(Object *obedit, bool select_only, float r_center[3])
bool calc_active_center_for_posemode(Object *ob, bool select_only, float r_center[3])
MatBase< T, NumCol, NumRow > normalize(const MatBase< T, NumCol, NumRow > &a)
float2 image_preview_unit_to_px(const Scene *scene, const float2 co_src)
int tool_settings_pivot_point_get(Scene *scene)
float view2d_view_to_region_y(const View2D *v2d, float y)
float view2d_view_to_region_x(const View2D *v2d, float x)
wmKeyMap * WM_keymap_active(const wmWindowManager *wm, wmKeyMap *keymap)
BLI_assert(slot->slot_subtype.map==BMO_OP_SLOT_SUBTYPE_MAP_FLT)
@ UVCALC_TRANSFORM_CORRECT_SLIDE
ViewOpsData * ED_view3d_navigation_init(bContext *C, const wmKeyMapItem *kmi_merge)
ScrArea * CTX_wm_area(const bContext *C)
void WM_event_drag_start_mval_fl(const wmEvent *event, const ARegion *region, float r_mval[2])
Object * BKE_view_layer_active_object_get(const ViewLayer *view_layer)
void RNA_property_float_get_array(PointerRNA *ptr, PropertyRNA *prop, float *values)
Scene * CTX_data_sequencer_scene(const bContext *C)
PropertyRNA * RNA_struct_find_property(PointerRNA *ptr, const char *identifier)
MINLINE void copy_v3_v3(float r[3], const float a[3])
int64_t BLI_time_now_seconds_i()
void copy_m3_m4(float m1[3][3], const float m2[4][4])
@ V3D_ORIENT_CUSTOM_MATRIX
void minmax_v3v3_v3(float min[3], float max[3], const float vec[3])
void copy_m3_m3(float m1[3][3], const float m2[3][3])
Depsgraph * CTX_data_depsgraph_pointer(const bContext *C)
bool invert_m3_m3(float inverse[3][3], const float mat[3][3])
void mul_v3_m4v3(float r[3], const float mat[4][4], const float vec[3])
MINLINE void copy_v2_v2(float r[2], const float a[2])
void RNA_property_boolean_get_array(PointerRNA *ptr, PropertyRNA *prop, bool *values)
void normalize_m3(float R[3][3]) ATTR_NONNULL()
int RNA_property_enum_get(PointerRNA *ptr, PropertyRNA *prop)
Object * BKE_modifiers_is_deformed_by_armature(Object *ob)
@ V3D_AROUND_CENTER_BOUNDS
@ V3D_AROUND_LOCAL_ORIGINS
@ V3D_AROUND_CENTER_MEDIAN
void mat3_to_compatible_eulO(float eul[3], const float oldrot[3], short order, const float mat[3][3])
void axis_angle_to_mat3(float R[3][3], const float axis[3], float angle)
wmWindow * CTX_wm_window(const bContext *C)
Base * BKE_view_layer_active_base_get(ViewLayer *view_layer)
MatBase< float, 4, 4 > float4x4
void MEM_delete_void(void *vmemh)
struct RNG * BLI_rng_new(unsigned int seed)
bool ED_space_clip_check_show_trackedit(const SpaceClip *sc)
ViewLayer * CTX_data_view_layer(const bContext *C)
SpaceSeq * CTX_wm_space_seq(const bContext *C)
MINLINE void mul_v3_fl(float r[3], float f)
bool RNA_property_boolean_get(PointerRNA *ptr, PropertyRNA *prop)
bool RNA_property_array_check(PropertyRNA *prop)
void BKE_brush_tag_unsaved_changes(Brush *brush)
VecBase< float, 4 > float4
void eulO_to_mat3(float M[3][3], const float e[3], short order)
void mul_m4_v3(const float M[4][4], float r[3])
void quat_to_mat3(float m[3][3], const float q[4])
VecBase< float, 2 > float2
MINLINE void mul_v3_v3(float r[3], const float a[3])
void * MEM_new_zeroed(size_t len, const char *str) ATTR_WARN_UNUSED_RESULT ATTR_ALLOC_SIZE(1) ATTR_NONNULL(2)
void BKE_mask_coord_from_image(Image *image, ImageUser *iuser, float r_co[2], const float co[2])
bool ED_region_draw_cb_exit(ARegionType *art, void *handle)
void copy_qt_qt(float q[4], const float a[4])
@ OB_MODE_EDIT_GPENCIL_LEGACY
@ OB_MODE_PAINT_GREASE_PENCIL
BMesh const char void * data
wmWindowManager * CTX_wm_manager(const bContext *C)
void initNumInput(NumInput *n)
eV3DProjStatus ED_view3d_project_float_global(const ARegion *region, const float co[3], float r_co[2], eV3DProjTest flag)
void BKE_mask_coord_from_movieclip(MovieClip *clip, MovieClipUser *user, float r_co[2], const float co[2])
bool ED_space_clip_check_show_maskedit(const SpaceClip *sc)
void WM_cursor_modal_restore(wmWindow *win)
constexpr size_t ARRAY_SIZE(const T(&arg)[N]) noexcept
bool BKE_view_layer_synced_ensure(const Main &bmain, const Scene *scene, ViewLayer *view_layer)
float ED_view3d_calc_zfac(const RegionView3D *rv3d, const float co[3])
ToolSettings * CTX_data_tool_settings(const bContext *C)
void BLI_rng_free(struct RNG *rng) ATTR_NONNULL(1)
MINLINE float len_v3(const float a[3]) ATTR_WARN_UNUSED_RESULT
bool RNA_boolean_get(PointerRNA *ptr, const char *name)
void mat3_to_axis_angle(float axis[3], float *angle, const float mat[3][3])
MINLINE void zero_v3(float r[3])
BLI_INLINE int BLI_rcti_size_x(const struct rcti *rct)
void invert_m3_m3_safe_ortho(float inverse[3][3], const float mat[3][3])
wmMsgBus * CTX_wm_message_bus(const bContext *C)
void ED_uvedit_live_unwrap_end(bool cancel)
float BLI_rng_get_float(struct RNG *rng) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1)
float RNA_property_float_get(PointerRNA *ptr, PropertyRNA *prop)
MINLINE float normalize_v3(float n[3])
MINLINE void add_v3_v3(float r[3], const float a[3])
void mid_v3_v3v3(float r[3], const float a[3], const float b[3])
Main * CTX_data_main(const bContext *C)
void unit_m3(float m[3][3])
BLI_INLINE float BLI_rctf_size_x(const struct rctf *rct)
Paint * BKE_paint_get_active_from_context(const bContext *C)
Base * BKE_view_layer_base_find(ViewLayer *view_layer, Object *ob)
Brush * BKE_paint_brush(Paint *paint)
void RNA_property_boolean_set(PointerRNA *ptr, PropertyRNA *prop, bool value)
Scene * CTX_data_scene(const bContext *C)
MINLINE void copy_v4_v4(float r[4], const float a[4])
void mul_m3_m3m3(float R[3][3], const float A[3][3], const float B[3][3])
void ED_view3d_navigation_free(bContext *C, ViewOpsData *vod)
VecBase< float, 3 > float3
ViewLayer * BKE_view_layer_default_render(const Scene *scene)
ARegion * CTX_wm_region(const bContext *C)
bool ED_space_image_show_uvedit(const SpaceImage *sima, Object *obedit)
MINLINE bool is_zero_v3(const float v[3]) ATTR_WARN_UNUSED_RESULT
Paint * BKE_paint_get_active(const Main &bmain, Scene *sce, ViewLayer *view_layer)
void mat3_to_quat(float q[4], const float mat[3][3])
bool RNA_property_is_set(PointerRNA *ptr, PropertyRNA *prop)
bScreen * ED_screen_animation_playing(const wmWindowManager *wm)
bool WM_paint_cursor_end(wmPaintCursor *handle)
float normalize_qt_qt(float r[4], const float q[4])
KERNEL_FEATURE_LIGHT_PASSES KERNEL_FEATURE_PATH_GUIDING float
bke::ARegionRuntime * runtime
struct PaintCurve * paint_curve
TransformOrientationSlot orientation_slots[4]
struct ToolSettings * toolsettings
ListBaseT< SpaceLink > spacedata
struct MovieClipUser user
struct wmTimer * animtimer
struct ARegionType * type
ListBaseT< wmKeyMapItem > items
struct ReportList * reports
struct wmOperatorType * type
#define ISMOUSE_BUTTON(event_type)