sketchucation logo sketchucation
    • Login
    πŸ€‘ SketchPlus 1.3 | 44 Tools for $15 until June 20th Buy Now

    Remove materials plugin question.

    Scheduled Pinned Locked Moved Plugins
    5 Posts 3 Posters 931 Views 3 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.
    • dereiD Offline
      derei
      last edited by

      I know that are several "remove materials" plugins, including remove C/G materials, leave geometry materials... but is there any plugin which removes materials from Groups/Components, but leaves on which don't have material attached to faces?
      What I want to say: I have two components(or groups), one textured inside (the faces), one with material applied on component. By mistake i added a material to first component. I want to remove component material from the first one (it haves material on faces), but to leave on second one (If i remove from it too, it will be redered default).

      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

        Here's a one-liner that removes any materials from [pre]selected groups/instances...
        Copy+paste it into the Ruby Console + <enter>...

        Sketchup.active_model.selection.each{|e|e.material=nil if e.class==Sketchup;;Group or e.class==Sketchup;;ComponentInstance}
        

        πŸ€“

        If you want to remove all materials from all groups/instances it can be done en mass by iterating the model's definitions thus [no selection needed]

        Sketchup.active_model.definitions.each{|d|next if d.image?;d.instances.each{|i|i.material=nil}}
        

        πŸ€“

        TIG

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

          @tig said:

          Here's a one-liner that removes any materials from [pre]selected groups/instances...
          Copy+paste it into the Ruby Console + <enter>...

          Sketchup.active_model.selection.each{|e|e.material=nil if e.class==Sketchup;;Group or e.class==Sketchup;;ComponentInstance}
          

          πŸ€“

          Shouldn't I get each instance and iterate trough each face inside for existing material? And if none found, to leave the material on instance ?

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

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

            See the original post - I have edited it to include two methods - one that works on all selected groups/instances, and the other that works on ALL by iterating the definitions...

            TIG

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

              It would be nice if the remove CG material plugin worked on the entire model OR on a selection only. Some plugins can make this difference by first checking if there is a selection.

              Gai...

              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