Message 1 of 5
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hello everyone,
For an addin I'm working on, I need to use the isFitView property of the camera object. It works fine on it's own but as soon as I add a change to the camera, the camera does a smooth transition to where it should end up, then snaps back to the position without the fitview. Is this a bug or am I missing something ? In the mean time I simply changed my code to update the camera twice, and it looks and works fine.
Sample code :
import adsk.core, adsk.fusion, traceback, adsk.cam
# Affectations usuelles
handlers = []
app: adsk.core.Application = adsk.core.Application.get()
ui = app.userInterface
def run(context):
try:
viewport = app.activeViewport
camera = viewport.camera
camera.isFitView = True
camera.viewOrientation = adsk.core.ViewOrientations.IsoTopRightViewOrientation
viewport.camera = camera
except:
if ui:
ui.messageBox('Failed:\n{}'.format(traceback.format_exc()))
Attached is a gif showing what happens on a model (the model is just a basic cube).
Solved! Go to Solution.