kopia lustrzana https://github.com/torrinworx/Blend_My_NFTs
Merge pull request #110 from AbrarAdnan/BMNFTs_V4_Alpha
Shows which attribute has naming problempull/117/head
commit
78e8bd20e2
|
@ -81,12 +81,22 @@ def get_hierarchy():
|
|||
"""
|
||||
allAttDataList = {}
|
||||
for i in attributeVariants:
|
||||
# Check if name follows naming conventions:
|
||||
if i.count("_") > 2:
|
||||
raise Exception(
|
||||
f"\n{bcolors.ERROR}Blend_My_NFTs Error:\n"
|
||||
f"There is a naming issue with the following Attribute/Variant: '{i}'\n"
|
||||
f"Review the naming convention of Attribute and Variant collections here:\n{bcolors.RESET}"
|
||||
f"https://github.com/torrinworx/Blend_My_NFTs#blender-file-organization-and-structure\n"
|
||||
)
|
||||
|
||||
def getName(i):
|
||||
"""
|
||||
Returns the name of "i" attribute variant
|
||||
"""
|
||||
|
||||
name = i.split("_")[0]
|
||||
|
||||
return name
|
||||
|
||||
def getOrder_rarity(i):
|
||||
|
@ -101,8 +111,25 @@ def get_hierarchy():
|
|||
name = getName(i)
|
||||
orderRarity = getOrder_rarity(i)
|
||||
|
||||
number = orderRarity[0]
|
||||
rarity = orderRarity[1]
|
||||
try:
|
||||
number = orderRarity[0]
|
||||
except:
|
||||
raise Exception(
|
||||
f"\n{bcolors.ERROR}Blend_My_NFTs Error:\n"
|
||||
f"There is a naming issue with the following Attribute/Variant: '{i}'\n"
|
||||
f"Review the naming convention of Attribute and Variant collections here:\n{bcolors.RESET}"
|
||||
f"https://github.com/torrinworx/Blend_My_NFTs#blender-file-organization-and-structure\n"
|
||||
)
|
||||
|
||||
try:
|
||||
rarity = orderRarity[1]
|
||||
except:
|
||||
raise Exception(
|
||||
f"\n{bcolors.ERROR}Blend_My_NFTs Error:\n"
|
||||
f"There is a naming issue with the following Attribute/Variant: '{i}'\n"
|
||||
f"Review the naming convention of Attribute and Variant collections here:\n{bcolors.RESET}"
|
||||
f"https://github.com/torrinworx/Blend_My_NFTs#blender-file-organization-and-structure\n"
|
||||
)
|
||||
|
||||
eachObject = {"name": name, "number": number, "rarity": rarity}
|
||||
allAttDataList[i] = eachObject
|
||||
|
@ -163,6 +190,7 @@ def generateNFT_DNA(collectionSize, enableRarity, enableLogic, logicFile, enable
|
|||
def singleCompleteDNA():
|
||||
"""This function applies Rarity and Logic to a single DNA created by createDNASingle() if Rarity or Logic specified"""
|
||||
singleDNA = ""
|
||||
# Comments for debugging random, rarity, logic, and materials.
|
||||
if not enableRarity:
|
||||
singleDNA = createDNArandom()
|
||||
# print("============")
|
||||
|
|
Ładowanie…
Reference in New Issue