61 if (data_len_all != 1) {
97 std::sort(sorted_index_span.
begin(), sorted_index_span.
end(), compare);
108 const auto compare = [&](
const int a,
const int b) {
113 if (is_selected_a && is_selected_b) {
152 "Expected sorting by selection state to only happen once");
154 const auto compare = [&](
const int a,
const int b) {
160 if (is_selected_a == is_selected_b) {
166 return is_selected_a;
179 const bool use_island,
180 const float proj_vec[3])
219 const float *proj_vec =
nullptr;
228 proj_vec = _proj_vec;
233 int td_table_len = 0;
241 MEM_mallocN(
sizeof(*td_table) * td_table_len, __func__));
244 KDTree_3d *td_tree = BLI_kdtree_3d_new(td_table_len);
246 int td_table_index = 0;
255 BLI_kdtree_3d_insert(td_tree, td_table_index, vec);
256 td_table[td_table_index++] = td;
261 BLI_kdtree_3d_balance(td_tree);
273 KDTreeNearest_3d nearest;
274 const int td_index = BLI_kdtree_3d_find_nearest(td_tree, vec, &nearest);
277 if (td_index != -1) {
278 td->
rdist = nearest.dist;
293 BLI_kdtree_3d_free(td_tree);
306 bool changed =
false;
324 const int old_rootbone =
data->rootbone;
325 if ((chainlen == 0) || (chainlen >
data->max_rootbone)) {
326 data->rootbone =
data->max_rootbone;
329 data->rootbone = chainlen;
331 changed |= (
data->rootbone != old_rootbone);
350 else if (mode == -1) {
362 bool changed =
false;
393 for (td = head; td <= tail; td++) {
409 if (td + 1 <= tail) {
416 if (next_td !=
nullptr) {
421 if (dist < next_td->dist) {
422 next_td->
dist = dist;
429 if (td - 1 >= head) {
436 if (next_td !=
nullptr) {
441 if (dist < next_td->dist) {
442 next_td->
dist = dist;
455 hdata->
ih1 = bezt->
h1;
456 hdata->
h1 = &bezt->
h1;
457 hdata->
ih2 = bezt->
h2;
458 hdata->
h2 = &bezt->
h2;
479 for (
int a = 0; a < tc->
data_len; a++, td++) {
503 dir = (center[0] > cframe) ?
'R' :
'L';
527 return (frame >= cframe);
529 return (frame <= cframe);
816 const short object_type = obact ? obact->
type : -1;
829 params.object_mode = object_mode;
837 objects = local_objects;
843 for (
int i = 0;
i < objects.
size();
i++) {
999 *r_obj_armature = ob_armature;
1026 Object *ob_armature =
nullptr;
1029 printf(
"edit type not implemented!\n");
1104 for (; md; md = md->
next) {
1116 float mtx[4][4], imtx[4][4];
1122 mul_m4_m4m4(mtx, obinv, ob->object_to_world().ptr());
1128 float loc[3], iloc[3];
1130 if (td->
loc ==
nullptr) {
1146 bool is_clipping =
false;
1148 if (
fabsf(iloc[0]) <= mmd->
tolerance || loc[0] * iloc[0] < 0.0f) {
1155 if (
fabsf(iloc[1]) <= mmd->
tolerance || loc[1] * iloc[1] < 0.0f) {
1161 if (
fabsf(iloc[2]) <= mmd->
tolerance || loc[2] * iloc[2] < 0.0f) {
1186 if (
ELEM(
nullptr, scene,
id, sad)) {
1208 const float2 frame_range = adt->
action->wrap().get_frame_range_of_keys(
true);
1209 if (frame_range[1] > frame_range[0] + 2.0f) {
1221 "Expecting un-assigning an action to always work when pushing down an NLA strip");
1232 if (is_first ==
false) {
1261 float delta_x = td->
loc[0] - td->
iloc[0];
1262 float delta_y = (td->
loc[1] - td->
iloc[1]) * y_fac;
1270 td2d->
h1[0] = td2d->
ih1[0] + delta_x;
1271 td2d->
h1[1] = td2d->
ih1[1] + delta_y;
1274 td2d->
h2[0] = td2d->
ih2[0] + delta_x;
1275 td2d->
h2[1] = td2d->
ih2[1] + delta_y;
Functions to insert, delete or modify keyframes.
Blender kernel action and pose functionality.
AnimData * BKE_animdata_from_id(const ID *id)
Main * CTX_data_main(const bContext *C)
void BKE_view_layer_synced_ensure(const Scene *scene, ViewLayer *view_layer)
blender::Vector< Object * > BKE_view_layer_array_from_objects_in_mode_params(const Scene *scene, ViewLayer *view_layer, const View3D *v3d, const ObjectsInModeParams *params)
Object * BKE_view_layer_active_object_get(const ViewLayer *view_layer)
NlaStrip * BKE_nlastack_add_strip(OwnedAnimData owned_adt, const bool is_liboverride)
void BKE_nlastrip_validate_fcurves(NlaStrip *strip)
void BKE_scene_graph_evaluated_ensure(Depsgraph *depsgraph, Main *bmain)
#define BLI_assert_msg(a, msg)
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)
#define LISTBASE_FOREACH(type, var, list)
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])
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_m3_m3(float inverse[3][3], const float mat[3][3])
void mul_m4_v3(const float M[4][4], float r[3])
void copy_m4_m4(float m1[4][4], const float m2[4][4])
void mul_v3_m4v3(float r[3], const float mat[4][4], const float vec[3])
bool invert_m4_m4(float inverse[4][4], const float mat[4][4])
void mul_v3_m3v3(float r[3], const float M[3][3], const float a[3])
bool invert_m4_m4_fallback(float inverse[4][4], const float mat[4][4])
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])
MINLINE float normalize_v3_v3(float r[3], const float a[3])
MINLINE float len_v3(const float a[3]) ATTR_WARN_UNUSED_RESULT
#define UNUSED_VARS_NDEBUG(...)
void DEG_relations_tag_update(Main *bmain)
#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
@ ACTCON_MIX_BEFORE_SPLIT
@ TRANSLIKE_MIX_BEFORE_SPLIT
@ TRANSLIKE_MIX_BEFORE_FULL
#define OB_MODE_ALL_PAINT
#define OB_MODE_ALL_WEIGHT_PAINT
#define OB_MODE_ALL_PAINT_GPENCIL
@ SCE_XFORM_SKIP_CHILDREN
@ AUTOKEY_FLAG_LAYERED_RECORD
@ AUTOKEY_FLAG_INSERTAVAILABLE
@ V3D_AROUND_CENTER_BOUNDS
@ V3D_AROUND_CENTER_MEDIAN
@ V3D_AROUND_LOCAL_ORIGINS
PTCacheEdit * PE_get_current(Depsgraph *depsgraph, Scene *scene, Object *ob)
int PE_start_edit(PTCacheEdit *edit)
Read Guarded memory(de)allocation.
#define MEM_reallocN(vmemh, len)
void UI_view2d_region_to_view(const View2D *v2d, float x, float y, float *r_view_x, float *r_view_y) ATTR_NONNULL()
BMesh const char void * data
constexpr T * end() const
constexpr T * begin() const
constexpr int64_t size() const
constexpr bool is_empty() const
void * MEM_mallocN(size_t len, const char *str)
void * MEM_calloc_arrayN(size_t len, size_t size, const char *str)
void * MEM_malloc_arrayN(size_t len, size_t size, const char *str)
void MEM_freeN(void *vmemh)
ActionSlotAssignmentResult assign_action_slot_handle(NlaStrip &strip, slot_handle_t slot_handle, ID &animated_id)
bool unassign_action(ID &animated_id)
bool is_keying_flag(const Scene *scene, eKeying_Flag flag)
void fill_index_range(MutableSpan< T > span, const T start=0)
bool sequencer_retiming_mode_is_active(const bContext *C)
VecBase< float, 2 > float2
VecBase< float, 3 > float3
struct Object * mirror_ob
struct ModifierData * next
struct SculptSession * sculpt
struct ToolSettings * toolsettings
struct Object * ob_center