Skip to content

Commit abc5f3d

Browse files
authored
Merge pull request #156 from MaximeHerpin/develop
replaced icons
2 parents 9f929c5 + 746e773 commit abc5f3d

File tree

7 files changed

+48
-2
lines changed

7 files changed

+48
-2
lines changed

__init__.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,8 +41,8 @@
4141
bl_info = {
4242
"name": "Modular trees",
4343
"author": "Herpin Maxime, Jake Dube",
44-
"version": (2, 9, 0),
45-
"blender": (2, 77, 0),
44+
"version": (2, 9, 1),
45+
"blender": (2, 79, 0),
4646
"location": "View3D > Tools > Tree > Make Tree",
4747
"description": "Generates an organic tree with correctly modeled branching.",
4848
"warning": "May take a long time to generate! Save your file before generating!",

custom_icons/BATCH_TREE.png

2.1 KB
Loading

custom_icons/TREE.png

1.79 KB
Loading

custom_icons/TREE1.png

1.96 KB
Loading

custom_icons/TREE_UPDATE.png

2.56 KB
Loading

custom_icons/TWIG.png

1.76 KB
Loading

icons.py

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
# Copyright 2016 Maxime Herpin, Jake Dube
2+
#
3+
# ##### BEGIN GPL LICENSE BLOCK ######
4+
# This file is part of Modular Tree.
5+
#
6+
# Modular Tree is free software: you can redistribute it and/or modify
7+
# it under the terms of the GNU General Public License as published by
8+
# the Free Software Foundation, either version 3 of the License, or
9+
# (at your option) any later version.
10+
#
11+
# Modular Tree is distributed in the hope that it will be useful,
12+
# but WITHOUT ANY WARRANTY; without even the implied warranty of
13+
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14+
# GNU General Public License for more details.
15+
#
16+
# You should have received a copy of the GNU General Public License
17+
# along with Modular Tree. If not, see <http://www.gnu.org/licenses/>.
18+
# ##### END GPL LICENSE BLOCK #####
19+
20+
from os.path import join, dirname
21+
from bpy.utils import previews
22+
23+
# global variables
24+
ICONS = {'TREE', 'TREE_UPDATE', 'BATCH_TREE', 'TWIG'}
25+
ICON_COLLECTION = {}
26+
27+
28+
def register_icons():
29+
preview_coll = previews.new()
30+
icons_folder = join(dirname(__file__), "custom_icons")
31+
32+
for icon in ICONS:
33+
preview_coll.load(icon, join(icons_folder, icon + ".png"), 'IMAGE')
34+
35+
ICON_COLLECTION["main"] = preview_coll
36+
37+
38+
def unregister_icons():
39+
for collection in ICON_COLLECTION.values():
40+
previews.remove(collection)
41+
ICON_COLLECTION.clear()
42+
43+
44+
def get_icon(icon):
45+
preview_coll = ICON_COLLECTION["main"]
46+
return preview_coll[icon].icon_id

0 commit comments

Comments
 (0)