1// Copyright (C) 2019 The Qt Company Ltd.
2// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GFDL-1.3-no-invariants-only
6\title Exporting from Blender
7\page quick3d-asset-conditioning-export-blender
9It is possible to export meshes, lights, cameras, transform animations (scale/rotation/location),
10UV layouts, pivot points, object hierarchy, and material slots from Blender.
12\section1 Exporting Models
14\section2 Create Material Slots
16Material slots must be created and assigned in Blender before exporting. If this is not done,
17one default material slot is used for the object.
19\note Only material slots that have a material, and that are assigned to a mesh on the exported
20object, will be imported.
22To create material slots, follow the steps below.
25 \li In the properties panel, select the \uicontrol material tab.
26 \li Press the \uicontrol + to add a new material slot.
27 \li Press the \uicontrol{New} button.
28 \image export-blender1.png
29 \li Repeat steps 2 to 4 for each material slot to create.
32By default, the first material slot will be assigned to the object.
34To assign a different material slot to the object, or to assign several material slots to the
35same object, follow the steps below.
38 \li In edit mode, select the desired faces.
39 (\e{Shift + Right Mouse Click} to multi select, \e{A} to select all faces).
40 \li In the properties panel, select the material tab.
41 \li In the material slots list, select the desired material slot.
42 \li Press the \uicontrol{Assign} button to assign the selected material slot to selected faces.
43 \image export-blender3.png
46\section2 UV Unwrap Models
48UV unwrapping your model will create a UV layout. Without a UV layout you will not be able to
49render any textures on your model in Qt Quick 3D.
51There are many different ways and techniques to unwrap 3D meshes. The most basic way to do it in
52Blender is described below.
55 \li In edit mode, press \e A to select the whole mesh.
56 \li Press the \e U key and select \uicontrol{Unwrap} from the context menu.
57 \image export-blender2.png
63 \li In object mode, select the object.
64 \li In the properties panel, select the modifiers tab.
65 \li In the drop down list, select \uicontrol{Triangulate}.
66 \image export-blender4.png
67 \li Press \uicontrol{Apply}.
70\note When exporting as COLLADA, it is possible to do the triangulation in the actual export step.
72\section2 Bake Actions for Animations
74\note This step is necessary only if you are exporting animations that are using custom curves
75or object constraints to control the animation.
77Actions are data-blocks containing animation data. If you are exporting animations you need to
81 \li Press the \e{space bar} key.
82 \li Type \e{bake actions}.
83 \li Press the \e Enter key.
86\section2 Apply Location, Rotation, and Scale
88\note This should not be done when exporting animations.
90Applying transform values resets the object's location, rotation, and scale values. Location and
91rotation values are changed to 0 while scale values are changed to 1. The object itself does not
95 \li In object mode, select the object.
96 \li Press the \e{Ctrl + A} keys.
97 \li Select \uicontrol {Location}.
98 \li From the check box in the panel, check also \uicontrol Rotation and \uicontrol {Scale}.
99 \image export-blender5.png
102\note Applying Location will also reset the object's origin (pivot point).
104\section1 Exporting Lights
106You can export lights of any type from Blender to use in Qt Quick 3D.
108The following properties are imported:
110 \li Position, rotation, scale
116Light type is imported (and converted if needed).
121 Light type in Blender
123 Will import to Qt Quick 3D as...
151\section1 Exporting Cameras
153You can export perspective and orthographic cameras from Blender to use in Qt Quick 3D.
155The following properties are imported:
157 \li Position, rotation, scale
158 \li Clipping start/end
159 \li Focal Length (perspective camera only).
162\section1 Exporting COLLADA from Blender
165 \li From the file menu, select \uicontrol {File > Export > Collada (.dae)}.
166 \li Ensure that \uicontrol Triangulation is checked on, unless you already have
167 triangulated all meshes.
168 \li Select the \uicontrol {Export COLLADA} button.
171\section1 Exporting FBX from Blender
173In order to export as FBX, you must have the FBX export add-on installed and enabled
174in Blender. With the default installation of Blender, the \c {Import-Export: FBX format} should be
175installed. If you do not have the option to export as FBX avaialble, ensure that the add-on is
176enabled by following the steps:
180 Select \uicontrol {File > User Preferences}.
182 Select \uicontrol{Add-ons} from the top menu bar.
186 The add-on should now be visible, enable it by selecting the checkbox next to its name.
189\image export-blender-enable-fbx-addon.png
191Next, to export as FBX, follow these steps:
194 \li Select \uicontrol {File > Export > FBX (.fbx)}.
195 \li Under the \uicontrol Main tab, set \uicontrol Forward to \c{Y Forward} and \uicontrol Up
197 \image export-blender-fbx-axis.png
198 \li For animations, ensure that the \uicontrol{Baked Animation} option is checked in the
199 \uicontrol Animation tab.
200 \image export-blender6.png
201 \li Select the \uicontrol {Export FBX} button.