Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSybren A. Stüvel <sybren@blender.org>2021-10-26 19:15:55 +0300
committerSybren A. Stüvel <sybren@blender.org>2021-10-26 19:35:13 +0300
commit03c0581c6ed6eb98c4c4c7bf42c92d623880dfac (patch)
tree67d8c951ecd5ed90fb18eda75f4bee6850f4de85 /source/blender
parent2d5c9e0bafcca0624ceec324b6c3ca384a748d36 (diff)
Assets: allow Mark/Clear Asset operators from 3D Viewport
Make it possible to run `ASSET_OT_mark` and `ASSET_OT_clear` operators from the 3D Viewport. There is no menu entry, just compatibility with pressing F3 and executing the operators from the operator search.
Diffstat (limited to 'source/blender')
-rw-r--r--source/blender/editors/space_view3d/space_view3d.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/source/blender/editors/space_view3d/space_view3d.c b/source/blender/editors/space_view3d/space_view3d.c
index 2b0e302a0d1..10fd7670996 100644
--- a/source/blender/editors/space_view3d/space_view3d.c
+++ b/source/blender/editors/space_view3d/space_view3d.c
@@ -1690,6 +1690,7 @@ static void space_view3d_refresh(const bContext *C, ScrArea *area)
const char *view3d_context_dir[] = {
"active_object",
+ "selected_ids",
NULL,
};
@@ -1728,6 +1729,17 @@ static int view3d_context(const bContext *C, const char *member, bContextDataRes
return CTX_RESULT_OK;
}
+ if (CTX_data_equals(member, "selected_ids")) {
+ ListBase selected_objects;
+ CTX_data_selected_objects(C, &selected_objects);
+ LISTBASE_FOREACH (PointerRNA *, object_ptr, &selected_objects) {
+ ID *selected_id = object_ptr->data;
+ CTX_data_id_list_add(result, selected_id);
+ }
+ BLI_freelistN(&selected_objects);
+ CTX_data_type_set(result, CTX_DATA_TYPE_COLLECTION);
+ return CTX_RESULT_OK;
+ }
return CTX_RESULT_MEMBER_NOT_FOUND;
}