Jump to content

Randomly scatter objects from one alembic


prekabreki

Recommended Posts

Hi guys

This is probably super basic, but I have an alembic with multiple objects all, every object has a separate group and they're all sitting at the scene origin.

I was trying to think of a simple way of scattering those objects on a grid for example but I've been having a hard time so far.

 

What's the best way to randomly choose objects from this alembic and copy them to points?

 

 

Link to comment
Share on other sites

The alembic comes into Houdini as packed alembic by default. This is quite handy because let's say you have 50 objects in the alembic it will come in as 50 packed alembics (unless they are in some sort of hierachy).
Each packed alembic is treated as a single point, so to randomly distribute them (copy stamp or for-loop) you could create a point attrib on the template points with a range from 0-49 (let's say we call it id) and blast away based on @ptnum=@id (delete non selected)

 

Link to comment
Share on other sites

Thanks for the help, I've got the attribute created, called it id and based it on $PT.

I'm just not sure how scatter it now randomly, I clearly need to work on my fundamentals as I've been tearing my hair out over this for a couple of hours now.

I've attached a hip file if anyone wants to just spell it out for me...

alembicScatter.hip

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...