defektu 2021-11-16 21:54:07 +03:00
commit ac245c4643
4 zmienionych plików z 34 dodań i 15 usunięć

Wyświetl plik

@ -149,9 +149,11 @@ def returnData():
orderRarity = getOrder_rarity(i)
if len(orderRarity) == 0:
print(bcolors.WARNING + "Warning" + bcolors.RESET)
print(bcolors.ERROR + "\nERROR:" + bcolors.RESET)
print("The collection " + str(i) + " doesn't follow the naming conventions of attributes. Please move this \n"
"colleciton to Script_Ignore or review proper collection format in README.md")
sys.exit(bcolors.ERROR + "SCRIPT FAILED" + bcolors.RESET)
return
elif len(orderRarity) > 0:
number = orderRarity[0]
@ -224,7 +226,7 @@ def returnData():
combinations = combinations*i
if combinations == 0:
print(bcolors.ERROR + "ERROR:" + bcolors.RESET)
print(bcolors.ERROR + "\nERROR:" + bcolors.RESET)
print("The number of all possible combinations is equal to 0. Please review your collection hierarchy \n "
"and ensure it is formatted correctly.")
print("Please review README.md for more information.")
@ -232,6 +234,7 @@ def returnData():
print("Here is the hierarchy of all collections the DNA_Generator gathered from your .blend file, excluding "
"\nthose in Script_Ignore:")
print(hierarchy)
sys.exit(bcolors.ERROR + "SCRIPT FAILED" + bcolors.RESET)
numBatches = combinations/config.nftsPerBatch
@ -242,6 +245,7 @@ def returnData():
+ str(config.nftsPerBatch) + " NFTs per batch.")
print("Lower the number of NFTs per batch in config.py or increase the number of \nattributes and/or variants"
" in your .blend file.")
sys.exit(bcolors.ERROR + "SCRIPT FAILED" + bcolors.RESET)
return combinations
@ -314,6 +318,7 @@ def generateNFT_DNA():
possibleCombinations = config.maxNFTs
if config.nftsPerBatch > config.maxNFTs:
print(bcolors.WARNING + "\nWARNING:" + bcolors.RESET)
print("The Max num of NFTs you chose is smaller than the NFTs Per Batch you set. Only " + str(config.maxNFTs) + " were added to 1 batch")
if config.enableRarity:

Wyświetl plik

@ -57,6 +57,7 @@ def printImportant():
print("\nSettings:")
print("Reset viewport(enableResetViewport): " + bcolors.WARNING + str(config.enableResetViewport) + bcolors.RESET)
print("3D Models(enable3DModels): " + bcolors.WARNING + str(config.enable3DModels) + bcolors.RESET)
print("")
if config.enable3DModels:
print("3D Model File Format(objectFormatExport): " + bcolors.WARNING + str(config.objectFormatExport) + bcolors.RESET)

Wyświetl plik

@ -1,13 +1,10 @@
import platform
# Set to True to generate images or 3D models depending on your settings below when main.py is run in Blender.
generate = False
# NFT configurations:
nftsPerBatch = 10 # Number of NFTs per batch
renderBatch = 1 # The batch number to render in PNG-Generator
imageName = 'ThisCozyPlace_' # The name of the NFT image produces by PNG-Generator
imageFileFormat = 'PNG' # Dictate the image extension when Blender renders the images
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
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.
@ -19,7 +16,11 @@ save_path_windows = r''
# Example mac: /Users/Path/to/Blend_My_NFTs
# Example windows: C:\Users\Path\to\Blend_My_NFTs
maxNFTs = 50 # The maximum number of NFTs you want to generate - does not work with enable3DModels set to True.
maxNFTs = 0 # 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.
renderImage = False
enableResetViewport = True # If True: turns all viewport and render cameras on after Image_Generator is finished operations
@ -27,7 +28,7 @@ enableResetViewport = True # If True: turns all viewport and render cameras on
enable3DModels = False # Set to True if using external models as attributes instead of Blender objects
# ^Does not work with colour options and rarity, both must be turned off in order to use this.
objectFormatExport = 'glb' # The file format of the objects you would like to export
objectFormatExport = '' # The file format of the objects you would like to export
# The following are file formats Blender accepts for exporting object files.
# Please type the exact name provided below in the '' above:
# fbx - The .FBX file format
@ -94,6 +95,13 @@ enableRarity = False
# True = include weighted rarity percentages in NFTRecord.json calculations,
# False = Pure random selection of variants
# RenderTest.py settings:
# Set to True to run Preview test, set to False to stop test. Run main.py in Blender to initiate the test.
# enable3DModels must be off to run the render test.
runPreview = False
maxNFTsTest = 0 # Increase to get a more accurate reading of the render time. The number of images generated in the render test.
imageNameTest = "" # Name of test file output.
# Specify the XYZ location for objects imported as external files:
locationObjectAttribute = {
"Cone": {"x": 0, "y": 0, "z": 0},
@ -103,5 +111,5 @@ locationObjectAttribute = {
# RenderTest.py settings:
# Set to True to run Preview test, set to False to stop test. Run main.py in Blender to initiate the test.
runPreview = False
maxNFTsTest = 5 # Increase to get a more accurate reading of the render time.
imageNameTest = "TestRenderImage_" # Name of test file output.
maxNFTsTest = 0 # Increase to get a more accurate reading of the render time.
imageNameTest = "" # Name of test file output.

Wyświetl plik

@ -11,14 +11,15 @@ sys.modules.values()
from src.main import config
importlib.reload(config)
from src.generators_and_sorters import DNA_Generator, Preview, RenderTest, Batch_Sorter, Model_Generator
from src.generators_and_sorters import DNA_Generator, Preview, RenderTest, Batch_Sorter, Model_Generator, Image_Generator
importlib.reload(DNA_Generator)
importlib.reload(Batch_Sorter)
importlib.reload(Model_Generator)
importlib.reload(Preview)
importlib.reload(RenderTest)
importlib.reload(Image_Generator)
if not config.runPreview:
if not config.runPreview and not config.renderImage:
if config.enable3DModels:
Model_Generator.generate3DModels()
@ -28,3 +29,7 @@ if not config.runPreview:
if config.runPreview:
Preview.printImportant()
if config.renderImage:
Image_Generator.render_and_save_NFTs()