def __init__(self, viewer): BUTTON_WIDTH = 72 super().__init__(layoutDirection=VERTICAL) self.viewer = viewer # Title self.children.append(ui.SubTitle(text='##Toon Edges')) # The first row enable = ui.Switch(text='Enable', fixedSize=True, width=80, active=viewer.canvas.renderer.toonRenderEnable) enable.connect_signal('toggled', self.update_enable, enable) insertButton = ui.Button(text='Insert', fixedSize=True, width=BUTTON_WIDTH) removeButton = ui.Button(text='Remove', fixedSize=True, width=BUTTON_WIDTH) copyButton = ui.Button(text='Copy', fixedSize=True, width=BUTTON_WIDTH) self.children.append(ui.make_hbox( fixedSize=True, height=18, children=[enable, insertButton, removeButton, copyButton])) insertButton.connect_signal('clicked', self.insert_edge, .5) removeButton.connect_signal('clicked', self.remove_edge) copyButton.connect_signal('clicked', self.copy) # Edges controllers self.edgeList = ui.make_vbox() edges = viewer.canvas.renderer.toonRenderEdges viewer.canvas.renderer.toonRenderEdges = [] for e in edges: self.insert_edge(e) self.children.append(self.edgeList)
def __init__(self, fixedSize=False, width=400, **kwargs): super().__init__(layoutDirection=HORIZONTAL, **kwargs) self._col1 = ui.make_vbox(fixedSize=True, width=300) # self._col2 = ui.make_vbox(fixedSize=True, width=200) self.children.append(self._col1) # self.children.append(self._col2) self.clear()