# ExportBuilder

> Human Generator for Blender documentation. Web version: https://humgen3d.com/docs/api/exportbuilder

Reached as: `human.export`

Source: https://github.com/OliverJPost/HumGen3D/blob/main/human/process/export.py#L209

Writes a human to a file. Every method returns the path that was written.

The datablocks are written under their names without the number suffix of
Blender, the livekeys are baked and the transparent outer layer of the eyes
is left out, as most formats can't carry it.

## Methods

### write()

```python
human.export.write(filepath: str, output: OutputSettings, units: str = 'meters', animation: Animation = 'none', armature_only: bool = False, sample_rate: int = 0, context: C = None) -> str
```

Writes the human in the format of the output settings.

Parameters:
- `filepath` (str): Path of the file, the extension of the format is added when missing. Its folder is made when needed.
- `output` ([OutputSettings](https://humgen3d.com/docs/api/outputsettings)): Format, exporter options and texture placement, as in a recipe.
- `units` (str, default 'meters'): "meters" or "centimeters", see `SkeletonSettings.units`. FBX only.
- `animation` (Animation, default 'none'): "none", "active" or "strips", what of the animation of the rig goes into the file. Formats with a rig only.
- `armature_only` (bool, default False): Only the skeleton and its animation, for a file with clips.
- `sample_rate` (int, default 0): Frames per second the animation is sampled at, 0 for the frame rate of the scene, see `AnimationClipSettings.sample_rate`. FBX only.
- `context` (C, default None): Blender context. bpy.context if not provided.

Returns: str — The path that was written.

Raises: ExportPackMissing — If the HG_Export content pack is not installed.

Raises: ValueError — If the output is not a file format.

Source: https://github.com/OliverJPost/HumGen3D/blob/main/human/process/export.py#L220

### to_fbx()

```python
human.export.to_fbx(filepath: str, export_custom_props: bool = False, triangulate: bool = False, axis_forward: Axis = '-Z', axis_up: Axis = 'Y', primary_bone_axis: Axis = 'Y', secondary_bone_axis: Axis = 'X', use_leaf_bones = False, apply_scale_options: str = 'FBX_SCALE_NONE', mesh_smooth_type: str = 'FACE', path_mode: str = 'AUTO', embed_textures: bool = False, animation: Animation = 'active', armature_only: bool = False, bake_anim_step: float = 1.0, bake_textures: bool = False, context: C = None)
```

Parameters:
- `filepath` (str)
- `export_custom_props` (bool, default False)
- `triangulate` (bool, default False)
- `axis_forward` (Axis, default '-Z')
- `axis_up` (Axis, default 'Y')
- `primary_bone_axis` (Axis, default 'Y')
- `secondary_bone_axis` (Axis, default 'X')
- `use_leaf_bones`
- `apply_scale_options` (str, default 'FBX_SCALE_NONE')
- `mesh_smooth_type` (str, default 'FACE')
- `path_mode` (str, default 'AUTO')
- `embed_textures` (bool, default False)
- `animation` (Animation, default 'active')
- `armature_only` (bool, default False)
- `bake_anim_step` (float, default 1.0)
- `bake_textures` (bool, default False)
- `context` (C, default None)

Source: https://github.com/OliverJPost/HumGen3D/blob/main/human/process/export.py#L299

### to_obj()

```python
human.export.to_obj(filepath: str, apply_modifiers: bool = True, triangulate: bool = False, export_vertex_groups: bool = False, path_mode: Literal['AUTO', 'ABSOLUTE', 'RELATIVE', 'MATCH', 'STRIP', 'COPY'] = 'AUTO', axis_forward: Axis = '-Z', axis_up: Axis = 'Y', bake_textures: bool = False, context: C = None)
```

Parameters:
- `filepath` (str)
- `apply_modifiers` (bool, default True)
- `triangulate` (bool, default False)
- `export_vertex_groups` (bool, default False)
- `path_mode` (Literal['AUTO', 'ABSOLUTE', 'RELATIVE', 'MATCH', 'STRIP', 'COPY'], default 'AUTO')
- `axis_forward` (Axis, default '-Z')
- `axis_up` (Axis, default 'Y')
- `bake_textures` (bool, default False)
- `context` (C, default None)

Source: https://github.com/OliverJPost/HumGen3D/blob/main/human/process/export.py#L364

### to_gltf()

```python
human.export.to_gltf(filepath: str, bake_textures: bool = False, context: C = None)
```

Parameters:
- `filepath` (str)
- `bake_textures` (bool, default False)
- `context` (C, default None)

Source: https://github.com/OliverJPost/HumGen3D/blob/main/human/process/export.py#L410

### to_gltf_embedded()

```python
human.export.to_gltf_embedded(filepath: str, bake_textures: bool = False, context: C = None)
```

Parameters:
- `filepath` (str)
- `bake_textures` (bool, default False)
- `context` (C, default None)

Source: https://github.com/OliverJPost/HumGen3D/blob/main/human/process/export.py#L421

### to_gltf_separate()

```python
human.export.to_gltf_separate(filepath: str, image_format: Literal['AUTO', 'JPEG'] = 'AUTO', tangents: bool = False, draco: bool = False, animation: Animation = 'none', armature_only: bool = False, bake_textures: bool = False, context: C = None)
```

Parameters:
- `filepath` (str)
- `image_format` (Literal['AUTO', 'JPEG'], default 'AUTO')
- `tangents` (bool, default False)
- `draco` (bool, default False)
- `animation` (Animation, default 'none')
- `armature_only` (bool, default False)
- `bake_textures` (bool, default False)
- `context` (C, default None)

Source: https://github.com/OliverJPost/HumGen3D/blob/main/human/process/export.py#L431

### to_glb()

```python
human.export.to_glb(filepath: str, image_format: Literal['AUTO', 'JPEG'] = 'AUTO', tangents: bool = False, draco: bool = False, animation: Animation = 'none', armature_only: bool = False, bake_textures: bool = False, context: C = None)
```

Parameters:
- `filepath` (str)
- `image_format` (Literal['AUTO', 'JPEG'], default 'AUTO')
- `tangents` (bool, default False)
- `draco` (bool, default False)
- `animation` (Animation, default 'none')
- `armature_only` (bool, default False)
- `bake_textures` (bool, default False)
- `context` (C, default None)

Source: https://github.com/OliverJPost/HumGen3D/blob/main/human/process/export.py#L448

### to_abc()

```python
human.export.to_abc(filepath: str, bake_textures: bool = False, context: C = None)
```

Parameters:
- `filepath` (str)
- `bake_textures` (bool, default False)
- `context` (C, default None)

Source: https://github.com/OliverJPost/HumGen3D/blob/main/human/process/export.py#L559
