torrinworx / Blend_My_NFTs

Easily generate thousands of 3D models, images, and animation automatically in Blender for free with Blend_My_NFTs.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Logic V2 bugs

shadyaymn opened this issue · comments

Blender Version 3.1.2
RAM: 12GB
Operating System: Windows 10
Processor: Intel(R) Core(TM) i7-2600K CPU @ 3.40GHz
Graphics Card: NVIDIA GeForce GTX 1660 Ti

Firstly I tested logic alone with 2 objects called "Cone Big_1_90" and "Sphere Big_1_90". The cone object was in the IF section of the JSON and the Sphere was in the THEN section, making the script look like this.
{
"Rule-1":{
"IF": [
"Cone Big_1_90"
],
"THEN":[
"Sphere Big_1_90"
]
}
}

After clicking create data a couple times I noticed it would work sometimes and others not. When it didn't work this error came up:

Python: Traceback (most recent call last):
File "C:\Users\Shady\AppData\Roaming\Blender Foundation\Blender\3.1\scripts\addons\Blend_My_NFTs-Logic_v2_and_minor_changes_init_.py", line 418, in execute
DNA_Generator.send_To_Record_JSON(collectionSize, nftsPerBatch, save_path, enableRarity, enableLogic, logicFile, enableMaterials,
File "C:\Users\Shady\AppData\Roaming\Blender Foundation\Blender\3.1\scripts\addons\Blend_My_NFTs-Logic_v2_and_minor_changes\main\DNA_Generator.py", line 361, in send_To_Record_JSON
create_nft_data()
File "C:\Users\Shady\AppData\Roaming\Blender Foundation\Blender\3.1\scripts\addons\Blend_My_NFTs-Logic_v2_and_minor_changes\main\DNA_Generator.py", line 316, in create_nft_data
DataDictionary = generateNFT_DNA(collectionSize, enableRarity, enableLogic, logicFile, enableMaterials,
File "C:\Users\Shady\AppData\Roaming\Blender Foundation\Blender\3.1\scripts\addons\Blend_My_NFTs-Logic_v2_and_minor_changes\main\DNA_Generator.py", line 214, in generateNFT_DNA
DNAList = create_DNAList()
File "C:\Users\Shady\AppData\Roaming\Blender Foundation\Blender\3.1\scripts\addons\Blend_My_NFTs-Logic_v2_and_minor_changes\main\DNA_Generator.py", line 196, in create_DNAList
DNASetReturn |= {''.join([dnaPushToList()]) for _ in range(collectionSize - len(DNASetReturn))}
File "C:\Users\Shady\AppData\Roaming\Blender Foundation\Blender\3.1\scripts\addons\Blend_My_NFTs-Logic_v2_and_minor_changes\main\DNA_Generator.py", line 196, in
DNASetReturn |= {''.join([dnaPushToList()]) for _ in range(collectionSize - len(DNASetReturn))}
File "C:\Users\Shady\AppData\Roaming\Blender Foundation\Blender\3.1\scripts\addons\Blend_My_NFTs-Logic_v2_and_minor_changes\main\DNA_Generator.py", line 181, in singleCompleteDNA
singleDNA = Logic.logicafyDNAsingle(hierarchy, singleDNA, logicFile, enableRarity, enableMaterials)
File "C:\Users\Shady\AppData\Roaming\Blender Foundation\Blender\3.1\scripts\addons\Blend_My_NFTs-Logic_v2_and_minor_changes\main\Logic.py", line 244, in logicafyDNAsingle
deconstructed_DNA = apply_rules_to_dna(
File "C:\Users\Shady\AppData\Roaming\Blender Foundation\Blender\3.1\scripts\addons\Blend_My_NFTs-Logic_v2_and_minor_changes\main\Logic.py", line 49, in apply_rules_to_dna
attribute_index = deconstructed_DNA.index(a)
ValueError: 'Sphere' is not in list

location: :-1
Error: Python: Traceback (most recent call last):
File "C:\Users\Shady\AppData\Roaming\Blender Foundation\Blender\3.1\scripts\addons\Blend_My_NFTs-Logic_v2_and_minor_changes_init_.py", line 418, in execute
DNA_Generator.send_To_Record_JSON(collectionSize, nftsPerBatch, save_path, enableRarity, enableLogic, logicFile, enableMaterials,
File "C:\Users\Shady\AppData\Roaming\Blender Foundation\Blender\3.1\scripts\addons\Blend_My_NFTs-Logic_v2_and_minor_changes\main\DNA_Generator.py", line 361, in send_To_Record_JSON
create_nft_data()
File "C:\Users\Shady\AppData\Roaming\Blender Foundation\Blender\3.1\scripts\addons\Blend_My_NFTs-Logic_v2_and_minor_changes\main\DNA_Generator.py", line 316, in create_nft_data
DataDictionary = generateNFT_DNA(collectionSize, enableRarity, enableLogic, logicFile, enableMaterials,
File "C:\Users\Shady\AppData\Roaming\Blender Foundation\Blender\3.1\scripts\addons\Blend_My_NFTs-Logic_v2_and_minor_changes\main\DNA_Generator.py", line 214, in generateNFT_DNA
DNAList = create_DNAList()
File "C:\Users\Shady\AppData\Roaming\Blender Foundation\Blender\3.1\scripts\addons\Blend_My_NFTs-Logic_v2_and_minor_changes\main\DNA_Generator.py", line 196, in create_DNAList
DNASetReturn |= {''.join([dnaPushToList()]) for _ in range(collectionSize - len(DNASetReturn))}
File "C:\Users\Shady\AppData\Roaming\Blender Foundation\Blender\3.1\scripts\addons\Blend_My_NFTs-Logic_v2_and_minor_changes\main\DNA_Generator.py", line 196, in
DNASetReturn |= {''.join([dnaPushToList()]) for _ in range(collectionSize - len(DNASetReturn))}
File "C:\Users\Shady\AppData\Roaming\Blender Foundation\Blender\3.1\scripts\addons\Blend_My_NFTs-Logic_v2_and_minor_changes\main\DNA_Generator.py", line 181, in singleCompleteDNA
singleDNA = Logic.logicafyDNAsingle(hierarchy, singleDNA, logicFile, enableRarity, enableMaterials)
File "C:\Users\Shady\AppData\Roaming\Blender Foundation\Blender\3.1\scripts\addons\Blend_My_NFTs-Logic_v2_and_minor_changes\main\Logic.py", line 244, in logicafyDNAsingle
deconstructed_DNA = apply_rules_to_dna(
File "C:\Users\Shady\AppData\Roaming\Blender Foundation\Blender\3.1\scripts\addons\Blend_My_NFTs-Logic_v2_and_minor_changes\main\Logic.py", line 49, in apply_rules_to_dna
attribute_index = deconstructed_DNA.index(a)
ValueError: 'Sphere' is not in list

location: :-1

I noticed it said "Sphere" when the object is called "Sphere Big" this led me to believe the Space between "Sphere" and "Big" caused issues, and after removing the space no error was given no matter how many times I pressed create data.

The second issue arose when using material rarity and logic together. This error was shown.

location: :-1
Error: Python: Traceback (most recent call last):
File "C:\Users\Shady\AppData\Roaming\Blender Foundation\Blender\3.1\scripts\addons\Blend_My_NFTs-Logic_v2_and_minor_changes_init_.py", line 418, in execute
DNA_Generator.send_To_Record_JSON(collectionSize, nftsPerBatch, save_path, enableRarity, enableLogic, logicFile, enableMaterials,
File "C:\Users\Shady\AppData\Roaming\Blender Foundation\Blender\3.1\scripts\addons\Blend_My_NFTs-Logic_v2_and_minor_changes\main\DNA_Generator.py", line 361, in send_To_Record_JSON
create_nft_data()
File "C:\Users\Shady\AppData\Roaming\Blender Foundation\Blender\3.1\scripts\addons\Blend_My_NFTs-Logic_v2_and_minor_changes\main\DNA_Generator.py", line 316, in create_nft_data
DataDictionary = generateNFT_DNA(collectionSize, enableRarity, enableLogic, logicFile, enableMaterials,
File "C:\Users\Shady\AppData\Roaming\Blender Foundation\Blender\3.1\scripts\addons\Blend_My_NFTs-Logic_v2_and_minor_changes\main\DNA_Generator.py", line 214, in generateNFT_DNA
DNAList = create_DNAList()
File "C:\Users\Shady\AppData\Roaming\Blender Foundation\Blender\3.1\scripts\addons\Blend_My_NFTs-Logic_v2_and_minor_changes\main\DNA_Generator.py", line 196, in create_DNAList
DNASetReturn |= {''.join([dnaPushToList()]) for _ in range(collectionSize - len(DNASetReturn))}
File "C:\Users\Shady\AppData\Roaming\Blender Foundation\Blender\3.1\scripts\addons\Blend_My_NFTs-Logic_v2_and_minor_changes\main\DNA_Generator.py", line 196, in
DNASetReturn |= {''.join([dnaPushToList()]) for _ in range(collectionSize - len(DNASetReturn))}
File "C:\Users\Shady\AppData\Roaming\Blender Foundation\Blender\3.1\scripts\addons\Blend_My_NFTs-Logic_v2_and_minor_changes\main\DNA_Generator.py", line 181, in singleCompleteDNA
singleDNA = Logic.logicafyDNAsingle(hierarchy, singleDNA, logicFile, enableRarity, enableMaterials)
File "C:\Users\Shady\AppData\Roaming\Blender Foundation\Blender\3.1\scripts\addons\Blend_My_NFTs-Logic_v2_and_minor_changes\main\Logic.py", line 244, in logicafyDNAsingle
deconstructed_DNA = apply_rules_to_dna(
File "C:\Users\Shady\AppData\Roaming\Blender Foundation\Blender\3.1\scripts\addons\Blend_My_NFTs-Logic_v2_and_minor_changes\main\Logic.py", line 24, in apply_rules_to_dna
attribute = list(hierarchy.keys())[attribute_index]
IndexError: list index out of range

location: :-1

I tried creating data using material rarity only and it worked, logic only and it worked, but both together would not work and always gave me an error.

Hope this was helpful!

Looks like this issue was just a matter of low combinations. I'm going to revamp how the number of combinations is calculated behind the scenes to take into account things like Logic, Rarity, and Materials to give the user a more accurate understanding of how those three features affect the outcome. Moving this issue here: #126