Class: Sketchup::MaterialsObserver
Overview
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 interest. The callback onMaterialRemoveAll has been deprecated, we recommend using onMaterialRemove instead.
Instance Method Summary collapse
-
#onMaterialAdd(materials, material) ⇒ nil
The onMaterialAdd method is invoked whenever a 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.
-
#onMaterialRemoveAll ⇒ Object
deprecated
Deprecated.
-
#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 Sketchup::Material is added.
41 42 |
# File 'lib/materialsobserver.rb', line 41 def onMaterialAdd(materials, material) end |
#onMaterialChange(materials, material) ⇒ nil
The onMaterialChange method is invoked whenever a Sketchup::Material’s texture image is altered.
60 61 |
# File 'lib/materialsobserver.rb', line 60 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.
81 82 |
# File 'lib/materialsobserver.rb', line 81 def onMaterialRefChange(materials, material) end |
#onMaterialRemove(materials, material) ⇒ nil
The onMaterialRemove method is invoked whenever a Sketchup::Material is deleted.
99 100 |
# File 'lib/materialsobserver.rb', line 99 def onMaterialRemove(materials, material) end |
#onMaterialRemoveAll ⇒ Object
103 104 |
# File 'lib/materialsobserver.rb', line 103 def onMaterialRemoveAll end |
#onMaterialSetCurrent(materials, material) ⇒ nil
The onMaterialSetCurrent method is invoked whenever a different Sketchup::Material is selected in the Materials dialog.
124 125 |
# File 'lib/materialsobserver.rb', line 124 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 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.
144 145 |
# File 'lib/materialsobserver.rb', line 144 def onMaterialUndoRedo(materials, material) end |