77 if (data_len_all != 1) {
139 if (i < tc->data_len) {
164 while (sel > unsel) {
199 const float *proj_vec =
NULL;
208 proj_vec = _proj_vec;
213 int td_table_len = 0;
216 for (
a = 0;
a < tc->data_len;
a++, td++) {
232 KDTree_3d *td_tree = BLI_kdtree_3d_new(td_table_len);
234 int td_table_index = 0;
237 for (
a = 0;
a < tc->data_len;
a++, td++) {
244 if (tc->use_local_mat) {
252 if (tc->use_local_mat) {
266 BLI_kdtree_3d_insert(td_tree, td_table_index, vec);
267 td_table[td_table_index++] = td;
277 BLI_kdtree_3d_balance(td_tree);
282 for (
a = 0;
a < tc->data_len;
a++, td++) {
287 if (tc->use_local_mat) {
295 if (tc->use_local_mat) {
309 KDTreeNearest_3d nearest;
310 const int td_index = BLI_kdtree_3d_find_nearest(td_tree, vec, &nearest);
313 if (td_index != -1) {
314 td->
rdist = nearest.dist;
316 copy_v3_v3(td->center, td_table[td_index]->center);
328 BLI_kdtree_3d_free(td_tree);
342 bool changed =
false;
357 const int old_rootbone =
data->rootbone;
358 if ((chainlen == 0) || (chainlen >
data->max_rootbone)) {
359 data->rootbone =
data->max_rootbone;
362 data->rootbone = chainlen;
364 changed |= (
data->rootbone != old_rootbone);
377 short *chainlen = &
t->settings->autoik_chainlen;
385 else if (mode == -1) {
397 bool changed =
false;
402 if (
ELEM(
NULL, tc->poseobj, tc->poseobj->pose)) {
406 for (pchan = tc->poseobj->pose->chanbase.first; pchan; pchan = pchan->
next) {
428 for (td = head; td <= tail; td++) {
444 if (td + 1 <= tail) {
456 if (dist < next_td->dist) {
457 next_td->
dist = dist;
464 if (td - 1 >= head) {
476 if (dist < next_td->dist) {
477 next_td->
dist = dist;
491 hdata->
ih1 = bezt->
h1;
492 hdata->
h1 = &bezt->
h1;
493 hdata->
ih2 = bezt->
h2;
494 hdata->
h2 = &bezt->
h2;
506 bool clipx =
true, clipy =
true;
515 float base_offset[2] = {0.0f, 0.0f};
518 if (is_tiled_image) {
520 if (nearest_tile_index != -1) {
521 nearest_tile_index -= 1001;
523 base_offset[0] = nearest_tile_index % 10;
524 base_offset[1] = nearest_tile_index / 10;
528 min[0] =
min[1] = FLT_MAX;
529 max[0] =
max[1] = FLT_MIN;
536 for (
a = 0, td = tc->data; a < tc->data_len;
a++, td++) {
542 if (
min[0] < base_offset[0] &&
t->center_global[0] > base_offset[0] &&
543 t->center_global[0] < base_offset[0] + (
t->aspect[0] * 0.5f)) {
544 vec[0] *= (
t->center_global[0] - base_offset[0]) / (
t->center_global[0] -
min[0]);
546 else if (
max[0] > (base_offset[0] +
t->aspect[0]) &&
547 t->center_global[0] < (base_offset[0] +
t->aspect[0])) {
548 vec[0] *= (
t->center_global[0] - (base_offset[0] +
t->aspect[0])) /
549 (
t->center_global[0] -
max[0]);
555 if (
min[1] < base_offset[1] &&
t->center_global[1] > base_offset[1] &&
556 t->center_global[1] < base_offset[1] + (
t->aspect[1] * 0.5f)) {
557 vec[1] *= (
t->center_global[1] - base_offset[1]) / (
t->center_global[1] -
min[1]);
559 else if (
max[1] > (base_offset[1] +
t->aspect[1]) &&
560 t->center_global[1] < (base_offset[1] +
t->aspect[1])) {
561 vec[1] *= (
t->center_global[1] - (base_offset[1] +
t->aspect[1])) /
562 (
t->center_global[1] -
max[1]);
569 if (
min[0] < base_offset[0]) {
570 vec[0] += base_offset[0] -
min[0];
572 else if (
max[0] > base_offset[0] +
t->aspect[0]) {
573 vec[0] -=
max[0] - base_offset[0] -
t->aspect[0];
579 if (
min[1] < base_offset[1]) {
580 vec[1] += base_offset[1] -
min[1];
582 else if (
max[1] > base_offset[1] +
t->aspect[1]) {
583 vec[1] -=
max[1] - base_offset[1] -
t->aspect[1];
590 return (clipx || clipy);
597 for (
int a = 0;
a < tc->data_len;
a++, td++) {
598 if ((td->flag &
TD_SKIP) || (!td->loc)) {
624 r_dir = (
center[0] > cframe) ?
'R' :
'L';
649 return (frame >= cframe);
651 return (frame <= cframe);
694 for (
int i = 0; i < fcu->
totvert; i++) {
703 rk->val += bezt->
vec[1][1];
709 if (rk->frame < bezt->
vec[1][0]) {
716 if (found ==
false) {
720 rk->
val = bezt->
vec[1][1];
731 printf(
"%s: nothing to do for FCurve %p (rna_path = '%s')\n", __func__, fcu, fcu->
rna_path);
738 rk->val = rk->val / (
float)rk->tot_count;
746 for (
int i = fcu->
totvert - 1; i >= 0; i--) {
760 if (rk->del_count == rk->tot_count - 1) {
762 if (can_average_points) {
764 bezt->
vec[1][1] = rk->val;
815 for (con = list->
first; con; con = con->
next) {
900 if (
t->data_len_all == 0 ||
t->mode ==
TFM_DUMMY) {
905 switch (
t->data_type) {
986 int data_container_len_orig =
t->data_container_len;
988 *tc = &
t->data_container[
t->data_container_len - 1];
991 if (tc->data_len == 0) {
992 uint index = tc -
t->data_container;
993 if (index + 1 !=
t->data_container_len) {
995 t->data_container[index],
996 t->data_container[
t->data_container_len - 1]);
998 t->data_container_len -= 1;
1001 t->data_len_all += tc->data_len;
1004 if (data_container_len_orig !=
t->data_container_len) {
1006 sizeof(*
t->data_container) *
t->data_container_len);
1008 return t->data_len_all;
1014 switch (convert_type) {
1092 switch (
t->data_type) {
1125 const short object_type = obact ? obact->
type : -1;
1129 if (
t->data_container) {
1133 bool free_objects =
false;
1134 if (objects ==
NULL) {
1140 .object_mode = object_mode,
1141 .no_dup_data = true,
1143 free_objects =
true;
1146 t->data_container =
MEM_callocN(
sizeof(*
t->data_container) * objects_len, __func__);
1147 t->data_container_len = objects_len;
1149 for (
int i = 0; i < objects_len; i++) {
1194 switch (data_type) {
1269 else if (
t->obedit_type ==
OB_MESH) {
1296 else if (
t->obedit_type != -1) {
1324 *r_obj_armature = ob_armature;
1348 return convert_type;
1353 t->data_len_all = -1;
1368 switch (
t->data_type) {
1473 printf(
"edit type not implemented!\n");
1475 t->data_len_all = 0;
1495 float tolerance[3] = {0.0f, 0.0f, 0.0f};
1498 for (; md; md = md->
next) {
1517 float mtx[4][4], imtx[4][4];
1529 for (i = 0; i < tc->data_len; i++, td++) {
1531 float loc[3], iloc[3];
1533 if (td->loc ==
NULL) {
1551 if (
fabsf(iloc[0]) <= tolerance[0] || loc[0] * iloc[0] < 0.0f) {
1558 if (
fabsf(iloc[1]) <= tolerance[1] || loc[1] * iloc[1] < 0.0f) {
1564 if (
fabsf(iloc[2]) <= tolerance[2] || loc[2] * iloc[2] < 0.0f) {
1617 if (aend > astart + 2.0f) {
1633 if (is_first ==
false) {
1666 float aspect_inv[2];
1668 aspect_inv[0] = 1.0f /
t->aspect[0];
1669 aspect_inv[1] = 1.0f /
t->aspect[1];
1671 td->loc[0] = td->loc[0] * aspect_inv[0];
1672 td->loc[1] = td->loc[1] * aspect_inv[1];
1697 switch (
t->data_type) {
typedef float(TangentPoint)[2]
Blender kernel action and pose functionality.
void calc_action_range(const struct bAction *act, float *start, float *end, short incl_modifiers)
struct AnimData * BKE_animdata_from_id(struct ID *id)
struct Main * CTX_data_main(const bContext *C)
void testhandles_fcurve(struct FCurve *fcu, eBezTriple_Flag sel_flag, const bool use_handle)
#define BEZT_BINARYSEARCH_THRESH
int BKE_image_find_nearest_tile(const struct Image *image, const float co[2])
#define BKE_view_layer_array_from_objects_in_mode(view_layer, v3d, r_len,...)
void id_us_min(struct ID *id)
void BKE_nlastrip_validate_fcurves(struct NlaStrip *strip)
struct NlaStrip * BKE_nlastack_add_strip(struct AnimData *adt, struct bAction *act, const bool is_liboverride)
void BKE_scene_graph_evaluated_ensure(struct Depsgraph *depsgraph, struct Main *bmain)
A kd-tree for nearest neighbor search.
BLI_LINKSTACK_*** wrapper macros for using a LinkNode to store a stack of pointers,...
#define BLI_LINKSTACK_PUSH(var, ptr)
#define BLI_LINKSTACK_DECLARE(var, type)
#define BLI_LINKSTACK_FREE(var)
#define BLI_LINKSTACK_INIT(var)
#define BLI_LINKSTACK_POP(var)
BLI_INLINE bool BLI_listbase_is_empty(const struct ListBase *lb)
#define LISTBASE_FOREACH(type, var, list)
void void BLI_freelistN(struct ListBase *listbase) ATTR_NONNULL(1)
void BLI_addtail(struct ListBase *listbase, void *vlink) ATTR_NONNULL(1)
MINLINE float max_ff(float a, float b)
MINLINE float min_ff(float a, float b)
void mul_m3_v3(const float M[3][3], float r[3])
void mul_m4_m4m4(float R[4][4], const float A[4][4], const float B[4][4])
bool invert_m4_m4_fallback(float R[4][4], const float A[4][4])
void normalize_m3_m3(float R[3][3], const float M[3][3]) ATTR_NONNULL()
void copy_m3_m3(float m1[3][3], const float m2[3][3])
void copy_m3_m4(float m1[3][3], const float m2[4][4])
bool invert_m4_m4(float R[4][4], const float A[4][4])
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 copy_m4_m4(float m1[4][4], const float m2[4][4])
void mul_v3_m4v3(float r[3], const float M[4][4], const float v[3])
void mul_v3_m3v3(float r[3], const float M[3][3], const float a[3])
MINLINE void sub_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 void copy_v3_v3(float r[3], const float a[3])
void project_v3_v3v3(float out[3], const float p[3], const float v_proj[3])
void minmax_v2v2_v2(float min[2], float max[2], const float vec[2])
MINLINE float normalize_v3_v3(float r[3], const float a[3])
MINLINE float len_v3(const float a[3]) ATTR_WARN_UNUSED_RESULT
void DEG_id_tag_update(struct ID *id, int flag)
void DEG_relations_tag_update(struct Main *bmain)
@ ID_RECALC_COPY_ON_WRITE
#define ID_IS_OVERRIDE_LIBRARY(_id)
@ NLASTRIP_FLAG_USR_INFLUENCE
@ NLASTRIP_FLAG_AUTO_BLENDS
@ NLASTRIP_EXTEND_NOTHING
@ CONSTRAINT_TYPE_CHILDOF
@ CONSTRAINT_TYPE_TRANSFORM
@ CONSTRAINT_TYPE_FOLLOWTRACK
@ CONSTRAINT_TYPE_OBJECTSOLVER
@ CONSTRAINT_TYPE_ARMATURE
@ CONSTRAINT_TYPE_ROTLIKE
@ CONSTRAINT_TYPE_KINEMATIC
@ CONSTRAINT_TYPE_TRANSLIKE
@ CONSTRAINT_TYPE_CLAMPTO
@ CONSTRAINT_TYPE_FOLLOWPATH
#define BEZT_ISSEL_ANY(bezt)
#define OB_MODE_ALL_PAINT
#define OB_MODE_ALL_WEIGHT_PAINT
@ SCE_XFORM_SKIP_CHILDREN
#define OBACT(_view_layer)
@ ANIMRECORD_FLAG_WITHNLA
@ V3D_AROUND_CENTER_BOUNDS
@ V3D_AROUND_CENTER_MEDIAN
@ V3D_AROUND_LOCAL_ORIGINS
#define IS_AUTOKEY_FLAG(scene, flag)
int PE_start_edit(struct PTCacheEdit *edit)
struct PTCacheEdit * PE_get_current(struct Depsgraph *depsgraph, struct Scene *scene, struct Object *ob)
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
Read Guarded memory(de)allocation.
#define MEM_reallocN(vmemh, len)
void UI_view2d_region_to_view(const struct View2D *v2d, float x, float y, float *r_view_x, float *r_view_y) ATTR_NONNULL()
void delete_fcurve_key(FCurve *fcu, int index, bool do_recalc)
void(* MEM_freeN)(void *vmemh)
void *(* MEM_callocN)(size_t len, const char *str)
void *(* MEM_mallocN)(size_t len, const char *str)
ThreadQueue * queue
all scheduled work for the cpu
struct Object * mirror_ob
struct ModifierData * next
struct SculptSession * sculpt
struct ToolSettings * toolsettings
TransDataCurveHandleFlags * hdata
struct Object * ob_center
struct bConstraint * next
struct bPoseChannel * next
struct tRetainedKeyframe * prev
struct tRetainedKeyframe * next