def createCmd(self): sel = pm.ls(sl=1, fl=1) selVertex = convert.toVertex(sel) BCCs = getBCC() if BCCs: maxNum = int(BCCs[-1].name().split("BCT_ctrl")[-1].split("_MASTER")[0]) else: maxNum = 0 cluster = createCluster(selVertex, "BCT_ctrl{0}".format(maxNum + 1)) fol = createFol(selVertex, "BCT_ctrl{0}".format(maxNum + 1)) ctrl = createCtrl(fol, cluster[1], "BCT_ctrl{0}".format(maxNum + 1)) pm.select(ctrl)
def createCmd(self): sel = pm.ls(sl=1, fl=1) selVertex = convert.toVertex(sel) BCCs = getBCC() if BCCs: maxNum = int(BCCs[-1].name().split('BCT_ctrl')[-1].split('_MASTER')[0]) else : maxNum = 0 cluster = createCluster(selVertex, "BCT_ctrl{0}".format(maxNum+1)) fol = createFol(selVertex, "BCT_ctrl{0}".format(maxNum+1)) ctrl = createCtrl(fol, cluster[1], "BCT_ctrl{0}".format(maxNum+1)) pm.select(ctrl)
def createFol(selection, name): vertexs = convert.toVertex(selection) mesh = vertexs[0].node() posLst = [v.getPosition(space = "world") for v in vertexs] pos = sum(posLst)/len(posLst) fol = follicle.create_follicle_by_position(mesh.getParent().name(), pos) fol = pm.rename(fol, "{0}_fol".format(name)) folShape = fol.getShape() fol.r.unlock() fol.r.disconnect() fol.r.set(0,0,0) folShape.visibility.set(0) return pm.PyNode(fol)
def createFol(selection, name): vertexs = convert.toVertex(selection) mesh = vertexs[0].node() posLst = [v.getPosition(space="world") for v in vertexs] pos = sum(posLst) / len(posLst) fol = follicle.create_follicle_by_position(mesh.getParent().name(), pos) fol = pm.rename(fol, "{0}_fol".format(name)) folShape = fol.getShape() fol.r.unlock() fol.r.disconnect() fol.r.set(0, 0, 0) folShape.visibility.set(0) return pm.PyNode(fol)