Blender V4.5
screen_context.cc
Go to the documentation of this file.
1/* SPDX-FileCopyrightText: 2008 Blender Authors
2 *
3 * SPDX-License-Identifier: GPL-2.0-or-later */
4
8
9#include <cstdlib>
10#include <cstring>
11
12#include "DNA_anim_types.h"
13#include "DNA_armature_types.h"
16#include "DNA_object_types.h"
17#include "DNA_scene_types.h"
18#include "DNA_screen_types.h"
19#include "DNA_sequence_types.h"
20#include "DNA_space_types.h"
22#include "DNA_workspace_types.h"
23
24#include "BLI_listbase.h"
25#include "BLI_map.hh"
26#include "BLI_set.hh"
27#include "BLI_utildefines.h"
28
29#include "BKE_action.hh"
30#include "BKE_armature.hh"
31#include "BKE_context.hh"
32#include "BKE_gpencil_legacy.h"
33#include "BKE_layer.hh"
34#include "BKE_library.hh"
35#include "BKE_object.hh"
36#include "BKE_tracking.h"
37
38#include "RNA_access.hh"
39#include "RNA_prototypes.hh"
40
41#include "ED_anim_api.hh"
42#include "ED_armature.hh"
43#include "ED_clip.hh"
44#include "ED_gpencil_legacy.hh"
45
46#include "SEQ_channels.hh"
47#include "SEQ_select.hh"
48#include "SEQ_sequencer.hh"
49#include "SEQ_transform.hh"
50
51#include "UI_interface.hh"
52#include "WM_api.hh"
53
54#include "ANIM_armature.hh"
56
57#include "screen_intern.hh"
58
59using blender::Vector;
60
61const char *screen_context_dir[] = {
62 "scene",
63 "view_layer",
64 "visible_objects",
65 "selectable_objects",
66 "selected_objects",
67 "editable_objects",
68 "selected_editable_objects",
69 "objects_in_mode",
70 "objects_in_mode_unique_data",
71 "visible_bones",
72 "editable_bones",
73 "selected_bones",
74 "selected_editable_bones",
75 "visible_pose_bones",
76 "selected_pose_bones",
77 "selected_pose_bones_from_active_object",
78 "active_bone",
79 "active_pose_bone",
80 "active_object",
81 "object",
82 "edit_object",
83 "sculpt_object",
84 "vertex_paint_object",
85 "weight_paint_object",
86 "image_paint_object",
87 "particle_edit_object",
88 "pose_object",
89 "active_sequence_strip", /* DEPRECATED - use "active_strip" */
90 "sequences", /* DEPRECATED - use "strips" */
91 "selected_sequences", /* DEPRECATED - use "selected_strips" */
92 "selected_editable_sequences", /* DEPRECATED - use "selected_editable_strips" */
93 "active_nla_track",
94 "active_nla_strip",
95 "selected_nla_strips", /* nla editor */
96 "selected_movieclip_tracks",
97 /* Legacy Grease Pencil */
98 "annotation_data",
99 "annotation_data_owner",
100 "active_annotation_layer",
101 /* Grease Pencil */
102 "grease_pencil",
103 "active_operator",
104 "active_action",
105 "selected_visible_actions",
106 "selected_editable_actions",
107 "visible_fcurves",
108 "editable_fcurves",
109 "selected_visible_fcurves",
110 "selected_editable_fcurves",
111 "active_editable_fcurve",
112 "selected_editable_keyframes",
113 "ui_list",
114 "property",
115 "asset_library_reference",
116 "active_strip",
117 "strips",
118 "selected_strips",
119 "selected_editable_strips",
120 nullptr,
121};
122
123/* Each function `screen_ctx_XXX()` will be called when the screen context "XXX" is requested.
124 * ensure_ed_screen_context_functions() is responsible for creating the hash map from context
125 * member name to function. */
126
135{
136 wmWindow *win = CTX_wm_window(C);
137 View3D *v3d = CTX_wm_view3d(C); /* This may be nullptr in a lot of cases. */
138 Scene *scene = WM_window_get_active_scene(win);
140 BKE_view_layer_synced_ensure(scene, view_layer);
141
143 if (BASE_VISIBLE(v3d, base)) {
144 CTX_data_id_list_add(result, &base->object->id);
145 }
146 }
148 return CTX_RESULT_OK;
149}
151{
152 wmWindow *win = CTX_wm_window(C);
153 View3D *v3d = CTX_wm_view3d(C); /* This may be nullptr in a lot of cases. */
154 Scene *scene = WM_window_get_active_scene(win);
156 BKE_view_layer_synced_ensure(scene, view_layer);
157
159 if (BASE_SELECTABLE(v3d, base)) {
160 CTX_data_id_list_add(result, &base->object->id);
161 }
162 }
164 return CTX_RESULT_OK;
165}
167{
168 wmWindow *win = CTX_wm_window(C);
169 View3D *v3d = CTX_wm_view3d(C); /* This may be nullptr in a lot of cases. */
170 Scene *scene = WM_window_get_active_scene(win);
172 BKE_view_layer_synced_ensure(scene, view_layer);
173
175 if (BASE_SELECTED(v3d, base)) {
176 CTX_data_id_list_add(result, &base->object->id);
177 }
178 }
180 return CTX_RESULT_OK;
181}
184{
185 wmWindow *win = CTX_wm_window(C);
186 View3D *v3d = CTX_wm_view3d(C); /* This may be nullptr in a lot of cases. */
187 Scene *scene = WM_window_get_active_scene(win);
189 BKE_view_layer_synced_ensure(scene, view_layer);
190
192 if (BASE_SELECTED_EDITABLE(v3d, base)) {
193 CTX_data_id_list_add(result, &base->object->id);
194 }
195 }
197 return CTX_RESULT_OK;
198}
200{
201 wmWindow *win = CTX_wm_window(C);
202 View3D *v3d = CTX_wm_view3d(C); /* This may be nullptr in a lot of cases. */
203 Scene *scene = WM_window_get_active_scene(win);
205 BKE_view_layer_synced_ensure(scene, view_layer);
206
207 /* Visible + Editable, but not necessarily selected */
209 if (BASE_EDITABLE(v3d, base)) {
210 CTX_data_id_list_add(result, &base->object->id);
211 }
212 }
214 return CTX_RESULT_OK;
215}
217{
218 wmWindow *win = CTX_wm_window(C);
219 View3D *v3d = CTX_wm_view3d(C); /* This may be nullptr in a lot of cases. */
220 const Scene *scene = WM_window_get_active_scene(win);
222 BKE_view_layer_synced_ensure(scene, view_layer);
223 Object *obact = BKE_view_layer_active_object_get(view_layer);
224
225 if (obact && (obact->mode != OB_MODE_OBJECT)) {
226 FOREACH_OBJECT_IN_MODE_BEGIN (scene, view_layer, v3d, obact->type, obact->mode, ob_iter) {
227 CTX_data_id_list_add(result, &ob_iter->id);
228 }
230 }
232 return CTX_RESULT_OK;
233}
236{
237 wmWindow *win = CTX_wm_window(C);
238 View3D *v3d = CTX_wm_view3d(C); /* This may be nullptr in a lot of cases. */
239 const Scene *scene = WM_window_get_active_scene(win);
241 BKE_view_layer_synced_ensure(scene, view_layer);
242 Object *obact = BKE_view_layer_active_object_get(view_layer);
243
244 if (obact && (obact->mode != OB_MODE_OBJECT)) {
245 FOREACH_OBJECT_IN_MODE_BEGIN (scene, view_layer, v3d, obact->type, obact->mode, ob_iter) {
246 ob_iter->id.tag |= ID_TAG_DOIT;
247 }
249 FOREACH_OBJECT_IN_MODE_BEGIN (scene, view_layer, v3d, obact->type, obact->mode, ob_iter) {
250 if (ob_iter->id.tag & ID_TAG_DOIT) {
251 ob_iter->id.tag &= ~ID_TAG_DOIT;
252 CTX_data_id_list_add(result, &ob_iter->id);
253 }
254 }
256 }
258 return CTX_RESULT_OK;
259}
262 const bool editable_bones)
263{
264 wmWindow *win = CTX_wm_window(C);
265 const Scene *scene = WM_window_get_active_scene(win);
267 BKE_view_layer_synced_ensure(scene, view_layer);
268 Object *obedit = BKE_view_layer_edit_object_get(view_layer);
269
270 bArmature *arm = static_cast<bArmature *>(
271 (obedit && obedit->type == OB_ARMATURE) ? obedit->data : nullptr);
272 EditBone *flipbone = nullptr;
273
274 if (arm && arm->edbo) {
276 scene, view_layer, CTX_wm_view3d(C));
277 for (Object *ob : objects) {
278 arm = static_cast<bArmature *>(ob->data);
279
280 /* Attention: X-Axis Mirroring is also handled here... */
281 LISTBASE_FOREACH (EditBone *, ebone, arm->edbo) {
282 /* first and foremost, bone must be visible and selected */
284 /* Get 'x-axis mirror equivalent' bone if the X-Axis Mirroring option is enabled
285 * so that most users of this data don't need to explicitly check for it themselves.
286 *
287 * We need to make sure that these mirrored copies are not selected, otherwise some
288 * bones will be operated on twice.
289 */
290 if (arm->flag & ARM_MIRROR_EDIT) {
291 flipbone = ED_armature_ebone_get_mirrored(arm->edbo, ebone);
292 }
293
294 /* if we're filtering for editable too, use the check for that instead,
295 * as it has selection check too */
296 if (editable_bones) {
297 /* only selected + editable */
298 if (EBONE_EDITABLE(ebone)) {
299 CTX_data_list_add(result, &arm->id, &RNA_EditBone, ebone);
300
301 if ((flipbone) && !(flipbone->flag & BONE_SELECTED)) {
302 CTX_data_list_add(result, &arm->id, &RNA_EditBone, flipbone);
303 }
304 }
305 }
306 else {
307 /* only include bones if visible */
308 CTX_data_list_add(result, &arm->id, &RNA_EditBone, ebone);
309
310 if ((flipbone) && blender::animrig::bone_is_visible_editbone(arm, flipbone) == 0) {
311 CTX_data_list_add(result, &arm->id, &RNA_EditBone, flipbone);
312 }
313 }
314 }
315 }
316 }
317
319 return CTX_RESULT_OK;
320 }
321 return CTX_RESULT_NO_DATA;
322}
333 const bool selected_editable_bones)
334{
335 wmWindow *win = CTX_wm_window(C);
336 const Scene *scene = WM_window_get_active_scene(win);
338 BKE_view_layer_synced_ensure(scene, view_layer);
339 Object *obedit = BKE_view_layer_edit_object_get(view_layer);
340 bArmature *arm = static_cast<bArmature *>(
341 (obedit && obedit->type == OB_ARMATURE) ? obedit->data : nullptr);
342 EditBone *flipbone = nullptr;
343
344 if (arm && arm->edbo) {
346 scene, view_layer, CTX_wm_view3d(C));
347 for (Object *ob : objects) {
348 arm = static_cast<bArmature *>(ob->data);
349
350 /* Attention: X-Axis Mirroring is also handled here... */
351 LISTBASE_FOREACH (EditBone *, ebone, arm->edbo) {
352 /* first and foremost, bone must be visible and selected */
354 (ebone->flag & BONE_SELECTED))
355 {
356 /* Get 'x-axis mirror equivalent' bone if the X-Axis Mirroring option is enabled
357 * so that most users of this data don't need to explicitly check for it themselves.
358 *
359 * We need to make sure that these mirrored copies are not selected, otherwise some
360 * bones will be operated on twice.
361 */
362 if (arm->flag & ARM_MIRROR_EDIT) {
363 flipbone = ED_armature_ebone_get_mirrored(arm->edbo, ebone);
364 }
365
366 /* if we're filtering for editable too, use the check for that instead,
367 * as it has selection check too */
368 if (selected_editable_bones) {
369 /* only selected + editable */
370 if (EBONE_EDITABLE(ebone)) {
371 CTX_data_list_add(result, &arm->id, &RNA_EditBone, ebone);
372
373 if ((flipbone) && !(flipbone->flag & BONE_SELECTED)) {
374 CTX_data_list_add(result, &arm->id, &RNA_EditBone, flipbone);
375 }
376 }
377 }
378 else {
379 /* only include bones if selected */
380 CTX_data_list_add(result, &arm->id, &RNA_EditBone, ebone);
381
382 if ((flipbone) && !(flipbone->flag & BONE_SELECTED)) {
383 CTX_data_list_add(result, &arm->id, &RNA_EditBone, flipbone);
384 }
385 }
386 }
387 }
388 }
389
391 return CTX_RESULT_OK;
392 }
393 return CTX_RESULT_NO_DATA;
394}
405{
406 wmWindow *win = CTX_wm_window(C);
407 View3D *v3d = CTX_wm_view3d(C); /* This may be nullptr in a lot of cases. */
408 const Scene *scene = WM_window_get_active_scene(win);
410 BKE_view_layer_synced_ensure(scene, view_layer);
411 Object *obact = BKE_view_layer_active_object_get(view_layer);
412 Object *obpose = BKE_object_pose_armature_get(obact);
413 if (obpose && obpose->pose && obpose->data) {
414 if (obpose != obact) {
416 CTX_data_list_add(result, &obpose->id, &RNA_PoseBone, pchan);
417 }
419 }
420 else if (obact->mode & OB_MODE_POSE) {
421 FOREACH_OBJECT_IN_MODE_BEGIN (scene, view_layer, v3d, OB_ARMATURE, OB_MODE_POSE, ob_iter) {
423 CTX_data_list_add(result, &ob_iter->id, &RNA_PoseBone, pchan);
424 }
426 }
428 }
430 return CTX_RESULT_OK;
431 }
432 return CTX_RESULT_NO_DATA;
433}
435{
436 wmWindow *win = CTX_wm_window(C);
437 View3D *v3d = CTX_wm_view3d(C); /* This may be nullptr in a lot of cases. */
438 const Scene *scene = WM_window_get_active_scene(win);
440 Object *obact = BKE_view_layer_active_object_get(view_layer);
441 Object *obpose = BKE_object_pose_armature_get(obact);
442 if (obpose && obpose->pose && obpose->data) {
443 if (obpose != obact) {
445 CTX_data_list_add(result, &obpose->id, &RNA_PoseBone, pchan);
446 }
448 }
449 else if (obact->mode & OB_MODE_POSE) {
450 FOREACH_OBJECT_IN_MODE_BEGIN (scene, view_layer, v3d, OB_ARMATURE, OB_MODE_POSE, ob_iter) {
452 CTX_data_list_add(result, &ob_iter->id, &RNA_PoseBone, pchan);
453 }
455 }
457 }
459 return CTX_RESULT_OK;
460 }
461 return CTX_RESULT_NO_DATA;
462}
465{
466 wmWindow *win = CTX_wm_window(C);
467 const Scene *scene = WM_window_get_active_scene(win);
469 BKE_view_layer_synced_ensure(scene, view_layer);
470 Object *obact = BKE_view_layer_active_object_get(view_layer);
471 Object *obpose = BKE_object_pose_armature_get(obact);
472 if (obpose && obpose->pose && obpose->data) {
473 if (obpose != obact) {
475 CTX_data_list_add(result, &obpose->id, &RNA_PoseBone, pchan);
476 }
478 }
479 else if (obact->mode & OB_MODE_POSE) {
481 CTX_data_list_add(result, &obact->id, &RNA_PoseBone, pchan);
482 }
484 }
486 return CTX_RESULT_OK;
487 }
488 return CTX_RESULT_NO_DATA;
489}
491{
492 wmWindow *win = CTX_wm_window(C);
493 const Scene *scene = WM_window_get_active_scene(win);
495 BKE_view_layer_synced_ensure(scene, view_layer);
496 Object *obact = BKE_view_layer_active_object_get(view_layer);
497 if (obact && obact->type == OB_ARMATURE) {
498 bArmature *arm = static_cast<bArmature *>(obact->data);
499 if (arm->edbo) {
500 if (arm->act_edbone) {
501 CTX_data_pointer_set(result, &arm->id, &RNA_EditBone, arm->act_edbone);
502 return CTX_RESULT_OK;
503 }
504 }
505 else {
506 if (arm->act_bone) {
507 CTX_data_pointer_set(result, &arm->id, &RNA_Bone, arm->act_bone);
508 return CTX_RESULT_OK;
509 }
510 }
511 }
512 return CTX_RESULT_NO_DATA;
513}
515{
516 wmWindow *win = CTX_wm_window(C);
517 const Scene *scene = WM_window_get_active_scene(win);
519 BKE_view_layer_synced_ensure(scene, view_layer);
520 Object *obact = BKE_view_layer_active_object_get(view_layer);
521 Object *obpose = BKE_object_pose_armature_get(obact);
522
524 if (pchan) {
525 CTX_data_pointer_set(result, &obpose->id, &RNA_PoseBone, pchan);
526 return CTX_RESULT_OK;
527 }
528 return CTX_RESULT_NO_DATA;
529}
531{
532 wmWindow *win = CTX_wm_window(C);
533 const Scene *scene = WM_window_get_active_scene(win);
535 BKE_view_layer_synced_ensure(scene, view_layer);
536 Object *obact = BKE_view_layer_active_object_get(view_layer);
537
538 if (obact) {
540 }
541
542 return CTX_RESULT_OK;
543}
544
546{
548 PropertyRNA *prop;
549 int index;
550
551 UI_context_active_but_prop_get(C, &ptr, &prop, &index);
552 if (ptr.data && prop) {
553 /* UI_context_active_but_prop_get returns an index of 0 if the property is not
554 * an array, but other functions expect -1 for non-arrays. */
555 if (!RNA_property_array_check(prop)) {
556 index = -1;
557 }
558
561 CTX_data_prop_set(result, prop, index);
562 }
563
564 return CTX_RESULT_OK;
565}
566
568{
569 wmWindow *win = CTX_wm_window(C);
570 const Scene *scene = WM_window_get_active_scene(win);
572 BKE_view_layer_synced_ensure(scene, view_layer);
573 Object *obact = BKE_view_layer_active_object_get(view_layer);
574
575 if (obact) {
577 }
578
579 return CTX_RESULT_OK;
580}
582{
583 wmWindow *win = CTX_wm_window(C);
584 Scene *scene = WM_window_get_active_scene(win);
586 BKE_view_layer_synced_ensure(scene, view_layer);
587 Object *obedit = BKE_view_layer_edit_object_get(view_layer);
588 /* convenience for now, 1 object per scene in editmode */
589 if (obedit) {
591 }
592
593 return CTX_RESULT_OK;
594}
596{
597 wmWindow *win = CTX_wm_window(C);
598 const Scene *scene = WM_window_get_active_scene(win);
600 BKE_view_layer_synced_ensure(scene, view_layer);
601 Object *obact = BKE_view_layer_active_object_get(view_layer);
602
603 if (obact && (obact->mode & OB_MODE_SCULPT)) {
605 }
606
607 return CTX_RESULT_OK;
608}
610{
611 wmWindow *win = CTX_wm_window(C);
612 const Scene *scene = WM_window_get_active_scene(win);
614 BKE_view_layer_synced_ensure(scene, view_layer);
615 Object *obact = BKE_view_layer_active_object_get(view_layer);
616 if (obact && (obact->mode & OB_MODE_VERTEX_PAINT)) {
618 }
619
620 return CTX_RESULT_OK;
621}
623{
624 wmWindow *win = CTX_wm_window(C);
625 const Scene *scene = WM_window_get_active_scene(win);
627 BKE_view_layer_synced_ensure(scene, view_layer);
628 Object *obact = BKE_view_layer_active_object_get(view_layer);
629 if (obact && (obact->mode & OB_MODE_ALL_WEIGHT_PAINT)) {
631 }
632
633 return CTX_RESULT_OK;
634}
636{
637 wmWindow *win = CTX_wm_window(C);
638 const Scene *scene = WM_window_get_active_scene(win);
640 BKE_view_layer_synced_ensure(scene, view_layer);
641 Object *obact = BKE_view_layer_active_object_get(view_layer);
642 if (obact && (obact->mode & OB_MODE_TEXTURE_PAINT)) {
644 }
645
646 return CTX_RESULT_OK;
647}
650{
651 wmWindow *win = CTX_wm_window(C);
652 const Scene *scene = WM_window_get_active_scene(win);
654 BKE_view_layer_synced_ensure(scene, view_layer);
655 Object *obact = BKE_view_layer_active_object_get(view_layer);
656 if (obact && (obact->mode & OB_MODE_PARTICLE_EDIT)) {
658 }
659
660 return CTX_RESULT_OK;
661}
663{
664 wmWindow *win = CTX_wm_window(C);
665 const Scene *scene = WM_window_get_active_scene(win);
667 BKE_view_layer_synced_ensure(scene, view_layer);
668 Object *obact = BKE_view_layer_active_object_get(view_layer);
669 Object *obpose = BKE_object_pose_armature_get(obact);
670 if (obpose) {
672 }
673 return CTX_RESULT_OK;
674}
677{
678 wmWindow *win = CTX_wm_window(C);
679 Scene *scene = WM_window_get_active_scene(win);
681 if (strip) {
682 CTX_data_pointer_set(result, &scene->id, &RNA_Strip, strip);
683 return CTX_RESULT_OK;
684 }
685 return CTX_RESULT_NO_DATA;
686}
688{
689 wmWindow *win = CTX_wm_window(C);
690 Scene *scene = WM_window_get_active_scene(win);
692 if (ed) {
693 LISTBASE_FOREACH (Strip *, strip, ed->seqbasep) {
694 CTX_data_list_add(result, &scene->id, &RNA_Strip, strip);
695 }
697 return CTX_RESULT_OK;
698 }
699 return CTX_RESULT_NO_DATA;
700}
702{
703 wmWindow *win = CTX_wm_window(C);
704 Scene *scene = WM_window_get_active_scene(win);
706 if (ed) {
707 LISTBASE_FOREACH (Strip *, strip, ed->seqbasep) {
708 if (strip->flag & SELECT) {
709 CTX_data_list_add(result, &scene->id, &RNA_Strip, strip);
710 }
711 }
713 return CTX_RESULT_OK;
714 }
715 return CTX_RESULT_NO_DATA;
716}
719{
720 wmWindow *win = CTX_wm_window(C);
721 Scene *scene = WM_window_get_active_scene(win);
723 if (ed == nullptr) {
724 return CTX_RESULT_NO_DATA;
725 }
726
728 LISTBASE_FOREACH (Strip *, strip, ed->seqbasep) {
729 if (strip->flag & SELECT && !blender::seq::transform_is_locked(channels, strip)) {
730 CTX_data_list_add(result, &scene->id, &RNA_Strip, strip);
731 }
732 }
734 return CTX_RESULT_OK;
735}
736
756{
757 bAnimContext ac;
758 if (ANIM_animdata_get_context(C, &ac) != 0) {
759 ListBase anim_data = {nullptr, nullptr};
760
762 &ac, &anim_data, ANIMFILTER_DATA_VISIBLE, ac.data, eAnimCont_Types(ac.datatype));
763 LISTBASE_FOREACH (bAnimListElem *, ale, &anim_data) {
764 if (ale->datatype != ALE_NLASTRIP) {
765 continue;
766 }
767 NlaTrack *nlt = (NlaTrack *)ale->data;
768 LISTBASE_FOREACH (NlaStrip *, strip, &nlt->strips) {
769 if (strip->flag & NLASTRIP_FLAG_SELECT) {
770 CTX_data_list_add(result, ale->id, &RNA_NlaStrip, strip);
771 }
772 }
773 }
774 ANIM_animdata_freelist(&anim_data);
775
777 return CTX_RESULT_OK;
778 }
779 return CTX_RESULT_NO_DATA;
780}
783{
784 SpaceClip *space_clip = CTX_wm_space_clip(C);
785 if (space_clip == nullptr) {
786 return CTX_RESULT_NO_DATA;
787 }
788 MovieClip *clip = ED_space_clip_get_clip(space_clip);
789 if (clip == nullptr) {
790 return CTX_RESULT_NO_DATA;
791 }
792
793 const MovieTrackingObject *tracking_object = BKE_tracking_object_get_active(&clip->tracking);
794 LISTBASE_FOREACH (MovieTrackingTrack *, track, &tracking_object->tracks) {
795 if (!TRACK_SELECTED(track)) {
796 continue;
797 }
798 CTX_data_list_add(result, &clip->id, &RNA_MovieTrackingTrack, track);
799 }
800
802 return CTX_RESULT_OK;
803}
804
806{
807 wmWindow *win = CTX_wm_window(C);
808 bScreen *screen = CTX_wm_screen(C);
809 ScrArea *area = CTX_wm_area(C);
810 Scene *scene = WM_window_get_active_scene(win);
811 bGPdata *gpd = ED_annotation_data_get_active_direct((ID *)screen, area, scene);
812
813 if (gpd) {
815 return CTX_RESULT_OK;
816 }
817 return CTX_RESULT_NO_DATA;
818}
821{
822 wmWindow *win = CTX_wm_window(C);
823 bScreen *screen = CTX_wm_screen(C);
824 ScrArea *area = CTX_wm_area(C);
825 Scene *scene = WM_window_get_active_scene(win);
826
827 /* Pointer to which data/datablock owns the reference to the Grease Pencil data being used. */
829 bGPdata **gpd_ptr = ED_annotation_data_get_pointers_direct((ID *)screen, area, scene, &ptr);
830
831 if (gpd_ptr) {
833 return CTX_RESULT_OK;
834 }
835 return CTX_RESULT_NO_DATA;
836}
839{
840 wmWindow *win = CTX_wm_window(C);
841 bScreen *screen = CTX_wm_screen(C);
842 ScrArea *area = CTX_wm_area(C);
843 Scene *scene = WM_window_get_active_scene(win);
844 bGPdata *gpd = ED_annotation_data_get_active_direct((ID *)screen, area, scene);
845
846 if (gpd) {
848
849 if (gpl) {
850 CTX_data_pointer_set(result, &gpd->id, &RNA_GPencilLayer, gpl);
851 return CTX_RESULT_OK;
852 }
853 }
854 return CTX_RESULT_NO_DATA;
855}
857{
858 wmWindow *win = CTX_wm_window(C);
859 const Scene *scene = WM_window_get_active_scene(win);
861 BKE_view_layer_synced_ensure(scene, view_layer);
862 Object *obact = BKE_view_layer_active_object_get(view_layer);
863 if (obact && obact->type == OB_GREASE_PENCIL) {
864 GreasePencil *grease_pencil = static_cast<GreasePencil *>(obact->data);
865 CTX_data_id_pointer_set(result, &grease_pencil->id);
866 return CTX_RESULT_OK;
867 }
868 return CTX_RESULT_NO_DATA;
869}
871{
872 wmOperator *op = nullptr;
873
874 SpaceFile *sfile = CTX_wm_space_file(C);
875 if (sfile) {
876 op = sfile->op;
877 }
878 else if ((op = UI_context_active_operator_get(C))) {
879 /* do nothing */
880 }
881 else {
882 /* NOTE: this checks poll, could be a problem, but this also
883 * happens for the toolbar */
885 }
886 /* TODO: get the operator from popup's. */
887
888 if (op && op->ptr) {
889 CTX_data_pointer_set(result, nullptr, &RNA_Operator, op);
890 return CTX_RESULT_OK;
891 }
892 return CTX_RESULT_NO_DATA;
893}
896 bool active_only,
897 bool editable)
898{
899 bAnimContext ac;
901 return CTX_RESULT_NO_DATA;
902 }
903
904 /* In the Action and Shape Key editor always use the action field at the top. */
905 if (ac.spacetype == SPACE_ACTION) {
906 SpaceAction *saction = (SpaceAction *)ac.sl;
907
908 if (ELEM(saction->mode, SACTCONT_ACTION, SACTCONT_SHAPEKEY)) {
909 if (active_only) {
911 }
912 else {
913 if (saction->action && !(editable && !ID_IS_EDITABLE(saction->action))) {
915 }
916
918 }
919
920 return CTX_RESULT_OK;
921 }
922 }
923
924 /* Search for selected animation data items. */
925 ListBase anim_data = {nullptr, nullptr};
926
928 bool check_selected = false;
929
930 switch (ac.spacetype) {
931 case SPACE_GRAPH:
933 (active_only ? ANIMFILTER_ACTIVE : ANIMFILTER_SEL);
934 break;
935
936 case SPACE_ACTION:
938 check_selected = true;
939 break;
940 default:
942 }
943
945 &ac, &anim_data, eAnimFilter_Flags(filter), ac.data, eAnimCont_Types(ac.datatype));
946
948
949 LISTBASE_FOREACH (bAnimListElem *, ale, &anim_data) {
950 /* In dope-sheet check selection status of individual items, skipping
951 * if not selected or has no selection flag. This is needed so that
952 * selecting action or group rows without any channels works. */
953 if (check_selected && ANIM_channel_setting_get(&ac, ale, ACHANNEL_SETTING_SELECT) <= 0) {
954 continue;
955 }
956
957 bAction *action = ANIM_channel_action_get(ale);
958 if (!action) {
959 continue;
960 }
961
962 if (active_only) {
964 break;
965 }
966 if (editable && !ID_IS_EDITABLE(action)) {
967 continue;
968 }
969
970 /* Add the action to the output list if not already added. */
971 if (seen_set.add(action)) {
972 CTX_data_id_list_add(result, &action->id);
973 }
974 }
975
976 ANIM_animdata_freelist(&anim_data);
977
978 if (!active_only) {
980 }
981
982 return CTX_RESULT_OK;
983}
1000 const int extra_filter)
1001{
1002 bAnimContext ac;
1004 ListBase anim_data = {nullptr, nullptr};
1005
1007 (ac.spacetype == SPACE_GRAPH ?
1010 extra_filter;
1011
1013 &ac, &anim_data, eAnimFilter_Flags(filter), ac.data, eAnimCont_Types(ac.datatype));
1014
1015 LISTBASE_FOREACH (bAnimListElem *, ale, &anim_data) {
1016 if (ELEM(ale->type, ANIMTYPE_FCURVE, ANIMTYPE_NLACURVE)) {
1017 CTX_data_list_add(result, ale->fcurve_owner_id, &RNA_FCurve, ale->data);
1018 }
1019 }
1020
1021 ANIM_animdata_freelist(&anim_data);
1022
1024 return CTX_RESULT_OK;
1025 }
1026 return CTX_RESULT_NO_DATA;
1027}
1048{
1049 bAnimContext ac;
1051 ListBase anim_data = {nullptr, nullptr};
1052
1055
1057 &ac, &anim_data, eAnimFilter_Flags(filter), ac.data, eAnimCont_Types(ac.datatype));
1058
1059 LISTBASE_FOREACH (bAnimListElem *, ale, &anim_data) {
1060 if (ELEM(ale->type, ANIMTYPE_FCURVE, ANIMTYPE_NLACURVE)) {
1061 CTX_data_pointer_set(result, ale->fcurve_owner_id, &RNA_FCurve, ale->data);
1062 break;
1063 }
1064 }
1065
1066 ANIM_animdata_freelist(&anim_data);
1067 return CTX_RESULT_OK;
1068 }
1069 return CTX_RESULT_NO_DATA;
1070}
1073{
1074 bAnimContext ac;
1076 ListBase anim_data = {nullptr, nullptr};
1077
1078 /* Use keyframes from editable selected FCurves. */
1081 (ac.spacetype == SPACE_GRAPH ?
1084
1086 &ac, &anim_data, eAnimFilter_Flags(filter), ac.data, eAnimCont_Types(ac.datatype));
1087
1088 int i;
1089 FCurve *fcurve;
1090 BezTriple *bezt;
1091 LISTBASE_FOREACH (bAnimListElem *, ale, &anim_data) {
1092 if (!ELEM(ale->type, ANIMTYPE_FCURVE, ANIMTYPE_NLACURVE)) {
1093 continue;
1094 }
1095
1096 fcurve = (FCurve *)ale->data;
1097 if (fcurve->bezt == nullptr) {
1098 /* Skip baked FCurves. */
1099 continue;
1100 }
1101
1102 for (i = 0, bezt = fcurve->bezt; i < fcurve->totvert; i++, bezt++) {
1103 if ((bezt->f2 & SELECT) == 0) {
1104 continue;
1105 }
1106
1107 CTX_data_list_add(result, ale->fcurve_owner_id, &RNA_Keyframe, bezt);
1108 }
1109 }
1110
1111 ANIM_animdata_freelist(&anim_data);
1112
1114 return CTX_RESULT_OK;
1115 }
1116 return CTX_RESULT_NO_DATA;
1117}
1118
1120{
1121 WorkSpace *workspace = CTX_wm_workspace(C);
1123 result, &workspace->id, &RNA_AssetLibraryReference, &workspace->asset_library_ref);
1124 return CTX_RESULT_OK;
1125}
1126
1128{
1129 wmWindow *win = CTX_wm_window(C);
1130 ARegion *region = CTX_wm_region(C);
1131 if (region) {
1132 uiList *list = UI_list_find_mouse_over(region, win->eventstate);
1133 if (list) {
1134 CTX_data_pointer_set(result, nullptr, &RNA_UIList, list);
1135 return CTX_RESULT_OK;
1136 }
1137 }
1138 return CTX_RESULT_NO_DATA;
1139}
1140
1142{
1143 wmWindow *win = CTX_wm_window(C);
1144 Scene *scene = WM_window_get_active_scene(win);
1145 Strip *strip = blender::seq::select_active_get(scene);
1146 if (strip) {
1147 CTX_data_pointer_set(result, &scene->id, &RNA_Strip, strip);
1148 return CTX_RESULT_OK;
1149 }
1150 return CTX_RESULT_NO_DATA;
1151}
1153{
1154 wmWindow *win = CTX_wm_window(C);
1155 Scene *scene = WM_window_get_active_scene(win);
1157 if (ed) {
1158 LISTBASE_FOREACH (Strip *, strip, ed->seqbasep) {
1159 CTX_data_list_add(result, &scene->id, &RNA_Strip, strip);
1160 }
1162 return CTX_RESULT_OK;
1163 }
1164 return CTX_RESULT_NO_DATA;
1165}
1167{
1168 wmWindow *win = CTX_wm_window(C);
1169 Scene *scene = WM_window_get_active_scene(win);
1171 if (ed) {
1172 LISTBASE_FOREACH (Strip *, strip, ed->seqbasep) {
1173 if (strip->flag & SELECT) {
1174 CTX_data_list_add(result, &scene->id, &RNA_Strip, strip);
1175 }
1176 }
1178 return CTX_RESULT_OK;
1179 }
1180 return CTX_RESULT_NO_DATA;
1181}
1184{
1185 wmWindow *win = CTX_wm_window(C);
1186 Scene *scene = WM_window_get_active_scene(win);
1188 if (ed == nullptr) {
1189 return CTX_RESULT_NO_DATA;
1190 }
1191
1193 LISTBASE_FOREACH (Strip *, strip, ed->seqbasep) {
1194 if (strip->flag & SELECT && !blender::seq::transform_is_locked(channels, strip)) {
1195 CTX_data_list_add(result, &scene->id, &RNA_Strip, strip);
1196 }
1197 }
1199 return CTX_RESULT_OK;
1200}
1201
1202/* Registry of context callback functions. */
1203
1205
1208{
1209 static blender::Map<blender::StringRef, context_callback> screen_context_functions = []() {
1211 map.add("scene", screen_ctx_scene);
1212 map.add("visible_objects", screen_ctx_visible_objects);
1213 map.add("selectable_objects", screen_ctx_selectable_objects);
1214 map.add("selected_objects", screen_ctx_selected_objects);
1215 map.add("selected_editable_objects", screen_ctx_selected_editable_objects);
1216 map.add("editable_objects", screen_ctx_editable_objects);
1217 map.add("objects_in_mode", screen_ctx_objects_in_mode);
1218 map.add("objects_in_mode_unique_data", screen_ctx_objects_in_mode_unique_data);
1219 map.add("visible_bones", screen_ctx_visible_bones);
1220 map.add("editable_bones", screen_ctx_editable_bones);
1221 map.add("selected_bones", screen_ctx_selected_bones);
1222 map.add("selected_editable_bones", screen_ctx_selected_editable_bones);
1223 map.add("visible_pose_bones", screen_ctx_visible_pose_bones);
1224 map.add("selected_pose_bones", screen_ctx_selected_pose_bones);
1225 map.add("selected_pose_bones_from_active_object",
1227 map.add("active_bone", screen_ctx_active_bone);
1228 map.add("active_pose_bone", screen_ctx_active_pose_bone);
1229 map.add("active_object", screen_ctx_active_object);
1230 map.add("object", screen_ctx_object);
1231 map.add("edit_object", screen_ctx_edit_object);
1232 map.add("sculpt_object", screen_ctx_sculpt_object);
1233 map.add("vertex_paint_object", screen_ctx_vertex_paint_object);
1234 map.add("weight_paint_object", screen_ctx_weight_paint_object);
1235 map.add("image_paint_object", screen_ctx_image_paint_object);
1236 map.add("particle_edit_object", screen_ctx_particle_edit_object);
1237 map.add("pose_object", screen_ctx_pose_object);
1238 map.add("active_sequence_strip", screen_ctx_active_sequence_strip); /* DEPRECATED */
1239 map.add("sequences", screen_ctx_sequences); /* DEPRECATED */
1240 map.add("selected_sequences", screen_ctx_selected_sequences); /* DEPRECATED */
1241 map.add("selected_editable_sequences",
1243 map.add("active_nla_track", screen_ctx_active_nla_track);
1244 map.add("active_nla_strip", screen_ctx_active_nla_strip);
1245 map.add("selected_nla_strips", screen_ctx_selected_nla_strips);
1246 map.add("selected_movieclip_tracks", screen_ctx_selected_movieclip_tracks);
1247 map.add("annotation_data", screen_ctx_annotation_data);
1248 map.add("annotation_data_owner", screen_ctx_annotation_data_owner);
1249 map.add("active_annotation_layer", screen_ctx_active_annotation_layer);
1250 map.add("grease_pencil", screen_ctx_grease_pencil_data);
1251 map.add("active_operator", screen_ctx_active_operator);
1252 map.add("active_action", screen_ctx_active_action);
1253 map.add("selected_visible_actions", screen_ctx_selected_visible_actions);
1254 map.add("selected_editable_actions", screen_ctx_selected_editable_actions);
1255 map.add("editable_fcurves", screen_ctx_editable_fcurves);
1256 map.add("visible_fcurves", screen_ctx_visible_fcurves);
1257 map.add("selected_editable_fcurves", screen_ctx_selected_editable_fcurves);
1258 map.add("selected_visible_fcurves", screen_ctx_selected_visible_fcurves);
1259 map.add("active_editable_fcurve", screen_ctx_active_editable_fcurve);
1260 map.add("selected_editable_keyframes", screen_ctx_selected_editable_keyframes);
1261 map.add("asset_library_reference", screen_ctx_asset_library);
1262 map.add("ui_list", screen_ctx_ui_list);
1263 map.add("property", screen_ctx_property);
1264 map.add("active_strip", screen_ctx_active_strip);
1265 map.add("strips", screen_ctx_strips);
1266 map.add("selected_strips", screen_ctx_selected_strips);
1267 map.add("selected_editable_strips", screen_ctx_selected_editable_strips);
1268 return map;
1269 }();
1270 return screen_context_functions;
1271}
1272
1273int ed_screen_context(const bContext *C, const char *member, bContextDataResult *result)
1274{
1275 if (CTX_data_dir(member)) {
1277 return CTX_RESULT_OK;
1278 }
1279
1282 context_callback callback = functions.lookup_default(member, nullptr);
1283 if (callback == nullptr) {
1285 }
1286
1287 return callback(C, result);
1288}
Functions to deal with Armatures.
C++ functions to deal with Armature collections (i.e. the successor of bone layers).
Blender kernel action and pose functionality.
bPoseChannel * BKE_pose_channel_active_if_bonecoll_visible(Object *ob) ATTR_WARN_UNUSED_RESULT
#define FOREACH_PCHAN_SELECTED_IN_OBJECT_END
#define FOREACH_PCHAN_VISIBLE_IN_OBJECT_BEGIN(_ob, _pchan)
#define FOREACH_PCHAN_SELECTED_IN_OBJECT_BEGIN(_ob, _pchan)
#define FOREACH_PCHAN_VISIBLE_IN_OBJECT_END
WorkSpace * CTX_wm_workspace(const bContext *C)
void CTX_data_dir_set(bContextDataResult *result, const char **dir)
void CTX_data_id_list_add(bContextDataResult *result, ID *id)
bScreen * CTX_wm_screen(const bContext *C)
void CTX_data_prop_set(bContextDataResult *result, PropertyRNA *prop, int index)
void CTX_data_pointer_set(bContextDataResult *result, ID *id, StructRNA *type, void *data)
bool CTX_data_dir(const char *member)
void CTX_data_id_pointer_set(bContextDataResult *result, ID *id)
SpaceFile * CTX_wm_space_file(const bContext *C)
ScrArea * CTX_wm_area(const bContext *C)
wmWindow * CTX_wm_window(const bContext *C)
eContextResult
@ CTX_RESULT_MEMBER_NOT_FOUND
@ CTX_RESULT_OK
@ CTX_RESULT_NO_DATA
void CTX_data_list_add(bContextDataResult *result, ID *id, StructRNA *type, void *data)
@ CTX_DATA_TYPE_PROPERTY
@ CTX_DATA_TYPE_COLLECTION
void CTX_data_pointer_set_ptr(bContextDataResult *result, const PointerRNA *ptr)
SpaceClip * CTX_wm_space_clip(const bContext *C)
ARegion * CTX_wm_region(const bContext *C)
void CTX_data_type_set(bContextDataResult *result, short type)
View3D * CTX_wm_view3d(const bContext *C)
struct bGPDlayer * BKE_gpencil_layer_active_get(struct bGPdata *gpd)
void BKE_view_layer_synced_ensure(const Scene *scene, ViewLayer *view_layer)
#define FOREACH_OBJECT_IN_MODE_END
Definition BKE_layer.hh:382
Object * BKE_view_layer_active_object_get(const ViewLayer *view_layer)
#define FOREACH_OBJECT_IN_MODE_BEGIN(_scene, _view_layer, _v3d, _object_type, _object_mode, _instance)
Definition BKE_layer.hh:377
blender::Vector< Object * > BKE_view_layer_array_from_objects_in_edit_mode_unique_data(const Scene *scene, ViewLayer *view_layer, const View3D *v3d)
ListBase * BKE_view_layer_object_bases_get(ViewLayer *view_layer)
Object * BKE_view_layer_edit_object_get(const ViewLayer *view_layer)
General operations, lookup, etc. for blender objects.
Object * BKE_object_pose_armature_get(Object *ob)
#define TRACK_SELECTED(track)
struct MovieTrackingObject * BKE_tracking_object_get_active(const struct MovieTracking *tracking)
#define BLI_assert_unreachable()
Definition BLI_assert.h:93
#define LISTBASE_FOREACH(type, var, list)
#define ELEM(...)
@ ID_TAG_DOIT
Definition DNA_ID.h:944
@ SACTCONT_ACTION
@ SACTCONT_SHAPEKEY
@ NLASTRIP_FLAG_SELECT
@ BONE_SELECTED
@ ARM_MIRROR_EDIT
#define OB_MODE_ALL_WEIGHT_PAINT
@ OB_MODE_PARTICLE_EDIT
@ OB_MODE_SCULPT
@ OB_MODE_POSE
@ OB_MODE_TEXTURE_PAINT
@ OB_MODE_OBJECT
@ OB_MODE_VERTEX_PAINT
Object is a sort of wrapper for general info.
@ OB_GREASE_PENCIL
@ OB_ARMATURE
#define BASE_SELECTED(v3d, base)
#define BASE_SELECTED_EDITABLE(v3d, base)
#define BASE_EDITABLE(v3d, base)
#define BASE_SELECTABLE(v3d, base)
#define BASE_VISIBLE(v3d, base)
@ SPACE_ACTION
@ SPACE_GRAPH
@ ANIMTYPE_NLACURVE
@ ANIMTYPE_FCURVE
@ ALE_NLASTRIP
eAnimCont_Types
@ ACHANNEL_SETTING_SELECT
bool ANIM_nla_context_strip_ptr(const bContext *C, PointerRNA *r_ptr)
bool ANIM_nla_context_track_ptr(const bContext *C, PointerRNA *r_ptr)
eAnimFilter_Flags
@ ANIMFILTER_ACTIVE
@ ANIMFILTER_FOREDIT
@ ANIMFILTER_DATA_VISIBLE
@ ANIMFILTER_CURVE_VISIBLE
@ ANIMFILTER_LIST_VISIBLE
@ ANIMFILTER_LIST_CHANNELS
@ ANIMFILTER_NODUPLIS
@ ANIMFILTER_FCURVESONLY
@ ANIMFILTER_SEL
#define EBONE_EDITABLE(ebone)
MovieClip * ED_space_clip_get_clip(const SpaceClip *sc)
#define C
Definition RandGen.cpp:29
uiList * UI_list_find_mouse_over(const ARegion *region, const wmEvent *event)
uiBut * UI_context_active_but_prop_get(const bContext *C, PointerRNA *r_ptr, PropertyRNA **r_prop, int *r_index)
wmOperator * UI_context_active_operator_get(const bContext *C)
bAction * ANIM_channel_action_get(const bAnimListElem *ale)
short ANIM_channel_setting_get(bAnimContext *ac, bAnimListElem *ale, eAnimChannel_Settings setting)
void ANIM_animdata_freelist(ListBase *anim_data)
Definition anim_deps.cc:463
bool ANIM_animdata_get_context(const bContext *C, bAnimContext *ac)
size_t ANIM_animdata_filter(bAnimContext *ac, ListBase *anim_data, const eAnimFilter_Flags filter_mode, void *data, const eAnimCont_Types datatype)
EditBone * ED_armature_ebone_get_mirrored(const ListBase *edbo, EditBone *ebo)
bool add(const Key &key, const Value &value)
Definition BLI_map.hh:295
Value lookup_default(const Key &key, const Value &default_value) const
Definition BLI_map.hh:570
bool add(const Key &key)
Definition BLI_set.hh:248
#define SELECT
bGPdata * ED_annotation_data_get_active_direct(ID *screen_id, ScrArea *area, Scene *scene)
bGPdata ** ED_annotation_data_get_pointers_direct(ID *screen_id, ScrArea *area, Scene *scene, PointerRNA *r_ptr)
#define filter
#define ID_IS_EDITABLE(_id)
bool bone_is_visible_editbone(const bArmature *armature, const EditBone *ebone)
ListBase * channels_displayed_get(const Editing *ed)
Definition channels.cc:28
Editing * editing_get(const Scene *scene)
Definition sequencer.cc:272
Strip * select_active_get(const Scene *scene)
bool transform_is_locked(ListBase *channels, const Strip *strip)
bool RNA_property_array_check(PropertyRNA *prop)
static eContextResult screen_ctx_selected_pose_bones(const bContext *C, bContextDataResult *result)
static eContextResult screen_ctx_objects_in_mode_unique_data(const bContext *C, bContextDataResult *result)
static eContextResult screen_ctx_selected_editable_objects(const bContext *C, bContextDataResult *result)
static eContextResult screen_ctx_active_operator(const bContext *C, bContextDataResult *result)
static eContextResult screen_ctx_sel_edit_fcurves_(const bContext *C, bContextDataResult *result, const int extra_filter)
static eContextResult screen_ctx_asset_library(const bContext *C, bContextDataResult *result)
static eContextResult screen_ctx_ui_list(const bContext *C, bContextDataResult *result)
static eContextResult screen_ctx_property(const bContext *C, bContextDataResult *result)
const char * screen_context_dir[]
static eContextResult screen_ctx_selected_objects(const bContext *C, bContextDataResult *result)
static eContextResult screen_ctx_selected_bones(const bContext *C, bContextDataResult *result)
static eContextResult screen_ctx_active_sequence_strip(const bContext *C, bContextDataResult *result)
static eContextResult screen_ctx_selected_editable_sequences(const bContext *C, bContextDataResult *result)
static eContextResult screen_ctx_selected_nla_strips(const bContext *C, bContextDataResult *result)
static eContextResult screen_ctx_strips(const bContext *C, bContextDataResult *result)
static eContextResult screen_ctx_editable_objects(const bContext *C, bContextDataResult *result)
static eContextResult screen_ctx_selected_sequences(const bContext *C, bContextDataResult *result)
static eContextResult screen_ctx_active_annotation_layer(const bContext *C, bContextDataResult *result)
static eContextResult screen_ctx_visible_pose_bones(const bContext *C, bContextDataResult *result)
static eContextResult screen_ctx_pose_object(const bContext *C, bContextDataResult *result)
eContextResult(*)(const bContext *C, bContextDataResult *result) context_callback
static eContextResult screen_ctx_selected_visible_fcurves(const bContext *C, bContextDataResult *result)
static eContextResult screen_ctx_selected_strips(const bContext *C, bContextDataResult *result)
static eContextResult screen_ctx_annotation_data(const bContext *C, bContextDataResult *result)
static eContextResult screen_ctx_edit_object(const bContext *C, bContextDataResult *result)
static eContextResult screen_ctx_active_bone(const bContext *C, bContextDataResult *result)
static eContextResult screen_ctx_objects_in_mode(const bContext *C, bContextDataResult *result)
static eContextResult screen_ctx_selectable_objects(const bContext *C, bContextDataResult *result)
static eContextResult screen_ctx_annotation_data_owner(const bContext *C, bContextDataResult *result)
static eContextResult screen_ctx_active_strip(const bContext *C, bContextDataResult *result)
static eContextResult screen_ctx_selected_visible_actions(const bContext *C, bContextDataResult *result)
static eContextResult screen_ctx_visible_fcurves(const bContext *C, bContextDataResult *result)
static eContextResult screen_ctx_editable_fcurves(const bContext *C, bContextDataResult *result)
static eContextResult screen_ctx_selected_editable_strips(const bContext *C, bContextDataResult *result)
static eContextResult screen_ctx_active_object(const bContext *C, bContextDataResult *result)
static eContextResult screen_ctx_selected_editable_actions(const bContext *C, bContextDataResult *result)
static eContextResult screen_ctx_particle_edit_object(const bContext *C, bContextDataResult *result)
static eContextResult screen_ctx_selected_editable_bones(const bContext *C, bContextDataResult *result)
int ed_screen_context(const bContext *C, const char *member, bContextDataResult *result)
static eContextResult screen_ctx_visible_objects(const bContext *C, bContextDataResult *result)
static eContextResult screen_ctx_editable_bones(const bContext *C, bContextDataResult *result)
static eContextResult screen_ctx_selected_editable_keyframes(const bContext *C, bContextDataResult *result)
static eContextResult screen_ctx_selected_editable_fcurves(const bContext *C, bContextDataResult *result)
static eContextResult screen_ctx_sel_actions_impl(const bContext *C, bContextDataResult *result, bool active_only, bool editable)
static eContextResult screen_ctx_object(const bContext *C, bContextDataResult *result)
static eContextResult screen_ctx_active_editable_fcurve(const bContext *C, bContextDataResult *result)
static eContextResult screen_ctx_selected_bones_(const bContext *C, bContextDataResult *result, const bool selected_editable_bones)
static eContextResult screen_ctx_grease_pencil_data(const bContext *C, bContextDataResult *result)
static eContextResult screen_ctx_selected_pose_bones_from_active_object(const bContext *C, bContextDataResult *result)
static eContextResult screen_ctx_visible_bones(const bContext *C, bContextDataResult *result)
static eContextResult screen_ctx_sequences(const bContext *C, bContextDataResult *result)
static eContextResult screen_ctx_vertex_paint_object(const bContext *C, bContextDataResult *result)
static eContextResult screen_ctx_active_pose_bone(const bContext *C, bContextDataResult *result)
static eContextResult screen_ctx_sculpt_object(const bContext *C, bContextDataResult *result)
static eContextResult screen_ctx_active_nla_strip(const bContext *C, bContextDataResult *result)
static eContextResult screen_ctx_visible_or_editable_bones_(const bContext *C, bContextDataResult *result, const bool editable_bones)
static eContextResult screen_ctx_active_nla_track(const bContext *C, bContextDataResult *result)
static eContextResult screen_ctx_image_paint_object(const bContext *C, bContextDataResult *result)
static eContextResult screen_ctx_scene(const bContext *C, bContextDataResult *result)
static eContextResult screen_ctx_weight_paint_object(const bContext *C, bContextDataResult *result)
static eContextResult screen_ctx_active_action(const bContext *C, bContextDataResult *result)
static eContextResult screen_ctx_selected_movieclip_tracks(const bContext *C, bContextDataResult *result)
static const blender::Map< blender::StringRef, context_callback > & ensure_ed_screen_context_functions()
ListBase * seqbasep
BezTriple * bezt
Definition DNA_ID.h:404
struct MovieTracking tracking
ListBase strips
struct bPose * pose
struct wmOperator * op
AssetLibraryReference asset_library_ref
SpaceLink * sl
eAnimCont_Types datatype
eSpace_Type spacetype
struct EditBone * act_edbone
ListBase * edbo
struct PointerRNA * ptr
struct wmEvent * eventstate
i
Definition text_draw.cc:230
PointerRNA * ptr
Definition wm_files.cc:4227
wmOperator * WM_operator_last_redo(const bContext *C)
ViewLayer * WM_window_get_active_view_layer(const wmWindow *win)
Scene * WM_window_get_active_scene(const wmWindow *win)