Connect adjacent pieces only connect pieces with same prefix

   367   1   0
User Avatar
Member
33 posts
Joined: Nov. 2022
Offline
Hi,

I would like to know how to get the connect adjacent pieces to only intra-connect pieces and don't generate connections between areas like windows, frames etc. I want to generate them myself. How can I do that?

They have different names, should be doable somehow.
Edited by D4uerrenner - Aug. 5, 2026 08:37:21
User Avatar
Member
5314 posts
Joined: Feb. 2012
Offline
Hi,

You can do it like this in VEX for a string based piece attribute (Point Wrangle):

int maxprims = chi("maxprims");
int pts [ ] = pcfind ( 0, "P", @P, ch("r"), chi("maxpts") );

string attribname = chs("connectattribute");

int nprims = 0;
foreach ( int pt; pts )
{
    if ( nprims >= maxprims )
        break;
        
    if ( @ptnum < pt )
    {
        string nearattrib = point ( 0, attribname, pt );
        if ( ( s@currentattrib != nearattrib ) == !chi("invertconnect") )
        {
            int pr = addprim ( geoself ( ), "polyline" );
            addvertex ( 0, pr, @ptnum );
            addvertex ( 0, pr, pt );
            ++nprims;
        }
    }
}
Senior FX TD @ Industrial Light & Magic
Get to the NEXT level in Houdini & VEX with Pragmatic VEX! [www.pragmatic-vfx.com] https://lnk.bio/animatrix [lnk.bio]
  • Quick Links