# Unable to edit the build settings on a static mesh from C++

**URL:** <https://forums.unrealengine.com/t/unable-to-edit-the-build-settings-on-a-static-mesh-from-c/415504>\
**Category:** Rendering\
**Tags:** static-mesh-editor, uv, unreal-engine, CPP, question\
**Created:** [January 25, 2018, 11:00am UTC](https://forums.unrealengine.com/t/unable-to-edit-the-build-settings-on-a-static-mesh-from-c/415504 "2018-01-25T11:00:19Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![anonymous\_user\_586fe6d5](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_586fe6d5](https://forums.unrealengine.com/u/anonymous_user_586fe6d5)\
**Post date:** [January 25, 2018, 11:00am UTC](https://forums.unrealengine.com/t/unable-to-edit-the-build-settings-on-a-static-mesh-from-c/415504/1 "2018-01-25T11:00:19Z")

</div>

I’m trying to access the “Use High Precision Tangent Basis” variable (as shown below in the Editor) but from C++, when I spawn an Actor tagged with “highPrecision” into the level.

 ![228355-capture.png](https://d3kjluh73b9h9o.cloudfront.net/original/4X/1/5/7/157382b5e414da9806e513f1bfe3b64ed485d30c.png)

I’ve found a way to access the static mesh build settings through [FStaticMeshSourceModel:][2]

```
bool result = newMeshComponent->SetStaticMesh(LoadMeshFromPath(FName(*meshPath)));

if (result)
{
   if (setHighPrecision)
   {
      UStaticMesh* precisionMesh = newMeshComponent->GetStaticMesh();
      FStaticMeshSourceModel& srcModel = precisionMesh->SourceModels[0];
      srcModel.BuildSettings.bUseHighPrecisionTangentBasis = true;
   }
}

```

I’ve tried to find a way to “save” this setting as you would in the Editor, and scoured the docs, but no matter what I try, the static mesh never has high precision tangents applied.

Am I on the right track here? Would appreciate any suggestions! Thanks,

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_b5bd819e](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_b5bd819e](https://forums.unrealengine.com/u/anonymous_user_b5bd819e)\
**Post date:** [July 22, 2018, 9:35am UTC](https://forums.unrealengine.com/t/unable-to-edit-the-build-settings-on-a-static-mesh-from-c/415504/2 "2018-07-22T09:35:31Z")

</div>

Did you ever find a solution to this?

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_586fe6d5](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_586fe6d5](https://forums.unrealengine.com/u/anonymous_user_586fe6d5)\
**Post date:** [July 23, 2018, 8:56am UTC](https://forums.unrealengine.com/t/unable-to-edit-the-build-settings-on-a-static-mesh-from-c/415504/3 "2018-07-23T08:56:03Z")

</div>

Hi , yes I did actually. As the code above is being run through a commandlet inside a plugin I can just put the block between `#if WITH_EDITOR` and `#endif` and then save the mesh using:

```
UPackage* meshPackage = mesh->GetOutermost();

FString meshPackageFileName = FPackageName::LongPackageNameToFilename(meshPackage->GetPathName(),
                                                                                     FPackageName::GetAssetPackageExtension());

UPackage::SavePackage(meshPackage, nullptr, RF_Standalone, *meshPackageFileName);

```

Memory is slightly hazy, but I may also have had to include something like

```
#if WITH_EDITOR
    "UnrealEd"
#endif

```

in the dependencies inside my plugin’s Build.cs file.

Hope that helps!

---

<div class="post-metadata">

**Author:** ![Seim2k](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Seim2k](https://forums.unrealengine.com/u/Seim2k)\
**Post date:** [July 26, 2019, 12:23pm UTC](https://forums.unrealengine.com/t/unable-to-edit-the-build-settings-on-a-static-mesh-from-c/415504/4 "2019-07-26T12:23:32Z")

</div>

Nice! Thank you !

---

<div class="post-metadata">

**Author:** ![lereel](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@lereel](https://forums.unrealengine.com/u/lereel)\
**Post date:** [October 17, 2024, 3:31pm UTC](https://forums.unrealengine.com/t/unable-to-edit-the-build-settings-on-a-static-mesh-from-c/415504/5 "2024-10-17T15:31:34Z")

</div>

Hi,

Just here to note that only using this did not solved the issue on my side. To make it work I had to add

```auto
#if WITH_EDITOR

mesh->Modify(); <---

//....

mesh->PostEditChange(); <---

#endif

```

However, thanks for the help!
