Skip to content

Commit

Permalink
add option to choose flat icons (#501)
Browse files Browse the repository at this point in the history
Co-authored-by: dan <{ID}+{username}@users.noreply.github.com>
  • Loading branch information
kromar and dan authored Nov 7, 2024
1 parent 92d1556 commit 83634a0
Show file tree
Hide file tree
Showing 7 changed files with 30 additions and 10 deletions.
6 changes: 5 additions & 1 deletion __init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
"description": """GoB (for GoBlender) is an unofficial GoZ-like extension, providing a seamless bridge between ZBrush and Blender.
Effortlessly transfer your models between ZBrush and Blender with a single click, streamlining your workflow and maximizing efficiency.""",
"author": "ODe, JoseConseco, Daniel Grauer (kromar)",
"version": (4, 1, 6),
"version": (4, 1, 7),
"blender": (4, 00, 0),
"location": "In the info header",
"doc_url": "https://github.com/JoseConseco/GoB/wiki",
Expand All @@ -58,6 +58,10 @@ def register():
icons.load("GOZ_SEND", os.path.join(icons_dir, "goz_send.png"), 'IMAGE')
icons.load("GOZ_SYNC_ENABLED", os.path.join(icons_dir, "goz_sync_enabled.png"), 'IMAGE')
icons.load("GOZ_SYNC_DISABLED", os.path.join(icons_dir, "goz_sync_disabled.png"), 'IMAGE')

icons.load("GOZ_SEND_FLAT", os.path.join(icons_dir, "goz_send_flat.png"), 'IMAGE')
icons.load("GOZ_SYNC_FLAT", os.path.join(icons_dir, "goz_sync_flat.png"), 'IMAGE')

ui.preview_collections["main"] = icons
bpy.types.TOPBAR_HT_upper_bar.prepend(ui.draw_goz_buttons)

Expand Down
2 changes: 1 addition & 1 deletion blender_manifest.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
schema_version = "1.0.0"
id = "gob"
name = "GoB"
version = "4.1.6"
version = "4.1.7"
tagline = "GoB providing a bridge between ZBrush and Blender"
maintainer = "Daniel Grauer (kromar)"
type = "add-on"
Expand Down
Binary file modified icons/GoB_Icon.blend
Binary file not shown.
Binary file added icons/goz_send_flat.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added icons/goz_sync_flat.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
10 changes: 8 additions & 2 deletions preferences.py
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,12 @@ class GoB_Preferences(AddonPreferences):
show_button_text: BoolProperty(
name="Show Buttons Text",
description="Show Text on the Import/Export Buttons",
default=True) # Default: True
default=True) # Default: True
flat_icons: BoolProperty(
name="Use flat icons",
description="Use flat icons without color",
default=False) # Default: False


export_uv_flip_x: BoolProperty(name='UV Map Flip X', default=False) # Default: False
export_uv_flip_y: BoolProperty(name='UV Map Flip Y', default=True) # Default: True
Expand Down Expand Up @@ -395,7 +400,8 @@ def draw_options(self, box):
col.prop(self, 'manual_scale')
if self.use_scale == 'ZUNITS':
col.prop(self, 'zbrush_scale')
col.prop(self, 'show_button_text')
col.prop(self, 'show_button_text')
col.prop(self, 'flat_icons')
#col.prop(self, 'texture_format')


Expand Down
22 changes: 16 additions & 6 deletions ui.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,25 +32,35 @@ def draw_goz_buttons(self, context):
row = layout.row(align=True)

icons = preview_collections["main"]
if utils.prefs().flat_icons:
icon_goz_send = 'GOZ_SEND_FLAT'
icon_goz_disabled = 'GOZ_SYNC_FLAT'
icon_goz_enabled = 'GOZ_SYNC_FLAT'
else:
icon_goz_send = 'GOZ_SEND'
icon_goz_disabled = 'GOZ_SYNC_DISABLED'
icon_goz_enabled = 'GOZ_SYNC_ENABLED'



if utils.prefs().show_button_text:
row.operator(operator="scene.gob_export_button",
text="Export",
emboss=True,
icon_value=icons["GOZ_SEND"].icon_id)
icon_value=icons[icon_goz_send].icon_id)

if gob_import.run_background_update:
row.operator(operator="scene.gob_import",
text=iface_("Import", None),
emboss=True,
depress=True,
icon_value=icons["GOZ_SYNC_ENABLED"].icon_id).action = 'AUTO'
icon_value=icons[icon_goz_enabled].icon_id).action = 'AUTO'
else:
row.operator(operator="scene.gob_import",
text=iface_("Import", None),
emboss=True,
depress=False,
icon_value=icons["GOZ_SYNC_DISABLED"].icon_id).action = 'AUTO'
icon_value=icons[icon_goz_disabled].icon_id).action = 'AUTO'

row.operator(operator="scene.gob_import",
text="Manual",
Expand All @@ -62,20 +72,20 @@ def draw_goz_buttons(self, context):
row.operator(operator="scene.gob_export_button",
text="",
emboss=True,
icon_value=icons["GOZ_SEND"].icon_id)
icon_value=icons[icon_goz_send].icon_id)

if gob_import.run_background_update:
row.operator(operator="scene.gob_import",
text="",
emboss=True,
depress=True,
icon_value=icons["GOZ_SYNC_ENABLED"].icon_id).action = 'AUTO'
icon_value=icons[icon_goz_enabled].icon_id).action = 'AUTO'
else:
row.operator(operator="scene.gob_import",
text="",
emboss=True,
depress=False,
icon_value=icons["GOZ_SYNC_DISABLED"].icon_id).action = 'AUTO'
icon_value=icons[icon_goz_disabled].icon_id).action = 'AUTO'

row.operator(operator="scene.gob_import",
text="",
Expand Down

0 comments on commit 83634a0

Please sign in to comment.