Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sketchup::Page - Missing methods (set camera, rendering options, ....) #878

Open
Fredosixx opened this issue Mar 15, 2023 · 4 comments
Open
Labels
enhancement logged parity Missing functional parity with client Ruby API SketchUp

Comments

@Fredosixx
Copy link

The Sketchup::Page class seems to be missing crucial methods.

For instance, I did not find a direct way to set a camera for scene via the API. There is no method like page.camera=.

So, you have to

  1. Save the current view and current scene if any
  2. Set the page as the current scene
  3. set the camera in the view
  4. call page.update to store the camera (ideally, we should just unset all use_ flags to make sure we just update the camera and then restore them after.
  5. restore the view camera
  6. select the original scene if any

The same happens for rendering_options, shadows, etc....

@DanRathbun
Copy link

A longstanding challenge. I described it in detail as the use case "elaboration" requested by @thomthom in #876 (comment), for why a "quick iterator" that temporarily switches off scene transitions is needed.

@thomthom
Copy link
Member

Would fixing this make #876 obsolete?

@DanRathbun
Copy link

DanRathbun commented Mar 17, 2023

Would fixing this make #876 obsolete?

Not, in my opinion. (More discussed in #876.)

But being able to set page properties without going through the clunky page.update from the active view (and it's rendering options) certainly will help avoid situations that cause buggy code.

For example, in the workaround described, any ViewObserver or FramechangeObserver will fire (perhaps twice each, maybe more.) This could cause other unneeded side-effects.

@sketchup
Copy link

sketchup bot commented Mar 20, 2023

Logged as: SKEXT-3662

@sketchup sketchup bot added the logged label Mar 20, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement logged parity Missing functional parity with client Ruby API SketchUp
Projects
None yet
Development

No branches or pull requests

3 participants