Bugfix for issue reported by Mitsu
This commit is contained in:
parent
56c1d5427a
commit
85e40b97f4
4 changed files with 12 additions and 5 deletions
|
@ -41,6 +41,8 @@ skyeweave --output out --id 70
|
||||||
|
|
||||||
This would generate the expressions for Scathach (Servant Id 70) in the folder out, using subfolders to better separate the outputs of multiple runs.
|
This would generate the expressions for Scathach (Servant Id 70) in the folder out, using subfolders to better separate the outputs of multiple runs.
|
||||||
|
|
||||||
|
For generating sprite sheets of only a singular ascension, use the `charaId` of the given sprite sheet collection. This is NOT to be confused with the `baseSvtId`, which is similar, but one digit short.
|
||||||
|
|
||||||
### python scripts [EXPERIMENTAL]
|
### python scripts [EXPERIMENTAL]
|
||||||
|
|
||||||
`skyeweave` can also be used in other Python scripts.
|
`skyeweave` can also be used in other Python scripts.
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
[project]
|
[project]
|
||||||
name = "skyeweave"
|
name = "skyeweave"
|
||||||
version = "1.0.0-c.3"
|
version = "1.0.0-c.4"
|
||||||
requires-python = ">= 3.10"
|
requires-python = ">= 3.10"
|
||||||
authors = [{name = "Firq", email = "firelp42@gmail.com"}]
|
authors = [{name = "Firq", email = "firelp42@gmail.com"}]
|
||||||
maintainers = [{name = "Firq", email = "firelp42@gmail.com"}]
|
maintainers = [{name = "Firq", email = "firelp42@gmail.com"}]
|
||||||
|
|
|
@ -36,8 +36,8 @@ def parse_arguments(arguments):
|
||||||
|
|
||||||
parser.add_argument("--version", action="version", version=f"skyeweave {__version__}")
|
parser.add_argument("--version", action="version", version=f"skyeweave {__version__}")
|
||||||
parser.add_argument("--output", action="store", type=str, default=None, dest="output", help="Set the output location. This can be an absolute or relative path")
|
parser.add_argument("--output", action="store", type=str, default=None, dest="output", help="Set the output location. This can be an absolute or relative path")
|
||||||
parser.add_argument("--id", action="store", type=int, default=None, dest="id", help="Set the servantId/charaId - Skips user prompt when provided")
|
parser.add_argument("--id", action="store", type=int, default=None, dest="id", help="Set the servantId (collectionNumber)/charaId (based on baseSvtId) - Skips user prompt when provided")
|
||||||
parser.add_argument("--filter", action="extend", nargs="+", dest="filter", help='SSpecify which spritesheets will actually be used (one or more charaIds)')
|
parser.add_argument("--filter", action="extend", nargs="+", dest="filter", help='Specify which spritesheets will actually be used (one or more charaIds)')
|
||||||
parser.add_argument("--timeout", action="store", type=int, default=None, dest="timeout", help="Set the timeout for all requests towards AtlasAcademy (default: 10s)")
|
parser.add_argument("--timeout", action="store", type=int, default=None, dest="timeout", help="Set the timeout for all requests towards AtlasAcademy (default: 10s)")
|
||||||
parser.add_argument("--no-cache", action="store_true", default=False, dest="nocache", help="Clear cache for this id, keeping all other files")
|
parser.add_argument("--no-cache", action="store_true", default=False, dest="nocache", help="Clear cache for this id, keeping all other files")
|
||||||
parser.add_argument("--reset", action="store_true", default=False, dest="reset", help="Delete any already downloaded assets")
|
parser.add_argument("--reset", action="store_true", default=False, dest="reset", help="Delete any already downloaded assets")
|
||||||
|
|
|
@ -22,9 +22,12 @@ def fetch_config(chara_id: int) -> SpritesheetData:
|
||||||
response = requests.get(url, timeout=AtlasAPIConfig.TIMEOUT)
|
response = requests.get(url, timeout=AtlasAPIConfig.TIMEOUT)
|
||||||
LOGGER.debug(f"{response.status_code} - {response.text}")
|
LOGGER.debug(f"{response.status_code} - {response.text}")
|
||||||
if not response.ok:
|
if not response.ok:
|
||||||
raise ValueError()
|
raise ValueError(f"Failed to fetch data for charaId {chara_id}")
|
||||||
|
|
||||||
resp_data = response.json()[0]
|
resp_json = response.json()
|
||||||
|
if len(resp_json) == 0:
|
||||||
|
raise ValueError(f"No data was returned for get given charaId {chara_id}. Please ensure that this is a valid charaId and not the baseSvtId")
|
||||||
|
resp_data = resp_json[0]
|
||||||
extend_data: ExtendData = resp_data["extendData"]
|
extend_data: ExtendData = resp_data["extendData"]
|
||||||
|
|
||||||
if "faceSizeRect" in extend_data:
|
if "faceSizeRect" in extend_data:
|
||||||
|
@ -92,6 +95,8 @@ def fetch_expression_sheets(tempfolder: pathlib.Path, imageid: int):
|
||||||
response = requests.get(atlasurl, stream=True, timeout=AtlasAPIConfig.TIMEOUT)
|
response = requests.get(atlasurl, stream=True, timeout=AtlasAPIConfig.TIMEOUT)
|
||||||
status = response.status_code
|
status = response.status_code
|
||||||
LOGGER.debug(f"{response.status_code} - {response.text}")
|
LOGGER.debug(f"{response.status_code} - {response.text}")
|
||||||
|
if status != 200 and postfix == "":
|
||||||
|
LOGGER.warning(f"There was no expression sheet for the given charaId {imageid} - please ensure that this charaId is valid.")
|
||||||
if status != 200:
|
if status != 200:
|
||||||
continue
|
continue
|
||||||
for block in response.iter_content(1024):
|
for block in response.iter_content(1024):
|
||||||
|
|
Loading…
Add table
Reference in a new issue