You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
# ##### BEGIN GPL LICENSE BLOCK ####### This program is free software; you can redistribute it and/or# modify it under the terms of the GNU General Public License# as published by the Free Software Foundation; either version 2# of the License, or (at your option) any later version.## This program is distributed in the hope that it will be useful,# but WITHOUT ANY WARRANTY; without even the implied warranty of# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the# GNU General Public License for more details.## You should have received a copy of the GNU General Public License# along with this program; if not, write to the Free Software Foundation,# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.## ##### END GPL LICENSE BLOCK ###### <pep8 compliant>bl_info= {
"name": "ploot",
"author": "zeffii (aka Dealga McArdle)",
"version": (1, 3, 1),
"blender": (2, 7, 7),
"category": "Mesh",
"location": "View3D > EditMode > (w) Specials"
}
importosimportbpyicon_names= ['BIX', 'CCEN', 'E2F']
icon_collection= {}
icon_dict= {}
classDudePanel(bpy.types.Panel):
"""Creates a Panel in the Object properties window"""bl_label="Hello World Panel"bl_idname="OBJECT_PT_hello"bl_space_type='PROPERTIES'bl_region_type='WINDOW'bl_context="object"defdraw(self, context):
layout=self.layoutrow=layout.row()
row.prop(context.scene, 'enumlumpa', text='')
defregister_icons():
importbpy.utils.previewspcoll=bpy.utils.previews.new()
icons_dir=os.path.join(os.path.dirname(__file__), "icons")
foricon_nameinicon_names:
pcoll.load(icon_name, os.path.join(icons_dir, icon_name+'.png'), 'IMAGE')
icon_collection["main"] =pcolldefunregister_icons():
forpcollinicon_collection.values():
bpy.utils.previews.remove(pcoll)
icon_collection.clear()
defregister():
register_icons()
icon_dict.update({name: icon_collection["main"][name].icon_idfornameinicon_names})
bpy.types.Scene.enumlumpa=bpy.props.EnumProperty(
default='BIX',
items=[(name, name.title(), '', icon_dict.get(name), idx) foridx, nameinenumerate(icon_names)]
)
bpy.utils.register_module(__name__)
defunregister():
bpy.utils.unregister_module(__name__)
unregister_icons()
delbpy.types.Scene.enumlumpa