Advertisement
Urik_Kane

rename_kf1_to_valve.ms

Feb 4th, 2021
140
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.68 KB | None | 0 0
  1. (
  2. local nameMap = #( \
  3. dataPair "CHR_Pelvis" "ValveBiped.Bip01_Pelvis",
  4. dataPair "CHR_Spine1" "ValveBiped.Bip01_Spine",
  5. dataPair "CHR_Spine2" "ValveBiped.Bip01_Spine1",
  6. dataPair "CHR_Spine3" "ValveBiped.Bip01_Spine2",
  7. dataPair "CHR_Ribcage" "ValveBiped.Bip01_Spine4",
  8. dataPair "CHR_Neck" "ValveBiped.Bip01_Neck1",
  9. dataPair "CHR_Head" "ValveBiped.Bip01_Head1",
  10. dataPair "CHR_LArmCollar" "ValveBiped.Bip01_L_Clavicle",
  11. dataPair "CHR_LArmUpper" "ValveBiped.Bip01_L_UpperArm",
  12. dataPair "CHR_LArmForeArm" "ValveBiped.Bip01_L_Forearm",
  13. dataPair "CHR_LArmPalm" "ValveBiped.Bip01_L_Hand",
  14. dataPair "CHR_LArmDigit11" "ValveBiped.Bip01_L_Finger0",
  15. dataPair "CHR_LArmDigit12" "ValveBiped.Bip01_L_Finger01",
  16. dataPair "CHR_LArmDigit13" "ValveBiped.Bip01_L_Finger02",
  17. dataPair "CHR_LArmDigit21" "ValveBiped.Bip01_L_Finger1",
  18. dataPair "CHR_LArmDigit22" "ValveBiped.Bip01_L_Finger11",
  19. dataPair "CHR_LArmDigit23" "ValveBiped.Bip01_L_Finger12",
  20. dataPair "CHR_LArmDigit31" "ValveBiped.Bip01_L_Finger2",
  21. dataPair "CHR_LArmDigit32" "ValveBiped.Bip01_L_Finger21",
  22. dataPair "CHR_LArmDigit33" "ValveBiped.Bip01_L_Finger22",
  23. dataPair "CHR_LArmDigit41" "ValveBiped.Bip01_L_Finger3",
  24. dataPair "CHR_LArmDigit42" "ValveBiped.Bip01_L_Finger31",
  25. dataPair "CHR_LArmDigit43" "ValveBiped.Bip01_L_Finger32",
  26. dataPair "CHR_LArmDigit51" "ValveBiped.Bip01_L_Finger4",
  27. dataPair "CHR_LArmDigit52" "ValveBiped.Bip01_L_Finger41",
  28. dataPair "CHR_LArmDigit53" "ValveBiped.Bip01_L_Finger42",
  29. dataPair "CHR_RArmCollar" "ValveBiped.Bip01_R_Clavicle",
  30. dataPair "CHR_RArmUpper" "ValveBiped.Bip01_R_UpperArm",
  31. dataPair "CHR_RArmForeArm" "ValveBiped.Bip01_R_Forearm",
  32. dataPair "CHR_RArmPalm" "ValveBiped.Bip01_R_Hand",
  33. dataPair "CHR_RArmDigit11" "ValveBiped.Bip01_R_Finger0",
  34. dataPair "CHR_RArmDigit12" "ValveBiped.Bip01_R_Finger01",
  35. dataPair "CHR_RArmDigit13" "ValveBiped.Bip01_R_Finger02",
  36. dataPair "CHR_RArmDigit21" "ValveBiped.Bip01_R_Finger1",
  37. dataPair "CHR_RArmDigit22" "ValveBiped.Bip01_R_Finger11",
  38. dataPair "CHR_RArmDigit23" "ValveBiped.Bip01_R_Finger12",
  39. dataPair "CHR_RArmDigit31" "ValveBiped.Bip01_R_Finger2",
  40. dataPair "CHR_RArmDigit32" "ValveBiped.Bip01_R_Finger21",
  41. dataPair "CHR_RArmDigit33" "ValveBiped.Bip01_R_Finger22",
  42. dataPair "CHR_RArmDigit41" "ValveBiped.Bip01_R_Finger3",
  43. dataPair "CHR_RArmDigit42" "ValveBiped.Bip01_R_Finger31",
  44. dataPair "CHR_RArmDigit43" "ValveBiped.Bip01_R_Finger32",
  45. dataPair "CHR_RArmDigit51" "ValveBiped.Bip01_R_Finger4",
  46. dataPair "CHR_RArmDigit52" "ValveBiped.Bip01_R_Finger41",
  47. dataPair "CHR_RArmDigit53" "ValveBiped.Bip01_R_Finger42",
  48. dataPair "CHR_LThigh" "ValveBiped.Bip01_L_Thigh",
  49. dataPair "CHR_LCalf" "ValveBiped.Bip01_L_Calf",
  50. dataPair "CHR_LAnkle" "ValveBiped.Bip01_L_Foot",
  51. dataPair "CHR_LToe1" "ValveBiped.Bip01_L_Toe0",
  52. dataPair "CHR_RThigh" "ValveBiped.Bip01_R_Thigh",
  53. dataPair "CHR_RCalf" "ValveBiped.Bip01_R_Calf",
  54. dataPair "CHR_RAnkle" "ValveBiped.Bip01_R_Foot",
  55. dataPair "CHR_RToe1" "ValveBiped.Bip01_R_Toe0"
  56.  
  57. -- add more mappings here
  58. )
  59.  
  60. for namePair in nameMap do ( -- check name pattern
  61. for obj in objects where matchPattern obj.name pattern:("*" + namePair.v1 + "*") do ( -- parse all objects that match the pattern with the name of the object
  62. obj.name = substituteString obj.name namePair.v1 namePair.v2 -- replace the strings
  63. )
  64. )
  65. )
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement