diff --git a/README.md b/README.md index a2fc350..e9a7a35 100644 --- a/README.md +++ b/README.md @@ -388,25 +388,30 @@ If you need help creating a JSON file, checkout this tutorial: [How to Create JS To learn more about JSON files and how to structure data read this article: [Working with JSON](https://developer.mozilla.org/en-US/docs/Learn/JavaScript/Objects/JSON) -Material Randomizer compatable materials must follow this naming convention: `__` - ## Material Randomizer JSON Schema If you'd like, copy and paste this template into the JSON file you created above: ``` { - "": { - "Variant Objects":["", ""], - "Material List": ["__", "__"] - }, - "Red Cone_1_0": { - "Variant Objects":["", ""], - "Material List": ["__", "__"] + "": { + "Material List": { + "": , + "": , + "": , + "": + }, + "Variant Objects": [ + "", + "", + "", + "" + ] } } ``` +TODO: Add more detail to this section regarding the new material system, for now reference this commit: https://github.com/torrinworx/Blend_My_NFTs/commit/3cb2a69c81932e5b882b69c4c4bfbdd153a2dfee # Custom Metadata Fields @@ -466,103 +471,68 @@ If you'd like, copy and paste this template into the JSON file you created above ``` { "Rule-1":{ - "Items-1": [ - "" + "IF": [ + "" ], - "Rule-Type": "", - "Items-2":[ - "" - ] - }, - "Rule-2":{ - "Items-1": [ - "" - ], - "Rule-Type": "", - "Items-2":[ - "" + "THEN":[ + "", "" ] } + "Rule-2":{ + "IF": [ + "" + ], + "NOT":[ + "", "" + ] + } } ``` ### Schema Definition - ``Rule-#`` A dictionary representing the information of a single defined Rule of an NFT collection. There can be as many as you choose. Increment the ``#`` when you create a new rule. -- ``Items-1`` A list of strings representing the names of Attribute(s) or Variant(s). -- ``Rule-Type`` The rule that governs the relation between ``Items-1`` and ``Items-2``. Has two possible values: ``Never with`` and ``Only with``. -- ``Items-2`` A list of strings representing the names of Attribute(s) or Variant(s). +- ``IF`` A single String in a list representing the Variant the rule is based off of. +- ``THEN`` A list of Attributes or Variants that always appear IF the ``IF`` Variant is selected. +- ``NOT`` A list of Attributes or Variants that never appear IF the ``IF`` Variant is selected. + +* Note: ``NOT`` is not currently stable, it's recommended to only use a Single variant per NOT rule to see consistant results. + ## Example Logic.json File Say we have the following scene in a .blend file: Screen Shot 2022-03-13 at 4 21 52 PM Note that we have two Attributes, ``Cube`` and ``Sphere``, and that they have 4 Variants. If you'd like to follow along with this example I'd recommend downloading the [Logic_Example.blend](https://github.com/torrinworx/BMNFTs_Examples/blob/main/Logic_Example.blend). -### Never With, Logic Rule Examples -- **Never With, Variants example:** - In this example, the Variant ``Red Cube_1_25`` never appears with ``Red Sphere_1_25``: +### Logic Examples +- **IF/THEN Rule setup** + In this example, the Variant ``Red Cube_1_25`` will always appear with ``Red Sphere_1_25``: ``` { "Rule-1":{ - "Items-1": [ + "IF": [ "Red Cube_1_25" ], - "Rule-Type": "Never With", - "Items-2":[ + "THEN":[ "Red Sphere_1_25" ] } } ``` - - -- **Never With, Attributes example:** - In this example, the Attribute ``Cube`` never appears with ``Red Sphere_1_25``. When ``Red Sphere_1_25`` is selected, no Variants in the Cube Attribute are selected, and hence the Attribute is set to "Empty": +- **IF/NOT Rule setup** + In this example, the Variant ``Red Cube_1_25`` will never appear with ``Red Sphere_1_25``: ``` { "Rule-1":{ - "Items-1": [ - "Cube" - ], - "Rule-Type": "Never With", - "Items-2":[ - "Red Sphere_1_25" - ] - } - } - ``` - -### Only With, Logic Rule Examples -- **Only With, Variants example:** - In this example, the Variant ``Red Cube_1_25`` only appears with ``Red Sphere_1_25``: - ``` - { - "Rule-1":{ - "Items-1": [ + "IF": [ "Red Cube_1_25" ], - "Rule-Type": "Only With", - "Items-2":[ + "NOT":[ "Red Sphere_1_25" ] } } ``` -- **Only With, Attributes example:** - In this example, the Attribute ``Cube`` only appears with ``Red Sphere_1_25``: - ``` - { - "Rule-1":{ - "Items-1": [ - "Cube" - ], - "Rule-Type": "Never With", - "Items-2":[ - "Red Sphere_1_25" - ] - } - } - ``` Now that you have a completed Logic.json file, you can now go back and complete [Step 1. Create Data](#step-1---create-nft-data)!