Blender V4.5
pose_lib_2.cc
Go to the documentation of this file.
1/* SPDX-FileCopyrightText: 2021 Blender Authors
2 *
3 * SPDX-License-Identifier: GPL-2.0-or-later */
4
8
9#include <cstring>
10
12
13#include "MEM_guardedalloc.h"
14
15#include "BLT_translation.hh"
16
17#include "DNA_armature_types.h"
18
19#include "BKE_action.hh"
20#include "BKE_anim_data.hh"
21#include "BKE_animsys.h"
22#include "BKE_armature.hh"
23#include "BKE_context.hh"
24#include "BKE_lib_id.hh"
25#include "BKE_object.hh"
26#include "BKE_pose_backup.h"
27#include "BKE_report.hh"
28
29#include "DEG_depsgraph.hh"
30
31#include "RNA_access.hh"
32#include "RNA_define.hh"
33#include "RNA_prototypes.hh"
34
35#include "WM_api.hh"
36#include "WM_types.hh"
37
38#include "UI_interface.hh"
39
40#include "ED_asset.hh"
41#include "ED_keyframing.hh"
42#include "ED_screen.hh"
43#include "ED_util.hh"
44
45#include "ANIM_action.hh"
46#include "ANIM_action_legacy.hh"
47#include "ANIM_armature.hh"
48#include "ANIM_keyframing.hh"
49#include "ANIM_keyingsets.hh"
50#include "ANIM_pose.hh"
51#include "ANIM_rna.hh"
52
53#include "armature_intern.hh"
54
62
66
67 struct {
70
72
73 /* For temp-loading the Action from the pose library. */
74 AssetTempIDConsumer *temp_id_consumer;
75
76 /* Blend factor for interpolating between current and given pose.
77 * 1.0 means "100% pose asset". Negative values and values > 1.0 will be used as-is, and can
78 * cause interesting effects. */
82
83 blender::Vector<Object *> objects; /* Objects to work on. */
84 bAction *act; /* Pose to blend into the current pose. */
85 bAction *act_flipped; /* Flipped copy of `act`. */
86
87 Scene *scene; /* For auto-keying. */
88 ScrArea *area; /* For drawing status text. */
89
90 tSlider *slider; /* Slider UI and event handling. */
91
94};
95
101{
102 return pbd->is_flipped ? pbd->act_flipped : pbd->act;
103}
104
105/* Makes a copy of the current pose for restoration purposes - doesn't do constraints currently */
107{
108 bAction *action = poselib_action_to_blend(pbd);
110
111 if (pbd->state == POSE_BLEND_INIT) {
112 /* Ready for blending now. */
114 }
115}
116
117/* ---------------------------- */
118
119/* Auto-key/tag bones affected by the pose Action. */
121{
122 for (Object *ob : pbd->objects) {
124 return;
125 }
126
127 AnimData *adt = BKE_animdata_from_id(&ob->id);
128 if (adt != nullptr && adt->action != nullptr &&
130 {
131 /* Changes to linked-in Actions are not allowed. */
132 return;
133 }
134
135 bPose *pose = ob->pose;
137 const bArmature *armature = static_cast<const bArmature *>(ob->data);
138
140 act->wrap());
141
142 /* Storing which pose bones were already keyed since multiple FCurves will probably exist per
143 * pose bone. */
144 blender::Set<bPoseChannel *> keyed_pose_bones;
145 auto autokey_pose_bones = [&](FCurve * /* fcu */, const char *bone_name) {
146 bPoseChannel *pchan = BKE_pose_channel_find_name(pose, bone_name);
147 if (!pchan) {
148 /* This bone cannot be found any more. This is fine, this can happen
149 * when F-Curves for a bone are included in a pose asset, and later the
150 * bone itself was renamed or removed. */
151 return;
152 }
154 !PBONE_SELECTED(armature, pchan->bone))
155 {
156 return;
157 }
158 if (keyed_pose_bones.contains(pchan)) {
159 return;
160 }
161 /* This mimics the Whole Character Keying Set that was used here previously. In the future we
162 * could only key rna paths of FCurves that are actually in the applied pose. */
163 PointerRNA pose_bone_pointer = RNA_pointer_create_discrete(&ob->id, &RNA_PoseBone, pchan);
165 pose_bone_pointer);
166 rna_paths.append({"location"});
168 eRotationModes(pchan->rotmode));
169 rna_paths.append({rotation_mode_path});
170 rna_paths.append({"scale"});
171 blender::animrig::autokeyframe_pose_channel(C, scene, ob, pchan, rna_paths, 0);
172 keyed_pose_bones.add(pchan);
173 };
174 blender::bke::BKE_action_find_fcurves_with_bones(act, slot.handle, autokey_pose_bones);
175 }
176
177 /* send notifiers for this */
179}
180
181/* Apply the relevant changes to the pose */
183{
184 PoseBlendData *pbd = static_cast<PoseBlendData *>(op->customdata);
185
186 if (!pbd->needs_redraw) {
187 return;
188 }
189 pbd->needs_redraw = false;
190
192
193 /* The pose needs updating, whether it's for restoring the original pose or for showing the
194 * result of the blend. */
195 for (Object *ob : pbd->objects) {
198 }
199
200 if (pbd->state != POSE_BLEND_BLENDING) {
201 return;
202 }
203
204 /* Perform the actual blending. */
207 blender::animrig::Action &pose_action = poselib_action_to_blend(pbd)->wrap();
208 if (pose_action.slot_array_num == 0) {
209 return;
210 }
211
213 pbd->objects, pose_action, &anim_eval_context, pbd->blend_factor);
214}
215
216/* ---------------------------- */
217
218static void poselib_blend_set_factor(PoseBlendData *pbd, const float new_factor)
219{
220 pbd->blend_factor = new_factor;
221 pbd->needs_redraw = true;
222}
223
225{
226 /* The pose will toggle between flipped and normal. This means the pose
227 * backup has to change, as it only contains the bones for one side. */
230
231 pbd->is_flipped = !pbd->is_flipped;
232 pbd->needs_redraw = true;
233
235}
236
237/* Return operator return value. */
239 wmOperator *op,
240 const wmEvent *event)
241{
242 PoseBlendData *pbd = static_cast<PoseBlendData *>(op->customdata);
243
244 ED_slider_modal(pbd->slider, event);
245 const float factor = ED_slider_factor_get(pbd->slider);
246 poselib_blend_set_factor(pbd, factor);
247
248 if (event->type == MOUSEMOVE) {
250 }
251
252 /* Handle the release confirm event directly, it has priority over others. */
254 (event->type == pbd->release_confirm_info.init_event_type) && (event->val == KM_RELEASE))
255 {
258 }
259
260 /* Ctrl manages the 'flipped' state. It works as a toggle so if the operator started in flipped
261 * mode, pressing it will unflip the pose. */
262 if (ELEM(event->val, KM_PRESS, KM_RELEASE) &&
264 {
266 }
267
268 /* only accept 'press' event, and ignore 'release', so that we don't get double actions */
269 if (ELEM(event->val, KM_PRESS, KM_NOTHING) == 0) {
271 }
272
273 /* NORMAL EVENT HANDLING... */
274 /* searching takes priority over normal activity */
275 switch (event->type) {
276 /* Exit - cancel. */
277 case EVT_ESCKEY:
278 case RIGHTMOUSE:
280 break;
281
282 /* Exit - confirm. */
283 case LEFTMOUSE:
284 case EVT_RETKEY:
285 case EVT_PADENTER:
286 case EVT_SPACEKEY:
288 break;
289
290 /* TODO(Sybren): toggle between original pose and poselib pose. */
291 case EVT_TABKEY:
293 pbd->needs_redraw = true;
294 break;
295 default: {
296 break;
297 }
298 }
299
301}
302
303/* ---------------------------- */
304
306{
307 blender::Vector<PointerRNA> selected_objects;
308 CTX_data_selected_objects(&C, &selected_objects);
309
310 blender::Vector<Object *> selected_pose_objects;
311 for (const PointerRNA &ptr : selected_objects) {
312 Object *object = reinterpret_cast<Object *>(ptr.owner_id);
313 if (!object || !object->pose) {
314 continue;
315 }
316 selected_pose_objects.append(object);
317 }
318
319 Object *active_object = CTX_data_active_object(&C);
320 /* The active object may not be selected, it should be added because you can still switch to pose
321 * mode. */
322 if (active_object && active_object->pose && !selected_pose_objects.contains(active_object)) {
323 selected_pose_objects.append(active_object);
324 }
325 return selected_pose_objects;
326}
327
329{
330 using namespace blender::ed;
332}
333
345
347{
348 bAction *action_copy = reinterpret_cast<bAction *>(
349 BKE_id_copy_ex(nullptr, &action->id, nullptr, LIB_ID_COPY_LOCALIZE));
350
351 /* Lock the window manager while flipping the pose. Flipping requires temporarily modifying the
352 * pose, which can cause unwanted visual glitches. */
354 const bool interface_was_locked = CTX_wm_interface_locked(C);
356
357 BKE_action_flip_with_pose(action_copy, objects);
358
359 WM_set_locked_interface(wm, interface_was_locked);
360 return action_copy;
361}
362
363/* Return true on success, false if the context isn't suitable. */
364static bool poselib_blend_init_data(bContext *C, wmOperator *op, const wmEvent *event)
365{
366 op->customdata = nullptr;
367
368 /* check if valid poselib */
369 blender::Vector<Object *> selected_pose_objects = get_poselib_objects(*C);
370 if (selected_pose_objects.is_empty()) {
371 BKE_report(op->reports, RPT_ERROR, "Pose lib is only for armatures in pose mode");
372 return false;
373 }
374
375 /* Set up blend state info. */
376 PoseBlendData *pbd;
377 op->customdata = pbd = MEM_new<PoseBlendData>("PoseLib Preview Data");
378
380 if (pbd->act == nullptr) {
381 return false;
382 }
383 if (pbd->act->wrap().slots().size() == 0) {
384 BKE_report(op->reports, RPT_ERROR, "This pose asset is empty, and thus has no pose");
385 return false;
386 }
387
388 pbd->is_flipped = RNA_boolean_get(op->ptr, "flipped");
389 pbd->blend_factor = RNA_float_get(op->ptr, "blend_factor");
390
391 /* Only construct the flipped pose if there is a chance it's actually needed. */
392 const bool is_interactive = (event != nullptr);
393 if (is_interactive || pbd->is_flipped) {
394 pbd->act_flipped = flip_pose(C, selected_pose_objects, pbd->act);
395 }
396
397 /* Get the basic data. */
398 pbd->objects = selected_pose_objects;
399
400 pbd->scene = CTX_data_scene(C);
401 pbd->area = CTX_wm_area(C);
402
403 pbd->state = POSE_BLEND_INIT;
404 pbd->needs_redraw = true;
405
406 /* Just to avoid a clang-analyzer warning (false positive), it's set properly below. */
408
409 /* Release confirm data. Only available if there's an event to work with. */
410 if (is_interactive) {
411 PropertyRNA *release_confirm_prop = RNA_struct_find_property(op->ptr, "release_confirm");
412 if (release_confirm_prop && RNA_property_is_set(op->ptr, release_confirm_prop)) {
414 op->ptr, release_confirm_prop);
415 }
416 else {
418 }
419
420 pbd->slider = ED_slider_create(C);
421 ED_slider_init(pbd->slider, event);
423 ED_slider_allow_overshoot_set(pbd->slider, true, true);
426 }
427
429 BLI_assert(is_interactive);
431 event->type);
432 }
433
434 /* Make backups for blending and restoring the pose. */
436
437 /* Set pose flags to ensure the depsgraph evaluation doesn't overwrite it. */
438 for (Object *ob : selected_pose_objects) {
439 ob->pose->flag &= ~POSE_DO_UNLOCK;
440 ob->pose->flag |= POSE_LOCKED;
441 }
442
443 return true;
444}
445
447{
448 PoseBlendData *pbd = static_cast<PoseBlendData *>(op->customdata);
449 wmWindow *win = CTX_wm_window(C);
450
451 /* Redraw the header so that it doesn't show any of our stuff anymore. */
452 ED_area_status_text(pbd->area, nullptr);
453 ED_workspace_status_text(C, nullptr);
454
455 if (pbd->slider) {
457 }
458
459 /* This signals the depsgraph to unlock and reevaluate the pose on the next evaluation. */
460 for (Object *ob : pbd->objects) {
461 bPose *pose = ob->pose;
462 pose->flag |= POSE_DO_UNLOCK;
463 }
464
465 switch (pbd->state) {
466 case POSE_BLEND_CONFIRM: {
467 Scene *scene = pbd->scene;
468 poselib_keytag_pose(C, scene, pbd);
469
470 /* Ensure the redo panel has the actually-used value, instead of the initial value. */
471 RNA_float_set(op->ptr, "blend_factor", pbd->blend_factor);
472 RNA_boolean_set(op->ptr, "flipped", pbd->is_flipped);
473 break;
474 }
475
476 case POSE_BLEND_INIT:
479 /* Cleanup should not be called directly from these states. */
480 BLI_assert_msg(0, "poselib_blend_cleanup: unexpected pose blend state");
481 BKE_report(op->reports, RPT_ERROR, "Internal pose library error, canceling operator");
485 break;
486 }
487
488 for (Object *ob : pbd->objects) {
491 }
492 /* Update mouse-hover highlights. */
494}
495
497{
498 PoseBlendData *pbd = static_cast<PoseBlendData *>(op->customdata);
499 if (pbd == nullptr) {
500 return;
501 }
502
503 if (pbd->act_flipped) {
504 BKE_id_free(nullptr, pbd->act_flipped);
505 }
507
508 /* Free temp data for operator */
510 pbd->pose_backup = nullptr;
511
512 MEM_delete(pbd);
513}
514
516{
517 PoseBlendData *pbd = static_cast<PoseBlendData *>(op->customdata);
518 const ePoseBlendState exit_state = pbd->state;
519
522
523 wmWindow *win = CTX_wm_window(C);
525
526 if (exit_state == POSE_BLEND_CANCEL) {
527 return OPERATOR_CANCELLED;
528 }
529 return OPERATOR_FINISHED;
530}
531
532/* Cancel previewing operation (called when exiting Blender) */
534{
535 PoseBlendData *pbd = static_cast<PoseBlendData *>(op->customdata);
538}
539
540/* Main modal status check. */
542{
543 const wmOperatorStatus operator_result = poselib_blend_handle_event(C, op, event);
544
545 const PoseBlendData *pbd = static_cast<const PoseBlendData *>(op->customdata);
547 return poselib_blend_exit(C, op);
548 }
549
550 if (pbd->needs_redraw) {
551
552 WorkspaceStatus status(C);
553
554 if (pbd->state == POSE_BLEND_BLENDING) {
555 status.item(IFACE_("Show Original Pose"), ICON_EVENT_TAB);
556 }
557 else {
558 status.item(IFACE_("Show Blended Pose"), ICON_EVENT_TAB);
559 }
560
561 ED_slider_status_get(pbd->slider, status);
562
563 status.item_bool(IFACE_("Flip Pose"), pbd->is_flipped, ICON_EVENT_CTRL);
564
566 }
567
568 return operator_result;
569}
570
571/* Modal Operator init. */
573{
574 if (!poselib_blend_init_data(C, op, event)) {
576 return OPERATOR_CANCELLED;
577 }
578
579 wmWindow *win = CTX_wm_window(C);
581
582 /* Do initial apply to have something to look at. */
584
587}
588
589/* Single-shot apply. */
591{
592 if (!poselib_blend_init_data(C, op, nullptr)) {
594 return OPERATOR_CANCELLED;
595 }
596
598
599 PoseBlendData *pbd = static_cast<PoseBlendData *>(op->customdata);
601 return poselib_blend_exit(C, op);
602}
603
605{
606 /* Check whether the context provides the asset data needed to add a pose. */
608 return asset && (asset->get_id_type() == ID_AC);
609}
610
611/* Poll callback for operators that require existing PoseLib data (with poses) to work. */
613{
614 blender::Span<Object *> selected_pose_objects = get_poselib_objects(*C);
615 if (selected_pose_objects.is_empty()) {
616 /* Pose lib is only for armatures in pose mode. */
617 return false;
618 }
619
621}
622
624{
625 PropertyRNA *prop;
626
627 /* Identifiers: */
628 ot->name = "Apply Pose Asset";
629 ot->idname = "POSELIB_OT_apply_pose_asset";
630 ot->description = "Apply the given Pose Action to the rig";
631
632 /* Callbacks: */
633 ot->exec = poselib_blend_exec;
634 ot->poll = poselib_blend_poll;
635
636 /* Flags: */
638
639 /* Properties: */
641 "blend_factor",
642 1.0f,
643 -FLT_MAX,
644 FLT_MAX,
645 "Blend Factor",
646 "Amount that the pose is applied on top of the existing poses. A negative "
647 "value will subtract the pose instead of adding it",
648 -1.0f,
649 1.0f);
650 prop = RNA_def_boolean(ot->srna,
651 "flipped",
652 false,
653 "Apply Flipped",
654 "When enabled, applies the pose flipped over the X-axis");
656}
657
659{
660 PropertyRNA *prop;
661
662 /* Identifiers: */
663 ot->name = "Blend Pose Asset";
664 ot->idname = "POSELIB_OT_blend_pose_asset";
665 ot->description = "Blend the given Pose Action to the rig";
666
667 /* Callbacks: */
668 ot->invoke = poselib_blend_invoke;
669 ot->modal = poselib_blend_modal;
670 ot->cancel = poselib_blend_cancel;
671 ot->exec = poselib_blend_exec;
672 ot->poll = poselib_blend_poll;
673
674 /* Flags: */
676
677 /* Properties: */
678 prop = RNA_def_float_factor(ot->srna,
679 "blend_factor",
680 0.0f,
681 -FLT_MAX,
682 FLT_MAX,
683 "Blend Factor",
684 "Amount that the pose is applied on top of the existing poses. A "
685 "negative value will subtract the pose instead of adding it",
686 -1.0f,
687 1.0f);
688 /* Blending should always start at 0%, and not at whatever percentage was last used. This RNA
689 * property just exists for symmetry with the Apply operator (and thus simplicity of the rest of
690 * the code, which can assume this property exists). */
692
693 prop = RNA_def_boolean(ot->srna,
694 "flipped",
695 false,
696 "Apply Flipped",
697 "When enabled, applies the pose flipped over the X-axis");
699
700 prop = RNA_def_boolean(ot->srna,
701 "release_confirm",
702 false,
703 "Confirm on Release",
704 "Always confirm operation when releasing button");
706}
Functions and classes to work with Actions.
Functions for backward compatibility with the legacy Action API.
Functions to deal with Armatures.
Functions to insert, delete or modify keyframes.
Functionality to interact with keying sets.
Functions to work with animation poses.
Helper functions for animation to interact with the RNA system.
Main runtime representation of an asset.
Blender kernel action and pose functionality.
void void void void void BKE_action_flip_with_pose(bAction *act, blender::Span< Object * > objects) ATTR_NONNULL(1)
bPoseChannel * BKE_pose_channel_find_name(const bPose *pose, const char *name)
AnimData * BKE_animdata_from_id(const ID *id)
Definition anim_data.cc:82
AnimationEvalContext BKE_animsys_eval_context_construct(struct Depsgraph *depsgraph, float eval_time) ATTR_WARN_UNUSED_RESULT
Definition anim_sys.cc:735
#define PBONE_SELECTED(arm, bone)
bool CTX_wm_interface_locked(const bContext *C)
ScrArea * CTX_wm_area(const bContext *C)
wmWindow * CTX_wm_window(const bContext *C)
Depsgraph * CTX_data_depsgraph_pointer(const bContext *C)
Object * CTX_data_active_object(const bContext *C)
Scene * CTX_data_scene(const bContext *C)
class blender::asset_system::AssetRepresentation * CTX_wm_asset(const bContext *C)
bool CTX_data_selected_objects(const bContext *C, blender::Vector< PointerRNA > *list)
Main * CTX_data_main(const bContext *C)
wmWindowManager * CTX_wm_manager(const bContext *C)
bool BKE_id_is_editable(const Main *bmain, const ID *id)
Definition lib_id.cc:2503
void BKE_id_free(Main *bmain, void *idv)
@ LIB_ID_COPY_LOCALIZE
ID * BKE_id_copy_ex(Main *bmain, const ID *id, ID **new_id_p, int flag)
Definition lib_id.cc:767
General operations, lookup, etc. for blender objects.
struct PoseBackup * BKE_pose_backup_create_selected_bones(blender::Span< Object * > objects, const struct bAction *action) ATTR_WARN_UNUSED_RESULT
void BKE_pose_backup_restore(const struct PoseBackup *pbd)
bool BKE_pose_backup_is_selection_relevant(const struct PoseBackup *pose_backup)
void BKE_pose_backup_free(struct PoseBackup *pbd)
void BKE_report(ReportList *reports, eReportType type, const char *message)
Definition report.cc:126
#define BLI_assert(a)
Definition BLI_assert.h:46
#define BLI_assert_msg(a, msg)
Definition BLI_assert.h:53
#define ATTR_FALLTHROUGH
#define ELEM(...)
#define IFACE_(msgid)
void DEG_id_tag_update(ID *id, unsigned int flags)
@ ID_RECALC_GEOMETRY
Definition DNA_ID.h:982
@ ID_AC
eRotationModes
@ POSE_LOCKED
@ POSE_DO_UNLOCK
struct AssetRepresentationHandle AssetRepresentationHandle
@ OPERATOR_CANCELLED
@ OPERATOR_FINISHED
@ OPERATOR_RUNNING_MODAL
void ED_area_status_text(ScrArea *area, const char *str)
Definition area.cc:872
void ED_workspace_status_text(bContext *C, const char *str)
Definition area.cc:1040
void ED_slider_init(tSlider *slider, const wmEvent *event)
Definition ed_draw.cc:477
void ED_slider_allow_overshoot_set(tSlider *slider, bool lower, bool upper)
Definition ed_draw.cc:616
void ED_slider_destroy(bContext *C, tSlider *slider)
Definition ed_draw.cc:579
void ED_slider_allow_increments_set(tSlider *slider, bool value)
Definition ed_draw.cc:627
tSlider * ED_slider_create(bContext *C)
Definition ed_draw.cc:433
bool ED_slider_modal(tSlider *slider, const wmEvent *event)
Definition ed_draw.cc:482
void ED_slider_status_get(const tSlider *slider, WorkspaceStatus &status)
Definition ed_draw.cc:563
void ED_slider_factor_bounds_set(tSlider *slider, float factor_bound_lower, float factor_bound_upper)
Definition ed_draw.cc:632
float ED_slider_factor_get(const tSlider *slider)
Definition ed_draw.cc:592
void ED_slider_factor_set(tSlider *slider, float factor)
Definition ed_draw.cc:597
Read Guarded memory(de)allocation.
@ PROP_SKIP_SAVE
Definition RNA_types.hh:330
@ PROP_HIDDEN
Definition RNA_types.hh:324
#define C
Definition RandGen.cpp:29
#define UI_MAX_DRAW_STR
@ OPTYPE_BLOCKING
Definition WM_types.hh:184
@ OPTYPE_UNDO
Definition WM_types.hh:182
@ OPTYPE_REGISTER
Definition WM_types.hh:180
@ OPTYPE_GRAB_CURSOR_X
Definition WM_types.hh:190
#define NC_ANIMATION
Definition WM_types.hh:385
#define ND_POSE
Definition WM_types.hh:455
#define NA_EDITED
Definition WM_types.hh:581
#define ND_KEYFRAME
Definition WM_types.hh:491
#define NC_OBJECT
Definition WM_types.hh:376
@ KM_NOTHING
Definition WM_types.hh:307
@ KM_PRESS
Definition WM_types.hh:308
@ KM_RELEASE
Definition WM_types.hh:309
BPy_StructRNA * depsgraph
void item_bool(std::string text, bool inverted, int icon1, int icon2=0)
Definition area.cc:995
void item(std::string text, int icon1, int icon2=0)
Definition area.cc:979
bool contains(const Key &key) const
Definition BLI_set.hh:310
bool add(const Key &key)
Definition BLI_set.hh:248
constexpr bool is_empty() const
Definition BLI_span.hh:260
bool contains(const T &value) const
void append(const T &value)
bool is_empty() const
bool autokeyframe_cfra_can_key(const Scene *scene, ID *id)
Vector< RNAPath > get_keyable_id_property_paths(const PointerRNA &ptr)
Definition anim_rna.cc:126
void pose_apply_action(blender::Span< Object * > objects, Action &pose_action, const AnimationEvalContext *anim_eval_context, float blend_factor)
StringRef get_rotation_mode_path(eRotationModes rotation_mode)
Definition anim_rna.cc:82
Slot & get_best_pose_slot_for_id(const ID &id, Action &pose_data)
Definition pose.cc:161
void autokeyframe_pose_channel(bContext *C, Scene *scene, Object *ob, bPoseChannel *pose_channel, Span< RNAPath > rna_paths, short targetless_ik)
void BKE_action_find_fcurves_with_bones(bAction *action, blender::animrig::slot_handle_t slot_handle, FoundFCurveCallback callback)
AssetTempIDConsumer * temp_id_consumer_create(const blender::asset_system::AssetRepresentation *asset)
ID * temp_id_consumer_ensure_local_id(AssetTempIDConsumer *consumer, ID_Type id_type, Main *bmain, ReportList *reports)
void temp_id_consumer_free(AssetTempIDConsumer **consumer)
static bool poselib_asset_in_context(bContext *C)
static wmOperatorStatus poselib_blend_exit(bContext *C, wmOperator *op)
static wmOperatorStatus poselib_blend_modal(bContext *C, wmOperator *op, const wmEvent *event)
static bAction * poselib_action_to_blend(PoseBlendData *pbd)
static wmOperatorStatus poselib_blend_handle_event(bContext *, wmOperator *op, const wmEvent *event)
static void poselib_blend_cleanup(bContext *C, wmOperator *op)
static bool poselib_blend_poll(bContext *C)
static void poselib_blend_cancel(bContext *C, wmOperator *op)
static void poselib_blend_apply(bContext *C, wmOperator *op)
void POSELIB_OT_apply_pose_asset(wmOperatorType *ot)
static wmOperatorStatus poselib_blend_invoke(bContext *C, wmOperator *op, const wmEvent *event)
static bAction * poselib_blend_init_get_action(bContext *C, wmOperator *op)
static void poselib_tempload_exit(PoseBlendData *pbd)
static void poselib_backup_posecopy(PoseBlendData *pbd)
static void poselib_keytag_pose(bContext *C, Scene *scene, PoseBlendData *pbd)
static void poselib_blend_free(wmOperator *op)
void POSELIB_OT_blend_pose_asset(wmOperatorType *ot)
static wmOperatorStatus poselib_blend_exec(bContext *C, wmOperator *op)
static void poselib_blend_set_factor(PoseBlendData *pbd, const float new_factor)
static blender::Vector< Object * > get_poselib_objects(bContext &C)
static bool poselib_blend_init_data(bContext *C, wmOperator *op, const wmEvent *event)
static bAction * flip_pose(bContext *C, blender::Span< Object * > objects, bAction *action)
static void poselib_toggle_flipped(PoseBlendData *pbd)
ePoseBlendState
Definition pose_lib_2.cc:55
@ POSE_BLEND_CANCEL
Definition pose_lib_2.cc:60
@ POSE_BLEND_CONFIRM
Definition pose_lib_2.cc:59
@ POSE_BLEND_ORIGINAL
Definition pose_lib_2.cc:58
@ POSE_BLEND_INIT
Definition pose_lib_2.cc:56
@ POSE_BLEND_BLENDING
Definition pose_lib_2.cc:57
PropertyRNA * RNA_struct_find_property(PointerRNA *ptr, const char *identifier)
void RNA_boolean_set(PointerRNA *ptr, const char *name, bool value)
bool RNA_property_is_set(PointerRNA *ptr, PropertyRNA *prop)
bool RNA_property_boolean_get(PointerRNA *ptr, PropertyRNA *prop)
float RNA_float_get(PointerRNA *ptr, const char *name)
void RNA_float_set(PointerRNA *ptr, const char *name, float value)
bool RNA_boolean_get(PointerRNA *ptr, const char *name)
PointerRNA RNA_pointer_create_discrete(ID *id, StructRNA *type, void *data)
PropertyRNA * RNA_def_float_factor(StructOrFunctionRNA *cont_, const char *identifier, const float default_value, const float hardmin, const float hardmax, const char *ui_name, const char *ui_description, const float softmin, const float softmax)
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)
#define FLT_MAX
Definition stdcycles.h:14
bAction * action
struct bPose * pose
PoseBackup * pose_backup
Definition pose_lib_2.cc:81
bAction * act_flipped
Definition pose_lib_2.cc:85
AssetTempIDConsumer * temp_id_consumer
Definition pose_lib_2.cc:74
Scene * scene
Definition pose_lib_2.cc:87
char headerstr[UI_MAX_DRAW_STR]
Definition pose_lib_2.cc:93
blender::Vector< Object * > objects
Definition pose_lib_2.cc:83
ScrArea * area
Definition pose_lib_2.cc:88
tSlider * slider
Definition pose_lib_2.cc:90
ePoseBlendState state
Definition pose_lib_2.cc:64
bool use_release_confirm
Definition pose_lib_2.cc:68
bAction * act
Definition pose_lib_2.cc:84
float blend_factor
Definition pose_lib_2.cc:79
struct PoseBlendData::@216165076114036054345200111212170037100004121231 release_confirm_info
struct Bone * bone
wmEventType type
Definition WM_types.hh:754
short val
Definition WM_types.hh:756
struct ReportList * reports
struct PointerRNA * ptr
void WM_cursor_modal_set(wmWindow *win, int val)
void WM_cursor_modal_restore(wmWindow *win)
@ WM_CURSOR_EW_SCROLL
Definition wm_cursors.hh:54
int WM_userdef_event_type_from_keymap_type(int kmitype)
wmEventHandler_Op * WM_event_add_modal_handler(bContext *C, wmOperator *op)
void WM_event_add_notifier(const bContext *C, uint type, void *reference)
void WM_set_locked_interface(wmWindowManager *wm, bool lock)
void WM_event_add_mousemove(wmWindow *win)
@ RIGHTMOUSE
@ EVT_RIGHTCTRLKEY
@ EVT_TABKEY
@ EVT_LEFTCTRLKEY
@ EVT_PADENTER
@ EVT_SPACEKEY
@ MOUSEMOVE
@ LEFTMOUSE
@ EVT_ESCKEY
@ EVT_RETKEY
PointerRNA * ptr
Definition wm_files.cc:4226
wmOperatorType * ot
Definition wm_files.cc:4225