import maya.cmds as cmds


# This is the controller library where I save curves' coordinates I make
# One day I'll import curves from this file 

# Rename shapes with
def ShapeList(crvControl, name):
    
    shapeList = cmds.listRelatives(crvControl, s = True)
    cmds.rename(shapeList, name + "Shape")

# Cube form
def createCube(nome):
    crvCube = cmds.curve(d=1, p=[(-1, 1, -1), (1, 1, -1),
    (1, 1, 1),
    (-1, 1, 1),
    (-1, -1, 1),
    (-1, -1, -1),
    (-1, 1, -1),
    (-1, 1, 1),
    (-1, -1, 1),
    (1, -1, 1), 
    (1, 1, 1),
    (1, 1, -1),
    (1, -1, -1),
    (1, -1, 1),
    (1, -1, -1),
    (-1, -1, -1)], k=[0 , 1, 2 , 3 , 4 , 5 , 6 , 7 , 8 , 9 , 1.0 , 1.1, 1.2 , 1.3 , 1.4 , 1.5], n=nome )

# Sphere
def createSphere(nome):
    crvSphere = cmds.curve(n=nome, d=1, p=[( 0, 1, 0 ), ( 0, 0.92388, 0.382683 ), ( 0, 0.707107, 0.707107 ), 
                                            ( 0, 0.382683, 0.92388 ), ( 0, 0, 1 ), ( 0, -0.382683, 0.92388 ), ( 0, -0.707107, 0.707107 ), ( 0, -0.92388, 0.382683 ), 
                                            ( 0, -1, 0 ), ( 0, -0.92388, -0.382683 ), ( 0, -0.707107, -0.707107 ), ( 0, -0.382683, -0.92388 ), 
                                            ( 0, 0, -1 ), ( 0, 0.382683, -0.92388 ), ( 0, 0.707107, -0.707107 ), ( 0, 0.92388, -0.382683 ), ( 0, 1, 0 ), 
                                            ( 0.382683, 0.92388, 0 ), ( 0.707107, 0.707107, 0 ), ( 0.92388, 0.382683, 0 ), ( 1, 0, 0 ), ( 0.92388, -0.382683, 0 ), 
                                            ( 0.707107, -0.707107, 0 ), ( 0.382683, -0.92388, 0 ), ( 0, -1, 0 ), ( -0.382683, -0.92388, 0 ), ( -0.707107, -0.707107, 0 ), 
                                            ( -0.92388, -0.382683, 0 ), ( -1, 0, 0 ), ( -0.92388, 0.382683, 0 ), ( -0.707107, 0.707107, 0 ), ( -0.382683, 0.92388, 0 ), 
                                            ( 0, 1, 0 ), ( 0, 0.92388, -0.382683, ), ( 0, 0.707107, -0.707107, ), ( 0, 0.382683, -0.92388, ), ( 0, 0, -1 ), 
                                            ( -0.382683, 0, -0.92388 ), ( -0.707107, 0, -0.707107 ), ( -0.92388, 0, -0.382683 ), ( -1, 0, 0 ), ( -0.92388, 0, 0.382683 ), 
                                            ( -0.707107, 0, 0.707107 ), ( -0.382683, 0, 0.92388 ), ( 0, 0, 1 ), ( 0.382683, 0, 0.92388 ), ( 0.707107, 0, 0.707107 ), 
                                            ( 0.92388, 0, 0.382683 ), ( 1, 0, 0 ), ( 0.92388, 0, -0.382683 ), ( 0.707107, 0, -0.707107 ), ( 0.382683, 0, -0.92388 ), 
                                            ( 0, 0, -1)], 
                                            k= [0 , 1 , 2 , 3 , 4 , 5 , 6 , 7 , 8 , 9 , 10 , 11 , 12 , 13 , 14 , 15 , 16 , 17 , 18 , 19 , 20 , 21 , 22 , 23 , 24 , 
                                            25 , 26 , 27 , 28 , 29 , 30 , 31 , 32 , 33 , 34 , 35 , 36 , 37 , 38 , 39 , 40 , 41 , 42 , 43 , 44 , 45 , 46 , 47 , 
                                            48 , 49 , 50 , 51 , 52])
    ShapeList(crvSphere, nome)
    print ("end createSphere-->", crvSphere)
    return crvSphere

# Hand controller. Simil pyramid
def createHandCtrl(nome):
    attributeController = cmds.curve(d=1, p=[(-1.6691866981302321, -0.8320895690179206, -4.590263419858138),
                                            (1.6691866981302317, -0.8320895690179206, -4.590263419858138),
                                            (1.6691866981302317, -0.8320895690179206, 4.590263419858138),
                                            (-1.6691866981302321, -0.8320895690179206, 4.590263419858138),
                                            (0.0, 0.8318404710680585, 4.590263419858138),
                                            (1.6691866981302317, -0.8320895690179206, 4.590263419858138),
                                            (1.6691866981302317, -0.8320895690179206, -4.590263419858138),
                                            (0.0, 0.8320895690179206, -4.590263419858138),
                                            (-1.6691866981302321, -0.8320895690179206, -4.590263419858138),
                                            (-1.6691866981302321, -0.8320895690179206, 4.590263419858138),
                                            (-1.6691866981302321, -0.8320895690179206, -4.590263419858138),
                                            (-1.6691866981302321, -0.8320895690179206, -4.590263419858138),
                                            (0.0, 0.8320895690179206, -4.590263419858138),
                                            (0.0, 0.8318404710680585, 4.590263419858138)], 
                                            k=[0,1,2,3,4,5,6,7,8,9,10,11,12,13], n=nome)
    print ("end createHandCtrl --->", attributeController)
    ShapeList(attributeController, nome)
    return attributeController


def createClav2(nome):
    print ("call createClav start-->")
    clavController = cmds.curve(d=1, p=[(0.0, -8.113749, -8.70951), (1.637134, -6.501093, -8.441733), (3.274268, -4.966615, -7.878044),
(4.911403, -3.564106, -7.038203),(3.274268, -3.564106, -7.038203),(1.637134, -3.564106, -7.038203),(1.637134, -2.342727, -5.951649),
(1.637134, -1.345292, -4.65647),(1.637134, -0.606765, -3.198066),(1.627559, -0.153032, -1.637134),(3.198066, -0.606765, -1.637134),
(4.65647, -1.345292, -1.637134),(5.951649, -2.342727, -1.637134),(7.038203, -3.564106, -1.637134),
(7.038203, -3.564106, -3.274268),(7.038203, -3.564106, -4.911403),(7.878044, -4.966615, -3.274268),
(8.441733, -6.501093, -1.637134),(8.70951, -8.113749, 0.0),(8.441733, -6.501093, 1.637134),
(7.878044, -4.966615, 3.274268),(7.038203, -3.564106, 4.911403),(7.038203, -3.564106, 3.274268),(7.038203, -3.564106, 1.637134),
(5.951649, -2.342727, 1.637134),(4.65647, -1.345292, 1.637134),(3.198066, -0.606765, 1.637134),(1.627559, -0.153032, 1.637134),
(1.637134, -0.606765, 3.198066),
(1.637134, -1.345292, 4.65647),
(1.637134, -2.342727, 5.951649),
(1.637134, -3.564106, 7.038203),
(3.274268, -3.564106, 7.038203),
(4.911403, -3.564106, 7.038203),
(3.274268, -4.966615, 7.878044),
(1.637134, -6.501093, 8.441733),
(0.0, -8.113749, 8.70951),
(-1.637134, -6.501093, 8.441733),
(-3.274268, -4.966615, 7.878044),
(-4.911403, -3.564106, 7.038203),
(-3.274268, -3.564106, 7.038203),
(-1.637134, -3.564106, 7.038203),
(-1.637134, -2.342727, 5.951649),
(-1.637134, -1.345292, 4.65647),
(-1.637134, -0.606765, 3.198066),
(-1.627559, -0.153032, 1.637134),
(-3.198066, -0.606765, 1.637134),
(-4.65647, -1.345292, 1.637134),
(-5.951649, -2.342727, 1.637134),
(-7.038203, -3.564106, 1.637134),
(-7.038203, -3.564106, 3.274268),
(-7.038203, -3.564106, 4.911403),
(-7.878044, -4.966615, 3.274268),
(-8.441733, -6.501093, 1.637134),
(-8.70951, -8.113749, 0.0),
(-8.441733, -6.501093, -1.637134),
(-7.878044, -4.966615, -3.274268),
(-7.038203, -3.564106, -4.911403),
(-7.038203, -3.564106, -3.274268),
(-7.038203, -3.564106, -1.637134),
(-5.951649, -2.342727, -1.637134),
(-4.65647, -1.345292, -1.637134),(-3.198066, -0.606765, -1.637134),(-1.637134, -0.153032, -1.627559),(-1.637134, -0.606765, -3.198066),
(-1.637134, -1.345292, -4.65647),(-1.637134, -2.342727, -5.951649),(-1.637134, -3.564106, -7.038203),(-3.274268, -3.564106, -7.038203),
(-4.911403, -3.564106, -7.038203), (-3.274268, -4.966615, -7.878044),(-1.637134, -6.501093, -8.441733),
(0.0, -8.113749, -8.70951)], n=nome)

    ShapeList(clavController, nome)
    
    return clavController
import maya.cmds as cmds


# This is the controller library where I save curves' coordinates I make
# One day I'll import curves from this file 

# Rename shapes with
def ShapeList(crvControl, name):
    
    shapeList = cmds.listRelatives(crvControl, s = True)
    cmds.rename(shapeList, name + "Shape")

# Cube form
def createCube(nome):
    crvCube = cmds.curve(d=1, p=[(-1, 1, -1), (1, 1, -1),
    (1, 1, 1),
    (-1, 1, 1),
    (-1, -1, 1),
    (-1, -1, -1),
    (-1, 1, -1),
    (-1, 1, 1),
    (-1, -1, 1),
    (1, -1, 1), 
    (1, 1, 1),
    (1, 1, -1),
    (1, -1, -1),
    (1, -1, 1),
    (1, -1, -1),
    (-1, -1, -1)], k=[0 , 1, 2 , 3 , 4 , 5 , 6 , 7 , 8 , 9 , 1.0 , 1.1, 1.2 , 1.3 , 1.4 , 1.5], n=nome )

# Sphere
def createSphere(nome):
    crvSphere = cmds.curve(n=nome, d=1, p=[( 0, 1, 0 ), ( 0, 0.92388, 0.382683 ), ( 0, 0.707107, 0.707107 ), 
                                            ( 0, 0.382683, 0.92388 ), ( 0, 0, 1 ), ( 0, -0.382683, 0.92388 ), ( 0, -0.707107, 0.707107 ), ( 0, -0.92388, 0.382683 ), 
                                            ( 0, -1, 0 ), ( 0, -0.92388, -0.382683 ), ( 0, -0.707107, -0.707107 ), ( 0, -0.382683, -0.92388 ), 
                                            ( 0, 0, -1 ), ( 0, 0.382683, -0.92388 ), ( 0, 0.707107, -0.707107 ), ( 0, 0.92388, -0.382683 ), ( 0, 1, 0 ), 
                                            ( 0.382683, 0.92388, 0 ), ( 0.707107, 0.707107, 0 ), ( 0.92388, 0.382683, 0 ), ( 1, 0, 0 ), ( 0.92388, -0.382683, 0 ), 
                                            ( 0.707107, -0.707107, 0 ), ( 0.382683, -0.92388, 0 ), ( 0, -1, 0 ), ( -0.382683, -0.92388, 0 ), ( -0.707107, -0.707107, 0 ), 
                                            ( -0.92388, -0.382683, 0 ), ( -1, 0, 0 ), ( -0.92388, 0.382683, 0 ), ( -0.707107, 0.707107, 0 ), ( -0.382683, 0.92388, 0 ), 
                                            ( 0, 1, 0 ), ( 0, 0.92388, -0.382683, ), ( 0, 0.707107, -0.707107, ), ( 0, 0.382683, -0.92388, ), ( 0, 0, -1 ), 
                                            ( -0.382683, 0, -0.92388 ), ( -0.707107, 0, -0.707107 ), ( -0.92388, 0, -0.382683 ), ( -1, 0, 0 ), ( -0.92388, 0, 0.382683 ), 
                                            ( -0.707107, 0, 0.707107 ), ( -0.382683, 0, 0.92388 ), ( 0, 0, 1 ), ( 0.382683, 0, 0.92388 ), ( 0.707107, 0, 0.707107 ), 
                                            ( 0.92388, 0, 0.382683 ), ( 1, 0, 0 ), ( 0.92388, 0, -0.382683 ), ( 0.707107, 0, -0.707107 ), ( 0.382683, 0, -0.92388 ), 
                                            ( 0, 0, -1)], 
                                            k= [0 , 1 , 2 , 3 , 4 , 5 , 6 , 7 , 8 , 9 , 10 , 11 , 12 , 13 , 14 , 15 , 16 , 17 , 18 , 19 , 20 , 21 , 22 , 23 , 24 , 
                                            25 , 26 , 27 , 28 , 29 , 30 , 31 , 32 , 33 , 34 , 35 , 36 , 37 , 38 , 39 , 40 , 41 , 42 , 43 , 44 , 45 , 46 , 47 , 
                                            48 , 49 , 50 , 51 , 52])
    ShapeList(crvSphere, nome)
    print ("end createSphere-->", crvSphere)
    return crvSphere

# Hand controller. Simil pyramid
def createHandCtrl(nome):
    attributeController = cmds.curve(d=1, p=[(-1.6691866981302321, -0.8320895690179206, -4.590263419858138),
                                            (1.6691866981302317, -0.8320895690179206, -4.590263419858138),
                                            (1.6691866981302317, -0.8320895690179206, 4.590263419858138),
                                            (-1.6691866981302321, -0.8320895690179206, 4.590263419858138),
                                            (0.0, 0.8318404710680585, 4.590263419858138),
                                            (1.6691866981302317, -0.8320895690179206, 4.590263419858138),
                                            (1.6691866981302317, -0.8320895690179206, -4.590263419858138),
                                            (0.0, 0.8320895690179206, -4.590263419858138),
                                            (-1.6691866981302321, -0.8320895690179206, -4.590263419858138),
                                            (-1.6691866981302321, -0.8320895690179206, 4.590263419858138),
                                            (-1.6691866981302321, -0.8320895690179206, -4.590263419858138),
                                            (-1.6691866981302321, -0.8320895690179206, -4.590263419858138),
                                            (0.0, 0.8320895690179206, -4.590263419858138),
                                            (0.0, 0.8318404710680585, 4.590263419858138)], 
                                            k=[0,1,2,3,4,5,6,7,8,9,10,11,12,13], n=nome)
    print ("end createHandCtrl --->", attributeController)
    ShapeList(attributeController, nome)
    return attributeController


def createClav2(nome):
    print ("call createClav start-->")
    clavController = cmds.curve(d=1, p=[(0.0, -8.113749, -8.70951), (1.637134, -6.501093, -8.441733), (3.274268, -4.966615, -7.878044),
(4.911403, -3.564106, -7.038203),(3.274268, -3.564106, -7.038203),(1.637134, -3.564106, -7.038203),(1.637134, -2.342727, -5.951649),
(1.637134, -1.345292, -4.65647),(1.637134, -0.606765, -3.198066),(1.627559, -0.153032, -1.637134),(3.198066, -0.606765, -1.637134),
(4.65647, -1.345292, -1.637134),(5.951649, -2.342727, -1.637134),(7.038203, -3.564106, -1.637134),
(7.038203, -3.564106, -3.274268),(7.038203, -3.564106, -4.911403),(7.878044, -4.966615, -3.274268),
(8.441733, -6.501093, -1.637134),(8.70951, -8.113749, 0.0),(8.441733, -6.501093, 1.637134),
(7.878044, -4.966615, 3.274268),(7.038203, -3.564106, 4.911403),(7.038203, -3.564106, 3.274268),(7.038203, -3.564106, 1.637134),
(5.951649, -2.342727, 1.637134),(4.65647, -1.345292, 1.637134),(3.198066, -0.606765, 1.637134),(1.627559, -0.153032, 1.637134),
(1.637134, -0.606765, 3.198066),
(1.637134, -1.345292, 4.65647),
(1.637134, -2.342727, 5.951649),
(1.637134, -3.564106, 7.038203),
(3.274268, -3.564106, 7.038203),
(4.911403, -3.564106, 7.038203),
(3.274268, -4.966615, 7.878044),
(1.637134, -6.501093, 8.441733),
(0.0, -8.113749, 8.70951),
(-1.637134, -6.501093, 8.441733),
(-3.274268, -4.966615, 7.878044),
(-4.911403, -3.564106, 7.038203),
(-3.274268, -3.564106, 7.038203),
(-1.637134, -3.564106, 7.038203),
(-1.637134, -2.342727, 5.951649),
(-1.637134, -1.345292, 4.65647),
(-1.637134, -0.606765, 3.198066),
(-1.627559, -0.153032, 1.637134),
(-3.198066, -0.606765, 1.637134),
(-4.65647, -1.345292, 1.637134),
(-5.951649, -2.342727, 1.637134),
(-7.038203, -3.564106, 1.637134),
(-7.038203, -3.564106, 3.274268),
(-7.038203, -3.564106, 4.911403),
(-7.878044, -4.966615, 3.274268),
(-8.441733, -6.501093, 1.637134),
(-8.70951, -8.113749, 0.0),
(-8.441733, -6.501093, -1.637134),
(-7.878044, -4.966615, -3.274268),
(-7.038203, -3.564106, -4.911403),
(-7.038203, -3.564106, -3.274268),
(-7.038203, -3.564106, -1.637134),
(-5.951649, -2.342727, -1.637134),
(-4.65647, -1.345292, -1.637134),(-3.198066, -0.606765, -1.637134),(-1.637134, -0.153032, -1.627559),(-1.637134, -0.606765, -3.198066),
(-1.637134, -1.345292, -4.65647),(-1.637134, -2.342727, -5.951649),(-1.637134, -3.564106, -7.038203),(-3.274268, -3.564106, -7.038203),
(-4.911403, -3.564106, -7.038203), (-3.274268, -4.966615, -7.878044),(-1.637134, -6.501093, -8.441733),
(0.0, -8.113749, -8.70951)], n=nome)

    ShapeList(clavController, nome)
    
    return clavController
# This is the controller library where I save curves' coordinates I make # One day I'll import curves from this file # Rename shapes with # Cube form # Sphere # Hand controller. Simil pyramid