Is there a method or extension to show a "swatch palette" of all materials in a model?

Here are my quickie.
You can install with the Extension Manger, however it is not fully fulfil the extension requirements, but still will work…
As usual, does not tested extensively… so no warranties! Use at your own risk!

EDIT: Please see newer version in a next post!
Dezmo_Material_Lister.rbz (658 Bytes)

You will get a menu in Extension>“Create ‘Material List’ component”

As the menu suggests it will create a component (with a name “Material List of +{model_name}”) and one of it instance will be attached to the mouse cursor so you can place it to the model as you wish.
Inside this component each group and its name representing one material. The materials are assigned to the corresponding groups.
The group itself geometrically created as 3D text of one cuboid and a material name.

You can undo it.
If you create an other component that will be automatically get a new name by numbering it.

Dezmo_Material_Lister

Ruby Code:
module Dezmo:MaterialLister

  @@loaded = false unless defined?(@@loaded)
  
  def self.list_materials
    mod = Sketchup.active_model
    mat = mod.materials 
    return UI.messagebox("There is no materials in a model ") if mat.to_a.empty?
    
    mod_name = mod.name == "" ? "Untitled" : mod.name
    mats = mat.sort_by(&:display_name).reverse
    
    mod.start_operation "Create Material list component", true
    comp = mod.definitions.add "Material List of #{mod_name}"
    
    mats.each_with_index do |m, i|
      g = comp.entities.add_group
      g.entities.add_3d_text("█ #{m.display_name}", 0, "Arial", true, false,
                              1.0, 0.0, 0.0, true, 0.10 )
      g.name = m.display_name
      g.material = m
      g.move!([0, 2.0 * i, 0])
    end
    mod.place_component comp
    
    mod.commit_operation
  end
  
  unless @@loaded
    @@loaded = true
    cmd1 = UI::Command.new("Create 'Material List' component"){
      self.list_materials
    }
    UI.menu("Plugins").add_item( cmd1 )
  end
  
end