src/jmLightToolkit.py
def quickAlign(self):
        """ Quick Align like 3DS Max. """
        # Get checkbox value
        t_ = self.pushButton_quickAlign_T.isChecked()
        r_ = self.pushButton_quickAlign_R.isChecked()
        s_ = self.pushButton_quickAlign_S.isChecked()

        # Return if no one checkbox checked
        if not t_ and not r_ and not s_:
            _logger.warning("Nothing checked in UI")
            return None

        # Get selection then check it
        selected = pm.selected()
        if not selected:
            _logger.warning("Nothing selected")
            return None

        elif len(selected) < 2:
            _logger.warning("Only one object selected")
            return None

        master = selected[-1]
        slaves = selected[:-1]
        if t_:  # Match translation
            for slave in slaves :
                pm.matchTransform(slave, master, position=True)

        if r_:  # Match rotation
            for slave in slaves :
                pm.matchTransform(slave, master, rotation=True)

        if s_:  # Match scale
            for slave in slaves :
                pm.matchTransform(slave, master, scale=True)

        pm.select(slaves)
        _logger.info("%s aligned to %s" % (slaves, master))
        return True
 Quick Align like 3DS Max. 
Quick Align like 3DS Max.
Quick Align like 3DS Max .
def quickAlign(self):
        t_ = self.pushButton_quickAlign_T.isChecked()
        r_ = self.pushButton_quickAlign_R.isChecked()
        s_ = self.pushButton_quickAlign_S.isChecked()
        if not t_ and not r_ and not s_:
            _logger.warning("Nothing checked in UI")
            return None
        selected = pm.selected()
        if not selected:
            _logger.warning("Nothing selected")
            return None
        elif len(selected) < 2:
            _logger.warning("Only one object selected")
            return None
        master = selected[-1]
        slaves = selected[:-1]
        if t_:  
            for slave in slaves :
                pm.matchTransform(slave, master, position=True)
        if r_:  
            for slave in slaves :
                pm.matchTransform(slave, master, rotation=True)
        if s_:  
            for slave in slaves :
                pm.matchTransform(slave, master, scale=True)
        pm.select(slaves)
        _logger.info("%s aligned to %s" % (slaves, master))
        return True
def quickAlign ( self ) : t_ = self . pushButton_quickAlign_T . isChecked ( ) r_ = self . pushButton_quickAlign_R . isChecked ( ) s_ = self . pushButton_quickAlign_S . isChecked ( ) if not t_ and not r_ and not s_ : _logger . warning ( "Nothing checked in UI" ) return None selected = pm . selected ( ) if not selected : _logger . warning ( "Nothing selected" ) return None elif len ( selected ) < 2 : _logger . warning ( "Only one object selected" ) return None master = selected [ - 1 ] slaves = selected [ : - 1 ] if t_ : for slave in slaves : pm . matchTransform ( slave , master , position = True ) if r_ : for slave in slaves : pm . matchTransform ( slave , master , rotation = True ) if s_ : for slave in slaves : pm . matchTransform ( slave , master , scale = True ) pm . select ( slaves ) _logger . info ( "%s aligned to %s" % ( slaves , master ) ) return True
Quick Align like 3DS Max.
Quick Align like 3DS Max .
""" Quick Align like 3DS Max. """ # Get checkbox value # Return if no one checkbox checked # Get selection then check it # Match translation # Match rotation # Match scale
self