State of Observers Redux — 18 August 2011
30 posts
• Page 1 of 1
State of Observers Redux — 18 August 2011I've begun on a revision of the State of Observers:
http://www.thomthom.net/software/sketchup/observers/ Could you please have a look and let me know if have information that would fit in this. (p.s. The page is in HTML5 - so if you use silly old browsers it might not look good - I've not tested it yes, just in Firefox 3.6. Atm I'm focusing on the content.) Added public bug tracker to the BitBucket repo: https://bitbucket.org/thomthom/sketchup ... tatus=open People can add reports of broken observer events there. Please, register (free) to access all the attachments on the forums. Thomas Thomassen — SketchUp Monkey & Coding addict
List of my plugins and link to the CookieWare fund
Re: State of Observers Redux — 12 September 2010Was there an observer hidden in the API docs somewhere that was listed in between the methods of another class instead of a class of its own?
Thomas Thomassen — SketchUp Monkey & Coding addict
List of my plugins and link to the CookieWare fund
Re: State of Observers Redux — 12 September 2010
Yes.. it is the FrameChangeObserver, see the Pages class.
~
Re: State of Observers Redux — 12 September 2010And 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. .
Re: State of Observers Redux — 12 September 2010they should have you on staff Thom...
Re: State of Observers Redux — 12 September 2010MaterialsObserver.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." ~
Re: State of Observers Redux — 12 September 2010Great work, and great resource. Thanks for doing it.
Re: State of Observers Redux — 12 September 2010Thanks Dan, knew it was hiding somewhere.
Thanks for the spelling control - I didn't run a spell-checker or proofread yet.
It's what the API docs said. I've not tested if the events are actually removed, or just aliased to their new names... Thomas Thomassen — SketchUp Monkey & Coding addict
List of my plugins and link to the CookieWare fund
Re: State of Observers Redux — 12 September 2010
http://dictionary.reference.com/browse/ ... ref&ch=dic Thomas Thomassen — SketchUp Monkey & Coding addict
List of my plugins and link to the CookieWare fund
Re: State of Observers Redux — 12 September 2010Oh, "Depreciated" refer to value...
*grumble something about English and too similar words* Thomas Thomassen — SketchUp Monkey & Coding addict
List of my plugins and link to the CookieWare fund
Re: State of Observers Redux — 12 September 2010Another issue, I imagine I read some reports on MaterialObserver.onMaterialSetCurrent not working as it should on OSX in some versions of SU?
Thomas Thomassen — SketchUp Monkey & Coding addict
List of my plugins and link to the CookieWare fund
Re: State of Observers Redux — 12 September 2010
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.)
Re: State of Observers Redux — 12 September 2010
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 .
Re: State of Observers Redux — 12 September 2010http://code.google.com/apis/sketchup/do ... e_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) Thomas Thomassen — SketchUp Monkey & Coding addict
List of my plugins and link to the CookieWare fund
Re: State of Observers Redux — 12 September 2010
So it's bugged on SU6, SU7.0, SU 7.1? Thomas Thomassen — SketchUp Monkey & Coding addict
List of my plugins and link to the CookieWare fund
Re: State of Observers Redux — 12 September 2010
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.... Thomas Thomassen — SketchUp Monkey & Coding addict
List of my plugins and link to the CookieWare fund
Re: State of Observers Redux — 12 September 2010
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. .
Re: State of Observers Redux — 12 September 2010
Yes.. the MaterialsObserver.onMaterialRemoveAll callback was removed, as it never worked, and/or never got called. So there was no point in deprecating it.
Re: State of Observers Redux — 12 September 2010
I'd like to add it for historic purpose - anyone remembers it parameters? Thomas Thomassen — SketchUp Monkey & Coding addict
List of my plugins and link to the CookieWare fund
Re: State of Observers Redux — 12 September 2010
Ah - already got it. Thought there was an event named onBulkChange, like the SelectionObserver has. Thomas Thomassen — SketchUp Monkey & Coding addict
List of my plugins and link to the CookieWare fund
Re: State of Observers Redux — 12 September 2010aiaiai... *sigh*
Please, register (free) to access all the attachments on the forums. Thomas Thomassen — SketchUp Monkey & Coding addict
List of my plugins and link to the CookieWare fund
Re: State of Observers Redux — 12 September 2010Thomas Thomassen — SketchUp Monkey & Coding addict
List of my plugins and link to the CookieWare fund
Re: State of Observers Redux — 18 August 2011You 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.
Re: State of Observers Redux — 18 August 2011InstanceObserver
I'm wonding if you can do this
Last edited by Dan Rathbun on Fri Aug 19, 2011 2:51 pm, edited 1 time in total.
Re: State of Observers Redux — 18 August 2011
Ok - I'll add that. Never used it. All the observers I've not tried and not heard any reports on I assume is working.
Groups and Images all are listed in model.definition.
I wish the docs would do that. Messageboxes are double plus ungood - especially in observer events. Thomas Thomassen — SketchUp Monkey & Coding addict
List of my plugins and link to the CookieWare fund
Re: State of Observers Redux — 18 August 2011Dan, how do you test AppObserver::onQuit ?
If I had a test case that illustrates the symptoms I could quickly run it on SU 6-8. Thomas Thomassen — SketchUp Monkey & Coding addict
List of my plugins and link to the CookieWare fund
Re: State of Observers Redux — 18 August 2011
Tough one... as it DOES fire. (It just doesn't wait for the callback to finish.) Well I first found it because I wanted to save the pos & size of several windows using Win32API calls. But it wasn't working. So I tried putting a debug popup messagebox inside onQuit(), thinking the shutdown process should stop, until I clicked "OK". But it DIDN'T stop, the messagebox came up, but everything else shutdown. And when I closed the messagebox, it's owner (the Sketchup App window,) no longer existed, so Windows poped up the VS Just in Time debugger query box (you know.. "DO want Debug now?") So next I tried, to open a WebDialog.. and that made things even worse. (I got a post-shutdown BugSplat!) They were either GPF or "Unhandled Win32 Exception".) I was trying to call a method that saved a whole bunch of data into the Registry, and that method may have called another method as well. Anyway, I even tried "lean" the process way down, putting all statements inside the onQuit(), and removing every extra reference assignment I could. But Sketchup just would not wait. It seemed to be processing all the onQuit callbacks, in the Ruby thread, but at the same time, cleaning up the main App thread, and disposing of all it's child windows. Perhaps it's a unique thing because I want to save window object data, ...that most other plugins would not encounter. I plan to try using Ruby define_finalizer, and see if that works for me. As far as testing.. I'll have to think more on this... perhaps a trace function.
Re: State of Observers Redux — 18 August 2011
I don't have a Mac to test this InstanceObserver workaround. (And I fixed the example. I don't know why, but every single time I go to write an initialize() method, I forget to put def in front of it!)
Re: State of Observers Redux — 18 August 2011In TT_Lib2 I got a function TT.debug that outputs a string to any system debugger, like DebugView. That can probably be used to track onQuit.
Thomas Thomassen — SketchUp Monkey & Coding addict
List of my plugins and link to the CookieWare fund
Re: State of Observers Redux — 18 August 2011Added public bug tracker to the BitBucket repo:
https://bitbucket.org/thomthom/sketchup ... tatus=open People can add reports of broken observer events there. Thomas Thomassen — SketchUp Monkey & Coding addict
List of my plugins and link to the CookieWare fund
SketchUcation One-Liner AdvertsAre you a Premium Member? Get your freebies here. Are you not> a Premium Member yet? Upgrade your account to grab these freebies instantly.
30 posts
• Page 1 of 1
|