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

    [Plugin] Material Replacer

    Scheduled Pinned Locked Moved Plugins
    73 Posts 39 Posters 79.1k Views 39 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.
    • TIGT Offline
      TIG Moderator
      last edited by

      @dedmin said:

      The beauty of this tool - You don't have to open a component to change the material of the faces.
      But it changes all the material in the whole model - not just the face You click on.

      BUT your question was to change the material of the picked face !
      You mean to change the material of the picked face INSIDE THE GROUP/INSTANCE !
      It couldbe done... but I must leave it to others......

      TIG

      1 Reply Last reply Reply Quote 0
      • D Offline
        dedmin
        last edited by

        Yes, inside the group or component. And only of that picked fase.

        1 Reply Last reply Reply Quote 0
        • L Offline
          lcbrewer
          last edited by

          How do you install this plugin

          1 Reply Last reply Reply Quote 0
          • thomthomT Offline
            thomthom
            last edited by

            Open the zip file and drop the .rb file and the folder with it into the Plugins folder where SketchUp is installed.

            Thomas Thomassen — SketchUp Monkey & Coding addict
            List of my plugins and link to the CookieWare fund

            1 Reply Last reply Reply Quote 0
            • bagateloB Offline
              bagatelo
              last edited by

              It would be possible to create a function swap some materials? Something like this:
              Imagine a blue box and a red ball. We play the plugin, we click on the box and after the ball, and the colors are reversed. It would be interesting too, if it were possible to exchange materials not in the whole scene, but only on selected objects. Thanks for this fantastic tool.

              While the cat's away, the mice will play

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

                Is there any way we can use this plugin to replace a specific material [.skm]..that has been used in the model with vray materials [i.e. .vismats]...??

                1 Reply Last reply Reply Quote 0
                • thomthomT Offline
                  thomthom
                  last edited by

                  @cobb89 said:

                  Is there any way we can use this plugin to replace a specific material [.skm]..that has been used in the model with vray materials [i.e. .vismats]...??

                  Use V-Ray's material editor. Right click a material and Import

                  Thomas Thomassen — SketchUp Monkey & Coding addict
                  List of my plugins and link to the CookieWare fund

                  1 Reply Last reply Reply Quote 0
                  • jarynzlesaJ Offline
                    jarynzlesa
                    last edited by

                    thank you for this plugin, i found this very useful. 👍

                    http://www.vizualizaceschodiste.mypage.cz/

                    1 Reply Last reply Reply Quote 0
                    • Bob JamesB Offline
                      Bob James
                      last edited by

                      This sort of ties in with the current thread:
                      http://forums.sketchucation.com/viewtopic.php?f=79&t=36987

                      i7-4930K 3.4Ghz, 2x GTX780 6GB, 32GB DDR3-1600 ECC, OCZ Vertex 4 500GB, WD Black 3TB, 32TB NAS, 4x 27" Monitors, SpaceMouse Pro, X-keys XK-60

                      1 Reply Last reply Reply Quote 0
                      • dereiD Offline
                        derei
                        last edited by

                        As I can see, this plugin replaces a material globally in entire model. It would be awesome to have option to replace material on a specific object only. 👍
                        Will you take into consideration my suggestion?
                        Thank you.

                        DESIGNER AND ARTIST [DEREI.UK](http://derei.uk/l)

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

                          @unknownuser said:

                          As I can see, this plugin replaces a material globally in entire model. It would be awesome to have option to replace material on a specific object only. 👍
                          Will you take into consideration my suggestion?
                          Thank you.

                          You probably need http://forums.sketchucation.com/viewtopic.php?p=63629#p63629 [my olde Global_Material_Replacer.rb tool] - it is dialog driven to choose the material to go and material to use - including 'All' and 'Default-front/back'. It swaps materials in the entire model's active_entities collection, OR IF there's a selection on selected objects... It works inside 'containers'...

                          TIG

                          1 Reply Last reply Reply Quote 0
                          • dereiD Offline
                            derei
                            last edited by

                            @tig said:

                            You probably need http://forums.sketchucation.com/viewtopic.php?p=63629#p63629 [my olde Global_Material_Replacer.rb tool] - it is dialog driven to choose the material to go and material to use - including 'All' and 'Default-front/back'. It swaps materials in the entire model's active_entities collection, OR IF there's a selection on selected objects... It works inside 'containers'...

                            As I could see, thomthom's plugin keeps UV mapping, when replacing materials, which is cool 😄. Does yours keeps UV ?
                            When I use paint bucket tool to change the material on some object, the UV is reset.

                            DESIGNER AND ARTIST [DEREI.UK](http://derei.uk/l)

                            1 Reply Last reply Reply Quote 0
                            • thomthomT Offline
                              thomthom
                              last edited by

                              @unknownuser said:

                              When I use paint bucket tool to change the material on some object, the UV is reset.

                              Use the Entity Info to replace materials - then the UV is preserved.

                              Thomas Thomassen — SketchUp Monkey & Coding addict
                              List of my plugins and link to the CookieWare fund

                              1 Reply Last reply Reply Quote 0
                              • dereiD Offline
                                derei
                                last edited by

                                @thomthom said:

                                Use the Entity Info to replace materials - then the UV is preserved.

                                Thanks! I never used it.

                                DESIGNER AND ARTIST [DEREI.UK](http://derei.uk/l)

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

                                  @unknownuser said:

                                  [TIG] Does yours keeps UV ?
                                  When I use paint bucket tool to change the material on some object, the UV is reset.
                                  Like with Entity Info... my tool swaps the material but keeps the UV-mapping - so any rotated or scales/skewed textures stay unchanged, but the material uses a different image-file...

                                  TIG

                                  1 Reply Last reply Reply Quote 0
                                  • dereiD Offline
                                    derei
                                    last edited by

                                    @tig said:

                                    Like with Entity Info... my tool swaps the material but keeps the UV-mapping - so any rotated or scales/skewed textures stay unchanged, but the material uses a different image-file...

                                    Will this affect Twilight metadata? If I change a "wood" material with a "metal" material, both with textures... will it render as "metal", or just the image is changed and uses metadata from initially "wood" ?

                                    DESIGNER AND ARTIST [DEREI.UK](http://derei.uk/l)

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

                                      @unknownuser said:

                                      @tig said:

                                      Like with Entity Info... my tool swaps the material but keeps the UV-mapping - so any rotated or scales/skewed textures stay unchanged, but the material uses a different image-file...

                                      Will this affect Twilight metadata? If I change a "wood" material with a "metal" material, both with textures... will it render as "metal", or just the image is changed and uses metadata from initially "wood" ?
                                      You could always try it yourself... 😒
                                      A Twilight material is associated with a SKP material.
                                      If you have a gray RGB material in your SKP you can tell Twilight to substitute it with a silver metal - shiny/textured/etc.
                                      If you have a buff RGB material in your SKP you can tell Twilight to substitute it with a golden metal - shiny/textured/etc.
                                      If you swap around materials in your SKP it'll be reflected in corresponding changes in the next Twilight render.
                                      How would changing a face's material in the SKP NOT affect the Twilight render? AND how might it affect the Twilight material - which is associated on a one-to-one relationship - gray=silver, buff=golden etc?? It only swaps around SKP materials by name it doesn't redefine them or rename them. I'm not sure what happens if you swap the names of materials over in your SKP - presumably if you said in the SKP material Browser gray=>gray1 and buff=>gray and gray1=>buff, then if Twilight uses a material-name look up table for how to render each of its materials based the SKP's current material-names then it would indeed swap what was silver with golden and vice versa... Perhaps useful on occasion, but not the point of this current discussion or thread.

                                      So to recap, swapping a face's SKP material gives the face that other SKP material, the face's material's UV-mapping comes from the face itself; whatever 'correspondence' Twilight a material has with the SKP material is kept intact and it renders accordingly...

                                      TIG

                                      1 Reply Last reply Reply Quote 0
                                      • S Offline
                                        samyell77
                                        last edited by

                                        Hi thomthom,
                                        Love this plugin by the way. Is it possible to have the material name display whenever using the eyedropper tool and not just when running your ruby script. Having the name of the material display is SOOOO handy and I'd love it if the eyedropper always displayed the material name. Is this possible? I work on mac so currently trying to work out what material is what is pretty tricky due to the absence of a list view in the material browser. Also would it be possible to move the 'material replacer' to a context menu so you could access if using a right click rather than going to the drop down menus?
                                        Fantastic tool tho - thanks!
                                        Sam

                                        SU Pro 2016
                                        Dell Precision M4800
                                        PC Windows 10
                                        Intel Core i7-4900MQ @ 2.80ghz
                                        Nvidia Quadro K2100M
                                        16gb RAM

                                        1 Reply Last reply Reply Quote 0
                                        • thomthomT Offline
                                          thomthom
                                          last edited by

                                          I can't modify the native SketchUp tools I'm afraid.

                                          As for context menu, I could, but then someone would ask me to reverse it. But I'll see if I can send you a modified version.

                                          Thomas Thomassen — SketchUp Monkey & Coding addict
                                          List of my plugins and link to the CookieWare fund

                                          1 Reply Last reply Reply Quote 0
                                          • S Offline
                                            samyell77
                                            last edited by

                                            Would really appreciate that - thanks! 😄

                                            SU Pro 2016
                                            Dell Precision M4800
                                            PC Windows 10
                                            Intel Core i7-4900MQ @ 2.80ghz
                                            Nvidia Quadro K2100M
                                            16gb RAM

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

                                            Advertisement