Getting uv shells/elements without UVW_unwrap Mod

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
  04 April 2013
Post

i was/am working on an eMesh and with the low poly counts (3k ish) that im dealing with it is not noticeable when i run getShells(), or whatever i eventually called it

My basic code is
Get face 1
faceCount = 1
while faceCountChanged
    verts = convertToVerts
    faces = convertToFaces
    if faces.count == faceCount
        faceCountChanged = false
    faceCount = faces.count
    append shells faces


what tri counts are you dealing with? and try doing a timestamp() at some points to see what exactly is the slow part of your script.
 
  04 April 2013
My current code is about the same as that, following the reference code in the MXS Help.
But using that code on an EPoly Mesh, even a Teapot, in realtime, causes a 0.5-1 second delay.

Well, or at least 0.5 delay. The other 0.4+ is from me using the convert BorderEdges FromFaces EditablePoly method.

Exploring what Dennis said, this code I have I think is getting me there. Or giving me an idea.


vertArrs = #()
faces = ($.mesh.faces as BitArray)

for i = 1 to (faces as array).count do 
(
	verts = meshop.getMapFace $.mesh 1 i 
	append vertArrs #(verts,i)
)


Which then returns, on my plane mesh, something like:


#([3,4,1], 1)
#([1,2,3], 2)
#([5,6,7], 3)
#([4,3,8], 4)
#([8,9,4], 5)


So, I think I need to sort those somehow, to see if any of the arrays contain the same map verts.
So Face 1, it has a shared Vert (4), in Face 5, which is correct, according to my mesh.

So from that I could then group those into seperate Arrays, or Element Arrays. So it should be something like:

Faces Groups:
#(1,2,4,5),#(3)



I think this is correct??
 
  04 April 2013
Originally Posted by Kickflipkid687: My current code is about the same as that, following the reference code in the MXS Help.
But using that code on an EPoly Mesh, even a Teapot, in realtime, causes a 0.5-1 second delay.

i don't understand... do you need it for Editable_Poly?
 
  04 April 2013
Yes, since most people, including myself like to model in EditablePoly, because the tools are better/quicker to use. Also other internal max tools only work on EditablePoly I believe.

So i need to evaluate on the Mesh level, but allow EditablePoly. Basically how other XView options work, as this is where it's being used.
 
  04 April 2013
Originally Posted by Kickflipkid687: Yes, since most people, including myself like to model in EditablePoly, because the tools are better/quicker to use. Also other internal max tools only work on EditablePoly I believe.

So i need to evaluate on the Mesh level, but allow EditablePoly. Basically how other XView options work, as this is where it's being used.


well... for Editable_Poly it's actually much faster than for Editable_Mesh...
there is another hint... to get all map seam edges you need only two polyop functions - getmapface and getfaceedges
 
  04 April 2013
Thanks for that.

So, was I right though, in that I should be doing some sort of compare FN /Sort against those mapVerts? That's the best way I can think to do it right now.
 
  04 April 2013
Originally Posted by Kickflipkid687: So, was I right though, in that I should be doing some sort of compare FN /Sort against those mapVerts? That's the best way I can think to do it right now.

another hint... if we don't have such thing as map edge, what might be the best implementation of it? what does an edge make?
 
  04 April 2013
Well verts would make an edge, or we need verts to make an edge.

I wish I could figure this out, but I'm not sure I can. I'm pretty much stuck at the beginning yet.

Like I said before, the only thing I can think of, is to compare/sort the faces based on MapVerts. To see if faces share map verts, then group into arrays/elements.


#(#(9, 10, 11, 12), 1)

#(#(1, 2, 5, 6), 2)
#(#(2, 3, 6, 7), 3)
#(#(3, 4, 7, 8), 4)
#(#(1, 4, 5, 8), 5)


As I showed before, the 1st value here, Face 1, clearly has seperate map Verts from the other Faces. But the rest of them, 2-5 in this example, share map verts in 1 way or another.
 
  04 April 2013
Originally Posted by Kickflipkid687: Well verts would make an edge, or we need verts to make an edge.

sure! you are so close. the edge is [v1,v2] !!! or [v2,v1]... but is it really different?
 
  04 April 2013
Well when creating an edge, it doesn't matter the vert order I don't think, only if you want to create a face properly..... So the face isn't turned on 1 end or inverted.
 
  04 April 2013
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 02:29 AM.


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