title: Adding a cylinder to a joint in Maya
body: <p>I think this is just a declaration issue. I want to constraint one cylinder between 2 joints. This code of block works, it adds a constraint with the weight of 0.5 to every cylinder from all joints. I want to add the constraints in this matter:
  cylinder 1 from joint 1 and 2
  cylinder 2 from joint 2 and 3
  cylinder 3 from joint 3 and 4</p>
  <pre><code>import maya.cmds as cmds
  import math as mt
  
  # CREATE THE CYLINDER ON JOINTS
  cmds.joint (p = (-5, 0, 0))
  cmds.joint (p = (-2, 0, -2))
  cmds.joint (p = (10, 0, -6))
  cmds.joint (p = (10, 0, 3))
  # GET THE RELATIVES FOR THE JOINT CHAIN
  sel = cmds.ls (selection = True)
  jnt_Hi = cmds.listRelatives (sel, allDescendents = True)
  jnt_Hi.extend (sel)
  
  for jnt in jnt_Hi:
      pc = cmds.polyCylinder (name = (jnt + '_cyl'), radius = 1, height = 2, subdivisionsX 
      = 20, subdivisionsY = 1,subdivisionsZ = 1, axis = (0, 1, 0), rcp = 0, createUVs = 3, 
      constructionHistory = 1)
       # CONSTRAINT THE CYLINDER TO THE JOINT
      cmds.pointConstraint (jnt_Hi, pc,
                            weight = 0.5,
                            name = (jnt[0] + 'point_1'))
      cmds.pointConstraint (jnt_Hi, pc,
                            weight = 0.5,
                            name = (jnt[0] + 'point_2'))
  </code></pre>