diff options
author | Lukas Tönne <lukas.toenne@gmail.com> | 2015-02-27 19:28:57 +0300 |
---|---|---|
committer | Lukas Tönne <lukas.toenne@gmail.com> | 2015-03-26 16:12:38 +0300 |
commit | e1a17cea89b44b62dc6d6e48f701a37fc5db3b57 (patch) | |
tree | 33ff7bbcee1e71ffd648e76adf8d2de5cc4fd161 /release | |
parent | 303997ea71be136f867e70087efc2422ccd36f5f (diff) |
Filter utility for finding objects in a cache group faster.
This is a preliminary feature and implemented purely in python, to be
replaced later.
Diffstat (limited to 'release')
-rw-r--r-- | release/scripts/startup/bl_ui/properties_scene.py | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/release/scripts/startup/bl_ui/properties_scene.py b/release/scripts/startup/bl_ui/properties_scene.py index 312799b6c98..2c9fc19959d 100644 --- a/release/scripts/startup/bl_ui/properties_scene.py +++ b/release/scripts/startup/bl_ui/properties_scene.py @@ -402,6 +402,9 @@ class SCENE_PT_simplify(SceneButtonsPanel, Panel): col.prop(rd, "simplify_ao_sss", text="AO and SSS") +# XXX temporary solution +bpy.types.Scene.cache_library_filter = bpy.props.StringProperty(name="Cache Library Filter", description="Filter cache libraries") + class SCENE_PT_cache_manager(SceneButtonsPanel, Panel): bl_label = "Cache Manager" COMPAT_ENGINES = {'BLENDER_RENDER'} @@ -469,8 +472,14 @@ class SCENE_PT_cache_manager(SceneButtonsPanel, Panel): row.prop(cachelib, "read", text="Read", toggle=True) row.operator("cachelibrary.bake") + obfilter_string = context.scene.cache_library_filter.lower() + if obfilter_string: + obcaches = filter(lambda obcache: obfilter_string in obcache.object.name.lower(), cachelib.object_caches) + else: + obcaches = cachelib.object_caches + first = True - for obcache in cachelib.object_caches: + for obcache in obcaches: ob = obcache.object if first: @@ -490,6 +499,9 @@ class SCENE_PT_cache_manager(SceneButtonsPanel, Panel): def draw(self, context): layout = self.layout + row = layout.row(align=True) + row.prop(context.scene, "cache_library_filter", icon='VIEWZOOM') + layout.operator("cachelibrary.new") for cachelib in context.blend_data.cache_libraries: box = layout.box() |