๐ฅ๏ธBlender
Blender is a free and open-source 3D modeling, animation, and texturing app.
Last updated
Blender is a free and open-source 3D modeling, animation, and texturing app.
Last updated
Blender has the best GLTF exporter in the business. Exporting from an app to Blender may be helpful for applying animations, baking or resizing textures, rescaling, and more.
You can read all about GLTF in Blender here. It covers different material types, transparency, UVs, PBR and more.
Choose File > Export > GLTF 2.0 (.glb/.gltf) to open the export options window. You can save as a .glb file, a .gltf file, or an embedded .glTF file. Generally, exporting as a .glb is always the best option. This is the binary version of the GLTF and will produce the smallest fall size while keeping all of your data bundled into one file.
Choose File > Export > GLTF 2.0 (.glb/.gltf) to open the export options window. You can save as a .glb file, a .gltf file, or an embedded .glTF file.
A .glb is preferred as it is smaller and standalone.
The first set of Include options allow you to control what parts of your scene will be exported based on what is selected, what is visible, what is renderable, or what is in the active collection. You can also use combinations of options to drill down further. For example, you could choose to export only visible, selected objects in the active collection and ignore anything that does not meet those requirements.
The second set of Include options enable export of scene custom properties, cameras, or punctual lights. These options will add some scene-level elements to the export outside the standard mesh, materials, and textures. Some of these options will require extensions to the GLTF 2.0 core specification, but if the option is checked the exported .gltf file will include any needed references.
The options for transform are the simplest to understand. The GLTF specification defines +Y as up in the scene coordinate system. Blenderโs coordinate system defines +Z as up, which would result in your asset being in an incorrect orientation when rendered. Checking this option will automatically convert the Blender coordinate system to match the GLTF coordinate system and keep your asset in the same orientation as it was authored.
The Geometry options in Blender give you some control over what is written into the .glTF file. You may want to enable or disable these options to control the size of the glTF file or to pass specific data from Blender to the renderer to control the asset's render at runtime. A good example of this is tangent data. There are times when you may want to include tangent data for specific shaders or if your tangents are authored in a particular way. If this data is present in the file the renderer won't calculate it at runtime. On the other hand, if you donโt mind the renderer calculating the tangent data at runtime, excluding tangent data from the export will make the resulting .glTF file smaller.
Apply Modifiers does exactly what it implies in that it bakes all modifiers into mesh object. Note, however, that it also prevents the exporting of shape keys. So if you want to use shape keys in your asset, you should leave this unchecked and manually apply any modifiers you use as any unapplied modifiers will not export.
Enable any of these options to include that data type into the glTF export.
Loose edges and loose points will export as lines and points respectively, based on the definition for lines and points as meshes in the glTF specification.
Materials
Materials can be exported as you normally would or not at all. There is also a third option for exporting materials as a placeholder. This means that the materials themselves will not be exported - and thus no textures are exported either - but that there is material slot information written into the .glTF file with no material definition.
Images can be exported either automatically, matching image format - .png or .jpg - of the original file. You can also override the orignal image format to save all images without an alpha channel as .jpg files. Usually, a .jpg file will be smaller than a .png file due to the compression used. However, the .jpg compression will cause problems if you are using a channel-packed image - for example an image with AO in the R channel, Roughness in the G channel, and Metallic in the B channel. The lossy compression of JPEG will quantize pixel values across all three channels which will result in pixel values from your individual packed textures being changed based on the pixel values of the other channels. In the case of channel-packed textures, you will want to make sure export .png files since that compression scheme isnโt lossy and does not compress data across channels.
Apply Draco Compression to your model. This is unnecessary as Foveate will already losslessy compress your model.
The Animation options allow you to enable or disable entire sections of the animation data. Expanding each of those sections will give you more fine control over individual options that pertain to each type of animation data.
Use current frame allows you to specify the default frame you want your asset to be exported in. This is helpful if you want your asset in a particular pose when it is loaded. Otherwise, the file will be exported in the rest pose of the rig.
Limit to Playback Range will clip exported animations only to the selected playback range. This can be useful if you want to split your animation timeline between several files to load as needed.
Sampling Rate is an optimization trade-off for export. The value for Sampling Rate represents how often the animation curve is sampled and baked. Using a sampling rate of 1 will sample the curve and write a keyframe on every frame of the animation where a rate of 3 will sample the curve and write a keyframe every three frames. If you use a sampling rate other than 1, the animation curve will be sampled that that interval regardless of where the keyframes were authored on the animation curve. This means that your animation will change slightly if the curve is sampled less often than you've placed keyframes. The larger the value set for sampling rate, the more your animation will change as your keyframes are averaged by the new sampling rate. This does save on file size, but at the cost of accuracy in your animation curves. Conversely, a low sampling rate produces a more precise export of your animation curve at the cost of a larger file size.
The Always Sample Animation parameter works in concert with the sampling rate. Enabling this option will write additional animation curve data into your export. In the case of a bone in an armature, if you set keys on rotation, but nothing on translation or scale normally the export will only include the rotation data. Enabling Always Sample Animation will write keyframe data on that boneโs translation and scale parameters even though none was autored on the bone. Enabling this parameter on a complex armature can potentially have a large impact on file size due to the amount of extra data exported that was not originally keyed. Best practice here is to try your export without this parameter checked and only use it if the resulting animation does not look right. If your animation does not need the extra animation data, there is no reason to export it.
Group By NLA Track is used to separate nonlinear animation tracks into their own animation clips. This can be useful if you author individual animations using the nonlinear animation graph rather than authoring your animations sequentially in the timeline. Working this way can help with organization by labeling your individual animations. You can simply enable Group by NLA Track at export time to write each track into its own clip. If you need to blend the tracks in your nonlinear animations together to get your desired motion, disabling the Group by NLA Track will write the animation data based solely on the timeline and not individual tracks.
Enabling the Shape Keys parameter is required if you have any shape key animation in your scene. If this parameter is disabled, no shape key animation will be exported into your file. If the parameter is enabled, you also have the choice of exporting Shape Key Normals and Shape Key Tangents. Including the normals and tangents of your shape keys will increase the exported file size, so only include them if you need to. For the most part, you can probably forego the Shape Key Tangents parameter and let the renderer calculate them at run time. In the case of the Shape Key Normals parameter, you will likely want to keep this enabled unless your shape keys do nothing to change the surface normals of your mesh. If that is the case, you can disable this parameter as well.
The Skinning parameter needs to be enabled to export animation on any skinned mesh - specifically any mesh driven by an armature. If this parameter is disabled, any skeleton and skinning information present in your scene will be excluded from the export. If you want to export only the mesh attached to an armature, disabling this parameter will easily allow it. With the Skinning parameter enabled, you get access to the Include All Bone Influences parameter. This parameter, when enabled, will export weights from every bone that influences every vertex. Typically, you do not want more than 4 bones to influence any vertex as individual glTF renderers may not support more than four bone influences per vertex. Babylon.js does support more than four bones influencing a single vertex, but if you need your glTF to render consistently across different renderers it would be advisable to stick to only four bone influences per vertex. Leaving this parameter unchecked will ensure you have no more than four bone influences per vertex, even if your authored file does.
Texture Baking in Blender with Nvidia Omniverse Plugin
Exporting Blender Animations to GLTF