=begin
Copyright 2013, Chris Fullmer
All Rights Reserved

Disclaimer
THIS SOFTWARE IS PROVIDED "AS IS" AND WITHOUT ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.

License
This software is distributed under the Smustard End User License Agreement
http://www.smustard.com/eula

Information
Author - Chris Fullmer with Stepped colorization by ICEPAM.
Organization - www.ChrisFullmer.com and distributed on the SketchUp Extension Warehouse and smustard.com
Name - Extrapolate Colors
SU Version - 2013, 8, 7

Description
This script finds materials used in a set of selected faces, and then randomly applies those 
same materials to all faces that have no material applied.

Usage
Run the script from Plugins > Chris Fullmer Tools > Extrapolate Colors.  First select a series 
of faces, at least one needs to have a meterial applied to it.  Then run the script.  The script 
will find all materials in the selection (only materials applied to faces though).  And it will 
randomly apply those materials to all faces in the selection set, leaving faces untouched that 
are already painted.

History
1.0:: 2009-08-25
   * First release
1.1:: 2009-09-01
   * Fixed sloppy code typo, thanks Jim!
1.2.0 2013-05-02
  * Made EW Compatible
  * Turned into an Extension
1.2.1 2013-05-06
  * Fixed menu compatibility with older clf scripts  
=end


module CLF_Extensions_NS

  module Clf_Extrapolate_Colors

    require 'sketchup.rb'
    require 'extensions.rb'
    
    NAME = "clf_extrapolate_colors"
    UNAME = "Clf Extrapolate Colors"
    MENU_NAME = "Extrapolate Colors"
    version = "1.2.1"           
    desc = "This plugin will quickly paint faces using selected materials."
    copy_year = "2013"
    author = "Chris Fullmer"
    
#------edit above--------------------------------------------------------------- 

    
    extension = SketchupExtension.new UNAME, NAME+"/"+NAME+"_menus.rb"

    #The name= method sets the name which appears for an extension inside the Extensions Manager dialog.
    extension.name = UNAME

    # The description= method sets the long description which appears beneath an extension inside the Extensions Manager dialog.
    extension.description = desc + "  Access it via Plugins > Chris Fullmer Tools > "+MENU_NAME

    # The version method sets the version which appears beneath an extension inside the Extensions Manager dialog.
    extension.version = version

    # Create an entry in the Extension list that loads a script called
    # stairTools.rb.
    extension.copyright = copy_year
     
    # The creator= method sets the creator string which appears beneath an extension inside the Extensions Manager dialog.
    extension.creator = author

    # The register_extension method is used to register an extension with SketchUp's extension manager (in SketchUp preferences).
    Sketchup.register_extension( extension, true )
    
  end
end  