L-system with spring problem

   3393   7   1
User Avatar
Member
32 posts
Joined: Feb. 2007
Offline
Hello,

I want my leaves to fall from my l-system.

So I have a spring that says “Warning: invalid group (lsysJ)”. This is why it is not working

My network i minimized to have a square (polygonal four-point CIRCLE), a TRANSFORM (for scale), the L-SYSTEM with two inputs, j and k so i can have some variation in the leaves, and then spring with group lsysJ and a y-force of -1. for now until i use expressions.

the answer i hope is obvious to you, but i can't get it. I want it to be so i dont pick the leaves for a group individually.

Thank you,

Cory
User Avatar
Staff
2540 posts
Joined: July 2005
Offline
I always put my leaf in to a Group SOP before I wire it in to one of the three leaf inputs. That is the perscribed method to have all your output leaves in a single group. No fussing in the rules.

Now it is easy to separate the leaves from the tree after the L-system SOP.
There's at least one school like the old school!
User Avatar
Member
32 posts
Joined: Feb. 2007
Offline
thanks, i will now try this method since i messed around with visibility sop (which seemed to work)
and i used particles instead of spring to the leaves wouldnt all fall at one time

For further help,

Can anyone tell me how to randomize the leaves a particle system picks from the l-system (it seems which ever leaf is created first drops first, basically lowest point value) or renumber points? any takers?

Thanks
User Avatar
Staff
2540 posts
Joined: July 2005
Offline
Sort SOP!
Random sort the points should do you. Only way when using the Particle SOP.
If you are using POPs, the Source POP also has a random birth from points option.
There's at least one school like the old school!
User Avatar
Member
32 posts
Joined: Feb. 2007
Offline
Thanks, i was messing around and found the sort sop. now how do i have a curve and convert it to one point or a primitive? sorry if these questions are simple
User Avatar
Staff
2540 posts
Joined: July 2005
Offline
The answer is to not pass in your actual leaf geometry.
Instead you pass in a single point generated with the Add SOP with the appropriate Normal and Up Vector attributes.

Add SOP
- Check on Point 0
- Polygons Folder > select By Group

This will give you a single point at 0,0,0 of the object and turn it in to a single primitive.
Without the By Group option, you just have points with no Primitive info. Handy for some things but not here.

Next append a Point SOP to the Add SOP.

Point SOP
- Standard folder > Add Normal > 0, 1, 0
- Particle folder > Add Up Vector > 0, 0, 1


Now feed this in to your Group SOP and then in to one of the three L-systems inputs.

Now after the L-systems, this is where you can either use the Copy SOP to copy your leaves to see them in the view port or even better, use point instancing.

Note: The need for the Point SOP's N normal and Up up vectors is that both the Copy SOP and the point instancing in Mantra use these attributes to properly orient your leaves after the L-system SOP.
You can even tweak the normals and upvectors AFTER the L-system SOP to add some randomness to the orientation. The more you can do before and after the L-system SOP the better. The more you try to pile in to the L-system SOP, the slower it gets especially when you pile on the generations to get the detail. Resist the urge

Resist the temptation to do too much in the Copy SOP. The idea is to use point instancing. For that you can insert a Point SOP between the Lsystem and your Copy and use the Particle folder to add and modify attributes that the Copy SOP uses. See this great post by Jim Price (wolfwood):

http://www.sidefx.com/index.php?option=com_forum&Itemid=172&page=viewtopic&t=6679&highlight=copy [sidefx.com]

Better to set up your leaves around the L-system SOP this way now. You will end up here anyway. Especially if you need to handle millions of leaves.

See the example file. I included Jim's instance VEX operator which is very handy.

Attachments:
leaf_anchor_points.hip (93.6 KB)

There's at least one school like the old school!
User Avatar
Staff
2540 posts
Joined: July 2005
Offline
And another thought. All those attributes used to orient the leaves are most definitely accessible in POPs.
There's at least one school like the old school!
User Avatar
Member
32 posts
Joined: Feb. 2007
Offline
thank you for your reply, i have been up all night so i will test it out once i get some sleep and tell you how it goes

thanks again!
  • Quick Links