Set up Variants
Variants are custom variations of your Prefab Asset that you can display to consumers when they make different selections in your application. For example, if you have a Prefab Asset for a car, you can create Variants for different customizations of the car. Forma natively supports two types of Variants that you can use to determine how the configurator displays your product when users select different customizations in your application:
Material Variants let you assign different materials to specific items of your product in Forma. Each Material Variant in the same Material Variant Set represents a different material that the user can select.
Visibility Variants: let you display or hide specific items of your product in the Forma. Each Visibility Variant in a Visibility Variant Set represents a different selection of visible items.
To specify the initial state of your product when a user opens your application, you can define a Default Configuration before you export it. For each Variant Set, you can select a single Variant for the configurator to display by default.
Variant workflows
- Set up Material Variants
- Set up Visibility Variants
- Verify that Variants function correctly
- Change the internal name of a Variant
- Change the display name of a Variant
- Set up the default product configuration
Set up Material Variants
Before you can add a Material Variant, you must add a Material Variant Set. By default, the system adds a Material Variant to each new set that you can configure.
Adding Material Variants involves these steps:
Adding a new Material Variant Set to contain the new Variant
Associating the new Material Variant to the elements of your product that will share the material
Assigning a specific material to the Variant
Adding other Material Variants to the set as needed
Add a new Material Variant Set
In the Configurator window, select Product tab.
To add the Material Variant Set that will contain the new Material Variant, select Add > Material Variant Set.
The system creates the new Set and gives it a unique name that you can change.
Associate the new Material Variant with parts of your product
In the Product window, find the new Material Variant Set and select it. By default, the set has been created with one Material Variant.
To add another Variant to the set, right click on the selected set and then select Add Variant.
Select a Variant under the Material Variant Set.
In the Product Outline window (on the right), select a product part that you want the variant to control.
In the Materials list for the part, right-click on the material you want to associate with the new Variant (in the Materials list) and select Set as assignment of selected Variant.
All the mesh renderers that share the material should now appear in the list of Assignments for the new Material Variant.
The material for each element will be determined by the material you associate with the new Variant.
Now, you must select a material for the Variant.
Assign a material to the Material Variant
To assign a material to the new Variant, in the Configurator tab, click on the material object field, and select the material you want from the list.
Please note that materials embedded in an FBX model can't be used in Material Variants because Forma will not be able to resolve their paths. In order to use the materials embedded in an FBX, they must first be extracted into standalone material assets. With this step done, the extracted materials can be used in Material Variants like any other material that is created directly in Unity.
Add another Material Variant in the set
When you add a second Variant, it inherits settings from the Assignments you defined for the first Variant in the set.
To add another Variant to the set, follow these steps:
Select Add > Material Variant.
Select the new Variant.
Use the Material object field to find a material for the new Variant (different from the material it inherited from the first Variant).
Add subsequent Variants as needed.
Set up Visibility Variants
Before you can add a Visibility Variant, you must add a Visibility Variant Set. By default, the system adds a Visibility Variant that you can configure to each new set when you create it.
Setting up Visibility Variants involves these steps:
Add a new Visibility Variant Set to contain the new Variant.
Associate the new Variant with the parts of your product you will use the Variant to display or hide.
Add other Visibility Variants as needed.
Add a new Visibility Variant Set
In the Configurator tab (left pane), select Product Setup.
Select Add > Visibility Variant Set.
When you create a new set, the system automatically adds a first Variant to it for you to configure.
Associate the new Variant with the parts of your product you will use it to display or hide
Select the new Variant Set.
Select the new Variant within the Set.
In the Product Outline tab (on the right), select the parts of your product that you want to associate with this Variant.
Right-click on your selection and select Apply to Variant Table.
- Select Modify this Variant on the dialog box that appears.
All selected elements of your product appear in the Assignments list for the Variant. Now you can use the Variant to determine when the elements are visible in the application.
Add more Visibility Variants to the Set
When you add a subsequent Visibility Variant to a set, it automatically excludes product elements that you assigned to the first Visibility Variant.
Assignments connect elements of your product with the Variant that determines when they're visible or invisible to the consumer.
If you need a Variant that will hide all the elements of your product, you can add a Visibility Variant with no Assignments.
To add another Variants to the set, follow these steps:
- Select the Visibility Variant Set or one of its Variants.
- Select Add > Visibility Variant.
- Select the new Variant. Note: By default, the second Visibility Variant you create excludes the elements of your product that are assigned to the first Visibility Variant you created.
- Modify or add Assignments to associate the new Variant with the group of elements that you will use to determine visibility for.
Note: You can apply multiple Visibility Variants to the same product element.
- Add more Variants as needed.
Validate the Variants
It can be helpful to verify that the Variants you add display and hide the correct elements or material in the configurator.
To see how a specific Variant affects your product in preview, follow these steps:
Find the Variant you want to test in the list.
Double click the Variant. The preview (eye) icon will move to this Variant and its assignments will be applied to the product.
The system displays a preview that you can use to make sure the correct elements or materials are visible. For best results, ensure there is at least one light in the scene.
Change the internal name of a Variant
To make it easier to find different variants while you set up the configurator, you can give any Variant or Set an internal name.
To edit the internal name of a Variant, follow these steps:
Find the Variant you want to rename.
At the top of the properties for the Variant, select the entry for Code and enter a new one.
The value for Code doesn't appear editable in the Configurator interface, but clicking on it will allow you to edit the text.
Change the display name of a Variant
You can control the information that consumers see about a Variant when they use your configurator.
In the properties for any Variant or Variant Set, you can add a Display Name, Description, and Thumbnail to display to consumers.
Variant visibility in the configurator
You can customize which Variants and Sets consumers can see. In the properties for any Variant, you can set the Variant to one of these states:
- Active - The Variant is displayed in the configurator and consumers can select it.
- Disabled - The Variant is displayed in the configurator but consumers can't select it.
- Hidden - The Variant isn't displayed in the configurator.
Set up the default product configuration
You can set a default configuration that determines how the product is displayed to consumers when they open the configurator.
To set up the default configuration of your product, you must identify a default Variant in each Variant set.
Forma uses a blue checkmark to specify which Variant is set as the default in a Variant Set.
To change the default selection, right-click on the correct Variant and select Set as Default.