Jump to content
Sign in to follow this  
JJ FX

Subdivision - transfer edge groups

Recommended Posts

Hi, 

How would you transfer edge groups using subdivision? I can't figure it out... 

Share this post


Link to post
Share on other sites

So here's the solution:

before subdiv > uvflatten (using the edge group) > subdivide > splituvseams > group (edge, unshared edges)


image.png.d483f94ee30fc5823bfa5885adb23f6d.png

  • Like 1

Share this post


Link to post
Share on other sites

Hi,

You can update your edge groups automatically using VEX (Detail Wrangle), but you will pay performance penalty for very high res geometry that has very large edge groups:

string edgegroups [ ] = split ( chs("edgegroups"), " " );
foreach ( string edgegroup; edgegroups )
{
    int pts [ ] = expandedgegroup ( 1, edgegroup );
    int count = len ( pts );
    for ( int i = 0; i < count; i += 2 )
    {
        int pt0 = pts [ i ];
        int pt1 = pts [ i + 1 ];
        
        int pts0 [ ] = neighbours ( 0, pt0 );
        int pts1 [ ] = neighbours ( 0, pt1 );
        
        int sharedpt = -1;
        foreach ( int pt; pts0 )
        {
            if ( find ( pts1, pt ) >= 0 )
            {
                sharedpt = pt;
                break;
            }
        }
        
        if ( sharedpt != -1 )
        {
            setedgegroup ( 0, edgegroup, pt0, sharedpt, 1 );
            setedgegroup ( 0, edgegroup, pt1, sharedpt, 1 );
        }
    }
}

 

Edge group expression:

`edgegrouplist(-1)`

 

image.thumb.png.0a0066ce5c2cb03ad786aabbb51e367b.png

image.thumb.png.5a6deec5624c87110bac730bc40fd1ce.png

 

If you need multiple levels of subdivision, you need to encapsulate the Subdivide and Attribute Wrangle inside a For Each Loop network, as the edges have to be updated at each subdivision.

Alternatively you can change the VEX code to walk the edges instead, then it would handle any edge group regardless of the subdivision levels difference between 2 geometries.

  • Like 2

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×