<commit_before>from PipelineTools.utilities import *
import string
"""
written by <NAME> 2017
email: <EMAIL>
All code written by me unless specify
"""
###Rigging
class facepart(object):
    def __init__(self, name, bone_name='bon', ctrl_name='ctl', version=1, direction=['Left','Right','Center']):
        self.name = name
        self.bon_suffix = bone_name
        self.ctrl_suffix = ctrl_name
    def create_joint(self):
        pass
    def create_ctrl(self):
        pass

class facial_rig(object):
    def __init__(self):
        self.facebs_name = 'FaceBaseBS'
        self.control_name = "ctl"
        self.joint_name = 'bon'
        self.direction_name = ['Left', 'Right', 'Center']
        self.version_name = list(string.ascii_uppercase)
        self.facepart_name = {
            'eyebrow':['eyebrow','brow'],
            'eye':['eye'],
            'mouth':['mouth'],
            'lip':['lip'],
            'nose':['nose'],
            'cheek':['cheek'], #2 direction, 3 version
            'teethUpper':['teethUpper'],
            'tongue':['tongue'],
            'teethLower':['teethLower'],
            'jaw':['jaw']}
        self.eyebs_name = ['sad', 'smile', 'anger', 'open', 'close']
        self.mouthbs_name = [
            'A', 'I', 'U', 'E', 'O',
            'shout', 'open', 'smileClose', 'angerClose']
        self.connect_atr_list = ['translate','rotate','scale']
    def facebs(self,value=None):
        if value is not None:
            self.facebs_name = value
        self.facebs = get_node(facebs_name)
        return self.facebs
    
    def controls(self):
        self.controls = {}
        self.controls['BS Controls'] = 

    def direction_shortname(self):
        return [n[0] for n in self.direction_name] 

    def add_direction(self, list, add_center=False, shortname=True):
        result = []
        dir_list = self.direction_shortname() if shortname else self.direction_name 
        if add_center is False:
            dir_list.pop(2)
        for item in list:
            for dir in dir_list:
                result.append('_'.join([item, dir]))
        return result

    def connect_bs_controller(self):
        facepart = self.facepart_name
        bs_control_name = ["_".join([n, self.control_name])<commit_msg>fix stuff<commit_after>from PipelineTools.utilities import *
import string
"""
written by <NAME> 2017
email: <EMAIL>
All code written by me unless specify
"""
###Rigging
class FacialEyeRig(object):
    pass
class FacialBonRig(object):
    offset_name = 'offset'
    bone_name = 'bon'
    def __init__(self):
        self._joints = {
            'eye':('LeftA', 'LeftB', 'LeftC', 'LeftD',
                   'SubLeftA', 'SubLeftB', 'SubLeftC', 'SubLeftD'),
            'eyebrow':('LeftA', 'LeftB', 'LeftC'),
            'nose':('Top', 'LeftA'),
            'cheek':('LeftA', 'LeftB', 'LeftC'),
            'jaw':('Root', 'Top'),
            'lip':('CenterA', 'CenterB', 'LeftA', 'LeftB', 'LeftC'),
            'teeth':('Lower', 'Upper'),
            'tongue':(
                'Root',
                'CenterARoot',  'CenterA', 'LeftA',
                'CenterBRoot', 'CenterB', 'LeftB',
                'CenterCRoot', 'CenterC', 'LeftC',
                'CenterDRoot', 'CenterD', 'LeftD')}
        self._get()
    def _get(self):
        self.joints = {}
        for name,variations in self._joints.items():
            self.joints[name] = {}
            for variation in variations:
                offset_bon = '_'.join([name+variation, self.offset_name, self.bone_name])
                bon_name = '_'.join([name+variation, self.bone_name])
                try:
                    self.joints[name]['offset'] = pm.PyNode(offset_bon)
                    self.joints[name]['joint'] = pm.PyNode(bon_name)
                except:
                    print offset_bon,' or', bon_name, ' is not exist'
                    raise
class FacialBsRig(object):
    def __init__(self):
        self.facebs_name = 'FaceBaseBS'
        self.control_name = "ctl"
        self.joint_name = 'bon'
        self.direction_name = ['Left', 'Right', 'Center']
        self.version_name = list(string.ascii_uppercase)
        self.facepart_name = ['eyebrow', 'eye', 'mouth']
        self.eyebs_name = ['sad', 'smile', 'anger', 'open', 'close']
        self.mouthbs_name = [
            'A', 'I', 'U', 'E', 'O',
            'shout', 'open', 'smileClose', 'angerClose']
        self.connect_atr_list = ['translate','rotate','scale']
    def facebs(self,value=None):
        if value is not None:
            self.facebs_name = value
        self.facebs = get_node(facebs_name)
        return self.facebs

    def direction_shortname(self):
        return [n[0] for n in self.direction_name] 

    def add_direction(self, list, add_center=False, shortname=True):
        result = []
        dir_list = self.direction_shortname() if shortname else self.direction_name 
        if add_center is False:
            dir_list.pop(2)
        for item in list:
            for dir in dir_list:
                result.append('_'.join([item, dir]))
        return result

    def connect_bs_controller(self):
        facepart = self.facepart_name
        bs_control_name = ["_".join([n, self.control_name])
{'fraction_non_alphanumeric': 0.14749713412304166, 'fraction_numerical': 0.002865876958349255, 'mean_word_length': 2.245505269683819, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5160472', 'n_tokens_mistral': 1671, 'n_tokens_neox': 1619, 'n_words': 350}