How to update mesh without Godot designer resetting the inspector every time

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By 5pectre7

I created a dynamically generated Sphere mesh which is configurable via exported properties. Whenever property changes I generate updated mesh, and assign it to the MeshInstance in the scene, i.e.

var newMesh: ArrayMesh =
self.mesh = surface.commit(newMesh)

The problem is that whenever the last line executes, and mesh is assigned, the inspector is completely resetting, so I can’t modify my mesh smoothly by using sliders.
So, the question as in the subject, is how do I modify the mesh without Inspector resetting ?