src/jmLightToolkit.py
def colorOutlinerSelected(self, color_, enable=True):
        """ Colorize Item selected in outliner. """
        # PREPROCESS
        selected = pm.selected()
        set_color = None
        if color_ == "red":
            set_color = (1.000, 0.500, 0.500)

        elif color_ == "orange":
            set_color = (0.900, 0.700, 0.400)

        elif color_ == "yellow":
            set_color = (1.000, 1.000, 0.500)

        elif color_ == "green":
            set_color = (0.600, 1.000, 0.400)

        elif color_ == "turquoise":
            set_color = (0.300, 1.000, 0.700)

        elif color_ == "cyan":
            set_color = (0.500, 1.000, 1.000)

        elif color_ == "blue":
            set_color = (0.300, 0.700, 1.000)

        elif color_ == "purple":
            set_color = (0.600, 0.400, 1.000)

        elif color_ == "magenta":
            set_color = (1.000, 0.500, 1.000)

        else:
            set_color = (0.000, 0.000, 0.000)

        # Return if selection is empty
        if not selected:
            _logger.warning("Nothing selected")
            return

        # Remove Color outliner
        if not enable:
            for node in selected:
                node.useOutlinerColor.set(False)
            _logger.info("Color Outliner disabled")
            pm.mel.eval("AEdagNodeCommonRefreshOutliners()")
            return

        # Set Color outliner
        for node in selected:
            node.useOutlinerColor.set(True)
            node.outlinerColor.set(set_color)

        pm.mel.eval("AEdagNodeCommonRefreshOutliners()")
        _logger.info("Color Outliner success")
 Colorize Item selected in outliner. 
Colorize Item selected in outliner.
Colorize Item selected in outliner .
def colorOutlinerSelected(self, color_, enable=True):
        selected = pm.selected()
        set_color = None
        if color_ == "red":
            set_color = (1.000, 0.500, 0.500)
        elif color_ == "orange":
            set_color = (0.900, 0.700, 0.400)
        elif color_ == "yellow":
            set_color = (1.000, 1.000, 0.500)
        elif color_ == "green":
            set_color = (0.600, 1.000, 0.400)
        elif color_ == "turquoise":
            set_color = (0.300, 1.000, 0.700)
        elif color_ == "cyan":
            set_color = (0.500, 1.000, 1.000)
        elif color_ == "blue":
            set_color = (0.300, 0.700, 1.000)
        elif color_ == "purple":
            set_color = (0.600, 0.400, 1.000)
        elif color_ == "magenta":
            set_color = (1.000, 0.500, 1.000)
        else:
            set_color = (0.000, 0.000, 0.000)
        if not selected:
            _logger.warning("Nothing selected")
            return
        if not enable:
            for node in selected:
                node.useOutlinerColor.set(False)
            _logger.info("Color Outliner disabled")
            pm.mel.eval("AEdagNodeCommonRefreshOutliners()")
            return
        for node in selected:
            node.useOutlinerColor.set(True)
            node.outlinerColor.set(set_color)
        pm.mel.eval("AEdagNodeCommonRefreshOutliners()")
        _logger.info("Color Outliner success")
def colorOutlinerSelected ( self , color_ , enable = True ) : selected = pm . selected ( ) set_color = None if color_ == "red" : set_color = ( 1.000 , 0.500 , 0.500 ) elif color_ == "orange" : set_color = ( 0.900 , 0.700 , 0.400 ) elif color_ == "yellow" : set_color = ( 1.000 , 1.000 , 0.500 ) elif color_ == "green" : set_color = ( 0.600 , 1.000 , 0.400 ) elif color_ == "turquoise" : set_color = ( 0.300 , 1.000 , 0.700 ) elif color_ == "cyan" : set_color = ( 0.500 , 1.000 , 1.000 ) elif color_ == "blue" : set_color = ( 0.300 , 0.700 , 1.000 ) elif color_ == "purple" : set_color = ( 0.600 , 0.400 , 1.000 ) elif color_ == "magenta" : set_color = ( 1.000 , 0.500 , 1.000 ) else : set_color = ( 0.000 , 0.000 , 0.000 ) if not selected : _logger . warning ( "Nothing selected" ) return if not enable : for node in selected : node . useOutlinerColor . set ( False ) _logger . info ( "Color Outliner disabled" ) pm . mel . eval ( "AEdagNodeCommonRefreshOutliners()" ) return for node in selected : node . useOutlinerColor . set ( True ) node . outlinerColor . set ( set_color ) pm . mel . eval ( "AEdagNodeCommonRefreshOutliners()" ) _logger . info ( "Color Outliner success" )
Colorize Item selected in outliner.
Colorize Item selected in outliner .
""" Colorize Item selected in outliner. """ # PREPROCESS # Return if selection is empty # Remove Color outliner # Set Color outliner
self
color_
enable