depsgraph.object_instances does not respect collection visibility #74368
Labels
No Label
Interest
Alembic
Interest
Animation & Rigging
Interest
Asset Browser
Interest
Asset Browser Project Overview
Interest
Audio
Interest
Automated Testing
Interest
Blender Asset Bundle
Interest
BlendFile
Interest
Collada
Interest
Compatibility
Interest
Compositing
Interest
Core
Interest
Cycles
Interest
Dependency Graph
Interest
Development Management
Interest
EEVEE
Interest
EEVEE & Viewport
Interest
Freestyle
Interest
Geometry Nodes
Interest
Grease Pencil
Interest
ID Management
Interest
Images & Movies
Interest
Import Export
Interest
Line Art
Interest
Masking
Interest
Metal
Interest
Modeling
Interest
Modifiers
Interest
Motion Tracking
Interest
Nodes & Physics
Interest
OpenGL
Interest
Overlay
Interest
Overrides
Interest
Performance
Interest
Physics
Interest
Pipeline, Assets & IO
Interest
Platforms, Builds & Tests
Interest
Python API
Interest
Render & Cycles
Interest
Render Pipeline
Interest
Sculpt, Paint & Texture
Interest
Text Editor
Interest
Translations
Interest
Triaging
Interest
Undo
Interest
USD
Interest
User Interface
Interest
UV Editing
Interest
VFX & Video
Interest
Video Sequencer
Interest
Virtual Reality
Interest
Vulkan
Interest
Wayland
Interest
Workbench
Interest: X11
Legacy
Blender 2.8 Project
Legacy
Milestone 1: Basic, Local Asset Browser
Legacy
OpenGL Error
Meta
Good First Issue
Meta
Papercut
Meta
Retrospective
Meta
Security
Module
Animation & Rigging
Module
Core
Module
Development Management
Module
EEVEE & Viewport
Module
Grease Pencil
Module
Modeling
Module
Nodes & Physics
Module
Pipeline, Assets & IO
Module
Platforms, Builds & Tests
Module
Python API
Module
Render & Cycles
Module
Sculpt, Paint & Texture
Module
Triaging
Module
User Interface
Module
VFX & Video
Platform
FreeBSD
Platform
Linux
Platform
macOS
Platform
Windows
Priority
High
Priority
Low
Priority
Normal
Priority
Unbreak Now!
Status
Archived
Status
Confirmed
Status
Duplicate
Status
Needs Info from Developers
Status
Needs Information from User
Status
Needs Triage
Status
Resolved
Type
Bug
Type
Design
Type
Known Issue
Type
Patch
Type
Report
Type
To Do
No Milestone
No project
No Assignees
4 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: blender/blender#74368
Loading…
Reference in New Issue
No description provided.
Delete Branch "%!s(<nil>)"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
System Information
Operating system: Windows-10-10.0.18362-SP0 64 Bits
Graphics card: GeForce GTX 860M/PCIe/SSE2 NVIDIA Corporation 4.5.0 NVIDIA 436.48
Blender Version
Broken: version: 2.83 (sub 5), branch: master, commit date: 2020-02-26 22:33, hash:
1a1f2912e6
Worked: 2.80 release
Short description of error
Collection visibility (Hide in Viewport) does not affect object appearance in
depsgraph.object_instances
.While hiding objects individually or excluding collection from view layer or Disable in Viewports does hide them from
depsgraph.object_instances
.In 2.80 release collection visibility did affect
depsgraph.object_instances
.Exact steps for others to reproduce the error
Hide in Viewport
visibility options and run script > console output has the same objects regardless of collection visibility state.Hide in Viewport
on an individual object > console output remose this individual objectAdded subscriber: @MikhailRachinskiy
Added subscriber: @brecht
Changed status from 'Needs Triage' to: 'Needs User Info'
But then why individually hidden objects are missing from depsgraph? Shouldn't there be a universally expected behaviour?
Currently behaviour is confusing: objects hidden individually are out of depsgraph, objects hidden by collection are appearing in depsgraph.
Changed status from 'Needs User Info' to: 'Needs Triage'
Sorry I must have confused something while testing the issue, Collection Disable in Viewport option is in fact hides objects from depsgraph. The issue is only with Hide in Viewport option.
I edited task description to reflect this.
Added subscribers: @dfelinto, @lichtwerk
Changed status from 'Needs Triage' to: 'Confirmed'
I would also argue that
Hide in Viewport
should not remove the object from thedepsgraph.object_instances
list.The bug here seems to be the fact that if you hide an object individually [not the collection], the object gets indeed removed from the list (which is wrong I think)
CC @dfelinto
I would argue that hidden objects should not be present in
depsgraph.object_instances
.API documentation for depsgraph.object_instances says the following:
Hidden objects (with Hide in Viewport) are not displayed, therefore they should not be in the list.
Just how it was in 2.80.
Changed status from 'Confirmed' to: 'Needs User Info'
The difference between collections and objects is that you can view a collection that is disabled for viewports in a viewport, when using "Local Collections" option. The same is not true for objects.
@MikhailRachinskiy what are you trying to do exactly with the Python API?
I am trying to get a list of all visible objects and their instances.
I can use
ob.visible_get()
to know if object is visible to the user, but instances do not have this method, I cannot check their visibility.With current system instances that are hidden to the user would still appear in this list.
Changed status from 'Needs User Info' to: 'Confirmed'
I agree it would be better if the collections and objects behaved consistent here, also just to make it easier to write add-ons.
I wouldn't consider it a bug, but a known issue that would be good to address.