Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoshua Leung <aligorith@gmail.com>2015-02-15 15:15:58 +0300
committerJoshua Leung <aligorith@gmail.com>2015-02-15 15:21:47 +0300
commit263518ec4909a8e108a587988b6c64e66b12ac9f (patch)
treeb6606283c50c904ef22c4398bd9cb4772e10f033 /release/scripts
parent0688f6e01201defc36df906c2d7086eb7f44d849 (diff)
Outliner: "Purge All" function for Outliner in "Orphaned Datablocks" mode
Many users have been requesting a way to remove unused datablocks from the file/session "without closing and reopening" Blender (or at least that's the impression I'm getting). This commit adds a new operator (exposed as the "Purge All" button in the header of the "Orphaned Datablocks" mode in the Outliner, which seems to be the logical place for this) for doing so. It does so by wrapping up the save and "revert" (i.e. reload the saved file from disk, without needing to quit Blender) operators along with a confirmation prompt for good measure. Caveats: * Ultimately, we still cannot really cleanly delete any datablocks from the current session outright without reloading the file/data at some point. Thus, we do need to reload the file again before it can be used. * This does mean that this operation is irreversible. Notably, Undo history is lost is doing this operation. Hence the warnings... (Then again, undo/redo actually reloads the entire scene DB from memory, so it's not anything uncommon ;) Other Notes: * The addition of this operator brings this mode more into line with being a kind of "Trashcan" place, with this new operator being the manual "Empty Trash" button. If the "Orphaned Datablocks" name is too obscure, maybe we could rename this mode to "Trash" or something similar?
Diffstat (limited to 'release/scripts')
-rw-r--r--release/scripts/startup/bl_ui/space_outliner.py2
1 files changed, 2 insertions, 0 deletions
diff --git a/release/scripts/startup/bl_ui/space_outliner.py b/release/scripts/startup/bl_ui/space_outliner.py
index 47c8cc65247..9c6018965a7 100644
--- a/release/scripts/startup/bl_ui/space_outliner.py
+++ b/release/scripts/startup/bl_ui/space_outliner.py
@@ -57,6 +57,8 @@ class OUTLINER_HT_header(Header):
else:
row = layout.row()
row.label(text="No Keying Set active")
+ elif space.display_mode == 'ORPHANED_DATABLOCKS':
+ layout.operator("outliner.orphans_purge")
class OUTLINER_MT_editor_menus(Menu):