Skip to content
Snippets Groups Projects
Commit 1cc5dcfc authored by Doug Hammond's avatar Doug Hammond
Browse files

extensions_framework: Add optional bl_info parameter to Addon class...

extensions_framework: Add optional bl_info parameter to Addon class contstructor, useful for making bl_idname and bl_label strings for versioned addons
parent 9298c1a8
No related branches found
No related tags found
No related merge requests found
......@@ -273,10 +273,26 @@ class declarative_property_group(bpy.types.IDPropertyGroup):
class Addon(object):
"""A list of classes registered by this addon"""
static_addon_count = 0
addon_serial = 0
addon_classes = None
bl_info = None
def __init__(self):
def __init__(self, bl_info=None):
self.addon_classes = []
self.bl_info = bl_info
self.addon_serial = Addon.static_addon_count
Addon.static_addon_count += 1
def bl_infos(self):
if self.bl_info:
BL_VERSION = '.'.join(['%s'%v for v in self.bl_info['version']]).lower()
BL_IDNAME = self.bl_info['name'].lower() + '-' + BL_VERSION
return BL_VERSION, BL_IDNAME
else:
return '0', 'Addon-%03d'%self.addon_serial
def addon_register_class(self, cls):
"""This method is designed to be used as a decorator on RNA-registerable
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment