def param_structure(self, list_): GRPDict = OrderedDict() GRPDict['param'] = _node.space_('param') GRPDict['V_param'] = [ _node.space_('V{}_space'.format(i), parent_=GRPDict['param']) for i in list_ ] return GRPDict
def main_structure(self, name_): GRPDict = OrderedDict() GRPDict['main'] = _node.space_('{}_{}_'.format('main',name_)) addAttr(GRPDict['main'], ln="FK_IK", nn="FK / IK", at="enum", en="IK:FK:", k=1) GRPDict['CTL'] = _node.space_('CTL_', parent_=GRPDict['main']) GRPDict['FK_CTL'] = _node.space_('FK_CTL_', parent_=GRPDict['CTL']) GRPDict['IK_CTL'] = _node.space_('IK_CTL_', parent_=GRPDict['CTL']) GRPDict['JNT'] = _node.space_('JNT_', parent_=GRPDict['main']) return GRPDict
def fourDirectionsCtrl(object_): spc_ = _node.space_(object_.name()) values = [0, 90, 180, -90] name = object_.name().split('Ctrl')[0] for i, value in enumerate(values): name_ = '{0}{1}Ctrl'.format(name, i + 1) ctrl_ = _control.control_([object_], 'triangle') ctrl_[0].rename(name_) grp_ = _node.offset_(ctrl_[0], num_=2) chd_ = grp_.getChildren()[0] chd_.attr('rx').set(value) parent(grp_, spc_)
def curve_at_null(object_): NULLList = [] name_ = object_.name() _shape = object_.getShape() cvs = get_cvs(_shape) for i,pos in enumerate(cvs): select(cl=1) pad_ = _name.padding(i) NULL_name = '{}_{}'.format(name_, pad_) NULL_ = _node.space_(NULL_name, None) _transform.set_trans_xform(NULL_, pos) NULLList.append(NULL_) return NULLList
def surf_param_space(self, object_, uNum, vNum): spaceDict = OrderedDict() _shape = object_.getShape() uMax, vMax = _attribute.surface_uvSpans_num(_shape) _name = object_.name() for v in range(vNum): uList = [] spaceDict[v] = uList for u in range(uNum): name = '{}_U{}_V{}'.format(_name, u, v) _POSI = _node.po_surf_info(name, _shape) _POSI.setAttr('parameterU', u) _POSI.setAttr('parameterV', v) _rotH = _node.rot_helper(name, _POSI) _space = _node.space_(name, parent_=None) addAttr(_space, ln='paramU', sn='pu', at='float', dv=u, min=0, max=uMax, k=1) addAttr(_space, ln='paramV', sn='pv', at='float', dv=v, min=0, max=vMax, k=1) _connect.connect_attrs([_space, _POSI], 'pu', 'parameterU') _connect.connect_attrs([_space, _POSI], 'pv', 'parameterV') _connect.connect_attrs([_POSI, _space], 'p', 't') _DCM = _node.decompose_(name) _connect.connect_attrs([_rotH, _DCM], 'rotateMatrix', 'inputMatrix') _connect.connect_attrs([_DCM, _space], 'or', 'r') uList.append(_space) return spaceDict
def hybrid_structure(self, name_): GRPDict = OrderedDict() GRPDict['hybrid'] = _node.space_('{}_{}_'.format('hybrid',name_)) GRPDict['CTL'] = _node.space_('CTL_', parent_=GRPDict['hybrid']) GRPDict['FK_CTL'] = _node.space_('FK_CTL_', parent_=GRPDict['CTL']) GRPDict['IK_CTL'] = _node.space_('IK_CTL_', parent_=GRPDict['CTL']) GRPDict['JNT'] = _node.space_('JNT_', parent_=GRPDict['hybrid']) GRPDict['bind_JNT'] = _node.space_('bind_JNT_', parent_=GRPDict['JNT']) GRPDict['CRV'] = _node.space_('CRV_', parent_=GRPDict['hybrid']) GRPDict['motion'] = _node.space_('motion_', parent_=GRPDict['hybrid']) GRPDict['IK_motion'] = _node.space_('IK_motion_', parent_=GRPDict['motion']) GRPDict['IK_space'] = _node.space_('IK_space_', parent_=GRPDict['IK_motion']) GRPDict['IK_upVec'] = _node.space_('IK_upVec_', parent_=GRPDict['IK_motion']) return GRPDict
def attach_structure(self, name_): GRPDict = OrderedDict() GRPDict['attach'] = _node.space_('{}_{}_'.format('attach', name_)) GRPDict['CTL'] = _node.space_('attach_CTL_', parent_=GRPDict['attach']) GRPDict['JNT'] = _node.space_('attach_JNT_', parent_=GRPDict['attach']) return GRPDict
def spine_structure(self, name_): GRPDict = OrderedDict() GRPDict['spine'] = _node.space_('{}_{}_'.format('spine', name_)) GRPDict['CTL'] = _node.space_('CTL_', parent_=GRPDict['spine']) GRPDict['FK_CTL'] = _node.space_('FK_CTL_', parent_=GRPDict['CTL']) GRPDict['IK_CTL'] = _node.space_('IK_CTL_', parent_=GRPDict['CTL']) GRPDict['JNT'] = _node.space_('JNT_', parent_=GRPDict['spine']) GRPDict['bind_JNT'] = _node.space_('bind_JNT_', parent_=GRPDict['JNT']) GRPDict['CRV'] = _node.space_('CRV_', parent_=GRPDict['spine']) GRPDict['motion'] = _node.space_('motion_', parent_=GRPDict['spine']) GRPDict['IK_motion'] = _node.space_('IK_motion_', parent_=GRPDict['motion']) GRPDict['IK_space'] = _node.space_('IK_space_', parent_=GRPDict['IK_motion']) GRPDict['IK_upVec'] = _node.space_('IK_upVec_', parent_=GRPDict['IK_motion']) addAttr(GRPDict['spine'], ln="FK_IK", nn="FK / IK", at="enum", en="IK:FK:", k=1) return GRPDict