Skip to content

Commit

Permalink
Add Hi-DPI icons for mmSolver
Browse files Browse the repository at this point in the history
These Hi-DPI icons follow the naming convention defined by Maya;
https://help.autodesk.com/view/MAYAUL/2025/ENU/?guid=GUID-F2900709-59D3-4E67-A217-4FECC84053BE
with the page name "Use a high resolution custom icon for a shelf item".

This includes a MS Windows Batch script to auto-generate all the icons
from the .svg files.

The README.md file is intended as documentation to help me remind myself
of the details if of the icons... and new people on the project.
  • Loading branch information
david-cattermole committed Oct 5, 2024
1 parent 9d942df commit be5b8de
Show file tree
Hide file tree
Showing 65 changed files with 205 additions and 0 deletions.
61 changes: 61 additions & 0 deletions share/icons/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
# Icons

The icons used in mmSolver are contained in this directory.

The "edit/" sub-directory contain the editable files, used to create the icons.

## Guidelines

The icons in mmSolver should:
- be readable and obvious to users.
- be consistent and share a common language with all other icons in
mmSolver (and in Autodesk Maya).
- be defined in vector formats whenever possible (to allow rendering
bitmaps at higher resolutions for Hi-DPI screens).
- use open standard formats (like SVG format) where possible to avoid
proprietary formats and avoid vendor lock-in.

Note: [Inkscape](https://inkscape.org/) is a really good Free Software
for creating vector artwork icons - it is recommended to use it for
creating the icons for mmSolver.

## Shelf Icon Naming Conventions

Icons for Maya shelf buttons require the following naming convention:
```
name.png # The default 32x32 icon.
name_150.png # The 150% 48x48 icon.
name_200.png # The 200% 64x64 icon.
```

Please see [High resolution shelf
icons](https://help.autodesk.com/view/MAYAUL/2025/ENU/?guid=GUID-F2900709-59D3-4E67-A217-4FECC84053BE)
for more details.

## Node Icon Naming Conventions

Icons for Maya nodes in the Autodesk Maya Outliner require the
following naming convention:
```
out_nodeType.png
```

Additionally the icons must have a resolution of 20x20.

## Building Icons

To speed up the process of outputting the bitmap icons with the
correct naming convention and resolution, there is a script (currently
only on Windows) to automate the process.

This uses [Inkscape](https://inkscape.org/) to render the SVG icons
into PNG files.

On Windows:
```cmd
:: Go to root of the icons directory.
> CD <project root>\share/icons/
:: Runs Inkscape for all files and exports all PNG/SVG files.
> build_icons.bat
```
Binary file added share/icons/attributeTools_150.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 share/icons/attributeTools_200.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
33 changes: 33 additions & 0 deletions share/icons/build_icons.bash
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
#!/bin/bash
#
# Copyright (C) 2024 David Cattermole.
#
# This file is part of mmSolver.
#
# mmSolver is free software: you can redistribute it and/or modify it
# under the terms of the GNU Lesser General Public License as
# published by the Free Software Foundation, either version 3 of the
# License, or (at your option) any later version.
#
# mmSolver 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 Lesser General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public License
# along with mmSolver. If not, see <https://www.gnu.org/licenses/>.
# ---------------------------------------------------------------------
#
# Runs 'inkscape' to export PNG files from .svg files.
#
# This file exports multiple resolutions using a naming convention.

# Any subsequent commands which fail will cause the shell script to
# exit immediately.
set -e

THIS_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )

# TODO: Write this script to match the Windows .bat equal.

cd ${THIS_DIR}
111 changes: 111 additions & 0 deletions share/icons/build_icons.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,111 @@
@ECHO OFF
SETLOCAL
::
:: Copyright (C) 2024 David Cattermole.
::
:: This file is part of mmSolver.
::
:: mmSolver is free software: you can redistribute it and/or modify it
:: under the terms of the GNU Lesser General Public License as
:: published by the Free Software Foundation, either version 3 of the
:: License, or (at your option) any later version.
::
:: mmSolver 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 Lesser General Public License for more details.
::
:: You should have received a copy of the GNU Lesser General Public License
:: along with mmSolver. If not, see <https://www.gnu.org/licenses/>.
:: ---------------------------------------------------------------------
::
:: Runs 'inkscape' to export PNG files from .svg files.
::
:: This file exports multiple resolutions using a naming convention.

SET THIS_DIR=%~dp0

SET INKSCAPE_EXE="%PROGRAMFILES%\Inkscape\inkscape.com"

SET OUTPUT_DIR=%THIS_DIR%

:: Export node PNG icons at 20 x 20 resolution, for use in the Outliner.
::
:: 20 x 20 is the resolution expected by Maya's Outliner.
SET OUT_RESOLUTION=20
for /r %%i in (edit\node\*.svg) do (
echo -------------------------------------------------------------
echo Input file: %%i
echo Output file: %OUTPUT_DIR%\out_%%~ni.png

%INKSCAPE_EXE% ^
--without-gui ^
--export-area-page ^
--export-width=%OUT_RESOLUTION% ^
--export-height=%OUT_RESOLUTION% ^
--file="%%i" ^
--export-png="%OUTPUT_DIR%\out_%%~ni.png"
)

:: Export node plain SVG icons.
SET OUT_RESOLUTION=20
for /r %%i in (edit\node\*.svg) do (
echo -------------------------------------------------------------
echo Input file: %%i
echo Output file: %OUTPUT_DIR%\%%~ni.svg

%INKSCAPE_EXE% ^
--without-gui ^
--export-area-page ^
--file="%%i" ^
--export-plain-svg="%OUTPUT_DIR%\%%~ni.svg"
)

:: Export shelf PNG icons at 32 x 32 resolution.
SET OUT_RESOLUTION=32
for /r %%i in (edit\shelf\*.svg) do (
echo -------------------------------------------------------------
echo Input file: %%i
echo Output file: %OUTPUT_DIR%\%%~ni_%OUT_RESOLUTION%x%OUT_RESOLUTION%.png

%INKSCAPE_EXE% ^
--without-gui ^
--export-area-page ^
--export-width=%OUT_RESOLUTION% ^
--export-height=%OUT_RESOLUTION% ^
--file="%%i" ^
--export-png="%OUTPUT_DIR%\%%~ni.png"
)

:: Export shelf PNG icons at 48 x 48 resolution (150% scale).
SET OUT_RESOLUTION=48
for /r %%i in (edit\shelf\*.svg) do (
echo -------------------------------------------------------------
echo Input file: %%i
echo Output file: %OUTPUT_DIR%\%%~ni_150.png

%INKSCAPE_EXE% ^
--without-gui ^
--export-area-page ^
--export-width=%OUT_RESOLUTION% ^
--export-height=%OUT_RESOLUTION% ^
--file="%%i" ^
--export-png="%OUTPUT_DIR%\%%~ni_150.png"
)


:: Export shelf PNG icons at 64 x 64 resolution (200% scale).
SET OUT_RESOLUTION=64
for /r %%i in (edit\shelf\*.svg) do (
echo -------------------------------------------------------------
echo Input file: %%i
echo Output file: %OUTPUT_DIR%\%%~ni_200.png

%INKSCAPE_EXE% ^
--without-gui ^
--export-area-page ^
--export-width=%OUT_RESOLUTION% ^
--export-height=%OUT_RESOLUTION% ^
--file="%%i" ^
--export-png="%OUTPUT_DIR%\%%~ni_200.png"
)
Binary file added share/icons/bundleTools_150.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 share/icons/bundleTools_200.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 share/icons/cameraContext_150.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 share/icons/cameraContext_200.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 share/icons/cameraTools_150.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 share/icons/cameraTools_200.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 share/icons/convertToMarker_150.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 share/icons/convertToMarker_200.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 share/icons/createBundle_150.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 share/icons/createBundle_200.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 share/icons/createCamera_150.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 share/icons/createCamera_200.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 share/icons/createImagePlane_150.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 share/icons/createImagePlane_200.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 share/icons/createLens_150.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 share/icons/createLens_200.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 share/icons/createMarker_150.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 share/icons/createMarker_200.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 share/icons/displayTools_150.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 share/icons/displayTools_200.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 share/icons/fileInputOutput_150.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 share/icons/fileInputOutput_200.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 share/icons/generalTools_150.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 share/icons/generalTools_200.png
Binary file added share/icons/hotkeySwitcher_150.png
Binary file added share/icons/hotkeySwitcher_200.png
Binary file added share/icons/keyFrameAdd_150.png
Binary file added share/icons/keyFrameAdd_200.png
Binary file added share/icons/keyFrameNext_150.png
Binary file added share/icons/keyFrameNext_200.png
Binary file added share/icons/keyFramePrevious_150.png
Binary file added share/icons/keyFramePrevious_200.png
Binary file added share/icons/keyFrameRemove_150.png
Binary file added share/icons/keyFrameRemove_200.png
Binary file added share/icons/lensTools_150.png
Binary file added share/icons/lensTools_200.png
Binary file added share/icons/lineTools_150.png
Binary file added share/icons/lineTools_200.png
Binary file added share/icons/loadMarker_150.png
Binary file added share/icons/loadMarker_200.png
Binary file added share/icons/markerBundleCombineSelection_150.png
Binary file added share/icons/markerBundleCombineSelection_200.png
Binary file added share/icons/markerBundleLinkTools_150.png
Binary file added share/icons/markerBundleLinkTools_200.png
Binary file added share/icons/markerBundleSwapSelection_150.png
Binary file added share/icons/markerBundleSwapSelection_200.png
Binary file added share/icons/markerTools_150.png
Binary file added share/icons/markerTools_200.png
Binary file added share/icons/meshTools_150.png
Binary file added share/icons/meshTools_200.png
Binary file added share/icons/mmSolverRunFrame_150.png
Binary file added share/icons/mmSolverRunFrame_200.png
Binary file added share/icons/mmSolverRun_150.png
Binary file added share/icons/mmSolverRun_200.png
Binary file added share/icons/mmSolverWindow_150.png
Binary file added share/icons/mmSolverWindow_200.png
Binary file added share/icons/selectionTools_150.png
Binary file added share/icons/selectionTools_200.png
Binary file added share/icons/zDepthTools_150.png
Binary file added share/icons/zDepthTools_200.png

0 comments on commit be5b8de

Please sign in to comment.