diff --git a/src/Main_Generators/Rarity_Sorter.py b/src/Main_Generators/Rarity_Sorter.py index 441da97..feeb762 100644 --- a/src/Main_Generators/Rarity_Sorter.py +++ b/src/Main_Generators/Rarity_Sorter.py @@ -28,10 +28,10 @@ if config.runPreview: config.nftName = "TestImages" def sortRarityWeights(hierarchy, listOptionVariant, DNAList): - ''' + """ Sorts through DataDictionary and appropriately weights each variant based on their rarity percentage set in Blender ("rarity" in DNA_Generator). Then - ''' + """ DNASet = set() @@ -80,5 +80,6 @@ def sortRarityWeights(hierarchy, listOptionVariant, DNAList): DNAListRare = list(DNASet) return DNAListRare + if __name__ == '__main__': sortRarityWeights() diff --git a/src/Main_Generators/metaData.py b/src/Main_Generators/metaData.py index 42080d0..b4b0cd1 100644 --- a/src/Main_Generators/metaData.py +++ b/src/Main_Generators/metaData.py @@ -8,8 +8,6 @@ import bpy import os import sys -import time -import json import importlib dir = os.path.dirname(bpy.data.filepath) @@ -24,23 +22,20 @@ importlib.reload(config) def returnCardanoMetaData(name, description, NFT_DNA, NFT_Variants): metaDataDictCardano = {"721": { "": { - "": { + name: { "name": name, "image": "", "mediaType": "", "description": description, - "files": [{ - "name": "", - "mediaType": "", - "src": "", - "NFT_Variants": NFT_Variants, - "NFT_DNA": NFT_DNA - }] + } }, "version": "1.0" }} + for i in NFT_Variants: + metaDataDictCardano["721"][""][name][i] = NFT_Variants[i] + return metaDataDictCardano def returnSolanaMetaData(name, description, NFT_DNA, NFT_Variants): @@ -92,6 +87,7 @@ def returnErc721MetaData(name, description, NFT_DNA, NFT_Variants): return metaDataDictErc721 + if __name__ == '__main__': returnSolanaMetaData() returnCardanoMetaData() diff --git a/src/Utility_Scripts/BatchRefactorer.py b/src/Utility_Scripts/BatchRefactorer.py index 0de8f0f..a03e2dd 100644 --- a/src/Utility_Scripts/BatchRefactorer.py +++ b/src/Utility_Scripts/BatchRefactorer.py @@ -3,12 +3,9 @@ import bpy import os -import re import sys import copy -import time import json -import shutil import importlib dir = os.path.dirname(bpy.data.filepath) @@ -23,6 +20,7 @@ importlib.reload(metaData) removeList = [".gitignore", ".DS_Store"] + def getNFType(): images = False animations = False @@ -45,9 +43,9 @@ def getNFType(): return images, animations, models, metaData def getMetaDataDirty(completeMetaDataPath, i): - ''' + """ Retrieves a given batches data determined by renderBatch in config.py - ''' + """ file_name = os.path.join(completeMetaDataPath, i) metaDataDirty = json.load(open(file_name)) @@ -215,9 +213,10 @@ def reformatNFTCollection(): dataCount += 1 - print("All NFT files stored and sorted to the Complete_Collection folder in {}".format(config.save_path)) + print(f"All NFT files stored and sorted to the Complete_Collection folder in {config.save_path}") renameMetaData(completeCollPath, completeMetaDataPath) + if __name__ == '__main__': reformatNFTCollection() diff --git a/src/Utility_Scripts/DuplicateChecker.py b/src/Utility_Scripts/DuplicateChecker.py index 3d68825..0da9e3c 100644 --- a/src/Utility_Scripts/DuplicateChecker.py +++ b/src/Utility_Scripts/DuplicateChecker.py @@ -45,7 +45,8 @@ def checkIfBatchDup(): return duplicates def checkDups(): - print("NFTRecord.json contains " + str(checkIfBatchDup()) + " duplicate NFT DNA.") + print(f"NFTRecord.json contains {checkIfBatchDup()} duplicate NFT DNA.") + if __name__ == '__main__': checkDups() diff --git a/src/Utility_Scripts/Preview.py b/src/Utility_Scripts/Preview.py index c630645..98d00da 100644 --- a/src/Utility_Scripts/Preview.py +++ b/src/Utility_Scripts/Preview.py @@ -73,7 +73,8 @@ def printImportant(): if not config.enable3DModels: RenderTest.imageRenderTest() if config.enable3DModels: - print( bcolors.WARNING + "Cannot run Render Test when enable3DModels = True" + bcolors.RESET) + print(f"{bcolors.WARNING} Cannot run Render Test when enable3DModels = True {bcolors.RESET}") + if __name__ == '__main__': printImportant() diff --git a/src/Utility_Scripts/RarityChecker.py b/src/Utility_Scripts/RarityChecker.py index c21d7bd..3f3e5b0 100644 --- a/src/Utility_Scripts/RarityChecker.py +++ b/src/Utility_Scripts/RarityChecker.py @@ -81,7 +81,7 @@ def getRealRarity(): print(completeData) - print(bcolors.OK + "Rarity Checker is active. These are the percentages for each variant per attribute you set in your .blend file:" + bcolors.RESET) + print(f"{bcolors.OK} Rarity Checker is active. These are the percentages for each variant per attribute you set in your .blend file:{bcolors.RESET}") for i in completeData: print(i + ":") @@ -93,9 +93,10 @@ def getRealRarity(): with open(os.path.join(config.save_path, "RarityData.json"), 'w') as outfile: outfile.write(jsonMetaData + '\n') path = os.path.join(config.save_path, "RarityData.json") - print(bcolors.OK + f"Rarity Data has been saved to {path}." + bcolors.RESET) + print(f"{bcolors.OK}Rarity Data has been saved to {path}. {bcolors.RESET}") return + if __name__ == '__main__': getRealRarity() diff --git a/src/config.py b/src/config.py index 396ba4a..b0ef5e7 100644 --- a/src/config.py +++ b/src/config.py @@ -2,13 +2,13 @@ # This file determines the settings of your NFT collection. Please read the README.md file to understand how to run this # program. -nftName = 'Test' # The name of the NFT image produces by PNG-Generator +nftName = '' # The name of the NFT image produces by PNG-Generator -maxNFTs = 10 # The maximum number of NFTs you want to generate. -nftsPerBatch = 10 # Number of NFTs per batch (Batches split maxNFTs into smaller manageable chunks) +maxNFTs = 0 # The maximum number of NFTs you want to generate. +nftsPerBatch = 0 # Number of NFTs per batch (Batches split maxNFTs into smaller manageable chunks) renderBatch = 1 # The batch number to render in Exporter.py -imageFileFormat = 'PNG' # Dictate the image extension when Blender renders the images +imageFileFormat = '' # Dictate the image extension when Blender renders the images # Type the exact name provided below in the '' above: # JPEG - Exports the .jpeg format # PNG - Exports the .png format @@ -35,7 +35,7 @@ modelFileFormat = '' # The file format of the objects you would like to export # for a complete list of object formats supported by Blender. # The path to Blend_My_NFTs folder: -save_path_mac = '/Users/torrinleonard/Desktop/ThisCozyStudio/Blend_My_NFTs' +save_path_mac = '' save_path_linux = '' save_path_windows = r'' # Place the path in the '', e.g: save_path_mac = '/Users/Path/to/Blend_My_NFTs'