Hi there. I have to make a turntable in UE4. I have a problem though: Most objects are modeled/imported far away from the origin in Maya. When imported, this results in pivots that are very distant compared to the object within UE4. As a result, rotating or centering objects to appear in-camera for the turntable has been tricky.
I need a way to center these objects that have distant so I can make them rotate and render in a turntable, without the use of pivot calculations, because those pivots are completely off.
They are hundreds of assets, so I can’t ask modelers to “just fix the pivot”.
After the export, the only way is to create a BP for each mesh and set a relative location in relation to the root.
For example, this cube was exported having its pivot 7.24 m (in x) from the center. So, I created a BP, and set it’s location to -7.24m (in x) relative to the root:
I generally move it to the origin, export, and put is back where it was. Neither Blender nor Autodesk programs account for the actual object origin, and that’s sad.
You can also make a new actor… have a scene component and a static mesh component… and place static mesh in relation to the scene root component as you like (so centered in any point you wish for).
Is there a way to find this new center with Blueprints? I have thousands of objects, and manual re-positioning inside Unreal Might prove too time consuming to consider it appropriate for the current project budget.
I’m afraid not. The object’s pivot point is lost during the convertion from .fbx → .uassets. You can verify that by exporting a model from unreal to fbx and open it in Maya. The object’s pivot point will be at (0,0,0).
So, I don’t think it’s possible to know the required re-positioning values.
There are scripts for Maya that automatically deal with this pivot and origin issue. So I suggest you start using one of them or implement one.
Snap the pivot to the center (hold Alt+V and drag the pivot with the middle mouse button (you have to click on the white ball));
Save the pivot offset (right click, Pivot => Set as Pivot Offset);
Add a cone and snap the table to the top of the cone (this time holding V and moving the white ball with LMB);
Parent the table to the cone;
Select both, press Blueprints (at the top of your viewport) => Convert Selection to Blueprint Class => Harvest Components;
In the cone details, reset the mesh to none or just make it invisible. It will now be the new root.
Now the table rotates around its center.
If the table doesn’t have a vertex in the center, but if you know the precise radius of the table, you can do the same with one of the outer vertices, and then just offset the table relative to the cone by the radius value.
If the table doesn’t have a vertex in the center and you don’t know the precise radius, that’s too bad. You’ll have to eyeball it somehow.
A little update if it’s still relevant. You can use the “Modeling Tool Editor Mode” plugin. It can automatically set the pivot to the center of the mesh and do lots of other stuff.
I was looking all over for this simple of a solution. I needed it to re-center a line trace on a large instanced array. Previously the line trace was off in a weird location and now, bringing in your above logic, the line trace is always in the center of my arrayed meshes regardless of how many there are. THANK YOU!