Jump to content

Randomly select objects for L-system or particles


RickWork

Recommended Posts

Hi

I'm trying to randomly select some objects to plug into an L-system (J input) as leaves.

I thought there was a select SOP or something that I could plug this into but I can't seem to find it.

I have about 10 variations of leaves and I'd like to be randomly used in my L-System. Another area where I need to do this is with particles instances.

TIA

Link to comment
Share on other sites

Hi Rick,

I think I've got it-- you want to use the leaf stamping feature in conjunction with a switch SOP:

1. plug all your leaf geometry variations into a Switch SOP, then plug the switch SOP into the lLSystem, for this example use the "Leaf J Input" on the LSystem SOP.

2. Set your stamping parameter on the switch SOP like this:

param("mystamp",0)%opninputs(".")

This will take the value of the variable called "mystamp" and use it as the input index for your switch SOP. The "%opninputs(".") will make it cycle through the number of leaf variations you have plugged into your switch SOP.

3. In the Lsystem SOP, set up your stamping variable:

--Under the "Funcs" tab, set "Leaf Param A" to mystamp

--In the "Rules" tab, try something like this to help get you started:

--Rule 1: A=!"////////B

--Rule 2: B=&FFFAJ(1,0,i)

-- the stuff in there with J(1,0,i) is the leaf stamping stuff , it will probably need some tweaking before it's working well for you... check the LSystem help page for more info.

Good luck, hope this helps!

-JS-

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