Search - User list
Full Version: distribute obj across a surface.
Root » Technical Discussion » distribute obj across a surface.
metaclay
1. hi, i'm using copy node, i want to place/distribute object to a grid surface. Ussually i pipe both the grid(template) and the object, with this step, i'll have my object distributed at every single point exist on grid surface. But this time i want the object to be placed not at the point position , but rather i want it to be in the center of every prim of my grid (center of every single square of the grid). How can i do that? btw the surface is a grid, but it could be any surface, so the pieces not always a square. I need a way to access the centroid the pieces and pipe it as the template.

2. similar to no.1, but this time i want to copy/distributed a single object contain multiple prim group onto a grid surface. I don't want to distribute a whole object as single entity, so i want to place every my prim group spread across the grid. I think i need to get the group id ..? ( like $PT or $PR , but i couldn't find a way to get the local variable for prim group) , or extracting the id from group's name?? Any idea?
In this case , i create a shattered obj. every pieces have a group name/id. So i want to use ‘copy’ to distribute every single pieces to be distributed on a surface template(grid). Also do the number of point in grid has to be the same with total number of the pieces?


3. How to get $PT or $PR using python? I read the documentation, but havent' found it.

thanx
dinkleberry
I had to do something similar to #1 recently, and have attached a file with one way to do it. There might be a simpler way.

Can't help you much with #2 but I think the foreach SOP could be very helpful there too.

#3 - The hou.lvar(“…”) function gives you local variable values, e.g. lvar(“PT”) and lvar(“PR”). (You don't need the “hou.” prefix in parameter expressions
metaclay
dinkleberry
I had to do something similar to #1 recently, and have attached a file with one way to do it. There might be a simpler way.

Can't help you much with #2 but I think the foreach SOP could be very helpful there too.

#3 - The hou.lvar(“…”) function gives you local variable values, e.g. lvar(“PT”) and lvar(“PR”). (You don't need the “hou.” prefix in parameter expressions

Hi Dinkleberry, thanx a lot for the sample file. That's exactly what i'm looking for. Great !

thanx
fsimerey
Another method with only 3 nodes much faster than with a FOREACH SOP.

1. FACET with ‘Unique Points’
2. PRIMITIVE with a ‘Scale’ of 0, 0, 0
3. FUSE with unchecked ‘Remove Degenerate’

I put a switch to test the 2 solutions.

Change the row/col of the grid and you can see, it is much faster with these 3 nodes.
metaclay
fsimerey
Another method with only 3 nodes much faster than with a FOREACH SOP.

1. FACET with ‘Unique Points’
2. PRIMITIVE with a ‘Scale’ of 0, 0, 0
3. FUSE with unchecked ‘Remove Degenerate’

I put a switch to test the 2 solutions.

Change the row/col of the grid and you can see, it is much faster with these 3 nodes.

Great! that's a good workflow. I tested it… it shows a quite big different in processing time. COOL.
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Powered by DjangoBB