Hi,
It is not possible today to save presets, view all material outputs or load 3d view states using Python.
Exporting renders and textures from the 2d / 3d view is also not exposed in the Python API at the moment.
Depending on what you need to do, maybe there are some alternatives. If you need to take screenshots for
icons or thumbnails, you can use Qt to retrieve the widget image and save that to a file.
Something like this (untested):
def take3DViewScreenShot(uiMgr, fileName):
all3DViews = []
self.__findAll3DViews(uiMgr.getMainWindow(), all3DViews)
if len(all3DViews):
view = all3DViews[0]
pixmap = view.grab()
img = pixmap.toImage()
img.save(fileName)
else:
print("No 3d views found!!!")
return None
def __findAll3DViews(widget, widgets):
if not isinstance(widget, QtWidgets.QWidget):
return
if isinstance(widget, QtWidgets.QOpenGLWidget):
widgets.append(widget)
for w in widget.children():
__findAll3DViews(w, widgets)
Est.