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:
authorDalai Felinto <dfelinto@gmail.com>2019-05-21 16:49:05 +0300
committerDalai Felinto <dfelinto@gmail.com>2019-05-22 01:24:04 +0300
commit0910932e71d2b869e0f9d4289d89f20c64beabaa (patch)
tree534961a356c0cf86efa282f3fb9ba9d9ce5327fe /source/blender/editors/screen/screen_context.c
parent58a75d01a6247063ae3a570150a4402e3cdf1e5a (diff)
Remove "_base*" from context API
We are not exposing RNA_ObjectBase in the 2.80 API. Thus we can't have operators relying on it (e.g, CTX_data_visible_bases, CTX_data_active_base, ...). Otherwise users won't be able to override context for these operators. This commit keep the CTX_data_.*bases() functions around so we don't need to change the operators and potentially break things that late into 2.80. However as far as the Python scripters are concerned there is no base to be overriden, ever. That also simplify the guessing game addon developers have to play when trying to override an operatori context. They still need to find whether an operator requires editables, visibles, selected, ... objects. But at least they don't need to find out whether the operators need base or object.
Diffstat (limited to 'source/blender/editors/screen/screen_context.c')
-rw-r--r--source/blender/editors/screen/screen_context.c59
1 files changed, 0 insertions, 59 deletions
diff --git a/source/blender/editors/screen/screen_context.c b/source/blender/editors/screen/screen_context.c
index c60469e092f..6a5df8a3776 100644
--- a/source/blender/editors/screen/screen_context.c
+++ b/source/blender/editors/screen/screen_context.c
@@ -69,15 +69,10 @@ const char *screen_context_dir[] = {
"scene",
"view_layer",
"visible_objects",
- "visible_bases",
"selectable_objects",
- "selectable_bases",
"selected_objects",
- "selected_bases",
"editable_objects",
- "editable_bases",
"selected_editable_objects",
- "selected_editable_bases",
"objects_in_mode",
"objects_in_mode_unique_data",
"visible_bones",
@@ -89,7 +84,6 @@ const char *screen_context_dir[] = {
"selected_pose_bones_from_active_object",
"active_bone",
"active_pose_bone",
- "active_base",
"active_object",
"object",
"edit_object",
@@ -179,52 +173,6 @@ 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, "visible_bases")) {
- for (Base *base = view_layer->object_bases.first; base; base = base->next) {
- if (BASE_VISIBLE(v3d, base)) {
- CTX_data_list_add(result, &scene->id, &RNA_ObjectBase, base);
- }
- }
- CTX_data_type_set(result, CTX_DATA_TYPE_COLLECTION);
- return 1;
- }
- else if (CTX_data_equals(member, "selectable_bases")) {
- for (Base *base = view_layer->object_bases.first; base; base = base->next) {
- if (BASE_SELECTABLE(v3d, base)) {
- CTX_data_list_add(result, &scene->id, &RNA_ObjectBase, base);
- }
- }
- CTX_data_type_set(result, CTX_DATA_TYPE_COLLECTION);
- return 1;
- }
- else if (CTX_data_equals(member, "selected_bases")) {
- for (Base *base = view_layer->object_bases.first; base; base = base->next) {
- if (BASE_SELECTED(v3d, base)) {
- CTX_data_list_add(result, &scene->id, &RNA_ObjectBase, base);
- }
- }
- CTX_data_type_set(result, CTX_DATA_TYPE_COLLECTION);
- return 1;
- }
- else if (CTX_data_equals(member, "selected_editable_bases")) {
- for (Base *base = view_layer->object_bases.first; base; base = base->next) {
- if (BASE_SELECTED_EDITABLE(v3d, base)) {
- CTX_data_list_add(result, &scene->id, &RNA_ObjectBase, base);
- }
- }
- CTX_data_type_set(result, CTX_DATA_TYPE_COLLECTION);
- return 1;
- }
- else if (CTX_data_equals(member, "editable_bases")) {
- /* Visible + Editable, but not necessarily selected */
- for (Base *base = view_layer->object_bases.first; base; base = base->next) {
- if (BASE_EDITABLE(v3d, base)) {
- CTX_data_list_add(result, &scene->id, &RNA_ObjectBase, base);
- }
- }
- 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) {
@@ -455,13 +403,6 @@ int ed_screen_context(const bContext *C, const char *member, bContextDataResult
return 1;
}
}
- else if (CTX_data_equals(member, "active_base")) {
- if (view_layer->basact) {
- CTX_data_pointer_set(result, &scene->id, &RNA_ObjectBase, view_layer->basact);
- }
-
- return 1;
- }
else if (CTX_data_equals(member, "active_object")) {
if (obact) {
CTX_data_id_pointer_set(result, &obact->id);