Emil Melikov

Emil

About Me

専門知識
Generalist
INDUSTRY
Film/TV

Connect

LOCATION
Azerbaijan
ウェブサイト

Houdini Skills

Availability

Not Specified

Recent Forum Posts

How to procedurally select leaves of a tree? 2026年9月7日1:35

tamte
You can additionaly decide by other factors unique to your leaves and not branches

- Like if your leaves have open boundary but the branches are closed
- Or since all your leaves have exactly 5 polys and 10 boundary points so if none of the branches do you can use that also to distinguish them
- or in case they have uvs and leaves and branches are already in different udim or clearly separated section of UV tile
- or average normal length will be much closer to 1 for flat leaves than for round branches, should be enough difference to find a clear threshold value
...

Essentially find the qualities that you think are the most robust way to distinguish leaf from other geo and you can use that when you run over the connected pieces, ideally consider all the models you want to apply it to potentially come up with a test that works for all if possible

Thank you Tomas for your reply.

Yes, using the point/vertex count seems decent option, so since I know the vertex count on the leaves, I tried to delete based on that but the code does not seem to do anything:

if (primvertexcount(0, @primnum) == 20) {
removeprim(0, @primnum, 1);
}


I managed to select the leaves based on the UVs, just using Select > UV Connected Geometry, no coding needed. But I am curious as an alternative or if I had not the UVs, what was wrong with the code so it didn't do the trick?

How to procedurally select leaves of a tree? 2026年9月7日0:37

Mike_A
How about:
Connectivity SOP to generate a per piece 'class'
Then a Measure SOP to get the leaf area per piece and selecting on the basis of that?

Thanks Mike_A for your reply.

Yes my first attempt was using the Measure SOP to isolate those leaves based on the @area attribute, but along with the leaves, the tiny branches also got included into that threshold making that group unusable.

How to procedurally select leaves of a tree? 2026年9月6日14:11

Hi everyone,

I have a tree model and I want to select its leaves for further applying materials, so I need to separate the leaves from the trunk/branches. The good news is that all leaves are the same shape, have the same point count. Any ideas how to select them?
Thanks.