Uv's to Flat Mesh

Become a member of the CGSociety

Connect, Share, and Learn with our Large Growing CG Art Community. It's Free!

 
Thread Tools Search this Thread Display Modes
  2 Weeks Ago
Uv's to Flat Mesh

Hi forum,

I don't know if I'm imagining it but I remember I saw something very recently released on the forum that would convert Uv's to a flat mesh object. There is a similar function in SouP but wondering and looking for something easier.

Is there an easy way to get a flat mesh object based on UVs?

Thanks.
__________________
..je suis -L -S -D!
 
  1 Week Ago
Select all your uv seams and detach component, then transfer attributes (vertex position) to a flat plane with sampling space set to UV.

I can post some screenshots if needed.
 
  5 Days Ago
Originally Posted by pollos: Select all your uv seams and detach component, then transfer attributes (vertex position) to a flat plane with sampling space set to UV.

I can post some screenshots if needed.

Thank you.
I'll give this a go on my own and see if I can get it working first, seems pretty straight forward.

Thanks again.
__________________
..je suis -L -S -D!
 
  5 Days Ago
or use mudbox....
or this script...

{
    string $selection[] = `ls -sl`;
    
    int $numVert[];
    int $numUVs[];
    string $vert[];
    float $uv[];
    float $v;
    float $u;
    string $temp[];
    string $flat;
    string $orig;
    string $blendShape;
    string $BSN;
    if (size($selection) > 0)
    {
        for ($s in $selection)
        {
             $s = `match "[^|]*$" $s`;
            $temp = `ls $s`;
            if (size($temp) == 1)
            {
                int $isCut = 0;
                $numVert = `polyEvaluate -vertex $s`;
                $numUVs = `polyEvaluate -uv $s`;
                $temp = `duplicate -n ($s+"_orig") $s`;
                $orig = $temp[0];
                print $numVert;
                print "\n";
                print $numUVs;
                if ($numVert[0] < $numUVs[0]) 
                {
                    polySplitEdge -ch 0 ($orig+".e[*]");                    
                    $isCut = 1;   
                    $numVert = `polyEvaluate -vertex $orig`;
                    $numUVs = `polyEvaluate -uv $orig`;
                }
    
                $temp = `duplicate -n ($s+"_flat" )$orig`;
                $flat = $temp[0];
                $temp = `duplicate -n ($s+"_bs" )$orig`;
                $blendShape = $temp[0];
                print $s;
                for($i = 0; $i < $numUVs[0]; $i++)
                {
                    $vert = `polyListComponentConversion -fuv -tv ($flat+".map["+$i+"]")`;
                    $uv = `polyEditUV -q ($flat+".map["+$i+"]")`;
                    $u = $uv[0];
                    $v = $uv[1] * -1;
                    for ($vtx in $vert) move -absolute -worldSpace $u 0 $v $vtx;
                }
                
                // scale according to 3d data;
                string $vert1[] = `polyListComponentConversion -fe -tv ($orig+".e[0]")`;
                $vert1 = `ls -fl $vert1`;
                string $vert2[] = `polyListComponentConversion -fe -tv ($flat+".e[0]")`;
                $vert2 = `ls -fl $vert2`;
                vector $v10 = `xform -q -ws -t $vert1[0]`;
                vector $v11 = `xform -q -ws -t $vert1[1]`;
                float $length1 = `mag ($v10 - $v11)`;
                vector $v20 = `xform -q -ws -t $vert2[0]`;
                vector $v21 = `xform -q -ws -t $vert2[1]`;
                float $length2 = `mag ($v20 - $v21)`;
                float $factor = $length1 / $length2;
                scale -pivot 0 0 0 $factor $factor $factor ($flat+".vtx[*]");
                
                
                
                addAttr -k 1 -dv 1 -min 0 -max 1 -ln "flatten" $blendShape;
                $temp = `blendShape -n ("BSN_"+$s+"_flat") $flat $blendShape`;
                $BSN = $temp[0];
                connectAttr ($blendShape+".flatten") ($BSN+".weight[0]");
                delete $orig;
                delete $flat;
                
                // make Cut mesh nice
                if ($isCut)
                {
                    $blendShape = `rename $blendShape "soonGone"`;
                    $temp = `duplicate -n ($s+"_flat") $blendShape`;
                    $flat = $temp[0];
                    $temp = `listRelatives -shapes $flat`;
                    for ($sh in $temp)
                    {
                        if (`getAttr ($sh+".intermediateObject")`) delete $sh;
                    }
                    polyMergeVertex  -d 0.0001 -ch 0 $flat;  
                    select -r $flat $blendShape;
                    string $wrap = `CreateWrap`;
                                   
                    setAttr ($blendShape+".flatten") 0;
                    $temp = `duplicate -n ($s+"_orig") $flat`;
                    $orig = $temp[0];
                    delete $blendShape;
                    $temp = `duplicate -n ($s+"_flattened") $orig`;
                    $blendShape = $temp[0];
                    
                    $temp = `blendShape -n ("BSN_"+$s+"_flat") $flat $blendShape`;
                    $BSN = $temp[0];
                    connectAttr ($blendShape+".flatten") ($BSN+".weight[0]");
                    delete $orig;
                    delete $flat;
                }
            }
            else confirmDialog -title "Warning" -message ("Multiple objects called \""+$s+"\" found.\nPlease give objects unique names!") -button "Ok";
        }
    }
    else error ("nothing selected");
}
__________________
ArtStation
 
reply share thread



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
CGSociety
Society of Digital Artists
www.cgsociety.org

Powered by vBulletin
Copyright ©2000 - 2006,
Jelsoft Enterprises Ltd.
Minimize Ads
Forum Jump
Miscellaneous

All times are GMT. The time now is 06:21 PM.


Powered by vBulletin
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.