Modeling Tools Editor Plugin Python API?

I use to import whole scenes from Blender with many objects, so it is always better to change the pivot point assigned by UE to all the object (the 0,0,0 of Blender) to new pivots based in the centre of each object.
The experimental plugin Modeling Tools Editor is great in doing this task on singular meshes, but when it comes to batch modify, there is no option to loop the centre pivot->bake through all the meshes, but it can only interpolate and assign a common pivot for all the selected meshes.

This is where I would need some help: I’d like to write a python script to loop the task through the selected static meshes, but I miss any kind of API or start to get these “modeling” functions.
I tried also to directly modify the code of the plugin and recompile it, but since I have almost zero knowledge with C++, compiling and such, I cant get to any result in this way.

P.S. I have also the Pivot Tool plugin and it works great for batch editing in UE 4.27, but I have to stick to UE5 and the said plugin does not support it

1 Like

Hello,

in UE5 geometry tools will be exposed to python. They are not available in Early Access but you can test from the git branch.

Here is a sample to flip normals on an asset I tried a month ago. The API might be slightly different are 5.0 is still being worked on, but it shows which object, classes or library you can start looking into.

def testFeature(input_sm):
    asset_options = unreal.GeometryScriptCopyMeshFromAssetOptions()
    requested_lod = unreal.GeometryScriptMeshReadLOD()
    dm = unreal.DynamicMesh()
    unreal.GeometryScript_AssetUtils.copy_mesh_from_static_mesh(input_sm,dm,asset_options,requested_lod)
    dm.flip_normals()
    options = unreal.GeometryScriptCopyMeshToAssetOptions()
    target_lod = unreal.GeometryScriptMeshWriteLOD()
    unreal.GeometryScript_AssetUtils.copy_mesh_to_static_mesh(dm,input_sm,options,target_lod)
    #unreal.EditorAssetLibrary.save_asset(input_sm)