sketchucation logo sketchucation
    • Login
    🤑 SketchPlus 1.3 | 44 Tools for $15 until June 20th Buy Now

    Remove Group/component materials and apply to faces

    Scheduled Pinned Locked Moved Plugins
    6 Posts 5 Posters 1.9k Views 5 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.
    • PixeroP Offline
      Pixero
      last edited by

      I was looking for this function in one of Thomthoms scripts but cannot find it. Am I wrong that it was there before?

      I have this file from an architect where all materials are applied to the groups which makes it very difficult to edit. Now I can't find the required plugin.

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

        If you want to simply find each group's material and apply it onto the default-material faces within that group, and then default the group's material, then a 'one-liner' will do it.
        However, note that copied groups will get made unique, and any nested groups will get the material of the outer most wrapper where appropriate - which might then be nil ?

        m=Sketchup.active_model;
        m.start_operation('ma',true);
        m.definitions.find_all{|g|g.group?}.each{|g|if g.entities.parent.instances[1];g.entities.parent.instances[1..-1].each{|i|i.make_unique};end};
        m.definitions.find_all{|g|g.group?}.each{|d|g=d.instances[0]; ma=g.material;g.entities.grep(Sketchup;;Face).each{|f|f.material=ma unless f.material;f.back_material=ma unless f.back_material};g.material=nil};
        m.commit_operation;
        

        TIG

        1 Reply Last reply Reply Quote 0
        • BoxB Offline
          Box
          last edited by

          Its not a Thomthom one. If you had searched by the first two words of your thread title you would have found
          https://sketchucation.com/pluginstore?pln=Remove_CG_mat

          1 Reply Last reply Reply Quote 0
          • PixeroP Offline
            Pixero
            last edited by

            Thanks TIG. I'll try that.
            @Box: I found and tested it but weird things happened when it applied same material to entire selection. I was just so sure Thomthom had it in his Material Tools.

            1 Reply Last reply Reply Quote 0
            • T Offline
              TBoy
              last edited by

              Are you talking about "Material Replacer" ?
              https://sketchucation.com/pluginstore?pln=tt_mat_replace

              'Remove material from All...' is inside Thomthom "Material Tools"

              1 Reply Last reply Reply Quote 0
              • pbacotP Offline
                pbacot
                last edited by

                I've tried the same thing and had trouble with Remove_CG_mat. It's not the same as material replacer. Still looking.

                MacOSX MojaveSketchUp Pro v19 Twilight v2 Thea v3 PowerCADD

                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