Advertisement
spookymunky

VBS for Constraining a Skyrim Biped Rig to Gear in Softimage

Dec 10th, 2012
195
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. ' This script needs the skyrim bones to be contained in a model
  2. ' To do this, select the root bone "_" and click "Model - Create - Model - New Model"
  3.  
  4. ' Before you run this, open up explorer (8 on the keyboard)
  5. ' Now run this script and it will start a pick session, in explorer click on the model containing the
  6. ' skyrim rig first, then click on the model containing the rig generated by gear
  7.  
  8. ' If you have deleted gear's biped guide, or you don't want a group created for it, either delete or
  9. ' comment out the line starting with CreateGroup "ManGuide_Visibility"
  10. ' and the line after it - SetValue "ManGuide_Visibility.viewvis", 0  (Lines 120,121)
  11.  
  12.  
  13. LogMessage "!!! Pick the Model containing the Skyrim Rig in explorer !!!"
  14. PickObject "Skyrim model", "Skyrim model", PickSession1
  15. LogMessage "!!! Pick the Model containing the Gear Rig in explorer !!!"
  16. PickObject "Gear rig", "Gear rig", PickSession2
  17.  
  18. ApplyCns "Pose", PickSession1 + ".NPC_L_UpperArm__LUar_", PickSession2 + ".arm_L0_0_shd", True
  19. ApplyCns "Pose", PickSession1 + ".NPC_L_UpperarmTwist1__LUt1_", PickSession2 + ".arm_L0_1_shd", True
  20. ApplyCns "Pose", PickSession1 + ".NPC_L_UpperarmTwist2__LUt2_", PickSession2 + ".arm_L0_2_shd", True
  21.  
  22. 'Add a Null to Constrain the Left Forearm to
  23. GetPrim "Null", "Cons_Left_Elbow", "", ""
  24. MatchTransform "Cons_Left_Elbow", PickSession1 + ".NPC_L_Forearm__LLar_", "siTrn", ""
  25. ApplyCns "Pose", "Cons_Left_Elbow", PickSession2 + ".arm_L0_1_jnt", True
  26.  
  27. ApplyCns "Pose", PickSession1 + ".NPC_L_Forearm__LLar_", "Cons_Left_Elbow", True
  28. ApplyCns "Pose", PickSession1 + ".NPC_L_ForearmTwist2__LLt2_", PickSession2 + ".arm_L0_4_shd", True
  29. ApplyCns "Pose", PickSession1 + ".NPC_L_ForearmTwist1__LLt1_", PickSession2 + ".arm_L0_5_shd", True
  30. ApplyCns "Pose", PickSession1 + ".NPC_L_Hand__LHnd_", PickSession2 + ".meta_L0_0_shd", True
  31. ApplyCns "Pose", PickSession1 + ".NPC_L_Finger00__LF00_", PickSession2 + ".thumb_L0_0_shd", True
  32. ApplyCns "Pose", PickSession1 + ".NPC_L_Finger01__LF01_", PickSession2 + ".thumb_L0_1_shd", True
  33. ApplyCns "Pose", PickSession1 + ".NPC_L_Finger02__LF02_", PickSession2 + ".thumb_L0_2_shd", True
  34. ApplyCns "Pose", PickSession1 + ".NPC_L_Finger10__LF10_", PickSession2 + ".finger_L0_0_shd", True
  35. ApplyCns "Pose", PickSession1 + ".NPC_L_Finger11__LF11_", PickSession2 + ".finger_L0_1_shd", True
  36. ApplyCns "Pose", PickSession1 + ".NPC_L_Finger12__LF12_", PickSession2 + ".finger_L0_2_shd", True
  37. ApplyCns "Pose", PickSession1 + ".NPC_L_Finger20__LF20_", PickSession2 + ".finger_L1_0_shd", True
  38. ApplyCns "Pose", PickSession1 + ".NPC_L_Finger21__LF21_", PickSession2 + ".finger_L1_1_shd", True
  39. ApplyCns "Pose", PickSession1 + ".NPC_L_Finger22__LF22_", PickSession2 + ".finger_L1_2_shd", True
  40. ApplyCns "Pose", PickSession1 + ".NPC_L_Finger30__LF30_", PickSession2 + ".finger_L2_0_shd", True
  41. ApplyCns "Pose", PickSession1 + ".NPC_L_Finger31__LF31_", PickSession2 + ".finger_L2_1_shd", True
  42. ApplyCns "Pose", PickSession1 + ".NPC_L_Finger32__LF32_", PickSession2 + ".finger_L2_2_shd", True
  43. ApplyCns "Pose", PickSession1 + ".NPC_L_Finger40__LF40_", PickSession2 + ".finger_L3_0_shd", True
  44. ApplyCns "Pose", PickSession1 + ".NPC_L_Finger41__LF41_", PickSession2 + ".finger_L3_1_shd", True
  45. ApplyCns "Pose", PickSession1 + ".NPC_L_Finger42__LF42_", PickSession2 + ".finger_L3_2_shd", True
  46. ApplyCns "Pose", PickSession1 + ".NPC_R_UpperArm__RUar_", PickSession2 + ".arm_R0_0_shd", True
  47. ApplyCns "Pose", PickSession1 + ".NPC_R_UpperarmTwist1__RUt1_", PickSession2 + ".arm_R0_1_shd", True
  48. ApplyCns "Pose", PickSession1 + ".NPC_R_UpperarmTwist2__RUt2_", PickSession2 + ".arm_R0_2_shd", True
  49.  
  50. 'Add a Null to Constrain the Right Forearm to
  51. GetPrim "Null", "Cons_Right_Elbow", "", ""
  52. MatchTransform "Cons_Right_Elbow", PickSession1 + ".NPC_R_Forearm__RLar_", "siTrn", ""
  53. ApplyCns "Pose", "Cons_Right_Elbow", PickSession2 + ".arm_R0_1_jnt", True
  54.  
  55. ApplyCns "Pose", PickSession1 + ".NPC_R_Forearm__RLar_", "Cons_Right_Elbow", True
  56. ApplyCns "Pose", PickSession1 + ".NPC_R_ForearmTwist2__RLt2_", PickSession2 + ".arm_R0_4_shd", True
  57. ApplyCns "Pose", PickSession1 + ".NPC_R_ForearmTwist1__RLt1_", PickSession2 + ".arm_R0_5_shd", True
  58. ApplyCns "Pose", PickSession1 + ".NPC_R_Hand__RHnd_", PickSession2 + ".meta_R0_0_shd", True
  59. ApplyCns "Pose", PickSession1 + ".NPC_R_Finger00__RF00_", PickSession2 + ".thumb_R0_0_shd", True
  60. ApplyCns "Pose", PickSession1 + ".NPC_R_Finger01__RF01_", PickSession2 + ".thumb_R0_1_shd", True
  61. ApplyCns "Pose", PickSession1 + ".NPC_R_Finger02__RF02_", PickSession2 + ".thumb_R0_2_shd", True
  62. ApplyCns "Pose", PickSession1 + ".NPC_R_Finger10__RF10_", PickSession2 + ".finger_R0_0_shd", True
  63. ApplyCns "Pose", PickSession1 + ".NPC_R_Finger11__RF11_", PickSession2 + ".finger_R0_1_shd", True
  64. ApplyCns "Pose", PickSession1 + ".NPC_R_Finger12__RF12_", PickSession2 + ".finger_R0_2_shd", True
  65. ApplyCns "Pose", PickSession1 + ".NPC_R_Finger20__RF20_", PickSession2 + ".finger_R1_0_shd", True
  66. ApplyCns "Pose", PickSession1 + ".NPC_R_Finger21__RF21_", PickSession2 + ".finger_R1_1_shd", True
  67. ApplyCns "Pose", PickSession1 + ".NPC_R_Finger22__RF22_", PickSession2 + ".finger_R1_2_shd", True
  68. ApplyCns "Pose", PickSession1 + ".NPC_R_Finger32__RF32_", PickSession2 + ".finger_R2_2_shd", True
  69. ApplyCns "Pose", PickSession1 + ".NPC_R_Finger31__RF31_", PickSession2 + ".finger_R2_1_shd", True
  70. ApplyCns "Pose", PickSession1 + ".NPC_R_Finger30__RF30_", PickSession2 + ".finger_R2_0_shd", True
  71. ApplyCns "Pose", PickSession1 + ".NPC_R_Finger40__RF40_", PickSession2 + ".finger_R3_0_shd", True
  72. ApplyCns "Pose", PickSession1 + ".NPC_R_Finger41__RF41_", PickSession2 + ".finger_R3_1_shd", True
  73. ApplyCns "Pose", PickSession1 + ".NPC_R_Finger42__RF42_", PickSession2 + ".finger_R3_2_shd", True
  74. ApplyCns "Pose", PickSession1 + ".NPC_R_Thigh__RThg_", PickSession2 + ".leg_R0_0_shd", True
  75. ApplyCns "Pose", PickSession1 + ".NPC_L_Thigh__LThg_", PickSession2 + ".leg_L0_0_shd", True
  76.  
  77. 'Add a Null to Constrain the Right Knee to
  78. GetPrim "Null", "Cons_Right_Knee", "", ""
  79. MatchTransform "Cons_Right_Knee", PickSession1 + ".NPC_R_Calf__RClf_", "siTrn", ""
  80. ApplyCns "Pose", "Cons_Right_Knee", PickSession2 + ".leg_R0_1_jnt", True
  81.  
  82. ApplyCns "Pose", PickSession1 + ".NPC_R_Calf__RClf_", "Cons_Right_Knee", True
  83. ApplyCns "Pose", PickSession1 + ".NPC_R_ToePivot", PickSession2 + ".foot_R0_bk0_ctl", True
  84. ApplyCns "Pose", PickSession1 + ".NPC_R_Toe0__RToe_", PickSession2 + ".foot_R0_2_shd", True
  85. ApplyCns "Pose", PickSession1 + ".NPC_R_FootBox", PickSession2 + ".foot_R0_1_shd", True
  86. ApplyCns "Pose", PickSession1 + ".NPC_R_Foot__Rft__", PickSession2 + ".leg_R0_end_shd", True
  87.  
  88. 'Add a Null to Constrain the Left Knee to
  89. GetPrim "Null", "Cons_Left_Knee", "", ""
  90. MatchTransform "Cons_Left_Knee", PickSession1 + ".NPC_L_Calf__LClf_", "siTrn", ""
  91. ApplyCns "Pose", "Cons_Left_Knee", PickSession2 + ".leg_L0_1_jnt", True
  92.  
  93. ApplyCns "Pose", PickSession1 + ".NPC_L_Calf__LClf_", "Cons_Left_Knee", True
  94. ApplyCns "Pose", PickSession1 + ".NPC_L_Foot__LLft__", PickSession2 + ".leg_L0_end_shd", True
  95. ApplyCns "Pose", PickSession1 + ".NPC_L_FootBox", PickSession2 + ".foot_L0_1_shd", True
  96. ApplyCns "Pose", PickSession1 + ".NPC_L_Toe0__LToe_", PickSession2 + ".foot_L0_2_shd", True
  97. ApplyCns "Pose", PickSession1 + ".NPC_L_ToePivot", PickSession2 + ".foot_L0_bk0_ctl", True
  98.  
  99. ApplyCns "Pose", PickSession1 + ".NPC_COM__COM__", PickSession2 + ".spine_C0_ik0_ctl", True
  100. ApplyCns "Pose", PickSession1 + ".NPC_Spine__Spn0_", PickSession2 + ".spine_C0_0_shd", True
  101. ApplyCns "Pose", PickSession1 + ".NPC_Spine1__Spn1_", PickSession2 + ".spine_C0_1_shd", True
  102. ApplyCns "Pose", PickSession1 + ".NPC_Spine2__Spn2_", PickSession2 + ".spine_C0_2_shd", True
  103. ApplyCns "Pose", PickSession1 + ".NPC_R_Clavicle__RClv_", PickSession2 + ".shoulder_R0_0_shd", True
  104. ApplyCns "Pose", PickSession1 + ".NPC_L_Clavicle__LClv_", PickSession2 + ".shoulder_L0_0_shd", True
  105. ApplyCns "Pose", PickSession1 + ".NPC_Neck__Neck_", PickSession2 + ".neck_C0_0_shd", True
  106. ApplyCns "Pose", PickSession1 + ".NPC_Head__Head_", PickSession2 + ".neck_C0_head_shd", True
  107.  
  108. 'Create a group for the Constraint Nulls I added and hide them
  109. CreateGroup "JointConst", "Cons_Left_Elbow, Cons_Left_Knee, Cons_Right_Elbow, Cons_Right_Knee"
  110. SetValue "JointConst.viewvis", 0
  111.  
  112. 'Move the Constraint Nulls to the Gear Model
  113. ParentObj PickSession2, "Cons_Left_Elbow"
  114. ParentObj PickSession2, "Cons_Right_Elbow"
  115. ParentObj PickSession2, "Cons_Right_Knee"
  116. ParentObj PickSession2, "Cons_Left_Knee"
  117. CopyPaste "JointConst", , PickSession2 , 1
  118.  
  119. 'Create a group for the Gear Character Guide and hide it
  120. CreateGroup "ManGuide_Visibility", "man_guide,man_guide.controlers_org,man_guide.foot_R0_fk0_ctl,man_guide.foot_R0_fk1_ctl,man_guide.spine_C0_fk1_ctl,man_guide.arm_R0_upv_ctl,man_guide.finger_R0_fk0_ctl,man_guide.finger_R3_fk0_ctl,man_guide.spine_C0_fk2_ctl,man_guide.finger_L0_fk2_ctl,man_guide.finger_R2_fk2_ctl,man_guide.foot_L0_roll_ctl,man_guide.arm_L0_fk1_ctl,man_guide.arm_L0_fk0_ctl,man_guide.toe_R3_fk0_ctl,man_guide.finger_L2_fk0_ctl,man_guide.thumb_R0_fk0_ctl,man_guide.finger_L1_fk1_ctl,man_guide.finger_L3_fk0_ctl,man_guide.finger_L3_fk1_ctl,man_guide.meta_L0_end_ctl,man_guide.shoulder_L0_fk0_ctl,man_guide.finger_R0_fk2_ctl,man_guide.toe_L3_fk0_ctl,man_guide.finger_L1_fk2_ctl,man_guide.finger_L0_fk0_ctl,man_guide.leg_L0_upv_ctl,man_guide.toe_L2_fk0_ctl,man_guide.finger_L0_fk1_ctl,man_guide.finger_R2_fk0_ctl,man_guide.finger_L2_fk1_ctl,man_guide.toe_L4_fk0_ctl,man_guide.thumb_R0_fk1_ctl,man_guide.leg_L0_ik_ctl,man_guide.arm_L0_upv_ctl,man_guide.foot_L0_fk2_ctl,man_guide.meta_R0_end_ctl,man_guide.foot_L0_fk1_ctl,man_guide.shoulder_R0_fk0_ctl,man_guide.finger_R3_fk1_ctl,man_guide.finger_R1_fk0_ctl,man_guide.toe_L0_fk0_ctl,man_guide.foot_R0_bk3_ctl,man_guide.finger_L3_fk2_ctl,man_guide.finger_L2_fk2_ctl,man_guide.toe_R4_fk0_ctl,man_guide.arm_R0_fk0_ctl,man_guide.thumb_L0_fk0_ctl,man_guide.finger_R0_fk1_ctl,man_guide.toe_R2_fk0_ctl,man_guide.finger_R1_fk1_ctl,man_guide.finger_L1_fk0_ctl,man_guide.toe_R0_fk0_ctl,man_guide.finger_R3_fk2_ctl,man_guide.spine_C0_fk0_ctl,man_guide.leg_R0_ik_ctl,man_guide.foot_L0_fk0_ctl,man_guide.finger_R1_fk2_ctl,man_guide.thumb_L0_fk1_ctl,man_guide.leg_R0_upv_ctl,man_guide.arm_R0_fk2_ctl,man_guide.arm_R0_fk1_ctl,man_guide.foot_L0_bk3_ctl,man_guide.neck_C0_head_ctl,man_guide.thumb_L0_fk2_ctl,man_guide.thumb_R0_fk2_ctl,man_guide.spine_C0_ik1_ctl,man_guide.finger_R2_fk1_ctl,man_guide.toe_L1_fk0_ctl,man_guide.foot_R0_fk2_ctl,man_guide.toe_R1_fk0_ctl,man_guide.foot_R0_roll_ctl,man_guide.local_C1_root,man_guide.local_C1_icon,man_guide.body_C0_root,man_guide.body_C0_icon,man_guide.spine_C0_root,man_guide.spine_C0_eff,man_guide.neck_C0_root,man_guide.neck_C0_neck,man_guide.neck_C0_head,man_guide.neck_C0_eff,man_guide.uispine_C0_root,man_guide.uispine_C0_icon,man_guide.uiarms_C0_root,man_guide.uiarms_C0_icon,man_guide.uilegs_C0_root,man_guide.uilegs_C0_icon,man_guide.uiface_C0_root,man_guide.uiface_C0_icon,man_guide.neck_C0_tan1,man_guide.neck_C0_head_crv,man_guide.neck_C0_tan0,man_guide.neck_C0_blade,man_guide.neck_C0_neck_crv,man_guide.shoulder_R0_root,man_guide.shoulder_R0_0_loc,man_guide.arm_R0_root,man_guide.arm_R0_elbow,man_guide.arm_R0_wrist,man_guide.arm_R0_eff,man_guide.meta_R0_root,man_guide.meta_R0_0_loc,man_guide.meta_R0_1_loc,man_guide.meta_R0_2_loc,man_guide.finger_R3_root,man_guide.finger_R3_0_loc,man_guide.finger_R3_1_loc,man_guide.finger_R3_2_loc,man_guide.finger_R3_blade,man_guide.finger_R3_crv,man_guide.finger_R2_root,man_guide.finger_R2_0_loc,man_guide.finger_R2_1_loc,man_guide.finger_R2_2_loc,man_guide.finger_R2_blade,man_guide.finger_R2_crv,man_guide.finger_R1_root,man_guide.finger_R1_0_loc,man_guide.finger_R1_1_loc,man_guide.finger_R1_2_loc,man_guide.finger_R1_blade,man_guide.finger_R1_crv,man_guide.meta_R0_crv,man_guide.finger_R0_root,man_guide.finger_R0_0_loc,man_guide.finger_R0_1_loc,man_guide.finger_R0_2_loc,man_guide.finger_R0_blade,man_guide.finger_R0_crv,man_guide.thumb_R0_root,man_guide.thumb_R0_0_loc,man_guide.thumb_R0_1_loc,man_guide.thumb_R0_2_loc,man_guide.thumb_R0_blade,man_guide.thumb_R0_crv,man_guide.arm_R0_crv,man_guide.shoulder_R0_blade,man_guide.shoulder_R0_crv,man_guide.shoulder_L0_root,man_guide.shoulder_L0_0_loc,man_guide.arm_L0_root,man_guide.arm_L0_elbow,man_guide.arm_L0_wrist,man_guide.arm_L0_eff,man_guide.meta_L0_root,man_guide.meta_L0_0_loc,man_guide.meta_L0_1_loc,man_guide.meta_L0_2_loc,man_guide.finger_L3_root,man_guide.finger_L3_0_loc,man_guide.finger_L3_1_loc,man_guide.finger_L3_2_loc,man_guide.finger_L3_blade,man_guide.finger_L3_crv,man_guide.finger_L2_root,man_guide.finger_L2_0_loc,man_guide.finger_L2_1_loc,man_guide.finger_L2_2_loc,man_guide.finger_L2_blade,man_guide.finger_L2_crv,man_guide.finger_L1_root,man_guide.finger_L1_0_loc,man_guide.finger_L1_1_loc,man_guide.finger_L1_2_loc,man_guide.finger_L1_blade,man_guide.finger_L1_crv,man_guide.meta_L0_crv,man_guide.finger_L0_root,man_guide.finger_L0_0_loc,man_guide.finger_L0_1_loc,man_guide.finger_L0_2_loc,man_guide.finger_L0_blade,man_guide.finger_L0_crv,man_guide.thumb_L0_root,man_guide.thumb_L0_0_loc,man_guide.thumb_L0_1_loc,man_guide.thumb_L0_2_loc,man_guide.thumb_L0_blade,man_guide.thumb_L0_crv,man_guide.arm_L0_crv,man_guide.shoulder_L0_blade,man_guide.shoulder_L0_crv,man_guide.spine_C0_blade,man_guide.spine_C0_crv,man_guide.leg_L0_root,man_guide.leg_L0_knee,man_guide.leg_L0_ankle,man_guide.leg_L0_eff,man_guide.foot_L0_root,man_guide.foot_L0_0_loc,man_guide.foot_L0_1_loc,man_guide.foot_L0_2_loc,man_guide.foot_L0_3_loc,man_guide.toe_L0_root,man_guide.toe_L0_0_loc,man_guide.toe_L0_blade,man_guide.toe_L0_crv,man_guide.toe_L1_root,man_guide.toe_L1_0_loc,man_guide.toe_L1_blade,man_guide.toe_L1_crv,man_guide.toe_L2_root,man_guide.toe_L2_0_loc,man_guide.toe_L2_blade,man_guide.toe_L2_crv,man_guide.toe_L3_root,man_guide.toe_L3_0_loc,man_guide.toe_L3_blade,man_guide.toe_L3_crv,man_guide.toe_L4_root,man_guide.toe_L4_0_loc,man_guide.toe_L4_blade,man_guide.toe_L4_crv,man_guide.foot_L0_crv,man_guide.foot_L0_heel,man_guide.foot_L0_outpivot,man_guide.foot_L0_inpivot,man_guide.foot_L0_1,man_guide.leg_L0_crv,man_guide.leg_R0_root,man_guide.leg_R0_knee,man_guide.leg_R0_ankle,man_guide.leg_R0_eff,man_guide.foot_R0_root,man_guide.foot_R0_0_loc,man_guide.foot_R0_1_loc,man_guide.foot_R0_2_loc,man_guide.foot_R0_3_loc,man_guide.toe_R0_root,man_guide.toe_R0_0_loc,man_guide.toe_R0_blade,man_guide.toe_R0_crv,man_guide.toe_R1_root,man_guide.toe_R1_0_loc,man_guide.toe_R1_blade,man_guide.toe_R1_crv,man_guide.toe_R2_root,man_guide.toe_R2_0_loc,man_guide.toe_R2_blade,man_guide.toe_R2_crv,man_guide.toe_R3_root,man_guide.toe_R3_0_loc,man_guide.toe_R3_blade,man_guide.toe_R3_crv,man_guide.toe_R4_root,man_guide.toe_R4_0_loc,man_guide.toe_R4_blade,man_guide.toe_R4_crv,man_guide.foot_R0_crv,man_guide.foot_R0_heel,man_guide.foot_R0_outpivot,man_guide.foot_R0_inpivot,man_guide.foot_R0_1,man_guide.leg_R0_crv"
  121. SetValue "ManGuide_Visibility.viewvis", 0
  122.  
  123. 'Create a group for the toe bones in the gear rig and hide them
  124. CreateGroup "HideTheToes"
  125. AddToGroup "HideTheToes", PickSession2 + ".toe_L2_fk0_ctl"
  126. AddToGroup "HideTheToes", PickSession2 + ".toe_L4_fk0_ctl"
  127. AddToGroup "HideTheToes", PickSession2 + ".toe_L3_fk0_ctl"
  128. AddToGroup "HideTheToes", PickSession2 + ".toe_L1_fk0_ctl"
  129. AddToGroup "HideTheToes", PickSession2 + ".toe_L0_fk0_ctl"
  130. AddToGroup "HideTheToes", PickSession2 + ".toe_R2_fk0_ctl"
  131. AddToGroup "HideTheToes", PickSession2 + ".toe_R0_fk0_ctl"
  132. AddToGroup "HideTheToes", PickSession2 + ".toe_R1_fk0_ctl"
  133. AddToGroup "HideTheToes", PickSession2 + ".toe_R3_fk0_ctl"
  134. AddToGroup "HideTheToes", PickSession2 + ".toe_R4_fk0_ctl"
  135. SetValue "HideTheToes.viewvis", 0
  136. CopyPaste "HideTheToes", , PickSession2 , 1
  137.  
  138. LogMessage "Skyrim rig should now be constrained to Gear, start animating !"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement