Difference between revisions of "3rd party integration"

From UMAWiki
Jump to: navigation, search
(Invector 3rd Person Controller)
 
(3 intermediate revisions by 3 users not shown)
Line 1: Line 1:
 
Here is a collection of tips and tricks for getting other assets to work with UMA.
 
Here is a collection of tips and tricks for getting other assets to work with UMA.
 +
 +
== Invector 3rd Person Controller ==
 +
 +
To setup the Invector 3rd person controller, you need to be using a version of UMA that has the 'Bone Builder'. This is in Release 2.7 of UMA, but also available as a feature tree for 2.6 on GITHUB.
 +
 +
* You're going to need an Humanoid Avatar. UMA ships with the FBX models for the human slot sources - but the avatar is set for generic rigging. To fix this, go to the FBX file, and change it the rig type to Humanoid and apply it. For example, the male fbx is here: UMA/Content/UMA_Core/HumanMale/FBX
 +
* Add an "Animator" component to your DynamicCharacterAvatar.
 +
*Set the avatar to the Male_Unified avatar (it's the one that was generated when you changed the FBX above).
 +
*Set the animator to the invector animator of your choice.
 +
*On the DynamicCharacterAvatar, set the "RuntimeAnimatorController" to the same animator.
 +
*Run the bone builder on the DynamicCharacterAvatar to create the bones.
 +
*Open the character creator of your choice from the Invector menu
 +
*Drop the DynamicCharacterAvatar on the "fbx model" slot
 +
*Fill in the other two items from the invector files
 +
 +
Press the button on the Invector Character Creator, and you're done! It creates a new gameobject that is ready to go.
  
 
== Final IK ==
 
== Final IK ==
Line 30: Line 46:
 
vrik.solver.rightArm.shoulderRotationMode = IKSolverVR.Arm.ShoulderRotationMode.FromTo;
 
vrik.solver.rightArm.shoulderRotationMode = IKSolverVR.Arm.ShoulderRotationMode.FromTo;
 
</syntaxhighlight>
 
</syntaxhighlight>
 
ftp://u68354706-umawiki@umawiki.secretanorak.com/UMAWiki/Docs/Final_IK_Recipes.zip
 

Latest revision as of 22:25, 12 October 2017

Here is a collection of tips and tricks for getting other assets to work with UMA.

Invector 3rd Person Controller

To setup the Invector 3rd person controller, you need to be using a version of UMA that has the 'Bone Builder'. This is in Release 2.7 of UMA, but also available as a feature tree for 2.6 on GITHUB.

  • You're going to need an Humanoid Avatar. UMA ships with the FBX models for the human slot sources - but the avatar is set for generic rigging. To fix this, go to the FBX file, and change it the rig type to Humanoid and apply it. For example, the male fbx is here: UMA/Content/UMA_Core/HumanMale/FBX
  • Add an "Animator" component to your DynamicCharacterAvatar.
  • Set the avatar to the Male_Unified avatar (it's the one that was generated when you changed the FBX above).
  • Set the animator to the invector animator of your choice.
  • On the DynamicCharacterAvatar, set the "RuntimeAnimatorController" to the same animator.
  • Run the bone builder on the DynamicCharacterAvatar to create the bones.
  • Open the character creator of your choice from the Invector menu
  • Drop the DynamicCharacterAvatar on the "fbx model" slot
  • Fill in the other two items from the invector files

Press the button on the Invector Character Creator, and you're done! It creates a new gameobject that is ready to go.

Final IK

FullBodyIK

You need to add the FullBodyIK during runtime. Just hook in to the CharacterCreated callback on your UMA and add the following code:

 1 using RootMotion; // Need to include the RootMotion namespace as well because of the BipedReferences
 2 FullBodyBipedIK ik;
 3 
 4 void AddFBBIK (GameObject go, BipedReferences references = null) {
 5     if (references == null) { // Auto-detect the biped definition if we don't have it yet
 6         BipedReferences.AutoDetectReferences(ref references, go.transform, BipedReferences.AutoDetectParams.Default);
 7     }
 8     ik = go.AddComponent<FullBodyBipedIK>(); // Adding the component
 9     ik.SetReferences(references, null);
10     ik.solver.SetLimbOrientations(BipedLimbOrientations.UMA); // The limb orientations definition for UMA skeletons
11 }

VRIK

You need to add the VRIK during runtime. Just hook in to the CharacterCreated callback on your UMA and add the following code:

1 using RootMotion.FinalIK;
2 
3 vrik = go.AddComponent<VRIK>(); // Adding the component
4 vrik.AutoDetectReferences();
5 
6 vrik.solver.leftArm.shoulderRotationMode = IKSolverVR.Arm.ShoulderRotationMode.FromTo;
7 vrik.solver.rightArm.shoulderRotationMode = IKSolverVR.Arm.ShoulderRotationMode.FromTo;