Download

How to replace static mesh with blueprint and proper rotation?

Hey all, I have a unique issue that I’m trying to solve. I have a series of cylinders that have been arrayed in my 3d modelling software. I’m importing the static meshes through datasmith. When these meshes are imported, they have the proper location, however, every static meshes rotation is 0,0,0. I would like to create a single blueprint with a cylinder inside of it and then replace all similar static meshes with the blueprint and have the blueprint be rotated to match the orientation of the original static mesh. Has anybody accomplished this before?


Hello:

  • Replacing static mesh actors by blueprint is possible, both in editor or visual dataprep. You will need to do: for each static mesh actor, spawn a blueprint instance, copy labels, copy position and change rotation, delete static mesh actor.
  • It seems you get individual static mesh for each cylinder and a rotation of 0,0,0. That means the rotation is baked in the vertices position of each mesh and you cannot retrieve it. You will have to compute a rotation based on the cylinder position. That might be easy if they are spawned on a surface of a simple geometric surface. Else you will have to export rotation data in another way.

Extra comments:

  • which software did you generate your cylinder with. There should be a way to export them in a way so that each cylinder is just one static mesh and you get actors storing rotation and translation instead.
  • you could also create a single blueprint with a hierarchical instance static mesh component, pass the cylinder mesh and then for each static mesh actor in scene create an instance in your blueprint and passing position and rotation. like this you have one single actor holding your 300 pink cylinders for example.

I generated my cylinder within a program called Rhino. The cylinders were parametrically generated due to the surface having a more complex shape. Unfortunately, Rhino doesn’t really have many options to specify how vertices are exported. I may need to bring my meshes into 3dsMax and export from there to maintain proper vertices positions of each mesh.

I thought about the single BP with a static mesh component as well. I was just hoping I wouldn’t have to manually replace every original static mesh with a new one since there will be hundreds of them.

Have you had success exporting proper rotational values of meshes from Max? Thanks

I am a casual Rhino user, but on the documentation here, it says that if you create elements using blocks in Rhino and export through datasmith exporter you should have instances in UE and not a separate static mesh for each cylinder. Check section “Instancing”

There is a solution to replace all static mesh with your custom blueprint as I mentioned earlier: you need to make a little blueprint / python on visual dataprep script. But it will be easier if rotation are easily accessible.