I have created a BP that populates instanced meshes along a spline - at specific spline points.
What I can’t work out is how to program a ‘spacing’ function so that a variable can control how many instances actually appear - allowing for regular gaps along the spline.
Use case - adding points to the spline creates the poles. This is as desired.
The little raccoon signs are a second mesh using duplicates of the same nodes - what I want to be able to do is change the racoon frequency to be every other post or every third or forth post or whatever…
Here is the relevant part of my BP - there is a variable to enable a twist on the posters - but I just can’t work out how to affect the number/spacing of them while still keeping the ones that do appear at the exact points of the spline.
The Mod(%) operator checks the remainder of the division, so if you use 2, it means that every two indexes the remainder will be 0, so you know when you should spawn or not. If you change it to 1, it means it will always will spawn the top board.
Additional notes:
I advise adding a value range to the variable so it can only be set to greater or equal to 1.
Usually this is called Phase instead of Frequency.
You can create another variable and use it as an offset by adding it to the Phase before the Mod operation.
Another question please - how would I go about keeping all of the above - but instead of one mesh being populated, it was an array in sequential order…?
Hi - just bumping this thread to see if anyone can help with my last question…
Given the work already there in the blueprint to create meshes only at points and with the spacing function kindly already provided, how can I get the meshes to be an array applied in sequential order?
Thanks for the above - the issue I have is that it only works properly when you have the right number of meshes, points on the spline and spawn frequency set that compliment each other… results vary wildly as any of those change…
Examples with 11 points on spline and four meshes in the array:
No apologies necessary! I appreciate your help. Thanks again!
I have combined with my previous setup and have a kind of functional tool.
When I took these nodes and put them AFTER my existing stuff, the mesh repetition weirdness reoccurs. Probably something to do with the exec/loop order in play you identified in your last post happening with the For Loops in my other parts. My quick solve was to put your part BEFORE everything else and it seems to work.
Now, the full BP works but is very slow. Moving and adding points on the spline is agonising. Your BP in isolation is not bad. My BP in isolation is not bad. When combined it is artificially/outrageously sluggish.
Next steps for me include trying to work out how to speed it up…
Maybe I can streamline the full BP and reduce repeated nodes or something. I’m assuming the simpler the BP, the quicker it would be…
Will also experiment with editing the spline with all the meshes for the boards cleared and then adding them into the array after the points are placed.
I now have a responsive* and easy-to-use tool to help me and my colleagues lay out crowd barriers within our designs, using a spline to draw the queues.
Spline points create position for the posts (yellow)
Belts automagically connect between all posts (blue)
Toppers are added with a control for spacing and separate control to twist them (green)
The brackets that hold the toppers appear with the toppers but do not rotate, always sitting correctly on top of the posts (red)
Thanks again to 3dRaven and Kokku_RafaelDias for your help!
*For reference, when combining the various BPs, overuse of For Loop nodes was slowing everything down, making it sluggish to use. By removing a single redundant For Loop node and using outputs from an earlier one in the script, everything sped up like 100x!