CGTalk > Software > Autodesk 3ds max > 3dsMax SDK and MaxScript
Login register
Thread Closed share thread « Previous Thread | Next Thread »
 
Thread Tools Search this Thread Display Modes
Old 04-10-2013, 01:58 AM   #16
broomy
Potatoe
Dave Broomfield
Halifax, Canada
 
Join Date: May 2006
Posts: 122
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
Code:
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.
 
Old 04-10-2013, 01:23 PM   #17
Kickflipkid687
Art and Music are Life
 
Kickflipkid687's Avatar
portfolio
Matthew Lichy%2B
3D Artist
United%2BStates
 
Join Date: Jan 2005
Posts: 1,640
Send a message via AIM to Kickflipkid687 Send a message via MSN to 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.

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.

Code:
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:

Code:
#([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:
Code:
#(1,2,4,5),#(3)



I think this is correct??
__________________
http://matthewlichy.com

 
Old 04-10-2013, 01:56 PM   #18
denisT
MAX Doctor
 
denisT's Avatar
portfolio
Denis Trofimov
CA, USA
 
Join Date: Jul 2009
Posts: 9,426
Send a message via ICQ to denisT
Quote:
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?
 
Old 04-10-2013, 06:36 PM   #19
Kickflipkid687
Art and Music are Life
 
Kickflipkid687's Avatar
portfolio
Matthew Lichy%2B
3D Artist
United%2BStates
 
Join Date: Jan 2005
Posts: 1,640
Send a message via AIM to Kickflipkid687 Send a message via MSN to 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.
__________________
http://matthewlichy.com

 
Old 04-10-2013, 09:32 PM   #20
denisT
MAX Doctor
 
denisT's Avatar
portfolio
Denis Trofimov
CA, USA
 
Join Date: Jul 2009
Posts: 9,426
Send a message via ICQ to denisT
Quote:
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
 
Old 04-11-2013, 01:31 PM   #21
Kickflipkid687
Art and Music are Life
 
Kickflipkid687's Avatar
portfolio
Matthew Lichy%2B
3D Artist
United%2BStates
 
Join Date: Jan 2005
Posts: 1,640
Send a message via AIM to Kickflipkid687 Send a message via MSN to Kickflipkid687
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.
__________________
http://matthewlichy.com

 
Old 04-11-2013, 04:24 PM   #22
denisT
MAX Doctor
 
denisT's Avatar
portfolio
Denis Trofimov
CA, USA
 
Join Date: Jul 2009
Posts: 9,426
Send a message via ICQ to denisT
Quote:
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?
 
Old 04-13-2013, 10:54 PM   #23
Kickflipkid687
Art and Music are Life
 
Kickflipkid687's Avatar
portfolio
Matthew Lichy%2B
3D Artist
United%2BStates
 
Join Date: Jan 2005
Posts: 1,640
Send a message via AIM to Kickflipkid687 Send a message via MSN to Kickflipkid687
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.

Code:
#(#(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.
__________________
http://matthewlichy.com

 
Old 04-14-2013, 12:00 AM   #24
denisT
MAX Doctor
 
denisT's Avatar
portfolio
Denis Trofimov
CA, USA
 
Join Date: Jul 2009
Posts: 9,426
Send a message via ICQ to denisT
Quote:
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?
 
Old 04-14-2013, 09:08 PM   #25
Kickflipkid687
Art and Music are Life
 
Kickflipkid687's Avatar
portfolio
Matthew Lichy%2B
3D Artist
United%2BStates
 
Join Date: Jan 2005
Posts: 1,640
Send a message via AIM to Kickflipkid687 Send a message via MSN to Kickflipkid687
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.
__________________
http://matthewlichy.com

 
Old 04-14-2013, 09:08 PM   #26
CGTalk Moderation
Lord of the posts
CGTalk Forum Leader
 
Join Date: Sep 2003
Posts: 1,066,481
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


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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:07 AM.


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