Heya…
been a while since I actually had time to work on this project (the Project that pays the bill is taking priority…), but I’ll try to answer the best I can.
So, basically, both functions deal with the custom meshes I use for my project, so simply copying what I did is likely gonna lead to more problems than answers…
But I can run you through, so you can adapt:
The first function (get extents) boils down to a “Get Bounds” node, using the static mesh as input.
Then I break the struct and return the box extents.
This is what tells the rest of the system how big the mesh is, so it can calculate how many segments will be added to the spline mesh component.
However, first it needs to know WHAT the input mesh is, and this is where it becomes very specific to your project and the assets you use.
If you only have one mesh for the rope, and no difference between the start/top, the middle and the end/bottom, then all you need is to use the “get bounds” node to grab the extents, set the rope mesh specifically and skip everything else in those two functions.
For my system, however, I have both a rope and a chain.
The rope is the same on each part, but the chain has a unique start, middle and end piece, and both rope and chain are of a different size.
So the first part of the “get extents” reads which material has been set in the BP (rope or chain), then sets that as the reference mesh from which to get the “get bounds”.
The second function deals with the start/middle/end, and is just a series of branches.
It takes in the index of the last element in the rope length, and the current index in the loop from which the function is called.
Then it checks:
is the current index 0, then use the “start” mesh
is the current index same as last index, then use the “end” mesh
anything else, use the middle mesh
That’s all there is to it