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:
-rw-r--r--doc/python_api/sphinx_doc_gen.py6
-rw-r--r--source/blender/editors/screen/screen_context.c25
2 files changed, 29 insertions, 2 deletions
diff --git a/doc/python_api/sphinx_doc_gen.py b/doc/python_api/sphinx_doc_gen.py
index ec2ee39a5e1..eda0ab637fa 100644
--- a/doc/python_api/sphinx_doc_gen.py
+++ b/doc/python_api/sphinx_doc_gen.py
@@ -1014,8 +1014,8 @@ context_type_map = {
"gpencil_data": ("GreasePencel", False),
"gpencil_data_owner": ("ID", False),
"image_paint_object": ("Object", False),
- "light": ("Light", False),
"lattice": ("Lattice", False),
+ "light": ("Light", False),
"lightprobe": ("LightProbe", False),
"line_style": ("FreestyleLineStyle", False),
"material": ("Material", False),
@@ -1023,6 +1023,8 @@ context_type_map = {
"mesh": ("Mesh", False),
"meta_ball": ("MetaBall", False),
"object": ("Object", False),
+ "objects_in_mode": ("Object", True),
+ "objects_in_mode_unique_data": ("Object", True),
"particle_edit_object": ("Object", False),
"particle_settings": ("ParticleSettings", False),
"particle_system": ("ParticleSystem", False),
@@ -1054,6 +1056,7 @@ context_type_map = {
"texture_user_property": ("Property", False),
"uv_sculpt_object": ("Object", False),
"vertex_paint_object": ("Object", False),
+ "view_layer": ("ViewLayer", False),
"visible_bases": ("ObjectBase", True),
"visible_bones": ("EditBone", True),
"visible_gpencil_layers": ("GPencilLayer", True),
@@ -1061,7 +1064,6 @@ context_type_map = {
"visible_pose_bones": ("PoseBone", True),
"weight_paint_object": ("Object", False),
"world": ("World", False),
- "view_layer": ("ViewLayer", False),
}
diff --git a/source/blender/editors/screen/screen_context.c b/source/blender/editors/screen/screen_context.c
index a33bea4d1be..15d9b3c5ccb 100644
--- a/source/blender/editors/screen/screen_context.c
+++ b/source/blender/editors/screen/screen_context.c
@@ -77,6 +77,7 @@ const char *screen_context_dir[] = {
"selected_objects", "selected_bases",
"editable_objects", "editable_bases",
"selected_editable_objects", "selected_editable_bases",
+ "objects_in_mode", "objects_in_mode_unique_data",
"visible_bones", "editable_bones", "selected_bones", "selected_editable_bones",
"visible_pose_bones", "selected_pose_bones", "selected_pose_bones_from_active_object",
"active_bone", "active_pose_bone",
@@ -245,6 +246,30 @@ int ed_screen_context(const bContext *C, const char *member, bContextDataResult
CTX_data_type_set(result, CTX_DATA_TYPE_COLLECTION);
return 1;
}
+ else if (CTX_data_equals(member, "objects_in_mode")) {
+ if (obact && (obact->mode != OB_MODE_OBJECT)) {
+ FOREACH_OBJECT_IN_MODE_BEGIN (view_layer, v3d, obact->type, obact->mode, ob_iter) {
+ CTX_data_id_list_add(result, &ob_iter->id);
+ } FOREACH_OBJECT_IN_MODE_END;
+ }
+ CTX_data_type_set(result, CTX_DATA_TYPE_COLLECTION);
+ return 1;
+ }
+ else if (CTX_data_equals(member, "objects_in_mode_unique_data")) {
+ if (obact && (obact->mode != OB_MODE_OBJECT)) {
+ FOREACH_OBJECT_IN_MODE_BEGIN (view_layer, v3d, obact->type, obact->mode, ob_iter) {
+ ob_iter->id.tag |= LIB_TAG_DOIT;
+ } FOREACH_OBJECT_IN_MODE_END;
+ FOREACH_OBJECT_IN_MODE_BEGIN (view_layer, v3d, obact->type, obact->mode, ob_iter) {
+ if (ob_iter->id.tag & LIB_TAG_DOIT) {
+ ob_iter->id.tag &= ~LIB_TAG_DOIT;
+ CTX_data_id_list_add(result, &ob_iter->id);
+ }
+ } FOREACH_OBJECT_IN_MODE_END;
+ }
+ CTX_data_type_set(result, CTX_DATA_TYPE_COLLECTION);
+ return 1;
+ }
else if (CTX_data_equals(member, "visible_bones") || CTX_data_equals(member, "editable_bones")) {
bArmature *arm = (obedit && obedit->type == OB_ARMATURE) ? obedit->data : NULL;
EditBone *ebone, *flipbone = NULL;