Blender V4.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
9#include <cmath>
10#include <cstring>
11
13
14#include "MEM_guardedalloc.h"
15
16#include "BLI_string.h"
17
18#include "BLT_translation.hh"
19
20#include "DNA_armature_types.h"
21
22#include "BKE_action.hh"
23#include "BKE_anim_data.hh"
24#include "BKE_animsys.h"
25#include "BKE_armature.hh"
26#include "BKE_context.hh"
27#include "BKE_lib_id.hh"
28#include "BKE_object.hh"
29#include "BKE_pose_backup.h"
30#include "BKE_report.hh"
31
32#include "DEG_depsgraph.hh"
33
34#include "RNA_access.hh"
35#include "RNA_define.hh"
36#include "RNA_prototypes.hh"
37
38#include "WM_api.hh"
39#include "WM_types.hh"
40
41#include "UI_interface.hh"
42
43#include "ED_asset.hh"
44#include "ED_keyframing.hh"
45#include "ED_screen.hh"
46#include "ED_util.hh"
47
48#include "ANIM_action.hh"
49#include "ANIM_action_legacy.hh"
51#include "ANIM_keyframing.hh"
52#include "ANIM_keyingsets.hh"
53#include "ANIM_pose.hh"
54
55#include "armature_intern.hh"
56
64
68
69 struct {
72
74
75 /* For temp-loading the Action from the pose library. */
76 AssetTempIDConsumer *temp_id_consumer;
77
78 /* Blend factor for interpolating between current and given pose.
79 * 1.0 means "100% pose asset". Negative values and values > 1.0 will be used as-is, and can
80 * cause interesting effects. */
84
85 Object *ob; /* Object to work on. */
86 bAction *act; /* Pose to blend into the current pose. */
87 bAction *act_flipped; /* Flipped copy of `act`. */
88
89 Scene *scene; /* For auto-keying. */
90 ScrArea *area; /* For drawing status text. */
91
92 tSlider *slider; /* Slider UI and event handling. */
93
96};
97
103{
104 return pbd->is_flipped ? pbd->act_flipped : pbd->act;
105}
106
107/* Makes a copy of the current pose for restoration purposes - doesn't do constraints currently */
109{
110 const bAction *action = poselib_action_to_blend(pbd);
112
113 if (pbd->state == POSE_BLEND_INIT) {
114 /* Ready for blending now. */
116 }
117}
118
119/* ---------------------------- */
120
121/* Auto-key/tag bones affected by the pose Action. */
122static void poselib_keytag_pose(bContext *C, Scene *scene, PoseBlendData *pbd)
123{
125 return;
126 }
127
128 AnimData *adt = BKE_animdata_from_id(&pbd->ob->id);
129 if (adt != nullptr && adt->action != nullptr &&
131 {
132 /* Changes to linked-in Actions are not allowed. */
133 return;
134 }
135
136 bPose *pose = pbd->ob->pose;
138
141
142 /* start tagging/keying */
143 const bArmature *armature = static_cast<const bArmature *>(pbd->ob->data);
145 /* Only for selected bones unless there aren't any selected, in which case all are included. */
146 bPoseChannel *pchan = BKE_pose_channel_find_name(pose, agrp->name);
147 if (pchan == nullptr) {
148 continue;
149 }
150
152 !PBONE_SELECTED(armature, pchan->bone))
153 {
154 continue;
155 }
156
157 /* Add data-source override for the PoseChannel, to be used later. */
158 ANIM_relative_keyingset_add_source(sources, &pbd->ob->id, &RNA_PoseBone, pchan);
159 }
160
161 if (adt->action) {
163 }
164
165 /* Perform actual auto-keying. */
167 C, &sources, ks, blender::animrig::ModifyKeyMode::INSERT, float(scene->r.cfra));
168
169 /* send notifiers for this */
171}
172
173/* Apply the relevant changes to the pose */
175{
177
178 if (!pbd->needs_redraw) {
179 return;
180 }
181 pbd->needs_redraw = false;
182
184
185 /* The pose needs updating, whether it's for restoring the original pose or for showing the
186 * result of the blend. */
189
190 if (pbd->state != POSE_BLEND_BLENDING) {
191 return;
192 }
193
194 /* Perform the actual blending. */
197 bAction *to_blend = poselib_action_to_blend(pbd);
199 *to_blend);
200
202 pbd->ob, to_blend, to_blend_slot_handle, &anim_eval_context, pbd->blend_factor);
203}
204
205/* ---------------------------- */
206
207static void poselib_blend_set_factor(PoseBlendData *pbd, const float new_factor)
208{
209 pbd->blend_factor = new_factor;
210 pbd->needs_redraw = true;
211}
212
214{
215 /* The pose will toggle between flipped and normal. This means the pose
216 * backup has to change, as it only contains the bones for one side. */
219
220 pbd->is_flipped = !pbd->is_flipped;
221 pbd->needs_redraw = true;
222
224}
225
226/* Return operator return value. */
227static int poselib_blend_handle_event(bContext * /*C*/, wmOperator *op, const wmEvent *event)
228{
229 PoseBlendData *pbd = static_cast<PoseBlendData *>(op->customdata);
230
231 ED_slider_modal(pbd->slider, event);
232 const float factor = ED_slider_factor_get(pbd->slider);
233 poselib_blend_set_factor(pbd, factor);
234
235 if (event->type == MOUSEMOVE) {
237 }
238
239 /* Handle the release confirm event directly, it has priority over others. */
241 (event->type == pbd->release_confirm_info.init_event_type) && (event->val == KM_RELEASE))
242 {
245 }
246
247 /* Ctrl manages the 'flipped' state. It works as a toggle so if the operator started in flipped
248 * mode, pressing it will unflip the pose. */
249 if (ELEM(event->val, KM_PRESS, KM_RELEASE) &&
251 {
253 }
254
255 /* only accept 'press' event, and ignore 'release', so that we don't get double actions */
256 if (ELEM(event->val, KM_PRESS, KM_NOTHING) == 0) {
258 }
259
260 /* NORMAL EVENT HANDLING... */
261 /* searching takes priority over normal activity */
262 switch (event->type) {
263 /* Exit - cancel. */
264 case EVT_ESCKEY:
265 case RIGHTMOUSE:
267 break;
268
269 /* Exit - confirm. */
270 case LEFTMOUSE:
271 case EVT_RETKEY:
272 case EVT_PADENTER:
273 case EVT_SPACEKEY:
275 break;
276
277 /* TODO(Sybren): toggle between original pose and poselib pose. */
278 case EVT_TABKEY:
280 pbd->needs_redraw = true;
281 break;
282 }
283
285}
286
287/* ---------------------------- */
288
290{
291 if (C == nullptr) {
292 return nullptr;
293 }
295}
296
298{
299 using namespace blender::ed;
300 asset::temp_id_consumer_free(&pbd->temp_id_consumer);
301}
302
304{
305 using namespace blender::ed;
306 const AssetRepresentationHandle *asset = CTX_wm_asset(C);
307
308 PoseBlendData *pbd = static_cast<PoseBlendData *>(op->customdata);
309
310 pbd->temp_id_consumer = asset::temp_id_consumer_create(asset);
311 return (bAction *)asset::temp_id_consumer_ensure_local_id(
313}
314
315static bAction *flip_pose(bContext *C, Object *ob, bAction *action)
316{
317 bAction *action_copy = (bAction *)BKE_id_copy_ex(
318 nullptr, &action->id, nullptr, LIB_ID_COPY_LOCALIZE);
319
320 /* Lock the window manager while flipping the pose. Flipping requires temporarily modifying the
321 * pose, which can cause unwanted visual glitches. */
323 const bool interface_was_locked = CTX_wm_interface_locked(C);
324 WM_set_locked_interface(wm, true);
325
326 BKE_action_flip_with_pose(action_copy, ob);
327
328 WM_set_locked_interface(wm, interface_was_locked);
329 return action_copy;
330}
331
332/* Return true on success, false if the context isn't suitable. */
333static bool poselib_blend_init_data(bContext *C, wmOperator *op, const wmEvent *event)
334{
335 op->customdata = nullptr;
336
337 /* check if valid poselib */
338 Object *ob = get_poselib_object(C);
339 if (ELEM(nullptr, ob, ob->pose, ob->data)) {
340 BKE_report(op->reports, RPT_ERROR, "Pose lib is only for armatures in pose mode");
341 return false;
342 }
343
344 /* Set up blend state info. */
345 PoseBlendData *pbd;
346 op->customdata = pbd = static_cast<PoseBlendData *>(
347 MEM_callocN(sizeof(PoseBlendData), "PoseLib Preview Data"));
348
350 if (pbd->act == nullptr) {
351 return false;
352 }
353
354 pbd->is_flipped = RNA_boolean_get(op->ptr, "flipped");
355 pbd->blend_factor = RNA_float_get(op->ptr, "blend_factor");
356
357 /* Only construct the flipped pose if there is a chance it's actually needed. */
358 const bool is_interactive = (event != nullptr);
359 if (is_interactive || pbd->is_flipped) {
360 pbd->act_flipped = flip_pose(C, ob, pbd->act);
361 }
362
363 /* Get the basic data. */
364 pbd->ob = ob;
365 pbd->ob->pose = ob->pose;
366
367 pbd->scene = CTX_data_scene(C);
368 pbd->area = CTX_wm_area(C);
369
370 pbd->state = POSE_BLEND_INIT;
371 pbd->needs_redraw = true;
372
373 /* Just to avoid a clang-analyzer warning (false positive), it's set properly below. */
375
376 /* Release confirm data. Only available if there's an event to work with. */
377 if (is_interactive) {
378 PropertyRNA *release_confirm_prop = RNA_struct_find_property(op->ptr, "release_confirm");
379 if (release_confirm_prop && RNA_property_is_set(op->ptr, release_confirm_prop)) {
381 op->ptr, release_confirm_prop);
382 }
383 else {
385 }
386
387 pbd->slider = ED_slider_create(C);
388 ED_slider_init(pbd->slider, event);
390 ED_slider_allow_overshoot_set(pbd->slider, true, true);
393 }
394
396 BLI_assert(is_interactive);
398 event->type);
399 }
400
401 /* Make backups for blending and restoring the pose. */
403
404 /* Set pose flags to ensure the depsgraph evaluation doesn't overwrite it. */
405 pbd->ob->pose->flag &= ~POSE_DO_UNLOCK;
406 pbd->ob->pose->flag |= POSE_LOCKED;
407
408 return true;
409}
410
412{
413 PoseBlendData *pbd = static_cast<PoseBlendData *>(op->customdata);
414 wmWindow *win = CTX_wm_window(C);
415
416 /* Redraw the header so that it doesn't show any of our stuff anymore. */
417 ED_area_status_text(pbd->area, nullptr);
418 ED_workspace_status_text(C, nullptr);
419
420 if (pbd->slider) {
421 ED_slider_destroy(C, pbd->slider);
422 }
423
424 /* This signals the depsgraph to unlock and reevaluate the pose on the next evaluation. */
425 bPose *pose = pbd->ob->pose;
426 pose->flag |= POSE_DO_UNLOCK;
427
428 switch (pbd->state) {
429 case POSE_BLEND_CONFIRM: {
430 Scene *scene = pbd->scene;
431 poselib_keytag_pose(C, scene, pbd);
432
433 /* Ensure the redo panel has the actually-used value, instead of the initial value. */
434 RNA_float_set(op->ptr, "blend_factor", pbd->blend_factor);
435 RNA_boolean_set(op->ptr, "flipped", pbd->is_flipped);
436 break;
437 }
438
439 case POSE_BLEND_INIT:
442 /* Cleanup should not be called directly from these states. */
443 BLI_assert_msg(0, "poselib_blend_cleanup: unexpected pose blend state");
444 BKE_report(op->reports, RPT_ERROR, "Internal pose library error, canceling operator");
448 break;
449 }
450
453 /* Update mouse-hover highlights. */
455}
456
458{
459 PoseBlendData *pbd = static_cast<PoseBlendData *>(op->customdata);
460 if (pbd == nullptr) {
461 return;
462 }
463
464 if (pbd->act_flipped) {
465 BKE_id_free(nullptr, pbd->act_flipped);
466 }
468
469 /* Free temp data for operator */
471 pbd->pose_backup = nullptr;
472
474}
475
477{
478 PoseBlendData *pbd = static_cast<PoseBlendData *>(op->customdata);
479 const ePoseBlendState exit_state = pbd->state;
480
483
484 wmWindow *win = CTX_wm_window(C);
486
487 if (exit_state == POSE_BLEND_CANCEL) {
488 return OPERATOR_CANCELLED;
489 }
490 return OPERATOR_FINISHED;
491}
492
493/* Cancel previewing operation (called when exiting Blender) */
495{
496 PoseBlendData *pbd = static_cast<PoseBlendData *>(op->customdata);
498 poselib_blend_exit(C, op);
499}
500
501/* Main modal status check. */
502static int poselib_blend_modal(bContext *C, wmOperator *op, const wmEvent *event)
503{
504 const int operator_result = poselib_blend_handle_event(C, op, event);
505
506 const PoseBlendData *pbd = static_cast<const PoseBlendData *>(op->customdata);
508 return poselib_blend_exit(C, op);
509 }
510
511 if (pbd->needs_redraw) {
512 char status_string[UI_MAX_DRAW_STR];
513 char slider_string[UI_MAX_DRAW_STR];
514 char tab_string[50];
515
516 ED_slider_status_string_get(pbd->slider, slider_string, sizeof(slider_string));
517
518 if (pbd->state == POSE_BLEND_BLENDING) {
519 STRNCPY(tab_string, IFACE_("[Tab] - Show original pose"));
520 }
521 else {
522 STRNCPY(tab_string, IFACE_("[Tab] - Show blended pose"));
523 }
524
525 SNPRINTF(status_string, IFACE_("%s | %s | [Ctrl] - Flip Pose"), tab_string, slider_string);
526 ED_workspace_status_text(C, status_string);
527
528 poselib_blend_apply(C, op);
529 }
530
531 return operator_result;
532}
533
534/* Modal Operator init. */
535static int poselib_blend_invoke(bContext *C, wmOperator *op, const wmEvent *event)
536{
537 if (!poselib_blend_init_data(C, op, event)) {
539 return OPERATOR_CANCELLED;
540 }
541
542 wmWindow *win = CTX_wm_window(C);
544
545 /* Do initial apply to have something to look at. */
546 poselib_blend_apply(C, op);
547
550}
551
552/* Single-shot apply. */
554{
555 if (!poselib_blend_init_data(C, op, nullptr)) {
557 return OPERATOR_CANCELLED;
558 }
559
560 poselib_blend_apply(C, op);
561
562 PoseBlendData *pbd = static_cast<PoseBlendData *>(op->customdata);
564 return poselib_blend_exit(C, op);
565}
566
568{
569 /* Check whether the context provides the asset data needed to add a pose. */
570 const AssetRepresentationHandle *asset = CTX_wm_asset(C);
571 return asset && (asset->get_id_type() == ID_AC);
572}
573
574/* Poll callback for operators that require existing PoseLib data (with poses) to work. */
576{
577 Object *ob = get_poselib_object(C);
578 if (ELEM(nullptr, ob, ob->pose, ob->data)) {
579 /* Pose lib is only for armatures in pose mode. */
580 return false;
581 }
582
583 return poselib_asset_in_context(C);
584}
585
587{
588 PropertyRNA *prop;
589
590 /* Identifiers: */
591 ot->name = "Apply Pose Asset";
592 ot->idname = "POSELIB_OT_apply_pose_asset";
593 ot->description = "Apply the given Pose Action to the rig";
594
595 /* Callbacks: */
598
599 /* Flags: */
601
602 /* Properties: */
604 "blend_factor",
605 1.0f,
606 -FLT_MAX,
607 FLT_MAX,
608 "Blend Factor",
609 "Amount that the pose is applied on top of the existing poses. A negative "
610 "value will subtract the pose instead of adding it",
611 -1.0f,
612 1.0f);
613 prop = RNA_def_boolean(ot->srna,
614 "flipped",
615 false,
616 "Apply Flipped",
617 "When enabled, applies the pose flipped over the X-axis");
619}
620
622{
623 PropertyRNA *prop;
624
625 /* Identifiers: */
626 ot->name = "Blend Pose Asset";
627 ot->idname = "POSELIB_OT_blend_pose_asset";
628 ot->description = "Blend the given Pose Action to the rig";
629
630 /* Callbacks: */
636
637 /* Flags: */
639
640 /* Properties: */
642 "blend_factor",
643 0.0f,
644 -FLT_MAX,
645 FLT_MAX,
646 "Blend Factor",
647 "Amount that the pose is applied on top of the existing poses. A "
648 "negative value will subtract the pose instead of adding it",
649 -1.0f,
650 1.0f);
651 /* Blending should always start at 0%, and not at whatever percentage was last used. This RNA
652 * property just exists for symmetry with the Apply operator (and thus simplicity of the rest of
653 * the code, which can assume this property exists). */
655
656 prop = RNA_def_boolean(ot->srna,
657 "flipped",
658 false,
659 "Apply Flipped",
660 "When enabled, applies the pose flipped over the X-axis");
662
663 prop = RNA_def_boolean(ot->srna,
664 "release_confirm",
665 false,
666 "Confirm on Release",
667 "Always confirm operation when releasing button");
669}
Functions and classes to work with Actions.
Functions for backward compatibility with the legacy Action API.
C++ functions to deal with Armature collections (i.e. the successor of bone layers).
Functions to insert, delete or modify keyframes.
Functionality to interact with keying sets.
Functions to work with animation poses.
Main runtime representation of an asset.
Blender kernel action and pose functionality.
bPoseChannel * BKE_pose_channel_find_name(const bPose *pose, const char *name)
void void void void void BKE_action_flip_with_pose(bAction *act, Object *ob_arm) ATTR_NONNULL(1
AnimData * BKE_animdata_from_id(const ID *id)
Definition anim_data.cc:89
AnimationEvalContext BKE_animsys_eval_context_construct(struct Depsgraph *depsgraph, float eval_time) ATTR_WARN_UNUSED_RESULT
Definition anim_sys.cc:734
#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)
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:2456
@ LIB_ID_COPY_LOCALIZE
void BKE_id_free(Main *bmain, void *idv)
ID * BKE_id_copy_ex(Main *bmain, const ID *id, ID **new_id_p, int flag)
Definition lib_id.cc:760
General operations, lookup, etc. for blender objects.
Object * BKE_object_pose_armature_get(Object *ob)
struct PoseBackup * BKE_pose_backup_create_selected_bones(const struct Object *ob, 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:125
#define BLI_assert(a)
Definition BLI_assert.h:50
#define BLI_assert_msg(a, msg)
Definition BLI_assert.h:57
#define ATTR_FALLTHROUGH
#define STRNCPY(dst, src)
Definition BLI_string.h:593
#define SNPRINTF(dst, format,...)
Definition BLI_string.h:597
#define ELEM(...)
#define IFACE_(msgid)
void DEG_id_tag_update(ID *id, unsigned int flags)
@ ID_RECALC_GEOMETRY
Definition DNA_ID.h:1041
@ ID_AC
@ POSE_LOCKED
@ POSE_DO_UNLOCK
struct AssetRepresentationHandle AssetRepresentationHandle
@ OPERATOR_RUNNING_MODAL
#define ANIM_KS_WHOLE_CHARACTER_ID
void ED_area_status_text(ScrArea *area, const char *str)
Definition area.cc:803
void ED_workspace_status_text(bContext *C, const char *str)
Definition area.cc:966
void ED_slider_status_string_get(const tSlider *slider, char *status_string, size_t size_of_status_string)
Definition ed_draw.cc:505
void ED_slider_init(tSlider *slider, const wmEvent *event)
Definition ed_draw.cc:467
void ED_slider_allow_overshoot_set(tSlider *slider, bool lower, bool upper)
Definition ed_draw.cc:580
void ED_slider_destroy(bContext *C, tSlider *slider)
Definition ed_draw.cc:553
void ED_slider_allow_increments_set(tSlider *slider, bool value)
Definition ed_draw.cc:591
tSlider * ED_slider_create(bContext *C)
Definition ed_draw.cc:427
bool ED_slider_modal(tSlider *slider, const wmEvent *event)
Definition ed_draw.cc:472
void ED_slider_factor_bounds_set(tSlider *slider, float factor_bound_lower, float factor_bound_upper)
Definition ed_draw.cc:596
float ED_slider_factor_get(const tSlider *slider)
Definition ed_draw.cc:566
void ED_slider_factor_set(tSlider *slider, float factor)
Definition ed_draw.cc:571
Read Guarded memory(de)allocation.
#define MEM_SAFE_FREE(v)
@ PROP_SKIP_SAVE
Definition RNA_types.hh:245
@ PROP_HIDDEN
Definition RNA_types.hh:239
#define UI_MAX_DRAW_STR
@ OPTYPE_BLOCKING
Definition WM_types.hh:164
@ OPTYPE_UNDO
Definition WM_types.hh:162
@ OPTYPE_REGISTER
Definition WM_types.hh:160
@ OPTYPE_GRAB_CURSOR_X
Definition WM_types.hh:170
#define NC_ANIMATION
Definition WM_types.hh:355
@ KM_NOTHING
Definition WM_types.hh:283
@ KM_PRESS
Definition WM_types.hh:284
@ KM_RELEASE
Definition WM_types.hh:285
#define ND_POSE
Definition WM_types.hh:425
#define NA_EDITED
Definition WM_types.hh:550
#define ND_KEYFRAME
Definition WM_types.hh:461
#define NC_OBJECT
Definition WM_types.hh:346
const Depsgraph * depsgraph
void ANIM_relative_keyingset_add_source(blender::Vector< PointerRNA > &sources, ID *id, StructRNA *srna, void *data)
KeyingSet * ANIM_get_keyingset_for_autokeying(const Scene *scene, const char *transformKSName)
int ANIM_apply_keyingset(bContext *C, blender::Vector< PointerRNA > *sources, KeyingSet *keyingset, const blender::animrig::ModifyKeyMode mode, const float cfra)
void *(* MEM_callocN)(size_t len, const char *str)
Definition mallocn.cc:42
Vector< bActionGroup * > channel_groups_all(bAction *action)
bool autokeyframe_cfra_can_key(const Scene *scene, ID *id)
void action_deselect_keys(Action &action)
slot_handle_t first_slot_handle(const ::bAction &dna_action)
decltype(::ActionSlot::handle) slot_handle_t
void pose_apply_action_blend(Object *ob, bAction *action, slot_handle_t slot_handle, const AnimationEvalContext *anim_eval_context, float blend_factor)
static int poselib_blend_handle_event(bContext *, wmOperator *op, const wmEvent *event)
static bool poselib_asset_in_context(bContext *C)
static Object * get_poselib_object(bContext *C)
static bAction * poselib_action_to_blend(PoseBlendData *pbd)
static int poselib_blend_exit(bContext *C, wmOperator *op)
static void poselib_blend_cleanup(bContext *C, wmOperator *op)
static int poselib_blend_modal(bContext *C, wmOperator *op, const wmEvent *event)
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 bAction * flip_pose(bContext *C, Object *ob, bAction *action)
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 void poselib_blend_set_factor(PoseBlendData *pbd, const float new_factor)
static bool poselib_blend_init_data(bContext *C, wmOperator *op, const wmEvent *event)
static int poselib_blend_invoke(bContext *C, wmOperator *op, const wmEvent *event)
static void poselib_toggle_flipped(PoseBlendData *pbd)
static int poselib_blend_exec(bContext *C, wmOperator *op)
ePoseBlendState
Definition pose_lib_2.cc:57
@ POSE_BLEND_CANCEL
Definition pose_lib_2.cc:62
@ POSE_BLEND_CONFIRM
Definition pose_lib_2.cc:61
@ POSE_BLEND_ORIGINAL
Definition pose_lib_2.cc:60
@ POSE_BLEND_INIT
Definition pose_lib_2.cc:58
@ POSE_BLEND_BLENDING
Definition pose_lib_2.cc:59
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)
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:83
bAction * act_flipped
Definition pose_lib_2.cc:87
AssetTempIDConsumer * temp_id_consumer
Definition pose_lib_2.cc:76
Scene * scene
Definition pose_lib_2.cc:89
struct PoseBlendData::@306 release_confirm_info
char headerstr[UI_MAX_DRAW_STR]
Definition pose_lib_2.cc:95
ScrArea * area
Definition pose_lib_2.cc:90
tSlider * slider
Definition pose_lib_2.cc:92
Object * ob
Definition pose_lib_2.cc:85
ePoseBlendState state
Definition pose_lib_2.cc:66
bool use_release_confirm
Definition pose_lib_2.cc:70
bAction * act
Definition pose_lib_2.cc:86
float blend_factor
Definition pose_lib_2.cc:81
struct Bone * bone
short val
Definition WM_types.hh:724
short type
Definition WM_types.hh:722
const char * name
Definition WM_types.hh:990
bool(* poll)(bContext *C) ATTR_WARN_UNUSED_RESULT
Definition WM_types.hh:1042
const char * idname
Definition WM_types.hh:992
int(* modal)(bContext *C, wmOperator *op, const wmEvent *event) ATTR_WARN_UNUSED_RESULT
Definition WM_types.hh:1036
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
StructRNA * srna
Definition WM_types.hh:1080
void(* cancel)(bContext *C, wmOperator *op)
Definition WM_types.hh:1028
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:53
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
wmOperatorType * ot
Definition wm_files.cc:4125