Search - User list
Full Version: Connect adjacent pieces only connect pieces with same prefix
Root » Houdini Indie and Apprentice » Connect adjacent pieces only connect pieces with same prefix
D4uerrenner
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.
animatrix_
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;
        }
    }
}
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.