Blender V5.0
pose_edit.cc
Go to the documentation of this file.
1/* SPDX-FileCopyrightText: 2001-2002 NaN Holding BV. All rights reserved.
2 *
3 * SPDX-License-Identifier: GPL-2.0-or-later */
4
9
10#include "BLI_listbase.h"
11#include "BLI_math_vector.h"
12#include "BLI_string_utf8.h"
13
14#include "BLT_translation.hh"
15
16#include "DNA_armature_types.h"
17#include "DNA_object_types.h"
18#include "DNA_scene_types.h"
19
21#include "BKE_armature.hh"
22#include "BKE_context.hh"
23#include "BKE_layer.hh"
24#include "BKE_lib_id.hh"
25#include "BKE_object.hh"
26#include "BKE_report.hh"
27
28#include "DEG_depsgraph.hh"
29
30#include "RNA_access.hh"
31#include "RNA_define.hh"
32#include "RNA_enum_types.hh"
33#include "RNA_prototypes.hh"
34
35#include "WM_api.hh"
36#include "WM_types.hh"
37
38#include "ED_anim_api.hh"
39#include "ED_armature.hh"
40#include "ED_keyframing.hh"
41#include "ED_object.hh"
42#include "ED_screen.hh"
43
44#include "ANIM_armature.hh"
46#include "ANIM_keyframing.hh"
47
48#include "armature_intern.hh"
49
50#undef DEBUG_TIME
51
52#ifdef DEBUG_TIME
53# include "BLI_time_utildefines.h"
54#endif
55
56using blender::Vector;
57
59{
60 /* NOTE: matches logic with #ED_operator_posemode_context(). */
61
62 ScrArea *area = CTX_wm_area(C);
63 Object *ob;
64
65 /* Since this call may also be used from the buttons window,
66 * we need to check for where to get the object. */
67 if (area && area->spacetype == SPACE_PROPERTIES) {
69 }
70 else {
72 }
73
74 return ob;
75}
76
78{
79 BLI_assert(BKE_id_is_editable(bmain, &ob->id));
80 bool ok = false;
81
82 switch (ob->type) {
83 case OB_ARMATURE:
84 ob->restore_mode = ob->mode;
85 ob->mode |= OB_MODE_POSE;
86
87 /* Inform all evaluated versions that we changed the mode. */
89 ok = true;
90
91 break;
92 default:
93 break;
94 }
95
96 return ok;
97}
99{
100 ReportList *reports = CTX_wm_reports(C);
101 Main *bmain = CTX_data_main(C);
102 if (!BKE_id_is_editable(bmain, &ob->id)) {
103 BKE_report(reports, RPT_WARNING, "Cannot pose libdata");
104 return false;
105 }
106 bool ok = ED_object_posemode_enter_ex(bmain, ob);
107 if (ok) {
109 }
110 return ok;
111}
112
114{
115 bool ok = false;
116 if (ob) {
117 ob->restore_mode = ob->mode;
118 ob->mode &= ~OB_MODE_POSE;
119
120 /* Inform all evaluated versions that we changed the mode. */
122 ok = true;
123 }
124 return ok;
125}
127{
128 Main *bmain = CTX_data_main(C);
129 bool ok = ED_object_posemode_exit_ex(bmain, ob);
130 if (ok) {
132 }
133 return ok;
134}
135
136/* ********************************************** */
137/* Motion Paths */
138
151
153{
154 /* Transform doesn't always have context available to do update. */
155 if (C == nullptr) {
156 return;
157 }
158
159 Main *bmain = CTX_data_main(C);
160 ViewLayer *view_layer = CTX_data_view_layer(C);
161
162 Depsgraph *depsgraph;
163 bool free_depsgraph = false;
164
166 /* set flag to force recalc, then grab the relevant bones to target */
169
170/* recalculate paths, then free */
171#ifdef DEBUG_TIME
172 TIMEIT_START(pose_path_calc);
173#endif
174
175 /* For a single frame update it's faster to re-use existing dependency graph and avoid overhead
176 * of building all the relations and so on for a temporary one. */
178 /* NOTE: Dependency graph will be evaluated at all the frames, but we first need to access some
179 * nested pointers, like animation data. */
181 free_depsgraph = false;
182 }
183 else {
184 depsgraph = animviz_depsgraph_build(bmain, scene, view_layer, targets);
185 free_depsgraph = true;
186 }
187
189 depsgraph, bmain, scene, targets, pose_path_convert_range(range), !free_depsgraph);
190
191#ifdef DEBUG_TIME
192 TIMEIT_END(pose_path_calc);
193#endif
194
196
198 /* Tag armature object for copy-on-eval - so paths will draw/redraw.
199 * For currently frame only we update evaluated object directly. */
201 }
202
203 /* Free temporary depsgraph. */
204 if (free_depsgraph) {
206 }
207}
208
209/* show popup to determine settings */
211 wmOperator *op,
212 const wmEvent * /*event*/)
213{
215
216 if (ELEM(nullptr, ob, ob->pose)) {
217 return OPERATOR_CANCELLED;
218 }
219
220 /* set default settings from existing/stored settings */
221 {
222 bAnimVizSettings *avs = &ob->pose->avs;
223
224 PointerRNA avs_ptr = RNA_pointer_create_discrete(nullptr, &RNA_AnimVizMotionPaths, avs);
225 RNA_enum_set(op->ptr, "display_type", RNA_enum_get(&avs_ptr, "type"));
226 RNA_enum_set(op->ptr, "range", RNA_enum_get(&avs_ptr, "range"));
227 RNA_enum_set(op->ptr, "bake_location", RNA_enum_get(&avs_ptr, "bake_location"));
228 }
229
230 /* show popup dialog to allow editing of range... */
231 /* FIXME: hard-coded dimensions here are just arbitrary. */
233 C, op, 270, IFACE_("Calculate Paths for the Selected Bones"), IFACE_("Calculate"));
234}
235
241{
243 Scene *scene = CTX_data_scene(C);
244
245 if (ELEM(nullptr, ob, ob->pose)) {
246 return OPERATOR_CANCELLED;
247 }
248
249 /* grab baking settings from operator settings */
250 {
251 bAnimVizSettings *avs = &ob->pose->avs;
252
253 avs->path_type = RNA_enum_get(op->ptr, "display_type");
254 avs->path_range = RNA_enum_get(op->ptr, "range");
256
257 PointerRNA avs_ptr = RNA_pointer_create_discrete(nullptr, &RNA_AnimVizMotionPaths, avs);
258 RNA_enum_set(&avs_ptr, "bake_location", RNA_enum_get(op->ptr, "bake_location"));
259 }
260
261 /* set up path data for bones being calculated */
262 CTX_DATA_BEGIN (C, bPoseChannel *, pchan, selected_pose_bones_from_active_object) {
263 /* verify makes sure that the selected bone has a bone with the appropriate settings */
264 animviz_verify_motionpaths(op->reports, scene, ob, pchan);
265 }
267
268#ifdef DEBUG_TIME
269 TIMEIT_START(recalc_pose_paths);
270#endif
271
272 /* Calculate the bones that now have motion-paths. */
273 /* TODO: only make for the selected bones? */
275
276#ifdef DEBUG_TIME
277 TIMEIT_END(recalc_pose_paths);
278#endif
279
280 /* notifiers for updates */
282
283 return OPERATOR_FINISHED;
284}
285
287{
288 /* identifiers */
289 ot->name = "Calculate Bone Paths";
290 ot->idname = "POSE_OT_paths_calculate";
291 ot->description = "Calculate paths for the selected bones";
292
293 /* API callbacks. */
297
298 /* flags */
300
301 /* properties */
302 RNA_def_enum(ot->srna,
303 "display_type",
306 "Display Type",
307 "");
308 RNA_def_enum(ot->srna,
309 "range",
312 "Computation Range",
313 "");
314
315 RNA_def_enum(ot->srna,
316 "bake_location",
319 "Bake Location",
320 "Which point on the bones is used when calculating paths");
321}
322
323/* --------- */
324
326{
329 return (ob->pose->avs.path_bakeflag & MOTIONPATH_BAKE_HAS_PATHS) != 0;
330 }
331
332 return false;
333}
334
336{
338 Scene *scene = CTX_data_scene(C);
339
340 if (ELEM(nullptr, ob, scene)) {
341 return OPERATOR_CANCELLED;
342 }
344
345 /* set up path data for bones being calculated */
346 CTX_DATA_BEGIN (C, bPoseChannel *, pchan, selected_pose_bones_from_active_object) {
347 animviz_verify_motionpaths(op->reports, scene, ob, pchan);
348 }
350
351 /* Calculate the bones that now have motion-paths. */
352 /* TODO: only make for the selected bones? */
354
355 /* notifiers for updates */
357
358 return OPERATOR_FINISHED;
359}
360
362{
363 /* identifiers */
364 ot->name = "Update Bone Paths";
365 ot->idname = "POSE_OT_paths_update";
366 ot->description = "Recalculate paths for bones that already have them";
367
368 /* API callbacks. */
371
372 /* flags */
374}
375
376/* --------- */
377
378/* for the object with pose/action: clear path curves for selected bones only */
379static void pose_clear_paths(Object *ob, bool only_selected)
380{
381 bool skipped = false;
382
383 if (ELEM(nullptr, ob, ob->pose)) {
384 return;
385 }
386
387 /* free the motionpath blocks for all bones - This is easier for users to quickly clear all */
388 LISTBASE_FOREACH (bPoseChannel *, pchan, &ob->pose->chanbase) {
389 if (pchan->mpath) {
390 if ((only_selected == false) || (pchan->flag & POSE_SELECTED)) {
391 animviz_free_motionpath(pchan->mpath);
392 pchan->mpath = nullptr;
393 }
394 else {
395 skipped = true;
396 }
397 }
398 }
399
400 /* if nothing was skipped, there should be no paths left! */
401 if (skipped == false) {
403 }
404
405 /* tag armature object for copy-on-eval - so removed paths don't still show */
407}
408
409/* Operator callback - wrapper for the back-end function. */
411{
413 bool only_selected = RNA_boolean_get(op->ptr, "only_selected");
414
415 /* only continue if there's an object */
416 if (ELEM(nullptr, ob, ob->pose)) {
417 return OPERATOR_CANCELLED;
418 }
419
420 /* use the backend function for this */
421 pose_clear_paths(ob, only_selected);
422
423 /* notifiers for updates */
425
426 return OPERATOR_FINISHED;
427}
428
430 wmOperatorType * /*ot*/,
432{
433 const bool only_selected = RNA_boolean_get(ptr, "only_selected");
434 if (only_selected) {
435 return TIP_("Clear motion paths of selected bones");
436 }
437 return TIP_("Clear motion paths of all bones");
438}
439
441{
442 /* identifiers */
443 ot->name = "Clear Bone Paths";
444 ot->idname = "POSE_OT_paths_clear";
445
446 /* API callbacks. */
449 ot->get_description = pose_clear_paths_get_description;
450
451 /* flags */
453
454 /* properties */
455 ot->prop = RNA_def_boolean(ot->srna,
456 "only_selected",
457 false,
458 "Only Selected",
459 "Only clear motion paths of selected bones");
461}
462
463/* --------- */
464
466{
467 Scene *scene = CTX_data_scene(C);
469
470 if (ELEM(nullptr, scene, ob, ob->pose)) {
471 return OPERATOR_CANCELLED;
472 }
473
474 /* use Preview Range or Full Frame Range - whichever is in use */
475 ob->pose->avs.path_sf = PSFRA;
476 ob->pose->avs.path_ef = PEFRA;
477
478 /* tag for updates */
481
482 return OPERATOR_FINISHED;
483}
484
486{
487 /* identifiers */
488 ot->name = "Update Range from Scene";
489 ot->idname = "POSE_OT_paths_range_update";
490 ot->description = "Update frame range for motion paths from the Scene's current frame range";
491
492 /* callbacks */
495
496 /* flags */
498}
499
500/* ********************************************** */
501
503{
504 Main *bmain = CTX_data_main(C);
505 const Scene *scene = CTX_data_scene(C);
506 ViewLayer *view_layer = CTX_data_view_layer(C);
507 View3D *v3d = CTX_wm_view3d(C);
508 const bool do_strip_numbers = RNA_boolean_get(op->ptr, "do_strip_numbers");
509
510 FOREACH_OBJECT_IN_MODE_BEGIN (scene, view_layer, v3d, OB_ARMATURE, OB_MODE_POSE, ob) {
511 bArmature *arm = static_cast<bArmature *>(ob->data);
512 ListBase bones_names = {nullptr};
513
515 BLI_addtail(&bones_names, BLI_genericNodeN(pchan->name));
516 }
518
519 ED_armature_bones_flip_names(bmain, arm, &bones_names, do_strip_numbers);
520
521 BLI_freelistN(&bones_names);
522
523 /* since we renamed stuff... */
525
526 /* NOTE: notifier might evolve. */
528 }
530
531 return OPERATOR_FINISHED;
532}
533
535{
536 /* identifiers */
537 ot->name = "Flip Names";
538 ot->idname = "POSE_OT_flip_names";
539 ot->description = "Flips (and corrects) the axis suffixes of the names of selected bones";
540
541 /* API callbacks. */
542 ot->exec = pose_flip_names_exec;
544
545 /* flags */
547
548 RNA_def_boolean(ot->srna,
549 "do_strip_numbers",
550 false,
551 "Strip Numbers",
552 "Try to remove right-most dot-number from flipped names.\n"
553 "Warning: May result in incoherent naming in some cases");
554}
555
556/* ------------------ */
557
559{
560 Main *bmain = CTX_data_main(C);
561 char newname[MAXBONENAME];
562 short axis = RNA_enum_get(op->ptr, "axis");
563 Object *ob_prev = nullptr;
564
565 /* loop through selected bones, auto-naming them */
566 CTX_DATA_BEGIN_WITH_ID (C, bPoseChannel *, pchan, selected_pose_bones, Object *, ob) {
567 bArmature *arm = static_cast<bArmature *>(ob->data);
568 STRNCPY_UTF8(newname, pchan->name);
569 if (bone_autoside_name(newname, 1, axis, pchan->bone->head[axis], pchan->bone->tail[axis])) {
570 ED_armature_bone_rename(bmain, arm, pchan->name, newname);
571 }
572
573 if (ob_prev != ob) {
574 /* since we renamed stuff... */
576
577 /* NOTE: notifier might evolve. */
579 ob_prev = ob;
580 }
581 }
583
584 return OPERATOR_FINISHED;
585}
586
588{
589 static const EnumPropertyItem axis_items[] = {
590 {0, "XAXIS", 0, "X-Axis", "Left/Right"},
591 {1, "YAXIS", 0, "Y-Axis", "Front/Back"},
592 {2, "ZAXIS", 0, "Z-Axis", "Top/Bottom"},
593 {0, nullptr, 0, nullptr, nullptr},
594 };
595
596 /* identifiers */
597 ot->name = "Auto-Name by Axis";
598 ot->idname = "POSE_OT_autoside_names";
599 ot->description =
600 "Automatically renames the selected bones according to which side of the target axis they "
601 "fall on";
602
603 /* API callbacks. */
604 ot->invoke = WM_menu_invoke;
606 ot->poll = ED_operator_posemode;
607
608 /* flags */
610
611 /* settings */
612 ot->prop = RNA_def_enum(ot->srna, "axis", axis_items, 0, "Axis", "Axis to tag names with");
613}
614
615/* ********************************************** */
616
618{
619 const int mode = RNA_enum_get(op->ptr, "type");
620 Object *prev_ob = nullptr;
621
622 /* Set rotation mode of selected bones. */
623 CTX_DATA_BEGIN_WITH_ID (C, bPoseChannel *, pchan, selected_pose_bones, Object *, ob) {
624 /* use API Method for conversions... */
626 pchan->quat, pchan->eul, pchan->rotAxis, &pchan->rotAngle, pchan->rotmode, short(mode));
627
628 /* finally, set the new rotation type */
629 pchan->rotmode = mode;
630
631 if (prev_ob != ob) {
632 /* Notifiers and updates. */
633 DEG_id_tag_update(reinterpret_cast<ID *>(ob), ID_RECALC_GEOMETRY);
636 prev_ob = ob;
637 }
638 }
640
641 return OPERATOR_FINISHED;
642}
643
645{
646 /* identifiers */
647 ot->name = "Set Rotation Mode";
648 ot->idname = "POSE_OT_rotation_mode_set";
649 ot->description = "Set the rotation representation used by selected bones";
650
651 /* callbacks */
652 ot->invoke = WM_menu_invoke;
654 ot->poll = ED_operator_posemode;
655
656 /* flags */
658
659 /* properties */
660 ot->prop = RNA_def_enum(
661 ot->srna, "type", rna_enum_object_rotation_mode_items, 0, "Rotation Mode", "");
662}
663
664/* ********************************************** */
665/* Show/Hide Bones */
666
667/* active object is armature in posemode, poll checked */
669{
670 const Scene *scene = CTX_data_scene(C);
671 ViewLayer *view_layer = CTX_data_view_layer(C);
673 bool changed_multi = false;
674
675 const int hide_select = !RNA_boolean_get(op->ptr, "unselected");
676
677 for (Object *ob_iter : objects) {
678 bool changed = false;
679 bArmature *arm = static_cast<bArmature *>(ob_iter->data);
680 LISTBASE_FOREACH (bPoseChannel *, pchan, &ob_iter->pose->chanbase) {
681 if (!ANIM_bone_in_visible_collection(arm, pchan->bone)) {
682 continue;
683 }
684 if (((pchan->flag & POSE_SELECTED) != 0) != hide_select) {
685 continue;
686 }
687 pchan->drawflag |= PCHAN_DRAW_HIDDEN;
688 pchan->flag &= ~POSE_SELECTED;
689 changed = true;
690 }
691
692 if (changed) {
693 changed_multi = true;
696 }
697 }
698
699 return changed_multi ? OPERATOR_FINISHED : OPERATOR_CANCELLED;
700}
701
703{
704 /* identifiers */
705 ot->name = "Hide Selected";
706 ot->idname = "POSE_OT_hide";
707 ot->description = "Tag selected bones to not be visible in Pose Mode";
708
709 /* API callbacks. */
710 ot->exec = pose_hide_exec;
711 ot->poll = ED_operator_posemode;
712
713 /* flags */
715
716 /* props */
717 RNA_def_boolean(ot->srna, "unselected", false, "Unselected", "");
718}
719
720/* active object is armature in posemode, poll checked */
722{
723 const Scene *scene = CTX_data_scene(C);
724 ViewLayer *view_layer = CTX_data_view_layer(C);
726 bool changed_multi = false;
727 const bool select = RNA_boolean_get(op->ptr, "select");
728
729 for (Object *ob_iter : objects) {
730 bArmature *arm = static_cast<bArmature *>(ob_iter->data);
731
732 bool changed = false;
733 LISTBASE_FOREACH (bPoseChannel *, pchan, &ob_iter->pose->chanbase) {
734 if (!ANIM_bone_in_visible_collection(arm, pchan->bone)) {
735 continue;
736 }
737 if ((pchan->drawflag & PCHAN_DRAW_HIDDEN) == 0) {
738 continue;
739 }
740 if (!(pchan->bone->flag & BONE_UNSELECTABLE)) {
742 }
743 pchan->drawflag &= ~PCHAN_DRAW_HIDDEN;
744 changed = true;
745 }
746
747 if (changed) {
748 changed_multi = true;
751 }
752 }
753
754 return changed_multi ? OPERATOR_FINISHED : OPERATOR_CANCELLED;
755}
756
758{
759 /* identifiers */
760 ot->name = "Reveal Selected";
761 ot->idname = "POSE_OT_reveal";
762 ot->description = "Reveal all bones hidden in Pose Mode";
763
764 /* API callbacks. */
765 ot->exec = pose_reveal_exec;
766 ot->poll = ED_operator_posemode;
767
768 /* flags */
770
771 RNA_def_boolean(ot->srna, "select", true, "Select", "");
772}
773
774/* -------------------------------------------------------------------- */
777
779{
780 Scene *scene = CTX_data_scene(C);
781
782 bool changed_multi = false;
783
784 ViewLayer *view_layer = CTX_data_view_layer(C);
785 View3D *v3d = CTX_wm_view3d(C);
786 FOREACH_OBJECT_IN_MODE_BEGIN (scene, view_layer, v3d, OB_ARMATURE, OB_MODE_POSE, ob_iter) {
787 bool changed = false;
788 /* loop through all selected pchans, flipping and keying (as needed) */
790 /* only if bone is using quaternion rotation */
791 if (pchan->rotmode == ROT_MODE_QUAT) {
792 changed = true;
793 /* quaternions have 720 degree range */
794 negate_v4(pchan->quat);
795
797 C, scene, ob_iter, pchan, {{"rotation_quaternion"}}, false);
798 }
799 }
801
802 if (changed) {
803 changed_multi = true;
804 /* notifiers and updates */
807 }
808 }
810
811 return changed_multi ? OPERATOR_FINISHED : OPERATOR_CANCELLED;
812}
813
815{
816 /* identifiers */
817 ot->name = "Flip Quaternions";
818 ot->idname = "POSE_OT_quaternions_flip";
819 ot->description =
820 "Flip quaternion values to achieve desired rotations, while maintaining the same "
821 "orientations";
822
823 /* callbacks */
824 ot->exec = pose_flip_quats_exec;
825 ot->poll = ED_operator_posemode;
826
827 /* flags */
829}
830
Functions to deal with Armatures.
C++ functions to deal with Armature collections (i.e. the successor of bone layers).
bool ANIM_bone_in_visible_collection(const bArmature *armature, const Bone *bone)
Functions to insert, delete or modify keyframes.
struct bMotionPath * animviz_verify_motionpaths(struct ReportList *reports, struct Scene *scene, struct Object *ob, struct bPoseChannel *pchan)
void animviz_free_motionpath(struct bMotionPath *mpath)
#define FOREACH_PCHAN_SELECTED_IN_OBJECT_END
void BKE_rotMode_change_values(float quat[4], float eul[3], float axis[3], float *angle, short oldMode, short newMode)
#define FOREACH_PCHAN_SELECTED_IN_OBJECT_BEGIN(_ob, _pchan)
bool bone_autoside_name(char name[64], int strip_number, short axis, float head, float tail)
#define CTX_DATA_BEGIN_WITH_ID(C, Type, instance, member, Type_id, instance_id)
ReportList * CTX_wm_reports(const bContext *C)
#define CTX_DATA_BEGIN(C, Type, instance, member)
Depsgraph * CTX_data_ensure_evaluated_depsgraph(const bContext *C)
ScrArea * CTX_wm_area(const bContext *C)
Object * CTX_data_active_object(const bContext *C)
Scene * CTX_data_scene(const bContext *C)
Main * CTX_data_main(const bContext *C)
#define CTX_DATA_END
View3D * CTX_wm_view3d(const bContext *C)
ViewLayer * CTX_data_view_layer(const bContext *C)
#define FOREACH_OBJECT_IN_MODE_END
Definition BKE_layer.hh:382
#define FOREACH_OBJECT_IN_MODE_BEGIN(_scene, _view_layer, _v3d, _object_type, _object_mode, _instance)
Definition BKE_layer.hh:377
bool BKE_id_is_editable(const Main *bmain, const ID *id)
Definition lib_id.cc:2523
General operations, lookup, etc. for blender objects.
Object * BKE_object_pose_armature_get(Object *ob)
blender::Vector< Object * > BKE_object_pose_array_get_unique(const Scene *scene, ViewLayer *view_layer, View3D *v3d)
@ RPT_WARNING
Definition BKE_report.hh:38
void BKE_report(ReportList *reports, eReportType type, const char *message)
Definition report.cc:153
#define BLI_assert(a)
Definition BLI_assert.h:46
LinkData * BLI_genericNodeN(void *data)
Definition listbase.cc:922
#define LISTBASE_FOREACH(type, var, list)
void void BLI_freelistN(ListBase *listbase) ATTR_NONNULL(1)
Definition listbase.cc:497
void BLI_addtail(ListBase *listbase, void *vlink) ATTR_NONNULL(1)
Definition listbase.cc:111
MINLINE void negate_v4(float r[4])
#define STRNCPY_UTF8(dst, src)
Utility defines for timing/benchmarks.
#define TIMEIT_START(var)
#define TIMEIT_END(var)
#define SET_FLAG_FROM_TEST(value, test, flag)
#define ELEM(...)
#define TIP_(msgid)
#define IFACE_(msgid)
void DEG_id_tag_update(ID *id, unsigned int flags)
void DEG_graph_free(Depsgraph *graph)
Definition depsgraph.cc:306
@ ID_RECALC_PARAMETERS
Definition DNA_ID.h:1138
@ ID_RECALC_SYNC_TO_EVAL
Definition DNA_ID.h:1118
@ ID_RECALC_GEOMETRY
Definition DNA_ID.h:1074
@ MOTIONPATH_BAKE_HEADS
@ MOTIONPATH_BAKE_HAS_PATHS
@ MOTIONPATH_TYPE_RANGE
@ ROT_MODE_QUAT
@ MOTIONPATH_RANGE_SCENE
@ ANIMVIZ_RECALC_PATHS
@ PCHAN_DRAW_HIDDEN
@ POSE_SELECTED
#define MAXBONENAME
@ BONE_UNSELECTABLE
@ OB_MODE_POSE
Object is a sort of wrapper for general info.
@ OB_ARMATURE
#define PSFRA
#define PEFRA
@ SPACE_PROPERTIES
@ OPERATOR_CANCELLED
@ OPERATOR_FINISHED
eAnimvizCalcRange
@ ANIMVIZ_CALC_RANGE_FULL
@ ANIMVIZ_CALC_RANGE_CURRENT_FRAME
@ ANIMVIZ_CALC_RANGE_CHANGED
ePosePathCalcRange
@ POSE_PATH_CALC_RANGE_CURRENT_FRAME
@ POSE_PATH_CALC_RANGE_CHANGED
@ POSE_PATH_CALC_RANGE_FULL
bool ED_operator_posemode_local(bContext *C)
bool ED_operator_posemode_exclusive(bContext *C)
bool ED_operator_posemode(bContext *C)
@ PROP_SKIP_SAVE
Definition RNA_types.hh:344
#define C
Definition RandGen.cpp:29
#define ND_MODE
Definition WM_types.hh:445
#define NC_SCENE
Definition WM_types.hh:378
@ OPTYPE_UNDO
Definition WM_types.hh:182
@ OPTYPE_REGISTER
Definition WM_types.hh:180
#define ND_POSE
Definition WM_types.hh:458
#define NS_MODE_OBJECT
Definition WM_types.hh:560
#define ND_TRANSFORM
Definition WM_types.hh:456
#define NS_MODE_POSE
Definition WM_types.hh:569
#define ND_BONE_SELECT
Definition WM_types.hh:460
#define NC_OBJECT
Definition WM_types.hh:379
Depsgraph * animviz_depsgraph_build(Main *bmain, Scene *scene, ViewLayer *view_layer, blender::Span< MPathTarget * > targets)
void animviz_free_motionpath_targets(blender::Vector< MPathTarget * > &targets)
void animviz_motionpath_compute_range(Object *ob, Scene *scene)
void animviz_calc_motionpaths(Depsgraph *depsgraph, Main *bmain, Scene *scene, blender::MutableSpan< MPathTarget * > targets, eAnimvizCalcRange range, bool restore)
void animviz_build_motionpath_targets(Object *ob, blender::Vector< MPathTarget * > &r_targets)
void ED_armature_bone_rename(Main *bmain, bArmature *arm, const char *oldnamep, const char *newnamep)
void ED_armature_bones_flip_names(Main *bmain, bArmature *arm, ListBase *bones_names, const bool do_strip_numbers)
BPy_StructRNA * depsgraph
#define select(A, B, C)
DEG_id_tag_update_ex(cb_data->bmain, cb_data->owner_id, ID_RECALC_TAG_FOR_UNDO|ID_RECALC_SYNC_TO_EVAL)
void autokeyframe_pose_channel(bContext *C, Scene *scene, Object *ob, bPoseChannel *pose_channel, Span< RNAPath > rna_paths, short targetless_ik)
Object * context_active_object(const bContext *C)
void POSE_OT_hide(wmOperatorType *ot)
Definition pose_edit.cc:702
void ED_pose_recalculate_paths(bContext *C, Scene *scene, Object *ob, ePosePathCalcRange range)
Definition pose_edit.cc:152
bool ED_object_posemode_enter_ex(Main *bmain, Object *ob)
Definition pose_edit.cc:77
static wmOperatorStatus pose_bone_rotmode_exec(bContext *C, wmOperator *op)
Definition pose_edit.cc:617
static wmOperatorStatus pose_update_paths_range_exec(bContext *C, wmOperator *)
Definition pose_edit.cc:465
void POSE_OT_paths_range_update(wmOperatorType *ot)
Definition pose_edit.cc:485
static wmOperatorStatus pose_reveal_exec(bContext *C, wmOperator *op)
Definition pose_edit.cc:721
void POSE_OT_quaternions_flip(wmOperatorType *ot)
Definition pose_edit.cc:814
void POSE_OT_paths_update(wmOperatorType *ot)
Definition pose_edit.cc:361
bool ED_object_posemode_enter(bContext *C, Object *ob)
Definition pose_edit.cc:98
static wmOperatorStatus pose_flip_names_exec(bContext *C, wmOperator *op)
Definition pose_edit.cc:502
static wmOperatorStatus pose_clear_paths_exec(bContext *C, wmOperator *op)
Definition pose_edit.cc:410
Object * ED_pose_object_from_context(bContext *C)
Definition pose_edit.cc:58
static wmOperatorStatus pose_hide_exec(bContext *C, wmOperator *op)
Definition pose_edit.cc:668
void POSE_OT_reveal(wmOperatorType *ot)
Definition pose_edit.cc:757
static eAnimvizCalcRange pose_path_convert_range(ePosePathCalcRange range)
Definition pose_edit.cc:139
static wmOperatorStatus pose_calculate_paths_exec(bContext *C, wmOperator *op)
Definition pose_edit.cc:240
void POSE_OT_flip_names(wmOperatorType *ot)
Definition pose_edit.cc:534
void POSE_OT_paths_clear(wmOperatorType *ot)
Definition pose_edit.cc:440
static void pose_clear_paths(Object *ob, bool only_selected)
Definition pose_edit.cc:379
static std::string pose_clear_paths_get_description(bContext *, wmOperatorType *, PointerRNA *ptr)
Definition pose_edit.cc:429
static wmOperatorStatus pose_autoside_names_exec(bContext *C, wmOperator *op)
Definition pose_edit.cc:558
void POSE_OT_autoside_names(wmOperatorType *ot)
Definition pose_edit.cc:587
void POSE_OT_paths_calculate(wmOperatorType *ot)
Definition pose_edit.cc:286
void POSE_OT_rotation_mode_set(wmOperatorType *ot)
Definition pose_edit.cc:644
static wmOperatorStatus pose_calculate_paths_invoke(bContext *C, wmOperator *op, const wmEvent *)
Definition pose_edit.cc:210
bool ED_object_posemode_exit_ex(Main *bmain, Object *ob)
Definition pose_edit.cc:113
static wmOperatorStatus pose_flip_quats_exec(bContext *C, wmOperator *)
Definition pose_edit.cc:778
static wmOperatorStatus pose_update_paths_exec(bContext *C, wmOperator *op)
Definition pose_edit.cc:335
static bool pose_update_paths_poll(bContext *C)
Definition pose_edit.cc:325
bool ED_object_posemode_exit(bContext *C, Object *ob)
Definition pose_edit.cc:126
bool RNA_boolean_get(PointerRNA *ptr, const char *name)
void RNA_enum_set(PointerRNA *ptr, const char *name, int value)
PointerRNA RNA_pointer_create_discrete(ID *id, StructRNA *type, void *data)
int RNA_enum_get(PointerRNA *ptr, const char *name)
const EnumPropertyItem rna_enum_motionpath_display_type_items[]
const EnumPropertyItem rna_enum_motionpath_range_items[]
const EnumPropertyItem rna_enum_motionpath_bake_location_items[]
PropertyRNA * RNA_def_enum(StructOrFunctionRNA *cont_, const char *identifier, const EnumPropertyItem *items, const int default_value, const char *ui_name, const char *ui_description)
PropertyRNA * RNA_def_boolean(StructOrFunctionRNA *cont_, const char *identifier, const bool default_value, const char *ui_name, const char *ui_description)
void RNA_def_property_flag(PropertyRNA *prop, PropertyFlag flag)
const EnumPropertyItem rna_enum_object_rotation_mode_items[]
Definition DNA_ID.h:414
struct bPose * pose
ListBase chanbase
bAnimVizSettings avs
struct ReportList * reports
struct PointerRNA * ptr
void WM_event_add_notifier(const bContext *C, uint type, void *reference)
PointerRNA * ptr
Definition wm_files.cc:4238
wmOperatorType * ot
Definition wm_files.cc:4237
wmOperatorStatus WM_operator_props_dialog_popup(bContext *C, wmOperator *op, int width, std::optional< std::string > title, std::optional< std::string > confirm_text, const bool cancel_default, std::optional< std::string > message)
wmOperatorStatus WM_menu_invoke(bContext *C, wmOperator *op, const wmEvent *)