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
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

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.


  • Recently Browsing   0 members

    No registered users viewing this page.

YOUTUBE CHANNEL:

ABOUT US:

C4D Cafe is the largest CINEMA 4D community. We provide facilities for discussion, showcasing and learning our favorite software :) Register now to gain access to all of our features. Once registered and logged in, you will be able to create topics, post replies to existing threads, get your own private messenger, post status updates, manage your profile and much more. If you need to find solution to your problem or otherwise ask for help, Cafe is the right place.
×
×
  • Create New...