verbreed / prototype-assist

Script to help with administrative tasks for building prototypes for physical games. This currently includes making numerous deck images for TableTop Simulator (TTS), some board making code specific to my purposes, and making the instruction manual (currently in production)
MIT License
0 stars 0 forks source link

restructure prototype-assist.py #19

Closed bcvilnrotter closed 1 year ago

bcvilnrotter commented 1 year ago

proposing a way of decoupling the argparse section of the script to be more contiguous and make more sense:

instead of subparsers: {tts_deckbuilder, tts_mapbuilder} it should be something focused on the actual image transformations:

suggestion:

{

group -> take an image (or folder containing images), and duplicate them into a bigger image separate -> take a large image filled with other images, and pull the images into individual images combine -> take images from folder, and add them to an image (initially can be randomly placed)

}

bcvilnrotter commented 1 year ago

possible argument breakdown. Very very very very bare-bones, not fully thought out.

base arguments

-i, --image_single, help=required path to the image that will be affected (either -i or -d is required)
-d, --directory_group, help=required path to a directory containing images that will be affected (either -i or -d is required)
-o, --crop_image, help=flag if cropping an image is needed
-s, --stats, help=stats of window to crop (required if -o is used)
-t, --crop_type, help=determines where to place the window to crop (currently only expecting to use 'random')

group:

--single, help=flag that tells the script to take each image in the directory and copy those into a bigger image per image (--single or --complete is required when using -d base argument)
--complete, help=flag that tells the script to make a single image out of all the images in the directory (--single or --complete is required when using -d base argument)
-m, --measuring_item, help=optional path to an image item that will be used to resize the image
-g, --grouping_ratio, default=[10,7], help=optional ratio that tells the script how to group the images (Width, Height)

separate:

--single, help=flag that tells the script to take each image in the directory and copy those into a bigger image per image (--single or --complete is required when using -d base argument)
--complete, help=flag that tells the script to make a single image out of all the images in the directory (--single or --complete is required when using -d base argument)

combine:

-p, page_asset, help=path to the file that contains multiple pictures that will be separated and combined to the main image
-a, asset_folder, help=path to folder that contains multiple images that will be combined to the main image
bcvilnrotter commented 1 year ago

This ticket should be closed.

In order to do so, I will be structuring the input sources as an exclusive_argument_group: {file, glob, google-api}

Currently {directory} will be left alone, but I would like to replace that with a jobs folder.

directory -> job where the argument for job will be to generate an output path where all deliverables for the script will be placed. This will be an optional argument since the script will by default generate a jobs folder. The argument itself will be used so multiple actions for a complex task can be localized to the same folder (super helpful as my current folder structure is immensely bad).

Later; the subparser instruction_manual should be added so that a docx file pulled from google drive can be parsed, and it's data pasted into a template image (it should take as many template pages as necessary while still maintaining multiple factors such as indeces, font size, font type, paragraphs, bold, etc...)

That said, since this is a massive issue to tackle, and will probable change by the time it is complete, I'm going to create a couple of smaller issues that will mention this issue for reference so we can see meaningful progress.

bcvilnrotter commented 1 year ago

adding mutually_exclusive_group of arguments has caused conflicts with the subparsers in argparse. For this reason I have resulted in creating a common_args parser that all subparser will use as a parent parser, as well as adding args conditioning after parsing. This has been done in #33

Centralized jobs folder functionality has also been added #44.

All the necessary components to close this is issue have been completed, so it will be closed.