Skip to content

Instantly share code, notes, and snippets.

@7marcus9
Created August 24, 2021 22:28
Show Gist options
  • Save 7marcus9/90680aeb4da211e18a8102d1bad3bc3d to your computer and use it in GitHub Desktop.
Save 7marcus9/90680aeb4da211e18a8102d1bad3bc3d to your computer and use it in GitHub Desktop.
numStep = 360
filename = "c:/tmp/screenshot_{}.png"
import ScreenCapture
cap = ScreenCapture.ScreenCaptureLogic()
layoutManager = slicer.app.layoutManager()
threeDWidget = layoutManager.threeDWidget(0)
threeDView = threeDWidget.threeDView()
threeDView.setPitchRollYawIncrement(360/numStep)
for i in range(numStep):
threeDView.yaw()
threeDView.forceRender()
cap.captureImageFromView(threeDView, filename.format(i))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment