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:
Diffstat (limited to 'source/blender/makesrna/intern/rna_object_api.c')
-rw-r--r--source/blender/makesrna/intern/rna_object_api.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/source/blender/makesrna/intern/rna_object_api.c b/source/blender/makesrna/intern/rna_object_api.c
index 17233b100c8..0d2e5dce496 100644
--- a/source/blender/makesrna/intern/rna_object_api.c
+++ b/source/blender/makesrna/intern/rna_object_api.c
@@ -134,6 +134,7 @@ static bool rna_Object_select_get(Object *ob, bContext *C, ReportList *reports)
static bool rna_Object_visible_get(Object *ob, bContext *C, ReportList *reports)
{
ViewLayer *view_layer = CTX_data_view_layer(C);
+ View3D *v3d = CTX_wm_view3d(C);
Base *base = BKE_view_layer_base_find(view_layer, ob);
if (!base) {
@@ -141,6 +142,10 @@ static bool rna_Object_visible_get(Object *ob, bContext *C, ReportList *reports)
return false;
}
+ if (v3d->localvd && ((base->local_view_bits & v3d->local_view_uuid) == 0)) {
+ return false;
+ }
+
return ((base->flag & BASE_VISIBLE) != 0);
}
@@ -503,7 +508,7 @@ void RNA_api_object(StructRNA *srna)
RNA_def_function_return(func, parm);
func = RNA_def_function(srna, "visible_get", "rna_Object_visible_get");
- RNA_def_function_ui_description(func, "Get the object visibility for the active view layer");
+ RNA_def_function_ui_description(func, "Get the object visibility for the active view layer and viewport");
RNA_def_function_flag(func, FUNC_USE_CONTEXT | FUNC_USE_REPORTS);
parm = RNA_def_boolean(func, "result", 0, "", "Object visible");
RNA_def_function_return(func, parm);