Class: Sketchup::MaterialsObserver
- Inherits:
-
Object
- Object
- Sketchup::MaterialsObserver
- Defined in:
- SketchUp/Sketchup/MaterialsObserver.rb
Overview
The callback onMaterialRemoveAll
has been deprecated, we recommend using #onMaterialRemove instead.
This observer interface is implemented to react to materials events. 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.
Instance Method Summary collapse
-
#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 Materials dialog.
-
#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.
40 41 |
# File 'SketchUp/Sketchup/MaterialsObserver.rb', line 40 def onMaterialAdd(materials, material) end |
#onMaterialChange(materials, material) ⇒ nil
The #onMaterialChange method is invoked whenever a material’s texture image is altered.
58 59 |
# File 'SketchUp/Sketchup/MaterialsObserver.rb', line 58 def onMaterialChange(materials, material) end |
#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.
78 79 |
# File 'SketchUp/Sketchup/MaterialsObserver.rb', line 78 def onMaterialRefChange(materials, material) end |
#onMaterialRemove(materials, material) ⇒ nil
The #onMaterialRemove method is invoked whenever a material is deleted.
95 96 |
# File 'SketchUp/Sketchup/MaterialsObserver.rb', line 95 def onMaterialRemove(materials, material) end |
#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.
116 117 |
# File 'SketchUp/Sketchup/MaterialsObserver.rb', line 116 def onMaterialSetCurrent(materials, material) end |
#onMaterialUndoRedo(materials, material) ⇒ nil
Due to a bug, this callback does not fire in SU6 or SU7. You can use the Sketchup::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.
138 139 |
# File 'SketchUp/Sketchup/MaterialsObserver.rb', line 138 def onMaterialUndoRedo(materials, material) end |