Added DuplicateChecker.py

pull/24/head
Torrin Leonard 2021-11-19 18:39:20 -05:00
rodzic c442cf9190
commit 74852ad837
2 zmienionych plików z 54 dodań i 6 usunięć

Wyświetl plik

@ -0,0 +1,48 @@
import bpy
import os
import sys
import json
import platform
import importlib
dir = os.path.dirname(bpy.data.filepath)
sys.path.append(dir)
sys.modules.values()
from src.main import config
importlib.reload(config)
listBatchFolder = os.listdir(config.batch_save_path)
numInBatchFolder = len(listBatchFolder)
removeList = [".gitignore", ".DS_Store", "Script_Ignore_Folder"]
batchList = [x for x in listBatchFolder if (x not in removeList)]
def checkIfBatchDup(i):
file_name = os.path.join(config.batch_save_path, i)
DataDictionary = json.load(open(file_name))
nftsInBatch = DataDictionary["NFTs_in_Batch"]
hierarchy = DataDictionary["hierarchy"]
DNAList = DataDictionary["BatchDNAList"]
def countDups(thelist):
numOfDupDNA = 0
seen = set()
for x in thelist:
if x in seen: numOfDupDNA += 1
seen.add(x)
return numOfDupDNA
duplicates = countDups(DNAList)
return duplicates
for i in batchList:
print("\nThis is the duplication result for " + i + ":")
print(checkIfBatchDup(i))
print("\n")

Wyświetl plik

@ -1,22 +1,22 @@
import platform
# NFT configurations:
nftsPerBatch = 0 # Number of NFTs per batch
renderBatch = 0 # The batch number to render in PNG-Generator
imageName = '' # The name of the NFT image produces by PNG-Generator
nftsPerBatch = 100000 # Number of NFTs per batch
renderBatch = 1 # The batch number to render in PNG-Generator
imageName = 'TestImage' # The name of the NFT image produces by PNG-Generator
imageFileFormat = '' # Dictate the image extension when Blender renders the images
# Visit https://docs.blender.org/api/current/bpy.types.Image.html#bpy.types.Image.file_format
# for a list of file formats supported by Blender. Enter the file extension exactly as specified in
# the Blender API documentation above.
# The path to Blend_My_NFTs folder:
save_path_mac = '/Users/Path/to/Blend_My_NFTs'
save_path_mac = '/Users/torrinleonard/Desktop/Blend_My_NFTs'
save_path_windows = r''
# Place the path in the '', e.g: save_path_mac = '/Users/Path/to/Blend_My_NFTs'
# Example mac: /Users/Path/to/Blend_My_NFTs
# Example windows: C:\Users\Path\to\Blend_My_NFTs
maxNFTs = 0 # The maximum number of NFTs you want to generate - does not work with enable3DModels set to True.
maxNFTs = 1000000 # The maximum number of NFTs you want to generate - does not work with enable3DModels set to True.
# 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.
@ -40,7 +40,7 @@ objectFormatExport = '' # The file format of the objects you would like to expo
# Object generation options:
enableGeneration = True # When set to true this applies the sets of colors listed below to the objects in the collections named below
generationType = 'material' #You can either set 'color' or 'material' here. Type you set will correspond to following options.
generationType = 'color' #You can either set 'color' or 'material' here. Type you set will correspond to following options.
#generationType = 'material' mode is experimental. Be sure that you back-up your file.
#You need to set materials as "fake user". Do not miss this step. Or your materials going to vanish after running this script.