procedural handles for scatter SOP points

   3624   10   1
User Avatar
Member
194 posts
Joined: Aug. 2011
Offline
Hi! I want to be able to have handles for the points made by a scatter SOP so that I (or someone else) can tweak the positions of objects which are Copy-SOPed to them.

Can someone please tell me a way to do this procedurally? thanks


12++
User Avatar
Member
194 posts
Joined: Aug. 2011
Offline
Ummm ok, I'll try that, but I don't think it's gonna work. :roll:


12++
User Avatar
Member
390 posts
Joined: Jan. 2012
Offline
for having tons of points i cant really think of a way to make this usable. if youre going to have a more managable number of points, around 20 or so, you could set up a multi parm to control the transforms of a copy sop per copy, but a huge number of points and this would be useless.

its the same for any other system i can think of though. if theres few enough points for you to set up all the parameters by hand, you could just use groups and transforms and opinput() and name the first transorm p0, adn then copy and paste that little set up however many times you needed it, (houdini will up the number by 1 with each copy), and then highlight all of those nodes you just made and drag them into a merge, and then in the parameter editor you could select them all and drag them over quite easily.. but this is really not a very good solution at all.

if i had to do this i would have it not be procedural and use an edit sop. although there probobly is still a way i cant think of
.
User Avatar
Member
194 posts
Joined: Aug. 2011
Offline
It seems like maybe a foreach sop might work, but i have never used it before. I tried to put a transform in a foreach and set it to points and make the handles on the transform persistent….

but it didn't work.

but maybe i just set it up incorrectly.


I want to be able to give houdini an arbitrary 2D shape and have it be populated with trees (and rocks and other stuff, but we'll start with trees).

Then it would be nice to just be able to yank them around to a more precise positioning (if necessary) and have all those transforms be containined in some nice little thing so there aren't edit sops popping up all over the place.

It would also be nice if i could just make handles appear on command and not have to click on a little point to get a handle when what i'm trying to move is a tree in a forest of trees.

if ya'll have any ideas, that would be great. Otherwise I'll suffer little edit sops until i come up with a better idea.



12++

Attachments:
forest--v001.hipnc (72.4 KB)

User Avatar
Member
390 posts
Joined: Jan. 2012
Offline
afaik the foreach wont work because you cant go in and change the transforms one by one like youre thinking. as far as the edit sops go, you can just make one edit sop ahead of time to contain all of the transforms. just make sure it is selected and then do your point moving. then you wont get new ones being created.
.
User Avatar
Member
194 posts
Joined: Aug. 2011
Offline
ok thanks, i'll jus do that.


12++
User Avatar
Member
194 posts
Joined: Aug. 2011
Offline
Ok, I have a new question!

How is a good way to push some of the scattered points away from each other if they are too close (so that copies of the geometry do not collide). Also, ideally I would not want to push any points outside the 2d polygon onto which I am scattering the points.

Thanks.


12++
User Avatar
Member
390 posts
Joined: Jan. 2012
Offline
instead of pushing points you can tell the scatter sop to compute the average of N nearest points, considering 1 point and store that in an attribute, ptarea. then use a delete sop and delete points with a ptarea that is less than half your object size.
.
User Avatar
Member
194 posts
Joined: Aug. 2011
Offline
Yes, that would be considerably easier than what I was thinking. I will play around with that.

What happens when I start adding more scatters for different types of objects like bushes or rocks, though? I wouldnt want any of them to collide.

Thanks for the help on this.


12++
User Avatar
Member
390 posts
Joined: Jan. 2012
Offline
you can merge all of them together into one node. then use pcopen in a vopsop to open that node as a point cloud. you can use the expression `opabsolute/path/to/node to tell houdini to cook that node as the pointcloud. then search for the two closest point and take the second one. then get the distance between that point and the current point. after that its the same as before
.
User Avatar
Member
194 posts
Joined: Aug. 2011
Offline
U, my friend, have been very very helpful. Thank you!

I was thinking I would need to delve into the point cloud universe, soon! Here I go! Pwwsssshhhhh

(thats the sound it makes when you delve into point clouds)


12++
  • Quick Links