Fix and Time tracking

- BMNFTs now stores total time and batch time across batches for better use with clients/contractor work
- Exporter revamp for time tracking
- Refactorer revamp for time tracking
pull/94/head
Torrin Leonard 2022-04-19 21:54:17 -04:00
rodzic 38fceb6bd9
commit 00a87d993b
3 zmienionych plików z 26 dodań i 4 usunięć

Wyświetl plik

@ -427,7 +427,12 @@ class createData(bpy.types.Operator):
enableLogic,
logicFile, Blend_My_NFTs_Output)
Batch_Sorter.makeBatches(nftName, collectionSize, nftsPerBatch, save_path, batch_json_save_path)
if not enableLogic:
Blend_My_NFTs_Output, batch_json_save_path, nftBatch_save_path = make_directories(save_path)
DNA_Generator.send_To_Record_JSON(collectionSize, nftsPerBatch, save_path, enableRarity, enableLogic,
logicFile, Blend_My_NFTs_Output)
Batch_Sorter.makeBatches(nftName, collectionSize, nftsPerBatch, save_path, batch_json_save_path)
self.report({'INFO'}, f"NFT Data created!")
return {"FINISHED"}

Wyświetl plik

@ -301,5 +301,13 @@ def render_and_save_NFTs(nftName, maxNFTs, batchToGenerate, batch_json_save_path
bpy.data.collections[j].hide_render = False
bpy.data.collections[j].hide_viewport = False
batch_complete_time = time.time() - time_start_1
print(f"\nAll NFTs successfully generated and sent to {nftBatch_save_path}"
f"\nCompleted all renders in Batch{batchToGenerate}.json in {time.time() - time_start_1}s\n")
f"\nCompleted all renders in Batch{batchToGenerate}.json in {batch_complete_time}s\n")
batch_info = {"Batch Render Time": batch_complete_time, "Number of NFTs generated in Batch": x - 1,
"Average time per generation": batch_complete_time / x - 1}
batch_infoFolder = os.path.join(nftBatch_save_path, "Batch" + str(batchToGenerate), "batch_info.json")
save_batch(batch_info, batch_infoFolder)

Wyświetl plik

@ -139,6 +139,8 @@ def reformatNFTCollection(refactor_panel_input):
animationCount = 1
modelCount = 1
dataCount = 1
collection_info = {"Total Time": 0}
for i in batchList:
if images:
imagesDir = os.path.join(refactor_panel_input.nftBatch_save_path, i, "Images")
@ -215,6 +217,15 @@ def reformatNFTCollection(refactor_panel_input):
dataCount += 1
batch_info = json.load(open(os.path.join(refactor_panel_input.nftBatch_save_path, i, "batch_info.json")))
collection_info[os.path.basename(i)] = batch_info
collection_info["Total Time"] = collection_info["Total Time"] + batch_info["Batch Render Time"]
collection_info = json.dumps(collection_info, indent=1, ensure_ascii=True)
with open(os.path.join(completeCollPath, "collection_info.json"), 'w') as outfile:
outfile.write(collection_info + '\n')
print(f"All NFT files stored and sorted to the Complete_Collection folder in {refactor_panel_input.save_path}")
class rename_MetaData_Variables:
@ -233,7 +244,5 @@ def reformatNFTCollection(refactor_panel_input):
solana_description = refactor_panel_input.solana_description
erc721_description = refactor_panel_input.erc721_description
renameMetaData(rename_MetaData_Variables)
shutil.rmtree(refactor_panel_input.nftBatch_save_path)