A text variable can be used to set the material.
For that purpose you should use existing or create a new text variable using Variable Editor command.
In the expression field you need to enter or copy from the library the name of the material that will be used for the model.
In order to generate a list of several materials, select the Materials option in the List field.
In the window "Value List for Variable" you need to specify all materials that can be used for this model.
It is important that the names of materials must match similar names in the library.
After creating a variable, you need to go to the model parameters, and enter the name of the created variable in the Material field. In this way, you can define both the body material and the coating material.
After completing these steps, you can change the material of one or more bodies with the drop-down list in the variables window.
To display the new material in the scene, you need to update the 3D model using the Apply button.
In addition, it is possible to explicitly indicate the library in which the material is located when it is set through variables or by entering into the appropriate text fields of the operation parameters dialog. The syntax is the same as for specifying libraries in file links: "<library> material".
If a material is defined via a variable, then, upon applying a material using the drag&drop method or via the contextual menu, the system will ask if you want to change a value of the variable:
Positive answer leads to changing value of the variable. If the variable has a list of values, then the new value will also be added to the list.
Negative answer leads to destroying the link between the body's material and the variable.