/**
  * @param chainMember
  * @return returns the segment chain (pinned or unpinned, doesn't matter) to which the inputBone
  *     belongs.
  */
 public SegmentedArmature getChainFor(AbstractBone chainMember) {
   AbstractBone candidate = this.segmentTip;
   while (true) {
     if (candidate == chainMember) return this;
     if (candidate == segmentRoot || candidate.parent == null) {
       break;
     }
     candidate = candidate.parent;
   }
   SegmentedArmature result = null;
   for (SegmentedArmature children : childSegments) {
     result = children.getChainFor(chainMember);
     if (result != null) break;
   }
   return result;
 }