Class: Sketchup::MaterialsObserver Abstract
| Relationships | |
| Inherits: | Object | 
Overview
To implement this observer, create a Ruby class of this type, override the desired methods, and add an instance of the observer to the objects of interests.
The callback onMaterialRemoveAll has been deprecated, we recommend using #onMaterialRemove instead.
This observer interface is implemented to react to materials events.
Instance Method Summary
- 
    
      #onMaterialAdd(materials, material)  ⇒ nil 
    
    The #onMaterialAdd method is invoked whenever a new material is added. 
- 
    
      #onMaterialChange(materials, material)  ⇒ nil 
    
    The #onMaterialChange method is invoked whenever a material’s texture image is altered. 
- 
    
      #onMaterialRefChange(materials, material)  ⇒ nil 
    
    The #onMaterialRefChange method is invoked whenever the number of entities that a material is painted on changes. 
- 
    
      #onMaterialRemove(materials, material)  ⇒ nil 
    
    The #onMaterialRemove method is invoked whenever a material is deleted. 
- 
    
      #onMaterialSetCurrent(materials, material)  ⇒ nil 
    
    The #onMaterialSetCurrent method is invoked whenever a different material is selected in the Materialsdialog.
- 
    
      #onMaterialUndoRedo(materials, material)  ⇒ nil 
    
    The #onMaterialUndoRedo method is invoked whenever a material is altered and then those changes are undone or redone. 
Instance Method Details
    #onMaterialAdd(materials, material)  ⇒ nil 
  
The #onMaterialAdd method is invoked whenever a new material is added.
    #onMaterialChange(materials, material)  ⇒ nil 
  
The #onMaterialChange method is invoked whenever a material’s texture image is altered.
    #onMaterialRefChange(materials, material)  ⇒ nil 
  
The #onMaterialRefChange method is invoked whenever the number of entities that a material is painted on changes. This could be due to the user manually painting something, but it could also be when faces are split, pasted, push-pulled, deleted, etc.
    #onMaterialRemove(materials, material)  ⇒ nil 
  
The #onMaterialRemove method is invoked whenever a material is deleted.
    #onMaterialSetCurrent(materials, material)  ⇒ nil 
  
The #onMaterialSetCurrent method is invoked whenever a different material is selected in the Materials dialog.
The materials parameter might be Nil when the material is picked from the materials libraries and not yet added to the model.
    #onMaterialUndoRedo(materials, material)  ⇒ nil 
  
Due to a bug, this callback does not fire in SU6 or SU7. You can use the ModelObserver#onTransactionStart to capture all undo events.
The #onMaterialUndoRedo method is invoked whenever a material is altered and then those changes are undone or redone.