Page MenuHome

Properties Panel: Object Visibility Restrictions

Authored by Dalai Felinto (dfelinto) on May 17 2019, 8:27 PM.



Outliner should not be the only way for users to change these settings.

Python API:
I had to add new Python API entries for these properties.
It makes more sense to have them "ON" by default when looking in this panel.

Diff Detail

rB Blender
viz-restrictions-dev (branched from master)
Build Status
Buildable 3643
Build 3643: arc lint + arc unit

Event Timeline

Missed registering the panel after a cleanup before uploading the patch

It would have been great if the properties had always been show rather than hide. We could still consider making that API change, but that's tricky regarding keyframing. It's unfortunate these properties will not show the keyframing in the properties editor, that seems quite important.


I would just name this "Visibility", don't think we need restrictions in there.

Options I can think of:

  1. API drastic change from hide_* to show_* + doversion for fcurves.
  2. Extend Depsgraph to support hide_viewport, hide_render, show_viewport, show_render.
  3. Change Layout API to support a "flip_boolean" option.

Now that I think of it, the [2] seems bad because users may end up keyframing both rna properties (hide_ and show_) leading to unpredictable results.
I'm tempted to pursuit 3.

  • From review: Rename panel

I must admit that the fact that the animation is not reflected in the Outliner seems almost like a dealbreaker for this. Additionally, this only works for objects but not Collections, since there is no Collections Properties.

Not trivial issues to solve, but it makes me wonder if we should do this or not?

New approach: Add a new argument to prop to invert checkbox value

For the records, it would be nice if we could pass 'ICON_NONE' for a button and have it not fallback to the prop defined one. I find this to be a weak design for booleans. That's why I had to remove the icons from rna_object.c and manually add them in the outliner draw code.

PS.: Is it ok to run that many RNA_property_boolean_get() calls? I could hardcode the tests (e.g., check for OB_RESTRICT_RENDER directly) if the overhead of the RNA_ call is too much.

Adding Campbell since I'm changing RNA/UI API. Removing Sergey since the current version of the patch no longer bothers with Depsgraph.

This revision is now accepted and ready to land.May 20 2019, 12:18 PM
This revision was automatically updated to reflect the committed changes.