Created
April 12, 2019 22:38
-
-
Save smoofra/8d3088b31a9cb6b587835af08a4ad854 to your computer and use it in GitHub Desktop.
Fusion360: orbit the camera around the target point by 90 degrees
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import adsk.core, adsk.fusion, adsk.cam, traceback | |
from adsk.core import * | |
from math import pi | |
def run(context): | |
ui = None | |
try: | |
app = adsk.core.Application.get() | |
ui = app.userInterface | |
view = app.activeViewport | |
camera = view.camera | |
rot = Matrix3D.create(); | |
rot.setToRotation(2 * pi / 360 * 90, camera.upVector, camera.target) | |
eye = camera.eye | |
eye.transformBy(rot) | |
camera.eye = eye | |
view.camera = camera | |
except: | |
if ui: | |
ui.messageBox('Failed:\n{}'.format(traceback.format_exc())) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment