Skip to content

Commit fa25a1b

Browse files
committed
replace Model Prefab Variant with FBX Linked Prefab
1 parent 95c68e2 commit fa25a1b

File tree

2 files changed

+36
-34
lines changed

2 files changed

+36
-34
lines changed
Lines changed: 28 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -1,69 +1,69 @@
1-
# Working with Model Prefab Variants
1+
# Working with FBX Linked Prefabs
22

33
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 Importer automatically updates the imported Model Prefab.
44

55
![A Model Prefab in the Scene and Hierarchy views](images/FBXExporter_ModelPrefab.png)
66

77
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.
88

9-
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.
9+
Using FBX Linked Prefabs 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 previously required the extra **FbxPrefab** component, the new FBX Linked Prefabs 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.
1010

1111
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.
1212

1313
> ***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.
1414
15-
## Creating a Model Prefab Variant
15+
## Creating an FBX Linked Prefab
1616

17-
You can either create a Model Prefab Variant Instance [from a GameObject](#fromGameObject) or generate a Model Prefab Variant directly [from the selected .fbx or .prefab file](#fromFBXorAssetFile).
17+
You can either create an FBX Linked Prefab [from a GameObject](#fromGameObject) or generate it directly [from the selected .fbx or .prefab file](#fromFBXorAssetFile).
1818

19-
When you convert a GameObject to a Model Prefab Variant instance, the FBX Exporter exports each selected GameObject hierarchy and writes an FBX file and a Prefab Variant (`.prefab`) with the FBX as its base.
19+
When you convert a GameObject to an FBX Linked Prefab, the FBX Exporter exports each selected GameObject hierarchy and writes an FBX file and a Prefab Variant (`.prefab`) with the FBX as its base.
2020

21-
When you generate a Model Prefab Variant from a selected file, the FBX Exporter generates the Model Prefab Variant without modifying the Scene. If you selected an FBX file, a Prefab Variant Asset file is generated. If you selected a Prefab Asset file, a Prefab Variant Asset file and an FBX file are generated.
21+
When you generate an FBX Linked Prefab from a selected file, the FBX Exporter generates the FBX Linked Prefab without modifying the Scene. If you selected an FBX file, a Prefab Variant Asset file is generated. If you selected a Prefab Asset file, a Prefab Variant Asset file and an FBX file are generated.
2222

2323
<a name="fromGameObject"></a>
2424

2525
### Converting a GameObject
2626

27-
To replace the GameObject hierarchy with an instance of a Model Prefab Variant:
27+
To replace the GameObject hierarchy with an instance of an FBX Linked Prefab:
2828

29-
1. Right-click on the GameObject in the Hierarchy view and select __Convert To Model Prefab Variant Instance__ from the context menu.
29+
1. Right-click on the GameObject in the Hierarchy view and select __Convert To FBX Linked Prefab...__ from the context menu.
3030

31-
![Convert GameObject to Model Prefab Variant instance](images/FBXExporter_LinkedPrefab-GameObject.png)
31+
![Convert GameObject to FBX Linked Prefab](images/FBXExporter_LinkedPrefab-GameObject.png)
3232

33-
Alternatively, you can use the main menu: __GameObject__ > __Convert To Model Prefab Variant Instance__ with the GameObject selected.
33+
Alternatively, you can use the main menu: __GameObject__ > __Convert To FBX Linked Prefab...__ with the GameObject selected.
3434

3535
2. Specify how you want to export the GameObject using the properties on the [Convert Options](#ConvertOptions) window and click **Convert**.
3636

37-
Model Prefab Variants use the same rules as for exporting: all selected objects and their descendants are exported to a single FBX file. If you select both a parent and a descendant, the Model Prefab Variant only exports the parent’s hierarchy.
37+
FBX Linked Prefabs use the same rules as for exporting: all selected objects and their descendants are exported to a single FBX file. If you select both a parent and a descendant, the FBX Linked Prefab only exports the parent’s hierarchy.
3838

39-
> ***Note:*** If the selected object is already linked to an existing FBX file, then the hierarchy is not re-exported: instead the Model Prefab Variant links to the FBX file that already exists.
39+
> ***Note:*** If the selected object is a Model Prefab instance, then the hierarchy is not re-exported: instead the FBX Linked Prefab links to the FBX file that already exists.
4040
4141
<a name="fromFBXorAssetFile"></a>
4242

4343
### Converting an FBX file or a Prefab
4444

45-
To generate the Model Prefab Variant from the selected file without modifying the scene:
45+
To generate the FBX Linked Prefab from the selected file without modifying the scene:
4646

47-
1. Right-click on an FBX or Prefab Asset file in the Project view and select __Convert To Model Prefab Variant__ from the context menu.
47+
1. Right-click on an FBX or Prefab Asset file in the Project view and select __Convert To FBX Linked Prefab...__ from the context menu.
4848

49-
![Convert Prefab file to Model Prefab Variant](images/FBXExporter_LinkedPrefab-PrefabFile.png)
49+
![Convert Prefab file to FBX Linked Prefab](images/FBXExporter_LinkedPrefab-PrefabFile.png)
5050

51-
Alternatively, you can use the main menu: __Assets__ > __Convert To Model Prefab Variant__.
51+
Alternatively, you can use the main menu: __Assets__ > __Convert To FBX Linked Prefab...__.
5252

5353
2. Specify how you want to export the GameObject using the properties on the [Convert Options](#ConvertOptions) window and click **Convert**.
5454

55-
Depending on which type of file you selected, the FBX Exporter creates the Model Prefab Variant in one of the following ways:
55+
Depending on which type of file you selected, the FBX Exporter creates the FBX Linked Prefab in one of the following ways:
5656

57-
* If an FBX file is selected, a Model Prefab Variant file is generated with the selected FBX file as its base.
58-
* If a Prefab Asset file is selected, the Prefab is exported to an FBX file and a new Model Prefab Variant is created.
57+
* If an FBX file is selected, a Prefab Variant file is generated with the selected FBX file as its base.
58+
* If a Prefab Asset file is selected, the Prefab is exported to an FBX file and a new FBX Linked Prefab is created.
5959

6060
<a name="ConvertOptions"></a>
6161

6262
## Convert Options window
6363

64-
When converting to a Model Prefab Variant, the following window opens, displaying options for exporting:
64+
When converting to an FBX Linked Prefab, the following window opens, displaying options for exporting:
6565

66-
![Convert Options for a Model Prefab Variant](images/FBXExporter_ConvertOptionsWindow.png)
66+
![Convert Options for an FBX Linked Prefab](images/FBXExporter_ConvertOptionsWindow.png)
6767

6868

6969
### Convert Option Properties
@@ -72,14 +72,14 @@ When converting to a Model Prefab Variant, the following window opens, displayin
7272
| :------------------------ | :----------------------------------------------------------- |
7373
| __Export Name__ | Specify the name of the FBX file to export. |
7474
| __Export Path__ | Specify the location where the FBX Exporter will save the FBX file. |
75-
| __Prefab Name__ | Specify the name of the Model Prefab Variant's file. |
76-
| __Prefab Path__ | Specify the location where the FBX Exporter will save the Model Prefab Variant file. |
75+
| __Prefab Name__ | Specify the name of the FBX Linked Prefab's file. |
76+
| __Prefab Path__ | Specify the location where the FBX Exporter will save the FBX Linked Prefab file. |
7777
| __Source__ | Transfer the transform animation from this object to the __Destination__ transform.<br/><br/>**Notes:**<br/> - __Source__ must be an ancestor of __Destination__.<br/> - __Source__ may be an ancestor of the selected object. |
7878
| __Destination__ | Which object to transfer the transform animation to.<br/><br/>This object receives the transform animation on objects between __Source__ and __Destination__ as well as the animation on the __Source__ itself. |
7979
| __Export Format__ | Select the format for the FBX Exporter to use when exporting the FBX file (ASCII or binary). |
80-
| __Include__ | __Convert to Model Prefab Variant Instance__ always exports both Models and Animation in the hierarchy. |
81-
| __LOD level__ | __Convert to Model Prefab Variant Instance__ always exports All levels of detail (LOD) available in the hierarchy for LOD groups. |
82-
| __Object(s) Position__ | __Convert to Model Prefab Variant Instance__ always resets the root object's transform during export. However, the Prefab maintains the global transform for the root object. |
80+
| __Include__ | __Convert to FBX Linked Prefab...__ always exports both Models and Animation in the hierarchy. |
81+
| __LOD level__ | __Convert to FBX Linked Prefab...__ always exports All levels of detail (LOD) available in the hierarchy for LOD groups. |
82+
| __Object(s) Position__ | __Convert to FBX Linked Prefab...__ always resets the root object's transform during export. However, the Prefab maintains the global transform for the root object. |
8383
| __Animated Skinned Mesh__ | Check this option to export animation on objects with skinned meshes.<br/><br/>If unchecked, the FBX Exporter does not export animation on skinned meshes. |
8484
| __Compatible Naming__ | Check this option to control renaming the GameObject and Materials during export. <br/><br/>The FBX Exporter ensures compatible naming with Autodesk® Maya® and Autodesk® Maya LT™ to avoid unexpected name changes between Unity and Autodesk® Maya® and Autodesk® Maya LT™. During export the FBX Exporter replaces characters in Unity names as follows:<br/> - Replaces invalid characters with underscores ("\_"). Invalid characters are all non-alphanumeric characters, except for colon (":").<br/> - Adds an underscore ("\_") to names that begin with a number. - Replaces diacritics. For example, replaces "é" with “e”.<br/><br/>**Note:** If you have a Material with a space in its name, the space is replaced with an underscore ("_"). This results in a new Material being created when it is imported. For example, the Material named "Default Material" is exported as "Default_Material" and is created as a new Material when it is imported. If you want the exported Material to match an existing Material in the scene, you must manually rename the Material before exporting. |
8585
| __Don't ask me again__ | Check this option to use the same **Convert Option** properties and hide this window when converting to Linked Prefabs in the future. You can reset this option by turning on the **Show Convert UI** option under **Edit** > **Project Settings** > **Fbx Export** in Unity's top menu. |
@@ -98,10 +98,8 @@ To convert existing Linked Prefabs to Prefab Variants, follow these steps:
9898

9999
1. Fix any name discrepancies that were previously handled by the [name remapping functionality for Linked Prefabs](prefabs.md#Remapping) before converting. Prefab Variants do not handle name remapping. If you start to add game logic to components, and then the objects in the FBX get renamed, you are at risk of losing the components. This can happen because the old GameObjects are deleted and new objects with the new names are added in their place.
100100

101-
2. Delete the FbxPrefab component from the prefab.
102-
103-
3. Right-click the Linked Prefab file and select **Convert to Model Prefab Variant** from the context menu.
101+
2. Right-click the Linked Prefab file and select **Convert to FBX Linked Prefab...** from the context menu.
104102

105103
![Create a Prefab variant from the file's context menu](images/FBXExporter_CreatePrefabVariant.png)
106104

107-
> ***Note:*** This will reexport the Linked Prefab to a new FBX file, and it will no longer be connected to the original.
105+
> ***Note:*** This will reexport the Linked Prefab to a new FBX file, and it will no longer be connected to the original FBX.

com.unity.formats.fbx/Documentation~/prefabs-overview.md

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,17 @@
22

33
In version 2018.3, Unity introduced a new way of working with Prefabs: [Nested Prefabs](https://docs.unity3d.com/2018.3/Documentation/Manual/NestedPrefabs.html) allow you to create Prefabs inside other Prefabs, and [Prefab Variants](https://docs.unity3d.com/2018.3/Documentation/Manual/PrefabVariants.html) allow you to save a variation on an existing Prefab. However, this changes the way you work with the FBX Exporter, because you can no longer use *Linked Prefabs* to maintain a connection between Unity and your 3D modeling application.
44

5-
In Unity version 2018.3, when you open an FBX file in Unity, the FBX Importer creates a Model Prefab. Model Prefabs are read-only, but you can create a *Prefab Variant* of that Model Prefab. Prefab Variants are Prefabs which inherit all data from a base Prefab. Prefab Variants can create inheritance between ordinary Prefabs. For example, you can create a Variant of a button Prefab which has a different color but the same functionality.
5+
Previously, Linked Prefabs were created by adding an FbxPrefab component to a Regular Prefab in order to connect it to an FBX file.
6+
From Unity 2018.3 onwards, FBX Linked Prefabs will instead be created as Prefab Variants of the exported FBX file.
67

7-
Since Prefab Variants allow you to override its base Prefab's properties, you can use a Model Prefab Variant to add components, Materials, or change most other property values without affecting the original FBX file.
8+
When you open an FBX file in Unity, the FBX Importer creates a Model Prefab. Model Prefabs are read-only, but you can create a *Prefab Variant* of that Model Prefab.
9+
Prefab Variants are Prefabs which inherit all data from a base Prefab. Prefab Variants can create inheritance between ordinary Prefabs.
10+
For example, you can create a Variant of a button Prefab which has a different color but the same functionality.
11+
12+
Since Prefab Variants allow you to override its base Prefab's properties, you can use a Prefab Variant of a Model Prefab to add components, Materials, or change most other property values without affecting the original FBX file.
813

914
> ***Note:*** While this method allows you to override properties, you cannot change the internal hierarchy of the Variant without breaking the link to the Model Prefab.
1015
1116
This type of connection is easy to maintain.
1217

13-
* For information on Model Prefabs in general and how to create Model Prefab Variants from FBX files, see [Working with Model Prefab Variants](nested-prefabs.md). If you are upgrading from a previous version of Unity, you can also [convert any existing](nested-prefabs.md#conversion) Linked Prefabs you may have to Variant Model Prefabs.
14-
18+
* For information on Model Prefabs in general and how to create FBX Linked Prefabs from FBX files, see [Working with FBX Linked Prefabs](nested-prefabs.md). If you are upgrading from a previous version of Unity, you can also [convert any existing](nested-prefabs.md#conversion) Linked Prefabs you may have to the new FBX Linked Prefabs.

0 commit comments

Comments
 (0)