Created
July 5, 2021 21:07
-
-
Save Roumenov/d8fc4dfefde0eca52f88aaa49634d568 to your computer and use it in GitHub Desktop.
because the replace_target_reference() function wasn't well thought out
This file contains 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
import pymel.core as pm | |
import vo_maya.core.vo_export as voe | |
reload(voe) | |
#replace namespace | |
voe.replace_target_namespace("mesh", "r") | |
voe.replace_target_namespace("rig", "r") | |
voe.replace_target_namespace("char", "r") | |
refs = pm.listReferences() | |
print refs | |
badpath = r'/Art_sourcefiles/Characters/scenes/Rigs/Baptiste/Baptiste_RIG.ma' | |
goodpath = r'/PotionomicsSourceAssets/Art_sourcefiles/Characters/scenes/Rigs/baptiste_rig.mb' | |
def fix_bapt_refs(refs, goodpath, badpath): | |
for reference in refs: | |
if reference.path.abspath() == os.path.abspath(badpath): | |
reference.replaceWith(goodpath) | |
else: | |
pass | |
fix_bapt_refs(refs, goodpath, badpath) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment