MaterialsObserver
-
Didn't onMaterialChanged used to get called whenever you changed the base color of a material? It now only gets called when you change the texture filename and I can't remember if it used to work differently... Has anyone used the MaterialsObserver lately, successfully?
Thanks!!
-
I also have noticed, but no solution.
azuby
-
So I checked the instance methods, to see if the exposed methods correspond to the API. I'm not sure if it should or not, my ruby knowledge is thin here for sure (extending classes where methods may get called but are / aren't defined in the base class).
However, I checked the instance methods of every single observer class and they match the API exactly (some have additional methods, but all have at least what the API says. Except MaterialsObserver.Sketchup;;MaterialsObserver.instance_methods ["MaterialUndoRedo", "onMaterialRemoveAll", "MaterialSetCurrent", "MaterialChange", "onMaterialAdd", "MaterialRefChange", "MaterialRemove"]
Sorry, but this is a serious "what the hell?!" moment. Most of the methods completely lack the "on" part. Yet, onMaterialChange does get called rarely, so the method is being used, even if the base material observer doesn't define it. Attempting to override "MaterialChange" instead of "onMaterialChange" never gets called.
Am I off base or is this a Google Fubar?
None of the other observers have any methods that don't start with "on", or differ at all from the API.
Advertisement