1
Substance Painter - Scripting - Re: Python - add_dock_widget
on: May 13, 2020, 08:39:33 am
Hi robert,
yes sur, here a example (with the Ui in attachment) :
yes sur, here a example (with the Ui in attachment) :
Code: [Select]
# Widget Global
self.widget = QtWidgets.QWidget()
self.widget.setObjectName("widget")
# Layout Creation
self.MainLayout = QtWidgets.QVBoxLayout(self.widget)
self.SecondLayout = QtWidgets.QVBoxLayout()
self.groupBoxMapsLayout = QtWidgets.QVBoxLayout()
self.firstHorizBoxMapLayout = QtWidgets.QHBoxLayout()
# Widgets Creation
self.groupBoxMaps = QtWidgets.QGroupBox()
self.btn_exportMaps = QtWidgets.QPushButton("Export")
self.btn_sendToMaya = QtWidgets.QPushButton("Export and Send to Maya")
# Widgets Modif
self.groupBoxMaps.setLayout(self.groupBoxMapsLayout)
# Layout in layout
self.MainLayout.addLayout(self.SecondLayout)
self.groupBoxMapsLayout.addLayout(self.firstHorizBoxMapLayout)
# Widgets in Layout
self.SecondLayout.addWidget(self.groupBoxMaps)
self.groupBoxMapsLayout.addWidget(self.btn_exportMaps)
self.groupBoxMapsLayout.addWidget(self.btn_sendToMaya)
# Add Widget to Painter Window
substance_painter.ui.add_dock_widget(self.widget)
