How to replace a material everywhere in SketchUp

To replace a material in SketchUp, pick the new material, hold Shift with the Paint Bucket and click a face that uses the old one: every matching face in the current context changes. Faces inside groups and components need the same click inside each one, or a short Ruby script that walks every definition.

Replace a material with the Paint Bucket

The Paint Bucket (B) has three replace modes, set by the key you hold while you click. Choose the new material in the Materials panel first, then click a face that has the old material.

  • All Matching (Shift on Windows and macOS): every face in the current context that uses the clicked material gets the new one.
  • All Connected (Ctrl on Windows, Option on macOS): only faces connected to the one you click that share its material. Useful for a countertop and its backsplash, not the bathtub across the room.
  • All on Same Object (Ctrl+Shift on Windows, Option+Shift on macOS): only matching faces inside the same group or component.

Where to find the Materials panel: on Windows it sits in the Default Tray. On macOS choose Window › Materials, which opens the system Colors window; SketchUp's materials are on its Texture Palettes tab. Activating the Paint Bucket also opens it.

Each Paint Bucket click is one undo step, so Cmd+Z (macOS) or Ctrl+Z (Windows) puts it back if the wrong faces changed.

Why some faces don't change: groups and components

The Paint Bucket works in the context you are editing. Shift-click at the top level and faces inside groups and components keep their old material. This is the most common reason a replace looks half done.

There are two ways a group or component can carry a material:

  • Painted on the faces inside. Open the group or component (double-click it) and Shift-click there. For a component, one edit updates every instance, because they share a definition. For groups you repeat it in each one.
  • Painted on the container. If you painted the whole group from outside, the material sits on the group, and faces inside that still use Default show it. Replace these from outside: click the group with the new material, and every Default face inside follows.

Faces with their own material always win over the container's material. If a chair painted as a whole still shows the old fabric on the seat, the seat faces carry the material themselves, so open the chair and replace it there. Entity Info shows which material sits on whatever you have selected.

Deeply nested models make this slow. That is where the script further down, or an extension, helps. Thomas Thomassen's Material Replacer on SketchUcation is the usual forum suggestion: you pick materials from the model to swap them.

Select everything that uses a material

Sometimes you want to see what uses a material before you change it.

  • Windows: in the Materials panel, click In Model (the house icon), right-click the swatch and choose Select.
  • macOS and Windows: right-click a face that uses the material and choose Select › All with Same Material. Forum users report the Colors window swatches on macOS don't offer Select, so use this route there.

Both select in the current context only, the same limit as the Paint Bucket. With the faces selected, click the new material in the panel to paint them all at once.

How to edit a material in SketchUp instead

If you want every use of a material to look different, you don't need to repaint anything. Edit the material, and every face, group and component that uses it updates, at every nesting level.

On Windows, select the material under In Model and open the Edit tab: change the color, opacity, texture size, or tick Use texture image and browse to a new image. On macOS, edit it from the Colors window; the editor has a menu for what the material is based on, where you can load a new texture image.

The catch is the name. Edit "Light Oak" to look like walnut and it is still called "Light Oak" in reports, cut lists and exports. Rename it in the same editor, or use the Paint Bucket or script approach when the name matters.

If the replacement is in a library and not yet in the model, it isn't In Model until something is painted with it. Paint one face, or (from Ruby, SketchUp 2017 and newer) load a saved .skm file with model.materials.load.

Replace a material in every group and component with Ruby

This script swaps one material for another on every face, edge, group and component in the model, including back faces and everything nested. Paste it into Extensions › Developer › Ruby Console (Window › Ruby Console before SketchUp 2021.1), change the two names, and press Enter. It is one undo step. New to the console? See how to run a Ruby script in SketchUp.

model = Sketchup.active_model
old_mat = model.materials["Light Oak"]
new_mat = model.materials["Dark Walnut"]
raise "Material not found" unless old_mat && new_mat

count = 0
swap = lambda do |entities|
  entities.each do |e|
    next unless e.is_a?(Sketchup::Drawingelement)
    if e.material == old_mat
      e.material = new_mat
      count += 1
    end
    if e.is_a?(Sketchup::Face) && e.back_material == old_mat
      e.back_material = new_mat
      count += 1
    end
  end
end

model.start_operation("Replace material", true)
begin
  swap.call(model.entities)
  model.definitions.each { |d| swap.call(d.entities) unless d.image? }
  model.commit_operation
  puts "Replaced #{count}"
rescue => e
  model.abort_operation
  raise e
end

Walking model.definitions covers every group and component once, no matter how deep it sits, so component instances all change together. If it says the material isn't found, run model.materials.map(&:name) to see the exact names in the model.

To change only some objects, such as every cabinet but not the floor, add a test on the parent definition's name. That kind of filter is also where a chatbot can help write the script; see using ChatGPT to write SketchUp Ruby.

Purge unused materials afterwards

The old material stays in the file after nothing uses it. Remove it with Window › Model Info › Statistics › Purge Unused, which also clears other unused items such as components and tags.

To purge only materials on Windows, click In Model in the Materials panel, open the details menu (the arrow beside the list) and choose Purge Unused. To remove one material by hand, right-click its swatch under In Model and choose Delete; SketchUp asks to replace its uses with the default material.

A material still counts as used if it sits inside an unused component definition, so purge components first, then materials. For more on trimming a heavy file, see Lookover's guide to reducing SketchUp file size.

Replace materials by asking, with exceptions

MakeIt4Me (our product) connects an AI agent on your computer (Claude, ChatGPT desktop, Cursor and others) to your open SketchUp model. Batch material swaps are a good fit because the agent can walk the whole entity tree and apply rules a Paint Bucket can't. You can type something like:

"Replace all 'Light Oak' with 'Dark Walnut'. Leave upholstery and flooring alone."

The agent reads the model to work out what counts as upholstery and flooring, writes the Ruby, runs it, takes a screenshot to check the result and tells you what it changed. The whole swap is one labeled undo step, so if it caught the wrong objects, Cmd+Z or Ctrl+Z undoes it. A vague exception may take a second round of prompting. Your AI provider bills its usage separately. See it in the demo.

Questions

Why doesn't Shift with the Paint Bucket change faces inside groups?

It only works in the context you are editing. Open each group or component and Shift-click inside it, or use a script that walks every definition.

How do I replace a material inside a component without changing other copies?

Right-click that instance and choose Make Unique, then open it and repaint. It gets its own definition, so the other copies keep the old material.

What is the Mac shortcut for All Connected and All on Same Object?

Option for All Connected and Option+Shift for All on Same Object. Shift (All Matching) is the same on both platforms.

Does deleting a material remove it from the faces that use it?

Yes. Deleting a material from In Model asks to replace it with the default material, so those faces go back to the default color. Paint them with the replacement first if you want to keep a finish.