Jump to content

bobtiki

Clone random objects from set

Recommended Posts

I'm making several shelving units, and my goal is to fill each shelf with a random selection of models of video media (DVD, Blu-ray, VHS). Would you have suggestions as to the best way to go about this?

 

Each media type is a different width, and I would want them spine toward the front, and aligned to the back of the shelf. There is a notch in the shelf so that some of the media can be tilted back with the face out (see my sketch, attached). My initial thought is to create each model with the origin at the back left, and just save a different model for each of the face orientations.

 

Is there a way to randomly fill the shelf with these models, accounting for the width of each model, so that the next random model sits right next to the previous one? I'm thinking something with particles or in the mograph module, but I'm relatively new to C4D, so I'm not very familiar with those yet. Or would this work better as a Python script? I'm familiar with Python, so I'm sure I could figure that out, but I suspected there might be an easier way to try first.

 

Thanks for any suggestions on how to tackle this!

MB

sketch-shelf-media-fill.jpg

Share this post


Link to post
Share on other sites

Some python ideas -

 

this file makes random width cubes to simulate your objects (various sizes)

 

start.c4d

 

then I iterated through the list, placing objects at

current x = prev obj x + 0.5 * prev width + 0.5 * current width

 

end.c4d

 

 

  • Like 1

Share this post


Link to post
Share on other sites

Expresso would be a neat way to do this, but I don't know it.

 

I've done similar thing with liquor bottles to get randomized groupings along a shelf using Cloners inside Cloners, but it's only useful for equal numbers of bottles in each set. Might work since I don't know your shelf dimensions.

 

However, if your shelf spaces are different lengths, I might consider just making spline segments to fit each space, connect them all into one spline, then place all the DVDs into a Cloner set to Object and target the spline then fiddle with the Cloner settings until things fit.

  • Like 1

Share this post


Link to post
Share on other sites
  • Topic Author
  • 20 hours ago, jed said:

    Some python ideas -

    That gives me a good start, thanks Jed! I was kind of envisioning keeping the original media case models in an exterior file, but I'll figure that out later. I can at least use this to start working on randomizing, placing them, and calculating the length to fit each shelf.

     

    20 hours ago, Vizn said:

    …then fiddle with the Cloner settings until things fit.

    Thanks, Vizn. That seems like a bit more manual fiddling than I'd like to do, seeing as how I have over 3,000 shelves to fill. I do appreciate the answer, though!

    Share this post


    Link to post
    Share on other sites

    Create an account or sign in to comment

    You need to be a member in order to leave a comment

    Create an account

    Sign up for a new account in our community. It's easy!

    Register a new account

    Sign in

    Already have an account? Sign in here.

    Sign In Now

    • Recently Browsing   0 members

      No registered users viewing this page.

    ×