Page MenuHome

Outliner Toggle inverts (improved behaviour )
AbandonedPublic

Authored by Alan Troth (Al) on Aug 24 2015, 1:27 AM.

Details

Summary

This diff is a response to T40085.

Current behaviour when multiple objects are highlighted in the outline editor and 'S' is pressed to toggle selectability is that each object's selectability is toggled individually. E.g. 4 objects are highlighted, 3 selectable and 1 with restricted selectability, pressing 'S' to toggle selectability will end up with 3 objects with restricted selectability and 1 selectable.

The improved behaviour causes the objects to be toggled as one. If any of the highlighted objects has restricted selectability ans 'S' is pressed then all objects become selectable, else all object get restricted selectability.

The same rule applies to 'V' visibility and 'R' renderability.

To check if any highlighted object has restricted selectability, visibility or renderability I've added a function:

bool outliner_do_object_query_any_true(...)'.

The restrict flags of highlighted objects are set or cleared depending on the result from this function.

Diff Detail

Repository
rB Blender

Event Timeline

Alan Troth (Al) retitled this revision from to Outliner Toggle inverts (improved behaviour ).
Alan Troth (Al) updated this object.
Alan Troth (Al) set the repository for this revision to rB Blender.
Alan Troth (Al) added a project: BF Blender.
Campbell Barton (campbellbarton) requested changes to this revision.Sep 2 2015, 12:51 PM
Campbell Barton (campbellbarton) edited edge metadata.

Generally the approach seems fine, however theres some redundant lookups.

source/blender/editors/space_outliner/outliner_edit.c
407–409

Checking the base is redundant, You can just use ob , since the base isn't used. This applies to other parts of this patch too.

This revision now requires changes to proceed.Sep 2 2015, 12:51 PM
Alan Troth (Al) edited edge metadata.

The new code uses the object pointer from tselem->id instead of going through Base to find it.

Alan Troth (Al) abandoned this revision.May 20 2018, 12:20 PM

Too old, the file has probably change too much for easy integration.. Also the task that spawned this diff is back in the 'quick hacks' list.