# Merge Parts By Regions

> How to merge parts by physical proximity in Asset Transformer Studio

![Merge Parts By Regions](/api/media?file=/asset-transformer-studio/2026.5.0/media/ALGO_MergeByRegions2.png)

## Description

[Merge Parts By Regions](/asset-transformer-studio/2026.5.0/api/python/scene_functions.md#mergepartoccurrencesbyregions) is different from other automatic parts merging functions ([Scene menu](./_index.md)), which rely on the hierarchical organization.

[Merge Parts By Regions](/asset-transformer-studio/2026.5.0/api/python/scene_functions.md#mergepartoccurrencesbyregions) enables you to merge parts together (assemble a collection of parts into a single resulting part), based on their physical proximity in the scene, meaning by region.

With this algorithm, you can quickly merge groups of parts gathered by region, without needing to manually select them through the viewer or the hierarchy ([Product Structure](../../../data-preparation-fundamentals/about-the-product-structure-tree)), which can be tedious, especially with very large models.

The [Merge Parts By Regions](/asset-transformer-studio/2026.5.0/api/python/scene_functions.md#mergepartoccurrencesbyregions) function is particularly suited for large AEC models coming from Revit, AutoCAD, Navisworks or RVM files.

![Merge By Regions animation](/api/media?file=/asset-transformer-studio/2026.5.0/media/ALGO_MergeByRegions.gif)

## Usage strategies

[Merge Parts By Regions](/asset-transformer-studio/2026.5.0/api/python/scene_functions.md#mergepartoccurrencesbyregions) can be very powerful with real-time 3D engines like [Unity](https://unity.com/).

For example, this merging strategy can be used as a starting point to generate HLODs, by creating regions before combining materials region by region (using [ProxyMesh + Bake](/asset-transformer-studio/2026.5.0/api/python/process_functions.md#proxyfrommeshes) for example).

Also, it can help take advantage of [occlusion culling](https://docs.unity3d.com/Manual/OcclusionCulling.html) capabilities: merging lowers the number of draw calls while benefiting from Unity's frustum culling (contrary to other `Merge` functions that do not merge by location/region but by hierarchy). This is particularly interesting with large AEC buildings where the user is more likely to be inside a model than outside, thus culling the invisible outer pieces. One drawback though is that merging like this generally destroys [instances](../../../data-preparation-fundamentals/about-instances-and-prototypes).

![Merge By Regions strategy animation](/api/media?file=/asset-transformer-studio/2026.5.0/media/ALGO_MergeByRegions3.gif)

## How To

1. Go to the [Scene](./_index.md) menu and select `Merge Parts By Regions`.

   ![Merge Parts By Regions menu item](/api/media?file=/asset-transformer-studio/2026.5.0/media/NewItem437.png)

2. Choose how the segmentation is guided:

   ![Segmentation options](/api/media?file=/asset-transformer-studio/2026.5.0/media/NewItem438.png)

   * `Number Of Regions`: sets how many resulting regions will be created
   * `Size of Regions`: defines the number of regions by a predefined region size

3. Choose a merging strategy:

   * `Merge Parts`: for each computed region, all parts included in this region are merged together as one unique resulting part
   * `Merge By Materials`: for each computed region, all parts included in this region are merged together based on their material (can result in multiple parts, depending on the number of materials of the model)

### Scripting

This function can also be used in a Python script:

```python
pxz.scene.mergePartOccurrencesByRegions([1], ["NumberOfRegions", 10], 0)
```
