Page MenuHome

Open linked datablock in new Blender, reloading lib when sub-blender quits
Needs ReviewPublic

Authored by Sybren A. Stüvel (sybren) on Oct 7 2016, 2:49 PM.

Details

Summary

With this patch, it is possible to right-click on linked datablocks (in the outliner), and choose "Open in new Blender". A new Blender process is started to edit the library file, while a modal operator keeps running to monitor the subprocess. After the subprocess finishes, the operator reloads the library blendfile and finishes.

One thing I'm not too happy about is the fact that the "Open in new Blender" menu item is always shown. I've simply added it to the exisiting menu items for various datablock types. Ideally it should only be added when the right-clicked datablock is actually linked. I don't know if that's possible with the current menu structure, though.

Diff Detail

Repository
rB Blender
Branch
sybren-open-in-new-blender
Build Status
Buildable 222
Build 222: arc lint + arc unit

Event Timeline

Sybren A. Stüvel (sybren) retitled this revision from to Open linked datablock in new Blender, reloading lib when sub-blender quits.
Sybren A. Stüvel (sybren) updated this object.
Sybren A. Stüvel (sybren) set the repository for this revision to rB Blender.

Yeah… One day, we'll have to rewrite completely those outilner menus, the way they are working currently is insane, painful to follow, totally static options, useless layers of callbacks, etc. A total PITA.

This should just generate its own 'local' context, including 'active' and selected entries (as done by the Buttons window e.g.), and be regular menu with regular operators besides that (would also allow add-ons to extend those menus with own stuff, and so on). That way, operator's poll function could be used to determine whether it can be shown in menu or not.

But for now… eeeeh… Not sure. On one end it’s nice feature to have, on the other it will feel a bit unfinished with that option showing up in many wrong cases.

To mitigate that, maybe you could only enable it for Library entries? Realize it would be less friendly to use, though. :/

Yeah… [...] A total PITA.

Yeah...

But for now… eeeeh… Not sure. On one end it’s nice feature to have, on the other it will feel a bit unfinished with that option showing up in many wrong cases.

To mitigate that, maybe you could only enable it for Library entries? Realize it would be less friendly to use, though. :/

I agree completely with the "will feel a bit unfinished", I'm also not too happy with it. On the other hand, only enabling it for libraries kind of defeats the point. I added this feature to be able to easily open anything that's linked, without having to figure out where it's linked from. Is there something we can do with a callback of some sort, in which I can decide at runtime whether to include the "Open in new Blender" menu item?

@Bastien Montagne (mont29) what do you think is necessary to get this into 2.79?

Honestly? Decide whether we accept that ok-ish feature as-is in master. Besides adding yet another set of specific menus for linked objects, linked groups, linked-other-datablocks, etc. (which is not an option imho), I do not see how we can avoid adding that option to all IDs in outliner, linked or not. Piece of crap needs full rewrite, but that’s for another time.

Have mixed feelings here, on one hand it’s nice feature, on the other it’s not critical “must have” either… @Campbell Barton (campbellbarton), @Sergey Sharybin (sergey), @Julian Eisel (Severin), thoughts?

source/blender/editors/space_outliner/outliner_tools.c
484

Should report a warning imho… At least so that user knows why it does nothing.

Have mixed feelings here, on one hand it’s nice feature, on the other it’s not critical “must have” either…

I share your feelings. When I showed the feature here at the studio people were enthousiastic. However, I agree the context menu doesn't quite invite the nicest of implementations.