# Alembic Export Options

## Alembic Export Patterns

### Pattern 1 — Named preset (recommended)
```python
from os_fast_ref.api import FastRefAPI

api = FastRefAPI()
api.export_abc(slot=0, output_path=r"J:\output\char.abc", preset="Unreal_UE5")
api.export_abc_all(output_folder=r"J:\output", preset="Unity_ABC")
```
A non-existent preset name immediately raises `ValueError`.

Bundled presets: `Unreal_UE5`, `Unity_ABC`

### Pattern 2 — Export Type filter (Meshes / Bones)
Applied just before the final `select`, after candidate collect (Auto Skin / Defined Selection Set).
```python
from os_fast_ref.api import FastRefAPI

api = FastRefAPI()

# Meshes only (typical UE Geometry Cache)
api.export_abc(
    slot=0,
    output_path=r"J:\output\char_mesh.abc",
    preset="Unreal_UE5",
    abc_options={"ExportMeshes": True, "ExportBones": False},
)

# Bones only
api.export_abc(
    slot=0,
    output_path=r"J:\output\char_bones.abc",
    abc_options={"ExportMeshes": False, "ExportBones": True},
)
```
Both `False` → FAIL FAST. Defaults are both `True`.

> **Reset Root:** Independent of Export Type. Full bone list is used to reset Root PRS first, then only filtered nodes are exported.

### Pattern 3 — Copy defaults then modify
```python
from os_fast_ref.api import FastRefAPI

api = FastRefAPI()
defaults = api.get_abc_default_options()
opts = defaults["options"].copy()
opts["ExportBones"] = False
opts["RemoveNameSpace"] = True
opts["ResetRoot"] = True
api.export_abc(slot=0, output_path=r"J:\output\char.abc", abc_options=opts)
```

### Pattern 4 — preset + partial override
```python
from os_fast_ref.api import FastRefAPI

api = FastRefAPI()
api.export_abc(
    slot=0,
    output_path=r"J:\output\char.abc",
    preset="Unreal_UE5",
    abc_options={
        "ExportMeshes": True,
        "ExportBones": False,
        "CoordinateSystem": "yup",
    },
)
```

### Pattern 5 — Defined Selection Set
If the reference INFO has `fbxExportMode == "Defined"` and `fbxExportSelectionSets`,  
ABC splits output files per Selection Set the same way as FBX.

- 1 set → `{base}.abc`
- 2+ sets → `{base}_{SetName}.abc`

Export Type filtering is applied again to each set's nodes.
```python
# Selection Sets come from Rig Data Manager / INFO
# Just call export_abc — Defined path is taken automatically
api.export_abc(slot=0, output_path=r"J:\output\char.abc", preset="Unreal_UE5")
```

---

## Key Alembic Options Reference
| Key | Type | Description |
| --- | --- | --- |
| `ExportMeshes` | `bool` | Include meshes in final select (default `True`) |
| `ExportBones` | `bool` | Include bones in final select (default `True`) |
| `RemoveNameSpace` | `bool` | Remove namespace before export |
| `ResetRoot` | `bool` | Temporarily reset Root transform, then restore |
| `ResetRootMode` | `str` | `"auto"` or `"name"` |
| `ResetRootName` | `str` | Node name for name mode |
| `ResetAxisX/Y/Z` | `float` | Rotation applied after root reset (degrees) |
| `ArchiveType` | `str` | `"ogawa"` / `"hdf5"` |
| `CoordinateSystem` | `str` | `"yup"` / `"zup"` / `"max"` |
| `Hidden` | `bool` | Export hidden geometry |
| `UVs` / `Normals` / `VertexColors` | `bool` | Export data flags |
| `AnimTimeRange` | `str` | `"CurrentFrame"` / `"TimeSlider"` / `"StartEnd"` |
| `BatchCreateSubfolder` | `bool` | Per-reference subfolder on batch export |

Lookup:
```python
info = api.get_abc_default_options()
print(info["preset_name"])
print(info["options"].keys())
```