display uv map border

Become a member of the CGSociety

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

THREAD CLOSED
 
Thread Tools Search this Thread Display Modes
Old 10 October 2010   #1
display uv map border

trying to find out a way to ALWAYS get just the uv border edges for an object. obviously:

PolySelectConvert 4;
polySelectBorderShell 1;
PolySelectConvert 20;


works most of the time, but if two edges share uv's it'll also select the edge in the middle. also tried finding the shortest distance between uv's, but `ls -sl -fl` returns them in numerical order not in an order around the border, which also occasionally messes things up.

was looking for how maya displays the map border edges in the viewport with polyOptions -displayMapBorder somewhere in the API but couldn't find it. any idea where i can get access to that data?
__________________
http://www.jacobschieck.com
 
Old 10 October 2010   #2
Quote: PolySelectConvert 4;
polySelectBorderShell 1;
PolySelectConvert 20;
Thats a really tough problem you got there!
I tryed a few approaches but it all didn't yield a rock solid solution. I'm curious if someone else has some ideas.

First I didn't know what you mean with "if two edges share uv's". Then I realised you mean at a 1 edge wide area. When 2 border UVs are connected through an edge that is not at the border.

But what do you need the edges for anyway? Edges are 3D data. UVs are 2D.
__________________
goodsoul.de
 
Old 10 October 2010   #3
yea at first I was thinking, "man this will be simple!" but then it turned into many failed approaches because of low poly game models having many areas that are 1 edge wide.

trying to simply grab all the seams and harden edges for baking normal maps right now, but it's bugged me for awhile.
__________________
http://www.jacobschieck.com
 
Old 10 October 2010   #4
I think this will do the trick, taken from one of my scripts:


 {	
 	string $currSelected[] = `ls -sl -o`;
 	string $temp[] = `ls ($currSelected[0]+".map[*]")`;
 	select $temp;
 	
 	
 	polySelectBorderShell 1;
 	PolySelectConvert 20;
 	
 	string $potentialEdges[]=`filterExpand -ex 1 -sm 32`;
 	
 	string $removedEdges[];
 	
 	for($eachEdge in $potentialEdges)
 	{
 		string $uvs[] =`polyListComponentConversion -fe -tuv $eachEdge`;
 		$uvs = `ls -fl $uvs`;
 		if(size($uvs)<=2)
 			$removedEdges[size($removedEdges)] = $eachEdge;
 	}
 	select -d $removedEdges;
 
 }
 
 
 
Old 10 October 2010   #5
oooo very nice man!
__________________
http://www.jacobschieck.com
 
Old 10 October 2010   #6
so you assume that if the converted UVs from each edge are <= 2 it would have to be a false one?

hmm I'm afraid no. that doesn't do it :/
the mystery keeps unsolved
__________________
goodsoul.de
 
Old 10 October 2010   #7
works fine for me in the tests that I've done so far. what kind of case wouldn't it work with?
__________________
http://www.jacobschieck.com
 
Old 10 October 2010   #8
At first I actually had the opposite problem: I couldn't find a case where it would work! But now I did it again with a proper mapped 3D Model and I have to say: Yes! this is quite feasible at a closed mesh: If every edge on the mesh shares 2 faces a UV-border edge MUST have 4 UVs.

But just create a plane (any divisions), run the script: everything is deselected. Or create a bridge 1 edge wide at any model...

But this brings me to the simple idea: We just have to substract the 3D border edges from the ones we would want to deselect!

I've set this up freshly and seems it solves all my cases as well:
{
	string $sel[] = `ls -sl`;

	// find 3d borders edges:
	select `polyListComponentConversion -te`;
	polySelectConstraint -type 0x8000 -m 2 -w 1;
	polySelectConstraint -m 0 -w 0;
	string $borderEdges[] = `ls -fl -sl`;

	// get border uvs :
	select `polyListComponentConversion -tuv $sel`;
	polySelectBorderShell 1;

	// get edges and find enclosed ones
	string $edges[] = ls("-fl",`polyListComponentConversion -in -fuv -te`);
	string $deselEdges[];
	int $num;
	for ($edge in $edges)
		if (size(ls("-fl",`polyListComponentConversion -fe -tuv $edge`)) == 2)
			$deselEdges[$num++] = $edge;

	// now subtract the 3d border edges from the found ones
	$deselEdges = stringArrayRemove($borderEdges,$deselEdges);
	$edges = stringArrayRemove($deselEdges,$edges);

	select $edges;
}


but on another topic: You just posted the snipped from r4inm4ker completely unchanged and technically uncommented over at your blog. Ok.. I mean you probably publish your stuff as well freely. Thats cool. But wouldn't a 'via' link or mentioning be nice?
I'm not the software patent guy. And its just a snippet. But it doesn't hurt to tell where you gut stuff from. .. but ok I don't know if you asked him already ;]
__________________
goodsoul.de
 
Old 10 October 2010   #9
ah i see the the problem u were having. good stuff. by no means did i mean to steal it, just thought i'd share it. i'll throw up a link to the thread haha :P
__________________
http://www.jacobschieck.com
 
Old 10 October 2010   #10
Originally Posted by ewerybody: At first I actually had the opposite problem: I couldn't find a case where it would work! But now I did it again with a proper mapped 3D Model and I have to say: Yes! this is quite feasible at a closed mesh: If every edge on the mesh shares 2 faces a UV-border edge MUST have 4 UVs.

But just create a plane (any divisions), run the script: everything is deselected. Or create a bridge 1 edge wide at any model...


well,actually the purpose of the codes I posted above is to find UV seams (uv borders that are not border edge). To find edge borders, I used this:


polySelectConstraint -mode 3 -type 0x8000 -where 1;
string $selectedEdge[] = `ls -sl`;
 polySelectConstraint -disable;


Originally Posted by jschieck: ah i see the the problem u were having. good stuff. by no means did i mean to steal it, just thought i'd share it. i'll throw up a link to the thread haha :P


A link to this thread is enough, I guess .
 
Old 10 October 2010   #11
Thread automatically closed

This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.
__________________
CGTalk Policy/Legalities
Note that as CGTalk Members, you agree to the terms and conditions of using this website.
 
Thread Closed 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 05:11 AM.


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