Page MenuHome

Fix T77844: Expose 'ViewLayer.object_bases' to RNA/Python API
Needs RevisionPublic

Authored by Campbell Barton (campbellbarton) on Jan 7 2021, 7:41 AM.

Details

Summary

This exposes ViewLayer.object_bases, similar to 2.7x Scene.object_bases.

It's an open topic if we should expose this or continue to keen this data-type mostly internal.

Submitting this for review since we might want avoid exposing ObjectBase and resolve the bug some other way.

NOTE: Python already has access to ObjectBase currently via context.active_base in the 3D view, so it's not completely hidden from Python.

This patch resolves T77844: outliner visibility not binded to bpy.context.object.hide_viewport.

At the moment there is no data-path we display when changing ObjectBase.hide_viewport
since there is no way to access this from the context.

This patch addresses this by exposing a object bases and defining a path callback
so these values can be looked up.

Diff Detail

Repository
rB Blender
Branch
TEMP-VIEWLAYER-OBJECT-BASES (branched from master)
Build Status
Buildable 12029
Build 12029: arc lint + arc unit

Event Timeline

Campbell Barton (campbellbarton) requested review of this revision.Jan 7 2021, 7:41 AM
Campbell Barton (campbellbarton) created this revision.
Campbell Barton (campbellbarton) retitled this revision from Add ViewLayer.object_bases to Expose 'ViewLayer.object_bases' to RNA/Python API.Jan 7 2021, 7:59 AM
Campbell Barton (campbellbarton) edited the summary of this revision. (Show Details)
Campbell Barton (campbellbarton) edited the summary of this revision. (Show Details)
Campbell Barton (campbellbarton) retitled this revision from Expose 'ViewLayer.object_bases' to RNA/Python API to Fix T77844: Expose 'ViewLayer.object_bases' to RNA/Python API.

I made something similar with D9575 but I got the impression in chat that bases were hidden by design in 2.8 and there was no way they would ever get exposed again.

Bastien Montagne (mont29) requested changes to this revision.Jan 11 2021, 5:05 PM

Think this needs to be discussed as a design task, imho T77844 is not valid anymore and should be closed?

This revision now requires changes to proceed.Jan 11 2021, 5:05 PM