> ## Documentation Index
> Fetch the complete documentation index at: https://developer.synopsys.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Ansys glTF Extensions

Part of [GLTFWriter Interface](https://developer.synopsys.com/docs/ensight/ensight-apis/2025-r2/group__gltf)

Ansys specifc extensions to the glTF specification.

Ansys specifc extensions to the glTF specification.

### Extensions

**Note: This component is a work in progress and this documentation is incomplete/preliminary.**

The GLTFWriter Library is a C++ library that is capable of writing geometry scenes in glTF format. The core glTF specification, while complete, does not meet all of the needs of Ansys applications. There are a collection of formal extensions to the specification that this library (and other aspects of the Ansys glTF ecosystem) use to place more specific information into the files.

### GLTFWriter API Interface

These extensions have been designed to be specified using the [ANSYS::AVZ::GLTFWriter::Value](https://developer.synopsys.com/docs/ensight/ensight-apis/2025-r2/class_a_n_s_y_s_1_1_a_v_z_1_1_g_l_t_f_writer_1_1_value.md) interface. Adding a line width specification to a [ANSYS::AVZ::GLTFWriter::Mesh](https://developer.synopsys.com/docs/ensight/ensight-apis/2025-r2/class_a_n_s_y_s_1_1_a_v_z_1_1_g_l_t_f_writer_1_1_mesh.md) object is done like this:

```cpp theme={null}
auto line_width = GLTFWriter::Value::Create(gltf, "ANSYS_linewidth", 0.5);
mesh->AppendValue(line_width);
```

### Extensions

The following extensions are supported:

| Extension | Datatype | Object(s) | Description |
| - | - | - | - |
| ANSYS\_linewidth | float | [ANSYS::AVZ::GLTFWriter::Scene](https://developer.synopsys.com/docs/ensight/ensight-apis/2025-r2/class_a_n_s_y_s_1_1_a_v_z_1_1_g_l_t_f_writer_1_1_scene.md), [ANSYS::AVZ::GLTFWriter::Mesh](https://developer.synopsys.com/docs/ensight/ensight-apis/2025-r2/class_a_n_s_y_s_1_1_a_v_z_1_1_g_l_t_f_writer_1_1_mesh.md) | Specifies the width of lines and size of points |
| ANSYS\_material\_name | string | [ANSYS::AVZ::GLTFWriter::Material](https://developer.synopsys.com/docs/ensight/ensight-apis/2025-r2/class_a_n_s_y_s_1_1_a_v_z_1_1_g_l_t_f_writer_1_1_material.md) | The name of the material |
| ANSYS\_material\_details | string | [ANSYS::AVZ::GLTFWriter::Material](https://developer.synopsys.com/docs/ensight/ensight-apis/2025-r2/class_a_n_s_y_s_1_1_a_v_z_1_1_g_l_t_f_writer_1_1_material.md) | JSON description of the material details |
| ANSYS\_scene\_timevalue | float | [ANSYS::AVZ::GLTFWriter::Scene](https://developer.synopsys.com/docs/ensight/ensight-apis/2025-r2/class_a_n_s_y_s_1_1_a_v_z_1_1_g_l_t_f_writer_1_1_scene.md) | Time value for the scene |

#### Examples

Examples of what is embedded in the glTF JSON block:

* **ANSYS\_linewidth**:

  ```cpp theme={null}
  "extensions": {
    "ANSYS_linewidth": {
        "linewidth" : 100.0
    }
  }
  ```
* **ANSYS\_material\_name**:

  ```cpp theme={null}
  "extensions": {
    "ANSYS_material_name": {
      "name" : "sample_material_name"
     }
  }
  ```
* **ANSYS\_material\_details**:

  ```cpp theme={null}
  "extensions": {
    "ANSYS_material_details": {
      "ensight/Metal/Gold": {
        "version": "2025 R1",
        "material_type": "SUBSURFACETHINGLASS",
        "color": [0.981126, 0.793495, 0.343545],
        "ambient": [0.981126, 0.793495, 0.343545],
        "ka": 0.001373,
        "diffuse": [0.981126, 0.793495, 0.343545],
        "kd": 0.000000,
        "specular": [1.000000, 0.808760, 0.350154],
        "ks": 1.000000,
        "reflective": [1.000000, 0.808760, 0.350154],
        "kr": 0.300000,
        "emissive": [1.000000, 1.000000, 1.000000],
        "ke": 0.000000,
        "shininess": 200.000000,
        "smoothness": 0.500000,
        "opacity": 1.000000,
        "gamma_corrected": false,
        "metallic": 1.000000,
        "speculartint": 1.000000,
        "eta": [0.070000, 0.370000, 1.500000],
        "kta": [3.700000, 2.300000, 1.700000]
      }
    }
  }
  ```

  The ANSYS\_material\_details is specifically the text of a JSON object description. The object keys are the material type. In the example, the material is in "ensight" format and is of the class "Metal" and subclass "Gold". It is legal for multiple specifications to be included. For example, both "ensight/Metal/Gold" and "MDL/omniverse/green glass" may both be included in the same JSON object.
* **ANSYS\_scene\_timevalue**:

  ```cpp theme={null}
  "extensions": {
    "ANSYS_scene_timevalue": {
      "timevalue": 0.223
    }
  }
  ```

Users of the GLTFWriter API need only set the "ANSYS\_\*" named Value object on the appropriate target object type listed in the table to generate the extension blocks.
