State of Observers Redux — 18 August 2011
-
And I think Jim had doubts whether it worked during an animation export.
PS, the table page looks fine under MSIE 7.
"Depreciated" has no "i" in it. And the methods that were removed can not be "Deprecated", they are "Abandoned", "Deceased".. whatever they are no longer even in the Observer protoclass.
. -
they should have you on staff Thom...
-
MaterialsObserver.onMaterialRefChange
"When purging materials, or right-clicking a material in the Material Browser this event triggers one time for every entity with a material. This cause a long series of events to trigger unnessesary."
should read:
"When purging materials, or right-clicking a material in the Material Browser, this event triggers one time for every entity with a material. This causes a long series of events to trigger unnecessarily."~
-
Great work, and great resource. Thanks for doing it.
-
Thanks Dan, knew it was hiding somewhere.
Thanks for the spelling control - I didn't run a spell-checker or proofread yet.
@dan rathbun said:
"Depreciated" has no "i" in it. And the methods that were removed can not be "Deprecated", they are "Abandoned", "Deceased".. whatever they are no longer even in the Observer protoclass.
It's what the API docs said. I've not tested if the events are actually removed, or just aliased to their new names...
-
@dan rathbun said:
"Depreciated" has no "i" in it.
http://dictionary.reference.com/browse/Depreciated?r=75&src=ref&ch=dic
-
Oh, "Depreciated" refer to value...
grumble something about English and too similar words
-
Another issue, I imagine I read some reports on
MaterialObserver.onMaterialSetCurrent
not working as it should on OSX in some versions of SU? -
@thomthom said:
It's what the API docs said. I've not tested if the events are actually removed, or just aliased to their new names...
I did test the MaterialObserver's Bulk change method. It has been removed from the superclass, so when you create an instance of a MaterialObserver subclass, it just is not there, and if you were to explicitly call the callback, a NoMethodError exception will be raised. Ie, there is no aliasing to the individual change callback(s).
So if you wanted to handle events in a bulk manner, you'd need to do it on the Ruby side, perhaps with a Ruby standard Observer class, or a bulkchange boolean flag variable and an Array of changed objects (each individual SU change callback would need to push it's object into the Array.)
-
@thomthom said:
Another issue, I imagine I read some reports on
MaterialObserver.onMaterialSetCurrent
not working as it should on OSX in some versions of SU?YES.. I posted the answer that Scott gave me. He says it's logged as an internal bug.
See GG post: Materials.current on OS X
. -
http://code.google.com/apis/sketchup/docs/ourdoc/pages.html#add_frame_change_observer
Sketchup::Pages.add_frame_change_observer(FrameChangeObserver.new)
This, surprisingly worked.
I'd thought you'd have to reference the model first...
Sketchup.active_model.pages.add_frame_change_observer(FrameChangeObserver.new)
-
@dan rathbun said:
@thomthom said:
Another issue, I imagine I read some reports on
MaterialObserver.onMaterialSetCurrent
not working as it should on OSX in some versions of SU?YES.. I posted the answer that Scott gave me. He says it's logged as an internal bug.
See GG post: Materials.current on OS X
.So it's bugged on SU6, SU7.0, SU 7.1?
-
@dan rathbun said:
@thomthom said:
It's what the API docs said. I've not tested if the events are actually removed, or just aliased to their new names...
I did test the MaterialObserver's Bulk change method. It has been removed from the superclass, so when you create an instance of a MaterialObserver subclass, it just is not there, and if you were to explicitly call the callback, a NoMethodError exception will be raised. Ie, there is no aliasing to the individual change callback(s).
So if you wanted to handle events in a bulk manner, you'd need to do it on the Ruby side, perhaps with a Ruby standard Observer class, or a bulkchange boolean flag variable and an Array of changed objects (each individual SU change callback would need to push it's object into the Array.)
bulk change event? Is that one that has been removed from the API?
That was a troublesome points when I made this chart - they recently removed some events from the API.... -
@thomthom said:
So it's bugged on SU6, SU7.0, SU 7.1?
Careful.. the collection getter method Materials.current IS bugged, the question remains, is the MaterialsObserver bugged as well. You'd need to test versions on the Mac to find out.
. -
@thomthom said:
bulk change event? Is that one that has been removed from the API?
That was a troublesome points when I made this chart - they recently removed some events from the API....Yes.. the MaterialsObserver.onMaterialRemoveAll callback was removed, as it never worked, and/or never got called. So there was no point in deprecating it.
-
@dan rathbun said:
@thomthom said:
bulk change event? Is that one that has been removed from the API?
That was a troublesome points when I made this chart - they recently removed some events from the API....Yes.. the MaterialsObserver.onMaterialRemoveAll callback was removed, as it never worked, and/or never got called. So there was no point in deprecating it.
I'd like to add it for historic purpose - anyone remembers it parameters?
-
@thomthom said:
@dan rathbun said:
@thomthom said:
bulk change event? Is that one that has been removed from the API?
That was a troublesome points when I made this chart - they recently removed some events from the API....Yes.. the MaterialsObserver.onMaterialRemoveAll callback was removed, as it never worked, and/or never got called. So there was no point in deprecating it.
I'd like to add it for historic purpose - anyone remembers it parameters?
Ah - already got it.
Thought there was an event namedonBulkChange
, like the SelectionObserver has. -
aiaiai... sigh
-
Update to include SU 8.0 M1
http://www.thomthom.net/software/sketchup/observers/ -
You have that the
AppObserver::onQuit
is working...It's is bugged in v8 (at least. And I did report a bug last beta cycle.)
It does not wait until the callbacks return, before shutting down the application.
Trying to use the callback to save plugin settings, and so forth, often fails for me.Also, trying to dettach the observer itself from within
onQuit
causes a GPF (if I remember right.)
In addition coders should NOT open any "owned" windows (like WebDialogs and messageboxes,) during the callback, until they fix the 'non-blocking' issue.
Can't remember if v7 had any of these problems.
Advertisement