Skip to content

Commit

Permalink
Got most of the stuff to run art tool with
Browse files Browse the repository at this point in the history
  • Loading branch information
ZadesSC committed Sep 10, 2019
1 parent 641eb09 commit e28ba5b
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 1 deletion.
26 changes: 26 additions & 0 deletions scripts/art_generator/art_set_generator.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
from tt3k_dw9_art_tool import ArtTool
import argparse
import yaml
import pprint
from path_type import PathType
from pathlib import Path

Expand Down Expand Up @@ -39,6 +40,9 @@ def build_portrait_set(self, build_target, target_dir):
# check if load order name exists, if it does, run the art tool on the ps_data
load_order = config_data.get("art_set_build_priority").get(build_target).get("priority")

#create art tool object
art_tool = ArtTool()

#loop through load order and load each portrait set yaml
#for now just only load the first one
ps_data = {}
Expand All @@ -62,8 +66,30 @@ def build_portrait_set(self, build_target, target_dir):
# get art and create it
art_data = ps_data.get(selected_art_set)
character_art_data = art_data.get("arts").get(art)
pp = pprint.PrettyPrinter(indent=4)
pp.pprint(character_art_data)

#run art tool here
char_source_dir = Path(config_data.get("source_dir")).joinpath(config_data.get("art_sets").get(selected_art_set).get("dir")).joinpath(character_art_data.get("src_dir"))
char_target_dir = Path(target_dir).joinpath(character_art_data.get("char_dir_name"))
char_card = character_art_data.get("char_file_name")
char_element = character_art_data.get("element")
char_gender = character_art_data.get("gender")
char_type = character_art_data.get("type")
if char_type == "generic":
char_is_generic = True
elif char_type == "ca_unique" or char_type == "unique":
char_is_generic = False
else:
raise Exception("Error when processing character {}. {} is not a valid value for character type.".format(char_source_dir, char_type))

print(char_source_dir)
print(char_target_dir)
print(char_card)
print(char_element)
print(char_gender)
print(char_is_generic)
#art_tool.build_target_folder_structure(source_dir, target_dir, character_folder, character_element, character_gender, is_generic)

def main():
build_target = args.build_target
Expand Down
2 changes: 1 addition & 1 deletion scripts/art_generator/tt3k_dw9_art_tool.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
import sys
import argparse
from path_type import PathType
from PIL import Image
from PIL import Image #this is Pillow and not PIL
from pathlib import Path


Expand Down

0 comments on commit e28ba5b

Please sign in to comment.