Blender V5.3
armature_update.cc
Go to the documentation of this file.
1/* SPDX-FileCopyrightText: 2015 Blender Authors
2 *
3 * SPDX-License-Identifier: GPL-2.0-or-later */
4
8
9#include <algorithm>
10
11#include "MEM_guardedalloc.h"
12
13#include "BLI_listbase.hh"
14#include "BLI_math_matrix_c.hh"
16#include "BLI_math_vector_c.hh"
17#include "BLI_utildefines.hh"
18
19#include "DNA_armature_types.h"
21#include "DNA_curve_types.h"
22#include "DNA_object_types.h"
23
24#include "BKE_action.hh"
25#include "BKE_anim_path.h"
26#include "BKE_armature.hh"
27#include "BKE_constraint.h"
28#include "BKE_curve.hh"
29#include "BKE_object_types.hh"
30#include "BKE_scene.hh"
31
32#include "BIK_api.h"
33
34#include "DEG_depsgraph.hh"
35
36namespace blender {
37
38/* ********************** SPLINE IK SOLVER ******************* */
39
40/* Temporary evaluation tree data used for Spline IK */
43
44 int type; /* type of IK that this serves (CONSTRAINT_TYPE_KINEMATIC or ..._SPLINEIK) */
45
46 short chainlen; /* number of bones in the chain */
47 float totlength; /* total length of bones in the chain */
48
49 const float *points; /* parametric positions for the joints along the curve */
50
51 /* Chain of bones to affect using Spline IK (ordered from the tip). */
53
54 bPoseChannel *root; /* bone that is the root node of the chain */
55
56 bConstraint *con; /* constraint for this chain */
57 bSplineIKConstraint *ik_data; /* constraint settings for this chain */
58};
59
60/* ----------- */
61
62/* Tag the bones in the chain formed by the given bone for IK. */
63static void splineik_init_tree_from_pchan(Scene * /*scene*/, Object *ob, bPoseChannel *pchan_tip)
64{
65 bPoseChannel *pchan, *pchan_root = nullptr;
66 bConstraint *con = nullptr;
67 bSplineIKConstraint *ik_data = nullptr;
68 float totlength = 0.0f;
69 int segcount = 0;
70
71 /* Find the SplineIK constraint. */
72 for (con = pchan_tip->constraints.first(); con; con = con->next) {
73 if (con->type == CONSTRAINT_TYPE_SPLINEIK) {
74 ik_data = static_cast<bSplineIKConstraint *>(con->data);
75
76 /* Target can only be a curve. */
77 if ((ik_data->tar == nullptr) || (ik_data->tar->type != OB_CURVES_LEGACY)) {
78 continue;
79 }
80 /* Skip if disabled. */
82 continue;
83 }
84
85 /* Otherwise, constraint is ok... */
86 break;
87 }
88 }
89 if (con == nullptr) {
90 return;
91 }
92
93 /* Find the root bone and the chain of bones from the root to the tip.
94 * NOTE: this assumes that the bones are connected, but that may not be true... */
95 Bone *pchan_bone = pchan_tip->bone_get(*ob);
96 Array<bPoseChannel *> pchan_chain(ik_data->chainlen);
97 Array<float> bone_lengths(ik_data->chainlen);
98 for (pchan = pchan_tip; pchan && (segcount < ik_data->chainlen);
99 pchan = pchan->parent, pchan_bone = pchan_bone->parent, segcount++)
100 {
101 /* Store this segment in the chain. */
102 pchan_chain[segcount] = pchan;
103
104 /* If performing rebinding, calculate the length of the bone. */
105 bone_lengths[segcount] = pchan_bone->length;
106 totlength += bone_lengths[segcount];
107 }
108
109 if (segcount == 0) {
110 return;
111 }
112
113 pchan_root = pchan_chain[segcount - 1];
114
115 /* Perform binding step if required. */
116 if ((ik_data->flag & CONSTRAINT_SPLINEIK_BOUND) == 0) {
117 float segmentLen = (1.0f / float(segcount));
118
119 /* Setup new empty array for the points list. */
120 if (ik_data->points) {
121 MEM_delete(ik_data->points);
122 }
123 ik_data->numpoints = ik_data->chainlen + 1;
124 ik_data->points = MEM_new_array_uninitialized<float>(size_t(ik_data->numpoints),
125 "Spline IK Binding");
126
127 /* Bind 'tip' of chain (i.e. first joint = tip of bone with the Spline IK Constraint). */
128 ik_data->points[0] = 1.0f;
129
130 /* Perform binding of the joints to parametric positions along the curve based
131 * proportion of the total length that each bone occupies.
132 */
133 for (int i = 0; i < segcount; i++) {
134 /* 'head' joints, traveling towards the root of the chain.
135 * - 2 methods; the one chosen depends on whether we've got usable lengths.
136 */
137 if ((ik_data->flag & CONSTRAINT_SPLINEIK_EVENSPLITS) || (totlength == 0.0f)) {
138 /* 1) Equi-spaced joints. */
139 ik_data->points[i + 1] = ik_data->points[i] - segmentLen;
140 }
141 else {
142 /* 2) To find this point on the curve, we take a step from the previous joint
143 * a distance given by the proportion that this bone takes.
144 */
145 ik_data->points[i + 1] = ik_data->points[i] - (bone_lengths[i] / totlength);
146 }
147 }
148
149 /* Spline has now been bound. */
151 }
152
153 /* Disallow negative values (happens with float precision). */
154 CLAMP_MIN(ik_data->points[segcount], 0.0f);
155
156 /* Make a new Spline-IK chain, and store it in the IK chains. */
157 /* TODO: we should check if there is already an IK chain on this,
158 * since that would take precedence... */
159 {
160 /* Make a new tree. */
161 tSplineIK_Tree *tree = MEM_new<tSplineIK_Tree>("SplineIK Tree");
163
164 tree->chainlen = segcount;
165 tree->totlength = totlength;
166
167 /* Move the array of links to bones in the chain (from tip to root) to the tree. */
168 tree->chain = std::move(pchan_chain);
169
170 /* Store reference to joint position array. */
171 tree->points = ik_data->points;
172
173 /* Store references to different parts of the chain. */
174 tree->root = pchan_root;
175 tree->con = con;
176 tree->ik_data = ik_data;
177
178 /* AND! Link the tree to the root. */
179 BLI_addtail(&pchan_root->siktree, tree);
180 }
181
182 /* Mark root channel having an IK tree. */
183 pchan_root->flag |= POSE_IKSPLINE;
184}
185
186/* Tag which bones are members of Spline IK chains. */
187static void splineik_init_tree(Scene *scene, Object *ob, float /*ctime*/)
188{
189 /* Find the tips of Spline IK chains,
190 * which are simply the bones which have been tagged as such. */
191 for (bPoseChannel &pchan : ob->pose->chanbase) {
192 if (pchan.constflag & PCHAN_HAS_SPLINEIK) {
193 splineik_init_tree_from_pchan(scene, ob, &pchan);
194 }
195 }
196}
197
198/* ----------- */
199
201 float curve_position; /* Current position along the curve. */
202 float curve_scale; /* Global scale to apply to curve positions. */
203 float locrot_offset[4][4]; /* Bone rotation and location offset inherited from parent. */
204 float prev_tail_loc[3]; /* Tail location of the previous bone. */
205 float prev_tail_radius; /* Tail curve radius of the previous bone. */
206 int prev_tail_seg_idx; /* Curve segment the previous tail bone belongs to. */
207};
208
209/* Prepare data to evaluate spline IK. */
211{
212 bSplineIKConstraint *ik_data = tree->ik_data;
213
214 /* Make sure that the constraint targets are ok, to avoid crashes
215 * in case of a depsgraph bug or dependency cycle.
216 */
217 if (ik_data->tar == nullptr) {
218 return false;
219 }
220
221 CurveCache *cache = ik_data->tar->runtime->curve_cache;
222
223 if (ELEM(nullptr, cache, cache->anim_path_accum_length)) {
224 return false;
225 }
226
227 /* Initialize the evaluation state. */
228 state->curve_position = 0.0f;
229 state->curve_scale = 1.0f;
230 unit_m4(state->locrot_offset);
231 zero_v3(state->prev_tail_loc);
232 state->prev_tail_radius = 1.0f;
233 state->prev_tail_seg_idx = 0;
234
235 /* Apply corrections for sensitivity to scaling. */
236 if ((ik_data->yScaleMode != CONSTRAINT_SPLINEIK_YS_FIT_CURVE) && (tree->totlength != 0.0f)) {
237 /* Get the current length of the curve. */
238 /* NOTE: This is assumed to be correct even after the curve was resized. */
239 const float spline_len = BKE_anim_path_get_length(cache);
240
241 /* Calculate the scale factor to multiply all the path values by so that the
242 * bone chain retains its current length, such that:
243 * maxScale * splineLen = totLength
244 */
245 state->curve_scale = tree->totlength / spline_len;
246 }
247
248 return true;
249}
250
252 bSplineIKConstraint *ik_data, Object *ob, float radius, float r_vec[3], float *r_radius)
253{
254 /* Apply the curve's object-mode transforms to the position
255 * unless the option to allow curve to be positioned elsewhere is activated (i.e. no root).
256 */
257 if ((ik_data->flag & CONSTRAINT_SPLINEIK_NO_ROOT) == 0) {
258 mul_m4_v3(ik_data->tar->object_to_world().ptr(), r_vec);
259 }
260
261 /* Convert the position to pose-space. */
262 mul_m4_v3(ob->world_to_object().ptr(), r_vec);
263
264 /* Set the new radius (it should be the average value). */
265 *r_radius = (radius + *r_radius) / 2;
266}
267
268static float dist_to_sphere_shell(const float sphere_origin[3],
269 const float sphere_radius,
270 const float point[3])
271{
272 float vec[3];
273 sub_v3_v3v3(vec, sphere_origin, point);
274 return sphere_radius - len_v3(vec);
275}
276
277/* This function positions the tail of the bone so that it preserves the length of it.
278 * The length of the bone can be seen as a sphere radius.
279 */
281 const float head_pos[3],
282 const float sphere_radius,
283 int prev_seg_idx,
284 float r_tail_pos[3],
285 float *r_new_curve_pos,
286 float *r_radius)
287{
288 /* This is using the tessellated curve data.
289 * So we are working with piece-wise linear curve segments.
290 * The same method is used in #BKE_where_on_path to get curve location data. */
291 const CurveCache *cache = ik_data->tar->runtime->curve_cache;
292 const float *seg_accum_len = cache->anim_path_accum_length;
293
294 int max_seg_idx = BKE_anim_path_get_array_size(cache) - 1;
295
296 /* Make an initial guess of where our intersection point will be.
297 * If the curve was a straight line, then the fraction passed in r_new_curve_pos
298 * would be the correct location.
299 * So make it our first initial guess.
300 */
301 const float spline_len = BKE_anim_path_get_length(cache);
302 const float guessed_len = *r_new_curve_pos * spline_len;
303
304 BLI_assert(prev_seg_idx >= 0);
305 int cur_seg_idx = prev_seg_idx;
306 while (cur_seg_idx < max_seg_idx && guessed_len > seg_accum_len[cur_seg_idx]) {
307 cur_seg_idx++;
308 }
309
310 /* Convert the segment to bev points.
311 * For example, the segment with index 0 will have bev points 0 and 1.
312 */
313 int bp_idx = cur_seg_idx + 1;
314
315 const BevList *bl = cache->bev.first();
316 bool is_cyclic = bl->poly >= 0;
317 BevPoint *bp = bl->bevpoints;
318 BevPoint *prev_bp;
319 bp = bp + bp_idx;
320 prev_bp = bp - 1;
321
322 /* Go to the next tessellated curve point until we cross to outside of the sphere. */
323 while (len_v3v3(head_pos, bp->vec) < sphere_radius) {
324 if (bp_idx > max_seg_idx) {
325 /* We are outside the defined curve. We will now extrapolate the intersection point. */
326 break;
327 }
328 prev_bp = bp;
329 if (is_cyclic && bp_idx == max_seg_idx) {
330 /* Wrap around to the start point.
331 * Don't set the bp_idx to zero here as we use it to get the segment index later.
332 */
333 bp = bl->bevpoints;
334 }
335 else {
336 bp++;
337 }
338 bp_idx++;
339 }
340
341 /* Calculate the intersection point using the secant root finding method */
342 float x0 = 0.0f, x1 = 1.0f;
343 float x0_point[3], x1_point[3], start_p[3];
344 float epsilon = std::max({1.0f, len_v3(head_pos), len_v3(bp->vec)}) * FLT_EPSILON;
345
346 if (prev_seg_idx == bp_idx - 1) {
347 /* The intersection lies inside the same segment as the last point.
348 * Set the last point to be the start search point so we minimize the risks of going backwards
349 * on the curve.
350 */
351 copy_v3_v3(start_p, head_pos);
352 }
353 else {
354 copy_v3_v3(start_p, prev_bp->vec);
355 }
356
357 for (int i = 0; i < 10; i++) {
358 interp_v3_v3v3(x0_point, start_p, bp->vec, x0);
359 interp_v3_v3v3(x1_point, start_p, bp->vec, x1);
360
361 float f_x0 = dist_to_sphere_shell(head_pos, sphere_radius, x0_point);
362 float f_x1 = dist_to_sphere_shell(head_pos, sphere_radius, x1_point);
363
364 if (fabsf(f_x1) <= epsilon || f_x0 == f_x1) {
365 break;
366 }
367
368 const float x2 = x1 - f_x1 * (x1 - x0) / (f_x1 - f_x0);
369 x0 = x1;
370 x1 = x2;
371 }
372 /* Found the bone tail position! */
373 copy_v3_v3(r_tail_pos, x1_point);
374
375 /* Because our intersection point lies inside the current segment,
376 * Convert our bevpoint index back to the previous segment index (-2 instead of -1).
377 * This is because our actual location is prev_seg_len + isect_seg_len.
378 */
379 prev_seg_idx = bp_idx - 2;
380 float prev_seg_len = 0;
381
382 if (prev_seg_idx < 0) {
383 prev_seg_idx = 0;
384 prev_seg_len = 0;
385 }
386 else {
387 prev_seg_len = seg_accum_len[prev_seg_idx];
388 }
389
390 /* Convert the point back into the 0-1 interpolation range. */
391 const float isect_seg_len = len_v3v3(prev_bp->vec, r_tail_pos);
392 const float frac = isect_seg_len / len_v3v3(prev_bp->vec, bp->vec);
393 *r_new_curve_pos = (prev_seg_len + isect_seg_len) / spline_len;
394
395 if (*r_new_curve_pos > 1.0f) {
396 *r_radius = bp->radius;
397 }
398 else {
399 *r_radius = (1.0f - frac) * prev_bp->radius + frac * bp->radius;
400 }
401
402 /* Return the current segment. */
403 return bp_idx - 1;
404}
405
406/* Evaluate spline IK for a given bone. */
409{
410 bSplineIKConstraint *ik_data = tree->ik_data;
411 Bone *pchan_bone = pchan->bone_get(*ob);
412
413 if (pchan_bone->length < FLT_EPSILON) {
414 /* Only move the bone position with zero length bones. */
415 float bone_pos[4], rad;
417 ik_data->tar, state->curve_position, bone_pos, nullptr, nullptr, &rad, nullptr);
418
419 apply_curve_transform(ik_data, ob, rad, bone_pos, &rad);
420
421 copy_v3_v3(pchan->pose_mat[3], bone_pos);
422 copy_v3_v3(pchan->pose_head, bone_pos);
423 copy_v3_v3(pchan->pose_tail, bone_pos);
424 pchan->flag |= POSE_DONE;
425 return;
426 }
427
428 float orig_head[3], orig_tail[3], pose_head[3], pose_tail[3];
429 float base_pose_mat[3][3], pose_mat[3][3];
430 float spline_vec[3], scale_fac, radius = 1.0f;
431 float tail_blend_fac = 0.0f;
432
433 mul_v3_m4v3(pose_head, state->locrot_offset, pchan->pose_head);
434 mul_v3_m4v3(pose_tail, state->locrot_offset, pchan->pose_tail);
435
436 copy_v3_v3(orig_head, pose_head);
437
438 /* First, adjust the point positions on the curve. */
439 float curveLen = tree->points[index] - tree->points[index + 1];
440 float bone_len = len_v3v3(pose_head, pose_tail);
441 float point_start = state->curve_position;
442 float pose_scale = bone_len / pchan_bone->length;
443 float base_scale = 1.0f;
444
446 /* Carry over the bone Y scale to the curve range. */
447 base_scale = pose_scale;
448 }
449
450 float point_end = point_start + curveLen * base_scale * state->curve_scale;
451
452 state->curve_position = point_end;
453
454 /* Step 1: determine the positions for the endpoints of the bone. */
455 if (point_start < 1.0f) {
456 float vec[4], rad;
457 radius = 0.0f;
458
459 /* Calculate head position. */
460 if (point_start == 0.0f) {
461 /* Start of the path. We have no previous tail position to copy. */
462 BKE_where_on_path(ik_data->tar, point_start, vec, nullptr, nullptr, &rad, nullptr);
463 }
464 else {
465 copy_v3_v3(vec, state->prev_tail_loc);
466 rad = state->prev_tail_radius;
467 }
468
469 radius = rad;
470 copy_v3_v3(pose_head, vec);
471 apply_curve_transform(ik_data, ob, rad, pose_head, &radius);
472
473 /* Calculate tail position. */
475 float sphere_radius;
476
478 sphere_radius = bone_len;
479 }
480 else {
481 /* Don't take bone scale into account. */
482 sphere_radius = pchan_bone->length;
483 }
484
485 /* Calculate the tail position with sphere curve intersection. */
486 state->prev_tail_seg_idx = position_tail_on_spline(
487 ik_data, vec, sphere_radius, state->prev_tail_seg_idx, pose_tail, &point_end, &rad);
488
489 state->prev_tail_radius = rad;
490 copy_v3_v3(state->prev_tail_loc, pose_tail);
491
492 apply_curve_transform(ik_data, ob, rad, pose_tail, &radius);
493 state->curve_position = point_end;
494 }
495 else {
496 /* Scale to fit curve end position. */
497 if (BKE_where_on_path(ik_data->tar, point_end, vec, nullptr, nullptr, &rad, nullptr)) {
498 state->prev_tail_radius = rad;
499 copy_v3_v3(state->prev_tail_loc, vec);
500 copy_v3_v3(pose_tail, vec);
501 apply_curve_transform(ik_data, ob, rad, pose_tail, &radius);
502 }
503 }
504
505 /* Determine if the bone should still be affected by SplineIK.
506 * This makes it so that the bone slowly becomes poseable again the further it rolls off the
507 * curve. When the whole bone has rolled off the curve, the IK constraint will not influence it
508 * anymore.
509 */
510 if (point_end >= 1.0f) {
511 /* Blending factor depends on the amount of the bone still left on the chain. */
512 tail_blend_fac = (1.0f - point_start) / (point_end - point_start);
513 }
514 else {
515 tail_blend_fac = 1.0f;
516 }
517 }
518
519 /* Step 2: determine the implied transform from these endpoints.
520 * - splineVec: the vector direction that the spline applies on the bone.
521 * - scaleFac: the factor that the bone length is scaled by to get the desired amount.
522 */
523 sub_v3_v3v3(spline_vec, pose_tail, pose_head);
524 scale_fac = len_v3(spline_vec) / pchan_bone->length;
525
526 /* Step 3: compute the shortest rotation needed
527 * to map from the bone rotation to the current axis.
528 * - this uses the same method as is used for the Damped Track Constraint
529 * (see the code there for details).
530 */
531 {
532 float dmat[3][3], rmat[3][3];
533 float raxis[3], rangle;
534
535 /* Compute the raw rotation matrix from the bone's current matrix by extracting only the
536 * orientation-relevant axes, and normalizing them.
537 */
538 mul_m3_m4m4(base_pose_mat, state->locrot_offset, pchan->pose_mat);
539 normalize_m3_m3(rmat, base_pose_mat);
540
541 /* Also, normalize the orientation imposed by the bone,
542 * now that we've extracted the scale factor. */
543 normalize_v3(spline_vec);
544
545 /* Calculate smallest axis-angle rotation necessary for getting from the
546 * current orientation of the bone, to the spline-imposed direction.
547 */
548 cross_v3_v3v3(raxis, rmat[1], spline_vec);
549
550 /* Check if the old and new bone direction is parallel to each other.
551 * If they are, then 'raxis' should be near zero and we will have to get the rotation axis in
552 * some other way.
553 */
554 float norm = normalize_v3(raxis);
555
556 if (norm < FLT_EPSILON) {
557 /* Can't use cross product! */
558 int order[3] = {0, 1, 2};
559 float tmp_axis[3];
560 zero_v3(tmp_axis);
561
562 axis_sort_v3(spline_vec, order);
563
564 /* Use the second largest axis as the basis for the rotation axis. */
565 tmp_axis[order[1]] = 1.0f;
566 cross_v3_v3v3(raxis, tmp_axis, spline_vec);
567 }
568
569 rangle = dot_v3v3(rmat[1], spline_vec);
570 CLAMP(rangle, -1.0f, 1.0f);
571 rangle = acosf(rangle);
572
573 /* Multiply the magnitude of the angle by the influence of the constraint to
574 * control the influence of the SplineIK effect.
575 */
576 rangle *= tree->con->enforce * tail_blend_fac;
577
578 /* Construct rotation matrix from the axis-angle rotation found above.
579 * - This call takes care to make sure that the axis provided is a unit vector first.
580 */
581 axis_angle_to_mat3(dmat, raxis, rangle);
582
583 /* Combine these rotations so that the y-axis of the bone is now aligned as the
584 * spline dictates, while still maintaining roll control from the existing bone animation. */
585 mul_m3_m3m3(pose_mat, dmat, rmat);
586
587 /* Attempt to reduce shearing, though I doubt this will really help too much now. */
588 normalize_m3(pose_mat);
589
590 mul_m3_m3m3(base_pose_mat, dmat, base_pose_mat);
591
592 /* Apply rotation to the accumulated parent transform. */
593 mul_m4_m3m4(state->locrot_offset, dmat, state->locrot_offset);
594 }
595
596 /* Step 4: Set the scaling factors for the axes. */
597
598 /* Always multiply the y-axis by the scaling factor to get the correct length. */
599 mul_v3_fl(pose_mat[1], scale_fac);
600
601 /* After that, apply x/z scaling modes. */
603 /* First, apply the original scale if enabled. */
606 {
607 float scale;
608
609 /* X-axis scale. */
610 scale = len_v3(pchan->pose_mat[0]);
611 mul_v3_fl(pose_mat[0], scale);
612 /* Z-axis scale. */
613 scale = len_v3(pchan->pose_mat[2]);
614 mul_v3_fl(pose_mat[2], scale);
615
616 /* Adjust the scale factor used for volume preservation
617 * to consider the pre-IK scaling as the initial volume. */
618 scale_fac /= pose_scale;
619 }
620
621 /* Apply volume preservation. */
622 switch (ik_data->xzScaleMode) {
625 break;
627 /* Old 'volume preservation' method using the inverse scale. */
628 float scale;
629
630 /* Calculate volume preservation factor which is
631 * basically the inverse of the y-scaling factor.
632 */
633 if (fabsf(scale_fac) != 0.0f) {
634 scale = 1.0f / fabsf(scale_fac);
635
636 /* We need to clamp this within sensible values. */
637 /* NOTE: these should be fine for now, but should get sanitized in future. */
638 CLAMP(scale, 0.0001f, 100000.0f);
639 }
640 else {
641 scale = 1.0f;
642 }
643
644 /* Apply the scaling. */
645 mul_v3_fl(pose_mat[0], scale);
646 mul_v3_fl(pose_mat[2], scale);
647 break;
648 }
650 /* Improved volume preservation based on the Stretch To constraint. */
651 float final_scale;
652
653 /* As the basis for volume preservation, we use the inverse scale factor... */
654 if (fabsf(scale_fac) != 0.0f) {
655 /* NOTE: The method here is taken wholesale from the Stretch To constraint. */
656 float bulge = powf(1.0f / fabsf(scale_fac), ik_data->bulge);
657
658 if (bulge > 1.0f) {
660 float bulge_max = max_ff(ik_data->bulge_max, 1.0f);
661 float hard = min_ff(bulge, bulge_max);
662
663 float range = bulge_max - 1.0f;
664 float scale = (range > 0.0f) ? 1.0f / range : 0.0f;
665 float soft = 1.0f + range * atanf((bulge - 1.0f) * scale) / float(M_PI_2);
666
667 bulge = interpf(soft, hard, ik_data->bulge_smooth);
668 }
669 }
670 if (bulge < 1.0f) {
672 float bulge_min = std::clamp(ik_data->bulge_min, 0.0f, 1.0f);
673 float hard = max_ff(bulge, bulge_min);
674
675 float range = 1.0f - bulge_min;
676 float scale = (range > 0.0f) ? 1.0f / range : 0.0f;
677 float soft = 1.0f - range * atanf((1.0f - bulge) * scale) / float(M_PI_2);
678
679 bulge = interpf(soft, hard, ik_data->bulge_smooth);
680 }
681 }
682
683 /* Compute scale factor for XZ axes from this value. */
684 final_scale = sqrtf(bulge);
685 }
686 else {
687 /* No scaling, so scale factor is simple. */
688 final_scale = 1.0f;
689 }
690
691 /* Apply the scaling (assuming normalized scale). */
692 mul_v3_fl(pose_mat[0], final_scale);
693 mul_v3_fl(pose_mat[2], final_scale);
694 break;
695 }
696 }
697 }
698
699 /* Finally, multiply the x and z scaling by the radius of the curve too,
700 * to allow automatic scales to get tweaked still.
701 */
702 if ((ik_data->flag & CONSTRAINT_SPLINEIK_NO_CURVERAD) == 0) {
703 mul_v3_fl(pose_mat[0], radius);
704 mul_v3_fl(pose_mat[2], radius);
705 }
706
707 /* Blend the scaling of the matrix according to the influence. */
708 sub_m3_m3m3(pose_mat, pose_mat, base_pose_mat);
709 madd_m3_m3m3fl(pose_mat, base_pose_mat, pose_mat, tree->con->enforce * tail_blend_fac);
710
711 /* Step 5: Set the location of the bone in the matrix. */
712 if (ik_data->flag & CONSTRAINT_SPLINEIK_NO_ROOT) {
713 /* When the 'no-root' option is affected, the chain can retain
714 * the shape but be moved elsewhere.
715 */
716 copy_v3_v3(pose_head, orig_head);
717 }
718 else if (tree->con->enforce < 1.0f) {
719 /* When the influence is too low:
720 * - Blend the positions for the 'root' bone.
721 * - Stick to the parent for any other.
722 */
723 if (index < tree->chainlen - 1) {
724 copy_v3_v3(pose_head, orig_head);
725 }
726 else {
727 interp_v3_v3v3(pose_head, orig_head, pose_head, tree->con->enforce);
728 }
729 }
730
731 /* Finally, store the new transform. */
732 copy_m4_m3(pchan->pose_mat, pose_mat);
733 copy_v3_v3(pchan->pose_mat[3], pose_head);
734 copy_v3_v3(pchan->pose_head, pose_head);
735
736 mul_v3_mat3_m4v3(orig_tail, state->locrot_offset, pchan->pose_tail);
737
738 /* Recalculate tail, as it's now outdated after the head gets adjusted above! */
739 BKE_pose_where_is_bone_tail({pchan, pchan_bone});
740
741 /* Update the offset in the accumulated parent transform. */
742 sub_v3_v3v3(state->locrot_offset[3], pchan->pose_tail, orig_tail);
743
744 /* Done! */
745 pchan->flag |= POSE_DONE;
746}
747
748/* Evaluate the chain starting from the nominated bone */
750 Depsgraph *depsgraph, Scene *scene, Object *ob, bPoseChannel *pchan_root, float ctime)
751{
752 tSplineIK_Tree *tree;
753
754 /* for each pose-tree, execute it if it is spline, otherwise just free it */
755 while ((tree = pchan_root->siktree.first()) != nullptr) {
756 /* Firstly, calculate the bone matrix the standard way,
757 * since this is needed for roll control. */
758 for (int i = tree->chainlen - 1; i >= 0; i--) {
759 BKE_pose_where_is_bone(depsgraph, scene, ob, tree->chain[i], ctime, true);
760 }
761
762 /* After that, evaluate the actual Spline IK, unless there are missing dependencies. */
764
765 if (splineik_evaluate_init(tree, &state)) {
766 /* Walk over each bone in the chain, calculating the effects of spline IK
767 * - the chain is traversed in the opposite order to storage order
768 * (i.e. parent to children) so that dependencies are correct
769 */
770 for (int i = tree->chainlen - 1; i >= 0; i--) {
771 bPoseChannel *pchan = tree->chain[i];
772 splineik_evaluate_bone(tree, ob, pchan, i, &state);
773 }
774 }
775
776 /* Free the tree info specific to SplineIK trees by removing the original array from scope. */
778
779 /* free this tree */
780 BLI_freelinkN(&pchan_root->siktree, tree);
781 }
782}
783
784void BKE_pose_splineik_init_tree(Scene *scene, Object *ob, float ctime)
785{
786 splineik_init_tree(scene, ob, ctime);
787}
788
790 Depsgraph *depsgraph, Scene *scene, Object *ob, bPoseChannel *pchan_root, float ctime)
791{
792 splineik_execute_tree(depsgraph, scene, ob, pchan_root, ctime);
793}
794
795/* *************** Depsgraph evaluation callbacks ************ */
796
798{
799 const int num_channels = pose->chanbase.count();
800 pose->runtime->chan_array.reinitialize(num_channels);
801 int pchan_index = 0;
802 for (bPoseChannel *pchan = pose->chanbase.first(); pchan != nullptr; pchan = pchan->next) {
803 pose->runtime->chan_array[pchan_index++] = pchan;
804 }
805}
806
808{
809 bPose *pose = ob->pose;
810 BLI_assert(pose != nullptr);
811 BLI_assert(!pose->runtime->chan_array.is_empty());
812 BLI_assert(pchan_index >= 0);
813 BLI_assert(pchan_index < pose->runtime->chan_array.size());
814 return pose->runtime->chan_array[pchan_index];
815}
816
817void BKE_pose_eval_init(Depsgraph *depsgraph, Scene * /*scene*/, Object *object)
818{
819 bPose *pose = object->pose;
820 BLI_assert(pose != nullptr);
821
822 DEG_debug_print_eval(depsgraph, __func__, object->id.name, object);
823
824 BLI_assert(object->type == OB_ARMATURE);
825
826 /* We demand having proper pose. */
827 BLI_assert(object->pose != nullptr);
828 BLI_assert((object->pose->flag & POSE_RECALC) == 0);
829
830 /* world_to_object is needed for solvers. */
831 invert_m4_m4(object->runtime->world_to_object.ptr(), object->object_to_world().ptr());
832
833 /* clear flags */
834 for (bPoseChannel *pchan = pose->chanbase.first(); pchan != nullptr; pchan = pchan->next) {
835 pchan->flag &= ~(POSE_DONE | POSE_CHAIN | POSE_IKTREE | POSE_IKSPLINE);
836
837 /* Free B-Bone shape data cache if it's not a B-Bone. */
838 const Bone *bone = pchan->bone_get(*object);
839 if (bone == nullptr || bone->segments <= 1) {
840 BKE_pose_channel_free_bbone_cache(&pchan->runtime);
841 }
842 }
843
844 BLI_assert(!pose->runtime->chan_array.is_empty() || pose->chanbase.is_empty());
845}
846
847void BKE_pose_eval_init_ik(Depsgraph *depsgraph, Scene *scene, Object *object)
848{
849 DEG_debug_print_eval(depsgraph, __func__, object->id.name, object);
850 BLI_assert(object->type == OB_ARMATURE);
851 const float ctime = BKE_scene_ctime_get(scene); /* not accurate... */
852 bArmature *armature = id_cast<bArmature *>(object->data);
853 if (armature->flag & ARM_RESTPOS) {
854 return;
855 }
856 /* construct the IK tree (standard IK) */
857 BIK_init_tree(depsgraph, scene, object, ctime);
858 /* construct the Spline IK trees
859 * - this is not integrated as an IK plugin, since it should be able
860 * to function in conjunction with standard IK. */
861 BKE_pose_splineik_init_tree(scene, object, ctime);
862}
863
864void BKE_pose_eval_bone(Depsgraph *depsgraph, Scene *scene, Object *object, int pchan_index)
865{
866 const bArmature *armature = id_cast<bArmature *>(object->data);
867 if (armature->edbo != nullptr) {
868 return;
869 }
870 bPoseChannel *pchan = pose_pchan_get_indexed(object, pchan_index);
872 depsgraph, __func__, object->id.name, object, "pchan", pchan->name, pchan);
873 BLI_assert(object->type == OB_ARMATURE);
874 if (armature->flag & ARM_RESTPOS) {
875 Bone *bone = pchan->bone_get(*object);
876 if (bone) {
877 copy_m4_m4(pchan->pose_mat, bone->arm_mat);
878 copy_v3_v3(pchan->pose_head, bone->arm_head);
879 copy_v3_v3(pchan->pose_tail, bone->arm_tail);
880 }
881 }
882 else {
883 /* TODO(sergey): Currently if there are constraints full transform is
884 * being evaluated in BKE_pose_constraints_evaluate. */
885 if (pchan->constraints.first() == nullptr) {
886 if (pchan->flag & POSE_IKTREE || pchan->flag & POSE_IKSPLINE) {
887 /* pass */
888 }
889 else {
890 if ((pchan->flag & POSE_DONE) == 0) {
891 /* TODO(sergey): Use time source node for time. */
892 float ctime = BKE_scene_ctime_get(scene); /* not accurate... */
893 BKE_pose_where_is_bone(depsgraph, scene, object, pchan, ctime, true);
894 }
895 }
896 }
897 }
898}
899
900void BKE_pose_constraints_evaluate(Depsgraph *depsgraph,
901 Scene *scene,
902 Object *object,
903 int pchan_index)
904{
905 const bArmature *armature = id_cast<bArmature *>(object->data);
906 if (armature->edbo != nullptr) {
907 return;
908 }
909 bPoseChannel *pchan = pose_pchan_get_indexed(object, pchan_index);
911 depsgraph, __func__, object->id.name, object, "pchan", pchan->name, pchan);
912 if (armature->flag & ARM_RESTPOS) {
913 return;
914 }
915 if (pchan->flag & POSE_IKTREE || pchan->flag & POSE_IKSPLINE) {
916 /* IK are being solved separately/ */
917 }
918 else {
919 if ((pchan->flag & POSE_DONE) == 0) {
920 float ctime = BKE_scene_ctime_get(scene); /* not accurate... */
921 BKE_pose_where_is_bone(depsgraph, scene, object, pchan, ctime, true);
922 }
923 }
924}
925
926static void pose_channel_flush_to_orig_if_needed(Depsgraph *depsgraph,
927 Object *object,
928 bPoseChannel *pchan)
929{
930 if (!DEG_is_active(depsgraph)) {
931 return;
932 }
933 const bArmature *armature = id_cast<bArmature *>(object->data);
934 if (armature->edbo != nullptr) {
935 return;
936 }
937 bPoseChannel *pchan_orig = pchan->orig_pchan;
938 /* TODO(sergey): Using BKE_pose_copy_pchan_result() introduces #70901, but why? */
939 copy_m4_m4(pchan_orig->pose_mat, pchan->pose_mat);
940 copy_m4_m4(pchan_orig->chan_mat, pchan->chan_mat);
941 copy_v3_v3(pchan_orig->pose_head, pchan->pose_mat[3]);
942 copy_m4_m4(pchan_orig->constinv, pchan->constinv);
943 copy_v3_v3(pchan_orig->pose_tail, pchan->pose_tail);
944 pchan_orig->constflag = pchan->constflag;
945}
946
947void BKE_pose_bone_done(Depsgraph *depsgraph, Object *object, int pchan_index)
948{
949 /* Note: tests in `armature_deform_test.cc` update pose matrices locally to avoid creating a full
950 * depsgraph. Keep these in sync if this function is changed! */
951
952 const bArmature *armature = id_cast<bArmature *>(object->data);
953 if (armature->edbo != nullptr) {
954 return;
955 }
956 bPoseChannel *pchan = pose_pchan_get_indexed(object, pchan_index);
957 float imat[4][4];
959 depsgraph, __func__, object->id.name, object, "pchan", pchan->name, pchan);
960 const Bone *bone = pchan->bone_get(*armature);
961 if (bone) {
962 invert_m4_m4(imat, bone->arm_mat);
963 mul_m4_m4m4(pchan->chan_mat, pchan->pose_mat, imat);
964 if (!(bone->flag & BONE_NO_DEFORM)) {
965 mat4_to_dquat(&pchan->runtime.deform_dual_quat, bone->arm_mat, pchan->chan_mat);
966 }
967 }
968 pose_channel_flush_to_orig_if_needed(depsgraph, object, pchan);
969 if (DEG_is_active(depsgraph)) {
970 bPoseChannel *pchan_orig = pchan->orig_pchan;
971 if (bone == nullptr || bone->segments <= 1) {
973 }
974 }
975}
976
977void BKE_pose_eval_bbone_segments(Depsgraph *depsgraph, Object *object, int pchan_index)
978{
979 const bArmature *armature = id_cast<bArmature *>(object->data);
980 if (armature->edbo != nullptr) {
981 return;
982 }
983 bPoseChannel *pchan = pose_pchan_get_indexed(object, pchan_index);
985 depsgraph, __func__, object->id.name, object, "pchan", pchan->name, pchan);
986 Bone *bone = pchan->bone_get(*object);
987 if (bone != nullptr && bone->segments > 1) {
988 BKE_pchan_bbone_segments_cache_compute({pchan, bone}, *armature);
989 if (DEG_is_active(depsgraph)) {
991 }
992 }
993}
994
995void BKE_pose_iktree_evaluate(Depsgraph *depsgraph,
996 Scene *scene,
997 Object *object,
998 int rootchan_index)
999{
1000 const bArmature *armature = id_cast<bArmature *>(object->data);
1001 if (armature->edbo != nullptr) {
1002 return;
1003 }
1004 bPoseChannel *rootchan = pose_pchan_get_indexed(object, rootchan_index);
1006 depsgraph, __func__, object->id.name, object, "rootchan", rootchan->name, rootchan);
1007 BLI_assert(object->type == OB_ARMATURE);
1008 const float ctime = BKE_scene_ctime_get(scene); /* not accurate... */
1009 if (armature->flag & ARM_RESTPOS) {
1010 return;
1011 }
1012 BIK_execute_tree(depsgraph, scene, object, rootchan, ctime);
1013}
1014
1015void BKE_pose_splineik_evaluate(Depsgraph *depsgraph,
1016 Scene *scene,
1017 Object *object,
1018 int rootchan_index)
1019
1020{
1021 const bArmature *armature = id_cast<bArmature *>(object->data);
1022 if (armature->edbo != nullptr) {
1023 return;
1024 }
1025 bPoseChannel *rootchan = pose_pchan_get_indexed(object, rootchan_index);
1027 depsgraph, __func__, object->id.name, object, "rootchan", rootchan->name, rootchan);
1028 BLI_assert(object->type == OB_ARMATURE);
1029 const float ctime = BKE_scene_ctime_get(scene); /* not accurate... */
1030 if (armature->flag & ARM_RESTPOS) {
1031 return;
1032 }
1033 BKE_splineik_execute_tree(depsgraph, scene, object, rootchan, ctime);
1034}
1035
1037{
1038 bPose *pose = object->pose;
1039 BLI_assert(pose != nullptr);
1040 BLI_assert(!pose->runtime->chan_array.is_empty() || pose->chanbase.is_empty());
1042}
1043
1044void BKE_pose_eval_done(Depsgraph *depsgraph, Object *object)
1045{
1046 bPose *pose = object->pose;
1047 BLI_assert(pose != nullptr);
1049 DEG_debug_print_eval(depsgraph, __func__, object->id.name, object);
1050 BLI_assert(object->type == OB_ARMATURE);
1051}
1052
1053void BKE_pose_eval_cleanup(Depsgraph *depsgraph, Scene *scene, Object *object)
1054{
1055 bPose *pose = object->pose;
1056 BLI_assert(pose != nullptr);
1058 const float ctime = BKE_scene_ctime_get(scene); /* not accurate... */
1059 DEG_debug_print_eval(depsgraph, __func__, object->id.name, object);
1060 BLI_assert(object->type == OB_ARMATURE);
1061 /* Release the IK tree. */
1062 BIK_release_tree(scene, object, ctime);
1064}
1065
1066} // namespace blender
Blender kernel action and pose functionality.
#define M_PI_2
Object is a sort of wrapper for general info.
Read Blender memory allocation and freeing.
#define CLAMP(a, b, c)
#define UNUSED_VARS_NDEBUG(...)
#define BLI_INLINE
#define ELEM(...)
#define CLAMP_MIN(a, b)
SIMD_FORCE_INLINE btScalar norm() const
Return the norm (length) of the vector.
Definition btVector3.h:263
Array(Allocator allocator={}) noexcept
Definition BLI_array.hh:78
CCL_NAMESPACE_BEGIN ccl_device_inline float frac(const float x, ccl_private int *ix)
#define powf(x, y)
#define acosf(x)
#define FLT_EPSILON
float3x3 scale(float3x3 mat, float2 scale)
const int state
BMesh Iterators.
MINLINE float min_ff(float a, float b)
void BIK_execute_tree(struct Depsgraph *depsgraph, struct Scene *scene, struct Object *ob, struct bPoseChannel *pchan, float ctime)
BLI_assert(slot->slot_subtype.map==BMO_OP_SLOT_SUBTYPE_MAP_FLT)
void BKE_pose_eval_bbone_segments(Depsgraph *depsgraph, Object *object, int pchan_index)
static void apply_curve_transform(bSplineIKConstraint *ik_data, Object *ob, float radius, float r_vec[3], float *r_radius)
MINLINE void copy_v3_v3(float r[3], const float a[3])
void * MEM_new_array_uninitialized(size_t len, size_t size, const char *str) ATTR_WARN_UNUSED_RESULT ATTR_ALLOC_SIZE(1
void BKE_pose_eval_cleanup(Depsgraph *depsgraph, Scene *scene, Object *object)
void BKE_pose_channel_free_bbone_cache(bPoseChannel_Runtime *runtime) ATTR_NONNULL(1)
bool DEG_is_active(const Depsgraph *depsgraph)
Definition depsgraph.cc:324
void BKE_pose_eval_init_ik(Depsgraph *depsgraph, Scene *scene, Object *object)
static int position_tail_on_spline(bSplineIKConstraint *ik_data, const float head_pos[3], const float sphere_radius, int prev_seg_idx, float r_tail_pos[3], float *r_new_curve_pos, float *r_radius)
static void pose_eval_cleanup_common(Object *object)
void copy_m4_m3(float m1[4][4], const float m2[3][3])
bool BKE_where_on_path(const struct Object *ob, float ctime, float r_vec[4], float r_dir[3], float r_quat[4], float *r_radius, float *r_weight)
void mul_v3_m4v3(float r[3], const float mat[4][4], const float vec[3])
void normalize_m3(float R[3][3]) ATTR_NONNULL()
static void splineik_execute_tree(Depsgraph *depsgraph, Scene *scene, Object *ob, bPoseChannel *pchan_root, float ctime)
bool invert_m4_m4(float inverse[4][4], const float mat[4][4])
void BKE_pose_where_is_bone(Depsgraph *depsgraph, Scene *scene, Object *ob, bPoseChannel *pchan, float ctime, bool do_extra)
void BKE_pose_eval_init(Depsgraph *depsgraph, Scene *scene, Object *object)
void DEG_debug_print_eval(Depsgraph *depsgraph, const char *function_name, const char *object_name, const void *object_address)
static void splineik_init_tree_from_pchan(Scene *, Object *ob, bPoseChannel *pchan_tip)
@ CONSTRAINT_SPLINEIK_NO_CURVERAD
@ CONSTRAINT_SPLINEIK_USE_BULGE_MAX
@ CONSTRAINT_SPLINEIK_USE_BULGE_MIN
@ CONSTRAINT_SPLINEIK_USE_ORIGINAL_SCALE
void axis_angle_to_mat3(float R[3][3], const float axis[3], float angle)
void BKE_splineik_execute_tree(Depsgraph *depsgraph, Scene *scene, Object *ob, bPoseChannel *pchan_root, float ctime)
void mul_v3_mat3_m4v3(float r[3], const float mat[4][4], const float vec[3])
void mul_m4_m4m4(float R[4][4], const float A[4][4], const float B[4][4])
BLI_INLINE bPoseChannel * pose_pchan_get_indexed(Object *ob, int pchan_index)
void BKE_pose_iktree_evaluate(Depsgraph *depsgraph, Scene *scene, Object *object, int rootchan_index)
void mul_m3_m4m4(float R[3][3], const float A[4][4], const float B[4][4])
static void splineik_evaluate_bone(tSplineIK_Tree *tree, Object *ob, bPoseChannel *pchan, int index, tSplineIk_EvalState *state)
MINLINE void mul_v3_fl(float r[3], float f)
void BKE_pchan_bbone_segments_cache_copy(bPoseChannel *pchan, bPoseChannel *pchan_from)
void mul_m4_v3(const float M[4][4], float r[3])
@ CONSTRAINT_SPLINEIK_XZS_ORIGINAL
@ CONSTRAINT_SPLINEIK_XZS_INVERSE
@ CONSTRAINT_SPLINEIK_XZS_VOLUMETRIC
void BKE_pose_pchan_index_rebuild(bPose *pose)
void BKE_pose_constraints_evaluate(Depsgraph *depsgraph, Scene *scene, Object *object, int pchan_index)
MINLINE void cross_v3_v3v3(float r[3], const float a[3], const float b[3])
bool BKE_constraint_has_influence(const struct bConstraint *con)
@ CONSTRAINT_SPLINEIK_YS_FIT_CURVE
@ CONSTRAINT_SPLINEIK_YS_ORIGINAL
void BIK_init_tree(struct Depsgraph *depsgraph, struct Scene *scene, struct Object *ob, float ctime)
void BLI_freelinkN(ListBase *listbase, void *vlink) ATTR_NONNULL(1)
Definition listbase.cc:277
void unit_m4(float m[4][4])
void interp_v3_v3v3(float r[3], const float a[3], const float b[3], float t)
int BKE_anim_path_get_array_size(const struct CurveCache *curve_cache)
MINLINE float len_v3(const float a[3]) ATTR_WARN_UNUSED_RESULT
MINLINE void zero_v3(float r[3])
void BKE_pose_splineik_evaluate(Depsgraph *depsgraph, Scene *scene, Object *object, int rootchan_index)
void normalize_m3_m3(float R[3][3], const float M[3][3]) ATTR_NONNULL()
void mat4_to_dquat(DualQuat *dq, const float basemat[4][4], const float mat[4][4])
void DEG_debug_print_eval_subdata(Depsgraph *depsgraph, const char *function_name, const char *object_name, const void *object_address, const char *subdata_comment, const char *subdata_name, const void *subdata_address)
MINLINE float normalize_v3(float n[3])
void BKE_pose_eval_bone(Depsgraph *depsgraph, Scene *scene, Object *object, int pchan_index)
void BKE_pose_eval_done(Depsgraph *depsgraph, Object *object)
void BKE_pose_where_is_bone_tail(bke::PChanBone pchanbone)
MINLINE void sub_v3_v3v3(float r[3], const float a[3], const float b[3])
void BLI_addtail(ListBase *listbase, void *vlink) ATTR_NONNULL(1)
Definition listbase.cc:118
float BKE_scene_ctime_get(const Scene *scene)
Definition scene.cc:2581
MINLINE float max_ff(float a, float b)
void BKE_pchan_bbone_segments_cache_compute(bke::PChanBone pchanbone, const bArmature &armature)
void axis_sort_v3(const float axis_values[3], int r_axis_order[3])
void BKE_pose_splineik_init_tree(Scene *scene, Object *ob, float ctime)
MINLINE float interpf(float target, float origin, float t)
void madd_m3_m3m3fl(float R[3][3], const float A[3][3], const float B[3][3], float f)
static void pose_channel_flush_to_orig_if_needed(Depsgraph *depsgraph, Object *object, bPoseChannel *pchan)
float BKE_anim_path_get_length(const struct CurveCache *curve_cache)
static float dist_to_sphere_shell(const float sphere_origin[3], const float sphere_radius, const float point[3])
void mul_m3_m3m3(float R[3][3], const float A[3][3], const float B[3][3])
void copy_m4_m4(float m1[4][4], const float m2[4][4])
static bool splineik_evaluate_init(tSplineIK_Tree *tree, tSplineIk_EvalState *state)
MINLINE float len_v3v3(const float a[3], const float b[3]) ATTR_WARN_UNUSED_RESULT
void sub_m3_m3m3(float R[3][3], const float A[3][3], const float B[3][3])
MINLINE float dot_v3v3(const float a[3], const float b[3]) ATTR_WARN_UNUSED_RESULT
void BKE_pose_bone_done(Depsgraph *depsgraph, Object *object, int pchan_index)
void mul_m4_m3m4(float R[4][4], const float A[3][3], const float B[4][4])
static void splineik_init_tree(Scene *scene, Object *ob, float)
void BIK_release_tree(struct Scene *scene, struct Object *ob, float ctime)
#define fabsf
#define sqrtf
#define atanf
KERNEL_FEATURE_LIGHT_PASSES KERNEL_FEATURE_PATH_GUIDING float
struct Bone * parent
ListBaseT< BevList > bev
Definition BKE_curve.hh:45
const float * anim_path_accum_length
Definition BKE_curve.hh:53
bke::ObjectRuntime * runtime
struct bPose * pose
ListBaseT< EditBone > * edbo
struct bConstraint * next
struct bPoseChannel_Runtime runtime
struct bPoseChannel * parent
ListBaseT< struct bConstraint > constraints
ePchan_ConstFlag constflag
ListBaseT< struct tSplineIK_Tree > siktree
struct bPoseChannel * orig_pchan
ListBaseT< bPoseChannel > chanbase
eSplineIK_XZScaleModes xzScaleMode
Array< bPoseChannel * > chain
bSplineIKConstraint * ik_data