Skip to content

Commit

Permalink
semantic changes
Browse files Browse the repository at this point in the history
change names of basename arg and of CLI command
  • Loading branch information
erumi321 committed Jul 8, 2024
1 parent 59606c3 commit 146995a
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 18 deletions.
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ The package name must include the mod GUID (ModAuthor-ModName) in order to work

Now call (without using py)
```
texture_packing_wheel pk -s NewIconPkg -b ModAuthor-NewIconPackage
hades_texture_pack -s NewIconPkg -t ModAuthor-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 output the following path to the files from the example above
Expand All @@ -35,7 +35,7 @@ ModAuthor-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}`

## Args
* `-s` or `--source` is the name of the folder you want to recursively search for in images
* `-b` or `--basename` is the name of the package and folder that will be formatted to be packed.
* `-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).
* `-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.
* `-iH` or `--includehulls` (not used above) set to anything but "False" to calculate hull points.
6 changes: 3 additions & 3 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,15 @@


setup(
name = "texture_packing_wheel",
name = "hades_texture_pack",
packages = ["texture_packing_wheel"],
entry_points = {
"console_scripts": ['texture_packing_wheel = texture_packing_wheel.cli:main']
"console_scripts": ['hades_texture_pack = texture_packing_wheel.cli:main']
},
version = "1.2",
description = "Format images into an atlas and manifest for packing with deppth",
#long_description = long_descr,
author = "Neil Sandberg & erumi321",
author = "Neil Sandberg & erumi321 & zannc",
author_email = "[email protected]",
url = "",
)
20 changes: 10 additions & 10 deletions texture_packing_wheel/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,23 +5,23 @@
from .texture_packing_wheel import build_atlases

def main():
parser = argparse.ArgumentParser(prog='texture_packer_wheel', description='Format images into an atlas and manifest for packing with deppth')
subparsers = parser.add_subparsers(help='The action to perform', dest='action')
parser = argparse.ArgumentParser(prog='hades_texture_pack', description='Format images into an atlas and manifest for packing with deppth')
# subparsers = parser.add_subparsers(help='The action to perform', dest='action')

# Pack parser
pack_parser = subparsers.add_parser('pack', help='Pack images into an atlas and manifest', aliases=['pk'])
pack_parser.add_argument('-s', '--source', metavar='source', default='MyPackage', type=str, help='The directory to recursively search for images in, default is current folder')
pack_parser.add_argument('-b', '--basename', metavar='basename', default='MyPackage', help='Filenames created will start with this plus a number')
pack_parser.add_argument('-dp', '--deppthpack', metavar='deppthpack', default='True', help='Automatically Pack your images and Manifest using deppth')
pack_parser.add_argument('-iH', '--includehulls', metavar='includehulls', default = "False", help='Set to anything if you want hull points computed and added')
pack_parser.set_defaults(func=cli_pack)
# 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('-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)

args = parser.parse_args()
args.func(args)

def cli_pack(args):
source = args.source
basename = args.basename
target = args.target

deppth = True
if args.deppthpack != "True":
Expand All @@ -31,4 +31,4 @@ def cli_pack(args):
if args.includehulls != "False":
hulls = True

build_atlases(source, basename, deppth, hulls, logger=lambda s: print(s))
build_atlases(source, target, deppth, hulls)
2 changes: 1 addition & 1 deletion texture_packing_wheel/texture_packing_wheel.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ def build_atlases(source_dir, basename, deppth_pack=True, include_hulls=False, l
if re.match(regexpattern, basename):
pass
else:
print("Please provide a basename with your mod guid, example ModAuthor-Modname or ModAuthor_ModName")
print("Please provide a target with your mod guid, example ModAuthor-Modname or ModAuthor_ModName")
return

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

0 comments on commit 146995a

Please sign in to comment.