Blender V4.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
10#include "MEM_guardedalloc.h"
11
12#include "BLI_blenlib.h"
13#include "BLI_math_vector.h"
14
15#include "BLT_translation.hh"
16
17#include "DNA_anim_types.h"
18#include "DNA_armature_types.h"
19#include "DNA_object_types.h"
20#include "DNA_scene_types.h"
21
23#include "BKE_armature.hh"
24#include "BKE_context.hh"
25#include "BKE_layer.hh"
26#include "BKE_lib_id.hh"
27#include "BKE_object.hh"
28#include "BKE_report.hh"
29
30#include "DEG_depsgraph.hh"
31
32#include "RNA_access.hh"
33#include "RNA_define.hh"
34#include "RNA_enum_types.hh"
35#include "RNA_prototypes.hh"
36
37#include "WM_api.hh"
38#include "WM_types.hh"
39
40#include "ED_anim_api.hh"
41#include "ED_armature.hh"
42#include "ED_keyframing.hh"
43#include "ED_object.hh"
44#include "ED_screen.hh"
45
47#include "ANIM_keyframing.hh"
48
49#include "armature_intern.hh"
50
51#undef DEBUG_TIME
52
53#ifdef DEBUG_TIME
54# include "BLI_time_utildefines.h"
55#endif
56
57using blender::Vector;
58
60{
61 /* NOTE: matches logic with #ED_operator_posemode_context(). */
62
63 ScrArea *area = CTX_wm_area(C);
64 Object *ob;
65
66 /* Since this call may also be used from the buttons window,
67 * we need to check for where to get the object. */
68 if (area && area->spacetype == SPACE_PROPERTIES) {
70 }
71 else {
73 }
74
75 return ob;
76}
77
79{
80 BLI_assert(BKE_id_is_editable(bmain, &ob->id));
81 bool ok = false;
82
83 switch (ob->type) {
84 case OB_ARMATURE:
85 ob->restore_mode = ob->mode;
86 ob->mode |= OB_MODE_POSE;
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
165 ListBase targets = {nullptr, nullptr};
166 /* set flag to force recalc, then grab the relevant bones to target */
168 animviz_get_object_motionpaths(ob, &targets);
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
195 BLI_freelistN(&targets);
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 */
210static int pose_calculate_paths_invoke(bContext *C, wmOperator *op, const wmEvent * /*event*/)
211{
213
214 if (ELEM(nullptr, ob, ob->pose)) {
215 return OPERATOR_CANCELLED;
216 }
217
218 /* set default settings from existing/stored settings */
219 {
220 bAnimVizSettings *avs = &ob->pose->avs;
221
222 PointerRNA avs_ptr = RNA_pointer_create(nullptr, &RNA_AnimVizMotionPaths, avs);
223 RNA_enum_set(op->ptr, "display_type", RNA_enum_get(&avs_ptr, "type"));
224 RNA_enum_set(op->ptr, "range", RNA_enum_get(&avs_ptr, "range"));
225 RNA_enum_set(op->ptr, "bake_location", RNA_enum_get(&avs_ptr, "bake_location"));
226 }
227
228 /* show popup dialog to allow editing of range... */
229 /* FIXME: hard-coded dimensions here are just arbitrary. */
231 C, op, 270, IFACE_("Calculate Paths for the Selected Bones"), IFACE_("Calculate"));
232}
233
239{
241 Scene *scene = CTX_data_scene(C);
242
243 if (ELEM(nullptr, ob, ob->pose)) {
244 return OPERATOR_CANCELLED;
245 }
246
247 /* grab baking settings from operator settings */
248 {
249 bAnimVizSettings *avs = &ob->pose->avs;
250
251 avs->path_type = RNA_enum_get(op->ptr, "display_type");
252 avs->path_range = RNA_enum_get(op->ptr, "range");
254
255 PointerRNA avs_ptr = RNA_pointer_create(nullptr, &RNA_AnimVizMotionPaths, avs);
256 RNA_enum_set(&avs_ptr, "bake_location", RNA_enum_get(op->ptr, "bake_location"));
257 }
258
259 /* set up path data for bones being calculated */
260 CTX_DATA_BEGIN (C, bPoseChannel *, pchan, selected_pose_bones_from_active_object) {
261 /* verify makes sure that the selected bone has a bone with the appropriate settings */
262 animviz_verify_motionpaths(op->reports, scene, ob, pchan);
263 }
265
266#ifdef DEBUG_TIME
267 TIMEIT_START(recalc_pose_paths);
268#endif
269
270 /* Calculate the bones that now have motion-paths. */
271 /* TODO: only make for the selected bones? */
273
274#ifdef DEBUG_TIME
275 TIMEIT_END(recalc_pose_paths);
276#endif
277
278 /* notifiers for updates */
280
281 return OPERATOR_FINISHED;
282}
283
285{
286 /* identifiers */
287 ot->name = "Calculate Bone Paths";
288 ot->idname = "POSE_OT_paths_calculate";
289 ot->description = "Calculate paths for the selected bones";
290
291 /* api callbacks */
295
296 /* flags */
298
299 /* properties */
301 "display_type",
304 "Display type",
305 "");
307 "range",
310 "Computation Range",
311 "");
312
314 "bake_location",
317 "Bake Location",
318 "Which point on the bones is used when calculating paths");
319}
320
321/* --------- */
322
324{
327 return (ob->pose->avs.path_bakeflag & MOTIONPATH_BAKE_HAS_PATHS) != 0;
328 }
329
330 return false;
331}
332
334{
336 Scene *scene = CTX_data_scene(C);
337
338 if (ELEM(nullptr, ob, scene)) {
339 return OPERATOR_CANCELLED;
340 }
342
343 /* set up path data for bones being calculated */
344 CTX_DATA_BEGIN (C, bPoseChannel *, pchan, selected_pose_bones_from_active_object) {
345 animviz_verify_motionpaths(op->reports, scene, ob, pchan);
346 }
348
349 /* Calculate the bones that now have motion-paths. */
350 /* TODO: only make for the selected bones? */
352
353 /* notifiers for updates */
355
356 return OPERATOR_FINISHED;
357}
358
360{
361 /* identifiers */
362 ot->name = "Update Bone Paths";
363 ot->idname = "POSE_OT_paths_update";
364 ot->description = "Recalculate paths for bones that already have them";
365
366 /* api callbacks */
369
370 /* flags */
372}
373
374/* --------- */
375
376/* for the object with pose/action: clear path curves for selected bones only */
377static void ED_pose_clear_paths(Object *ob, bool only_selected)
378{
379 bool skipped = false;
380
381 if (ELEM(nullptr, ob, ob->pose)) {
382 return;
383 }
384
385 /* free the motionpath blocks for all bones - This is easier for users to quickly clear all */
386 LISTBASE_FOREACH (bPoseChannel *, pchan, &ob->pose->chanbase) {
387 if (pchan->mpath) {
388 if ((only_selected == false) || ((pchan->bone) && (pchan->bone->flag & BONE_SELECTED))) {
389 animviz_free_motionpath(pchan->mpath);
390 pchan->mpath = nullptr;
391 }
392 else {
393 skipped = true;
394 }
395 }
396 }
397
398 /* if nothing was skipped, there should be no paths left! */
399 if (skipped == false) {
400 ob->pose->avs.path_bakeflag &= ~MOTIONPATH_BAKE_HAS_PATHS;
401 }
402
403 /* tag armature object for copy-on-eval - so removed paths don't still show */
405}
406
407/* Operator callback - wrapper for the back-end function. */
409{
411 bool only_selected = RNA_boolean_get(op->ptr, "only_selected");
412
413 /* only continue if there's an object */
414 if (ELEM(nullptr, ob, ob->pose)) {
415 return OPERATOR_CANCELLED;
416 }
417
418 /* use the backend function for this */
419 ED_pose_clear_paths(ob, only_selected);
420
421 /* notifiers for updates */
423
424 return OPERATOR_FINISHED;
425}
426
428 wmOperatorType * /*ot*/,
430{
431 const bool only_selected = RNA_boolean_get(ptr, "only_selected");
432 if (only_selected) {
433 return TIP_("Clear motion paths of selected bones");
434 }
435 return TIP_("Clear motion paths of all bones");
436}
437
439{
440 /* identifiers */
441 ot->name = "Clear Bone Paths";
442 ot->idname = "POSE_OT_paths_clear";
443
444 /* api callbacks */
448
449 /* flags */
451
452 /* properties */
454 "only_selected",
455 false,
456 "Only Selected",
457 "Only clear motion paths of selected bones");
459}
460
461/* --------- */
462
464{
465 Scene *scene = CTX_data_scene(C);
467
468 if (ELEM(nullptr, scene, ob, ob->pose)) {
469 return OPERATOR_CANCELLED;
470 }
471
472 /* use Preview Range or Full Frame Range - whichever is in use */
473 ob->pose->avs.path_sf = PSFRA;
474 ob->pose->avs.path_ef = PEFRA;
475
476 /* tag for updates */
479
480 return OPERATOR_FINISHED;
481}
482
484{
485 /* identifiers */
486 ot->name = "Update Range from Scene";
487 ot->idname = "POSE_OT_paths_range_update";
488 ot->description = "Update frame range for motion paths from the Scene's current frame range";
489
490 /* callbacks */
493
494 /* flags */
496}
497
498/* ********************************************** */
499
501{
502 Main *bmain = CTX_data_main(C);
503 const Scene *scene = CTX_data_scene(C);
504 ViewLayer *view_layer = CTX_data_view_layer(C);
505 View3D *v3d = CTX_wm_view3d(C);
506 const bool do_strip_numbers = RNA_boolean_get(op->ptr, "do_strip_numbers");
507
508 FOREACH_OBJECT_IN_MODE_BEGIN (scene, view_layer, v3d, OB_ARMATURE, OB_MODE_POSE, ob) {
509 bArmature *arm = static_cast<bArmature *>(ob->data);
510 ListBase bones_names = {nullptr};
511
513 BLI_addtail(&bones_names, BLI_genericNodeN(pchan->name));
514 }
516
517 ED_armature_bones_flip_names(bmain, arm, &bones_names, do_strip_numbers);
518
519 BLI_freelistN(&bones_names);
520
521 /* since we renamed stuff... */
523
524 /* NOTE: notifier might evolve. */
526 }
528
529 return OPERATOR_FINISHED;
530}
531
533{
534 /* identifiers */
535 ot->name = "Flip Names";
536 ot->idname = "POSE_OT_flip_names";
537 ot->description = "Flips (and corrects) the axis suffixes of the names of selected bones";
538
539 /* api callbacks */
542
543 /* flags */
545
547 "do_strip_numbers",
548 false,
549 "Strip Numbers",
550 "Try to remove right-most dot-number from flipped names.\n"
551 "Warning: May result in incoherent naming in some cases");
552}
553
554/* ------------------ */
555
557{
558 Main *bmain = CTX_data_main(C);
559 char newname[MAXBONENAME];
560 short axis = RNA_enum_get(op->ptr, "axis");
561 Object *ob_prev = nullptr;
562
563 /* loop through selected bones, auto-naming them */
564 CTX_DATA_BEGIN_WITH_ID (C, bPoseChannel *, pchan, selected_pose_bones, Object *, ob) {
565 bArmature *arm = static_cast<bArmature *>(ob->data);
566 STRNCPY(newname, pchan->name);
567 if (bone_autoside_name(newname, 1, axis, pchan->bone->head[axis], pchan->bone->tail[axis])) {
568 ED_armature_bone_rename(bmain, arm, pchan->name, newname);
569 }
570
571 if (ob_prev != ob) {
572 /* since we renamed stuff... */
574
575 /* NOTE: notifier might evolve. */
577 ob_prev = ob;
578 }
579 }
581
582 return OPERATOR_FINISHED;
583}
584
586{
587 static const EnumPropertyItem axis_items[] = {
588 {0, "XAXIS", 0, "X-Axis", "Left/Right"},
589 {1, "YAXIS", 0, "Y-Axis", "Front/Back"},
590 {2, "ZAXIS", 0, "Z-Axis", "Top/Bottom"},
591 {0, nullptr, 0, nullptr, nullptr},
592 };
593
594 /* identifiers */
595 ot->name = "Auto-Name by Axis";
596 ot->idname = "POSE_OT_autoside_names";
597 ot->description =
598 "Automatically renames the selected bones according to which side of the target axis they "
599 "fall on";
600
601 /* api callbacks */
605
606 /* flags */
608
609 /* settings */
610 ot->prop = RNA_def_enum(ot->srna, "axis", axis_items, 0, "Axis", "Axis to tag names with");
611}
612
613/* ********************************************** */
614
616{
617 const int mode = RNA_enum_get(op->ptr, "type");
618 Object *prev_ob = nullptr;
619
620 /* Set rotation mode of selected bones. */
621 CTX_DATA_BEGIN_WITH_ID (C, bPoseChannel *, pchan, selected_pose_bones, Object *, ob) {
622 /* use API Method for conversions... */
624 pchan->quat, pchan->eul, pchan->rotAxis, &pchan->rotAngle, pchan->rotmode, short(mode));
625
626 /* finally, set the new rotation type */
627 pchan->rotmode = mode;
628
629 if (prev_ob != ob) {
630 /* Notifiers and updates. */
634 prev_ob = ob;
635 }
636 }
638
639 return OPERATOR_FINISHED;
640}
641
643{
644 /* identifiers */
645 ot->name = "Set Rotation Mode";
646 ot->idname = "POSE_OT_rotation_mode_set";
647 ot->description = "Set the rotation representation used by selected bones";
648
649 /* callbacks */
653
654 /* flags */
656
657 /* properties */
659 ot->srna, "type", rna_enum_object_rotation_mode_items, 0, "Rotation Mode", "");
660}
661
662/* ********************************************** */
663/* Show/Hide Bones */
664
665static int hide_pose_bone_fn(Object *ob, Bone *bone, void *ptr)
666{
667 bArmature *arm = static_cast<bArmature *>(ob->data);
668 const bool hide_select = bool(POINTER_AS_INT(ptr));
669 int count = 0;
670 if (ANIM_bone_in_visible_collection(arm, bone)) {
671 if (((bone->flag & BONE_SELECTED) != 0) == hide_select) {
672 bone->flag |= BONE_HIDDEN_P;
673 /* only needed when 'hide_select' is true, but harmless. */
674 bone->flag &= ~BONE_SELECTED;
675 count += 1;
676 }
677 }
678 return count;
679}
680
681/* active object is armature in posemode, poll checked */
683{
684 const Scene *scene = CTX_data_scene(C);
685 ViewLayer *view_layer = CTX_data_view_layer(C);
686 Vector<Object *> objects = BKE_object_pose_array_get_unique(scene, view_layer, CTX_wm_view3d(C));
687 bool changed_multi = false;
688
689 const int hide_select = !RNA_boolean_get(op->ptr, "unselected");
690 void *hide_select_p = POINTER_FROM_INT(hide_select);
691
692 for (Object *ob_iter : objects) {
693 bArmature *arm = static_cast<bArmature *>(ob_iter->data);
694
695 bool changed = bone_looper(ob_iter,
696 static_cast<Bone *>(arm->bonebase.first),
697 hide_select_p,
698 hide_pose_bone_fn) != 0;
699 if (changed) {
700 changed_multi = true;
703 }
704 }
705
706 return changed_multi ? OPERATOR_FINISHED : OPERATOR_CANCELLED;
707}
708
710{
711 /* identifiers */
712 ot->name = "Hide Selected";
713 ot->idname = "POSE_OT_hide";
714 ot->description = "Tag selected bones to not be visible in Pose Mode";
715
716 /* api callbacks */
719
720 /* flags */
722
723 /* props */
724 RNA_def_boolean(ot->srna, "unselected", false, "Unselected", "");
725}
726
727static int show_pose_bone_cb(Object *ob, Bone *bone, void *data)
728{
729 const bool select = POINTER_AS_INT(data);
730
731 bArmature *arm = static_cast<bArmature *>(ob->data);
732 int count = 0;
733 if (ANIM_bone_in_visible_collection(arm, bone)) {
734 if (bone->flag & BONE_HIDDEN_P) {
735 if (!(bone->flag & BONE_UNSELECTABLE)) {
737 }
738 bone->flag &= ~BONE_HIDDEN_P;
739 count += 1;
740 }
741 }
742
743 return count;
744}
745
746/* active object is armature in posemode, poll checked */
748{
749 const Scene *scene = CTX_data_scene(C);
750 ViewLayer *view_layer = CTX_data_view_layer(C);
751 Vector<Object *> objects = BKE_object_pose_array_get_unique(scene, view_layer, CTX_wm_view3d(C));
752 bool changed_multi = false;
753 const bool select = RNA_boolean_get(op->ptr, "select");
754 void *select_p = POINTER_FROM_INT(select);
755
756 for (Object *ob_iter : objects) {
757 bArmature *arm = static_cast<bArmature *>(ob_iter->data);
758
759 bool changed = bone_looper(
760 ob_iter, static_cast<Bone *>(arm->bonebase.first), select_p, show_pose_bone_cb);
761 if (changed) {
762 changed_multi = true;
765 }
766 }
767
768 return changed_multi ? OPERATOR_FINISHED : OPERATOR_CANCELLED;
769}
770
772{
773 /* identifiers */
774 ot->name = "Reveal Selected";
775 ot->idname = "POSE_OT_reveal";
776 ot->description = "Reveal all bones hidden in Pose Mode";
777
778 /* api callbacks */
781
782 /* flags */
784
785 RNA_def_boolean(ot->srna, "select", true, "Select", "");
786}
787
788/* -------------------------------------------------------------------- */
793{
794 Scene *scene = CTX_data_scene(C);
795
796 bool changed_multi = false;
797
798 ViewLayer *view_layer = CTX_data_view_layer(C);
799 View3D *v3d = CTX_wm_view3d(C);
800 FOREACH_OBJECT_IN_MODE_BEGIN (scene, view_layer, v3d, OB_ARMATURE, OB_MODE_POSE, ob_iter) {
801 bool changed = false;
802 /* loop through all selected pchans, flipping and keying (as needed) */
804 /* only if bone is using quaternion rotation */
805 if (pchan->rotmode == ROT_MODE_QUAT) {
806 changed = true;
807 /* quaternions have 720 degree range */
808 negate_v4(pchan->quat);
809
811 C, scene, ob_iter, pchan, {{"rotation_quaternion"}}, false);
812 }
813 }
815
816 if (changed) {
817 changed_multi = true;
818 /* notifiers and updates */
821 }
822 }
824
825 return changed_multi ? OPERATOR_FINISHED : OPERATOR_CANCELLED;
826}
827
829{
830 /* identifiers */
831 ot->name = "Flip Quaternions";
832 ot->idname = "POSE_OT_quaternions_flip";
833 ot->description =
834 "Flip quaternion values to achieve desired rotations, while maintaining the same "
835 "orientations";
836
837 /* callbacks */
840
841 /* flags */
843}
844
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)
Definition armature.cc:2383
#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:2456
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)
void BKE_report(ReportList *reports, eReportType type, const char *message)
Definition report.cc:125
#define BLI_assert(a)
Definition BLI_assert.h:50
#define LISTBASE_FOREACH(type, var, list)
void void BLI_freelistN(struct ListBase *listbase) ATTR_NONNULL(1)
Definition listbase.cc:496
void BLI_addtail(struct ListBase *listbase, void *vlink) ATTR_NONNULL(1)
Definition listbase.cc:110
struct LinkData * BLI_genericNodeN(void *data)
Definition listbase.cc:909
MINLINE void negate_v4(float r[4])
#define STRNCPY(dst, src)
Definition BLI_string.h:593
Utility defines for timing/benchmarks.
#define TIMEIT_START(var)
#define TIMEIT_END(var)
#define POINTER_FROM_INT(i)
#define SET_FLAG_FROM_TEST(value, test, flag)
#define POINTER_AS_INT(i)
#define ELEM(...)
#define TIP_(msgid)
#define IFACE_(msgid)
void DEG_id_tag_update(ID *id, unsigned int flags)
void DEG_id_tag_update_ex(Main *bmain, ID *id, unsigned int flags)
void DEG_graph_free(Depsgraph *graph)
Definition depsgraph.cc:301
@ ID_RECALC_PARAMETERS
Definition DNA_ID.h:1105
@ ID_RECALC_SYNC_TO_EVAL
Definition DNA_ID.h:1085
@ ID_RECALC_GEOMETRY
Definition DNA_ID.h:1041
@ MOTIONPATH_BAKE_HEADS
@ MOTIONPATH_BAKE_HAS_PATHS
@ MOTIONPATH_TYPE_RANGE
@ ROT_MODE_QUAT
@ MOTIONPATH_RANGE_SCENE
@ ANIMVIZ_RECALC_PATHS
#define MAXBONENAME
@ BONE_SELECTED
@ BONE_UNSELECTABLE
@ BONE_HIDDEN_P
@ OB_MODE_POSE
Object is a sort of wrapper for general info.
@ OB_ARMATURE
#define PSFRA
#define PEFRA
@ SPACE_PROPERTIES
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)
Read Guarded memory(de)allocation.
@ PROP_SKIP_SAVE
Definition RNA_types.hh:245
@ OPTYPE_UNDO
Definition WM_types.hh:162
@ OPTYPE_REGISTER
Definition WM_types.hh:160
#define ND_MODE
Definition WM_types.hh:412
#define NC_SCENE
Definition WM_types.hh:345
#define ND_POSE
Definition WM_types.hh:425
#define NS_MODE_OBJECT
Definition WM_types.hh:526
#define ND_TRANSFORM
Definition WM_types.hh:423
#define NS_MODE_POSE
Definition WM_types.hh:535
#define ND_BONE_SELECT
Definition WM_types.hh:427
#define NC_OBJECT
Definition WM_types.hh:346
void animviz_calc_motionpaths(Depsgraph *depsgraph, Main *bmain, Scene *scene, ListBase *targets, eAnimvizCalcRange range, bool restore)
void animviz_get_object_motionpaths(Object *ob, ListBase *targets)
void animviz_motionpath_compute_range(Object *ob, Scene *scene)
Depsgraph * animviz_depsgraph_build(Main *bmain, Scene *scene, ViewLayer *view_layer, ListBase *targets)
int bone_looper(Object *ob, Bone *bone, void *data, int(*bone_func)(Object *, Bone *, void *))
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)
const Depsgraph * depsgraph
int count
ccl_device_inline float4 select(const int4 mask, const float4 a, const float4 b)
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)
static int pose_clear_paths_exec(bContext *C, wmOperator *op)
Definition pose_edit.cc:408
void POSE_OT_hide(wmOperatorType *ot)
Definition pose_edit.cc:709
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:78
static int pose_update_paths_range_exec(bContext *C, wmOperator *)
Definition pose_edit.cc:463
void POSE_OT_paths_range_update(wmOperatorType *ot)
Definition pose_edit.cc:483
static int pose_update_paths_exec(bContext *C, wmOperator *op)
Definition pose_edit.cc:333
static int pose_autoside_names_exec(bContext *C, wmOperator *op)
Definition pose_edit.cc:556
void POSE_OT_quaternions_flip(wmOperatorType *ot)
Definition pose_edit.cc:828
static int pose_calculate_paths_invoke(bContext *C, wmOperator *op, const wmEvent *)
Definition pose_edit.cc:210
void POSE_OT_paths_update(wmOperatorType *ot)
Definition pose_edit.cc:359
bool ED_object_posemode_enter(bContext *C, Object *ob)
Definition pose_edit.cc:98
Object * ED_pose_object_from_context(bContext *C)
Definition pose_edit.cc:59
static void ED_pose_clear_paths(Object *ob, bool only_selected)
Definition pose_edit.cc:377
static int show_pose_bone_cb(Object *ob, Bone *bone, void *data)
Definition pose_edit.cc:727
void POSE_OT_reveal(wmOperatorType *ot)
Definition pose_edit.cc:771
static eAnimvizCalcRange pose_path_convert_range(ePosePathCalcRange range)
Definition pose_edit.cc:139
static int hide_pose_bone_fn(Object *ob, Bone *bone, void *ptr)
Definition pose_edit.cc:665
static int pose_flip_quats_exec(bContext *C, wmOperator *)
Definition pose_edit.cc:792
void POSE_OT_flip_names(wmOperatorType *ot)
Definition pose_edit.cc:532
void POSE_OT_paths_clear(wmOperatorType *ot)
Definition pose_edit.cc:438
static int pose_reveal_exec(bContext *C, wmOperator *op)
Definition pose_edit.cc:747
static std::string pose_clear_paths_get_description(bContext *, wmOperatorType *, PointerRNA *ptr)
Definition pose_edit.cc:427
void POSE_OT_autoside_names(wmOperatorType *ot)
Definition pose_edit.cc:585
static int pose_calculate_paths_exec(bContext *C, wmOperator *op)
Definition pose_edit.cc:238
void POSE_OT_paths_calculate(wmOperatorType *ot)
Definition pose_edit.cc:284
static int pose_flip_names_exec(bContext *C, wmOperator *op)
Definition pose_edit.cc:500
void POSE_OT_rotation_mode_set(wmOperatorType *ot)
Definition pose_edit.cc:642
bool ED_object_posemode_exit_ex(Main *bmain, Object *ob)
Definition pose_edit.cc:113
static int pose_bone_rotmode_exec(bContext *C, wmOperator *op)
Definition pose_edit.cc:615
static int pose_hide_exec(bContext *C, wmOperator *op)
Definition pose_edit.cc:682
static bool pose_update_paths_poll(bContext *C)
Definition pose_edit.cc:323
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(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:413
void * first
struct bPose * pose
ListBase chanbase
bAnimVizSettings avs
const char * name
Definition WM_types.hh:990
bool(* poll)(bContext *C) ATTR_WARN_UNUSED_RESULT
Definition WM_types.hh:1042
std::string(* get_description)(bContext *C, wmOperatorType *ot, PointerRNA *ptr)
Definition WM_types.hh:1074
const char * idname
Definition WM_types.hh:992
int(* invoke)(bContext *C, wmOperator *op, const wmEvent *event) ATTR_WARN_UNUSED_RESULT
Definition WM_types.hh:1022
int(* exec)(bContext *C, wmOperator *op) ATTR_WARN_UNUSED_RESULT
Definition WM_types.hh:1006
const char * description
Definition WM_types.hh:996
PropertyRNA * prop
Definition WM_types.hh:1092
StructRNA * srna
Definition WM_types.hh:1080
struct ReportList * reports
struct PointerRNA * ptr
void WM_event_add_notifier(const bContext *C, uint type, void *reference)
PointerRNA * ptr
Definition wm_files.cc:4126
wmOperatorType * ot
Definition wm_files.cc:4125
int WM_menu_invoke(bContext *C, wmOperator *op, const wmEvent *)
int 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)