def create_curve(self, name_, type_): self.shape_dic = _shape_dic.load_dic(type_) crv_ = curve(n='{}_CTL'.format(name_), d=self.shape_dic[0], p=self.shape_dic[1], k=self.shape_dic[2]) return crv_, self.shape_dic
def crvShape_(type_): shape_dic = _shape_dic.load_dic(type_) crv_ = curve(d = shape_dic[0], p = shape_dic[1], k = shape_dic[2]) shape_name_match(crv_) return crv_
def create_shape(self): offsets_ = [] dic = self.get_name() for shape_ in dic.keys(): if self.offset > 0: for i in range(self.offset): if self.offset >1: os_name = '{}_{}_{}'.format(shape_,'OS', string.ascii_uppercase[i]) if self.offset ==1: os_name = '{}_{}'.format(shape_,'OS') offset_ = cmds.createNode('transform', n = os_name) cmds.xform(offset_, r = 1, t = dic[shape_][0]) cmds.xform(offset_, r = 1, ro = dic[shape_][1]) offsets_.append(offset_) if i > 0: cmds.parent(offset_, offsets_[i-1]) shape_dic = _shape_dic.load_dic(self.type_) crvShape_ = cmds.curve(n = '{}_{}'.format(shape_, 'CTL'), d = shape_dic[0], p = shape_dic[1], k = shape_dic[2]) cmds.parent(crvShape_, offsets_[-1]) cmds.setAttr(crvShape_ + '.t', 0,0,0) cmds.setAttr(crvShape_ + '.r', 0,0,0) if self.radius: cmds.setAttr(offsets_[-1] + '.s', self.radius, self.radius, self.radius) if self.direct == 'x': pass if self.direct == 'y': cmds.setAttr(offsets_[-1] + '.rz', 90) if self.direct == 'z': cmds.setAttr(offsets_[-1] + '.ry', -90) else: pass cmds.makeIdentity(offsets_[-1], a = True, r=1, s=1, n=0) return crvShape_, offsets_[0]
def crvShape_(object_, type_): shape_dic = _shape_dic.load_dic(type_) _name = object_.name() crv_ = curve(n=_name, d=shape_dic[0], p=shape_dic[1], k=shape_dic[2]) return crv_