Difference between revisions of "Documentation/Nightly/Developers/Tutorials/ExportToMaya"
From Slicer Wiki
| Line 9: | Line 9: | ||
| − | This code created two files 'tracts.obj' and 'tracts.mtl' | + | This code created two files 'tracts.obj' and 'tracts.mtl' which are available in [[File:OBJtracts.tar OBJtracts.tar]]. |
Revision as of 13:17, 18 December 2013
Home < Documentation < Nightly < Developers < Tutorials < ExportToMayaPython code to capture the contents of the 3D View and export to an OBJ file called 'tracts'
exporter = vtk.vtkOBJExporter()
exporter.SetFilePrefix('/tmp/tracts')
layoutManager = slicer.app.layoutManager()
view = layoutManager.threeDWidget(0).threeDView()
exporter.SetRenderWindow(view.renderWindow())
exporter.Write()
This code created two files 'tracts.obj' and 'tracts.mtl' which are available in File:OBJtracts.tar OBJtracts.tar.