Implementing building columns that reflect displacement according to force using Unreal Engine

I created a pillar with python in Unreal Engine.
I wrote a code that prints the size of the selected pillar to the log using python code.

By entering the force value and point of application to be applied, I want to create the effect of the pillar bending accordingly. Although various attempts were made, it was not possible to determine the location to apply the force or implement the deformation of the pillar in Unreal. I’m curious what steps should be taken to solve this problem. Or, I want to know how to implement the code.

Ultimately, the goal is to create a structural analysis program that can check values ​​in Unreal Engine.

Oh it all depends what you want exactly.

Fundamental choice for your project:

  • python. IT most likely has ready to use libraries that you would need to do simulation
  • C++ in unreal. Maybe you can find libraries in C++ but they will need some coding to fit unreal way.

So it is flexible and slow in python, or interactive in C++ but not so flexible (From engineer point of view, as they are used to python)

Next question is:
Is this commercial app or in house app? For commercial app i would do C++ plugin, that interfaces python code. Then next plugin/project that adds editor interface to work with and prepare simulation. But for this you need some good developer that knows SLATE (and those are rare breed).

So TLDR:
All depends on scope and target for this project. And time/resources you have.

edit:
Not sure if this can be coded (needs deep knowledge about FBX format, animation and bones):
You could create FBX file for your mesh in python, and create bones/animations for bending.
In this case unreal would be just rendering engine.

edit2:
Blender has open format for meshes (so you get documentation, and maybe there are some scripts that can create such mesh, so you can see how to make bones and animations for blender format)

Thank you. The answer was based on deep knowledge!
We want to show structural analysis results more realistically to clients than to commercial use.
The results of structural analysis programs (e.g., MidasGen, SAP2000, etc.) may be unfamiliar to people who are not familiar with the structural field. So, for example, I would like to calculate the amount of deformation that occurs when a force of 1000N is input in Unreal Engine and show the tilt of the column. To implement this interface, I found a structural analysis algorithm library in Python.
I wonder if I can use this library by applying it as code to Unreal Engine.
It doesn’t matter if the column behaves as a rigid body. Structural analysis programs also interpolate the central area by deforming nodes.

Ah so since you calculate all in python, and unreal is just render engine.

Unreal has python script that you can use to import, export and generally as tools for data. Look into DataSmith. And python scripting tools in unreal.

There are also editor tools done in blueprints. So you could do editor gui in blueprints that runs scripts in python. And that script may be your simulation library.

However there is one more thing to do: exporting results from simulation into format that can be read by unreal.

1 Like