State of Observers ?
-
Hi all.
A feature I've been thinking about in a project is synchronising an item in SU with another item in another program.
Sending information to and from isn't a problem. What I'm curious about is the Observers I should use.
Since no Observer (as far as I've seen) keeps directly track of entity positions or orientations, one way I could think of that'd enable me to do so would be by combining a Tool Observer (OnButtonUp and OnButtonDown) and an EntityObserver (OnEntityChange), and making sure the right tool is selected. That way I could send a transformation information whenever the user completes a move, scale or rotate action.
Does this seem like the most natural way to you ? Are there any latent bugs (seems like Observers have had problems in past versions, I can't seem to find more recent information) or potential problems to this approach (I've read up on a few common pitfalls but don't know much more) ?
-
@oajfh said:
...Tool Observer (OnButtonUp and OnButtonDown) ...
There is not a ToolObserver class in the API.
The
onButton
.. callbacks are part of the abstractTool
class, not an observer class.@oajfh said:
... and an
EntityObserver
(OnEntityChange), ...Write a quick test observer and see if it fires when you move an object.
@oajfh said:
Does this seem like the most natural way to you ? Are there any latent bugs (seems like Observers have had problems in past versions, I can't seem to find more recent information) or potential problems to this approach (I've read up on a few common pitfalls but don't know much more) ?
Welcome the foggy world of SketchUp API Dcoumentation. Where nothing is really certain, and all are kept in limbo.
Advertisement