Blender V5.3
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.hh"
11#include "BLI_math_vector_c.hh"
12#include "BLI_string_utf8.hh"
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#include "BKE_scene.hh"
28
29#include "DEG_depsgraph.hh"
30
31#include "RNA_access.hh"
32#include "RNA_define.hh"
33#include "RNA_enum_types.hh"
34#include "RNA_prototypes.hh"
35
36#include "WM_api.hh"
37#include "WM_types.hh"
38
39#include "ED_anim_api.hh"
40#include "ED_armature.hh"
41#include "ED_keyframing.hh"
42#include "ED_object.hh"
43#include "ED_screen.hh"
44
45#include "ANIM_armature.hh"
47#include "ANIM_keyframing.hh"
48
49#include "armature_intern.hh"
50
51namespace blender {
52
53#undef DEBUG_TIME
54
55#ifdef DEBUG_TIME
57#endif
58/* -------------------------------------------------------------------- */
61
63{
64 /* NOTE: matches logic with #ED_operator_posemode_context(). */
65
66 ScrArea *area = CTX_wm_area(C);
67 Object *ob;
68
69 /* Since this call may also be used from the buttons window,
70 * we need to check for where to get the object. */
71 if (area && area->spacetype == SPACE_PROPERTIES) {
73 }
74 else {
76 }
77
78 return ob;
79}
80
82{
83 BLI_assert(BKE_id_is_editable(bmain, &ob->id));
84 bool ok = false;
85
86 switch (ob->type) {
87 case OB_ARMATURE:
88 ob->restore_mode = ob->mode;
89 ob->mode |= OB_MODE_POSE;
90
91 /* Inform all evaluated versions that we changed the mode. */
93 ok = true;
94
95 break;
96 default:
97 break;
98 }
99
100 return ok;
101}
103{
104 ReportList *reports = CTX_wm_reports(C);
105 Main *bmain = CTX_data_main(C);
106 if (!BKE_id_is_editable(bmain, &ob->id)) {
107 BKE_report(reports, RPT_WARNING, "Cannot pose libdata");
108 return false;
109 }
110 bool ok = ED_object_posemode_enter_ex(bmain, ob);
111 if (ok) {
113 }
114 return ok;
115}
116
118{
119 bool ok = false;
120 if (ob) {
121 ob->restore_mode = ob->mode;
122 ob->mode &= ~OB_MODE_POSE;
123
124 /* Inform all evaluated versions that we changed the mode. */
126 ok = true;
127 }
128 return ok;
129}
131{
132 Main *bmain = CTX_data_main(C);
133 bool ok = ED_object_posemode_exit_ex(bmain, ob);
134 if (ok) {
136 }
137 return ok;
138}
139
141
142/* -------------------------------------------------------------------- */
145
147{
148 /* Transform doesn't always have context available to do update. */
149 if (C == nullptr) {
150 return;
151 }
152
153 Main *bmain = CTX_data_main(C);
154 ViewLayer *view_layer = CTX_data_view_layer(C);
155
156 Vector<MPathTarget> targets;
157 /* set flag to force recalc, then grab the relevant bones to target */
160
161/* recalculate paths, then free */
162#ifdef DEBUG_TIME
163 TIMEIT_START(pose_path_calc);
164#endif
165
166 Depsgraph *depsgraph = animviz_depsgraph_build(bmain, scene, view_layer, targets);
167 animviz_calc_motionpaths(depsgraph, scene, targets, BKE_scene_frame_get(scene));
168
169#ifdef DEBUG_TIME
170 TIMEIT_END(pose_path_calc);
171#endif
172
174
175 /* Free temporary depsgraph. */
176 DEG_graph_free(depsgraph);
177}
178
179/* show popup to determine settings */
181 wmOperator *op,
182 const wmEvent * /*event*/)
183{
185
186 if (ELEM(nullptr, ob, ob->pose)) {
187 return OPERATOR_CANCELLED;
188 }
189
190 /* set default settings from existing/stored settings */
191 {
192 bAnimVizSettings *avs = &ob->pose->avs;
193
194 PointerRNA avs_ptr = RNA_pointer_create_discrete(nullptr, RNA_AnimVizMotionPaths, avs);
195 RNA_enum_set(op->ptr, "display_type", RNA_enum_get(&avs_ptr, "type"));
196 RNA_enum_set(op->ptr, "range", RNA_enum_get(&avs_ptr, "range"));
197 RNA_enum_set(op->ptr, "bake_location", RNA_enum_get(&avs_ptr, "bake_location"));
198 }
199
200 /* show popup dialog to allow editing of range... */
201 /* FIXME: hard-coded dimensions here are just arbitrary. */
203 C, op, 270, IFACE_("Calculate Paths for the Selected Bones"), IFACE_("Calculate"));
204}
205
211{
213 Scene *scene = CTX_data_scene(C);
214
215 if (ELEM(nullptr, ob, ob->pose)) {
216 return OPERATOR_CANCELLED;
217 }
218
219 /* grab baking settings from operator settings */
220 {
221 bAnimVizSettings *avs = &ob->pose->avs;
222
223 avs->path_type = eMotionPaths_Types(RNA_enum_get(op->ptr, "display_type"));
224 avs->path_range = eMotionPath_Ranges(RNA_enum_get(op->ptr, "range"));
226
227 PointerRNA avs_ptr = RNA_pointer_create_discrete(nullptr, RNA_AnimVizMotionPaths, avs);
228 RNA_enum_set(&avs_ptr, "bake_location", RNA_enum_get(op->ptr, "bake_location"));
229 }
230
231 /* set up path data for bones being calculated */
232 CTX_DATA_BEGIN (C, bPoseChannel *, pchan, selected_pose_bones_from_active_object) {
233 /* verify makes sure that the selected bone has a bone with the appropriate settings */
234 bke::motionpath::ensure(op->reports, scene, ob, pchan);
235 if (pchan->mpath) {
236 ed::motionpath::tag_for_recalc(*pchan->mpath);
237 }
238 }
240
241#ifdef DEBUG_TIME
242 TIMEIT_START(recalc_pose_paths);
243#endif
244
245 /* Calculate the bones that now have motion-paths. */
246 /* TODO: only make for the selected bones? */
247 ED_pose_recalculate_paths(C, scene, ob);
248
249#ifdef DEBUG_TIME
250 TIMEIT_END(recalc_pose_paths);
251#endif
252
253 /* notifiers for updates */
255
256 return OPERATOR_FINISHED;
257}
258
260{
261 /* identifiers */
262 ot->name = "Calculate Bone Paths";
263 ot->idname = "POSE_OT_paths_calculate";
264 ot->description = "Calculate paths for the selected bones";
265
266 /* API callbacks. */
270
271 /* flags */
273
274 /* properties */
275 RNA_def_enum(ot->srna,
276 "display_type",
279 "Display Type",
280 "");
281 RNA_def_enum(ot->srna,
282 "range",
285 "Computation Range",
286 "");
287
288 RNA_def_enum(ot->srna,
289 "bake_location",
292 "Bake Location",
293 "Which point on the bones is used when calculating paths");
294}
295
296/* --------- */
297
299{
302 return (ob->pose->avs.path_bakeflag & MOTIONPATH_BAKE_HAS_PATHS) != 0;
303 }
304
305 return false;
306}
307
309{
311 Scene *scene = CTX_data_scene(C);
312
313 if (ELEM(nullptr, ob, scene)) {
314 return OPERATOR_CANCELLED;
315 }
317
318 /* set up path data for bones being calculated */
319 CTX_DATA_BEGIN (C, bPoseChannel *, pchan, selected_pose_bones_from_active_object) {
320 bke::motionpath::ensure(op->reports, scene, ob, pchan);
321 if (pchan->mpath) {
322 /* We enforce a full update since this is a direct user action. */
323 ed::motionpath::tag_for_recalc(*pchan->mpath);
324 }
325 }
327
328 /* Calculate the bones that now have motion-paths. */
329 /* TODO: only make for the selected bones? */
330 ED_pose_recalculate_paths(C, scene, ob);
331
332 /* notifiers for updates */
334
335 return OPERATOR_FINISHED;
336}
337
339{
340 /* identifiers */
341 ot->name = "Update Bone Paths";
342 ot->idname = "POSE_OT_paths_update";
343 ot->description = "Recalculate paths for bones that already have them";
344
345 /* API callbacks. */
348
349 /* flags */
351}
352
353/* --------- */
354
355/* for the object with pose/action: clear path curves for selected bones only */
356static void pose_clear_paths(Object *ob, bool only_selected)
357{
358 bool skipped = false;
359
360 if (ELEM(nullptr, ob, ob->pose)) {
361 return;
362 }
363
364 /* free the motionpath blocks for all bones - This is easier for users to quickly clear all */
365 for (bPoseChannel &pchan : ob->pose->chanbase) {
366 if (pchan.mpath) {
367 if ((only_selected == false) || (pchan.flag & POSE_SELECTED)) {
369 pchan.mpath = nullptr;
370 }
371 else {
372 skipped = true;
373 }
374 }
375 }
376
377 /* if nothing was skipped, there should be no paths left! */
378 if (skipped == false) {
380 }
381
382 /* tag armature object for copy-on-eval - so removed paths don't still show */
384}
385
386/* Operator callback - wrapper for the back-end function. */
388{
390 bool only_selected = RNA_boolean_get(op->ptr, "only_selected");
391
392 /* only continue if there's an object */
393 if (ELEM(nullptr, ob, ob->pose)) {
394 return OPERATOR_CANCELLED;
395 }
396
397 /* use the backend function for this */
398 pose_clear_paths(ob, only_selected);
399
400 /* notifiers for updates */
402
403 return OPERATOR_FINISHED;
404}
405
407 wmOperatorType * /*ot*/,
408 PointerRNA *ptr)
409{
410 const bool only_selected = RNA_boolean_get(ptr, "only_selected");
411 if (only_selected) {
412 return TIP_("Clear motion paths of selected bones");
413 }
414 return TIP_("Clear motion paths of all bones");
415}
416
418{
419 /* identifiers */
420 ot->name = "Clear Bone Paths";
421 ot->idname = "POSE_OT_paths_clear";
422
423 /* API callbacks. */
427
428 /* flags */
430
431 /* properties */
432 ot->prop = RNA_def_boolean(ot->srna,
433 "only_selected",
434 false,
435 "Only Selected",
436 "Only clear motion paths of selected bones");
438}
439
440/* --------- */
441
443{
444 Scene *scene = CTX_data_scene(C);
446
447 if (ELEM(nullptr, scene, ob, ob->pose)) {
448 return OPERATOR_CANCELLED;
449 }
450
451 /* Use Preview Range or Full Frame Range - whichever is in use. */
452 ob->pose->avs.path_sf = scene->playback_start();
453 ob->pose->avs.path_ef = scene->playback_end();
454
455 /* tag for updates */
458
459 return OPERATOR_FINISHED;
460}
461
463{
464 /* identifiers */
465 ot->name = "Update Range from Scene";
466 ot->idname = "POSE_OT_paths_range_update";
467 ot->description = "Update frame range for motion paths from the Scene's current frame range";
468
469 /* callbacks */
472
473 /* flags */
475}
476
478
479/* -------------------------------------------------------------------- */
482
484{
485 Main *bmain = CTX_data_main(C);
486 const Scene *scene = CTX_data_scene(C);
487 ViewLayer *view_layer = CTX_data_view_layer(C);
488 View3D *v3d = CTX_wm_view3d(C);
489 const bool do_strip_numbers = RNA_boolean_get(op->ptr, "do_strip_numbers");
490
491 FOREACH_OBJECT_IN_MODE_BEGIN (bmain, scene, view_layer, v3d, OB_ARMATURE, OB_MODE_POSE, ob) {
492 bArmature *arm = id_cast<bArmature *>(ob->data);
493 ListBaseT<LinkData> bones_names = {nullptr};
494
496 BLI_addtail(&bones_names, BLI_genericNodeN(pchan->name));
497 }
499
500 ED_armature_bones_flip_names(bmain, arm, &bones_names, do_strip_numbers);
501
502 bones_names.free_no_destruct();
503
504 /* Since we renamed stuff... */
507
508 /* Update animation channels */
510 }
512
513 return OPERATOR_FINISHED;
514}
515
517{
518 /* identifiers */
519 ot->name = "Flip Names";
520 ot->idname = "POSE_OT_flip_names";
521 ot->description = "Flips (and corrects) the axis suffixes of the names of selected bones";
522
523 /* API callbacks. */
526
527 /* flags */
529
531 "do_strip_numbers",
532 false,
533 "Strip Numbers",
534 "Try to remove right-most dot-number from flipped names.\n"
535 "Warning: May result in incoherent naming in some cases");
536}
537
538/* ------------------ */
539
541{
542 Main *bmain = CTX_data_main(C);
543 char newname[MAXBONENAME];
544 short axis = RNA_enum_get(op->ptr, "axis");
545 Object *ob_prev = nullptr;
546
547 /* loop through selected bones, auto-naming them */
548 CTX_DATA_BEGIN_WITH_ID (C, bPoseChannel *, pchan, selected_pose_bones, Object *, ob) {
549 bArmature *arm = id_cast<bArmature *>(ob->data);
550 const Bone *bone = pchan->bone_get(*ob);
551 STRNCPY_UTF8(newname, pchan->name);
552 if (bone_autoside_name(newname, 1, axis, bone->head[axis], bone->tail[axis])) {
553 ED_armature_bone_rename(bmain, arm, pchan->name, newname);
554 }
555
556 if (ob_prev != ob) {
557 /* Since we renamed stuff... */
560
561 /* Update animation channels */
563 ob_prev = ob;
564 }
565 }
567
568 return OPERATOR_FINISHED;
569}
570
572{
573 static const EnumPropertyItem axis_items[] = {
574 {0, "XAXIS", 0, "X-Axis", "Left/Right"},
575 {1, "YAXIS", 0, "Y-Axis", "Front/Back"},
576 {2, "ZAXIS", 0, "Z-Axis", "Top/Bottom"},
577 {0, nullptr, 0, nullptr, nullptr},
578 };
579
580 /* identifiers */
581 ot->name = "Auto-Name by Axis";
582 ot->idname = "POSE_OT_autoside_names";
583 ot->description =
584 "Automatically renames the selected bones according to which side of the target axis they "
585 "fall on";
586
587 /* API callbacks. */
591
592 /* flags */
594
595 /* settings */
596 ot->prop = RNA_def_enum(ot->srna, "axis", axis_items, 0, "Axis", "Axis to tag names with");
597}
598
600
601/* -------------------------------------------------------------------- */
604
606{
609 "pose.rotation_mode_set is deprecated. Use anim.rotation_mode_convert instead");
610 const eRotationModes mode = eRotationModes(RNA_enum_get(op->ptr, "type"));
611 Object *prev_ob = nullptr;
612
613 /* Set rotation mode of selected bones. */
614 CTX_DATA_BEGIN_WITH_ID (C, bPoseChannel *, pchan, selected_pose_bones, Object *, ob) {
615 /* use API Method for conversions... */
617 pchan->quat, pchan->eul, pchan->rotAxis, &pchan->rotAngle, pchan->rotmode, mode);
618
619 /* finally, set the new rotation type */
620 pchan->rotmode = mode;
621
622 if (prev_ob != ob) {
623 /* Notifiers and updates. */
624 DEG_id_tag_update(reinterpret_cast<ID *>(ob), ID_RECALC_GEOMETRY);
627 prev_ob = ob;
628 }
629 }
631
632 return OPERATOR_FINISHED;
633}
634
636{
637 /* identifiers */
638 ot->name = "Set Rotation Mode";
639 ot->idname = "POSE_OT_rotation_mode_set";
640 ot->description = "Set the rotation representation used by selected bones";
641
642 /* callbacks */
646
647 /* flags */
649
650 /* properties */
651 ot->prop = RNA_def_enum(
652 ot->srna, "type", rna_enum_object_rotation_mode_items, 0, "Rotation Mode", "");
653}
654
656
657/* -------------------------------------------------------------------- */
660
661/* active object is armature in posemode, poll checked */
663{
664 const Main *bmain = CTX_data_main(C);
665 const Scene *scene = CTX_data_scene(C);
666 ViewLayer *view_layer = CTX_data_view_layer(C);
668 *bmain, scene, view_layer, CTX_wm_view3d(C));
669 bool changed_multi = false;
670
671 const int hide_select = !RNA_boolean_get(op->ptr, "unselected");
672
673 for (Object *ob_iter : objects) {
674 bool changed = false;
675 bArmature *arm = id_cast<bArmature *>(ob_iter->data);
676 for (bPoseChannel &pchan : ob_iter->pose->chanbase) {
677 if (!ANIM_bone_in_visible_collection(arm, pchan.bone_get(*ob_iter))) {
678 continue;
679 }
680 if (((pchan.flag & POSE_SELECTED) != 0) != hide_select) {
681 continue;
682 }
685 changed = true;
686 }
687
688 if (changed) {
689 changed_multi = true;
692 }
693 }
694
695 return changed_multi ? OPERATOR_FINISHED : OPERATOR_CANCELLED;
696}
697
699{
700 /* identifiers */
701 ot->name = "Hide Selected";
702 ot->idname = "POSE_OT_hide";
703 ot->description = "Tag selected bones to not be visible in Pose Mode";
704
705 /* API callbacks. */
706 ot->exec = pose_hide_exec;
708
709 /* flags */
711
712 /* props */
713 RNA_def_boolean(ot->srna, "unselected", false, "Unselected", "");
714}
715
716/* active object is armature in posemode, poll checked */
718{
719 const Main *bmain = CTX_data_main(C);
720 const Scene *scene = CTX_data_scene(C);
721 ViewLayer *view_layer = CTX_data_view_layer(C);
723 *bmain, scene, view_layer, CTX_wm_view3d(C));
724 bool changed_multi = false;
725 const bool select = RNA_boolean_get(op->ptr, "select");
726
727 for (Object *ob_iter : objects) {
728 bArmature *arm = id_cast<bArmature *>(ob_iter->data);
729
730 bool changed = false;
731 for (bPoseChannel &pchan : ob_iter->pose->chanbase) {
732 const Bone *bone = pchan.bone_get(*ob_iter);
733 if (!ANIM_bone_in_visible_collection(arm, bone)) {
734 continue;
735 }
736 if ((pchan.drawflag & PCHAN_DRAW_HIDDEN) == 0) {
737 continue;
738 }
739 if (!(bone->flag & BONE_UNSELECTABLE)) {
741 }
743 changed = true;
744 }
745
746 if (changed) {
747 changed_multi = true;
750 }
751 }
752
753 return changed_multi ? OPERATOR_FINISHED : OPERATOR_CANCELLED;
754}
755
757{
758 /* identifiers */
759 ot->name = "Reveal Selected";
760 ot->idname = "POSE_OT_reveal";
761 ot->description = "Reveal all bones hidden in Pose Mode";
762
763 /* API callbacks. */
766
767 /* flags */
769
770 RNA_def_boolean(ot->srna, "select", true, "Select", "");
771}
772
774
775/* -------------------------------------------------------------------- */
778
780{
781 const Main *bmain = CTX_data_main(C);
782 Scene *scene = CTX_data_scene(C);
783
784 bool changed_multi = false;
785
786 ViewLayer *view_layer = CTX_data_view_layer(C);
787 View3D *v3d = CTX_wm_view3d(C);
788 FOREACH_OBJECT_IN_MODE_BEGIN (bmain, scene, view_layer, v3d, OB_ARMATURE, OB_MODE_POSE, ob_iter)
789 {
790 bool changed = false;
791 /* loop through all selected pchans, flipping and keying (as needed) */
793 /* only if bone is using quaternion rotation */
794 if (pchan->rotmode == ROT_MODE_QUAT) {
795 changed = true;
796 /* quaternions have 720 degree range */
797 negate_v4(pchan->quat);
798
800 C, scene, ob_iter, pchan, {{"rotation_quaternion"}}, false);
801 }
802 }
804
805 if (changed) {
806 changed_multi = true;
807 /* notifiers and updates */
810 }
811 }
813
814 return changed_multi ? OPERATOR_FINISHED : OPERATOR_CANCELLED;
815}
816
818{
819 /* identifiers */
820 ot->name = "Flip Quaternions";
821 ot->idname = "POSE_OT_quaternions_flip";
822 ot->description =
823 "Flip quaternion values to achieve desired rotations, while maintaining the same "
824 "orientations";
825
826 /* callbacks */
829
830 /* flags */
832}
833
835
836} // namespace blender
Functions to deal with Armatures.
C++ functions to deal with Armature collections (i.e. the successor of bone layers).
Functions to insert, delete or modify keyframes.
#define FOREACH_PCHAN_SELECTED_IN_OBJECT_END
#define FOREACH_PCHAN_SELECTED_IN_OBJECT_BEGIN(_ob, _pchan)
#define CTX_DATA_BEGIN_WITH_ID(C, Type, instance, member, Type_id, instance_id)
#define CTX_DATA_BEGIN(C, Type, instance, member)
#define CTX_DATA_END
#define FOREACH_OBJECT_IN_MODE_BEGIN(_bmain, _scene, _view_layer, _v3d, _object_type, _object_mode, _instance)
Definition BKE_layer.hh:470
#define FOREACH_OBJECT_IN_MODE_END
Definition BKE_layer.hh:477
General operations, lookup, etc. for blender objects.
#define STRNCPY_UTF8(dst, src)
Utility defines for timing/benchmarks.
#define TIMEIT_START(var)
#define TIMEIT_END(var)
#define TIP_(msgid)
#define IFACE_(msgid)
#define MAXBONENAME
Object is a sort of wrapper for general info.
#define C
Definition RandGen.cpp:29
#define NC_GEOM
Definition WM_types.hh:406
#define ND_DATA
Definition WM_types.hh:552
#define NC_ANIMATION
Definition WM_types.hh:401
#define ND_MODE
Definition WM_types.hh:464
#define NC_SCENE
Definition WM_types.hh:391
#define ND_POSE
Definition WM_types.hh:482
#define NS_MODE_OBJECT
Definition WM_types.hh:610
#define ND_TRANSFORM
Definition WM_types.hh:475
#define NS_MODE_POSE
Definition WM_types.hh:619
#define NA_RENAME
Definition WM_types.hh:638
#define ND_DRAW_ANIMVIZ
Definition WM_types.hh:514
#define ND_BONE_SELECT
Definition WM_types.hh:491
#define NC_OBJECT
Definition WM_types.hh:392
#define ND_ANIMCHAN
Definition WM_types.hh:539
#define SET_FLAG_FROM_TEST(value, test, flag)
#define ELEM(...)
void bone_deselect(bPoseChannel *pchan)
void autokeyframe_pose_channel(bContext *C, Scene *scene, Object *ob, bPoseChannel *pose_channel, Span< RNAPath > rna_paths, short targetless_ik)
void free(struct bMotionPath *mpath)
struct bMotionPath * ensure(struct ReportList *reports, struct Scene *scene, struct Object *ob, struct bPoseChannel *pchan)
void tag_for_recalc(bMotionPath &motion_path)
Object * context_active_object(const bContext *C)
BMesh Iterators.
void ED_armature_bones_flip_names(Main *bmain, bArmature *arm, ListBaseT< LinkData > *bones_names, const bool do_strip_numbers)
BLI_assert(slot->slot_subtype.map==BMO_OP_SLOT_SUBTYPE_MAP_FLT)
void POSE_OT_flip_names(wmOperatorType *ot)
Definition pose_edit.cc:516
wmOperatorStatus WM_menu_invoke(bContext *C, wmOperator *op, const wmEvent *)
bool ED_operator_posemode_exclusive(bContext *C)
ScrArea * CTX_wm_area(const bContext *C)
int RNA_enum_get(PointerRNA *ptr, const char *name)
@ RPT_WARNING
Definition BKE_report.hh:40
void POSE_OT_paths_calculate(wmOperatorType *ot)
Definition pose_edit.cc:259
void DEG_graph_free(Depsgraph *graph)
Definition depsgraph.cc:307
static wmOperatorStatus pose_bone_rotmode_exec(bContext *C, wmOperator *op)
Definition pose_edit.cc:605
const EnumPropertyItem rna_enum_object_rotation_mode_items[]
static std::string pose_clear_paths_get_description(bContext *, wmOperatorType *, PointerRNA *ptr)
Definition pose_edit.cc:406
bool ED_operator_posemode(bContext *C)
PropertyRNA * RNA_def_enum(StructOrFunctionRNA *cont_, const char *identifier, const EnumPropertyItem *items, const int default_value, const char *ui_name, const char *ui_description)
void POSE_OT_paths_range_update(wmOperatorType *ot)
Definition pose_edit.cc:462
bool ANIM_bone_in_visible_collection(const bArmature *armature, const Bone *bone)
void POSE_OT_quaternions_flip(wmOperatorType *ot)
Definition pose_edit.cc:817
void RNA_enum_set(PointerRNA *ptr, const char *name, int value)
const EnumPropertyItem rna_enum_motionpath_bake_location_items[]
static wmOperatorStatus pose_autoside_names_exec(bContext *C, wmOperator *op)
Definition pose_edit.cc:540
static bool pose_update_paths_poll(bContext *C)
Definition pose_edit.cc:298
ViewLayer * CTX_data_view_layer(const bContext *C)
Object * ED_pose_object_from_context(bContext *C)
Definition pose_edit.cc:62
static wmOperatorStatus pose_calculate_paths_exec(bContext *C, wmOperator *op)
Definition pose_edit.cc:210
void ED_armature_bone_rename(Main *bmain, bArmature *arm, const char *oldnamep, const char *newnamep)
bool bone_autoside_name(char name[64], int strip_number, short axis, float head, float tail)
void POSE_OT_paths_update(wmOperatorType *ot)
Definition pose_edit.cc:338
Vector< Object * > BKE_object_pose_array_get_unique(const Main &bmain, const Scene *scene, ViewLayer *view_layer, View3D *v3d)
Definition object.cc:2587
void animviz_build_motionpath_targets(Object *ob, Vector< MPathTarget > &r_targets)
static wmOperatorStatus pose_reveal_exec(bContext *C, wmOperator *op)
Definition pose_edit.cc:717
static wmOperatorStatus pose_update_paths_exec(bContext *C, wmOperator *op)
Definition pose_edit.cc:308
void DEG_id_tag_update_ex(Main *bmain, ID *id, unsigned int flags)
Depsgraph * animviz_depsgraph_build(Main *bmain, Scene *scene, ViewLayer *view_layer, const Span< MPathTarget > targets)
void POSE_OT_hide(wmOperatorType *ot)
Definition pose_edit.cc:698
bool ED_object_posemode_exit_ex(Main *bmain, Object *ob)
Definition pose_edit.cc:117
void DEG_id_tag_update(ID *id, unsigned int flags)
float BKE_scene_frame_get(const Scene *scene)
Definition scene.cc:2595
void BKE_report(ReportList *reports, eReportType type, const char *message)
Definition report.cc:162
Object * BKE_object_pose_armature_get(Object *ob)
Definition object.cc:2507
static wmOperatorStatus pose_flip_quats_exec(bContext *C, wmOperator *)
Definition pose_edit.cc:779
LinkData * BLI_genericNodeN(void *data)
Definition listbase.cc:936
void animviz_calc_motionpaths(Depsgraph *depsgraph, Scene *scene, MutableSpan< MPathTarget > targets, const int modified_frame)
PointerRNA RNA_pointer_create_discrete(ID *id, StructRNA *type, void *data)
static void pose_clear_paths(Object *ob, bool only_selected)
Definition pose_edit.cc:356
const EnumPropertyItem rna_enum_motionpath_range_items[]
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, const bool show_icon)
bool RNA_boolean_get(PointerRNA *ptr, const char *name)
void WM_event_add_notifier(const bContext *C, uint type, void *reference)
void animviz_motionpath_compute_range(Object *ob, Scene *scene)
void BKE_rotMode_change_values(float quat[4], float eul[3], float axis[3], float *angle, eRotationModes oldMode, eRotationModes newMode)
static wmOperatorStatus pose_calculate_paths_invoke(bContext *C, wmOperator *op, const wmEvent *)
Definition pose_edit.cc:180
void RNA_def_property_flag(PropertyRNA *prop, PropertyFlag flag)
bool ED_object_posemode_exit(bContext *C, Object *ob)
Definition pose_edit.cc:130
static wmOperatorStatus pose_flip_names_exec(bContext *C, wmOperator *op)
Definition pose_edit.cc:483
void BLI_addtail(ListBase *listbase, void *vlink) ATTR_NONNULL(1)
Definition listbase.cc:118
Main * CTX_data_main(const bContext *C)
bool ED_operator_posemode_local(bContext *C)
static wmOperatorStatus pose_hide_exec(bContext *C, wmOperator *op)
Definition pose_edit.cc:662
@ 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
@ PROP_SKIP_SAVE
Definition RNA_types.hh:414
bool ED_object_posemode_enter_ex(Main *bmain, Object *ob)
Definition pose_edit.cc:81
void POSE_OT_paths_clear(wmOperatorType *ot)
Definition pose_edit.cc:417
const EnumPropertyItem rna_enum_motionpath_display_type_items[]
MINLINE void negate_v4(float r[4])
Scene * CTX_data_scene(const bContext *C)
@ OPTYPE_REGISTER
Definition WM_types.hh:188
@ OPTYPE_UNDO
Definition WM_types.hh:190
PropertyRNA * RNA_def_boolean(StructOrFunctionRNA *cont_, const char *identifier, const bool default_value, const char *ui_name, const char *ui_description)
ReportList * CTX_wm_reports(const bContext *C)
bool BKE_id_is_editable(const Main *bmain, const ID *id)
Definition lib_id.cc:2782
@ MOTIONPATH_BAKE_HAS_PATHS
void POSE_OT_rotation_mode_set(wmOperatorType *ot)
Definition pose_edit.cc:635
void POSE_OT_autoside_names(wmOperatorType *ot)
Definition pose_edit.cc:571
Object * CTX_data_active_object(const bContext *C)
void POSE_OT_reveal(wmOperatorType *ot)
Definition pose_edit.cc:756
void ED_pose_recalculate_paths(bContext *C, Scene *scene, Object *ob)
Definition pose_edit.cc:146
View3D * CTX_wm_view3d(const bContext *C)
bool ED_object_posemode_enter(bContext *C, Object *ob)
Definition pose_edit.cc:102
static wmOperatorStatus pose_clear_paths_exec(bContext *C, wmOperator *op)
Definition pose_edit.cc:387
static wmOperatorStatus pose_update_paths_range_exec(bContext *C, wmOperator *)
Definition pose_edit.cc:442
eObjectMode restore_mode
struct bPose * pose
eMotionPath_Ranges path_range
eMotionPath_BakeFlag path_bakeflag
eMotionPaths_Types path_type
eAnimViz_RecalcFlags recalc
bAnimVizSettings avs
ListBaseT< bPoseChannel > chanbase
wmOperatorStatus(*) exec(bContext *C, wmOperator *op) ATTR_WARN_UNUSED_RESULT
Definition WM_types.hh:1125
const char * description
Definition WM_types.hh:1115
bool(*) poll(bContext *C) ATTR_WARN_UNUSED_RESULT
Definition WM_types.hh:1165
wmOperatorStatus(*) invoke(bContext *C, wmOperator *op, const wmEvent *event) ATTR_WARN_UNUSED_RESULT
Definition WM_types.hh:1141
std::string(*) get_description(bContext *C, wmOperatorType *ot, PointerRNA *ptr)
Definition WM_types.hh:1197
struct ReportList * reports