kopia lustrzana https://github.com/torrinworx/Blend_My_NFTs
Small changes to print statements
rodzic
417c8f0ebc
commit
8a2e74b41c
|
@ -28,10 +28,10 @@ if config.runPreview:
|
||||||
config.nftName = "TestImages"
|
config.nftName = "TestImages"
|
||||||
|
|
||||||
def sortRarityWeights(hierarchy, listOptionVariant, DNAList):
|
def sortRarityWeights(hierarchy, listOptionVariant, DNAList):
|
||||||
'''
|
"""
|
||||||
Sorts through DataDictionary and appropriately weights each variant based on their rarity percentage set in Blender
|
Sorts through DataDictionary and appropriately weights each variant based on their rarity percentage set in Blender
|
||||||
("rarity" in DNA_Generator). Then
|
("rarity" in DNA_Generator). Then
|
||||||
'''
|
"""
|
||||||
|
|
||||||
DNASet = set()
|
DNASet = set()
|
||||||
|
|
||||||
|
@ -80,5 +80,6 @@ def sortRarityWeights(hierarchy, listOptionVariant, DNAList):
|
||||||
DNAListRare = list(DNASet)
|
DNAListRare = list(DNASet)
|
||||||
return DNAListRare
|
return DNAListRare
|
||||||
|
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
sortRarityWeights()
|
sortRarityWeights()
|
||||||
|
|
|
@ -8,8 +8,6 @@
|
||||||
import bpy
|
import bpy
|
||||||
import os
|
import os
|
||||||
import sys
|
import sys
|
||||||
import time
|
|
||||||
import json
|
|
||||||
import importlib
|
import importlib
|
||||||
|
|
||||||
dir = os.path.dirname(bpy.data.filepath)
|
dir = os.path.dirname(bpy.data.filepath)
|
||||||
|
@ -24,23 +22,20 @@ importlib.reload(config)
|
||||||
def returnCardanoMetaData(name, description, NFT_DNA, NFT_Variants):
|
def returnCardanoMetaData(name, description, NFT_DNA, NFT_Variants):
|
||||||
metaDataDictCardano = {"721": {
|
metaDataDictCardano = {"721": {
|
||||||
"<policy_id>": {
|
"<policy_id>": {
|
||||||
"<asset_name>": {
|
name: {
|
||||||
"name": name,
|
"name": name,
|
||||||
"image": "",
|
"image": "",
|
||||||
"mediaType": "",
|
"mediaType": "",
|
||||||
"description": description,
|
"description": description,
|
||||||
"files": [{
|
|
||||||
"name": "",
|
|
||||||
"mediaType": "",
|
|
||||||
"src": "",
|
|
||||||
"NFT_Variants": NFT_Variants,
|
|
||||||
"NFT_DNA": NFT_DNA
|
|
||||||
}]
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"version": "1.0"
|
"version": "1.0"
|
||||||
}}
|
}}
|
||||||
|
|
||||||
|
for i in NFT_Variants:
|
||||||
|
metaDataDictCardano["721"]["<policy_id>"][name][i] = NFT_Variants[i]
|
||||||
|
|
||||||
return metaDataDictCardano
|
return metaDataDictCardano
|
||||||
|
|
||||||
def returnSolanaMetaData(name, description, NFT_DNA, NFT_Variants):
|
def returnSolanaMetaData(name, description, NFT_DNA, NFT_Variants):
|
||||||
|
@ -92,6 +87,7 @@ def returnErc721MetaData(name, description, NFT_DNA, NFT_Variants):
|
||||||
|
|
||||||
return metaDataDictErc721
|
return metaDataDictErc721
|
||||||
|
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
returnSolanaMetaData()
|
returnSolanaMetaData()
|
||||||
returnCardanoMetaData()
|
returnCardanoMetaData()
|
||||||
|
|
|
@ -3,12 +3,9 @@
|
||||||
|
|
||||||
import bpy
|
import bpy
|
||||||
import os
|
import os
|
||||||
import re
|
|
||||||
import sys
|
import sys
|
||||||
import copy
|
import copy
|
||||||
import time
|
|
||||||
import json
|
import json
|
||||||
import shutil
|
|
||||||
import importlib
|
import importlib
|
||||||
|
|
||||||
dir = os.path.dirname(bpy.data.filepath)
|
dir = os.path.dirname(bpy.data.filepath)
|
||||||
|
@ -23,6 +20,7 @@ importlib.reload(metaData)
|
||||||
|
|
||||||
removeList = [".gitignore", ".DS_Store"]
|
removeList = [".gitignore", ".DS_Store"]
|
||||||
|
|
||||||
|
|
||||||
def getNFType():
|
def getNFType():
|
||||||
images = False
|
images = False
|
||||||
animations = False
|
animations = False
|
||||||
|
@ -45,9 +43,9 @@ def getNFType():
|
||||||
return images, animations, models, metaData
|
return images, animations, models, metaData
|
||||||
|
|
||||||
def getMetaDataDirty(completeMetaDataPath, i):
|
def getMetaDataDirty(completeMetaDataPath, i):
|
||||||
'''
|
"""
|
||||||
Retrieves a given batches data determined by renderBatch in config.py
|
Retrieves a given batches data determined by renderBatch in config.py
|
||||||
'''
|
"""
|
||||||
|
|
||||||
file_name = os.path.join(completeMetaDataPath, i)
|
file_name = os.path.join(completeMetaDataPath, i)
|
||||||
metaDataDirty = json.load(open(file_name))
|
metaDataDirty = json.load(open(file_name))
|
||||||
|
@ -215,9 +213,10 @@ def reformatNFTCollection():
|
||||||
|
|
||||||
dataCount += 1
|
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)
|
renameMetaData(completeCollPath, completeMetaDataPath)
|
||||||
|
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
reformatNFTCollection()
|
reformatNFTCollection()
|
||||||
|
|
|
@ -45,7 +45,8 @@ def checkIfBatchDup():
|
||||||
return duplicates
|
return duplicates
|
||||||
|
|
||||||
def checkDups():
|
def checkDups():
|
||||||
print("NFTRecord.json contains " + str(checkIfBatchDup()) + " duplicate NFT DNA.")
|
print(f"NFTRecord.json contains {checkIfBatchDup()} duplicate NFT DNA.")
|
||||||
|
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
checkDups()
|
checkDups()
|
||||||
|
|
|
@ -73,7 +73,8 @@ def printImportant():
|
||||||
if not config.enable3DModels:
|
if not config.enable3DModels:
|
||||||
RenderTest.imageRenderTest()
|
RenderTest.imageRenderTest()
|
||||||
if config.enable3DModels:
|
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__':
|
if __name__ == '__main__':
|
||||||
printImportant()
|
printImportant()
|
||||||
|
|
|
@ -81,7 +81,7 @@ def getRealRarity():
|
||||||
|
|
||||||
print(completeData)
|
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:
|
for i in completeData:
|
||||||
print(i + ":")
|
print(i + ":")
|
||||||
|
@ -93,9 +93,10 @@ def getRealRarity():
|
||||||
with open(os.path.join(config.save_path, "RarityData.json"), 'w') as outfile:
|
with open(os.path.join(config.save_path, "RarityData.json"), 'w') as outfile:
|
||||||
outfile.write(jsonMetaData + '\n')
|
outfile.write(jsonMetaData + '\n')
|
||||||
path = os.path.join(config.save_path, "RarityData.json")
|
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
|
return
|
||||||
|
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
getRealRarity()
|
getRealRarity()
|
||||||
|
|
|
@ -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
|
# This file determines the settings of your NFT collection. Please read the README.md file to understand how to run this
|
||||||
# program.
|
# 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.
|
maxNFTs = 0 # The maximum number of NFTs you want to generate.
|
||||||
nftsPerBatch = 10 # Number of NFTs per batch (Batches split maxNFTs into smaller manageable chunks)
|
nftsPerBatch = 0 # Number of NFTs per batch (Batches split maxNFTs into smaller manageable chunks)
|
||||||
renderBatch = 1 # The batch number to render in Exporter.py
|
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:
|
# Type the exact name provided below in the '' above:
|
||||||
# JPEG - Exports the .jpeg format
|
# JPEG - Exports the .jpeg format
|
||||||
# PNG - Exports the .png 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.
|
# for a complete list of object formats supported by Blender.
|
||||||
|
|
||||||
# The path to Blend_My_NFTs folder:
|
# 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_linux = ''
|
||||||
save_path_windows = r''
|
save_path_windows = r''
|
||||||
# Place the path in the '', e.g: save_path_mac = '/Users/Path/to/Blend_My_NFTs'
|
# Place the path in the '', e.g: save_path_mac = '/Users/Path/to/Blend_My_NFTs'
|
||||||
|
|
Ładowanie…
Reference in New Issue