I am attempting to test the #view.camera= setter that includes a second argument of a transition time. Instead of manually coding multiple camera objects, I used a multi-scene model. (I have been able to sucessfully sequence through the scenes with a Ruby script by using a UI timer with "Sketchup.send_action ‘pageNext:’ ")
I tried the following:
view = Sketchup.active_model.active_view
Sketchup.active_model.pages.each{|page|
view.camera= page.camera, 2.0
}
The code snippet above does not work, but it does end up at the last camera view, but there was no delays.
Question 1: I have noticed that changing the camera alone with “camera=” does not introduce a “view.refresh”. Shouldn’t passing it a second argument not only interpolate the camera over the transition time, but and update the view as well for each frame?
I tried the same coded and stubbed a simple FrameChangeObserver object. It still did not work. My next attempt was statement below, which causes a syntax error during script loading:
view.camera=( page.camera, 2.0 )
Apparently Ruby does not recognize parenthesis with a setter. According to StackOverflow:
Multiple arguments can be dealt with the “send” method:
view.send(:camera=, page.camera, 2.0 )
The send method statement above caused the following run time exception:
Error: #<ArgumentError: wrong number of arguments (2 for 1)>test.rb:4:in `camera=’
Question #2: What am I doing wrong?