I have chain of 3 bones which are influenced by IK constraint. IK is added to bone named IK B#3:
I'm trying to populate them into array in reverse order, i.e. IK B#1, IK B#2, IK B#3 in that order.
bone_list =  def populate_array(self): index = self.ik.chain_count - 1 currentBone = activeBone for i in range(-1, self.ik.chain_count - 1): print("\nindex is :"+str(index)+"\n\tcurrent bone is: "+str(currentBone.name)) self.bone_list.insert(index, currentBone) index -= 1 currentBone = currentBone.parent #print out array for b in self.bone_list: print(b.name)
Why array is populated in that order, what is wrong with my code?