Announcement

Collapse
No announcement yet.

Flip face script ?

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Flip face script ?

    Heya

    I'm in a bit of a trouble. Got tight deadline and my scripting skilz in max got rusty (im doing python for maya now ;/ )

    In any case I have 200 objects I have in to go in to each of them, select edit poly>select all face> flip normal > finish.

    Gotta do it this 1 by 1...

    Does any1 know any script that could do it for me maybe ?

    I would be eternally grateful...

    THANKS!!!
    CGI - Freelancer - Available for work

    www.dariuszmakowski.com - come and look

  • #2
    Why not select them all, stick on a normal modifier set to flip normals, then collapse them all?

    Comment


    • #3
      Wish that would work but it dont.

      Its CAD data from manufacturer and they got loads of normals "tricks". So the only way to reverse normals so I can render them is to go to each object and edit it on polygon level. Global flipping don't work or it break the smoothness and all goes to hell.

      Thanks, bye.
      CGI - Freelancer - Available for work

      www.dariuszmakowski.com - come and look

      Comment


      • #4
        No error checking at all so make sure all your objects are e polys!

        Code:
        theArray = selection as array
        
        max modify mode
        
        for i = 1 to theArray.count do
        (
        select theArray[i]
        subObjectLevel = 4
        polyop.SetFaceSelection $  #{1..(getnumfaces $)}
        polyop.flipNormals $  #{1..(getnumfaces $)}
        subObjectLevel = 0
        )

        Comment


        • #5
          You are epic! Thanks!!!!
          CGI - Freelancer - Available for work

          www.dariuszmakowski.com - come and look

          Comment


          • #6
            All good geezer.

            Comment


            • #7
              Not sure what that is supposed to do.
              I just made a f*%#ed up model manually like one might get from someone else, and ran the script, and it only flips them all, like a global reverse normal.
              Signing out,
              Christian

              Comment


              • #8
                No idea to be honest but Dadal's got geometry giving him lots of problems. Working with Cad models is a hell I've yet to visit.

                Comment


                • #9
                  Cad models data that I get is not merged -or partially merged (verticles). So you cant put a smooth on it to smooth normals. U cant put TS/MS to smooth it either.

                  With model like that you have to keep existing normals or else u doomed. Usually with cars half of the car is flipped or at least some parts are. If they are flipped maya cant render them. I cant unlock normals and reverse them in maya because it break smoothness. I cant apply modifier from max (normal one )because it will not work. Only way to fix them is to go to face mode and fix it there

                  Its pain but its the only way I know of... unless I use Vred.
                  CGI - Freelancer - Available for work

                  www.dariuszmakowski.com - come and look

                  Comment


                  • #10
                    This used to be a really very common issue for me when most of my architect clients were supplying models made in Autocad, so DXF for example, or solidworks or something like that, and the normals would just be all kinds of messed up. Impossible to deal with. But these days most practices have moved over to Revit or at the very least, Sketchup, and they are much, much better at dealing with this. And ultimately it comes down to the people modeling knowing how to keep their models clean and unified, which comes with time.

                    For the time being, one good method, still manual but better than nothing, is to enable Normal view in XView in the viewport. This will display all flipped normals as bright green, so you can quickly select them and flip them. Last i checked, in 2012, you could NOT use the XView selection tool to select based on the results of this. Which is a HUGE shame. I don't know why it's so hard, actually... maybe some hacky method using the display buffer might be in order.... I hope someone brainy could make a plugin/script that would expand on this and make it work! "Select all Xview results that are bright green - Flip - DONE".
                    Alex York
                    Founder of Atelier York - Bespoke Architectural Visualisation
                    www.atelieryork.co.uk

                    Comment


                    • #11
                      Heya

                      Yea I know that xview but in max 2013 its even worse!!! Instead of bright green you get just light grey which is hard to notice + u have to select all models 1st to display it... very bad

                      Maya has a lot more problems with normals too. If I use default viewport some normals are flipped, if I use 2.0 other ones are flipped... Its so messy
                      CGI - Freelancer - Available for work

                      www.dariuszmakowski.com - come and look

                      Comment


                      • #12
                        Well Revit sends nice models into max, even through regular export (not using the new "send to" function), but Sketchup still has issues. Mostly it comes down to the users, but models from Sketchup are best left alone after import, where you only do shader stuff on them, so if you need to remodel\fix stuff you will see there are issues with normals. Apart from regular flipped faces, there are issues with the vertex-normals being locked. This is apparent when trying to manually flip faces that seem reversed, but resulting in what looks like something reversed with weird smoothing artifacts along the border. I usually start by converting to poly, add an edit normals, select all normals and hit reset. After that one needs to recreate all prior smoothing groups. As 99% of all the models I get are buildings etc., smoothing groups are no big issue. Setting it back to mesh when done, and running a auto-visibility on the edges to reduce screen clutter.
                        Signing out,
                        Christian

                        Comment

                        Working...
                        X