Blender V5.3
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.hh"
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"
42#include "ED_keyframing.hh"
43#include "ED_screen.hh"
44#include "ED_util.hh"
45
46#include "ANIM_action.hh"
47#include "ANIM_action_legacy.hh"
48#include "ANIM_armature.hh"
49#include "ANIM_keyframing.hh"
50#include "ANIM_keyingsets.hh"
51#include "ANIM_pose.hh"
52#include "ANIM_rna.hh"
53
54#include "armature_intern.hh"
55
56namespace blender {
57
65
69
75
76 /* For temp-loading the Action from the pose library. */
77 AssetTempIDConsumer *temp_id_consumer;
78
79 /* Blend factor for interpolating between current and given pose.
80 * 1.0 means "100% pose asset". Negative values and values > 1.0 will be used as-is, and can
81 * cause interesting effects. */
85
86 Vector<Object *> objects; /* Objects to work on. */
87 bAction *act; /* Pose to blend into the current pose. */
88 bAction *act_flipped; /* Flipped copy of `act`. */
89
90 Scene *scene; /* For auto-keying. */
91 ScrArea *area; /* For drawing status text. */
92
93 tSlider *slider; /* Slider UI and event handling. */
94
97};
98
104{
105 return pbd->is_flipped ? pbd->act_flipped : pbd->act;
106}
107
108/* Makes a copy of the current pose for restoration purposes - doesn't do constraints currently */
110{
111 bAction *action = poselib_action_to_blend(pbd);
113
114 if (pbd->state == POSE_BLEND_INIT) {
115 /* Ready for blending now. */
117 }
118}
119
120/* ---------------------------- */
121
122/* Auto-key/tag bones affected by the pose Action. */
124{
125 for (Object *ob : pbd->objects) {
126 if (!animrig::autokeyframe_cfra_can_key(scene, &ob->id)) {
127 return;
128 }
129
130 AnimData *adt = BKE_animdata_from_id(&ob->id);
131 if (adt != nullptr && adt->action != nullptr &&
133 {
134 /* Changes to linked-in Actions are not allowed. */
135 return;
136 }
137
138 bPose *pose = ob->pose;
140 const bArmature *armature = id_cast<const bArmature *>(ob->data);
141
142 animrig::Slot &slot = animrig::get_best_pose_slot_for_id(ob->id, act->wrap());
143
144 /* Storing which pose bones were already keyed since multiple FCurves will probably exist per
145 * pose bone. */
146 Set<bPoseChannel *> keyed_pose_bones;
147 auto autokey_pose_bones = [&](FCurve * /* fcu */, const char *bone_name) {
148 bPoseChannel *pchan = BKE_pose_channel_find_name(pose, bone_name);
149 if (!pchan) {
150 /* This bone cannot be found any more. This is fine, this can happen
151 * when F-Curves for a bone are included in a pose asset, and later the
152 * bone itself was renamed or removed. */
153 return;
154 }
156 !animrig::bone_is_selected(armature, {pchan, pchan->bone_get(*ob)}))
157 {
158 return;
159 }
160 if (keyed_pose_bones.contains(pchan)) {
161 return;
162 }
163 /* This mimics the Whole Character Keying Set that was used here previously. In the future we
164 * could only key rna paths of FCurves that are actually in the applied pose. */
165 PointerRNA pose_bone_pointer = RNA_pointer_create_discrete(&ob->id, RNA_PoseBone, pchan);
166 Vector<RNAPath> rna_paths = animrig::get_keyable_id_property_paths(pose_bone_pointer);
167 rna_paths.append({"location"});
168 const StringRefNull rotation_mode_path = animrig::get_rotation_mode_path(
169 eRotationModes(pchan->rotmode));
170 rna_paths.append({rotation_mode_path});
171 rna_paths.append({"scale"});
172 animrig::autokeyframe_pose_channel(C, scene, ob, pchan, rna_paths, 0);
173 keyed_pose_bones.add(pchan);
174 };
175 bke::BKE_action_find_fcurves_with_bones(act, slot.handle, autokey_pose_bones);
176 }
177
178 /* Send notifiers for this. Auto-keying can create new animation data. */
180}
181
182/* Apply the relevant changes to the pose */
184{
185 PoseBlendData *pbd = static_cast<PoseBlendData *>(op->customdata);
186
187 if (!pbd->needs_redraw) {
188 return;
189 }
190 pbd->needs_redraw = false;
191
193
194 /* The pose needs updating, whether it's for restoring the original pose or for showing the
195 * result of the blend. */
196 for (Object *ob : pbd->objects) {
199 }
200
201 if (pbd->state != POSE_BLEND_BLENDING) {
202 return;
203 }
204
205 /* Perform the actual blending. */
206 Depsgraph *depsgraph = CTX_data_depsgraph_pointer(C);
207 AnimationEvalContext anim_eval_context = BKE_animsys_eval_context_construct(depsgraph, 0.0f);
208 animrig::Action &pose_action = poselib_action_to_blend(pbd)->wrap();
209 if (pose_action.slot_array_num == 0) {
210 return;
211 }
212
213 animrig::pose_apply_action(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. */
253 if (pbd->release_confirm_info.use_release_confirm &&
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 Vector<PointerRNA> selected_objects;
308 CTX_data_selected_objects(&C, &selected_objects);
309
310 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
335{
336 using namespace blender::ed;
337
339
342 *C, *op->ptr, op->reports);
343 if (!asset) {
344 /* Explicit asset reference passed, but cannot be found. Error out. */
346 RPT_ERROR,
347 "Asset not found: '%s'",
348 RNA_string_get(op->ptr, "relative_asset_identifier").c_str());
349 return nullptr;
350 }
351 }
352 else {
353 /* If no explicit asset reference was passed, get asset from context. */
355 if (!asset) {
356 BKE_report(op->reports, RPT_ERROR, "No asset in context");
357 return nullptr;
358 }
359 }
360
361 if (asset->get_id_type() != ID_AC) {
363 RPT_ERROR,
364 "Asset ('%s') is not an action data-block",
365 asset->get_name().c_str());
366 return nullptr;
367 }
368
369 if (asset->is_online_only()) {
371 RPT_ERROR,
372 "Pose '%s' needs downloading before it can be applied (check context menu)",
373 asset->get_name().c_str());
374 return nullptr;
375 }
376
377 PoseBlendData *pbd = static_cast<PoseBlendData *>(op->customdata);
378
380 return reinterpret_cast<bAction *>(asset::temp_id_consumer_ensure_local_id(
382}
383
385{
386 bAction *action_copy = reinterpret_cast<bAction *>(
387 BKE_id_copy_ex(nullptr, &action->id, nullptr, LIB_ID_COPY_LOCALIZE));
388
389 /* Lock the window manager while flipping the pose. Flipping requires temporarily modifying the
390 * pose, which can cause unwanted visual glitches. */
392 const bool interface_was_locked = CTX_wm_interface_locked(C);
394
395 BKE_action_flip_with_pose(action_copy, objects);
396
397 WM_locked_interface_set(wm, interface_was_locked);
398 return action_copy;
399}
400
401/* Return true on success, false if the context isn't suitable. */
402static bool poselib_blend_init_data(bContext *C, wmOperator *op, const wmEvent *event)
403{
404 op->customdata = nullptr;
405
406 /* check if valid poselib */
407 Vector<Object *> selected_pose_objects = get_poselib_objects(*C);
408 if (selected_pose_objects.is_empty()) {
409 BKE_report(op->reports, RPT_ERROR, "Pose lib is only for armatures in pose mode");
410 return false;
411 }
412
413 /* Set up blend state info. */
414 PoseBlendData *pbd;
415 op->customdata = pbd = MEM_new<PoseBlendData>("PoseLib Preview Data");
416
418 if (pbd->act == nullptr) {
419 /* No report here. The poll function cannot check if the operator properties have an asset
420 * reference to determine the asset to operate on, in which case we fallback to getting the
421 * asset from context. */
422 return false;
423 }
424 if (pbd->act->wrap().slots().size() == 0) {
425 BKE_report(op->reports, RPT_ERROR, "This pose asset is empty, and thus has no pose");
426 return false;
427 }
428
429 pbd->is_flipped = RNA_struct_property_is_set(op->ptr, "flipped") ?
430 RNA_boolean_get(op->ptr, "flipped") :
431 (event && (event->modifier & KM_CTRL));
432 pbd->blend_factor = RNA_float_get(op->ptr, "blend_factor");
433
434 /* Only construct the flipped pose if there is a chance it's actually needed. */
435 const bool is_interactive = (event != nullptr);
436 if (is_interactive || pbd->is_flipped) {
437 pbd->act_flipped = flip_pose(C, selected_pose_objects, pbd->act);
438 }
439
440 /* Get the basic data. */
441 pbd->objects = selected_pose_objects;
442
443 pbd->scene = CTX_data_scene(C);
444 pbd->area = CTX_wm_area(C);
445
446 pbd->state = POSE_BLEND_INIT;
447 pbd->needs_redraw = true;
448
449 /* Just to avoid a clang-analyzer warning (false positive), it's set properly below. */
450 pbd->release_confirm_info.use_release_confirm = false;
451
452 /* Release confirm data. Only available if there's an event to work with. */
453 if (is_interactive) {
454 PropertyRNA *release_confirm_prop = RNA_struct_find_property(op->ptr, "release_confirm");
455 if (release_confirm_prop && RNA_property_is_set(op->ptr, release_confirm_prop)) {
456 pbd->release_confirm_info.use_release_confirm = RNA_property_boolean_get(
457 op->ptr, release_confirm_prop);
458 }
459 else {
460 pbd->release_confirm_info.use_release_confirm = event->val != KM_RELEASE;
461 }
462
463 pbd->slider = ED_slider_create(C);
464 ED_slider_init(pbd->slider, event);
466 ED_slider_allow_overshoot_set(pbd->slider, true, true);
469 }
470
471 if (pbd->release_confirm_info.use_release_confirm) {
472 BLI_assert(is_interactive);
474 event->type);
475 }
476
477 /* Make backups for blending and restoring the pose. */
479
480 return true;
481}
482
484{
485 PoseBlendData *pbd = static_cast<PoseBlendData *>(op->customdata);
486 wmWindow *win = CTX_wm_window(C);
487
488 /* Redraw the header so that it doesn't show any of our stuff anymore. */
489 ED_area_status_text(pbd->area, nullptr);
490 ED_workspace_status_text(C, nullptr);
491
492 if (pbd->slider) {
494 }
495
496 switch (pbd->state) {
497 case POSE_BLEND_CONFIRM: {
498 Scene *scene = pbd->scene;
499 poselib_keytag_pose(C, scene, pbd);
500
501 /* Ensure the redo panel has the actually-used value, instead of the initial value. */
502 RNA_float_set(op->ptr, "blend_factor", pbd->blend_factor);
503 RNA_boolean_set(op->ptr, "flipped", pbd->is_flipped);
504 break;
505 }
506
507 case POSE_BLEND_INIT:
510 /* Cleanup should not be called directly from these states. */
511 BLI_assert_msg(0, "poselib_blend_cleanup: unexpected pose blend state");
512 BKE_report(op->reports, RPT_ERROR, "Internal pose library error, canceling operator");
516 break;
517 }
518
519 for (Object *ob : pbd->objects) {
522 }
523 /* Update mouse-hover highlights. */
525}
526
528{
529 PoseBlendData *pbd = static_cast<PoseBlendData *>(op->customdata);
530 if (pbd == nullptr) {
531 return;
532 }
533
534 if (pbd->act_flipped) {
535 BKE_id_free(nullptr, pbd->act_flipped);
536 }
538
539 /* Free temp data for operator */
541 pbd->pose_backup = nullptr;
542
543 MEM_delete(pbd);
544}
545
547{
548 PoseBlendData *pbd = static_cast<PoseBlendData *>(op->customdata);
549 const ePoseBlendState exit_state = pbd->state;
550
553
554 wmWindow *win = CTX_wm_window(C);
556
557 if (exit_state == POSE_BLEND_CANCEL) {
558 return OPERATOR_CANCELLED;
559 }
560 return OPERATOR_FINISHED;
561}
562
563/* Cancel previewing operation (called when exiting Blender) */
565{
566 PoseBlendData *pbd = static_cast<PoseBlendData *>(op->customdata);
569}
570
571/* Main modal status check. */
573{
574 const wmOperatorStatus operator_result = poselib_blend_handle_event(C, op, event);
575
576 const PoseBlendData *pbd = static_cast<const PoseBlendData *>(op->customdata);
578 return poselib_blend_exit(C, op);
579 }
580
581 if (pbd->needs_redraw) {
582
583 WorkspaceStatus status(C);
584
585 if (pbd->state == POSE_BLEND_BLENDING) {
586 status.item(IFACE_("Show Original Pose"), ICON_EVENT_TAB);
587 }
588 else {
589 status.item(IFACE_("Show Blended Pose"), ICON_EVENT_TAB);
590 }
591
592 ED_slider_status_get(pbd->slider, status);
593
594 status.item_bool(IFACE_("Flip Pose"), pbd->is_flipped, ICON_EVENT_CTRL);
595
597 }
598
599 return operator_result;
600}
601
603{
604 if (!poselib_blend_init_data(C, op, event)) {
606 return OPERATOR_CANCELLED;
607 }
608
610
611 PoseBlendData *pbd = static_cast<PoseBlendData *>(op->customdata);
613 return poselib_blend_exit(C, op);
614}
615
617{
618 return poselib_apply_invoke(C, op, nullptr);
619}
620
621/* Modal Operator init. */
623{
624 if (!poselib_blend_init_data(C, op, event)) {
626 return OPERATOR_CANCELLED;
627 }
628
629 wmWindow *win = CTX_wm_window(C);
631
632 /* Do initial apply to have something to look at. */
634
637}
638
639/* Single-shot apply. */
641{
642 return poselib_apply_invoke(C, op, nullptr);
643}
644
645/* Poll callback for operators that require existing PoseLib data (with poses) to work. */
647{
648 Span<Object *> selected_pose_objects = get_poselib_objects(*C);
649 if (selected_pose_objects.is_empty()) {
650 /* Pose lib is only for armatures in pose mode. */
651 return false;
652 }
653
654 return true;
655}
656
657/* Operator properties can set an asset reference to determine the asset to operate on (the pose
658 * can then be applied via shortcut too, for example). If this isn't set, an active asset from
659 * context is queried. */
661{
662 PropertyRNA *prop;
663
664 /* Identifiers: */
665 ot->name = "Apply Pose Asset";
666 ot->idname = "POSELIB_OT_apply_pose_asset";
667 ot->description = "Apply the given Pose Action to the rig";
668
669 /* Callbacks: */
673
674 /* Flags: */
676
677 /* Properties: */
680 "blend_factor",
681 1.0f,
682 -FLT_MAX,
683 FLT_MAX,
684 "Blend Factor",
685 "Amount that the pose is applied on top of the existing poses. A negative "
686 "value will subtract the pose instead of adding it",
687 -1.0f,
688 1.0f);
689 prop = RNA_def_boolean(ot->srna,
690 "flipped",
691 false,
692 "Apply Flipped",
693 "When enabled, applies the pose flipped over the X-axis");
695}
696
697/* See comment on #POSELIB_OT_apply_pose_asset. */
699{
700 PropertyRNA *prop;
701
702 /* Identifiers: */
703 ot->name = "Blend Pose Asset";
704 ot->idname = "POSELIB_OT_blend_pose_asset";
705 ot->description = "Blend the given Pose Action to the rig";
706
707 /* Callbacks: */
713
714 /* Flags: */
716
717 /* Properties: */
719 prop = RNA_def_float_factor(ot->srna,
720 "blend_factor",
721 0.0f,
722 -FLT_MAX,
723 FLT_MAX,
724 "Blend Factor",
725 "Amount that the pose is applied on top of the existing poses. A "
726 "negative value will subtract the pose instead of adding it",
727 -1.0f,
728 1.0f);
729 /* Blending should always start at 0%, and not at whatever percentage was last used. This RNA
730 * property just exists for symmetry with the Apply operator (and thus simplicity of the rest of
731 * the code, which can assume this property exists). */
733
734 prop = RNA_def_boolean(ot->srna,
735 "flipped",
736 false,
737 "Apply Flipped",
738 "When enabled, applies the pose flipped over the X-axis");
740
741 prop = RNA_def_boolean(ot->srna,
742 "release_confirm",
743 false,
744 "Confirm on Release",
745 "Always confirm operation when releasing button");
747}
748
749} // namespace blender
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.
General operations, lookup, etc. for blender objects.
#define ATTR_FALLTHROUGH
#define IFACE_(msgid)
Read Blender memory allocation and freeing.
#define C
Definition RandGen.cpp:29
#define UI_MAX_DRAW_STR
#define NC_ANIMATION
Definition WM_types.hh:401
#define NA_ADDED
Definition WM_types.hh:636
#define ND_POSE
Definition WM_types.hh:482
#define ND_KEYFRAME
Definition WM_types.hh:537
#define NC_OBJECT
Definition WM_types.hh:392
#define ELEM(...)
#define BLI_assert_msg(a, msg)
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:264
bool contains(const T &value) const
void append(const T &value)
bool is_empty() const
void item(std::string text, int icon1, int icon2=0)
Definition area.cc:1076
void item_bool(std::string text, bool inverted, int icon1, int icon2=0)
Definition area.cc:1097
#define FLT_MAX
bool autokeyframe_cfra_can_key(const Scene *scene, ID *id)
StringRefNull get_rotation_mode_path(eRotationModes rotation_mode)
Definition anim_rna.cc:109
void pose_apply_action(Span< Object * > objects, Action &pose_action, const AnimationEvalContext *anim_eval_context, float blend_factor)
Vector< RNAPath > get_keyable_id_property_paths(const PointerRNA &ptr)
Definition anim_rna.cc:202
bool bone_is_selected(const bArmature *armature, const Bone *bone)
Slot & get_best_pose_slot_for_id(const ID &id, Action &pose_data)
Definition pose.cc:471
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, animrig::slot_handle_t slot_handle, FoundFCurveCallback callback)
AssetTempIDConsumer * temp_id_consumer_create(const asset_system::AssetRepresentation *asset)
void operator_asset_reference_props_register(StructRNA &srna)
const asset_system::AssetRepresentation * operator_asset_reference_props_get_asset_from_all_library(const bContext &C, PointerRNA &ptr, ReportList *reports)
ID * temp_id_consumer_ensure_local_id(AssetTempIDConsumer *consumer, ID_Type id_type, Main *bmain, ReportList *reports)
bool operator_asset_reference_props_is_set(PointerRNA &ptr)
void temp_id_consumer_free(AssetTempIDConsumer **consumer)
BMesh Iterators.
static wmOperatorStatus poselib_apply_exec(bContext *C, wmOperator *op)
BLI_assert(slot->slot_subtype.map==BMO_OP_SLOT_SUBTYPE_MAP_FLT)
bool ED_slider_modal(tSlider *slider, const wmEvent *event)
Definition ed_draw.cc:492
ScrArea * CTX_wm_area(const bContext *C)
PropertyRNA * RNA_struct_find_property(PointerRNA *ptr, const char *identifier)
void ED_slider_init(tSlider *slider, const wmEvent *event)
Definition ed_draw.cc:487
Depsgraph * CTX_data_depsgraph_pointer(const bContext *C)
static bAction * poselib_action_to_blend(PoseBlendData *pbd)
class asset_system::AssetRepresentation * CTX_wm_asset(const bContext *C)
void BKE_pose_backup_restore(const struct PoseBackup *pbd)
void ED_slider_factor_set(tSlider *slider, float factor)
Definition ed_draw.cc:607
static void poselib_toggle_flipped(PoseBlendData *pbd)
static void poselib_blend_cleanup(bContext *C, wmOperator *op)
float ED_slider_factor_get(const tSlider *slider)
Definition ed_draw.cc:602
void WM_cursor_modal_set(wmWindow *win, int val)
@ POSE_BLEND_ORIGINAL
Definition pose_lib_2.cc:61
@ POSE_BLEND_INIT
Definition pose_lib_2.cc:59
@ POSE_BLEND_BLENDING
Definition pose_lib_2.cc:60
@ POSE_BLEND_CANCEL
Definition pose_lib_2.cc:63
@ POSE_BLEND_CONFIRM
Definition pose_lib_2.cc:62
static void poselib_blend_free(wmOperator *op)
static bAction * flip_pose(bContext *C, Span< Object * > objects, bAction *action)
static void poselib_blend_apply(bContext *C, wmOperator *op)
wmWindow * CTX_wm_window(const bContext *C)
static wmOperatorStatus poselib_blend_exit(bContext *C, wmOperator *op)
void void void void void BKE_action_flip_with_pose(bAction *act, Span< Object * > objects) ATTR_NONNULL(1)
@ LIB_ID_COPY_LOCALIZE
static wmOperatorStatus poselib_blend_exec(bContext *C, wmOperator *op)
void POSELIB_OT_blend_pose_asset(wmOperatorType *ot)
AnimationEvalContext BKE_animsys_eval_context_construct(Depsgraph *depsgraph, float eval_time) ATTR_WARN_UNUSED_RESULT
Definition anim_sys.cc:602
tSlider * ED_slider_create(bContext *C)
Definition ed_draw.cc:438
bool RNA_property_boolean_get(PointerRNA *ptr, PropertyRNA *prop)
void WM_locked_interface_set(wmWindowManager *wm, bool lock)
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)
AnimData * BKE_animdata_from_id(const ID *id)
Definition anim_data.cc:93
void ED_slider_allow_increments_set(tSlider *slider, bool value)
Definition ed_draw.cc:637
void DEG_id_tag_update(ID *id, unsigned int flags)
void BKE_report(ReportList *reports, eReportType type, const char *message)
Definition report.cc:162
static bool poselib_blend_poll(bContext *C)
wmWindowManager * CTX_wm_manager(const bContext *C)
static void poselib_keytag_pose(bContext *C, Scene *scene, PoseBlendData *pbd)
static wmOperatorStatus poselib_blend_invoke(bContext *C, wmOperator *op, const wmEvent *event)
void WM_cursor_modal_restore(wmWindow *win)
static Vector< Object * > get_poselib_objects(bContext &C)
bool RNA_struct_property_is_set(PointerRNA *ptr, const char *identifier)
PointerRNA RNA_pointer_create_discrete(ID *id, StructRNA *type, void *data)
void ED_area_status_text(ScrArea *area, const char *str)
Definition area.cc:975
static void poselib_tempload_exit(PoseBlendData *pbd)
static void poselib_blend_set_factor(PoseBlendData *pbd, const float new_factor)
bool RNA_boolean_get(PointerRNA *ptr, const char *name)
void BKE_id_free(Main *bmain, void *idv)
void WM_event_add_notifier(const bContext *C, uint type, void *reference)
void RNA_float_set(PointerRNA *ptr, const char *name, float value)
void RNA_boolean_set(PointerRNA *ptr, const char *name, bool value)
struct PoseBackup * BKE_pose_backup_create_selected_bones(Span< Object * > objects, const struct bAction *action) ATTR_WARN_UNUSED_RESULT
static bool poselib_blend_init_data(bContext *C, wmOperator *op, const wmEvent *event)
void ED_slider_allow_overshoot_set(tSlider *slider, bool lower, bool upper)
Definition ed_draw.cc:626
static void poselib_blend_cancel(bContext *C, wmOperator *op)
wmEventHandler_Op * WM_event_add_modal_handler(bContext *C, wmOperator *op)
void RNA_def_property_flag(PropertyRNA *prop, PropertyFlag flag)
void ED_slider_factor_bounds_set(tSlider *slider, float factor_bound_lower, float factor_bound_upper)
Definition ed_draw.cc:642
void BKE_reportf(ReportList *reports, eReportType type, const char *format,...) ATTR_PRINTF_FORMAT(3
Definition report.cc:191
@ WM_CURSOR_EW_SCROLL
Definition wm_cursors.hh:56
Main * CTX_data_main(const bContext *C)
void BKE_pose_backup_free(struct PoseBackup *pbd)
static wmOperatorStatus poselib_blend_handle_event(bContext *, wmOperator *op, const wmEvent *event)
@ ID_RECALC_GEOMETRY
Definition DNA_ID.h:1074
@ PROP_SKIP_SAVE
Definition RNA_types.hh:414
@ PROP_HIDDEN
Definition RNA_types.hh:408
void ED_slider_status_get(const tSlider *slider, WorkspaceStatus &status)
Definition ed_draw.cc:573
static wmOperatorStatus poselib_apply_invoke(bContext *C, wmOperator *op, const wmEvent *event)
@ KM_NOTHING
Definition WM_types.hh:323
@ KM_RELEASE
Definition WM_types.hh:325
Scene * CTX_data_scene(const bContext *C)
static bAction * poselib_blend_init_get_action(bContext *C, wmOperator *op)
@ OPTYPE_REGISTER
Definition WM_types.hh:188
@ OPTYPE_UNDO
Definition WM_types.hh:190
@ OPTYPE_BLOCKING
Definition WM_types.hh:192
@ OPTYPE_GRAB_CURSOR_X
Definition WM_types.hh:198
static wmOperatorStatus poselib_blend_modal(bContext *C, wmOperator *op, const wmEvent *event)
std::string RNA_string_get(PointerRNA *ptr, const char *name)
ID * BKE_id_copy_ex(Main *bmain, const ID *id, ID **new_id_p, int flag)
Definition lib_id.cc:851
bool CTX_data_selected_objects(const bContext *C, Vector< PointerRNA > *list)
PropertyRNA * RNA_def_boolean(StructOrFunctionRNA *cont_, const char *identifier, const bool default_value, const char *ui_name, const char *ui_description)
void WM_event_add_mousemove(wmWindow *win)
int WM_userdef_event_type_from_keymap_type(int kmitype)
bool CTX_wm_interface_locked(const bContext *C)
void POSELIB_OT_apply_pose_asset(wmOperatorType *ot)
bool BKE_id_is_editable(const Main *bmain, const ID *id)
Definition lib_id.cc:2782
static void poselib_backup_posecopy(PoseBlendData *pbd)
Object * CTX_data_active_object(const bContext *C)
void ED_workspace_status_text(bContext *C, const char *str)
Definition area.cc:1153
float RNA_float_get(PointerRNA *ptr, const char *name)
bPoseChannel * BKE_pose_channel_find_name(const bPose *pose, const char *name)
bool RNA_property_is_set(PointerRNA *ptr, PropertyRNA *prop)
void ED_slider_destroy(bContext *C, tSlider *slider)
Definition ed_draw.cc:589
bool BKE_pose_backup_is_selection_relevant(const struct PoseBackup *pose_backup)
struct bPose * pose
PoseBackup * pose_backup
Definition pose_lib_2.cc:84
char headerstr[UI_MAX_DRAW_STR]
Definition pose_lib_2.cc:96
ePoseBlendState state
Definition pose_lib_2.cc:67
AssetTempIDConsumer * temp_id_consumer
Definition pose_lib_2.cc:77
struct blender::PoseBlendData::@202016276230060133034117207351337027212247257316 release_confirm_info
Vector< Object * > objects
Definition pose_lib_2.cc:86
wmEventType type
Definition WM_types.hh:817
wmOperatorStatus(*) exec(bContext *C, wmOperator *op) ATTR_WARN_UNUSED_RESULT
Definition WM_types.hh:1125
const char * description
Definition WM_types.hh:1115
void(*) cancel(bContext *C, wmOperator *op)
Definition WM_types.hh:1149
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
wmOperatorStatus(*) modal(bContext *C, wmOperator *op, const wmEvent *event) ATTR_WARN_UNUSED_RESULT
Definition WM_types.hh:1157
struct ReportList * reports