From e84c1148f383067b8c6cd738f11663e285cbe791 Mon Sep 17 00:00:00 2001 From: yyc12345 Date: Wed, 22 Nov 2023 17:41:43 +0800 Subject: [PATCH] add thumbnail for blender icons --- .gitignore | 6 +++ bbp_ng/icons/.gitkeep | 0 bbp_ng/{icons => raw_icons}/Empty.png | Bin bbp_ng/raw_icons/README.md | 7 +++ .../element/PC_TwoFlames.png | Bin .../element/PE_Balloon.png | Bin .../element/PR_Resetpoint.png | Bin .../element/PS_FourFlames.png | Bin .../element/P_Ball_Paper.png | Bin .../element/P_Ball_Stone.png | Bin .../element/P_Ball_Wood.png | Bin bbp_ng/{icons => raw_icons}/element/P_Box.png | Bin .../{icons => raw_icons}/element/P_Dome.png | Bin .../element/P_Extra_Life.png | Bin .../element/P_Extra_Point.png | Bin .../element/P_Modul_01.png | Bin .../element/P_Modul_03.png | Bin .../element/P_Modul_08.png | Bin .../element/P_Modul_17.png | Bin .../element/P_Modul_18.png | Bin .../element/P_Modul_19.png | Bin .../element/P_Modul_25.png | Bin .../element/P_Modul_26.png | Bin .../element/P_Modul_29.png | Bin .../element/P_Modul_30.png | Bin .../element/P_Modul_34.png | Bin .../element/P_Modul_37.png | Bin .../element/P_Modul_41.png | Bin .../element/P_Trafo_Paper.png | Bin .../element/P_Trafo_Stone.png | Bin .../element/P_Trafo_Wood.png | Bin bbp_ng/{icons => raw_icons}/floor/Flat.png | Bin .../{icons => raw_icons}/floor/Normal1x1.png | Bin .../floor/NormalBorder.png | Bin .../floor/NormalCrossroad.png | Bin .../floor/NormalFloor.png | Bin .../floor/NormalFloorTerminal.png | Bin .../floor/NormalInnerCorner.png | Bin .../floor/NormalLConnector.png | Bin .../floor/NormalOutterCorner.png | Bin .../floor/NormalPlatform.png | Bin .../floor/NormalSinkTransition.png | Bin .../floor/NormalTConnector.png | Bin .../{icons => raw_icons}/floor/PaperTrafo.png | Bin .../floor/RibbonBorder.png | Bin .../floor/RibbonOutterCorner.png | Bin .../floor/RibbonPlatform.png | Bin bbp_ng/{icons => raw_icons}/floor/Sink1x1.png | Bin .../{icons => raw_icons}/floor/SinkBorder.png | Bin .../floor/SinkCrossroad.png | Bin .../{icons => raw_icons}/floor/SinkFloor.png | Bin .../floor/SinkFloorTerminal.png | Bin .../floor/SinkInnerCorner.png | Bin .../floor/SinkLConnector.png | Bin .../floor/SinkOutterCorner.png | Bin .../floor/SinkPlatform.png | Bin .../floor/SinkTConnector.png | Bin .../{icons => raw_icons}/floor/StoneTrafo.png | Bin .../floor/WideCrossroad.png | Bin .../{icons => raw_icons}/floor/WideFloor.png | Bin .../floor/WideFloorTerminal.png | Bin .../floor/WideLConnector.png | Bin .../floor/WideTConnector.png | Bin .../{icons => raw_icons}/floor/WoodTrafo.png | Bin .../{icons => raw_icons}/group/SoundID_01.png | Bin .../{icons => raw_icons}/group/SoundID_02.png | Bin .../{icons => raw_icons}/group/SoundID_03.png | Bin bbp_ng/tools/build_icons.py | 42 ++++++++++++++++++ 68 files changed, 55 insertions(+) create mode 100644 bbp_ng/icons/.gitkeep rename bbp_ng/{icons => raw_icons}/Empty.png (100%) create mode 100644 bbp_ng/raw_icons/README.md rename bbp_ng/{icons => raw_icons}/element/PC_TwoFlames.png (100%) rename bbp_ng/{icons => raw_icons}/element/PE_Balloon.png (100%) rename bbp_ng/{icons => raw_icons}/element/PR_Resetpoint.png (100%) rename bbp_ng/{icons => raw_icons}/element/PS_FourFlames.png (100%) rename bbp_ng/{icons => raw_icons}/element/P_Ball_Paper.png (100%) rename bbp_ng/{icons => raw_icons}/element/P_Ball_Stone.png (100%) rename bbp_ng/{icons => raw_icons}/element/P_Ball_Wood.png (100%) rename bbp_ng/{icons => raw_icons}/element/P_Box.png (100%) rename bbp_ng/{icons => raw_icons}/element/P_Dome.png (100%) rename bbp_ng/{icons => raw_icons}/element/P_Extra_Life.png (100%) rename bbp_ng/{icons => raw_icons}/element/P_Extra_Point.png (100%) rename bbp_ng/{icons => raw_icons}/element/P_Modul_01.png (100%) rename bbp_ng/{icons => raw_icons}/element/P_Modul_03.png (100%) rename bbp_ng/{icons => raw_icons}/element/P_Modul_08.png (100%) rename bbp_ng/{icons => raw_icons}/element/P_Modul_17.png (100%) rename bbp_ng/{icons => raw_icons}/element/P_Modul_18.png (100%) rename bbp_ng/{icons => raw_icons}/element/P_Modul_19.png (100%) rename bbp_ng/{icons => raw_icons}/element/P_Modul_25.png (100%) rename bbp_ng/{icons => raw_icons}/element/P_Modul_26.png (100%) rename bbp_ng/{icons => raw_icons}/element/P_Modul_29.png (100%) rename bbp_ng/{icons => raw_icons}/element/P_Modul_30.png (100%) rename bbp_ng/{icons => raw_icons}/element/P_Modul_34.png (100%) rename bbp_ng/{icons => raw_icons}/element/P_Modul_37.png (100%) rename bbp_ng/{icons => raw_icons}/element/P_Modul_41.png (100%) rename bbp_ng/{icons => raw_icons}/element/P_Trafo_Paper.png (100%) rename bbp_ng/{icons => raw_icons}/element/P_Trafo_Stone.png (100%) rename bbp_ng/{icons => raw_icons}/element/P_Trafo_Wood.png (100%) rename bbp_ng/{icons => raw_icons}/floor/Flat.png (100%) rename bbp_ng/{icons => raw_icons}/floor/Normal1x1.png (100%) rename bbp_ng/{icons => raw_icons}/floor/NormalBorder.png (100%) rename bbp_ng/{icons => raw_icons}/floor/NormalCrossroad.png (100%) rename bbp_ng/{icons => raw_icons}/floor/NormalFloor.png (100%) rename bbp_ng/{icons => raw_icons}/floor/NormalFloorTerminal.png (100%) rename bbp_ng/{icons => raw_icons}/floor/NormalInnerCorner.png (100%) rename bbp_ng/{icons => raw_icons}/floor/NormalLConnector.png (100%) rename bbp_ng/{icons => raw_icons}/floor/NormalOutterCorner.png (100%) rename bbp_ng/{icons => raw_icons}/floor/NormalPlatform.png (100%) rename bbp_ng/{icons => raw_icons}/floor/NormalSinkTransition.png (100%) rename bbp_ng/{icons => raw_icons}/floor/NormalTConnector.png (100%) rename bbp_ng/{icons => raw_icons}/floor/PaperTrafo.png (100%) rename bbp_ng/{icons => raw_icons}/floor/RibbonBorder.png (100%) rename bbp_ng/{icons => raw_icons}/floor/RibbonOutterCorner.png (100%) rename bbp_ng/{icons => raw_icons}/floor/RibbonPlatform.png (100%) rename bbp_ng/{icons => raw_icons}/floor/Sink1x1.png (100%) rename bbp_ng/{icons => raw_icons}/floor/SinkBorder.png (100%) rename bbp_ng/{icons => raw_icons}/floor/SinkCrossroad.png (100%) rename bbp_ng/{icons => raw_icons}/floor/SinkFloor.png (100%) rename bbp_ng/{icons => raw_icons}/floor/SinkFloorTerminal.png (100%) rename bbp_ng/{icons => raw_icons}/floor/SinkInnerCorner.png (100%) rename bbp_ng/{icons => raw_icons}/floor/SinkLConnector.png (100%) rename bbp_ng/{icons => raw_icons}/floor/SinkOutterCorner.png (100%) rename bbp_ng/{icons => raw_icons}/floor/SinkPlatform.png (100%) rename bbp_ng/{icons => raw_icons}/floor/SinkTConnector.png (100%) rename bbp_ng/{icons => raw_icons}/floor/StoneTrafo.png (100%) rename bbp_ng/{icons => raw_icons}/floor/WideCrossroad.png (100%) rename bbp_ng/{icons => raw_icons}/floor/WideFloor.png (100%) rename bbp_ng/{icons => raw_icons}/floor/WideFloorTerminal.png (100%) rename bbp_ng/{icons => raw_icons}/floor/WideLConnector.png (100%) rename bbp_ng/{icons => raw_icons}/floor/WideTConnector.png (100%) rename bbp_ng/{icons => raw_icons}/floor/WoodTrafo.png (100%) rename bbp_ng/{icons => raw_icons}/group/SoundID_01.png (100%) rename bbp_ng/{icons => raw_icons}/group/SoundID_02.png (100%) rename bbp_ng/{icons => raw_icons}/group/SoundID_03.png (100%) create mode 100644 bbp_ng/tools/build_icons.py diff --git a/.gitignore b/.gitignore index 6d95b8c..d9056db 100644 --- a/.gitignore +++ b/.gitignore @@ -1,7 +1,13 @@ # My Ban bbp_ng/PyBMap/*.dll +bbp_ng/PyBMap/*.so +bbp_ng/PyBMap/*.dylib +bbp_ng/PyBMap/*.bin bbp_ng/PyBMap/*.pdb +bbp_ng/icons/* +!bbp_ng/icons/.gitkeep + # Byte-compiled / optimized / DLL files __pycache__/ *.py[cod] diff --git a/bbp_ng/icons/.gitkeep b/bbp_ng/icons/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/bbp_ng/icons/Empty.png b/bbp_ng/raw_icons/Empty.png similarity index 100% rename from bbp_ng/icons/Empty.png rename to bbp_ng/raw_icons/Empty.png diff --git a/bbp_ng/raw_icons/README.md b/bbp_ng/raw_icons/README.md new file mode 100644 index 0000000..1122b16 --- /dev/null +++ b/bbp_ng/raw_icons/README.md @@ -0,0 +1,7 @@ +# Raw Icons + +This folder contain all images used by this Blender plugin. + +This folder should not be distributed in production because all of these files are in original size. It is pretty need too much time to load them in blender. +So we keep these high quality images here and provide a tools in `tools` folder. Builder should run script to generate thumbnails in `icons` folder. +Then this Blender plugin can work normally. diff --git a/bbp_ng/icons/element/PC_TwoFlames.png b/bbp_ng/raw_icons/element/PC_TwoFlames.png similarity index 100% rename from bbp_ng/icons/element/PC_TwoFlames.png rename to bbp_ng/raw_icons/element/PC_TwoFlames.png diff --git a/bbp_ng/icons/element/PE_Balloon.png b/bbp_ng/raw_icons/element/PE_Balloon.png similarity index 100% rename from bbp_ng/icons/element/PE_Balloon.png rename to bbp_ng/raw_icons/element/PE_Balloon.png diff --git a/bbp_ng/icons/element/PR_Resetpoint.png b/bbp_ng/raw_icons/element/PR_Resetpoint.png similarity index 100% rename from bbp_ng/icons/element/PR_Resetpoint.png rename to bbp_ng/raw_icons/element/PR_Resetpoint.png diff --git a/bbp_ng/icons/element/PS_FourFlames.png b/bbp_ng/raw_icons/element/PS_FourFlames.png similarity index 100% rename from bbp_ng/icons/element/PS_FourFlames.png rename to bbp_ng/raw_icons/element/PS_FourFlames.png diff --git a/bbp_ng/icons/element/P_Ball_Paper.png b/bbp_ng/raw_icons/element/P_Ball_Paper.png similarity index 100% rename from bbp_ng/icons/element/P_Ball_Paper.png rename to bbp_ng/raw_icons/element/P_Ball_Paper.png diff --git a/bbp_ng/icons/element/P_Ball_Stone.png b/bbp_ng/raw_icons/element/P_Ball_Stone.png similarity index 100% rename from bbp_ng/icons/element/P_Ball_Stone.png rename to bbp_ng/raw_icons/element/P_Ball_Stone.png diff --git a/bbp_ng/icons/element/P_Ball_Wood.png b/bbp_ng/raw_icons/element/P_Ball_Wood.png similarity index 100% rename from bbp_ng/icons/element/P_Ball_Wood.png rename to bbp_ng/raw_icons/element/P_Ball_Wood.png diff --git a/bbp_ng/icons/element/P_Box.png b/bbp_ng/raw_icons/element/P_Box.png similarity index 100% rename from bbp_ng/icons/element/P_Box.png rename to bbp_ng/raw_icons/element/P_Box.png diff --git a/bbp_ng/icons/element/P_Dome.png b/bbp_ng/raw_icons/element/P_Dome.png similarity index 100% rename from bbp_ng/icons/element/P_Dome.png rename to bbp_ng/raw_icons/element/P_Dome.png diff --git a/bbp_ng/icons/element/P_Extra_Life.png b/bbp_ng/raw_icons/element/P_Extra_Life.png similarity index 100% rename from bbp_ng/icons/element/P_Extra_Life.png rename to bbp_ng/raw_icons/element/P_Extra_Life.png diff --git a/bbp_ng/icons/element/P_Extra_Point.png b/bbp_ng/raw_icons/element/P_Extra_Point.png similarity index 100% rename from bbp_ng/icons/element/P_Extra_Point.png rename to bbp_ng/raw_icons/element/P_Extra_Point.png diff --git a/bbp_ng/icons/element/P_Modul_01.png b/bbp_ng/raw_icons/element/P_Modul_01.png similarity index 100% rename from bbp_ng/icons/element/P_Modul_01.png rename to bbp_ng/raw_icons/element/P_Modul_01.png diff --git a/bbp_ng/icons/element/P_Modul_03.png b/bbp_ng/raw_icons/element/P_Modul_03.png similarity index 100% rename from bbp_ng/icons/element/P_Modul_03.png rename to bbp_ng/raw_icons/element/P_Modul_03.png diff --git a/bbp_ng/icons/element/P_Modul_08.png b/bbp_ng/raw_icons/element/P_Modul_08.png similarity index 100% rename from bbp_ng/icons/element/P_Modul_08.png rename to bbp_ng/raw_icons/element/P_Modul_08.png diff --git a/bbp_ng/icons/element/P_Modul_17.png b/bbp_ng/raw_icons/element/P_Modul_17.png similarity index 100% rename from bbp_ng/icons/element/P_Modul_17.png rename to bbp_ng/raw_icons/element/P_Modul_17.png diff --git a/bbp_ng/icons/element/P_Modul_18.png b/bbp_ng/raw_icons/element/P_Modul_18.png similarity index 100% rename from bbp_ng/icons/element/P_Modul_18.png rename to bbp_ng/raw_icons/element/P_Modul_18.png diff --git a/bbp_ng/icons/element/P_Modul_19.png b/bbp_ng/raw_icons/element/P_Modul_19.png similarity index 100% rename from bbp_ng/icons/element/P_Modul_19.png rename to bbp_ng/raw_icons/element/P_Modul_19.png diff --git a/bbp_ng/icons/element/P_Modul_25.png b/bbp_ng/raw_icons/element/P_Modul_25.png similarity index 100% rename from bbp_ng/icons/element/P_Modul_25.png rename to bbp_ng/raw_icons/element/P_Modul_25.png diff --git a/bbp_ng/icons/element/P_Modul_26.png b/bbp_ng/raw_icons/element/P_Modul_26.png similarity index 100% rename from bbp_ng/icons/element/P_Modul_26.png rename to bbp_ng/raw_icons/element/P_Modul_26.png diff --git a/bbp_ng/icons/element/P_Modul_29.png b/bbp_ng/raw_icons/element/P_Modul_29.png similarity index 100% rename from bbp_ng/icons/element/P_Modul_29.png rename to bbp_ng/raw_icons/element/P_Modul_29.png diff --git a/bbp_ng/icons/element/P_Modul_30.png b/bbp_ng/raw_icons/element/P_Modul_30.png similarity index 100% rename from bbp_ng/icons/element/P_Modul_30.png rename to bbp_ng/raw_icons/element/P_Modul_30.png diff --git a/bbp_ng/icons/element/P_Modul_34.png b/bbp_ng/raw_icons/element/P_Modul_34.png similarity index 100% rename from bbp_ng/icons/element/P_Modul_34.png rename to bbp_ng/raw_icons/element/P_Modul_34.png diff --git a/bbp_ng/icons/element/P_Modul_37.png b/bbp_ng/raw_icons/element/P_Modul_37.png similarity index 100% rename from bbp_ng/icons/element/P_Modul_37.png rename to bbp_ng/raw_icons/element/P_Modul_37.png diff --git a/bbp_ng/icons/element/P_Modul_41.png b/bbp_ng/raw_icons/element/P_Modul_41.png similarity index 100% rename from bbp_ng/icons/element/P_Modul_41.png rename to bbp_ng/raw_icons/element/P_Modul_41.png diff --git a/bbp_ng/icons/element/P_Trafo_Paper.png b/bbp_ng/raw_icons/element/P_Trafo_Paper.png similarity index 100% rename from bbp_ng/icons/element/P_Trafo_Paper.png rename to bbp_ng/raw_icons/element/P_Trafo_Paper.png diff --git a/bbp_ng/icons/element/P_Trafo_Stone.png b/bbp_ng/raw_icons/element/P_Trafo_Stone.png similarity index 100% rename from bbp_ng/icons/element/P_Trafo_Stone.png rename to bbp_ng/raw_icons/element/P_Trafo_Stone.png diff --git a/bbp_ng/icons/element/P_Trafo_Wood.png b/bbp_ng/raw_icons/element/P_Trafo_Wood.png similarity index 100% rename from bbp_ng/icons/element/P_Trafo_Wood.png rename to bbp_ng/raw_icons/element/P_Trafo_Wood.png diff --git a/bbp_ng/icons/floor/Flat.png b/bbp_ng/raw_icons/floor/Flat.png similarity index 100% rename from bbp_ng/icons/floor/Flat.png rename to bbp_ng/raw_icons/floor/Flat.png diff --git a/bbp_ng/icons/floor/Normal1x1.png b/bbp_ng/raw_icons/floor/Normal1x1.png similarity index 100% rename from bbp_ng/icons/floor/Normal1x1.png rename to bbp_ng/raw_icons/floor/Normal1x1.png diff --git a/bbp_ng/icons/floor/NormalBorder.png b/bbp_ng/raw_icons/floor/NormalBorder.png similarity index 100% rename from bbp_ng/icons/floor/NormalBorder.png rename to bbp_ng/raw_icons/floor/NormalBorder.png diff --git a/bbp_ng/icons/floor/NormalCrossroad.png b/bbp_ng/raw_icons/floor/NormalCrossroad.png similarity index 100% rename from bbp_ng/icons/floor/NormalCrossroad.png rename to bbp_ng/raw_icons/floor/NormalCrossroad.png diff --git a/bbp_ng/icons/floor/NormalFloor.png b/bbp_ng/raw_icons/floor/NormalFloor.png similarity index 100% rename from bbp_ng/icons/floor/NormalFloor.png rename to bbp_ng/raw_icons/floor/NormalFloor.png diff --git a/bbp_ng/icons/floor/NormalFloorTerminal.png b/bbp_ng/raw_icons/floor/NormalFloorTerminal.png similarity index 100% rename from bbp_ng/icons/floor/NormalFloorTerminal.png rename to bbp_ng/raw_icons/floor/NormalFloorTerminal.png diff --git a/bbp_ng/icons/floor/NormalInnerCorner.png b/bbp_ng/raw_icons/floor/NormalInnerCorner.png similarity index 100% rename from bbp_ng/icons/floor/NormalInnerCorner.png rename to bbp_ng/raw_icons/floor/NormalInnerCorner.png diff --git a/bbp_ng/icons/floor/NormalLConnector.png b/bbp_ng/raw_icons/floor/NormalLConnector.png similarity index 100% rename from bbp_ng/icons/floor/NormalLConnector.png rename to bbp_ng/raw_icons/floor/NormalLConnector.png diff --git a/bbp_ng/icons/floor/NormalOutterCorner.png b/bbp_ng/raw_icons/floor/NormalOutterCorner.png similarity index 100% rename from bbp_ng/icons/floor/NormalOutterCorner.png rename to bbp_ng/raw_icons/floor/NormalOutterCorner.png diff --git a/bbp_ng/icons/floor/NormalPlatform.png b/bbp_ng/raw_icons/floor/NormalPlatform.png similarity index 100% rename from bbp_ng/icons/floor/NormalPlatform.png rename to bbp_ng/raw_icons/floor/NormalPlatform.png diff --git a/bbp_ng/icons/floor/NormalSinkTransition.png b/bbp_ng/raw_icons/floor/NormalSinkTransition.png similarity index 100% rename from bbp_ng/icons/floor/NormalSinkTransition.png rename to bbp_ng/raw_icons/floor/NormalSinkTransition.png diff --git a/bbp_ng/icons/floor/NormalTConnector.png b/bbp_ng/raw_icons/floor/NormalTConnector.png similarity index 100% rename from bbp_ng/icons/floor/NormalTConnector.png rename to bbp_ng/raw_icons/floor/NormalTConnector.png diff --git a/bbp_ng/icons/floor/PaperTrafo.png b/bbp_ng/raw_icons/floor/PaperTrafo.png similarity index 100% rename from bbp_ng/icons/floor/PaperTrafo.png rename to bbp_ng/raw_icons/floor/PaperTrafo.png diff --git a/bbp_ng/icons/floor/RibbonBorder.png b/bbp_ng/raw_icons/floor/RibbonBorder.png similarity index 100% rename from bbp_ng/icons/floor/RibbonBorder.png rename to bbp_ng/raw_icons/floor/RibbonBorder.png diff --git a/bbp_ng/icons/floor/RibbonOutterCorner.png b/bbp_ng/raw_icons/floor/RibbonOutterCorner.png similarity index 100% rename from bbp_ng/icons/floor/RibbonOutterCorner.png rename to bbp_ng/raw_icons/floor/RibbonOutterCorner.png diff --git a/bbp_ng/icons/floor/RibbonPlatform.png b/bbp_ng/raw_icons/floor/RibbonPlatform.png similarity index 100% rename from bbp_ng/icons/floor/RibbonPlatform.png rename to bbp_ng/raw_icons/floor/RibbonPlatform.png diff --git a/bbp_ng/icons/floor/Sink1x1.png b/bbp_ng/raw_icons/floor/Sink1x1.png similarity index 100% rename from bbp_ng/icons/floor/Sink1x1.png rename to bbp_ng/raw_icons/floor/Sink1x1.png diff --git a/bbp_ng/icons/floor/SinkBorder.png b/bbp_ng/raw_icons/floor/SinkBorder.png similarity index 100% rename from bbp_ng/icons/floor/SinkBorder.png rename to bbp_ng/raw_icons/floor/SinkBorder.png diff --git a/bbp_ng/icons/floor/SinkCrossroad.png b/bbp_ng/raw_icons/floor/SinkCrossroad.png similarity index 100% rename from bbp_ng/icons/floor/SinkCrossroad.png rename to bbp_ng/raw_icons/floor/SinkCrossroad.png diff --git a/bbp_ng/icons/floor/SinkFloor.png b/bbp_ng/raw_icons/floor/SinkFloor.png similarity index 100% rename from bbp_ng/icons/floor/SinkFloor.png rename to bbp_ng/raw_icons/floor/SinkFloor.png diff --git a/bbp_ng/icons/floor/SinkFloorTerminal.png b/bbp_ng/raw_icons/floor/SinkFloorTerminal.png similarity index 100% rename from bbp_ng/icons/floor/SinkFloorTerminal.png rename to bbp_ng/raw_icons/floor/SinkFloorTerminal.png diff --git a/bbp_ng/icons/floor/SinkInnerCorner.png b/bbp_ng/raw_icons/floor/SinkInnerCorner.png similarity index 100% rename from bbp_ng/icons/floor/SinkInnerCorner.png rename to bbp_ng/raw_icons/floor/SinkInnerCorner.png diff --git a/bbp_ng/icons/floor/SinkLConnector.png b/bbp_ng/raw_icons/floor/SinkLConnector.png similarity index 100% rename from bbp_ng/icons/floor/SinkLConnector.png rename to bbp_ng/raw_icons/floor/SinkLConnector.png diff --git a/bbp_ng/icons/floor/SinkOutterCorner.png b/bbp_ng/raw_icons/floor/SinkOutterCorner.png similarity index 100% rename from bbp_ng/icons/floor/SinkOutterCorner.png rename to bbp_ng/raw_icons/floor/SinkOutterCorner.png diff --git a/bbp_ng/icons/floor/SinkPlatform.png b/bbp_ng/raw_icons/floor/SinkPlatform.png similarity index 100% rename from bbp_ng/icons/floor/SinkPlatform.png rename to bbp_ng/raw_icons/floor/SinkPlatform.png diff --git a/bbp_ng/icons/floor/SinkTConnector.png b/bbp_ng/raw_icons/floor/SinkTConnector.png similarity index 100% rename from bbp_ng/icons/floor/SinkTConnector.png rename to bbp_ng/raw_icons/floor/SinkTConnector.png diff --git a/bbp_ng/icons/floor/StoneTrafo.png b/bbp_ng/raw_icons/floor/StoneTrafo.png similarity index 100% rename from bbp_ng/icons/floor/StoneTrafo.png rename to bbp_ng/raw_icons/floor/StoneTrafo.png diff --git a/bbp_ng/icons/floor/WideCrossroad.png b/bbp_ng/raw_icons/floor/WideCrossroad.png similarity index 100% rename from bbp_ng/icons/floor/WideCrossroad.png rename to bbp_ng/raw_icons/floor/WideCrossroad.png diff --git a/bbp_ng/icons/floor/WideFloor.png b/bbp_ng/raw_icons/floor/WideFloor.png similarity index 100% rename from bbp_ng/icons/floor/WideFloor.png rename to bbp_ng/raw_icons/floor/WideFloor.png diff --git a/bbp_ng/icons/floor/WideFloorTerminal.png b/bbp_ng/raw_icons/floor/WideFloorTerminal.png similarity index 100% rename from bbp_ng/icons/floor/WideFloorTerminal.png rename to bbp_ng/raw_icons/floor/WideFloorTerminal.png diff --git a/bbp_ng/icons/floor/WideLConnector.png b/bbp_ng/raw_icons/floor/WideLConnector.png similarity index 100% rename from bbp_ng/icons/floor/WideLConnector.png rename to bbp_ng/raw_icons/floor/WideLConnector.png diff --git a/bbp_ng/icons/floor/WideTConnector.png b/bbp_ng/raw_icons/floor/WideTConnector.png similarity index 100% rename from bbp_ng/icons/floor/WideTConnector.png rename to bbp_ng/raw_icons/floor/WideTConnector.png diff --git a/bbp_ng/icons/floor/WoodTrafo.png b/bbp_ng/raw_icons/floor/WoodTrafo.png similarity index 100% rename from bbp_ng/icons/floor/WoodTrafo.png rename to bbp_ng/raw_icons/floor/WoodTrafo.png diff --git a/bbp_ng/icons/group/SoundID_01.png b/bbp_ng/raw_icons/group/SoundID_01.png similarity index 100% rename from bbp_ng/icons/group/SoundID_01.png rename to bbp_ng/raw_icons/group/SoundID_01.png diff --git a/bbp_ng/icons/group/SoundID_02.png b/bbp_ng/raw_icons/group/SoundID_02.png similarity index 100% rename from bbp_ng/icons/group/SoundID_02.png rename to bbp_ng/raw_icons/group/SoundID_02.png diff --git a/bbp_ng/icons/group/SoundID_03.png b/bbp_ng/raw_icons/group/SoundID_03.png similarity index 100% rename from bbp_ng/icons/group/SoundID_03.png rename to bbp_ng/raw_icons/group/SoundID_03.png diff --git a/bbp_ng/tools/build_icons.py b/bbp_ng/tools/build_icons.py new file mode 100644 index 0000000..fe8f9e2 --- /dev/null +++ b/bbp_ng/tools/build_icons.py @@ -0,0 +1,42 @@ +import os +import PIL, PIL.Image + +# the config for thumbnail +g_ThumbnailSize: int = 16 + +def resize_image(src_file: str, dst_file: str) -> None: + # open image + src_image: PIL.Image.Image = PIL.Image.open(src_file) + # create thumbnail + src_image.thumbnail((g_ThumbnailSize, g_ThumbnailSize)) + # save to new file + src_image.save(dst_file) + +def relative_to_folder(abs_path: str, src_parent: str, dst_parent: str) -> str: + return os.path.join(dst_parent, os.path.relpath(abs_path, src_parent)) + +def create_thumbnails() -> None: + # get folder path + root_folder: str = os.path.dirname(os.path.dirname(__file__)) + raw_icons_folder: str = os.path.join(root_folder, 'raw_icons') + icons_folder: str = os.path.join(root_folder, 'icons') + + # iterate raw icons folder + for root, dirs, files in os.walk(raw_icons_folder, topdown = True): + # iterate folder and create it in dest folder + for name in dirs: + src_folder: str = os.path.join(root, name) + dst_folder: str = relative_to_folder(src_folder, raw_icons_folder, icons_folder) + print(f'Creating Folder: {src_folder} -> {dst_folder}') + os.makedirs(dst_folder, exist_ok = True) + for name in files: + if not name.endswith('.png'): continue # skip non-image + src_file: str = os.path.join(root, name) + dst_file: str = relative_to_folder(src_file, raw_icons_folder, icons_folder) + print(f'Processing Thumbnail: {src_file} -> {dst_file}') + resize_image(src_file, dst_file) + + print('Done.') + +if __name__ == '__main__': + create_thumbnails()