Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
Loading...
Searching...
No Matches
qtquick3d-export-blender.qdoc
Go to the documentation of this file.
1// Copyright (C) 2019 The Qt Company Ltd.
2// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GFDL-1.3-no-invariants-only
3
4/*!
5
6\title Exporting from Blender
7\page quick3d-asset-conditioning-export-blender
8
9It is possible to export meshes, lights, cameras, transform animations (scale/rotation/location),
10UV layouts, pivot points, object hierarchy, and material slots from Blender.
11
12\section1 Exporting Models
13
14\section2 Create Material Slots
15
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.
18
19\note Only material slots that have a material, and that are assigned to a mesh on the exported
20object, will be imported.
21
22To create material slots, follow the steps below.
23
24\list 1
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 {Blender material properties panel with New button highlighted}
30 \li Repeat steps 2 to 4 for each material slot to create.
31\endlist
32
33By default, the first material slot will be assigned to the object.
34
35To assign a different material slot to the object, or to assign several material slots to the
36same object, follow the steps below.
37
38\list 1
39 \li In edit mode, select the desired faces.
40 (\e{Shift + Right Mouse Click} to multi select, \e{A} to select all faces).
41 \li In the properties panel, select the material tab.
42 \li In the material slots list, select the desired material slot.
43 \li Press the \uicontrol{Assign} button to assign the selected material slot to selected faces.
44 \image export-blender3.png
45 {Blender viewport showing green cube with material properties panel}
46\endlist
47
48\section2 UV Unwrap Models
49
50UV unwrapping your model will create a UV layout. Without a UV layout you will not be able to
51render any textures on your model in Qt Quick 3D.
52
53There are many different ways and techniques to unwrap 3D meshes. The most basic way to do it in
54Blender is described below.
55
56\list 1
57 \li In edit mode, press \e A to select the whole mesh.
58 \li Press the \e U key and select \uicontrol{Unwrap} from the context menu.
59 \image export-blender2.png
60 {Blender UV Mapping menu with Unwrap option selected}
61\endlist
62
63\section2 Triangulate
64
65\list 1
66 \li In object mode, select the object.
67 \li In the properties panel, select the modifiers tab.
68 \li In the drop down list, select \uicontrol{Triangulate}.
69 \image export-blender4.png
70 {Blender Add Modifier menu with Triangulate option highlighted}
71 \li Press \uicontrol{Apply}.
72\endlist
73
74\note When exporting as COLLADA, it is possible to do the triangulation in the actual export step.
75
76\section2 Bake Actions for Animations
77
78\note This step is necessary only if you are exporting animations that are using custom curves
79or object constraints to control the animation.
80
81Actions are data-blocks containing animation data. If you are exporting animations you need to
82bake actions.
83
84\list 1
85 \li Press the \e{space bar} key.
86 \li Type \e{bake actions}.
87 \li Press the \e Enter key.
88\endlist
89
90\section2 Apply Location, Rotation, and Scale
91
92\note This should not be done when exporting animations.
93
94Applying transform values resets the object's location, rotation, and scale values. Location and
95rotation values are changed to 0 while scale values are changed to 1. The object itself does not
96visually change.
97
98\list 1
99 \li In object mode, select the object.
100 \li Press the \e{Ctrl + A} keys.
101 \li Select \uicontrol {Location}.
102 \li From the check box in the panel, check also \uicontrol Rotation and \uicontrol {Scale}.
103 \image export-blender5.png {Blender Apply menu showing Location option}
104\endlist
105
106\note Applying Location will also reset the object's origin (pivot point).
107
108\section1 Exporting Lights
109
110You can export lights of any type from Blender to use in Qt Quick 3D.
111
112The following properties are imported:
113\list
114 \li Position, rotation, scale
115 \li Brightness
116 \li Light color
117 \li Cast shadows
118\endlist
119
120Light type is imported (and converted if needed).
121
122\table
123 \header
124 \li
125 Light type in Blender
126 \li
127 Will import to Qt Quick 3D as...
128 \row
129 \li
130 Point
131 \li
132 Point
133 \row
134 \li
135 Area
136 \li
137 Area
138 \row
139 \li
140 Sun
141 \li
142 Directional
143 \row
144 \li
145 Spot
146 \li
147 Directional
148 \row
149 \li
150 Hemi
151 \li
152 Directional
153\endtable
154
155\section1 Exporting Cameras
156
157You can export perspective and orthographic cameras from Blender to use in Qt Quick 3D.
158
159The following properties are imported:
160\list
161 \li Position, rotation, scale
162 \li Clipping start/end
163 \li Focal Length (perspective camera only).
164\endlist
165
166\section1 Exporting COLLADA from Blender
167
168\list 1
169 \li From the file menu, select \uicontrol {File > Export > Collada (.dae)}.
170 \li Ensure that \uicontrol Triangulation is checked on, unless you already have
171 triangulated all meshes.
172 \li Select the \uicontrol {Export COLLADA} button.
173\endlist
174
175\section1 Exporting FBX from Blender
176
177In order to export as FBX, you must have the FBX export add-on installed and enabled
178in Blender. With the default installation of Blender, the \c {Import-Export: FBX format} should be
179installed. If you do not have the option to export as FBX avaialble, ensure that the add-on is
180enabled by following the steps:
181
182\list 1
183 \li
184 Select \uicontrol {File > User Preferences}.
185 \li
186 Select \uicontrol{Add-ons} from the top menu bar.
187 \li
188 Search for \e{fbx}.
189 \li
190 The add-on should now be visible, enable it by selecting the checkbox next to its name.
191\endlist
192
193\image export-blender-enable-fbx-addon.png
194 {Blender User Preferences showing FBX format addon enabled}
195
196Next, to export as FBX, follow these steps:
197
198\list 1
199 \li Select \uicontrol {File > Export > FBX (.fbx)}.
200 \li Under the \uicontrol Main tab, set \uicontrol Forward to \c{Y Forward} and \uicontrol Up
201 to \c{Z Up}.
202 \image export-blender-fbx-axis.png
203 {Blender FBX export axis settings showing Y Forward and Z Up}
204 \li For animations, ensure that the \uicontrol{Baked Animation} option is checked in the
205 \uicontrol Animation tab.
206 \image export-blender6.png
207 {Blender FBX export settings with Baked Animation option checked}
208 \li Select the \uicontrol {Export FBX} button.
209\endlist
210
211*/