Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 10 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ To install the texture packer, install [deppth](https://github.com/quaerus/deppt

# How to Use
Open command prompt and cd to a parent folder, in that folder, have a folder with .pngs (must be a png otherwise the image will not be used) and nested folders with more images.
For this example, the folder with images in it will be called NewIconPkg, with the following setup, and the package we want is ModAuthor-NewIconPackage.\
The package name must include the mod GUID (ModAuthor-ModName) in order to work with Hell2Modding.
For this example, the folder with images in it will be called NewIconPkg, with the following setup below, and the package we want is ThunderstoreTeamName-NewIconPackage.\
The package name must include the ``Mod-GUID`` (ThunderstoreTeamName-ModName) in order to work with Hell2Modding.
```
├── NewIconPkg
│ ├── GUI
Expand All @@ -20,22 +20,22 @@ The package name must include the mod GUID (ModAuthor-ModName) in order to work

Now call (without using py)
```
hades_texture_pack -s NewIconPkg -t ModAuthor-NewIconPackage
hades_texture_pack -s NewIconPkg -t ThunderstoreTeamName-NewIconPackage
```
this will generate a folder called ModAuthor-NewIconPackage in the parent directory that will be correctly formatted for deppth packaging, as well as 2 package files to use.\
this will generate a folder called ThunderstoreTeamName-NewIconPackage in the parent directory that will be correctly formatted for deppth packaging, as well as 2 package files to use.\
This will output the following path to the files from the example above
```
ModAuthor-NewIconPackage/GUI/image1.png
ModAuthor-NewIconPackage/GUI/image2.png
ModAuthor-NewIconPackage/GUI/image3.png
ThunderstoreTeamName-NewIconPackage/GUI/image1.png
ThunderstoreTeamName-NewIconPackage/GUI/image2.png
ThunderstoreTeamName-NewIconPackage/GUI/image3.png
and
ModAuthor-NewIconPackage/GUI/Icons/Iconimage.png
ThunderstoreTeamName-NewIconPackage/GUI/Icons/Iconimage.png
```

All image file paths will follow the file path inside the folder they were originally in, plus the package name appended to the start of it - in order to work with Hell2Modding. For example, if the package was in the folder by itself its file path in-game would just be the ``ModAuthor-NewIconPackage\\{Name}``, but if its path was `NewIconPkg/GUI/Icons` then its file path in-game would be `ModAuthor-NewIconPackage\\GUI\\Icons\\{Name}`
All image file paths will follow the file path inside the folder they were originally in, plus the package name appended to the start of it - in order to work with Hell2Modding. For example, if the package was in the folder by itself its file path in-game would just be the ``ThunderstoreTeamName-NewIconPackage\\{Name}``, but if its path was `NewIconPkg/GUI/Icons` then its file path in-game would be `ThunderstoreTeamName-NewIconPackage\\GUI\\Icons\\{Name}`

## Args
* `-s` or `--source` is the name of the folder in which to recursively search for images
* `-t` or `--target` is the name of the resulting folder to be packed by deppth, must be in the form of a mod GUID (ModAuthor-ModName).
* `-t` or `--target` is the name of the resulting folder to be packed by deppth, must be in the form of a ``Mod-GUID`` (ThunderstoreTeamName-ModName).
* `-dp` or `--deppthpack` (not used above) set to anything but "True" to disable automatic Deppth Packing.
* `-iH` or `--includehulls` (not used above) set to anything but "False" to calculate hull points.
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
entry_points = {
"console_scripts": ['hades_texture_pack = texture_packing_wheel.cli:main']
},
version = "1.2",
version = "1.3",
description = "Format images into an atlas and manifest for packing with deppth",
#long_description = long_descr,
author = "Neil Sandberg & erumi321 & zannc",
Expand Down
2 changes: 1 addition & 1 deletion texture_packing_wheel/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ def main():
# Pack parser
# pack_parser = subparsers.add_parser('pack', help='Pack images into an atlas and manifest', aliases=['pk'])
parser.add_argument('-s', '--source', metavar='source', default='MyPackage', type=str, help='The directory to recursively search for images in, default is current folder')
parser.add_argument('-t', '--target', metavar='target', default='ModAuthor-MyPackage', help='Filenames created will start with this plus a number')
parser.add_argument('-t', '--target', metavar='target', default='ThunderstoreTeamName-MyPackage', help='Filenames created will start with this plus a number')
parser.add_argument('-dP', '--deppthpack', metavar='deppthpack', default='True', help='Automatically Pack your images and Manifest using deppth')
parser.add_argument('-iH', '--includehulls', metavar='includehulls', default = "False", help='Set to anything if you want hull points computed and added')
parser.set_defaults(func=cli_pack)
Expand Down
7 changes: 4 additions & 3 deletions texture_packing_wheel/texture_packing_wheel.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,12 @@

def build_atlases(source_dir, basename, deppth_pack=True, include_hulls=False, logger=lambda s: None):
# Regex check to make sure user inserts a mod guid type basename
regexpattern = r"^[A-Za-z0-9]+[-_][A-Za-z0-9]+$"
if re.match(regexpattern, basename):
regexpattern = r"^[a-z0-9]+(\w+[a-z0-9])?-\w+$"

if re.match(regexpattern, basename, flags=re.I|re.A):
pass
else:
print("Please provide a target with your mod guid, example ModAuthor-Modname or ModAuthor_ModName")
print("Please provide a target with your mod guid, example ThunderstoreTeamName-Modname")
return

if os.path.isdir(basename) == True:
Expand Down