# Is there any way to access the Build Settings of a static mesh through the Python API?

**URL:** <https://forums.unrealengine.com/t/is-there-any-way-to-access-the-build-settings-of-a-static-mesh-through-the-python-api/133640>\
**Category:** Editor Scripting\
**Tags:** unreal-engine\
**Created:** [November 18, 2019, 1:30am UTC](https://forums.unrealengine.com/t/is-there-any-way-to-access-the-build-settings-of-a-static-mesh-through-the-python-api/133640 "2019-11-18T01:30:30Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![anonymous\_user\_3690b88b](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_3690b88b](https://forums.unrealengine.com/u/anonymous_user_3690b88b)\
**Post date:** [November 18, 2019, 1:30am UTC](https://forums.unrealengine.com/t/is-there-any-way-to-access-the-build-settings-of-a-static-mesh-through-the-python-api/133640/1 "2019-11-18T01:30:30Z")

</div>

I’m hoping to write a script that will allow me to batch-edit all static meshes within a folder and change their Build Settings, specifically the Min Lightmap Resolution. Is there any way to do this currently? I can’t find anything in the Python API. The only lightmap-related parameter exposed in **unreal.StaticMesh** is Lightmap Resolution (not allowing you to adjust the padding).

---

<div class="post-metadata">

**Author:** ![kamrann](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@kamrann](https://forums.unrealengine.com/u/kamrann)\
**Post date:** [November 19, 2019, 1:08pm UTC](https://forums.unrealengine.com/t/is-there-any-way-to-access-the-build-settings-of-a-static-mesh-through-the-python-api/133640/2 "2019-11-19T13:08:19Z")

</div>

If I recall correctly, a lot of that static mesh stuff is handled in the mesh editor UI code, not on the mesh object itself, meaning it wouldn’t be possible to update it through script, or if you could you’d end up with some dependent logic not being run causing further problems.

I know a staff member referenced it somewhere recently and said they are working to gradually refactor that sort of thing, but it’s a problem throughout the engine codebase, so realistically if it’s important you’d need to make the changes yourself and submit a PR, if you don’t want to wait months/years.

---

<div class="post-metadata">

**Author:** ![sprunghunt](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@sprunghunt](https://forums.unrealengine.com/u/sprunghunt)\
**Post date:** [August 24, 2021, 2:31am UTC](https://forums.unrealengine.com/t/is-there-any-way-to-access-the-build-settings-of-a-static-mesh-through-the-python-api/133640/3 "2021-08-24T02:31:47Z")

</div>

The Min Lightmap parameter is stored in a unreal.MeshBuildSettings object.

[https://docs.unrealengine.com/4.26/en-US/PythonAPI/class/MeshBuildSettings.html](https://docs.unrealengine.com/4.26/en-US/PythonAPI/class/MeshBuildSettings.html)

To edit any of these you need to create (or get) a unreal.MeshBuildSettings object with the right settings and then apply it to the mesh using unreal.EditorStaticMeshLibrary.set\_lod\_build\_settings()

[https://docs.unrealengine.com/4.26/en-US/PythonAPI/class/EditorStaticMeshLibrary.html](https://docs.unrealengine.com/4.26/en-US/PythonAPI/class/EditorStaticMeshLibrary.html)

---

<div class="post-metadata">

**Author:** ![slim\_sheady19](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/slim_sheady19/32/1092065_2.png) [@slim\_sheady19](https://forums.unrealengine.com/u/slim_sheady19)\
**Post date:** [July 15, 2022, 7:52pm UTC](https://forums.unrealengine.com/t/is-there-any-way-to-access-the-build-settings-of-a-static-mesh-through-the-python-api/133640/4 "2022-07-15T19:52:56Z")

</div>

does this sort of thing have to be done in Python, or can it be done in BP with say an Editor Utility Widget? I have many static meshes and materials I want to import and modify (for example) Build Settings such as [full precision UVs = true] and [generate lightmap UVs = false], I need to be able to automate this process.

---

<div class="post-metadata">

**Author:** ![KiranBhallamudi](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@KiranBhallamudi](https://forums.unrealengine.com/u/KiranBhallamudi)\
**Post date:** [December 12, 2022, 1:44pm UTC](https://forums.unrealengine.com/t/is-there-any-way-to-access-the-build-settings-of-a-static-mesh-through-the-python-api/133640/5 "2022-12-12T13:44:40Z")

</div>

Hey hi, did you got any solution for this.

i am trying to get proper answer to change Precision UV for all the static meshes at once.

---

<div class="post-metadata">

**Author:** ![KiranBhallamudi](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@KiranBhallamudi](https://forums.unrealengine.com/u/KiranBhallamudi)\
**Post date:** [December 14, 2022, 6:12am UTC](https://forums.unrealengine.com/t/is-there-any-way-to-access-the-build-settings-of-a-static-mesh-through-the-python-api/133640/6 "2022-12-14T06:12:34Z")

</div>

I created a blueprint and it’s working great.

---

<div class="post-metadata">

**Author:** ![AmrSrour](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/amrsrour/32/465284_2.png) [@AmrSrour](https://forums.unrealengine.com/u/AmrSrour)\
**Post date:** [January 14, 2023, 1:03am UTC](https://forums.unrealengine.com/t/is-there-any-way-to-access-the-build-settings-of-a-static-mesh-through-the-python-api/133640/7 "2023-01-14T01:03:06Z")

</div>

can you share it with us if u dont mind

---

<div class="post-metadata">

**Author:** ![ReissWalk](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@ReissWalk](https://forums.unrealengine.com/u/ReissWalk)\
**Post date:** [June 16, 2023, 3:18pm UTC](https://forums.unrealengine.com/t/is-there-any-way-to-access-the-build-settings-of-a-static-mesh-through-the-python-api/133640/8 "2023-06-16T15:18:39Z")

</div>

Hey, can anyone help me further understand using python to do these sorts of tasks, I am currently learning using python in Unreal and just need some places to help me learn writing and applying, I don’t mind paying for a tutorial series or similar stuff, thanks in advance 🙂

---

<div class="post-metadata">

**Author:** ![KiranBhallamudi](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@KiranBhallamudi](https://forums.unrealengine.com/u/KiranBhallamudi)\
**Post date:** [July 28, 2023, 9:26am UTC](https://forums.unrealengine.com/t/is-there-any-way-to-access-the-build-settings-of-a-static-mesh-through-the-python-api/133640/9 "2023-07-28T09:26:46Z")

</div>

![To Activate The PrecisionUV](https://d3kjluh73b9h9o.cloudfront.net/original/4X/3/e/0/3e06d1efcbf6e81f65fb77f3c8875336f3aded71.jpeg)

---

<div class="post-metadata">

**Author:** ![dpotuznik](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@dpotuznik](https://forums.unrealengine.com/u/dpotuznik)\
**Post date:** [July 24, 2024, 9:04pm UTC](https://forums.unrealengine.com/t/is-there-any-way-to-access-the-build-settings-of-a-static-mesh-through-the-python-api/133640/10 "2024-07-24T21:04:13Z")

</div>

Hi everyone,

if you need here i small python code tu update the sm\_build\_settings

```auto
    def set_lighmap_uv(asset, resolution=512, generate= True, indexUV = 0):
        staticmesh_subsystem = unreal.get_editor_subsystem(unreal.StaticMeshEditorSubsystem)
        if asset.get_class().get_name() != "StaticMesh":
            return # skip everything else except static meshes

        sm_build_settings = staticmesh_subsystem.get_lod_build_settings(asset, 0)

        sm_build_settings.min_lightmap_resolution = resolution
        sm_build_settings.generate_lightmap_u_vs = generate
        sm_build_settings.dst_lightmap_index = indexUV

        staticmesh_subsystem.set_lod_build_settings(asset, 0, sm_build_settings)

```

have nice day.  
Daniel
