How can I implement multiple material colours across multiple .JSON files

Viewed 50

I have a MASTER.JSON file that is my main part, I then have multiple parts that DOCK into the MASTER part, each of these parts is called as a SUBCOMPONENT and is in it's own .JSON file, for example have a SUB_CUBBY.JSON, SUB_SHELF.JSON etc. The subcomponents have Material Colours set with in their JSON files, which works fine but we periodically need to add additional colours, which at the moment means opening each subcomponent file and updating the Material / Colour and resaving. Is there a way to have a Global File that contains the Material / Colours that can be CALLED from within each of the subcomponent files, so I would only need to update the 1 file and it would add the colours to all the files??

1 Answers

There are two ways:

  1. Store the material parameter in another component, called for example material_carrier, supersede the parameter wherever you need it.
  2. Load materials not via validValues, but validGroups or conditionalGroups. This will allow you to add or remove parameter by tagging the materials with the respective tags. See very end of this page https://docs.roomle.com/scripting/resources/200_140_getmaterialproperty.html

Note: I recommend NOT referring to "docked parts" as subcomponents.

Related