Page MenuHome

Fix T84327: outliner_id_copy_tag was only copying from expanded nodes
ClosedPublic

Authored by Pi Lanningham (Quantumplation) on Jan 5 2021, 2:59 AM.

Details

Summary

If a node was closed in the hierarchy, we would only copy that node,
even if child nodes were selected.

This restriction seems intentional, but it's unclear why. The most
intuitive behavior is to copy all items selected, regardless of whether
the node is collapsed.

By removing the if condition, we always recurse, grabbing anything the
user has selected for the copy. This method doesn't appear to be used
anywhere else so I don't think this would have any unintended consequences.

I believe another potential solution would be to set the
space_outliner->search_flags to include SO_SEARCH_RECURSIVE, as the
TSELEM_OPEN macro checks this, but given that I'm not as familiar with
the code base, I went for the more straightforward approach.

Diff Detail

Repository
rB Blender

Event Timeline

Pi Lanningham (Quantumplation) requested review of this revision.Jan 5 2021, 2:59 AM
Pi Lanningham (Quantumplation) created this revision.

Note: the original commit where this was added doesn't provide much insight as to why this choice was made:

https://developer.blender.org/rB94388d69bb8082945e95f1b7583320cd43d90c69

Pi Lanningham (Quantumplation) retitled this revision from Recurse unconditionally in outliner_id_copy_tag, See T84327 to Fix T84327: outliner_id_copy_tag was only copying from expanded nodes.Jan 5 2021, 4:14 AM

Would it be possible to add an option to copy the node and all its children regardless of selection?
It feels wrong to have to select all the children first when most of the time you want to copy the whole subtree

Would it be possible to add an option to copy the node and all its children regardless of selection?
It feels wrong to have to select all the children first when most of the time you want to copy the whole subtree

Hello,
write me PM on blenderartists.org or devtalk.blender.org (I'm "APEC" here), maybe I have a solution for you.

Would it be possible to add an option to copy the node and all its children regardless of selection?
It feels wrong to have to select all the children first when most of the time you want to copy the whole subtree

Probably! But I think that's a separate feature request, and a bit outside the scope of this particular bugfix.

This revision is now accepted and ready to land.Jan 11 2021, 10:17 AM

I imagine this was just a copy-paste error, in another operator ignoring hidden items makes sense, but not here.

This revision now requires review to proceed.Jan 11 2021, 11:18 AM

yes indeed, in that context think it makes sense to copy also non-visible-in-outliner objects...

This revision is now accepted and ready to land.Jan 11 2021, 11:58 AM