Skip to content

Commit 83634a0

Browse files
kromardan
and
dan
authored
add option to choose flat icons (#501)
Co-authored-by: dan <{ID}+{username}@users.noreply.github.com>
1 parent 92d1556 commit 83634a0

File tree

7 files changed

+30
-10
lines changed

7 files changed

+30
-10
lines changed

__init__.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
"description": """GoB (for GoBlender) is an unofficial GoZ-like extension, providing a seamless bridge between ZBrush and Blender.
3232
Effortlessly transfer your models between ZBrush and Blender with a single click, streamlining your workflow and maximizing efficiency.""",
3333
"author": "ODe, JoseConseco, Daniel Grauer (kromar)",
34-
"version": (4, 1, 6),
34+
"version": (4, 1, 7),
3535
"blender": (4, 00, 0),
3636
"location": "In the info header",
3737
"doc_url": "https://github.com/JoseConseco/GoB/wiki",
@@ -58,6 +58,10 @@ def register():
5858
icons.load("GOZ_SEND", os.path.join(icons_dir, "goz_send.png"), 'IMAGE')
5959
icons.load("GOZ_SYNC_ENABLED", os.path.join(icons_dir, "goz_sync_enabled.png"), 'IMAGE')
6060
icons.load("GOZ_SYNC_DISABLED", os.path.join(icons_dir, "goz_sync_disabled.png"), 'IMAGE')
61+
62+
icons.load("GOZ_SEND_FLAT", os.path.join(icons_dir, "goz_send_flat.png"), 'IMAGE')
63+
icons.load("GOZ_SYNC_FLAT", os.path.join(icons_dir, "goz_sync_flat.png"), 'IMAGE')
64+
6165
ui.preview_collections["main"] = icons
6266
bpy.types.TOPBAR_HT_upper_bar.prepend(ui.draw_goz_buttons)
6367

blender_manifest.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
schema_version = "1.0.0"
33
id = "gob"
44
name = "GoB"
5-
version = "4.1.6"
5+
version = "4.1.7"
66
tagline = "GoB providing a bridge between ZBrush and Blender"
77
maintainer = "Daniel Grauer (kromar)"
88
type = "add-on"

icons/GoB_Icon.blend

74.1 KB
Binary file not shown.

icons/goz_send_flat.png

1.43 KB
Loading

icons/goz_sync_flat.png

1.26 KB
Loading

preferences.py

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,12 @@ class GoB_Preferences(AddonPreferences):
118118
show_button_text: BoolProperty(
119119
name="Show Buttons Text",
120120
description="Show Text on the Import/Export Buttons",
121-
default=True) # Default: True
121+
default=True) # Default: True
122+
flat_icons: BoolProperty(
123+
name="Use flat icons",
124+
description="Use flat icons without color",
125+
default=False) # Default: False
126+
122127

123128
export_uv_flip_x: BoolProperty(name='UV Map Flip X', default=False) # Default: False
124129
export_uv_flip_y: BoolProperty(name='UV Map Flip Y', default=True) # Default: True
@@ -395,7 +400,8 @@ def draw_options(self, box):
395400
col.prop(self, 'manual_scale')
396401
if self.use_scale == 'ZUNITS':
397402
col.prop(self, 'zbrush_scale')
398-
col.prop(self, 'show_button_text')
403+
col.prop(self, 'show_button_text')
404+
col.prop(self, 'flat_icons')
399405
#col.prop(self, 'texture_format')
400406

401407

ui.py

Lines changed: 16 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -32,25 +32,35 @@ def draw_goz_buttons(self, context):
3232
row = layout.row(align=True)
3333

3434
icons = preview_collections["main"]
35+
if utils.prefs().flat_icons:
36+
icon_goz_send = 'GOZ_SEND_FLAT'
37+
icon_goz_disabled = 'GOZ_SYNC_FLAT'
38+
icon_goz_enabled = 'GOZ_SYNC_FLAT'
39+
else:
40+
icon_goz_send = 'GOZ_SEND'
41+
icon_goz_disabled = 'GOZ_SYNC_DISABLED'
42+
icon_goz_enabled = 'GOZ_SYNC_ENABLED'
43+
44+
3545

3646
if utils.prefs().show_button_text:
3747
row.operator(operator="scene.gob_export_button",
3848
text="Export",
3949
emboss=True,
40-
icon_value=icons["GOZ_SEND"].icon_id)
50+
icon_value=icons[icon_goz_send].icon_id)
4151

4252
if gob_import.run_background_update:
4353
row.operator(operator="scene.gob_import",
4454
text=iface_("Import", None),
4555
emboss=True,
4656
depress=True,
47-
icon_value=icons["GOZ_SYNC_ENABLED"].icon_id).action = 'AUTO'
57+
icon_value=icons[icon_goz_enabled].icon_id).action = 'AUTO'
4858
else:
4959
row.operator(operator="scene.gob_import",
5060
text=iface_("Import", None),
5161
emboss=True,
5262
depress=False,
53-
icon_value=icons["GOZ_SYNC_DISABLED"].icon_id).action = 'AUTO'
63+
icon_value=icons[icon_goz_disabled].icon_id).action = 'AUTO'
5464

5565
row.operator(operator="scene.gob_import",
5666
text="Manual",
@@ -62,20 +72,20 @@ def draw_goz_buttons(self, context):
6272
row.operator(operator="scene.gob_export_button",
6373
text="",
6474
emboss=True,
65-
icon_value=icons["GOZ_SEND"].icon_id)
75+
icon_value=icons[icon_goz_send].icon_id)
6676

6777
if gob_import.run_background_update:
6878
row.operator(operator="scene.gob_import",
6979
text="",
7080
emboss=True,
7181
depress=True,
72-
icon_value=icons["GOZ_SYNC_ENABLED"].icon_id).action = 'AUTO'
82+
icon_value=icons[icon_goz_enabled].icon_id).action = 'AUTO'
7383
else:
7484
row.operator(operator="scene.gob_import",
7585
text="",
7686
emboss=True,
7787
depress=False,
78-
icon_value=icons["GOZ_SYNC_DISABLED"].icon_id).action = 'AUTO'
88+
icon_value=icons[icon_goz_disabled].icon_id).action = 'AUTO'
7989

8090
row.operator(operator="scene.gob_import",
8191
text="",

0 commit comments

Comments
 (0)