[REQ]Auto Perspective
-
It's a great idea so I had a go and it seems to work under Windows.
Save this code as a .rb file and drop it into the plugins folder. I'm a Ruby newby so it might violate proper code habits but feel free to comment.
require 'sketchup.rb' module MB class OrbitToPerspectiveObserver < Sketchup;;ToolsObserver def onActiveToolChanged(tools, tool_name, tool_id) if tool_id==10508 camera = Sketchup.active_model.active_view.camera status = camera.perspective? if !status camera.perspective = true end end end end class OrbitAppObserver < Sketchup;;AppObserver def onNewModel(model) model.tools.add_observer(OrbitToPerspectiveObserver.new) end def onOpenModel(model) model.tools.add_observer(OrbitToPerspectiveObserver.new) end end Sketchup.add_observer(OrbitAppObserver.new) end #module
edit: changed the code so it will now auto-start when Sketchup starts OR a new file is made. Note: double-clicking on a file in windows explorer will not get noticed by these observers
-
@rich o brien said:
Snapping out of ortho on orbit seems a logical move.
on the mac, orbit automatically switches to perspective and remains there, doesn't that happen on a PC?
john
-
If I am in ortho and orbit i remain in ortho
-
@driven said:
@rich o brien said:
Snapping out of ortho on orbit seems a logical move.
on the mac, orbit automatically switches to perspective and remains there, doesn't that happen on a PC?
john
I don't see that on my Mac. When I orbit the view shows an isometric view but it is still parallel projection.
-
If I am in ortho and orbit i remain in perspective
-
This is what I see on my Mac:
Front view.
After orbiting.
After manually switching camera to Perspective .
-
@dave r said:
I don't see that on my Mac. When I orbit the view shows an isometric view but it is still parallel projection.
I select Menu >> Camera >> Parallel Projection
I Orbit
I check Menu >> Camera : Perspective is selected
are you seeing something else??
EDIT: I had left the code from above active when I started test, it causes Perspective to 'Stick'
john
-
-
click that image to play it
-
your to quick dave I edited my question because
I had left the code from above active when I started test, it causes Perspective to 'Stick'
oops and thanks
john -
@rich o brien said:
click that image to play it
What did you use to do this Image Rich. It would help in a project I'm developing...
Advertisement