Home Technical Talk

3DS Max - Cap hole with polys intact

BraXzy
polycounter lvl 9
Offline / Send Message
BraXzy polycounter lvl 9
I've been looking for how to do this for awhile and never found out so have done this manually but I am hoping there is a way. When capping a hole, in the back of an object for example.. is there a set way to make all of the loops connect? So rather than having a huge N-Gon you instead have a bunch of polys connected to the stuff round the side.

Replies

  • PolyHertz
    Offline / Send Message
    PolyHertz polycount lvl 666
    Here's a script I wrote that'll do what you're asking. It only works in Editable poly mode (never got around to adding Edit_Poly modifier support), but maybe it'll work for you're purposes:
    --ASSUMED: in editable poly mode, with one or more borders selected. Edit_Poly modifiers not supported.
    
    allEdjs = polyop.getEdgeSelection $ as array
    curSubOBJlvl = subobjectLevel
    subobjectLevel = 2
    
    --Find out how many borders their are among the edge selection, and store them each separately.
    allBorders = #()
    allBordersFlat = #()
    curLoop = 1
    for i in allEdjs do
        (
        if ((finditem allBordersFlat i) == 0) do
            (
            $.EditablePoly.SetSelection #Edge ((polyop.getBorderFromEdge $ i) as bitArray)
            allBorders[curLoop] = $.EditablePoly.GetSelection #Edge as array
            join allBordersFlat allBorders[curLoop]
            curLoop += 1
            )
        )
    
    
    curLoop = 1
    while (allBorders.count >= curLoop) do
        (
        --Crawl from the first edge to two adjacent ones, then afterwords do the rest in a loop.
        curVrts = polyop.getVertsUsingEdge $ allBorders[curLoop][1] as array
        curEdjs = polyop.getEdgesUsingVert $ curVrts[1] as array
        buff = polyop.getEdgesUsingVert $ curVrts[2] as array
        join curEdjs buff
    
        keptEdjs = #()
        for i in curEdjs do (if ((finditem allBorders[curLoop] i) != 0 and allBorders[curLoop][1] != i) do (append keptEdjs i))
        $.EditablePoly.SetSelection #Edge (keptEdjs as bitArray) --quick and dirty way to remove duplicates
        keptEdjs = $.EditablePoly.GetSelection #Edge as array
    
    
        --Start loops--
        finalEdjs = #(keptEdjs[1], keptEdjs[2])
        latestEdjs = #(keptEdjs[1], keptEdjs[2])
        loopKill = 0
        for i in allBorders[curLoop] do
            (
            temp = #()
            for k in latestEdjs do
                (
                curVrts = polyop.getVertsUsingEdge $ k as array
                curEdjs = polyop.getEdgesUsingVert $ curVrts[1] as array
                buff = polyop.getEdgesUsingVert $ curVrts[2] as array
                join curEdjs buff
    
                buff = #()
                for i in curEdjs do (if ((finditem allBorders[curLoop] i) != 0 and (finditem latestEdjs i) == 0 and allBorders[curLoop][1] != i) do (append buff i))
                buff = join buff finalEdjs
                $.EditablePoly.SetSelection #Edge (buff as bitArray) --quick and dirty way to remove duplicates
                buff = $.EditablePoly.GetSelection #Edge as array
                
                finalEdjs = (buff as bitArray)
                temp = (buff as bitArray)
                
                if ((finalEdjs as array).count == (allBorders[curLoop].count - 2)) do (loopKill = 1 ; exit;)
                )
            latestEdjs = temp
            if loopKill == 1 do (print "killed" ; exit)
            )
    
        $.EditablePoly.SetSelection #Edge (finalEdjs as bitArray)
        $.EditablePoly.Bridge ()
        curLoop += 1
        )
        
    subobjectLevel = curSubOBJlvl
    
    
  • miauu
    Offline / Send Message
    miauu polycounter lvl 14
    Something like this:

    [ame="http://www.youtube.com/watch?v=qlE8tIm-SIw"]miauu's Quad Cap Holes - YouTube[/ame]

    [ame="http://www.youtube.com/watch?v=VWj_y7rS5vM"]miauu's Quad Cap Holes v. 1.1 - YouTube[/ame]
  • PolyHertz
    Offline / Send Message
    PolyHertz polycount lvl 666
    Ah yes, the one I wrote is basically just for mass bridge-capping on lowpoly models, miauus one is more for highpoly and stuff that's not geometry constrained. Both are useful for different purposes.
  • BraXzy
    Offline / Send Message
    BraXzy polycounter lvl 9
    miauu wrote: »

    Holy crap exactly like that. I'm surprised it isn't a standard feature. Thanks to both of you for the help :)
  • CrazyButcher
    Offline / Send Message
    CrazyButcher polycounter lvl 18
    http://allesimfluss.biz/ also has primarily quad-based hole capping, that allows you to refine interpolation, and surface flow

    teasernew12.png
    teasernew13.png
  • miauu
    Offline / Send Message
    miauu polycounter lvl 14
    http://allesimfluss.biz/ also has primarily quad-based hole capping, that allows you to refine interpolation, and surface flow

    +1
  • onionhead_o
    Offline / Send Message
    onionhead_o polycounter lvl 16
    oh how i wish there was something like this for Maya. I will pay for it for sure. sorry to sabotage this thread.
  • D4V1DC
    Offline / Send Message
    D4V1DC polycounter lvl 18
    teasernew13.png

    So no one notices that triangle at the mid/bottom left side?
    oppsy was i not supposed to mention it. ;) :poly136:
  • Luka
    Offline / Send Message
    Luka polycounter lvl 5
    its not an even sided hole, obviously there will need to be a triangle somewhere, and if it were even sided, it wouldnt be there.

    oppsy, just saying ;)
Sign In or Register to comment.