Not finished - refactoring how meta data works

Trying to refactor how meta data works so that it can be changed more easily after BatchRefactorer has run
pull/34/head
Torrin Leonard 2021-12-09 12:13:41 -05:00
rodzic 8f4efb40ca
commit 24e5c25d18
3 zmienionych plików z 18 dodań i 20 usunięć

Wyświetl plik

@ -55,8 +55,6 @@ def render_and_save_NFTs():
x = 1
for a in BatchDNAList:
metaDataDict = {}
for i in hierarchy:
for j in hierarchy[i]:
if config.enableGeneration:
@ -190,7 +188,12 @@ def render_and_save_NFTs():
if not os.path.exists(metaDataFolder):
os.makedirs(metaDataFolder)
metaData.returnMetaData(config.metaDataType, metaDataDict, name, a, dnaDictionary)
metaDataDict = {}
metaDataDict["name"] = name
metaDataDict["description"] = config.metaDataDescription
metaDataDict["NFT_DNA"] = a
metaDataDict["NFT_Variants"] = dnaDictionary
jsonMetaData = json.dumps(metaDataDict, indent=1, ensure_ascii=True)
with open(os.path.join(metaDataFolder, "Data_" + name + ".json"), 'w') as outfile:

Wyświetl plik

@ -21,18 +21,12 @@ from src import config
importlib.reload(config)
def returnMetaData(metaDataType, metaDataDict, name, a, dnaDictionary):
def returnMetaData(metaDataDict, name, a, dnaDictionary):
'''
This function exports formatted meta data based on the metaDataType variable in config.py
'''
if metaDataType == "DEFAULT":
metaDataDict["name"] = name
metaDataDict["description"] = config.metaDataDescription
metaDataDict["NFT_DNA"] = a
metaDataDict["NFT_Variants"] = dnaDictionary
elif metaDataType == "SOL":
if config.solanaMetaData:
metaDataDict["name"] = config.nftName
metaDataDict["symbol"] = ""
metaDataDict["description"] = config.metaDataDescription
@ -61,7 +55,7 @@ def returnMetaData(metaDataType, metaDataDict, name, a, dnaDictionary):
"creators": [{"address": "", "share": None}]
}
elif metaDataType == "ADA":
if config.cardanoMetaData:
metaDataDict["721"] = {
"<policy_id>": {
"<asset_name>": {
@ -81,7 +75,7 @@ def returnMetaData(metaDataType, metaDataDict, name, a, dnaDictionary):
"version": "1.0"
}
elif metaDataType == "ERC721":
if config.erc721MetaData:
metaDataDict["title"] = name
metaDataDict["type"] = ""
metaDataDict["properties"] = {"NFT_Variants": dnaDictionary,

Wyświetl plik

@ -39,7 +39,7 @@ save_path_windows = r''
maxNFTs = 20 # The maximum number of NFTs you want to generate.
nftsPerBatch = 5 # Number of NFTs per batch
renderBatch = 4 # The batch number to render in Exporter.py
renderBatch = 1 # The batch number to render in Exporter.py
# Set to True to generate images or 3D models depending on your settings below when main.py is run in Blender. Only works
# if you have already generated NFTRecord.json and all batches.
@ -93,11 +93,12 @@ if generationType == 'material': # Do not change this line.
# Meta Data generation
enableMetaData = True # Set to True to turn on meta data, set to False to turn off meta data generation.
metaDataType = 'ADA' # Select the format of the generated Meta Data for your NFTs blockchain.
# DEFAULT - The default setting; exports variants, dna, number, name, and rarity of each NFT to a dictionary (Not a blockchain standard)
# ADA - Cardano - Format Source: https://cips.cardano.org/cips/cip25/
# SOL - Solana - Format Source: https://docs.metaplex.com/nft-standard
# ERC721 - Ethereum ERC721 - Format Source: https://eips.ethereum.org/EIPS/eip-721
metaDataType = 'ADA'
# Select the format of the generated Meta Data for your NFTs blockchain.
defaultMetaData = True # The default setting; exports variants, dna, number, name, and rarity of each NFT to a dictionary (Not a blockchain standard)
cardanoMetaData = False # Cardano - Format Source: https://cips.cardano.org/cips/cip25/
solanaMetaData = False # Solana - Format Source: https://docs.metaplex.com/nft-standard
erc721MetaData = False # Ethereum ERC721 - Format Source: https://eips.ethereum.org/EIPS/eip-721
# NOTE: This is just the information Blend_My_NFTs can provide, you will have to add policy ID, URI information, etc
# yourself when you upload and mint your NFT collection.
@ -154,7 +155,7 @@ maxNFTsTest = 5 # Increase to get a more accurate reading of the render time. T
checkDups = False
# EXPERIMENTAL FEATURE:
refactorBatchOrder = True # When set to True, sorts, renames, and moves all NFTs files in all batches in NFT_Output
refactorBatchOrder = False # When set to True, sorts, renames, and moves all NFTs files in all batches in NFT_Output
# folder to the Complete_Collection folder.
# After you generate all batches move them all to one computer and place them in the NFT_Output folder of Blend_My_NFTs.
# Run main.py with refactorBatchOrder set to True and all NFT files will be renamed and sorted into a folder called Complete_Collection.