Created
February 12, 2018 15:42
-
-
Save pixaline/ed22a4263952338c84cd0ada2fb310c1 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# [["name1", "name2"], ["name3", "name4"]] | |
def fixBones(boneArray): | |
for anim in bpy.data.actions: | |
for fc in anim.fcurves: | |
d = fc.data_path | |
if d.rpartition(".")[2] == "scale": | |
anim.fcurves.remove(fc) | |
else: | |
for i in boneArray: | |
o = str.format('"{}"', i[0]) | |
n = str.format('"{}"', i[1]) | |
if o in d: | |
d = d.replace(o, n) | |
fc.data_path = d | |
if fc.group and i[0] in fc.group.name: | |
fc.group.name = fc.group.name.replace(i[0], i[1]) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment