예제 #1
0
    def getSelectedFaceGroup(self):
        """
        This method uses a non-displayed image containing color-coded faces
        to return the index of the FaceGroup selected by the user with the mouse.
        This is part of a technique called *Selection Using Unique Color IDs* to make each
        FaceGroup independently clickable.

        :return: The selected face group.
        :rtype: :py:class:`module3d.FaceGroup`
        """

        picked = mh.getColorPicked()

        IDkey = picked[0] / 8 | picked[1] / 8 << 5 | picked[2] / 8 << 10  # 555

        # print "DEBUG COLOR PICKED: %s,%s,%s %s"%(picked[0], picked[1], picked[2], IDkey)

        try:
            groupSelected = self.colorIDToFaceGroup[IDkey]
        except:

            # print groupSelected.name
            #this print should only come on while debugging color picking
            #print 'Color %s (%s) not found' % (IDkey, picked)
            groupSelected = None
        return groupSelected
예제 #2
0
 def getSelectedFaceGroup(self):
     picked = mh.getColorPicked()
     return selection.selectionColorMap.getSelectedFaceGroup(picked)
예제 #3
0
 def getSelectedFaceGroup(self):
     picked = mh.getColorPicked()
     return selection.selectionColorMap.getSelectedFaceGroup(picked)