Skip to content

Instantly share code, notes, and snippets.

@Roumenov
Last active October 4, 2020 03:12
Show Gist options
  • Save Roumenov/cd1a33994fc4b0f0580583981c449e68 to your computer and use it in GitHub Desktop.
Save Roumenov/cd1a33994fc4b0f0580583981c449e68 to your computer and use it in GitHub Desktop.
procedure to clean up messy references
import pymel.core as pm
import vo_maya.core.vo_export as voe
reload(voe)
pm.ogs(pause=True)
controls = [u'Roxanne_rWristFKC', u'Roxanne_rUpperLegCurveC', u'Roxanne_rUpperLegCurve3C', u'Roxanne_rUpperLegCurve2C', u'Roxanne_rUpperLegCurve1C', u'Roxanne_rUpperArmCurve3C', u'Roxanne_rUpperArmCurve2C', u'Roxanne_rUpperArmCurve1C', u'Roxanne_rLowerLegCurveC', u'Roxanne_rLowerLegCurve3C', u'Roxanne_rLowerLegCurve2C', u'Roxanne_rLowerLegCurve1C', u'Roxanne_rLowerArmCurve3C', u'Roxanne_rLowerArmCurve2C', u'Roxanne_rLowerArmCurve1C', u'Roxanne_rKneeFKC', u'Roxanne_rKneeCurveC', u'Roxanne_rElbowFKC', u'Roxanne_rBallFKC', u'Roxanne_rAnkleFKC', u'Roxanne_lWristIKC', u'Roxanne_lUpperLegCurveC', u'Roxanne_lUpperLegCurve3C', u'Roxanne_lUpperLegCurve2C', u'Roxanne_lUpperLegCurve1C', u'Roxanne_lUpperArmCurve3C', u'Roxanne_lUpperArmCurve2C', u'Roxanne_lUpperArmCurve1C', u'Roxanne_lLowerLegCurveC', u'Roxanne_lLowerLegCurve3C', u'Roxanne_lLowerLegCurve2C', u'Roxanne_lLowerLegCurve1C', u'Roxanne_lLowerArmCurve3C', u'Roxanne_lLowerArmCurve2C', u'Roxanne_lLowerArmCurve1C', u'Roxanne_lKneeFKC', u'Roxanne_lKneeCurveC', u'Roxanne_lElbowIKC', u'Roxanne_lBallFKC', u'Roxanne_lAnkleFKC', u'Roxanne_SpineTopFKC', u'Roxanne_SpineMidIKC', u'Roxanne_Spine03CurveC', u'Roxanne_Spine02CurveC', u'Roxanne_Spine01CurveC', u'Roxanne_NeckMidIKC', u'Roxanne_Neck02CurveC', u'Roxanne_Neck01CurveC', u'Roxanne_HeadFKC', u'Roxanne_rHipFKC', u'Roxanne_rWristIKC', u'Roxanne_brow_C_CTL', u'Roxanne_R_brow_CTL_03', u'Roxanne_R_brow_CTL_04', u'Roxanne_L_CoatTailA_FK_02_CTL', u'Roxanne_L_CoatTailA_FK_04_CTL', u'Roxanne_L_CoatTailA_FK_01_CTL', u'Roxanne_L_CoatTailA_FK_03_CTL', u'Roxanne_L_CoatTailA_FK_05_CTL', u'Roxanne_R_CoatTail_FK_02_CTL', u'Roxanne_R_CoatTailB_FK_05_CTL', u'Skel_R_Apron_03_CTL', u'Skel_R_Apron_01_CTL', u'Skel_R_Apron_02_CTL', u'Skel_L_Apron_04_CTL', u'Roxanne_R_shawl_02_CTL', u'Roxanne_R_shawl_01_CTL', u'Roxanne_lFootIKC', u'Roxanne_lKneeIKC', u'Roxanne_lEyeAimC', u'Roxanne_lLegSwitchC', u'Roxanne_JawC', u'Roxanne_C_topTeeth_CTL', u'Roxanne_R_nostril_CTL', u'Roxanne_lFinger1J2C', u'Roxanne_lPalmC', u'Roxanne_lFinger1J1C', u'Roxanne_lFinger2J1C', u'Roxanne_lFinger1J3C', u'Roxanne_L_shawl_02_CTL', u'Roxanne_L_shawl_04_CTL', u'Skel_C_Apron_03_CTL', u'Skel_C_Apron_01_CTL', u'Skel_C_Apron_02_CTL', u'Skel_C_Apron_04_CTL', u'Roxanne_C_shawl_07_CTL', u'Roxanne_L_shawl_06_CTL', u'Roxanne_R_ear_CTL', u'Roxanne_L_ear_CTL', u'Roxanne_R_eyelid_06_CTL', u'Roxanne_Roxanne_R_eyeCrnr_CTL', u'Roxanne_L_eyelid_01_CTL', u'Roxanne_L_botLid_CTL', u'Roxanne_L_eyelid_02_CTL', u'Roxanne_L_eyeCrnr_CTL', u'Roxanne_Spine01FKC', u'Roxanne_MainHipC', u'Roxanne_lFinger4J1C', u'Roxanne_lFinger3J3C', u'Roxanne_lFinger4J2C', u'Roxanne_noseTip_CTL', u'Roxanne_L_nostril_CTL', u'Roxanne_C_BangB_02_CTL', u'Roxanne_C_BangA_07_CTL', u'Roxanne_C_BangB_01_CTL', u'Roxanne_R_BangC_01_CTL', u'Roxanne_Hat_leafA_01_CTL', u'Roxanne_Hat_ballA_CTL', u'Roxanne_Hat_ballB_CTL', u'Roxanne_Hat_leafB_01_CTL', u'Roxanne_C_shawlMain_front_CTL', u'Roxanne_lFinger3J1C', u'Roxanne_lFinger2J2C', u'Roxanne_lFinger2J3C', u'Roxanne_lFinger3J2C', u'Roxanne_rFinger4J1C', u'Roxanne_rFinger3J1C', u'Roxanne_rFinger3J2C', u'Roxanne_rFinger3J3C', u'Roxanne_rFinger4J2C', u'Roxanne_rFinger4J3C', u'Roxanne_rToeIKC', u'Roxanne_lThumbJ1C', u'Roxanne_R_hair_side_CTL', u'Roxanne_R_BangA_04_CTL', u'Roxanne_R_BangA_03_CTL', u'Roxanne_R_BangA_01_CTL', u'Roxanne_R_BangA_02_CTL', u'Roxanne_lLowerArmCurveC', u'Roxanne_lUpperArmCurveC', u'Roxanne_lToeIKC', u'Roxanne_rThumbJ1C', u'Roxanne_HatRoot_CTL', u'Roxanne_R_Corset_CTL', u'Roxanne_R_Breast_03_CTL', u'Roxanne_R_Breast_FK_03_CTL', u'Roxanne_R_Breast_01_CTL', u'Roxanne_L_brow_CTL_04', u'Roxanne_L_brow_CTL_03', u'Roxanne_L_brow_CTL_01', u'Roxanne_L_brow_CTL_02', u'Roxanne_R_orbit_CTL', u'Roxanne_L_bridge_CTL', u'Roxanne_rClavicleC', u'Roxanne_rShoulderFKC', u'Roxanne_L_topLid_02_CTL', u'Roxanne_L_topLid_CTL', u'Roxanne_L_topLid_01_CTL', u'Roxanne_L_eyeDuct_CTL', u'Roxanne_faceBot_CTL', u'Roxanne_R_hair_02_CTL', u'Roxanne_R_HairFeatherE_02_CTL', u'Roxanne_R_HairFeatherE_01_CTL', u'Roxanne_R_hair_01_CTL', u'Roxanne_CoatTail_02_CTL', u'Roxanne_CoatTail_01_CTL', u'Roxanne_R_eyelid_08_CTL', u'Roxanne_R_eyelid_07_CTL', u'Roxanne_lWristFKC', u'Roxanne_lElbowFKC', u'Roxanne_L_CoatFlap_02_CTL', u'Roxanne_L_CoatFlap_01_CTL', u'Roxanne_R_CoatFlap_01_CTL', u'Roxanne_lArmSwitchC', u'Roxanne_lHipFKC', u'Roxanne_R_brow_CTL_01', u'Roxanne_R_brow_CTL', u'Roxanne_R_brow_CTL_02', u'Roxanne_R_eyeSocket_CTL', u'Roxanne_R_CoatTailB_FK_04_CTL', u'Roxanne_R_CoatTailB_FK_02_CTL', u'Roxanne_L_CoatTail_FK_02_CTL', u'Roxanne_L_CoatTailB_FK_05_CTL', u'Roxanne_C_botTeeth_CTL', u'Roxanne_rFinger1J1C', u'Roxanne_rFinger1J3C', u'Roxanne_rFinger1J2C', u'Roxanne_rPalmC', u'Roxanne_rFinger2J3C', u'Roxanne_rFinger2J2C', u'Roxanne_rFinger2J1C', u'Roxanne_rThumbJ2C', u'Roxanne_rThumbJ3C', u'Roxanne_R_eyelid_01_CTL', u'Roxanne_R_eyelid_02_CTL', u'Roxanne_R_eyelid_03_CTL', u'Roxanne_Roxanne_R_eyeDuct_CTL', u'Roxanne_topSkull_CTL', u'Roxanne_L_brow_CTL', u'Roxanne_R_BangC_02_CTL', u'Roxanne_R_BangC_03_CTL', u'Roxanne_L_Bang_02_CTL', u'Roxanne_L_Bang_01_CTL', u'Roxanne_R_CoatTailB_FK_06_CTL', u'Roxanne_R_hairFeatherB_01_CTL', u'Roxanne_R_HairFeatherC_03_CTL', u'Roxanne_R_hairFeatherB_02_CTL', u'Roxanne_L_nose_CTL', u'Roxanne_lElbowCurveC', u'Roxanne_lThumbJ3C', u'Roxanne_lThumbJ2C', u'Roxanne_L_CoatTail_FK_01_CTL', u'Roxanne_L_CoatTailB_FK_03_CTL', u'Roxanne_L_CoatTailA_FK_06_CTL', u'Roxanne_L_CoatTailB_FK_01_CTL', u'Roxanne_Hat_leafC_01_CTL', u'Roxanne_Hat_leafB_02_CTL', u'Roxanne_Hat_leafB_03_CTL', u'Roxanne_HatOrnaments_CTL', u'Roxanne_Hat_leafC_02_CTL', u'Roxanne_L_shawlMain_CTL', u'Roxanne_R_shawlMain_CTL', u'Roxanne_R_shawl_06_CTL', u'Roxanne_R_shawl_05_CTL', u'Roxanne_chin_CTL', u'Roxanne_rFootIKC', u'Roxanne_rKneeIKC', u'Roxanne_R_noseBridge_CTL', u'Roxanne_R_upperCheek_CTL', u'Roxanne_rElbowIKC', u'Roxanne_rArmSwitchC', u'Roxanne_rEyeAimC', u'Roxanne_EyeAimC', u'Roxanne_R_CoatTailA_FK_03_CTL', u'Roxanne_R_CoatTailA_FK_01_CTL', u'Roxanne_R_CoatTailA_FK_05_CTL', u'Roxanne_C_BangA_03_CTL', u'Roxanne_C_BangA_06_CTL', u'Roxanne_C_BangA_05_CTL', u'Roxanne_C_BangA_04_CTL', u'Roxanne_rUpperArmCurveC', u'Roxanne_rLowerArmCurveC', u'Roxanne_C_nose_CTL', u'Roxanne_R_nasoCrnr_CTL', u'Roxanne_R_nose_CTL', u'Roxanne_R_chin_CTL', u'Roxanne_R_nasolab_CTL', u'Roxanne_R_brastrap_mid_CTL', u'Roxanne_L_brastrap_mid_CTL', u'Roxanne_R_brastrap_end_CTL', u'Roxanne_C_brastrap_start_CTL', u'Roxanne_L_brastrap_end_CTL', u'Roxanne_ROOTC', u'Roxanne_R_CoatTailA_FK_04_CTL', u'Skel_C_Apron_05_CTL', u'Skel_C_Apron_06_CTL', u'Skel_L_Apron_02_CTL', u'Skel_L_Apron_03_CTL', u'Skel_L_Apron_01_CTL', u'Skel_C_Apron_07_CTL', u'Roxanne_R_BangB_02_CTL', u'Roxanne_R_BangB_01_CTL', u'Roxanne_R_BangB_03_CTL', u'Roxanne_C_BangA_01_CTL', u'Roxanne_C_BangA_02_CTL', u'Roxanne_R_BangB_04_CTL', u'Roxanne_L_CoatTailB_FK_02_CTL', u'Roxanne_L_CoatTailB_FK_06_CTL', u'Roxanne_lFinger4J3C', u'Roxanne_HeadC', u'Roxanne_rElbowCurveC', u'Roxanne_Neck01FKC', u'Roxanne_Neck02FKC', u'Roxanne_L_noseBridge_CTL', u'Roxanne_L_cheekA_CTL', u'Roxanne_L_upperCheek_CTL', u'Roxanne_L_cheekMain_CTL', u'Roxanne_R_jaw_CTL', u'Roxanne_L_jaw_CTL', u'Roxanne_L_topLip_CTL_01', u'Roxanne_L_topLip_CTL_02', u'Roxanne_L_botLip_CTL_02', u'Roxanne_R_botLip_CTL_02', u'Roxanne_L_botLip_CTL_01', u'Roxanne_R_botLip_CTL_01', u'Roxanne_Rim_02b_CTL', u'Roxanne_Rim_02_CTL', u'Roxanne_Rim_01b_CTL', u'Roxanne_Rim_01_CTL', u'Roxanne_Crown_06_CTL', u'Roxanne_Crown_05_CTL', u'Roxanne_C_botMouth_CTL', u'Roxanne_C_topMouth_CTL', u'Roxanne_lShoulderFKC', u'Roxanne_lClavicleC', u'Roxanne_L_eyeSocket_CTL', u'Roxanne_faceTop_CTL', u'Roxanne_R_bridge_CTL', u'Roxanne_R_hairFeatherA_01_CTL', u'Roxanne_R_hairFeatherB_03_CTL', u'Roxanne_R_hairFeatherB_04_CTL', u'Roxanne_L_HairFeatherB_02_CTL', u'Roxanne_L_HairFeatherB_03_CTL', u'Roxanne_L_HairFeatherC_04_CTL', u'Roxanne_L_HairFeatherB_04_CTL', u'Roxanne_L_HairFeatherA_03_CTL', u'Roxanne_L_HairFeatherA_01_CTL', u'Roxanne_L_HairFeatherA_02_CTL', u'Roxanne_L_Hair_01_CTL', u'Roxanne_R_hairFeatherA_02_CTL', u'Roxanne_R_hairFeatherA_04_CTL', u'Roxanne_R_hairFeatherA_03_CTL', u'Roxanne_L_HairFeatherD_01_CTL', u'Roxanne_L_HairFeatherE_01_CTL', u'Roxanne_L_HairFeatherD_02_CTL', u'Roxanne_L_HairFeatherD_03_CTL', u'Roxanne_L_HairFeatherC_02_CTL', u'Roxanne_L_Hair_02_CTL', u'Roxanne_L_HairFeatherC_03_CTL', u'Roxanne_L_HairFeatherE_03_CTL', u'Roxanne_C_hair_rear_CTL', u'Roxanne_L_HairFeatherE_02_CTL', u'Roxanne_L_hair_side_CTL', u'Roxanne_Spine03FKC', u'Roxanne_Spine02FKC', u'Roxanne_R_CoatTail_FK_01_CTL', u'Roxanne_R_CoatTailB_FK_03_CTL', u'Roxanne_R_CoatFlap_02_CTL', u'Roxanne_R_Collar_CTL', u'Roxanne_L_Collar_CTL', u'Roxanne_C_Collar_CTL', u'Roxanne_R_CoatTailB_FK_01_CTL', u'Roxanne_R_CoatTailA_FK_02_CTL', u'Roxanne_R_CoatTailA_FK_06_CTL', u'Roxanne_L_Breast_FK_02_CTL', u'Roxanne_L_Breast_01_CTL', u'Roxanne_R_GlassesArm_CTL', u'Roxanne_R_Breast_FK_02_CTL', u'Roxanne_R_Breast_02_CTL', u'Roxanne_L_Corset_CTL', u'Roxanne_L_shawl_05_CTL', u'Roxanne_L_shawl_03_CTL', u'Roxanne_C_shawl_00_CTL', u'Roxanne_L_shawl_01_CTL', u'Roxanne_L_Breast_03_CTL', u'Roxanne_L_Breast_FK_03_CTL', u'Roxanne_L_Breast_02_CTL', u'Roxanne_R_zygomArch_CTL', u'Roxanne_R_cheekA_CTL', u'Roxanne_R_cheekMain_CTL', u'Roxanne_R_cheekB_CTL', u'Roxanne_R_shawl_04_CTL', u'Roxanne_R_shawl_03_CTL', u'Roxanne_Hat_leafA_02_CTL', u'Roxanne_L_GlassesArm_CTL', u'Roxanne_Glasses_CTL', u'Roxanne_L_cornerLip_CTL', u'Roxanne_C_botLip_CTL', u'Roxanne_R_cornerLip_CTL', u'Roxanne_C_topLip_CTL', u'Roxanne_R_topLip_CTL_02', u'Roxanne_R_topLip_CTL_01', u'Roxanne_SpineTopIKC', u'Roxanne_L_nasoCrnr_CTL', u'Roxanne_L_nasolab_CTL', u'Roxanne_L_chin_CTL', u'Roxanne_C_bridge_CTL', u'Roxanne_L_orbit_CTL', u'Roxanne_R_HairFeatherC_01_CTL', u'Roxanne_R_HairFeatherC_02_CTL', u'Roxanne_R_HairFeatherD_03_CTL', u'Roxanne_R_HairFeatherD_01_CTL', u'Roxanne_R_HairFeatherE_03_CTL', u'Roxanne_R_HairFeatherD_02_CTL', u'Roxanne_L_cheekB_CTL', u'Roxanne_L_zygomArch_CTL', u'Roxanne_L_Bang_03_CTL', u'Roxanne_Crown_04_CTL', u'Roxanne_Crown_03_CTL', u'Roxanne_Crown_02_CTL', u'Roxanne_Crown_01_CTL', u'Roxanne_C_mouth_CTL', u'Roxanne_R_cornerMouth_CTL', u'Roxanne_L_cornerMouth_CTL', u'Skel_R_Apron_04_CTL', u'Roxanne_rLegSwitchC', u'Roxanne_tail_01_CTL', u'Roxanne_Rim_08b_CTL', u'Roxanne_Rim_08_CTL', u'Roxanne_Rim_07b_CTL', u'Roxanne_Rim_07_CTL', u'Roxanne_Rim_06b_CTL', u'Roxanne_C_shawlMain_back_CTL', u'Roxanne_tail_15_CTL', u'Roxanne_tail_14_CTL', u'Roxanne_tail_13_CTL', u'Roxanne_tail_12_CTL', u'Roxanne_tail_11_CTL', u'Roxanne_tail_10_CTL', u'Roxanne_MainC', u'Roxanne_tail_09_CTL', u'Roxanne_tail_08_CTL', u'Roxanne_tail_07_CTL', u'Roxanne_tail_06_CTL', u'Roxanne_tail_05_CTL', u'Roxanne_tail_04_CTL', u'Roxanne_tail_03_CTL', u'Roxanne_tail_02_CTL', u'Roxanne_Rim_06_CTL', u'Roxanne_Rim_05b_CTL', u'Roxanne_Rim_05_CTL', u'Roxanne_Rim_04b_CTL', u'Roxanne_Rim_04_CTL', u'Roxanne_Rim_03b_CTL', u'Roxanne_Rim_03_CTL']
voe.clean_references(filename = 'Roxanne_Rig.ma', filepath = 'Z:/0_p4v/PotionomicsSourceAssets/Art_sourcefiles/Characters/scenes/Rigs/roxanne_rig.mb')
try:
#voe.replace_target_namespace('r', 'rig')
voe.claim_namespace('Z:/0_p4v/PotionomicsSourceAssets/Art_sourcefiles/Characters/scenes/Rigs/ShopCameraScene.ma', 'cam')
voe.claim_namespace('Z:/0_p4v/PotionomicsSourceAssets/Art_sourcefiles/Characters/scenes/Rigs/roxanne_rig.mb', 'rig')
except Exception as e:
print(e, type(e))
try:
pm.select(pm.ls(controls, recursive = True))
pm.cutKey(clear = True, time = ':', at = ("rcurve", "cwdth", "srate", "ai_curve_shaderr", "ai_curve_shaderg", "ai_curve_shaderb"))
except Exception as e:
print(e, type(e))
pm.ogs(pause=True)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment