sketchucation logo sketchucation
    • Login
    ℹ️ Licensed Extensions | FredoBatch, ElevationProfile, FredoSketch, LayOps, MatSim and Pic2Shape will require license from Sept 1st More Info

    Remove duplicate material / separate mesh for each material

    Scheduled Pinned Locked Moved Newbie Forum
    sketchup
    9 Posts 4 Posters 2.6k Views 4 Watching
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • C Offline
      chanz
      last edited by

      Hi. In Sketchup, I made a level I wanted to import into Unity. I made a mistake however and made several components and built the level using components. I finally got everything textured, imported into Unity and lo and behold, the framerate is terrible. I have figured out this is do to the fact that I have:

      A) a number of duplicate materials
      B) I should have a separate mesh for each material

      I want to continue using SketchUp as it is a fantastic way to create things easily.

      For the first question, is there any way to remove the duplicate materials. For example, if I have 5 rooms and they all have the same material for their walls, because of my incorrect way of building them, they have 5 separate materials, one for each room regardless of the fact they use the same texture. Is there any way to remove the duplicates and apply just one to all of them via a script or SketchUp command?

      Secondly, I know other modeling programs have them, but is there a way to create separate meshes from each material. I am not sure if groups/components are the same thing as separate meshes but if so, how would I go about doing this?

      Thank you.

      1 Reply Last reply Reply Quote 0
      • Rich O BrienR Offline
        Rich O Brien Moderator
        last edited by

        Hi Dan,

        What format are you exporting to? FBX?

        Download the free D'oh Book for SketchUp πŸ“–

        1 Reply Last reply Reply Quote 0
        • GaieusG Offline
          Gaieus
          last edited by

          Hi Dan,

          This plugins will group your meshes by material: http://www.smustard.com/script/GroupByTexture

          I am not sure if you need to explode all your existing groups/components though but if you do, here is another plugin that can do it in a single operation: http://www.smustard.com/script/Bomb

          Gai...

          1 Reply Last reply Reply Quote 0
          • C Offline
            chanz
            last edited by

            Rich: FBX is the intended export format.

            Gaieus: Thank you. I suppose I should have asked about grouping. Does it actually create separate meshes for each group? Or I am confused about my terminology here. The reason I ask is because Unity recommends that each mesh be comprised of submeshes of a single material.

            Still curious about the removing duplicates in materials too.

            Thank you both for your replies.

            1 Reply Last reply Reply Quote 0
            • GaieusG Offline
              Gaieus
              last edited by

              Yes, separate meshes for materials and then groups these meshes separately (so that they are not merged back with each other).

              As for duplicate materials: if it's FBX, it should not happen because of distorted materials. In this case I have no clue I have to confess. What happens if you try?

              Gai...

              1 Reply Last reply Reply Quote 0
              • TIGT Offline
                TIG Moderator
                last edited by

                There are several tools around that try to resolve duplicate materials in a SKP.
                My own 'MaterialConsolidator' or thomthom's 'Cleanup' are two...
                Do a browser-search for key words like 'material' on the Plugins Index page accessed from the Resources > Plugins menu item above...

                When you export to several file formats you can find that materials are duplicated in that format - this is usually because textured materials in the SKP have been edited [typically using 'Texture' or perhaps by some projected-texture method] so that they have some skewing/distortion that is not possible to replicate with their three-vertex UVmap format - therefore a new 'unique' distorted texture image-file is made with its new material, this is used for just that facet in the exported file format.

                TIG

                1 Reply Last reply Reply Quote 0
                • C Offline
                  chanz
                  last edited by

                  Gaieus: Thank you for the clarification, that is exactly what I needed. Also, I must ask. You do look a bit drunk in your avatar. πŸ˜„

                  TIG: Fantastic plugin TIG! The MaterialConsolidator worked like a charm. Thank you.

                  Thank you all for the responses. This is an extremely helpful forum.

                  1 Reply Last reply Reply Quote 0
                  • C Offline
                    chanz
                    last edited by

                    Update: Seems I am still running into a few issues.

                    I have uploaded a small sample room from my project. Notice the asphalt. When I run MaterialConsolidator or Cleanup, it does not get rid of the redundant materials. It's possible I am using it incorrectly or misunderstand its use.

                    Here is a sample room file. Let me know what you guys see that I may be glossing over.

                    Thanks!


                    sample.skp

                    1 Reply Last reply Reply Quote 0
                    • TIGT Offline
                      TIG Moderator
                      last edited by

                      You have several materials with 'Asphalt' in their name and all with the same RGBA values BUT each using a different image-file as the texture.
                      Therefore, no material-consolidator is going to change them to be one material. How is it to know that two similar named materials with the same RGBA values BUT with different named image-files should be the same material. The two images might be quite different and their materials' naming coincidental.

                      OK, the repeated image-files do all look the same and have similar names, but without sophisticated techniques beyond the API and Ruby they can't be compared for exactness.

                      You can manually edit one Asphalt material and export its image-file with a simpler name, then edit all similar materials and set them to use that one new file.
                      NOW when you do an image-consolidation ALL of those materials will be seen as the same one and will be consolidated... πŸ˜•

                      TIG

                      1 Reply Last reply Reply Quote 0
                      • 1 / 1
                      • First post
                        Last post
                      Buy SketchPlus
                      Buy SUbD
                      Buy WrapR
                      Buy eBook
                      Buy Modelur
                      Buy Vertex Tools
                      Buy SketchCuisine
                      Buy FormFonts

                      Advertisement