示例#1
0
	def __init__( self, title="Select color", color=IECore.Color3f( 1 ), cancelLabel="Cancel", confirmLabel="OK", **kw ) :
	
		GafferUI.Dialogue.__init__( self, title, **kw )
		
		self.__colorChooserWidget = GafferUI.ColorChooser( color )
		self._setWidget( self.__colorChooserWidget )

		self.cancelButton = self._addButton( cancelLabel )
		self.confirmButton = self._addButton( confirmLabel )
示例#2
0
	def __init__( self, title="Select color", color=imath.Color3f( 1 ), cancelLabel="Cancel", confirmLabel="OK", useDisplayTransform = True, **kw ) :

		GafferUI.Dialogue.__init__( self, title, **kw )

		self.__colorChooserWidget = GafferUI.ColorChooser( color, useDisplayTransform = useDisplayTransform )
		self._setWidget( self.__colorChooserWidget )

		self.cancelButton = self._addButton( cancelLabel )
		self.confirmButton = self._addButton( confirmLabel )
示例#3
0
    def __init__(self, node, name):

        GafferUI.Dialogue.__init__(self, "Annotate")

        self.__node = node
        self.__name = name

        template = Gaffer.MetadataAlgo.getAnnotationTemplate(name)
        annotation = Gaffer.MetadataAlgo.getAnnotation(node, name) or template

        with GafferUI.ListContainer(
                GafferUI.ListContainer.Orientation.Vertical,
                spacing=4) as layout:

            self.__textWidget = GafferUI.MultiLineTextWidget(
                text=annotation.text() if annotation else "", )
            self.__textWidget.textChangedSignal().connect(Gaffer.WeakMethod(
                self.__updateButtonStatus),
                                                          scoped=False)

            if not template:
                self.__colorChooser = GafferUI.ColorChooser(
                    annotation.color() if annotation else imath.Color3f(
                        0.15, 0.26, 0.26),
                    useDisplayTransform=False)
                self.__colorChooser.colorChangedSignal().connect(
                    Gaffer.WeakMethod(self.__updateButtonStatus), scoped=False)
            else:
                self.__colorChooser = None

        self._setWidget(layout)

        self.__cancelButton = self._addButton("Cancel")
        self.__removeButton = self._addButton("Remove")
        self.__annotateButton = self._addButton("Annotate")

        self.__updateButtonStatus()