|
1 |
| -<a name="NestedPrefab"></a> |
2 |
| -# Converting to Nested Prefabs |
3 |
| -## Applies To: Unity 2018.3 |
| 1 | +# Working with Model Prefab Variants |
4 | 2 |
|
5 |
| -As of 2018.3 Linked Prefabs will be replaced with the new [Nested Prefab workflow](https://unity3d.com/prefabs). |
6 |
| -More specifically, [Prefab Variants](https://docs.unity3d.com/2018.3/Documentation/Manual/PrefabVariants.html) can be used to achieve almost the same functionality as Linked Prefabs. |
7 |
| -Variant Prefabs cover the same updates as Linked Prefabs, as well as increased control over model updates. |
8 |
| -For example, consider an FBX with a Point Light of size 10. If the size of the Point Light is set to 1 in the Prefab Variant, |
9 |
| - and the Point Light color is modified in the FBX, the prefab variant will update the color of the Point Light but not the size. |
10 |
| -If it were a Linked Prefab, both the size and color would be overwritten to what is in the FBX. |
| 3 | +> ***Note:*** Prefab Variants are only available in Unity version 2018.3. If you are using Unity version 2018.2, use [Linked Prefabs](prefabs.md) instead. |
11 | 4 |
|
12 |
| -Additionally, Prefab Variants provide a more natural, built-in way to create a prefab which receives updates from the FBX model. |
13 |
| -They can be created and look like any other prefab without requiring an additional FbxPrefab component. |
14 |
| -They also extend the flexibility of the prefab in allowing you to create variants of variants that will still update with the model prefab. |
| 5 | +When a user imports a Model from a 3D modeling application such as Autodesk® Maya®, it is represented in Unity as a *Model Prefab*. You can't edit Model Prefabs in Unity, apart from [changing the import settings](https://docs.unity3d.com/2018.3/Documentation/Manual/class-FBXImporter.html). If someone saves changes to that Model file in an external application, the FBX Exporter automatically updates the imported Model Prefab. |
15 | 6 |
|
16 |
| -In order to convert existing Linked Prefabs or new FBX files to Nested Prefabs, follow these steps: |
| 7 | + |
17 | 8 |
|
18 |
| -1. Right click the fbx file and select “Prefab Variant” to create a variant prefab that links to the FBX |
| 9 | +You can add components to a Model Prefab in the Scene, such as a collider. However, you cannot apply any change back to the Asset without breaking the link. In this way, a Model Prefab is a *read-only* Prefab, because it is non-editable except for overrides in the Scene. |
19 | 10 |
|
20 |
| - |
| 11 | +Using Model Prefab Variants is the best way to ensure that your Models continue to reflect any changes you make to your FBX files in external applications while still taking full advantage of the Prefab system. For example, while Linked Prefabs required the extra **FbxPrefab** component, Model Prefab Variants use only the Unity Prefab features. And you can create Variants of your Variants which all receive updates from the Model Prefab but provide a lot of flexibility. |
21 | 12 |
|
22 |
| -**Notes:** |
| 13 | +In addition, Variants give you some additional control over receiving updates from external applications. For example, if you have a Model with a Spot Light of size 10 and you override the size to 1 in your Variant, when the size and color change in the FBX file, the color will change but the size will remain 1. |
23 | 14 |
|
24 |
| -* If converting an existing Linked Prefab, then the components from the Linked Prefab will need to be manually copied to the variant. |
25 |
| -* With Variant Prefabs, the name remapping functionality will be lost, so make sure to fix any name discrepancies before converting. |
| 15 | +> ***Important:*** Because the Prefab Variant inherits data from the base Model Prefab, you cannot make structural changes to the Prefab Variant. This means that you cannot delete inherited child objects or re-arrange the order of inherited child objects on the Prefab Variant. |
| 16 | +
|
| 17 | +## Creating a Model Prefab Variant |
| 18 | + |
| 19 | + by and choosing “Prefab Variant”. |
| 20 | + |
| 21 | +You can create a unidirectional link between your external 3D modeling application and your Unity Scene by setting up a Model Prefab Variant to inherit all changes from the Model Prefab. This means that updates to the FBX Model file will flow through to the Prefab. |
| 22 | + |
| 23 | +To create Prefab Variant from a Model Prefab: |
| 24 | + |
| 25 | +1. If you haven't already created a Prefab Model from the FBX Model file, drag the FBX file from the Project view into the Scene Hierarchy. |
| 26 | + |
| 27 | + A Model Prefab  appears in the Hierarchy view. |
| 28 | + |
| 29 | +2. Drag the Prefab Model from the Scene Hierarchy to the Project view. |
| 30 | + |
| 31 | + A dialog box prompts you to choose how you want to create the Prefab. |
| 32 | + |
| 33 | +  |
| 34 | + |
| 35 | +3. Click the **Prefab Variant** button. |
| 36 | + |
| 37 | + The Model Prefab now appears as a Prefab Variant  in both the Scene and Hierarchy views. |
| 38 | + |
| 39 | +<a name="conversion"></a> |
| 40 | + |
| 41 | +## Converting from Linked Prefabs to Prefab Variants |
| 42 | + |
| 43 | +To convert existing Linked Prefabs to Prefab Variants, follow these steps: |
| 44 | + |
| 45 | +1. Fix any name discrepancies that were previously handled by the [name remapping functionality for Linked Prefabs](prefabs.md#Remapping) before converting. |
| 46 | + |
| 47 | +2. Right-click the FBX file and select **Prefab Variant** from the context menu. |
| 48 | + |
| 49 | +  |
| 50 | + |
| 51 | +3. Copy any components from the old Linked Prefab onto the new Prefab Variant. |
0 commit comments