sketchucation logo sketchucation
    • Login
    ℹ️ GoFundMe | Our friend Gus Robatto needs some help in a challenging time Learn More

    .scene_transition_finished?

    Scheduled Pinned Locked Moved Developers' Forum
    5 Posts 3 Posters 64 Views
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • T Offline
      tomasz
      last edited by

      I want to make sure that a transition has been finished between two scenes.
      When a scene is selected Sketchup.active_model.active_view.camera returns immediately the selected scene camera, although current view still changes till it reaches the destination.

      If scenes contain cameras then it can be tested using a view observers and comparing camera eye & direction or maybe even more parameters. What if cameras exactly same in both scenes, but have say a different shadow settings?

      Have someone a good idea how to solve it, that it will work in all cases?

      Author of [Thea Render for SketchUp](http://www.thearender.com/sketchup)

      1 Reply Last reply Reply Quote 0
      • TIGT Offline
        TIG Moderator
        last edited by

        Can you get the rendering_options of the scene [page] you are transitioning to... and compare some aspect[s] of the active_view's rendering_options with the equivalent[s] of the scene's rendering_options - e.g. sun-direction or date-time ? and return 'true' only when these are found to be equal ?

        TIG

        1 Reply Last reply Reply Quote 0
        • Dan RathbunD Offline
          Dan Rathbun
          last edited by

          You need to use the FrameChangeObserver

          Weirdly it must be attached to the class via a class method (see example).

          1) The simple example is posted in the Google Sketchup API Blog:
          http://sketchupapi.blogspot.com/2009/07/dynamic-components-that-react-to-scene.html

          2) It is not formmatted correctly (if you cut and paste it from the webpage,) so Todd Burch reformatted it, and posted it here:
          http://www.smustard.com/forum/viewtopic.php?f=9&t=25

          IF you use it, RENAME the class "FrameChangeObserver" to something else, WITHIN your own toplevel namespace.
          Ex:

          module Tomasz # <<-- unique toplevel namespace
            module AnimTest
              class FrameSpy
                # modified callback methods
                # from the Google example
              end
          
              # your AnimTest code that uses
              # an instance of your FrameSpy class
          
              # other methods, etc.
          
            end # module
          end # module
          

          I'm not here much anymore.

          1 Reply Last reply Reply Quote 0
          • T Offline
            tomasz
            last edited by

            @tig said:

            Can you get the rendering_options of the scene [page] you are transitioning to... and compare some aspect[s] of the active_view's rendering_options with the equivalent[s] of the scene's rendering_options - e.g. sun-direction or date-time ? and return 'true' only when these are found to be equal ?

            Right. Unfortunately it is what I would like to avoid.

            @dan rathbun said:

            You need to use the FrameChangeObserver

            Weirdly it must be attached to the class via a class method (see example).

            Thank you, this is exactly what I was looking for!
            It is really weird. I have checked all observers, but didn't remember this method hidden in SketchUp::Pages!

            Author of [Thea Render for SketchUp](http://www.thearender.com/sketchup)

            1 Reply Last reply Reply Quote 0
            • Dan RathbunD Offline
              Dan Rathbun
              last edited by

              @unknownuser said:

              Thank you, this is exactly what I was looking for!
              It is really weird. I have checked all observers, but didn't remember this method hidden in SketchUp::Pages!

              Yup.. it is overlooked because is does not have a protoclass defined, nor it's own page in the API reference.

              I'm not here much anymore.

              1 Reply Last reply Reply Quote 0
              • 1 / 1
              • First post
                Last post
              Buy SketchPlus
              Buy SUbD
              Buy WrapR
              Buy eBook
              Buy Modelur
              Buy Vertex Tools
              Buy SketchCuisine
              Buy FormFonts

              Advertisement