Ejemplo n.º 1
0
 def poci_connect(self, object_):
     item = object_[0]
     target = object_[1:]
     _shape = item.getShape()
     param_ = _curve.cvs_at_param(_shape)
     for i, param in enumerate(param_):
         POCI = _node.po_crv_info(_shape)
         setAttr('{}.parameter'.format(POCI), param)
         _connect.connect_attr(POCI, 'p', target[i], 't')
Ejemplo n.º 2
0
def param_at_objectPositions(object_): 
    _curve = object_[0]
    _object = object_[1:]
    params_ = pos_at_param(_curve, _object)
    
    for i,object in enumerate(_object):
        POCI = _node.pointOnCurveInfo_(_curve)
        setAttr('{}.parameter'.format(POCI), params_[i])
        _connect.connect_attr(POCI, 'p', object, 't')
Ejemplo n.º 3
0
def matrixConst(item, target, type_, t=None, r=None, s=None):
    _name = '{}2{}'.format(item.name(),target.name())

    MM_ = _node.multMatrix_(_name)
    DM_ = _node.decompose_(_name)
    
    if type_ == 'local':
        pass
    elif type_ == 'parent':
        offset_ = offsetMatrix(item, target)
        MM_.setAttr('matrixIn[0]', offset_)
    _connect.connect_attr(item, 'wm', MM_, 'matrixIn[1]')
    if target.getParent():
        _connect.connect_attr(target.getParent(), 'wim', MM_, 'matrixIn[2]')
    else:
        _connect.connect_attr(target, 'pim', MM_, 'matrixIn[2]')
    _connect.connect_attr(MM_, 'matrixSum', DM_, 'inputMatrix')
    
    data = {}
    if t is not None:
        data["outputTranslate"] = t
    if r is not None:
        data["outputRotate"] = r
    if s is not None:
        data["outputScale"] = s
    for DItem in data.items():
        connectKwargs(DM_ ,target, DItem[0], DItem[1])
Ejemplo n.º 4
0
 def connect_attrs(self, object_, output, input):
     items, targets = _transform.divide_in_two(object_)
     for i, item in enumerate(items):
         _connect.connect_attr(item, output, targets[i], input)
Ejemplo n.º 5
0
def po_surf_info(name_, _shape):
    _node = createNode('pointOnSurfaceInfo', n='{}PSI'.format(name_))
    _connect.connect_attr(_shape, 'ws', _node, 'is')
    return _node
Ejemplo n.º 6
0
def rot_helper(name_, object_):
    _node = createNode('rotateHelper', n='{}RH'.format(name_))
    _connect.connect_attr(object_, 'n', _node, 'up')
    _connect.connect_attr(object_, 'tv', _node, 'f')
    return _node