def getAutoOffsetAmount( placeObject, joints=None, axis=AX_Z, threshold=0.65 ): ''' returns a value reflecting the distance from the placeObject to the edge of the bounding box containing the verts skinned to the joints in the joints list the axis controls what edge of the bounding box is used if joints is None, [placeObject] is used ''' if joints is None: joints = [ placeObject ] else: joints = removeDupes( [ placeObject ] + joints ) #make sure the placeObject is the first item in the joints list, otherwise the bounds won't be transformed to the correct space #get the bounds of the geo skinned to the hand and use it to determine default placement of the slider control bounds = rigUtils.getJointBounds( joints ) offsetAmount = abs( bounds[ axis.isNegative() ][ axis % 3 ] ) #print bounds[ 0 ].x, bounds[ 0 ].y, bounds[ 0 ].z, bounds[ 1 ].x, bounds[ 1 ].y, bounds[ 1 ].z return offsetAmount