20tab / UnrealEnginePython

Embed Python in Unreal Engine 4
MIT License
2.76k stars 752 forks source link

Bulk change StaticMesh Settings / Apply Polygon Reduction #375

Open Schizo opened 6 years ago

Schizo commented 6 years ago

I found my self changing all resolutions of the static meshes by a factor x. Didn't see that those options are exposed, so wanted to make, are we able to access Percentage Triangles from within the Python API?

rdeioris commented 6 years ago

Hi, check this snippet:

https://github.com/20tab/UnrealEnginePython/blob/master/tutorials/SnippetsForStaticAndSkeletalMeshes.md#staticmesh-adding-lods

you need to set the ReductionSettings field of a StaticMeshSourceModel struct:

http://api.unrealengine.com/INT/API/Runtime/Engine/Engine/FStaticMeshSourceModel/index.html

http://api.unrealengine.com/INT/API/Runtime/Engine/Engine/FMeshReductionSettings/index.html

Never worked with it, so if you came with something useful, feel free to post an example script/tutorial