How to sync LODs pivot using Modeling Tools?

Hello everybody!
So I’m currently working on some foliage assets and I put them into a collection in my DCC (Blender) where they’re not located in 0,0,0 world position. This means when importing into Unreal, the pivot is quite far from the assets.
I found a way to change the pivot using Modeling tools (Transform - Pivot - Bottom), but this only applies to the LOD0.
So how to apply the settings to all the LODs so that my foliage doesn’t teleport once the camera moves away?
Thanks a lot!

Hello :slight_smile:

Just uploaded an Editor Utility Widget snippet that does just what you are needing.

https://dev.epicgames.com/community/snippets/g7k/apply-new-pivot-location-to-all-staticmesh-lods-after-using-pivot-tool-with-geometry-scripting

Hope this helps and feel free to reach out if you have any questions!

-Tim

Wow! Thanks a lot. I’ll check this out ASAP :+1:

Alright, so I’ve tried using your script but I’m not sure how to proceed. I’ve never ran a custom script in Unreal before. I enabled Geometry Script plugin but what do I do next? Do I go to Tools - Run Python script? This didn’t seem to work… Do I need to create a blueprint class with your code? Sorry if those questions seem very beginner-level.

Hi! :slight_smile:

No worries! Sorry, should have added more info!

Just to make it easier on you I have attached the Editor Utility Widget .uasset file that the snippet came from. Just download and go to your project folder in Windows Explorer and paste anywhere inside your project’s Content folder. Open your project and right click on the asset you pasted then select “Run Editor Utility Widget” at the top of the menu. A new window should pop open with two buttons to run the tool. From there, just follow the instructions that are in the blue comment area of the snippet.

Let me know if you run into any problems or have any other questions!
euw_SetLODPivots.uasset (204.1 KB)

That should get you going, but just in case you want to know how to use the snippet and build the Editor Utility Widget yourself here are some steps below. (This is just for some extra info if you are interested :slight_smile: )

What you’d want to do is in an empty spot in your Content Browser, right click and go and add “Editor Utilities->Editor Utility Widget”. Open that up and in the Designer tab create two buttons and for each button go to the bottom of their Details panel and click the “+” next to “On Clicked”. This will add button click events in the Graph section. You can switch between the Graph and Designer sections by pressing the tabs on the top right of the window.

Now you can paste the snippet into the Graph section and delete the two red On Clicked nodes that where pasted and use your button On Clicked nodes instead. Now you can complie and save the widget.

The final step is to go back to your content browser and right click on the widget and select “Run Editor Utility Widget” at the top of the menu. Now you can follow the steps in the comments of the pasted widget to actually use the tool.

I hope this helps and please let me know if you have any other questions!

1 Like

Hi again!
Your script works perfectly! Thanks a lot, this will save me lots of work!
Just one caveat: if you happen to have already tried and moved the pivot of the mesh (like I had done before asking on the forum), then it won’t work, because when you copy the pivot location, it will already be the “final” one.
So I simply deleted and reimported the assets. Then, following the steps worked as intended!

Glad that helped out! :slight_smile:

Yeah, if the pivot has already been moved before using the script reimport is the way to go. There is probably a way to do it so that you don’t need to use the first button, will have to look into it when I have some time! :+1: