Page MenuHome

Cleanup: Remove unused View3D member from ObjectsInModeIteratorData.
AbandonedPublic

Authored by Bastien Montagne (mont29) on Oct 12 2019, 1:07 PM.

Details

Summary

Not sure why/if that data was ever needed (maybe at some point to handle
local view?), but it is currently unused, and removing it allows to
remove the view3D parameter from a lot of utils functions and
macros based on that iterator.

Found while investigating T70714.

Diff Detail

Repository
rB Blender
Branch
tmp-ObjectsInModeIteratorData-cleanup-view3d (branched from master)
Build Status
Buildable 5341
Build 5341: arc lint + arc unit

Event Timeline

Bastien Montagne (mont29) planned changes to this revision.Oct 12 2019, 1:08 PM

Arg there was a prpblem with the rebase to 2.81 release branch it seems… sigh

Proper diff from blender-v2.81-release branch...

Is this intended to go to master or the release branch? Generally I would think cleanups are for the master branch only.

Otherwise seems like a good simplification.

This revision is now accepted and ready to land.Oct 14 2019, 4:30 PM

I’d agree that cleanup should go to master only… except that this will then make both branches diverge more, potentially making merges from release more and more complicated?

Don’t know for sure, if you think we can keep doing that kind of noisy cleanups in master only without too much hassle when merging release branch, am fine with doing that in master only.

Dalai Felinto (dfelinto) requested changes to this revision.EditedOct 15 2019, 4:47 AM

Please do not commit this.

We should actually be using v3d to determine if the base is visible.

For example in the following file, select all and move it, but do it from one of the local views.

Same for the next example and local collections:

Editing in these cases is not restrict to the local view/collections, but it is affecting all the viewport objects.

Of course we can do this outside the API calls, but that would mean do it for every single operator.

This revision now requires changes to proceed.Oct 15 2019, 4:47 AM

See D6064 for proposed solution. It may need more work, but it covers the basic cases.

OK so we still need the View3D for that… This is a bit annoying, and lots of code actually just pass a NULL pointer already, what's the actual expected behavior in that case?

If v3d is NULL means we are not calling the function from the viewport (or the operator should work regardless of viewport - e.g., F12), so we take only the viewlayer visibility generic into consideration. An example is the dopesheet when you want to see only the "visible" objects. It should show the same objects you get when in a viewport without localview/local collections/ob type restriction.