Blender V4.3
rna_pose.cc
Go to the documentation of this file.
1/* SPDX-FileCopyrightText: 2023 Blender Authors
2 *
3 * SPDX-License-Identifier: GPL-2.0-or-later */
4
9#include <cstdlib>
10#include <cstring>
11
12#include "RNA_define.hh"
13#include "RNA_enum_types.hh"
14
15#include "rna_internal.hh"
16
17#include "DNA_action_types.h"
18#include "DNA_armature_types.h"
20#include "DNA_object_types.h"
21#include "DNA_scene_types.h"
22
23#include "BLI_math_rotation.h"
24#include "BLI_math_vector.h"
26
27#include "BLT_translation.hh"
28
29#include "UI_resources.hh"
30
31#include "WM_types.hh"
32
33/* Bone and Group Color Sets */
35 {0, "DEFAULT", 0, "Default Colors", ""},
36 {1, "THEME01", ICON_COLORSET_01_VEC, "01 - Theme Color Set", ""},
37 {2, "THEME02", ICON_COLORSET_02_VEC, "02 - Theme Color Set", ""},
38 {3, "THEME03", ICON_COLORSET_03_VEC, "03 - Theme Color Set", ""},
39 {4, "THEME04", ICON_COLORSET_04_VEC, "04 - Theme Color Set", ""},
40 {5, "THEME05", ICON_COLORSET_05_VEC, "05 - Theme Color Set", ""},
41 {6, "THEME06", ICON_COLORSET_06_VEC, "06 - Theme Color Set", ""},
42 {7, "THEME07", ICON_COLORSET_07_VEC, "07 - Theme Color Set", ""},
43 {8, "THEME08", ICON_COLORSET_08_VEC, "08 - Theme Color Set", ""},
44 {9, "THEME09", ICON_COLORSET_09_VEC, "09 - Theme Color Set", ""},
45 {10, "THEME10", ICON_COLORSET_10_VEC, "10 - Theme Color Set", ""},
46 {11, "THEME11", ICON_COLORSET_11_VEC, "11 - Theme Color Set", ""},
47 {12, "THEME12", ICON_COLORSET_12_VEC, "12 - Theme Color Set", ""},
48 {13, "THEME13", ICON_COLORSET_13_VEC, "13 - Theme Color Set", ""},
49 {14, "THEME14", ICON_COLORSET_14_VEC, "14 - Theme Color Set", ""},
50 {15, "THEME15", ICON_COLORSET_15_VEC, "15 - Theme Color Set", ""},
51 {16, "THEME16", ICON_COLORSET_16_VEC, "16 - Theme Color Set", ""},
52 {17, "THEME17", ICON_COLORSET_17_VEC, "17 - Theme Color Set", ""},
53 {18, "THEME18", ICON_COLORSET_18_VEC, "18 - Theme Color Set", ""},
54 {19, "THEME19", ICON_COLORSET_19_VEC, "19 - Theme Color Set", ""},
55 {20, "THEME20", ICON_COLORSET_20_VEC, "20 - Theme Color Set", ""},
56 {-1, "CUSTOM", 0, "Custom Color Set", ""},
57 {0, nullptr, 0, nullptr, nullptr},
58};
59
60#ifdef RNA_RUNTIME
61
62# include <fmt/format.h>
63
64# include "BLI_ghash.h"
65# include "BLI_string_utils.hh"
66
67# include "BIK_api.h"
68# include "BKE_action.hh"
69# include "BKE_armature.hh"
70
71# include "DNA_userdef_types.h"
72
73# include "MEM_guardedalloc.h"
74
75# include "BKE_constraint.h"
76# include "BKE_context.hh"
77# include "BKE_global.hh"
78# include "BKE_idprop.hh"
79
80# include "DEG_depsgraph.hh"
81# include "DEG_depsgraph_build.hh"
82
83# include "ED_armature.hh"
84# include "ED_object.hh"
85
86# include "WM_api.hh"
87
88# include "RNA_access.hh"
89
90static void rna_Pose_update(Main * /*bmain*/, Scene * /*scene*/, PointerRNA *ptr)
91{
92 // ob->pose->flag |= (POSE_LOCKED | POSE_DO_UNLOCK); /* XXX when to use this? */
93
96}
97
98static void rna_Pose_dependency_update(Main *bmain, Scene * /*scene*/, PointerRNA *ptr)
99{
101
104}
105
106static void rna_Pose_IK_update(Main * /*bmain*/, Scene * /*scene*/, PointerRNA *ptr)
107{
108 // ob->pose->flag |= (POSE_LOCKED | POSE_DO_UNLOCK); /* XXX: when to use this? */
109 Object *ob = (Object *)ptr->owner_id;
110
113
114 BIK_clear_data(ob->pose);
115}
116
117static std::optional<std::string> rna_Pose_path(const PointerRNA * /*ptr*/)
118{
119 return "pose";
120}
121
122static std::optional<std::string> rna_PoseBone_path(const PointerRNA *ptr)
123{
124 const bPoseChannel *pchan = static_cast<const bPoseChannel *>(ptr->data);
125 char name_esc[sizeof(pchan->name) * 2];
126
127 BLI_str_escape(name_esc, pchan->name, sizeof(name_esc));
128 return fmt::format("pose.bones[\"{}\"]", name_esc);
129}
130
131/* shared for actions groups and bone groups */
132
133static bool rna_bone_group_poll(Object *ob, ReportList *reports)
134{
135 if (ID_IS_OVERRIDE_LIBRARY(ob)) {
136 BKE_report(reports, RPT_ERROR, "Cannot edit bone groups for library overrides");
137 return false;
138 }
139
140 return true;
141}
142
144{
145 Object *ob = (Object *)ptr->owner_id;
146 if (!rna_bone_group_poll(ob, nullptr)) {
147 return;
148 }
149
150 bActionGroup *grp = static_cast<bActionGroup *>(ptr->data);
151
152 /* ensure only valid values get set */
153 if ((value >= -1) && (value < 21)) {
154 grp->customCol = value;
155
156 /* sync colors stored with theme colors based on the index specified */
157 action_group_colors_sync(grp, nullptr);
158 }
159}
160
162{
163 bActionGroup *grp = static_cast<bActionGroup *>(ptr->data);
164
165 return (grp->customCol < 0);
166}
167
168static IDProperty **rna_PoseBone_idprops(PointerRNA *ptr)
169{
170 bPoseChannel *pchan = static_cast<bPoseChannel *>(ptr->data);
171 return &pchan->prop;
172}
173
174static void rna_Pose_ik_solver_set(PointerRNA *ptr, int value)
175{
176 bPose *pose = (bPose *)ptr->data;
177
178 if (pose->iksolver != value) {
179 /* the solver has changed, must clean any temporary structures */
180 BIK_clear_data(pose);
181 if (pose->ikparam) {
182 MEM_freeN(pose->ikparam);
183 pose->ikparam = nullptr;
184 }
185 pose->iksolver = value;
187 }
188}
189
190static void rna_Pose_ik_solver_update(Main *bmain, Scene * /*scene*/, PointerRNA *ptr)
191{
192 Object *ob = (Object *)ptr->owner_id;
193 bPose *pose = static_cast<bPose *>(ptr->data);
194
195 BKE_pose_tag_recalc(bmain, pose); /* checks & sorts pose channels */
197
199
201
203}
204
205/* rotation - axis-angle */
206static void rna_PoseChannel_rotation_axis_angle_get(PointerRNA *ptr, float *value)
207{
208 bPoseChannel *pchan = static_cast<bPoseChannel *>(ptr->data);
209
210 /* for now, assume that rotation mode is axis-angle */
211 value[0] = pchan->rotAngle;
212 copy_v3_v3(&value[1], pchan->rotAxis);
213}
214
215/* rotation - axis-angle */
216static void rna_PoseChannel_rotation_axis_angle_set(PointerRNA *ptr, const float *value)
217{
218 bPoseChannel *pchan = static_cast<bPoseChannel *>(ptr->data);
219
220 /* for now, assume that rotation mode is axis-angle */
221 pchan->rotAngle = value[0];
222 copy_v3_v3(pchan->rotAxis, &value[1]);
223
224 /* TODO: validate axis? */
225}
226
227static void rna_PoseChannel_rotation_mode_set(PointerRNA *ptr, int value)
228{
229 bPoseChannel *pchan = static_cast<bPoseChannel *>(ptr->data);
230
231 /* use API Method for conversions... */
233 pchan->quat, pchan->eul, pchan->rotAxis, &pchan->rotAngle, pchan->rotmode, short(value));
234
235 /* finally, set the new rotation type */
236 pchan->rotmode = value;
237}
238
239static float rna_PoseChannel_length_get(PointerRNA *ptr)
240{
241 bPoseChannel *pchan = static_cast<bPoseChannel *>(ptr->data);
242 return len_v3v3(pchan->pose_head, pchan->pose_tail);
243}
244
245static void rna_PoseChannel_name_set(PointerRNA *ptr, const char *value)
246{
247 Object *ob = (Object *)ptr->owner_id;
248 bPoseChannel *pchan = (bPoseChannel *)ptr->data;
249 char oldname[sizeof(pchan->name)], newname[sizeof(pchan->name)];
250
251 /* need to be on the stack */
252 STRNCPY_UTF8(newname, value);
253 STRNCPY(oldname, pchan->name);
254
256 BLI_assert(BKE_id_is_in_global_main(static_cast<ID *>(ob->data)));
257 ED_armature_bone_rename(G_MAIN, static_cast<bArmature *>(ob->data), oldname, newname);
258}
259
260/* See rna_Bone_update_renamed() */
261static void rna_PoseChannel_name_update(Main * /*bmain*/, Scene * /*scene*/, PointerRNA *ptr)
262{
263 ID *id = ptr->owner_id;
264
265 /* redraw view */
267
268 /* update animation channels */
270}
271
272static PointerRNA rna_PoseChannel_bone_get(PointerRNA *ptr)
273{
274 Object *ob = (Object *)ptr->owner_id;
275 bPoseChannel *pchan = (bPoseChannel *)ptr->data;
276 PointerRNA tmp_ptr = *ptr;
277
278 /* Replace the id_data pointer with the Armature ID. */
279 tmp_ptr.owner_id = static_cast<ID *>(ob->data);
280
281 return rna_pointer_inherit_refine(&tmp_ptr, &RNA_Bone, pchan->bone);
282}
283
284static bool rna_PoseChannel_has_ik_get(PointerRNA *ptr)
285{
286 Object *ob = (Object *)ptr->owner_id;
287 bPoseChannel *pchan = (bPoseChannel *)ptr->data;
288
289 return BKE_pose_channel_in_IK_chain(ob, pchan);
290}
291
292static StructRNA *rna_IKParam_refine(PointerRNA *ptr)
293{
294 bIKParam *param = (bIKParam *)ptr->data;
295
296 switch (param->iksolver) {
297 case IKSOLVER_ITASC:
298 return &RNA_Itasc;
299 default:
300 return &RNA_IKParam;
301 }
302}
303
304static PointerRNA rna_Pose_ikparam_get(PointerRNA *ptr)
305{
306 bPose *pose = (bPose *)ptr->data;
307 return rna_pointer_inherit_refine(ptr, &RNA_IKParam, pose->ikparam);
308}
309
310static StructRNA *rna_Pose_ikparam_typef(PointerRNA *ptr)
311{
312 bPose *pose = (bPose *)ptr->data;
313
314 switch (pose->iksolver) {
315 case IKSOLVER_ITASC:
316 return &RNA_Itasc;
317 default:
318 return &RNA_IKParam;
319 }
320}
321
322static void rna_Itasc_update(Main * /*bmain*/, Scene * /*scene*/, PointerRNA *ptr)
323{
324 Object *ob = (Object *)ptr->owner_id;
325 bItasc *itasc = static_cast<bItasc *>(ptr->data);
326
327 /* verify values */
328 if (itasc->precision < 0.0001f) {
329 itasc->precision = 0.0001f;
330 }
331 if (itasc->minstep < 0.001f) {
332 itasc->minstep = 0.001f;
333 }
334 if (itasc->maxstep < itasc->minstep) {
335 itasc->maxstep = itasc->minstep;
336 }
337 if (itasc->feedback < 0.01f) {
338 itasc->feedback = 0.01f;
339 }
340 if (itasc->feedback > 100.0f) {
341 itasc->feedback = 100.0f;
342 }
343 if (itasc->maxvel < 0.01f) {
344 itasc->maxvel = 0.01f;
345 }
346 if (itasc->maxvel > 100.0f) {
347 itasc->maxvel = 100.0f;
348 }
350
352}
353
354static void rna_Itasc_update_rebuild(Main *bmain, Scene *scene, PointerRNA *ptr)
355{
356 Object *ob = (Object *)ptr->owner_id;
357 bPose *pose = ob->pose;
358
359 BKE_pose_tag_recalc(bmain, pose); /* checks & sorts pose channels */
360 rna_Itasc_update(bmain, scene, ptr);
361}
362
363static PointerRNA rna_PoseChannel_active_constraint_get(PointerRNA *ptr)
364{
365 bPoseChannel *pchan = (bPoseChannel *)ptr->data;
366 bConstraint *con = BKE_constraints_active_get(&pchan->constraints);
367 return rna_pointer_inherit_refine(ptr, &RNA_Constraint, con);
368}
369
370static void rna_PoseChannel_active_constraint_set(PointerRNA *ptr,
371 PointerRNA value,
372 ReportList * /*reports*/)
373{
374 bPoseChannel *pchan = (bPoseChannel *)ptr->data;
375 BKE_constraints_active_set(&pchan->constraints, (bConstraint *)value.data);
376}
377
378static bConstraint *rna_PoseChannel_constraints_new(ID *id,
379 bPoseChannel *pchan,
380 Main *main,
381 int type)
382{
383 Object *ob = (Object *)id;
384 bConstraint *new_con = BKE_constraint_add_for_pose(ob, pchan, nullptr, type);
385
388
389 return new_con;
390}
391
392static void rna_PoseChannel_constraints_remove(
393 ID *id, bPoseChannel *pchan, Main *bmain, ReportList *reports, PointerRNA *con_ptr)
394{
395 bConstraint *con = static_cast<bConstraint *>(con_ptr->data);
397 Object *ob = (Object *)id;
398
399 if (BLI_findindex(&pchan->constraints, con) == -1) {
401 reports, RPT_ERROR, "Constraint '%s' not found in pose bone '%s'", con->name, pchan->name);
402 return;
403 }
404
406 RNA_POINTER_INVALIDATE(con_ptr);
407
409
410 /* XXX(@ideasman42): is this really needed? */
411 BKE_constraints_active_set(&pchan->constraints, nullptr);
412
414
415 if (is_ik) {
416 BIK_clear_data(ob->pose);
417 }
418}
419
420static void rna_PoseChannel_constraints_move(
421 ID *id, bPoseChannel *pchan, Main *bmain, ReportList *reports, int from, int to)
422{
423 Object *ob = (Object *)id;
424
425 if (from == to) {
426 return;
427 }
428
429 if (!BLI_listbase_move_index(&pchan->constraints, from, to)) {
430 BKE_reportf(reports, RPT_ERROR, "Could not move constraint from index '%d' to '%d'", from, to);
431 return;
432 }
433
436}
437
438static bConstraint *rna_PoseChannel_constraints_copy(ID *id,
439 bPoseChannel *pchan,
440 Main *bmain,
441 PointerRNA *con_ptr)
442{
443 Object *ob = (Object *)id;
444 bConstraint *con = static_cast<bConstraint *>(con_ptr->data);
445 bConstraint *new_con = BKE_constraint_copy_for_pose(ob, pchan, con);
447
450
451 return new_con;
452}
453
454bool rna_PoseChannel_constraints_override_apply(Main *bmain,
456{
457 PointerRNA *ptr_dst = &rnaapply_ctx.ptr_dst;
458 PointerRNA *ptr_src = &rnaapply_ctx.ptr_src;
459 PropertyRNA *prop_dst = rnaapply_ctx.prop_dst;
461
463 "Unsupported RNA override operation on constraints collection");
464
465 bPoseChannel *pchan_dst = (bPoseChannel *)ptr_dst->data;
466 bPoseChannel *pchan_src = (bPoseChannel *)ptr_src->data;
467
468 /* Remember that insertion operations are defined and stored in correct order, which means that
469 * even if we insert several items in a row, we always insert first one, then second one, etc.
470 * So we should always find 'anchor' constraint in both _src *and* _dst */
471 const size_t name_offset = offsetof(bConstraint, name);
472 bConstraint *con_anchor = static_cast<bConstraint *>(
473 BLI_listbase_string_or_index_find(&pchan_dst->constraints,
474 opop->subitem_reference_name,
475 name_offset,
476 opop->subitem_reference_index));
477 /* If `con_anchor` is nullptr, `con_src` will be inserted in first position. */
478
480 &pchan_src->constraints, opop->subitem_local_name, name_offset, opop->subitem_local_index));
481
482 if (con_src == nullptr) {
483 BLI_assert(con_src != nullptr);
484 return false;
485 }
486
487 bConstraint *con_dst = BKE_constraint_duplicate_ex(con_src, 0, true);
488
489 /* This handles nullptr anchor as expected by adding at head of list. */
490 BLI_insertlinkafter(&pchan_dst->constraints, con_anchor, con_dst);
491
492 /* This should actually *not* be needed in typical cases.
493 * However, if overridden source was edited,
494 * we *may* have some new conflicting names. */
495 BKE_constraint_unique_name(con_dst, &pchan_dst->constraints);
496
497 // printf("%s: We inserted a constraint...\n", __func__);
498 RNA_property_update_main(bmain, nullptr, ptr_dst, prop_dst);
499 return true;
500}
501
502static int rna_PoseChannel_proxy_editable(const PointerRNA * /*ptr*/, const char ** /*r_info*/)
503{
504# if 0
505 Object *ob = (Object *)ptr->owner_id;
506 bArmature *arm = ob->data;
507 bPoseChannel *pchan = (bPoseChannel *)ptr->data;
508
509 if (pchan->bone && (pchan->bone->layer & arm->layer_protected)) {
510 *r_info = "Can't edit property of a proxy on a protected layer";
511 return 0;
512 }
513# endif
514
515 return PROP_EDITABLE;
516}
517
518static int rna_PoseChannel_location_editable(const PointerRNA *ptr, int index)
519{
520 bPoseChannel *pchan = (bPoseChannel *)ptr->data;
521
522 /* only if the axis in question is locked, not editable... */
523 if ((index == 0) && (pchan->protectflag & OB_LOCK_LOCX)) {
524 return 0;
525 }
526 else if ((index == 1) && (pchan->protectflag & OB_LOCK_LOCY)) {
527 return 0;
528 }
529 else if ((index == 2) && (pchan->protectflag & OB_LOCK_LOCZ)) {
530 return 0;
531 }
532 else {
533 return PROP_EDITABLE;
534 }
535}
536
537static int rna_PoseChannel_scale_editable(const PointerRNA *ptr, int index)
538{
539 bPoseChannel *pchan = (bPoseChannel *)ptr->data;
540
541 /* only if the axis in question is locked, not editable... */
542 if ((index == 0) && (pchan->protectflag & OB_LOCK_SCALEX)) {
543 return 0;
544 }
545 else if ((index == 1) && (pchan->protectflag & OB_LOCK_SCALEY)) {
546 return 0;
547 }
548 else if ((index == 2) && (pchan->protectflag & OB_LOCK_SCALEZ)) {
549 return 0;
550 }
551 else {
552 return PROP_EDITABLE;
553 }
554}
555
556static int rna_PoseChannel_rotation_euler_editable(const PointerRNA *ptr, int index)
557{
558 bPoseChannel *pchan = (bPoseChannel *)ptr->data;
559
560 /* only if the axis in question is locked, not editable... */
561 if ((index == 0) && (pchan->protectflag & OB_LOCK_ROTX)) {
562 return 0;
563 }
564 else if ((index == 1) && (pchan->protectflag & OB_LOCK_ROTY)) {
565 return 0;
566 }
567 else if ((index == 2) && (pchan->protectflag & OB_LOCK_ROTZ)) {
568 return 0;
569 }
570 else {
571 return PROP_EDITABLE;
572 }
573}
574
575static int rna_PoseChannel_rotation_4d_editable(const PointerRNA *ptr, int index)
576{
577 bPoseChannel *pchan = (bPoseChannel *)ptr->data;
578
579 /* only consider locks if locking components individually... */
580 if (pchan->protectflag & OB_LOCK_ROT4D) {
581 /* only if the axis in question is locked, not editable... */
582 if ((index == 0) && (pchan->protectflag & OB_LOCK_ROTW)) {
583 return 0;
584 }
585 else if ((index == 1) && (pchan->protectflag & OB_LOCK_ROTX)) {
586 return 0;
587 }
588 else if ((index == 2) && (pchan->protectflag & OB_LOCK_ROTY)) {
589 return 0;
590 }
591 else if ((index == 3) && (pchan->protectflag & OB_LOCK_ROTZ)) {
592 return 0;
593 }
594 }
595
596 return PROP_EDITABLE;
597}
598
599/* not essential, but much faster than the default lookup function */
600static bool rna_PoseBones_lookup_string(PointerRNA *ptr, const char *key, PointerRNA *r_ptr)
601{
602 bPose *pose = (bPose *)ptr->data;
603 bPoseChannel *pchan = BKE_pose_channel_find_name(pose, key);
604 if (pchan) {
605 *r_ptr = RNA_pointer_create(ptr->owner_id, &RNA_PoseBone, pchan);
606 return true;
607 }
608 else {
609 return false;
610 }
611}
612
613static void rna_PoseChannel_matrix_basis_get(PointerRNA *ptr, float *values)
614{
615 bPoseChannel *pchan = (bPoseChannel *)ptr->data;
616 BKE_pchan_to_mat4(pchan, (float(*)[4])values);
617}
618
619static void rna_PoseChannel_matrix_basis_set(PointerRNA *ptr, const float *values)
620{
621 bPoseChannel *pchan = (bPoseChannel *)ptr->data;
622 /* No compatibility for predictable result. */
623 BKE_pchan_apply_mat4(pchan, (const float(*)[4])values, false);
624}
625
626static void rna_PoseChannel_matrix_set(PointerRNA *ptr, const float *values)
627{
628 bPoseChannel *pchan = (bPoseChannel *)ptr->data;
629 Object *ob = (Object *)ptr->owner_id;
630 float tmat[4][4];
631
632 BKE_armature_mat_pose_to_bone_ex(nullptr, ob, pchan, (const float(*)[4])values, tmat);
633
634 /* No compatibility for predictable result. */
635 BKE_pchan_apply_mat4(pchan, tmat, false);
636}
637
638static bPoseChannel *rna_PoseChannel_ensure_own_pchan(Object *ob,
639 Object *ref_ob,
640 bPoseChannel *ref_pchan)
641{
642 if (ref_ob != ob) {
643 /* We are trying to set a pchan from another object! Forbidden,
644 * try to find by name, or abort. */
645 if (ref_pchan != nullptr) {
646 ref_pchan = BKE_pose_channel_find_name(ob->pose, ref_pchan->name);
647 }
648 }
649 return ref_pchan;
650}
651
652static void rna_PoseChannel_custom_shape_transform_set(PointerRNA *ptr,
653 PointerRNA value,
654 ReportList * /*reports*/)
655{
656 bPoseChannel *pchan = (bPoseChannel *)ptr->data;
657 Object *ob = (Object *)ptr->owner_id;
658
659 pchan->custom_tx = static_cast<bPoseChannel *>(rna_PoseChannel_ensure_own_pchan(
660 ob, (Object *)value.owner_id, static_cast<bPoseChannel *>(value.data)));
661}
662
663#else
664
665void rna_def_actionbone_group_common(StructRNA *srna, int update_flag, const char *update_cb)
666{
667 PropertyRNA *prop;
668
669 /* color set + colors */
670 prop = RNA_def_property(srna, "color_set", PROP_ENUM, PROP_NONE);
671 RNA_def_property_enum_sdna(prop, nullptr, "customCol");
673 RNA_def_property_enum_funcs(prop, nullptr, "rna_ActionGroup_colorset_set", nullptr);
674 RNA_def_property_ui_text(prop, "Color Set", "Custom color set to use");
675 RNA_def_property_update(prop, update_flag, update_cb);
676
677 prop = RNA_def_property(srna, "is_custom_color_set", PROP_BOOLEAN, PROP_NONE);
678 RNA_def_property_boolean_funcs(prop, "rna_ActionGroup_is_custom_colorset_get", nullptr);
681 prop, "Custom Color Set", "Color set is user-defined instead of a fixed theme color set");
682
683 /* TODO: editing the colors for this should result in changes to the color type... */
684 prop = RNA_def_property(srna, "colors", PROP_POINTER, PROP_NONE);
686 RNA_def_property_struct_type(prop, "ThemeBoneColorSet");
687 /* NOTE: the DNA data is not really a pointer, but this code works :) */
688 RNA_def_property_pointer_sdna(prop, nullptr, "cs");
690 prop, "Colors", "Copy of the colors associated with the group's color set");
691 RNA_def_property_update(prop, update_flag, update_cb);
692}
693
695 {IKSOLVER_STANDARD, "LEGACY", 0, "Standard", "Original IK solver"},
696 {IKSOLVER_ITASC, "ITASC", 0, "iTaSC", "Multi constraint, stateful IK solver"},
697 {0, nullptr, 0, nullptr, nullptr},
698};
699
701 {ITASC_SOLVER_SDLS, "SDLS", 0, "SDLS", "Selective Damped Least Square"},
702 {ITASC_SOLVER_DLS, "DLS", 0, "DLS", "Damped Least Square with Numerical Filtering"},
703 {0, nullptr, 0, nullptr, nullptr},
704};
705
707{
708 StructRNA *srna;
709 PropertyRNA *prop;
710
711 FunctionRNA *func;
712 PropertyRNA *parm;
713
714 RNA_def_property_srna(cprop, "PoseBoneConstraints");
715 srna = RNA_def_struct(brna, "PoseBoneConstraints", nullptr);
716 RNA_def_struct_sdna(srna, "bPoseChannel");
717 RNA_def_struct_ui_text(srna, "PoseBone Constraints", "Collection of pose bone constraints");
718
719 /* Collection active property */
720 prop = RNA_def_property(srna, "active", PROP_POINTER, PROP_NONE);
721 RNA_def_property_struct_type(prop, "Constraint");
723 "rna_PoseChannel_active_constraint_get",
724 "rna_PoseChannel_active_constraint_set",
725 nullptr,
726 nullptr);
728 RNA_def_property_ui_text(prop, "Active Constraint", "Active PoseChannel constraint");
729
730 /* Constraint collection */
731 func = RNA_def_function(srna, "new", "rna_PoseChannel_constraints_new");
732 RNA_def_function_ui_description(func, "Add a constraint to this object");
734 FUNC_USE_MAIN | FUNC_USE_SELF_ID); /* ID and Main needed for refresh */
735 /* return type */
736 parm = RNA_def_pointer(func, "constraint", "Constraint", "", "New constraint");
737 RNA_def_function_return(func, parm);
738 /* constraint to add */
739 parm = RNA_def_enum(
740 func, "type", rna_enum_constraint_type_items, 1, "", "Constraint type to add");
742
743 func = RNA_def_function(srna, "remove", "rna_PoseChannel_constraints_remove");
744 RNA_def_function_ui_description(func, "Remove a constraint from this object");
746 func, FUNC_USE_SELF_ID | FUNC_USE_MAIN | FUNC_USE_REPORTS); /* ID needed for refresh */
747 /* constraint to remove */
748 parm = RNA_def_pointer(func, "constraint", "Constraint", "", "Removed constraint");
751
752 func = RNA_def_function(srna, "move", "rna_PoseChannel_constraints_move");
753 RNA_def_function_ui_description(func, "Move a constraint to a different position");
755 parm = RNA_def_int(
756 func, "from_index", -1, INT_MIN, INT_MAX, "From Index", "Index to move", 0, 10000);
758 parm = RNA_def_int(func, "to_index", -1, INT_MIN, INT_MAX, "To Index", "Target index", 0, 10000);
760
761 func = RNA_def_function(srna, "copy", "rna_PoseChannel_constraints_copy");
762 RNA_def_function_ui_description(func, "Add a new constraint that is a copy of the given one");
764 /* constraint to copy */
765 parm = RNA_def_pointer(func,
766 "constraint",
767 "Constraint",
768 "",
769 "Constraint to copy - may belong to a different object");
772 /* return type */
773 parm = RNA_def_pointer(func, "new_constraint", "Constraint", "", "New constraint");
774 RNA_def_function_return(func, parm);
775}
776
778{
779 StructRNA *srna;
780 PropertyRNA *prop;
781
782 srna = RNA_def_struct(brna, "PoseBone", nullptr);
783 RNA_def_struct_sdna(srna, "bPoseChannel");
784 RNA_def_struct_ui_text(srna, "Pose Bone", "Channel defining pose data for a bone in a Pose");
785 RNA_def_struct_path_func(srna, "rna_PoseBone_path");
786 RNA_def_struct_idprops_func(srna, "rna_PoseBone_idprops");
787 RNA_def_struct_ui_icon(srna, ICON_BONE_DATA);
788
789 /* Bone Constraints */
790 prop = RNA_def_property(srna, "constraints", PROP_COLLECTION, PROP_NONE);
791 RNA_def_property_struct_type(prop, "Constraint");
794 RNA_def_property_ui_text(prop, "Constraints", "Constraints that act on this pose channel");
796 prop, nullptr, nullptr, "rna_PoseChannel_constraints_override_apply");
797
799
800 /* Name + Selection Status */
801 prop = RNA_def_property(srna, "name", PROP_STRING, PROP_NONE);
802 RNA_def_property_string_funcs(prop, nullptr, nullptr, "rna_PoseChannel_name_set");
803 RNA_def_property_ui_text(prop, "Name", "");
804 RNA_def_property_editable_func(prop, "rna_PoseChannel_proxy_editable");
806 RNA_def_property_update(prop, 0, "rna_PoseChannel_name_update");
807
808 /* Baked Bone Path cache data */
810
811 /* Relationships to other bones */
812 prop = RNA_def_property(srna, "bone", PROP_POINTER, PROP_NONE);
814 RNA_def_property_struct_type(prop, "Bone");
815 RNA_def_property_pointer_funcs(prop, "rna_PoseChannel_bone_get", nullptr, nullptr, nullptr);
818 RNA_def_property_ui_text(prop, "Bone", "Bone associated with this PoseBone");
819
820 prop = RNA_def_property(srna, "parent", PROP_POINTER, PROP_NONE);
821 RNA_def_property_struct_type(prop, "PoseBone");
824 RNA_def_property_ui_text(prop, "Parent", "Parent of this pose bone");
825
826 prop = RNA_def_property(srna, "child", PROP_POINTER, PROP_NONE);
827 RNA_def_property_struct_type(prop, "PoseBone");
830 RNA_def_property_ui_text(prop, "Child", "Child of this pose bone");
831
832 /* Transformation settings */
833 prop = RNA_def_property(srna, "location", PROP_FLOAT, PROP_TRANSLATION);
834 RNA_def_property_float_sdna(prop, nullptr, "loc");
836 RNA_def_property_editable_array_func(prop, "rna_PoseChannel_location_editable");
837 RNA_def_property_ui_text(prop, "Location", "");
839 RNA_def_property_update(prop, NC_OBJECT | ND_POSE, "rna_Pose_IK_update");
840
841 prop = RNA_def_property(srna, "scale", PROP_FLOAT, PROP_XYZ);
842 RNA_def_property_float_sdna(prop, nullptr, "size");
845 RNA_def_property_editable_array_func(prop, "rna_PoseChannel_scale_editable");
847 RNA_def_property_ui_text(prop, "Scale", "");
848 RNA_def_property_update(prop, NC_OBJECT | ND_POSE, "rna_Pose_IK_update");
849
850 prop = RNA_def_property(srna, "rotation_quaternion", PROP_FLOAT, PROP_QUATERNION);
851 RNA_def_property_float_sdna(prop, nullptr, "quat");
853 RNA_def_property_editable_array_func(prop, "rna_PoseChannel_rotation_4d_editable");
855 RNA_def_property_ui_text(prop, "Quaternion Rotation", "Rotation in Quaternions");
856 RNA_def_property_update(prop, NC_OBJECT | ND_POSE, "rna_Pose_update");
857
858 /* XXX: for axis-angle, it would have been nice to have 2 separate fields for UI purposes, but
859 * having a single one is better for Keyframing and other property-management situations...
860 */
861 prop = RNA_def_property(srna, "rotation_axis_angle", PROP_FLOAT, PROP_AXISANGLE);
863 RNA_def_property_array(prop, 4);
865 "rna_PoseChannel_rotation_axis_angle_get",
866 "rna_PoseChannel_rotation_axis_angle_set",
867 nullptr);
868 RNA_def_property_editable_array_func(prop, "rna_PoseChannel_rotation_4d_editable");
871 prop, "Axis-Angle Rotation", "Angle of Rotation for Axis-Angle rotation representation");
872 RNA_def_property_update(prop, NC_OBJECT | ND_POSE, "rna_Pose_update");
873
874 prop = RNA_def_property(srna, "rotation_euler", PROP_FLOAT, PROP_EULER);
875 RNA_def_property_float_sdna(prop, nullptr, "eul");
877 RNA_def_property_editable_array_func(prop, "rna_PoseChannel_rotation_euler_editable");
878 RNA_def_property_ui_text(prop, "Euler Rotation", "Rotation in Eulers");
880 RNA_def_property_update(prop, NC_OBJECT | ND_POSE, "rna_Pose_update");
881
882 prop = RNA_def_property(srna, "rotation_mode", PROP_ENUM, PROP_NONE);
883 RNA_def_property_enum_sdna(prop, nullptr, "rotmode");
886 RNA_def_property_enum_funcs(prop, nullptr, "rna_PoseChannel_rotation_mode_set", nullptr);
887 /* XXX... disabled, since proxy-locked layers are currently
888 * used for ensuring proxy-syncing too */
889 RNA_def_property_editable_func(prop, "rna_PoseChannel_proxy_editable");
890 RNA_def_property_ui_text(prop, "Rotation Mode", "");
891 RNA_def_property_update(prop, NC_OBJECT | ND_POSE, "rna_Pose_update");
892
893 /* Curved bones settings - Applied on top of rest-pose values. */
894 rna_def_bone_curved_common(srna, true, false);
895
896 /* Custom BBone next/prev sources */
897 prop = RNA_def_property(srna, "bbone_custom_handle_start", PROP_POINTER, PROP_NONE);
898 RNA_def_property_pointer_sdna(prop, nullptr, "bbone_prev");
899 RNA_def_property_struct_type(prop, "PoseBone");
903 prop, "B-Bone Start Handle", "Bone that serves as the start handle for the B-Bone curve");
904 RNA_def_property_update(prop, NC_OBJECT | ND_POSE, "rna_Pose_dependency_update");
905
906 prop = RNA_def_property(srna, "bbone_custom_handle_end", PROP_POINTER, PROP_NONE);
907 RNA_def_property_pointer_sdna(prop, nullptr, "bbone_next");
908 RNA_def_property_struct_type(prop, "PoseBone");
912 prop, "B-Bone End Handle", "Bone that serves as the end handle for the B-Bone curve");
913 RNA_def_property_update(prop, NC_OBJECT | ND_POSE, "rna_Pose_dependency_update");
914
915 /* transform matrices - should be read-only since these are set directly by AnimSys evaluation */
916 prop = RNA_def_property(srna, "matrix_channel", PROP_FLOAT, PROP_MATRIX);
917 RNA_def_property_float_sdna(prop, nullptr, "chan_mat");
921 "Channel Matrix",
923 "4 matrix of the bone's location/rotation/scale channels (including "
924 "animation and drivers) and the effect of bone constraints");
925
926 /* writable because it touches loc/scale/rot directly */
927 prop = RNA_def_property(srna, "matrix_basis", PROP_FLOAT, PROP_MATRIX);
930 prop,
931 "Basis Matrix",
932 "Alternative access to location/scale/rotation relative to the parent and own rest bone");
934 prop, "rna_PoseChannel_matrix_basis_get", "rna_PoseChannel_matrix_basis_set", nullptr);
936 RNA_def_property_update(prop, NC_OBJECT | ND_POSE, "rna_Pose_update");
937
938 /* final matrix */
939 prop = RNA_def_property(srna, "matrix", PROP_FLOAT, PROP_MATRIX);
940 RNA_def_property_float_sdna(prop, nullptr, "pose_mat");
942 RNA_def_property_float_funcs(prop, nullptr, "rna_PoseChannel_matrix_set", nullptr);
944 "Pose Matrix",
946 "4 matrix after constraints and drivers are applied, in "
947 "the armature object space");
948 RNA_def_property_update(prop, NC_OBJECT | ND_POSE, "rna_Pose_update");
949
950 /* Head/Tail Coordinates (in Pose Space) - Automatically calculated... */
951 prop = RNA_def_property(srna, "head", PROP_FLOAT, PROP_TRANSLATION);
952 RNA_def_property_float_sdna(prop, nullptr, "pose_head");
954 RNA_def_property_ui_text(prop, "Pose Head Position", "Location of head of the channel's bone");
956
957 prop = RNA_def_property(srna, "tail", PROP_FLOAT, PROP_TRANSLATION);
958 RNA_def_property_float_sdna(prop, nullptr, "pose_tail");
960 RNA_def_property_ui_text(prop, "Pose Tail Position", "Location of tail of the channel's bone");
962
963 prop = RNA_def_property(srna, "length", PROP_FLOAT, PROP_DISTANCE);
964 RNA_def_property_float_funcs(prop, "rna_PoseChannel_length_get", nullptr, nullptr);
966 RNA_def_property_ui_text(prop, "Length", "Length of the bone");
967
968 /* IK Settings */
969 prop = RNA_def_property(srna, "is_in_ik_chain", PROP_BOOLEAN, PROP_NONE);
970 RNA_def_property_boolean_funcs(prop, "rna_PoseChannel_has_ik_get", nullptr);
973 RNA_def_property_ui_text(prop, "Has IK", "Is part of an IK chain");
974 RNA_def_property_update(prop, NC_OBJECT | ND_POSE, "rna_Pose_IK_update");
975
976 prop = RNA_def_property(srna, "lock_ik_x", PROP_BOOLEAN, PROP_NONE);
977 RNA_def_property_boolean_sdna(prop, nullptr, "ikflag", BONE_IK_NO_XDOF);
978 RNA_def_property_ui_icon(prop, ICON_UNLOCKED, true);
979 RNA_def_property_ui_text(prop, "IK X Lock", "Disallow movement around the X axis");
980 RNA_def_property_editable_func(prop, "rna_PoseChannel_proxy_editable");
981 RNA_def_property_update(prop, NC_OBJECT | ND_POSE, "rna_Pose_IK_update");
982
983 prop = RNA_def_property(srna, "lock_ik_y", PROP_BOOLEAN, PROP_NONE);
984 RNA_def_property_boolean_sdna(prop, nullptr, "ikflag", BONE_IK_NO_YDOF);
985 RNA_def_property_ui_icon(prop, ICON_UNLOCKED, true);
986 RNA_def_property_ui_text(prop, "IK Y Lock", "Disallow movement around the Y axis");
987 RNA_def_property_editable_func(prop, "rna_PoseChannel_proxy_editable");
988 RNA_def_property_update(prop, NC_OBJECT | ND_POSE, "rna_Pose_IK_update");
989
990 prop = RNA_def_property(srna, "lock_ik_z", PROP_BOOLEAN, PROP_NONE);
991 RNA_def_property_boolean_sdna(prop, nullptr, "ikflag", BONE_IK_NO_ZDOF);
992 RNA_def_property_ui_icon(prop, ICON_UNLOCKED, true);
993 RNA_def_property_ui_text(prop, "IK Z Lock", "Disallow movement around the Z axis");
994 RNA_def_property_editable_func(prop, "rna_PoseChannel_proxy_editable");
995 RNA_def_property_update(prop, NC_OBJECT | ND_POSE, "rna_Pose_IK_update");
996
997 prop = RNA_def_property(srna, "use_ik_limit_x", PROP_BOOLEAN, PROP_NONE);
998 RNA_def_property_boolean_sdna(prop, nullptr, "ikflag", BONE_IK_XLIMIT);
999 RNA_def_property_ui_text(prop, "IK X Limit", "Limit movement around the X axis");
1000 RNA_def_property_editable_func(prop, "rna_PoseChannel_proxy_editable");
1001 RNA_def_property_update(prop, NC_OBJECT | ND_POSE, "rna_Pose_IK_update");
1002
1003 prop = RNA_def_property(srna, "use_ik_limit_y", PROP_BOOLEAN, PROP_NONE);
1004 RNA_def_property_boolean_sdna(prop, nullptr, "ikflag", BONE_IK_YLIMIT);
1005 RNA_def_property_ui_text(prop, "IK Y Limit", "Limit movement around the Y axis");
1006 RNA_def_property_editable_func(prop, "rna_PoseChannel_proxy_editable");
1007 RNA_def_property_update(prop, NC_OBJECT | ND_POSE, "rna_Pose_IK_update");
1008
1009 prop = RNA_def_property(srna, "use_ik_limit_z", PROP_BOOLEAN, PROP_NONE);
1010 RNA_def_property_boolean_sdna(prop, nullptr, "ikflag", BONE_IK_ZLIMIT);
1011 RNA_def_property_ui_text(prop, "IK Z Limit", "Limit movement around the Z axis");
1012 RNA_def_property_editable_func(prop, "rna_PoseChannel_proxy_editable");
1013 RNA_def_property_update(prop, NC_OBJECT | ND_POSE, "rna_Pose_IK_update");
1014
1015 prop = RNA_def_property(srna, "use_ik_rotation_control", PROP_BOOLEAN, PROP_NONE);
1016 RNA_def_property_boolean_sdna(prop, nullptr, "ikflag", BONE_IK_ROTCTL);
1017 RNA_def_property_ui_text(prop, "IK Rotation Control", "Apply channel rotation as IK constraint");
1018 RNA_def_property_editable_func(prop, "rna_PoseChannel_proxy_editable");
1019 RNA_def_property_update(prop, NC_OBJECT | ND_POSE, "rna_Pose_IK_update");
1020
1021 prop = RNA_def_property(srna, "use_ik_linear_control", PROP_BOOLEAN, PROP_NONE);
1022 RNA_def_property_boolean_sdna(prop, nullptr, "ikflag", BONE_IK_LINCTL);
1024 prop, "IK Linear Control", "Apply channel size as IK constraint if stretching is enabled");
1025 RNA_def_property_editable_func(prop, "rna_PoseChannel_proxy_editable");
1026 RNA_def_property_update(prop, NC_OBJECT | ND_POSE, "rna_Pose_IK_update");
1027
1028 prop = RNA_def_property(srna, "ik_min_x", PROP_FLOAT, PROP_ANGLE);
1029 RNA_def_property_float_sdna(prop, nullptr, "limitmin[0]");
1030 RNA_def_property_range(prop, -M_PI, 0.0f);
1031 RNA_def_property_ui_text(prop, "IK X Minimum", "Minimum angles for IK Limit");
1032 RNA_def_property_editable_func(prop, "rna_PoseChannel_proxy_editable");
1033 RNA_def_property_update(prop, NC_OBJECT | ND_POSE, "rna_Pose_IK_update");
1034
1035 prop = RNA_def_property(srna, "ik_max_x", PROP_FLOAT, PROP_ANGLE);
1036 RNA_def_property_float_sdna(prop, nullptr, "limitmax[0]");
1037 RNA_def_property_range(prop, 0.0f, M_PI);
1038 RNA_def_property_ui_text(prop, "IK X Maximum", "Maximum angles for IK Limit");
1039 RNA_def_property_editable_func(prop, "rna_PoseChannel_proxy_editable");
1040 RNA_def_property_update(prop, NC_OBJECT | ND_POSE, "rna_Pose_IK_update");
1041
1042 prop = RNA_def_property(srna, "ik_min_y", PROP_FLOAT, PROP_ANGLE);
1043 RNA_def_property_float_sdna(prop, nullptr, "limitmin[1]");
1044 RNA_def_property_range(prop, -M_PI, 0.0f);
1045 RNA_def_property_ui_text(prop, "IK Y Minimum", "Minimum angles for IK Limit");
1046 RNA_def_property_editable_func(prop, "rna_PoseChannel_proxy_editable");
1047 RNA_def_property_update(prop, NC_OBJECT | ND_POSE, "rna_Pose_IK_update");
1048
1049 prop = RNA_def_property(srna, "ik_max_y", PROP_FLOAT, PROP_ANGLE);
1050 RNA_def_property_float_sdna(prop, nullptr, "limitmax[1]");
1051 RNA_def_property_range(prop, 0.0f, M_PI);
1052 RNA_def_property_ui_text(prop, "IK Y Maximum", "Maximum angles for IK Limit");
1053 RNA_def_property_editable_func(prop, "rna_PoseChannel_proxy_editable");
1054 RNA_def_property_update(prop, NC_OBJECT | ND_POSE, "rna_Pose_IK_update");
1055
1056 prop = RNA_def_property(srna, "ik_min_z", PROP_FLOAT, PROP_ANGLE);
1057 RNA_def_property_float_sdna(prop, nullptr, "limitmin[2]");
1058 RNA_def_property_range(prop, -M_PI, 0.0f);
1059 RNA_def_property_ui_text(prop, "IK Z Minimum", "Minimum angles for IK Limit");
1060 RNA_def_property_editable_func(prop, "rna_PoseChannel_proxy_editable");
1061 RNA_def_property_update(prop, NC_OBJECT | ND_POSE, "rna_Pose_IK_update");
1062
1063 prop = RNA_def_property(srna, "ik_max_z", PROP_FLOAT, PROP_ANGLE);
1064 RNA_def_property_float_sdna(prop, nullptr, "limitmax[2]");
1065 RNA_def_property_range(prop, 0.0f, M_PI);
1066 RNA_def_property_ui_text(prop, "IK Z Maximum", "Maximum angles for IK Limit");
1067 RNA_def_property_editable_func(prop, "rna_PoseChannel_proxy_editable");
1068 RNA_def_property_update(prop, NC_OBJECT | ND_POSE, "rna_Pose_IK_update");
1069
1070 prop = RNA_def_property(srna, "ik_stiffness_x", PROP_FLOAT, PROP_NONE);
1071 RNA_def_property_float_sdna(prop, nullptr, "stiffness[0]");
1072 RNA_def_property_range(prop, 0.0f, 0.99f);
1073 RNA_def_property_ui_text(prop, "IK X Stiffness", "IK stiffness around the X axis");
1074 RNA_def_property_editable_func(prop, "rna_PoseChannel_proxy_editable");
1075 RNA_def_property_update(prop, NC_OBJECT | ND_POSE, "rna_Pose_IK_update");
1076
1077 prop = RNA_def_property(srna, "ik_stiffness_y", PROP_FLOAT, PROP_NONE);
1078 RNA_def_property_float_sdna(prop, nullptr, "stiffness[1]");
1079 RNA_def_property_range(prop, 0.0f, 0.99f);
1080 RNA_def_property_ui_text(prop, "IK Y Stiffness", "IK stiffness around the Y axis");
1081 RNA_def_property_editable_func(prop, "rna_PoseChannel_proxy_editable");
1082 RNA_def_property_update(prop, NC_OBJECT | ND_POSE, "rna_Pose_IK_update");
1083
1084 prop = RNA_def_property(srna, "ik_stiffness_z", PROP_FLOAT, PROP_NONE);
1085 RNA_def_property_float_sdna(prop, nullptr, "stiffness[2]");
1086 RNA_def_property_range(prop, 0.0f, 0.99f);
1087 RNA_def_property_ui_text(prop, "IK Z Stiffness", "IK stiffness around the Z axis");
1088 RNA_def_property_editable_func(prop, "rna_PoseChannel_proxy_editable");
1089 RNA_def_property_update(prop, NC_OBJECT | ND_POSE, "rna_Pose_IK_update");
1090
1091 prop = RNA_def_property(srna, "ik_stretch", PROP_FLOAT, PROP_FACTOR);
1092 RNA_def_property_float_sdna(prop, nullptr, "ikstretch");
1093 RNA_def_property_range(prop, 0.0f, 1.0f);
1094 RNA_def_property_ui_text(prop, "IK Stretch", "Allow scaling of the bone for IK");
1095 RNA_def_property_editable_func(prop, "rna_PoseChannel_proxy_editable");
1096 RNA_def_property_update(prop, NC_OBJECT | ND_POSE, "rna_Pose_IK_update");
1097
1098 prop = RNA_def_property(srna, "ik_rotation_weight", PROP_FLOAT, PROP_FACTOR);
1099 RNA_def_property_float_sdna(prop, nullptr, "ikrotweight");
1100 RNA_def_property_range(prop, 0.0f, 1.0f);
1101 RNA_def_property_ui_text(prop, "IK Rotation Weight", "Weight of rotation constraint for IK");
1102 RNA_def_property_editable_func(prop, "rna_PoseChannel_proxy_editable");
1103 RNA_def_property_update(prop, NC_OBJECT | ND_POSE, "rna_Pose_update");
1104
1105 prop = RNA_def_property(srna, "ik_linear_weight", PROP_FLOAT, PROP_FACTOR);
1106 RNA_def_property_float_sdna(prop, nullptr, "iklinweight");
1107 RNA_def_property_range(prop, 0.0f, 1.0f);
1108 RNA_def_property_ui_text(prop, "IK Lin Weight", "Weight of scale constraint for IK");
1109 RNA_def_property_editable_func(prop, "rna_PoseChannel_proxy_editable");
1110 RNA_def_property_update(prop, NC_OBJECT | ND_POSE, "rna_Pose_update");
1111
1112 /* custom bone shapes */
1113 prop = RNA_def_property(srna, "custom_shape", PROP_POINTER, PROP_NONE);
1114 RNA_def_property_pointer_sdna(prop, nullptr, "custom");
1115 RNA_def_property_struct_type(prop, "Object");
1119 prop, "Custom Object", "Object that defines custom display shape for this bone");
1120 RNA_def_property_editable_func(prop, "rna_PoseChannel_proxy_editable");
1121 RNA_def_property_update(prop, NC_OBJECT | ND_POSE, "rna_Pose_dependency_update");
1122
1123 prop = RNA_def_property(srna, "custom_shape_scale_xyz", PROP_FLOAT, PROP_XYZ);
1124 RNA_def_property_float_sdna(prop, nullptr, "custom_scale_xyz");
1127 RNA_def_property_ui_text(prop, "Custom Shape Scale", "Adjust the size of the custom shape");
1128 RNA_def_property_update(prop, NC_OBJECT | ND_POSE, "rna_Pose_update");
1129
1130 prop = RNA_def_property(srna, "custom_shape_translation", PROP_FLOAT, PROP_XYZ);
1131 RNA_def_property_float_sdna(prop, nullptr, "custom_translation");
1134 prop, "Custom Shape Translation", "Adjust the location of the custom shape");
1136 RNA_def_property_update(prop, NC_OBJECT | ND_POSE, "rna_Pose_update");
1137
1138 prop = RNA_def_property(srna, "custom_shape_rotation_euler", PROP_FLOAT, PROP_EULER);
1139 RNA_def_property_float_sdna(prop, nullptr, "custom_rotation_euler");
1141 prop, "Custom Shape Rotation", "Adjust the rotation of the custom shape");
1143 RNA_def_property_update(prop, NC_OBJECT | ND_POSE, "rna_Pose_update");
1144
1145 prop = RNA_def_property(srna, "use_custom_shape_bone_size", PROP_BOOLEAN, PROP_NONE);
1147 prop, nullptr, "drawflag", PCHAN_DRAW_NO_CUSTOM_BONE_SIZE);
1149 prop, "Scale to Bone Length", "Scale the custom object by the bone length");
1150 RNA_def_property_update(prop, NC_OBJECT | ND_POSE, "rna_Pose_update");
1151
1152 prop = RNA_def_property(srna, "custom_shape_transform", PROP_POINTER, PROP_NONE);
1153 RNA_def_property_pointer_sdna(prop, nullptr, "custom_tx");
1154 RNA_def_property_struct_type(prop, "PoseBone");
1158 "Custom Shape Transform",
1159 "Bone that defines the display transform of this custom shape");
1160 RNA_def_property_editable_func(prop, "rna_PoseChannel_proxy_editable");
1162 prop, nullptr, "rna_PoseChannel_custom_shape_transform_set", nullptr, nullptr);
1163 RNA_def_property_update(prop, NC_OBJECT | ND_POSE, "rna_Pose_update");
1164
1165 prop = RNA_def_property(srna, "custom_shape_wire_width", PROP_FLOAT, PROP_NONE);
1166 RNA_def_property_float_sdna(prop, nullptr, "custom_shape_wire_width");
1167 RNA_def_property_ui_text(prop, "Wire Width", "Adjust the line thickness of custom shapes");
1168 /* When changing the upper limit of the range, also adjust the WIRE_WIDTH_COMPRESSION in
1169 * overlay_shader_shared.h */
1170 RNA_def_property_range(prop, 1.0f, 16.0f);
1171 RNA_def_property_ui_range(prop, 1.0f, 10.0f, 1, 1);
1172 RNA_def_property_update(prop, NC_OBJECT | ND_POSE, "rna_Pose_update");
1173
1174 prop = RNA_def_property(srna, "color", PROP_POINTER, PROP_NONE);
1175 RNA_def_property_struct_type(prop, "BoneColor");
1178
1179 /* transform locks */
1180 prop = RNA_def_property(srna, "lock_location", PROP_BOOLEAN, PROP_NONE);
1181 RNA_def_property_boolean_sdna(prop, nullptr, "protectflag", OB_LOCK_LOCX);
1182 RNA_def_property_array(prop, 3);
1183 RNA_def_property_ui_text(prop, "Lock Location", "Lock editing of location when transforming");
1184 RNA_def_property_ui_icon(prop, ICON_UNLOCKED, 1);
1185 RNA_def_property_editable_func(prop, "rna_PoseChannel_proxy_editable");
1186 RNA_def_property_update(prop, NC_OBJECT | ND_POSE, "rna_Pose_update");
1187
1188 prop = RNA_def_property(srna, "lock_rotation", PROP_BOOLEAN, PROP_NONE);
1189 RNA_def_property_boolean_sdna(prop, nullptr, "protectflag", OB_LOCK_ROTX);
1190 RNA_def_property_array(prop, 3);
1191 RNA_def_property_ui_text(prop, "Lock Rotation", "Lock editing of rotation when transforming");
1192 RNA_def_property_ui_icon(prop, ICON_UNLOCKED, 1);
1193 RNA_def_property_editable_func(prop, "rna_PoseChannel_proxy_editable");
1194 RNA_def_property_update(prop, NC_OBJECT | ND_POSE, "rna_Pose_update");
1195
1196 /* XXX this is sub-optimal - it really should be included above, but due to technical reasons
1197 * we can't do this! */
1198 prop = RNA_def_property(srna, "lock_rotation_w", PROP_BOOLEAN, PROP_NONE);
1199 RNA_def_property_boolean_sdna(prop, nullptr, "protectflag", OB_LOCK_ROTW);
1201 prop,
1202 "Lock Rotation (4D Angle)",
1203 "Lock editing of 'angle' component of four-component rotations when transforming");
1204 RNA_def_property_ui_icon(prop, ICON_UNLOCKED, 1);
1205 RNA_def_property_editable_func(prop, "rna_PoseChannel_proxy_editable");
1206 RNA_def_property_update(prop, NC_OBJECT | ND_POSE, "rna_Pose_update");
1207
1208 /* XXX this needs a better name */
1209 prop = RNA_def_property(srna, "lock_rotations_4d", PROP_BOOLEAN, PROP_NONE);
1210 RNA_def_property_boolean_sdna(prop, nullptr, "protectflag", OB_LOCK_ROT4D);
1212 prop,
1213 "Lock Rotations (4D)",
1214 "Lock editing of four component rotations by components (instead of as Eulers)");
1215 RNA_def_property_editable_func(prop, "rna_PoseChannel_proxy_editable");
1216 RNA_def_property_update(prop, NC_OBJECT | ND_POSE, "rna_Pose_update");
1217
1218 prop = RNA_def_property(srna, "lock_scale", PROP_BOOLEAN, PROP_NONE);
1219 RNA_def_property_boolean_sdna(prop, nullptr, "protectflag", OB_LOCK_SCALEX);
1220 RNA_def_property_array(prop, 3);
1221 RNA_def_property_ui_text(prop, "Lock Scale", "Lock editing of scale when transforming");
1222 RNA_def_property_ui_icon(prop, ICON_UNLOCKED, 1);
1223 RNA_def_property_editable_func(prop, "rna_PoseChannel_proxy_editable");
1224 RNA_def_property_update(prop, NC_OBJECT | ND_POSE, "rna_Pose_update");
1225
1227}
1228
1230{
1231 static const EnumPropertyItem prop_itasc_mode_items[] = {
1232 {0,
1233 "ANIMATION",
1234 0,
1235 "Animation",
1236 "Stateless solver computing pose starting from current action and non-IK constraints"},
1238 "SIMULATION",
1239 0,
1240 "Simulation",
1241 "State-full solver running in real-time context and ignoring actions "
1242 "and non-IK constraints"},
1243 {0, nullptr, 0, nullptr, nullptr},
1244 };
1245 static const EnumPropertyItem prop_itasc_reiteration_items[] = {
1246 {0,
1247 "NEVER",
1248 0,
1249 "Never",
1250 "The solver does not reiterate, not even on first frame (starts from rest pose)"},
1252 "INITIAL",
1253 0,
1254 "Initial",
1255 "The solver reiterates (converges) on the first frame but not on "
1256 "subsequent frame"},
1258 "ALWAYS",
1259 0,
1260 "Always",
1261 "The solver reiterates (converges) on all frames"},
1262 {0, nullptr, 0, nullptr, nullptr},
1263 };
1264
1265 StructRNA *srna;
1266 PropertyRNA *prop;
1267
1268 srna = RNA_def_struct(brna, "Itasc", "IKParam");
1269 RNA_def_struct_sdna(srna, "bItasc");
1270 RNA_def_struct_ui_text(srna, "bItasc", "Parameters for the iTaSC IK solver");
1271
1272 prop = RNA_def_property(srna, "precision", PROP_FLOAT, PROP_NONE);
1273 RNA_def_property_float_sdna(prop, nullptr, "precision");
1274 RNA_def_property_range(prop, 0.0f, 0.1f);
1275 RNA_def_property_ui_text(prop, "Precision", "Precision of convergence in case of reiteration");
1276 RNA_def_property_update(prop, NC_OBJECT | ND_POSE, "rna_Itasc_update");
1277
1278 prop = RNA_def_property(srna, "iterations", PROP_INT, PROP_NONE);
1279 RNA_def_property_int_sdna(prop, nullptr, "numiter");
1280 RNA_def_property_range(prop, 0, 1000);
1282 prop, "Iterations", "Maximum number of iterations for convergence in case of reiteration");
1283 RNA_def_property_update(prop, NC_OBJECT | ND_POSE, "rna_Itasc_update");
1284
1285 prop = RNA_def_property(srna, "step_count", PROP_INT, PROP_NONE);
1286 RNA_def_property_int_sdna(prop, nullptr, "numstep");
1287 RNA_def_property_range(prop, 1.0f, 50.0f);
1288 RNA_def_property_ui_text(prop, "Num Steps", "Divide the frame interval into this many steps");
1289 RNA_def_property_update(prop, NC_OBJECT | ND_POSE, "rna_Itasc_update");
1290
1291 prop = RNA_def_property(srna, "translate_root_bones", PROP_BOOLEAN, PROP_NONE);
1294 prop, "Translate Roots", "Translate root (i.e. parentless) bones to the armature origin");
1295 RNA_def_property_update(prop, NC_OBJECT | ND_POSE, "rna_Itasc_update");
1296
1297 prop = RNA_def_property(srna, "mode", PROP_ENUM, PROP_NONE);
1298 RNA_def_property_enum_bitflag_sdna(prop, nullptr, "flag");
1299 RNA_def_property_enum_items(prop, prop_itasc_mode_items);
1300 RNA_def_property_ui_text(prop, "Mode", nullptr);
1301 RNA_def_property_update(prop, NC_OBJECT | ND_POSE, "rna_Itasc_update_rebuild");
1302
1303 prop = RNA_def_property(srna, "reiteration_method", PROP_ENUM, PROP_NONE);
1304 RNA_def_property_enum_bitflag_sdna(prop, nullptr, "flag");
1305 RNA_def_property_enum_items(prop, prop_itasc_reiteration_items);
1307 "Reiteration",
1308 "Defines if the solver is allowed to reiterate (converge until "
1309 "precision is met) on none, first or all frames");
1310 RNA_def_property_update(prop, NC_OBJECT | ND_POSE, "rna_Itasc_update");
1311
1312 prop = RNA_def_property(srna, "use_auto_step", PROP_BOOLEAN, PROP_NONE);
1313 RNA_def_property_boolean_sdna(prop, nullptr, "flag", ITASC_AUTO_STEP);
1315 "Auto Step",
1316 "Automatically determine the optimal number of steps for best "
1317 "performance/accuracy trade off");
1318 RNA_def_property_update(prop, NC_OBJECT | ND_POSE, "rna_Itasc_update");
1319
1320 prop = RNA_def_property(srna, "step_min", PROP_FLOAT, PROP_FACTOR);
1321 RNA_def_property_float_sdna(prop, nullptr, "minstep");
1322 RNA_def_property_range(prop, 0.0f, 0.1f);
1324 prop, "Min Step", "Lower bound for timestep in second in case of automatic substeps");
1325 RNA_def_property_update(prop, NC_OBJECT | ND_POSE, "rna_Itasc_update");
1326
1327 prop = RNA_def_property(srna, "step_max", PROP_FLOAT, PROP_FACTOR);
1328 RNA_def_property_float_sdna(prop, nullptr, "maxstep");
1329 RNA_def_property_range(prop, 0.0f, 1.0f);
1331 prop, "Max Step", "Higher bound for timestep in second in case of automatic substeps");
1332 RNA_def_property_update(prop, NC_OBJECT | ND_POSE, "rna_Itasc_update");
1333
1334 prop = RNA_def_property(srna, "feedback", PROP_FLOAT, PROP_NONE);
1335 RNA_def_property_float_sdna(prop, nullptr, "feedback");
1336 RNA_def_property_range(prop, 0.0f, 100.0f);
1338 prop,
1339 "Feedback",
1340 "Feedback coefficient for error correction, average response time is 1/feedback");
1341 RNA_def_property_update(prop, NC_OBJECT | ND_POSE, "rna_Itasc_update");
1342
1343 prop = RNA_def_property(srna, "velocity_max", PROP_FLOAT, PROP_NONE);
1344 RNA_def_property_float_sdna(prop, nullptr, "maxvel");
1345 RNA_def_property_range(prop, 0.0f, 100.0f);
1346 RNA_def_property_ui_text(prop, "Max Velocity", "Maximum joint velocity in radians/second");
1347 RNA_def_property_update(prop, NC_OBJECT | ND_POSE, "rna_Itasc_update");
1348
1349 prop = RNA_def_property(srna, "solver", PROP_ENUM, PROP_NONE);
1350 RNA_def_property_enum_sdna(prop, nullptr, "solver");
1353 prop, "Solver", "Solving method selection: automatic damping or manual damping");
1354 RNA_def_property_update(prop, NC_OBJECT | ND_POSE, "rna_Itasc_update_rebuild");
1355
1356 prop = RNA_def_property(srna, "damping_max", PROP_FLOAT, PROP_FACTOR);
1357 RNA_def_property_float_sdna(prop, nullptr, "dampmax");
1358 RNA_def_property_range(prop, 0.0f, 1.0f);
1360 "Damp",
1361 "Maximum damping coefficient when singular value is nearly 0 "
1362 "(higher values produce results with more stability, less reactivity)");
1363 RNA_def_property_update(prop, NC_OBJECT | ND_POSE, "rna_Itasc_update");
1364
1365 prop = RNA_def_property(srna, "damping_epsilon", PROP_FLOAT, PROP_FACTOR);
1366 RNA_def_property_float_sdna(prop, nullptr, "dampeps");
1367 RNA_def_property_range(prop, 0.0f, 1.0f);
1369 "Epsilon",
1370 "Singular value under which damping is progressively applied "
1371 "(higher values produce results with more stability, less reactivity)");
1372 RNA_def_property_update(prop, NC_OBJECT | ND_POSE, "rna_Itasc_update");
1373}
1374
1376{
1377 StructRNA *srna;
1378 PropertyRNA *prop;
1379
1380 srna = RNA_def_struct(brna, "IKParam", nullptr);
1381 RNA_def_struct_sdna(srna, "bIKParam");
1382 RNA_def_struct_ui_text(srna, "IKParam", "Base type for IK solver parameters");
1383 RNA_def_struct_refine_func(srna, "rna_IKParam_refine");
1384
1385 prop = RNA_def_property(srna, "ik_solver", PROP_ENUM, PROP_NONE);
1386 RNA_def_property_enum_sdna(prop, nullptr, "iksolver");
1389 RNA_def_property_ui_text(prop, "IK Solver", "IK solver for which these parameters are defined");
1390}
1391
1392static void rna_def_pose(BlenderRNA *brna)
1393{
1394 StructRNA *srna;
1395 PropertyRNA *prop;
1396
1397 /* struct definition */
1398 srna = RNA_def_struct(brna, "Pose", nullptr);
1399 RNA_def_struct_sdna(srna, "bPose");
1401 srna, "Pose", "A collection of pose channels, including settings for animating bones");
1402
1403 /* pose channels */
1404 prop = RNA_def_property(srna, "bones", PROP_COLLECTION, PROP_NONE);
1405 RNA_def_property_collection_sdna(prop, nullptr, "chanbase", nullptr);
1406 RNA_def_property_struct_type(prop, "PoseBone");
1408 RNA_def_property_ui_text(prop, "Pose Bones", "Individual pose bones for the armature");
1409 /* can be removed, only for fast lookup */
1411 nullptr,
1412 nullptr,
1413 nullptr,
1414 nullptr,
1415 nullptr,
1416 nullptr,
1417 "rna_PoseBones_lookup_string",
1418 nullptr);
1419
1420 /* ik solvers */
1421 prop = RNA_def_property(srna, "ik_solver", PROP_ENUM, PROP_NONE);
1422 RNA_def_property_enum_sdna(prop, nullptr, "iksolver");
1423 RNA_def_property_enum_funcs(prop, nullptr, "rna_Pose_ik_solver_set", nullptr);
1425 RNA_def_property_ui_text(prop, "IK Solver", "Selection of IK solver for IK chain");
1426 RNA_def_property_update(prop, NC_OBJECT | ND_POSE, "rna_Pose_ik_solver_update");
1427
1428 prop = RNA_def_property(srna, "ik_param", PROP_POINTER, PROP_NONE);
1429 RNA_def_property_struct_type(prop, "IKParam");
1431 prop, "rna_Pose_ikparam_get", nullptr, "rna_Pose_ikparam_typef", nullptr);
1433 RNA_def_property_ui_text(prop, "IK Param", "Parameters for IK solver");
1434
1436
1437 /* pose edit options */
1438 prop = RNA_def_property(srna, "use_mirror_x", PROP_BOOLEAN, PROP_NONE);
1439 RNA_def_property_boolean_sdna(prop, nullptr, "flag", POSE_MIRROR_EDIT);
1441 prop, "X-Axis Mirror", "Apply changes to matching bone on opposite side of X-Axis");
1442 RNA_def_struct_path_func(srna, "rna_Pose_path");
1443 RNA_def_property_update(prop, 0, "rna_Pose_update");
1445
1446 prop = RNA_def_property(srna, "use_mirror_relative", PROP_BOOLEAN, PROP_NONE);
1449 prop,
1450 "Relative Mirror",
1451 "Apply relative transformations in X-mirror mode (not supported with Auto IK)");
1452 RNA_def_struct_path_func(srna, "rna_Pose_path");
1453 RNA_def_property_update(prop, 0, "rna_Pose_update");
1455
1456 prop = RNA_def_property(srna, "use_auto_ik", PROP_BOOLEAN, PROP_NONE);
1457 RNA_def_property_boolean_sdna(prop, nullptr, "flag", POSE_AUTO_IK);
1459 prop, "Auto IK", "Add temporary IK constraints while grabbing bones in Pose Mode");
1460 RNA_def_struct_path_func(srna, "rna_Pose_path");
1461 RNA_def_property_update(prop, 0, "rna_Pose_update");
1463
1465
1466 /* animviz */
1468
1469 RNA_api_pose(srna);
1470}
1471
1473{
1474 rna_def_pose(brna);
1477 rna_def_pose_itasc(brna);
1478}
1479
1480#endif
void BIK_update_param(struct bPose *pose)
void BIK_clear_data(struct bPose *pose)
Blender kernel action and pose functionality.
void BKE_pose_tag_recalc(Main *bmain, bPose *pose) ATTR_NONNULL(1
void BKE_pose_ikparam_init(bPose *pose) ATTR_NONNULL(1)
void BKE_pose_update_constraint_flags(bPose *pose) ATTR_NONNULL(1)
bPoseChannel * BKE_pose_channel_find_name(const bPose *pose, const char *name)
bool BKE_pose_channel_in_IK_chain(Object *ob, bPoseChannel *pchan)
void action_group_colors_sync(bActionGroup *grp, const bActionGroup *ref_grp)
void BKE_pchan_apply_mat4(bPoseChannel *pchan, const float mat[4][4], bool use_compat)
Definition armature.cc:2358
void BKE_pchan_to_mat4(const bPoseChannel *pchan, float r_chanmat[4][4])
Definition armature.cc:2837
void BKE_rotMode_change_values(float quat[4], float eul[3], float axis[3], float *angle, short oldMode, short newMode)
Definition armature.cc:2383
void BKE_armature_mat_pose_to_bone_ex(Depsgraph *depsgraph, Object *ob, bPoseChannel *pchan, const float inmat[4][4], float outmat[4][4])
Definition armature.cc:2292
bool BKE_constraint_remove(ListBase *list, struct bConstraint *con)
struct bConstraint * BKE_constraint_copy_for_pose(struct Object *ob, struct bPoseChannel *pchan, struct bConstraint *src)
struct bConstraint * BKE_constraint_add_for_pose(struct Object *ob, struct bPoseChannel *pchan, const char *name, short type)
struct bConstraint * BKE_constraint_duplicate_ex(struct bConstraint *src, int flag, bool do_extern)
struct bConstraint * BKE_constraints_active_get(struct ListBase *list)
void BKE_constraints_active_set(ListBase *list, struct bConstraint *con)
void BKE_constraint_unique_name(struct bConstraint *con, struct ListBase *list)
#define G_MAIN
bool BKE_id_is_in_global_main(ID *id)
Definition lib_id.cc:2433
void BKE_reportf(ReportList *reports, eReportType type, const char *format,...) ATTR_PRINTF_FORMAT(3
void BKE_report(ReportList *reports, eReportType type, const char *message)
Definition report.cc:125
#define BLI_assert(a)
Definition BLI_assert.h:50
#define BLI_assert_msg(a, msg)
Definition BLI_assert.h:57
bool BLI_listbase_move_index(ListBase *listbase, int from, int to) ATTR_NONNULL()
Definition listbase.cc:466
void BLI_insertlinkafter(struct ListBase *listbase, void *vprevlink, void *vnewlink) ATTR_NONNULL(1)
Definition listbase.cc:331
int BLI_findindex(const struct ListBase *listbase, const void *vlink) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1)
void void * BLI_listbase_string_or_index_find(const struct ListBase *listbase, const char *string, size_t string_offset, int index) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1)
#define M_PI
MINLINE float len_v3v3(const float a[3], const float b[3]) ATTR_WARN_UNUSED_RESULT
MINLINE void copy_v3_v3(float r[3], const float a[3])
#define STRNCPY(dst, src)
Definition BLI_string.h:593
size_t BLI_str_escape(char *__restrict dst, const char *__restrict src, size_t dst_maxncpy) ATTR_NONNULL(1
#define STRNCPY_UTF8(dst, src)
#define BLI_STR_UTF8_MULTIPLICATION_SIGN
#define ELEM(...)
void DEG_id_tag_update(ID *id, unsigned int flags)
void DEG_relations_tag_update(Main *bmain)
@ ID_RECALC_TRANSFORM
Definition DNA_ID.h:1021
@ ID_RECALC_GEOMETRY
Definition DNA_ID.h:1041
@ LIBOVERRIDE_OP_INSERT_AFTER
Definition DNA_ID.h:239
#define ID_IS_OVERRIDE_LIBRARY(_id)
Definition DNA_ID.h:683
@ ITASC_SOLVER_SDLS
@ ITASC_SOLVER_DLS
@ IKSOLVER_STANDARD
@ IKSOLVER_ITASC
@ ITASC_REITERATION
@ ITASC_AUTO_STEP
@ ITASC_TRANSLATE_ROOT_BONES
@ ITASC_SIMULATION
@ ITASC_INITIAL_REITERATION
@ BONE_IK_ZLIMIT
@ BONE_IK_XLIMIT
@ BONE_IK_NO_ZDOF
@ BONE_IK_ROTCTL
@ BONE_IK_YLIMIT
@ BONE_IK_NO_YDOF
@ BONE_IK_LINCTL
@ BONE_IK_NO_XDOF
@ PCHAN_DRAW_NO_CUSTOM_BONE_SIZE
@ POSE_AUTO_IK
@ POSE_MIRROR_EDIT
@ POSE_MIRROR_RELATIVE
@ CONSTRAINT_OVERRIDE_LIBRARY_LOCAL
@ CONSTRAINT_TYPE_SPLINEIK
@ CONSTRAINT_TYPE_KINEMATIC
Object is a sort of wrapper for general info.
@ OB_LOCK_ROTZ
@ OB_LOCK_ROT4D
@ OB_LOCK_SCALEZ
@ OB_LOCK_ROTX
@ OB_LOCK_SCALEX
@ OB_LOCK_ROTW
@ OB_LOCK_LOCY
@ OB_LOCK_LOCZ
@ OB_LOCK_ROTY
@ OB_LOCK_SCALEY
@ OB_LOCK_LOCX
Read Guarded memory(de)allocation.
#define RNA_POINTER_INVALIDATE(ptr)
ParameterFlag
Definition RNA_types.hh:396
@ PARM_RNAPTR
Definition RNA_types.hh:399
@ PARM_REQUIRED
Definition RNA_types.hh:397
@ FUNC_USE_REPORTS
Definition RNA_types.hh:680
@ FUNC_USE_MAIN
Definition RNA_types.hh:678
@ FUNC_USE_SELF_ID
Definition RNA_types.hh:667
@ PROP_FLOAT
Definition RNA_types.hh:67
@ PROP_BOOLEAN
Definition RNA_types.hh:65
@ PROP_ENUM
Definition RNA_types.hh:69
@ PROP_INT
Definition RNA_types.hh:66
@ PROP_STRING
Definition RNA_types.hh:68
@ PROP_POINTER
Definition RNA_types.hh:70
@ PROP_COLLECTION
Definition RNA_types.hh:71
#define RNA_TRANSLATION_PREC_DEFAULT
Definition RNA_types.hh:127
@ PROPOVERRIDE_OVERRIDABLE_LIBRARY
Definition RNA_types.hh:355
@ PROPOVERRIDE_NO_COMPARISON
Definition RNA_types.hh:363
@ PROPOVERRIDE_LIBRARY_INSERTION
Definition RNA_types.hh:380
PropertyFlag
Definition RNA_types.hh:201
@ PROP_THICK_WRAP
Definition RNA_types.hh:312
@ PROP_ANIMATABLE
Definition RNA_types.hh:220
@ PROP_PROPORTIONAL
Definition RNA_types.hh:250
@ PROP_EDITABLE
Definition RNA_types.hh:207
@ PROP_LIB_EXCEPTION
Definition RNA_types.hh:213
@ PROP_NEVER_NULL
Definition RNA_types.hh:266
@ PROP_PTR_NO_OWNERSHIP
Definition RNA_types.hh:284
@ PROP_ID_REFCOUNT
Definition RNA_types.hh:253
@ PROP_MATRIX
Definition RNA_types.hh:168
@ PROP_XYZ
Definition RNA_types.hh:172
@ PROP_DISTANCE
Definition RNA_types.hh:159
@ PROP_ANGLE
Definition RNA_types.hh:155
@ PROP_AXISANGLE
Definition RNA_types.hh:171
@ PROP_EULER
Definition RNA_types.hh:169
@ PROP_NONE
Definition RNA_types.hh:136
@ PROP_FACTOR
Definition RNA_types.hh:154
@ PROP_TRANSLATION
Definition RNA_types.hh:164
@ PROP_QUATERNION
Definition RNA_types.hh:170
#define NC_GEOM
Definition WM_types.hh:360
#define ND_DATA
Definition WM_types.hh:475
#define NC_ANIMATION
Definition WM_types.hh:355
#define NA_ADDED
Definition WM_types.hh:552
#define ND_POSE
Definition WM_types.hh:425
#define ND_CONSTRAINT
Definition WM_types.hh:431
#define NA_REMOVED
Definition WM_types.hh:553
#define NC_OBJECT
Definition WM_types.hh:346
#define ND_ANIMCHAN
Definition WM_types.hh:463
void ED_armature_bone_rename(Main *bmain, bArmature *arm, const char *oldnamep, const char *newnamep)
#define offsetof(t, d)
void MEM_freeN(void *vmemh)
Definition mallocn.cc:105
int main()
void object_test_constraints(Main *bmain, Object *ob)
void constraint_dependency_tag_update(Main *bmain, Object *ob, bConstraint *con)
void constraint_update(Main *bmain, Object *ob)
void constraint_tag_update(Main *bmain, Object *ob, bConstraint *con)
void RNA_property_update_main(Main *bmain, Scene *scene, PointerRNA *ptr, PropertyRNA *prop)
PointerRNA rna_pointer_inherit_refine(const PointerRNA *ptr, StructRNA *type, void *data)
PointerRNA RNA_pointer_create(ID *id, StructRNA *type, void *data)
void rna_def_animviz_common(StructRNA *srna)
void rna_def_motionpath_common(StructRNA *srna)
void rna_def_bone_curved_common(StructRNA *srna, bool is_posebone, bool is_editbone)
const EnumPropertyItem rna_enum_constraint_type_items[]
void RNA_def_struct_name_property(StructRNA *srna, PropertyRNA *prop)
void RNA_def_struct_refine_func(StructRNA *srna, const char *refine)
void RNA_def_property_pointer_sdna(PropertyRNA *prop, const char *structname, const char *propname)
void RNA_define_lib_overridable(const bool make_overridable)
void RNA_def_struct_path_func(StructRNA *srna, const char *path)
void RNA_def_property_boolean_sdna(PropertyRNA *prop, const char *structname, const char *propname, int64_t bit)
void RNA_def_parameter_clear_flags(PropertyRNA *prop, PropertyFlag flag_property, ParameterFlag flag_parameter)
void RNA_def_property_string_funcs(PropertyRNA *prop, const char *get, const char *length, const char *set)
const float rna_default_quaternion[4]
void RNA_def_function_return(FunctionRNA *func, PropertyRNA *ret)
void RNA_def_property_float_funcs(PropertyRNA *prop, const char *get, const char *set, const char *range)
void RNA_def_property_ui_text(PropertyRNA *prop, const char *name, const char *description)
void RNA_def_property_ui_icon(PropertyRNA *prop, int icon, int consecutive)
void RNA_def_property_srna(PropertyRNA *prop, const char *type)
void RNA_def_property_collection_funcs(PropertyRNA *prop, const char *begin, const char *next, const char *end, const char *get, const char *length, const char *lookupint, const char *lookupstring, const char *assignint)
void RNA_def_struct_ui_text(StructRNA *srna, const char *name, const char *description)
const float rna_default_scale_3d[3]
void RNA_def_property_boolean_funcs(PropertyRNA *prop, const char *get, const char *set)
void RNA_def_property_multi_array(PropertyRNA *prop, int dimension, const int length[])
PropertyRNA * RNA_def_enum(StructOrFunctionRNA *cont_, const char *identifier, const EnumPropertyItem *items, const int default_value, const char *ui_name, const char *ui_description)
const float rna_default_axis_angle[4]
void RNA_def_property_editable_array_func(PropertyRNA *prop, const char *editable)
void RNA_def_property_enum_items(PropertyRNA *prop, const EnumPropertyItem *item)
void RNA_def_struct_sdna(StructRNA *srna, const char *structname)
FunctionRNA * RNA_def_function(StructRNA *srna, const char *identifier, const char *call)
void RNA_def_property_array(PropertyRNA *prop, int length)
void RNA_def_property_range(PropertyRNA *prop, double min, double max)
PropertyRNA * RNA_def_pointer(StructOrFunctionRNA *cont_, const char *identifier, const char *type, const char *ui_name, const char *ui_description)
void RNA_def_property_struct_type(PropertyRNA *prop, const char *type)
void RNA_def_property_collection_sdna(PropertyRNA *prop, const char *structname, const char *propname, const char *lengthpropname)
void RNA_def_function_ui_description(FunctionRNA *func, const char *description)
void RNA_def_property_update(PropertyRNA *prop, int noteflag, const char *func)
const int rna_matrix_dimsize_4x4[]
PropertyRNA * RNA_def_property(StructOrFunctionRNA *cont_, const char *identifier, int type, int subtype)
void RNA_def_property_enum_funcs(PropertyRNA *prop, const char *get, const char *set, const char *item)
void RNA_def_property_editable_func(PropertyRNA *prop, const char *editable)
void RNA_def_property_enum_bitflag_sdna(PropertyRNA *prop, const char *structname, const char *propname)
StructRNA * RNA_def_struct(BlenderRNA *brna, const char *identifier, const char *from)
void RNA_def_function_flag(FunctionRNA *func, int flag)
void RNA_def_property_clear_flag(PropertyRNA *prop, PropertyFlag flag)
void RNA_def_property_pointer_funcs(PropertyRNA *prop, const char *get, const char *set, const char *type_fn, const char *poll)
void RNA_def_property_enum_sdna(PropertyRNA *prop, const char *structname, const char *propname)
void RNA_def_struct_ui_icon(StructRNA *srna, int icon)
void RNA_def_struct_idprops_func(StructRNA *srna, const char *idproperties)
void RNA_def_property_override_funcs(PropertyRNA *prop, const char *diff, const char *store, const char *apply)
void RNA_def_property_flag(PropertyRNA *prop, PropertyFlag flag)
void RNA_def_property_float_sdna(PropertyRNA *prop, const char *structname, const char *propname)
void RNA_def_property_ui_range(PropertyRNA *prop, double min, double max, double step, int precision)
void RNA_def_property_int_sdna(PropertyRNA *prop, const char *structname, const char *propname)
void RNA_def_property_float_array_default(PropertyRNA *prop, const float *array)
PropertyRNA * RNA_def_int(StructOrFunctionRNA *cont_, const char *identifier, const int default_value, const int hardmin, const int hardmax, const char *ui_name, const char *ui_description, const int softmin, const int softmax)
void RNA_def_property_boolean_negative_sdna(PropertyRNA *prop, const char *structname, const char *propname, int64_t booleanbit)
void RNA_def_property_override_flag(PropertyRNA *prop, PropertyOverrideFlag flag)
void RNA_def_parameter_flags(PropertyRNA *prop, PropertyFlag flag_property, ParameterFlag flag_parameter)
bool rna_ActionGroup_is_custom_colorset_get(PointerRNA *ptr)
void RNA_api_pose(StructRNA *srna)
void rna_ActionGroup_colorset_set(PointerRNA *ptr, int value)
void RNA_api_pose_channel(StructRNA *srna)
const EnumPropertyItem rna_enum_object_rotation_mode_items[]
static void rna_def_pose_ikparam(BlenderRNA *brna)
Definition rna_pose.cc:1375
static const EnumPropertyItem prop_solver_items[]
Definition rna_pose.cc:700
const EnumPropertyItem rna_enum_color_sets_items[]
Definition rna_pose.cc:34
static void rna_def_pose_channel(BlenderRNA *brna)
Definition rna_pose.cc:777
static void rna_def_pose(BlenderRNA *brna)
Definition rna_pose.cc:1392
static void rna_def_pose_channel_constraints(BlenderRNA *brna, PropertyRNA *cprop)
Definition rna_pose.cc:706
static const EnumPropertyItem prop_iksolver_items[]
Definition rna_pose.cc:694
static void rna_def_pose_itasc(BlenderRNA *brna)
Definition rna_pose.cc:1229
void RNA_def_pose(BlenderRNA *brna)
Definition rna_pose.cc:1472
void rna_def_actionbone_group_common(StructRNA *srna, int update_flag, const char *update_cb)
Definition rna_pose.cc:665
#define FLT_MAX
Definition stdcycles.h:14
Definition DNA_ID.h:413
struct bPose * pose
ID * owner_id
Definition RNA_types.hh:40
void * data
Definition RNA_types.hh:42
IDOverrideLibraryPropertyOperation * liboverride_operation
float precision
IDProperty * prop
struct Bone * bone
struct bPoseChannel * custom_tx
void WM_main_add_notifier(uint type, void *reference)
PointerRNA * ptr
Definition wm_files.cc:4126