save plugins Fusion 360
This commit is contained in:
1
rotate_Test/.env
Normal file
1
rotate_Test/.env
Normal file
@@ -0,0 +1 @@
|
||||
PYTHONPATH=C:/Users/bartool/AppData/Local/Autodesk/webdeploy/production/9209df45963e1599ff476303834125d21fd43de4/Api/Python/packages
|
||||
20
rotate_Test/.vscode/launch.json
vendored
Normal file
20
rotate_Test/.vscode/launch.json
vendored
Normal file
@@ -0,0 +1,20 @@
|
||||
{
|
||||
"version": "0.2.0",
|
||||
"configurations": [{
|
||||
"name": "Python: Attach",
|
||||
"type": "python",
|
||||
"request": "attach",
|
||||
"pathMappings": [{
|
||||
"localRoot": "${workspaceRoot}",
|
||||
"remoteRoot": "${workspaceRoot}"
|
||||
}],
|
||||
"osx": {
|
||||
"filePath": "${file}"
|
||||
},
|
||||
"windows": {
|
||||
"filePath": "${file}"
|
||||
},
|
||||
"port": 9000,
|
||||
"host": "localhost"
|
||||
}]
|
||||
}
|
||||
5
rotate_Test/.vscode/settings.json
vendored
Normal file
5
rotate_Test/.vscode/settings.json
vendored
Normal file
@@ -0,0 +1,5 @@
|
||||
{
|
||||
"python.autoComplete.extraPaths": ["C:/Users/bartool/AppData/Roaming/Autodesk/Autodesk Fusion 360/API/Python/defs"],
|
||||
"python.analysis.extraPaths": ["C:/Users/bartool/AppData/Roaming/Autodesk/Autodesk Fusion 360/API/Python/defs"],
|
||||
"python.pythonPath": "C:/Users/bartool/AppData/Local/Autodesk/webdeploy/production/9209df45963e1599ff476303834125d21fd43de4/Python/python.exe"
|
||||
}
|
||||
10
rotate_Test/rotate_Test.manifest
Normal file
10
rotate_Test/rotate_Test.manifest
Normal file
@@ -0,0 +1,10 @@
|
||||
{
|
||||
"autodeskProduct": "Fusion360",
|
||||
"type": "script",
|
||||
"author": "",
|
||||
"description": {
|
||||
"": ""
|
||||
},
|
||||
"supportedOS": "windows|mac",
|
||||
"editEnabled": true
|
||||
}
|
||||
58
rotate_Test/rotate_Test.py
Normal file
58
rotate_Test/rotate_Test.py
Normal file
@@ -0,0 +1,58 @@
|
||||
# Author-
|
||||
# Description-
|
||||
|
||||
import math
|
||||
import adsk.core
|
||||
import adsk.fusion
|
||||
import adsk.cam
|
||||
import traceback
|
||||
|
||||
|
||||
def run(context):
|
||||
ui = None
|
||||
try:
|
||||
print('hello, world')
|
||||
app = adsk.core.Application.get()
|
||||
|
||||
move_camera(app, app.activeViewport)
|
||||
|
||||
ui = app.userInterface
|
||||
# ui.messageBox('Hello script')
|
||||
|
||||
except:
|
||||
if ui:
|
||||
ui.messageBox('Failed:\n{}'.format(traceback.format_exc()))
|
||||
|
||||
|
||||
def move_camera(app, view):
|
||||
try:
|
||||
camera = view.camera
|
||||
|
||||
# target = adsk.core.Point3D.create(0, 0, 0)
|
||||
up = adsk.core.Vector3D.create(0, 0, 1)
|
||||
steps = 1000
|
||||
|
||||
eye = camera.eye
|
||||
dist = camera.target.distanceTo(eye)
|
||||
x_eye = eye.x
|
||||
y_eye = eye.y
|
||||
|
||||
for i in range(0, steps):
|
||||
x = dist * math.cos((math.pi*2) * (i/steps)) + x_eye
|
||||
y = dist * math.sin((math.pi*2) * (i/steps)) + y_eye
|
||||
z = eye.z
|
||||
|
||||
eye = adsk.core.Point3D.create(x, y, z)
|
||||
|
||||
camera.eye = eye
|
||||
# camera.target = target
|
||||
# camera.upVector = up
|
||||
|
||||
# camera.isSmoothTransition = False
|
||||
view.camera = camera
|
||||
adsk.doEvents()
|
||||
view.refresh()
|
||||
except:
|
||||
ui = app.userInterface
|
||||
if ui:
|
||||
ui.messageBox('Failed:\n{}'.format(traceback.format_exc()))
|
||||
Reference in New Issue
Block a user