Previously the addon would never choose the last material in a material list, and would not change the material if the first in the list was chosen randomly.
This was caused by a missing "+1" because the original author chose 0 as an error when returned. Without the +1 the script could return 0 randomly when choosing a random element from the list
- Reformatted exceptions to work with new logging system
- Reformatted all print statements
- Moved `activate_debug()` to helpers.py
- Debug mode now shuts down all renders and 3D model exports to perform a 'Dry Run' to check that collections/objects/DNA still exist and work on render time.
- More general pep8 formatting
- Renamed some more variables for pep8
- Modified import comments
- Renamed functions
- Added bpy.path.abspath() to material, logic, and debug save paths
- Beginning to reformat files with new logging/console output system
- Deprecated Rarity.py, moved to Helpers to avoid circular import issues
- Moved get_hierarchy() function from DNA_Generator.py to Helpers to avoid circular import issues
- Reformatted some comments and example code
Resolved conflicts with failed batches recovery related to headless variable integration from previous merge.
Fixed issue where animations would get corrupt when resuming failed batch. The last file to be generated will now be deleted if it exists to avoid this issue.
- Email is now only activated if the user specifies
- Implemented "NOT" rule in Logic.py
- Added documentation for Synced Attribute Material values in Material_Generator.py
- Added AutoSave before generation functionality to Other panel
- Removed strip_empty_exclude function
- Modified Exporter to work with new Material Randomizer layout
- Added Enable Materials option in logicafyDNAsingle function in preparation for Material Randomizer Logic
- Materials are no longer formatted like Variants, the Material List is now a dictionary where the keys are the names of the Materials and the values are the Rarity percentages. Each Variant in the Materials.json file can have a different list with different rarity values that are selected for only that variant.
Material file format:
```
{
"Variant Name": {
"Material List": {
"Material Name 1": 90,
"Material Name 2": 5,
"Material Name 3": 1,
"Material Name 4": 4
},
"Variant Objects": []
}
}
```
Lots more info in the comments of the code.
Documentation still needs to be made, also more testing lol
This is the new format for Logic.json files:
```
{
"Rule-1":{
"IF": [
"Variant collection name"
],
"THEN":[
"Attribute collection name", "Variant collection name"
]
}
}
```
Some basic guidelines, needs to be more thorough and cleaned up for documentation:
Attributes and Variants can be used in the “THEN” list, Variants can only be used in the “IF” list.
If a full attribute is detected in the “THEN” list (either by the attribute collection name or all variant collection names in that attribute) and a variant is not detected in the “IF” list, the attribute detected in the “THEN” list will be set to “EMPTY”.
Variants in the “IF” list may be from the same or separate attributes, however they must never be from the same attribute as variants in the “THEN” list.
I need sleep.
Note to self: The Logic UI List needs to be updated to reflect these changes to Logics core functionality, the current UI List is broken on this branch and wont work.
Also added save_result to Constants.py for basic logging functionality.
- Changed labeling in __init__.py to reflect new workflow
- Updated Checks.py to stop throwing weird error and to now catch Script_Ignore collection error
- Added error message if you change collection name after data is created and you generate your nfts
- Added more info in comments and relocated Change Text Object in Scene
- Metadata no longer contains order number and rarity number