Exemplo n.º 1
0
	def customview_Init(self, pane):
		'''
		Initialize the viewport, add the PySide widget.
		'''
		global moduleName
		if not (pane or moduleName):
			return False

		# Get the pane
		customPane = lx.object.CustomPane(pane)

		if not customPane.test():
			return False

		# Get the parent QWidget
		parent = customPane.GetParent()
		parentWidget = lx.getQWidget(parent)

		# Check that it suceeds
		if not parentWidget:
			return False

		# import the module we passed
		__import__(moduleName)
		# create the widget by running module.main()
		# main should return a QWidget derivative
		widget = sys.modules[moduleName].main()

		layout = QtGui.QGridLayout()
		layout.setContentsMargins(0, 0, 0, 0)

		layout.addWidget(widget)
		parentWidget.setLayout(layout)
Exemplo n.º 2
0
        def customview_Init(self, pane):
            global _shotgun_parent
            global _shotgun_panel

            log("customview_Init")

            if pane == None:
                return False

            custPane = lx.object.CustomPane(pane)

            if not custPane.test():
                log("unable to create custom pane")
                return False

            # get the parent object
            parent = custPane.GetParent()

            # convert to PySide QWidget
            p = lx.getQWidget(parent)


            # Check that it suceeds
            if p != None:

                log("UI INIT")

                _shotgun_parent = p

                shotgunWidget  = ShotgunWidget(p)
                _shotgun_panel = shotgunWidget

                layout = QtGui.QVBoxLayout()
                layout.addWidget(shotgunWidget)
                layout.setContentsMargins(2,2,2,2)
                p.setLayout(layout)
                
                log("init_tank.bootstrap_tank")
                try:
                    shotgunWidget.reload_shotgun()
                    log("bootstrap completed")
                except:
                    log("bootstrap failed")
                    lx.out("can not import shotgun startup script")

                return True


            return False
Exemplo n.º 3
0
        def customview_Init(self, pane):
            global _shotgun_parent
            global _shotgun_panel

            log("customview_Init")

            if pane == None:
                return False

            custPane = lx.object.CustomPane(pane)

            if not custPane.test():
                log("unable to create custom pane")
                return False

            # get the parent object
            parent = custPane.GetParent()

            # convert to PySide QWidget
            p = lx.getQWidget(parent)

            # Check that it suceeds
            if p != None:

                log("UI INIT")

                _shotgun_parent = p

                shotgunWidget = ShotgunWidget(p)
                _shotgun_panel = shotgunWidget

                layout = QtGui.QVBoxLayout()
                layout.addWidget(shotgunWidget)
                layout.setContentsMargins(2, 2, 2, 2)
                p.setLayout(layout)

                log("init_tank.bootstrap_tank")
                try:
                    shotgunWidget.reload_shotgun()
                    log("bootstrap completed")
                except:
                    log("bootstrap failed")
                    lx.out("can not import shotgun startup script")

                return True

            return False
Exemplo n.º 4
0
    def customview_Init(self, pane):
        if pane is None:
            return False
        custPane = lx.object.CustomPane(pane)
        if not custPane.test():
            return False

        # get the parent object
        parent = custPane.GetParent()

        # convert to PySide QWidget
        widget = lx.getQWidget(parent)

        # Check that it succeeds
        if widget is not None:
            farmodo.buildSubmitterLayout(widget)
            return True

        return False
Exemplo n.º 5
0
    def customview_Init(self, pane):
        if pane is None:
            return False
        custom_pane = lx.object.CustomPane(pane)
        if not custom_pane.test():
            return False
        parent = custom_pane.GetParent()
        widget = lx.getQWidget(parent)
        if widget is not None:

            layout = QtGui.QVBoxLayout()
            self.form = Interface()
            layout.addWidget(self.form)
            widget.setLayout(layout)

            self.form.renderButton.clicked.connect(self.render)
            self.form.randButton.clicked.connect(self.randomize)
            self.form.mmValButton.clicked.connect(self.set_val)

            return True
        return False
Exemplo n.º 6
0
	def customview_Init(self, pane):

		if pane is None:
			return False

		custPane = lx.object.CustomPane(pane)

		if not custPane.test():
			return False

		# get the parent object
		parent = custPane.GetParent()

		# convert to PySide QWidget
		widget = lx.getQWidget(parent)

		# Check that it succeeds
		if widget is not None:

			# Here we create a new layout and add a button to it
			layout = PySide.QtGui.QVBoxLayout()
			exportGrpButton = QPushButton("Export material group")
			createGrpButton = QPushButton("Create material group")
		# Increasing the font size for the button
		# f = exportGrpButton.font()
		# f.setPointSize(30)
		# exportGrpButton.setFont(f)

		# This connects the "clicked" signal of the button to the onClicked function above
		exportGrpButton.clicked.connect(exportMatGrp)
		createGrpButton.clicked.connect(createMatGrp)

		# Adds the button to our layout and adds the layout to our parent widget
		layout.addWidget(exportGrpButton)
		layout.addWidget(createGrpButton)
		layout.setContentsMargins(2, 2, 2, 2)
		widget.setLayout(layout)
		return True

		return False
	def customview_Init(self, pane):
		# Get the pane
		if pane == None:
			return False

		custPane = lx.object.CustomPane(pane)

		if custPane.test() == False:
			return False

		# Get the parent QWidget
		parent = custPane.GetParent()
		parentWidget = lx.getQWidget(parent)

		# Check that it suceeds
		if parentWidget != None:
			layout = QGridLayout()
			layout.setContentsMargins(1,1,1,1)
			self.form = projectmanager.ProjectManager()
			layout.addWidget(self.form)
			parentWidget.setLayout(layout)
			return True

		return False
Exemplo n.º 8
0
	def customview_Init(self, pane):
		'''
		Initialize the viewport, add the LightBank widget, and add a listener.
		'''
		# Get the pane
		if pane == None:
			return False

		custPane = lx.object.CustomPane(pane)

		if custPane.test() == False:
			return False

		# Get the parent QWidget
		parent = custPane.GetParent()
		parentWidget = lx.getQWidget(parent)

		# Check that it suceeds
		if parentWidget != None:
			layout = PySide.QtGui.QGridLayout()
			layout.setContentsMargins( 0,0,0,0 )
			self.form = lightbank.LightBank_Container()
			layout.addWidget(self.form)
			parentWidget.setLayout(layout)

			# Start Item Event listener
			lx.out('LightBank starting - adding Scene Item Listener...')
			self.item_events = sil.ItemEvents (self.itemEvent_Handler)

			# Wrap the listener to ensure we add and remove the same object
			self.com_listener = lx.object.Unknown(self.item_events)
			lx.service.Listener().AddListener(self.com_listener)

			return True

		return False
Exemplo n.º 9
0
    def customview_Init(self, pane):
        '''
		Initialize the viewport, add the LightBank widget, and add a listener.
		'''
        # Get the pane
        if pane == None:
            return False

        custPane = lx.object.CustomPane(pane)

        if custPane.test() == False:
            return False

        # Get the parent QWidget
        parent = custPane.GetParent()
        parentWidget = lx.getQWidget(parent)

        # Check that it suceeds
        if parentWidget != None:
            layout = PySide.QtGui.QGridLayout()
            layout.setContentsMargins(0, 0, 0, 0)
            self.form = lightbank.LightBank_Container()
            layout.addWidget(self.form)
            parentWidget.setLayout(layout)

            # Start Item Event listener
            lx.out('LightBank starting - adding Scene Item Listener...')
            self.item_events = sil.ItemEvents(self.itemEvent_Handler)

            # Wrap the listener to ensure we add and remove the same object
            self.com_listener = lx.object.Unknown(self.item_events)
            lx.service.Listener().AddListener(self.com_listener)

            return True

        return False