Refactored and organized config.py

- Added sponsorship credit to Model_Generator.py
pull/19/head
Torrin Leonard 2021-11-16 22:36:50 -05:00
rodzic 085a4ea9f0
commit f7e6ad392f
2 zmienionych plików z 20 dodań i 30 usunięć

Wyświetl plik

@ -1,3 +1,7 @@
# The code in this file was generous sponsored by the amazing team over at Rumble Worlds!
# Feel free to check out their amazing project and see how they are using Blend_My_NFTs
# https://www.rumbleworlds.io/
import bpy
import os
import re

Wyświetl plik

@ -36,36 +36,34 @@ objectFormatExport = '' # The file format of the objects you would like to expo
# obj - The .obj file format *Exports both a .obj and a .mtl files for the same generated object
# x3d - The .x3d file format
### Select colour or material.###
# 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 = 'material' # You can either set 'color' or 'material' here. Type you set will correspond to following options.
# The collections below are RGBA Color values. You can put as many or as little color values in these lists as you would like.
# You can create any number of rgbaColorLists and assign them to any number of collections that you would like.
# Each set of rgbaColorList1 assigned to an object by collection name in the colorList will act like an attribute and create a unique variant of that item.
rgbaColorList1 = [(1,0,0,1),(0,1,0,1),(0,0,1,1),(1,1,1,1),(.5,0,0,1)]
rgbaColorList2 = [(1,1,0,1),(0,1,1,1),(.5,0,1,1),(.5,1,1,1),(0,.5,0,1)]
rgbaColorList1 = [(1, 0, 0, 1), (0, 1, 0, 1), (0, 0, 1, 1), (1, 1, 1, 1), (.5, 0, 0, 1)]
rgbaColorList2 = [(1, 1, 0, 1), (0, 1, 1, 1), (.5, 0, 1, 1), (.5, 1, 1, 1), (0, .5, 0, 1)]
# The following color list can be as long or as short as you want it to be.
# To use this all you need to do is place the name of the collection you want colored in the "" and the set of colors you want to apply to it after the :
# The collection named can only contain objects and not sub collections. Every object in the collection will be set to the colors you assigned above for each attribute
if generationType == 'color': #Do not change this line.
colorList = {"Cube_1_33":rgbaColorList1,"Sphere_4_0":rgbaColorList2}
if generationType == 'color': # Do not change this line.
colorList = {"Cube_1_33": rgbaColorList1, "Sphere_4_0": rgbaColorList2}
### These materials must be in your Current Files' Materials. ###
# These materials must be in your Current Files' Materials. ###
# The collections below are Current Files' Materials. You can put as many or as little materials values in these lists as you would like.
# You can create any number of materialLists and assign them to any number of collections that you would like.
# Each set of materialLists assigned to an object by collection name in the materialList will act like an attribute and create a unique variant of that item.
materialList1 = ['Material1','Material1.001','Material1.002','Material1.003','Material1.004']
materialList2 = ['Material2','Material2.001','Material2.002','Material2.003','Material2.004']
materialList1 = ['Material1', 'Material1.001', 'Material1.002', 'Material1.003', 'Material1.004']
materialList2 = ['Material2', 'Material2.001', 'Material2.002', 'Material2.003', 'Material2.004']
# The following material list can be as long or as short as you want it to be.
# To use this all you need to do is place the name of the collection you want materials assigned in the "" and the set of materials you want to apply to it after the :
# The collection named can only contain objects and not sub collections. Every object in the collection will be set to the materials you assigned above for each attribute
if generationType == 'material': #Do not change this line.
colorList = {"Cube_1_33":materialList1,"Sphere_2_0":materialList2}
if generationType == 'material': # Do not change this line.
colorList = {"Cube_1_33": materialList1, "Sphere_2_0": materialList2}
# Utilities - DO NOT TOUCH:
mac = 'Darwin' # Mac OS
@ -82,10 +80,10 @@ elif platform.system() == windows:
slash = '\\'
# Paths to folders
batch_save_path = save_path + slash + 'Batch_Json_files' # The output path for batches genreated by Batch_Sorter.py
images_save_path = save_path + slash + 'NFT_Image_Output' # The output path for images generated by Image_Generator.py
modelAssetPath = save_path + slash + "3D_Model_Input" # The input path for 3D models
model_save_path = save_path + slash + "3D_Model_Output" # The output path for 3D models generated by Model_Generator.py
batch_save_path = save_path + slash + 'Batch_Json_files' # The output path for batches generated by Batch_Sorter.py
images_save_path = save_path + slash + 'NFT_Image_Output' # The output path for images generated by Image_Generator.py
modelAssetPath = save_path + slash + "3D_Model_Input" # The input path for 3D models
model_save_path = save_path + slash + "3D_Model_Output" # The output path for 3D models generated by Model_Generator.py
# EXPERIMENTAL FEATURES:
@ -95,21 +93,9 @@ enableRarity = False
# True = include weighted rarity percentages in NFTRecord.json calculations,
# False = Pure random selection of variants
# RenderTest.py settings:
# Preview and render test 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},
"Cube": {"x": 0, "y": 0, "z": 0}
}
# 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 = 0 # Increase to get a more accurate reading of the render time.
imageNameTest = "" # Name of test file output.