Skip to content

Commit

Permalink
Better disconnect twist bones
Browse files Browse the repository at this point in the history
  • Loading branch information
johnzero7 committed Feb 2, 2018
1 parent 6622c2b commit 30b0504
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion __init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
bl_info = {
"name": "XNALara/XPS Import/Export",
"author": "johnzero7",
"version": (1, 8, 0),
"version": (1, 8, 1),
"blender": (2, 74, 0),
"location": "File > Import-Export > XNALara/XPS",
"description": "Import-Export XNALara/XPS",
Expand Down
5 changes: 3 additions & 2 deletions import_xnalara_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -467,6 +467,7 @@ def importArmature(autoIk):

def boneTailMiddle(editBones, connectBones):
'''Move bone tail to children middle point'''
twistboneRegex = r'\b(hip)?(twist|ctr|root|adj)\d*\b'
for bone in editBones:
if (bone.name.lower() == "root ground" or not bone.parent):
bone.tail = bone.head.xyz + Vector((0, -.5, 0))
Expand All @@ -475,9 +476,9 @@ def boneTailMiddle(editBones, connectBones):
else:
if visibleBone(bone):
childBones = [childBone for childBone in bone.children
if visibleBone(childBone) and not ('adj' in childBone.name.split() or 'twist' in childBone.name.split())]
if visibleBone(childBone) and not (re.search(twistboneRegex, childBone.name))]
else:
childBones = [childBone for childBone in bone.children if not ('adj' in childBone.name.split() or 'twist' in childBone.name.split())]
childBones = [childBone for childBone in bone.children if not (re.search(twistboneRegex, childBone.name))]

if childBones:
# Set tail to children middle
Expand Down

0 comments on commit 30b0504

Please sign in to comment.