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

git.blender.org/blender-addons.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2011-02-11 05:19:03 +0300
committerCampbell Barton <ideasman42@gmail.com>2011-02-11 05:19:03 +0300
commit5be2e689c16ab971105f7d3658d4cabd32ad022f (patch)
tree09104d2d89cd07f9734af5d10b5ce77e29eaf9ac /development_icon_get.py
parenta60e3c434916a118feaf70aea2dfbc4aa6be3731 (diff)
update icon script for changes in svn.
Diffstat (limited to 'development_icon_get.py')
-rw-r--r--development_icon_get.py67
1 files changed, 36 insertions, 31 deletions
diff --git a/development_icon_get.py b/development_icon_get.py
index b0ed6cd9..6f052b05 100644
--- a/development_icon_get.py
+++ b/development_icon_get.py
@@ -40,25 +40,24 @@ bl_info = {
import bpy
-def create_icon_list():
- props = bpy.context.scene.icon_props
- keys = bpy.types.UILayout.bl_rna.functions['prop'].parameters['icon'].\
+def create_icon_list_all():
+ icons = bpy.types.UILayout.bl_rna.functions['prop'].parameters['icon'].\
items.keys()
- if props.search == '':
- list = keys
- else:
- list = [key for key in keys if props.search.lower() in key.lower()]
- if "BLENDER" in list:
- list.remove("BLENDER")
- return list
+ icons.remove("BLENDER")
+
+ return icons
+
+def create_icon_list():
+ icons = create_icon_list_all()
+ search = bpy.context.scene.icon_props.search.lower()
+
+ if search == "":
+ pass
+ else:
+ icons = [key for key in icons if search in key.lower()]
-class IconProps(bpy.types.IDPropertyGroup):
- """
- Fake module like class
- bpy.context.scene.icon_props
- """
- pass
+ return icons
class WM_OT_icon_info(bpy.types.Operator):
@@ -211,29 +210,34 @@ def menu_func(self, context):
def register():
+ icons_total = len(create_icon_list_all())
+ icons_per_row = 10
+
+ class IconProps(bpy.types.IDPropertyGroup):
+ """
+ Fake module like class
+ bpy.context.scene.icon_props
+ """
+ console = bpy.props.BoolProperty(name='Show System Icons',
+ description='Display the Icons in the console header', default=False)
+ expand = bpy.props.BoolProperty(default=False,
+ description="Expand, to display all icons at once")
+ search = bpy.props.StringProperty(default="",
+ description = "Search for icons by name")
+ search_old = bpy.props.StringProperty(default="",
+ description = "Used to keep track of changes in IconProps.search")
+ scroll = bpy.props.IntProperty(default=1, min=1,
+ max=max(1, icons_total - icons_per_row + 1),
+ description="Drag to scroll icons")
+
bpy.utils.register_module(__name__)
bpy.types.Scene.icon_props = bpy.props.PointerProperty(type = IconProps)
- IconProps.console = bpy.props.BoolProperty(name='Show System Icons',
- description='Display the Icons in the console header', default=False)
- IconProps.expand = bpy.props.BoolProperty(default=False,
- description="Expand, to display all icons at once")
- IconProps.search = bpy.props.StringProperty(default="",
- description = "Search for icons by name")
- IconProps.search_old = bpy.props.StringProperty(default="",
- description = "Used to keep track of changes in IconProps.search")
-
- icons_total = len(create_icon_list())
- icons_per_row = 10
- IconProps.scroll = bpy.props.IntProperty(default=1, min=1,
- max=max(1, icons_total - icons_per_row + 1),
- description="Drag to scroll icons")
bpy.types.CONSOLE_MT_console.append(menu_func)
def unregister():
- bpy.utils.unregister_module(__name__)
if bpy.context.scene.get('icon_props') != None:
del bpy.context.scene['icon_props']
@@ -247,6 +251,7 @@ def unregister():
bpy.types.unregister(OBJECT_PT_icons)
bpy.types.unregister(CONSOLE_HT_icons)
+ bpy.utils.unregister_module(__name__)
if __name__ == "__main__":
register()