| Since | 22.0 |
The glTF 2.0 ROP can export your scene as a GLTF file. See glTF format for further information.
Note
See the following link for an overview of importing and exporting glTF files to and from Houdini.
The follow table provides further details about which glTF features and extensions are supported, plus any relevant notes about how they are supported:
glTF Property or Extension |
Supported |
Notes |
Scene |
|
All nodes will be exported to a single scene, which can be optionally named with the Scene Name parameter. |
Node |
|
When exporting an Object network, a glTF node will be exported for each OBJ node. When exporting a SOP, the behaviour will differ depending on how the node parameters are configured. By default, only a single glTF node will be exported, along with a mesh and as many mesh primitives as are needed. If the Build Hierarchy from Path Attribute parameter is enabled, a glTF node will be exported for every unique path in the geometry being exported. |
Mesh |
|
SOP geometry will be exported to a glTF mesh. Sometimes exported geometry needs to be processed to make it compatible with glTF, such as by triangulating the geometry or splitting points when vertices sharing that point have different attribute values. |
Mesh Primitive (Points) |
|
Point clouds will be exported to a mesh primitive with mode POINTS. Note This is not supported when Draco mesh compression is enabled. |
Mesh Primitive (Lines) |
|
Lines will be exported to a mesh primitive with mode LINES. Note This is not supported when Draco mesh compression is enabled. |
Mesh Primitive (Triangles) |
|
Triangular polygon meshes will be exported to a mesh primitive with mode TRIANGLES. |
Camera |
|
Both OBJ cameras and SOP primitive cameras are supported and will be exported unless |
Skin |
|
- |
Morph Target |
|
- |
Animation (Transform Target) |
|
Animated OBJ node transforms will be exported to a single glTF animation or multiple glTF animations (if Export Animations to is set to Multiple Clips). |
Animation (Weight Target) |
|
- |
Material |
|
Supported materials assigned to geometry in the scene will be exported. |
Texture |
|
Supported texture maps used by supported materials in the scene will be exported, as well as any textures specified by the Additional Textures parameter. |
KHR_draco_mesh_compression Extension |
|
Meshes will be exported with Draco mesh compression when Use Draco Compression is enabled. Draco mesh compression only supports triangle primitives. |
KHR_lights_punctual Extension |
|
Any OBJ lights in the scene will be exported unless Export Lights is disabled. |
Parameters ¶
Save to Disk
Begins the render with the last render control settings.
Controls
Opens the Render Control window, which allows you to adjust the render parameters before rendering.
Valid Frame Range
Controls whether this render node outputs the current frame or the image sequence specified in the Start/End/Inc parameters.
Render Current Frame
Export only the current frame.
Render Frame Range
Export the frames in the Start/End/Inc frame range, but also allow exporting of frames referenced by in-range frames.
Render Frame Range Only (Strict)
Only export the frames in the Start/End/Inc frame range. Do not allow exporting of other frames, including frames referenced by in-range frames.
Start/End/Inc
Specifies the range of frames to render (start frame, end frame, and increment). All of the values can be floating point values. The range is inclusive.
The Start/End/Inc parameters determine the values of the below local variables for the output driver.
$NRENDER
The number of frames to be rendered by the output driver.
$N
The current frame being rendered (starting at 1 and going to
$NRENDER).
For example, if the parameters are set to:
Start |
End |
Inc |
|---|---|---|
10.5 |
12 |
0.5 |
… there will be 4 frames rendered (10.5, 11, 11.5, and 12), so $NRENDER will have a value of 4.
$N will have the following values at each frame:
Frame |
|
|---|---|
10.5 |
1 |
11 |
2 |
11.5 |
3 |
12 |
4 |
Render with Take
Uses the settings in a particular take while rendering. Choose Current to use the current take when rendering.
Output File
The path of the file written by the node. The extension determines the type of file that is written.
A path with a .glb extension generates a single binary GLB file and stores all resources (such as images) within the file.
A path with a .gltf extension may store some resources externally as separate files. Exported resource files are written to the same folder as .gltf and are referenced using relative paths.
Create Intermediate Directories
When turned on, automatically creates intermediate directories in the Output File path. When off, the path must exist or the node will raise an error.
glTF ¶
Use SOP Path
When turned on, outputs a single SOP node to the outputted glTF file instead of an Object node graph.
SOP Path
When Use SOP Path is turned on, specify the path to the SOP node to export.
Build Hierarchy from Attribute
Use a primitive string attribute for creating nodes in the output file. Each string value is treated like a path to a node in the glTF scene. If the primitive is a packed primitive, then the exported node takes on the primitive’s transform.
Note
This parameter is only available when used from the Geometry context or when the Use SOP Path parameter is on.
Path Attribute
The name of the attribute containing the path used for Build Hierarchy from Path Attribute.
Root Object
When exporting an Object graph, specifies the root object of the scene. All displayed objects contained under this node will be included in the exported glTF file.
Objects
A pattern/bundle of objects to include in the exported glTF scene.
Scene Name
The name of the exported glTF scene property. When blank, the name property will be omitted.
Copyright
The text to include in the exported glTF asset’s copyright property.
Use Draco Compression
Turn on the Draco mesh compression extension for exported meshes.
Note
KHR_draco_mesh_compression currently only supports triangle primitives. You cannot export point clouds or curve primitives which are supported when Use Draco Compression is off.
Export Custom Attributes
When turned on, all attributes that are prefixed with _ (as defined in the glTF specification) are exported as custom attributes. When off, only attributes defined in the glTF standard are exported.
Attributes are exported with their original types whenever possible. However, glTF allows a maximum of 32 bits for floats and integers which means that a narrowing conversion can occur.
Note
glTF only supports point attributes, so any custom vertex, primitive, or detail attributes you want to support must be promoted to point attributes.
Export Extras
When turned on, exports dictionary attributes to glTF property fields. This can include any arbitrary user data in the exported glTF file.
Extras are currently supported for the following glTF property types:
-
Scene
-
Node
-
Mesh
-
Skin
Refer to the table below to see the expected attribute names and attribute classes that the node will search for when exporting extras:
|
Extras Property Owner |
Dictionary Attribute Name |
Supported Attribute Classes |
|
Scene |
gltf_scene_extras |
Detail |
|
Node |
gltf_node_extras |
Primitive, Detail |
|
Mesh |
gltf_mesh_extras |
Primitive, Detail |
|
Skin |
gltf_skin_extras |
Detail |
Export Materials
When turned on, exports any materials associated with geometry that is being exported. The exporter looks for the standard shop_materialpath primitive attribute to determine the material of geometry being exported.
The list of supported materials that the exporter can translate to glTF are:
-
Principled Shader
-
Mtlx Gltf Material
Export Cameras
When turned on, also exports cameras. For an Object graph, it exports camera objects that match the Objects pattern or bundle. FOr a SOP node, it exports camera primitives found in the SOP geometry.
Export Lights
When on, also exports any light objects matching the Objects pattern/bundle. This will create a dependency in the exported glTF file on the KHR_lights_punctual extension.
Image Export
Controls where images are exported to when exporting material texture maps.
Embed in glTF File
The image will be saved as a binary blob either directly within a .glb file or within the associated .bin data file of a .gltf file.
Save to External File
The image will be saved on disk as its own file. Like all exported resources, it’s stored in the same folder as the output glTF file and referenced relatively by the same glTF file.
Image Format
Controls the format of an exported image. glTF supports JPEG and PNG images.
Original or PNG
Images will be exported in their original format if supported by the glTF standard and PNG otherwise.
Original or JPEG
Images will be exported in their original format if supported by the glTF standard and JPEG otherwise.
PNG
Images will be exported as a PNG.
JPEG
Images will be exported as a JPEG.
Additional Textures
This multi-parameter can specify additional textures that should be exported to the glTF file. This is useful to have images included in the exported glTF file that are not associated with any materials being exported from your Houdini scene.
Export Animations to
Controls how animations are interpreted and exported by the exporter.
Single Clip
Any animations in the Houdini scene exports to a single glTF animation.
Multiple Clips
Any animations in the Houdini scene exports to multiple clips defined by the user with a frame range that delineates each animation clip in the Houdini scene.
None
Any animations in the Houdini scene will be ignored and no animations will be exported to the glTF file.
Animation Name
When Export Animations to is set to Single Clip, this defines the name of the exported animation property.
Animation Clips
When Export Animations to is set to Multiple Clips, this multi-parameter sets the number of clips, the name of each clip, and the frame range that delineates the animation within the Houdini scene.
Scripts ¶
A script command can be specified for execution at various execution points. The expression language selected for the script parameter determines whether the command is in hscript or python.
Prior to execution, this node is automatically set as the global current node.
To run statements from a file, specify the path to the file with
either a .cmd extension (when the language is set to Hscript) or a .py
extension (when the language is set to Python). Additional arguments to the
script can also be supplied. They will be parsed in a shell-like manner.
Pre-Render Script
Run this script before any rendering.
Pre-Frame Script
Run this script before each frame.
Post-Frame Script
Run this script after each frame.
Post-Write Script
Run this script after each frame’s data finishes writing to disk.
Post-Render Script
Run this script after all rendering.