Generate books on each row of a bookshelf using PCG

I’m new to Unreal Engine but I have a dev background.

I can’t find any resources that matches my question so hopefully someone can point me in the right direction. Most Youtube videos I saw regarding PCG are mostly for landscaping i.e adding trees, vines, grass.

So far I have been able to looks for my bookshelf mesh and get points from it.

I have my graph setup like:

([Mesh sampler] | [Get actor data]) → [Copy points]

Next, I think the plan would be to get points where books should spawn.

Now if I was in another language, my steps would probably be:

  • Get only points where books would stand up. Not sideways.
  • Constrain min/max height so no books would spawn on top and bottom of shelf.
  • On each row, generate books on leftmost point to rightmost point.

What nodes will I need to achieve this?

You could, within the bookshelf bp, add a spline along the length of the shelf, then (with the book geometry as a separate BP, that sets the material at random from an array of materials in the construction script - therefore on spawn each book will be random) at this point you just spawn that BookBP along the spline with potential variables for distance between each book etc and maybe simulate physics at the end so they drop and fall into place.