.scene_transition_finished?
-
I want to make sure that a transition has been finished between two scenes.
When a scene is selectedSketchup.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?
-
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 ?
-
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.html2) 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=25IF 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
-
@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! -
@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 inSketchUp::Pages
!Yup.. it is overlooked because is does not have a protoclass defined, nor it's own page in the API reference.
Advertisement