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 abstractToolclass, 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.
Hello! It looks like you're interested in this conversation, but you don't have an account yet.
Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.
With your input, this post could be even better π
Register LoginAdvertisement