[Bf-blender-cvs] [b41c208] gooseberry: Filter utility for finding objects in a cache group faster.
Lukas Tönne
noreply at git.blender.org
Mon Mar 23 13:01:59 CET 2015
Commit: b41c208e871dc087d65670faaebf6cdadbcd1b98
Author: Lukas Tönne
Date: Fri Feb 27 17:28:57 2015 +0100
Branches: gooseberry
https://developer.blender.org/rBb41c208e871dc087d65670faaebf6cdadbcd1b98
Filter utility for finding objects in a cache group faster.
This is a preliminary feature and implemented purely in python, to be
replaced later.
===================================================================
M release/scripts/startup/bl_ui/properties_scene.py
===================================================================
diff --git a/release/scripts/startup/bl_ui/properties_scene.py b/release/scripts/startup/bl_ui/properties_scene.py
index 312799b..2c9fc19 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()
More information about the Bf-blender-cvs
mailing list