User Tools

Site Tools


unity

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
unity [2018/05/13 20:51] 85.195.237.69unity [2018/05/16 17:20] (current) 10.150.0.28
Line 4: Line 4:
  
 Save new projects on the [[filer|Innovationlab Filer]] or on the [[git|ZHdK GIT Server]] in your project folder. Save new projects on the [[filer|Innovationlab Filer]] or on the [[git|ZHdK GIT Server]] in your project folder.
 +
 +
 +{{::unity-new-project.png?600|}}
 +
 +===== Import a Character =====
 +
 +  - Drag and Drop FBX into project window
 +  - Select Character in project window and go to Inspector > Rig > Animation Type set to Humanoid
 +
 +[[Unity_ImportMayaAdvancedSkeleton|Import Advanced Sceleton Charater from Maya into Unity]]
 +
  
 ===== Install OptiTrack Unity Plugin ===== ===== Install OptiTrack Unity Plugin =====
Line 10: Line 21:
  
   - Download Plugin from Optitrack Website [[http://optitrack.com/downloads/plugins.html]] or from the [[filer|Innovationlab Filer]]: Path 01_assets/06_plugins/Optitrack/   - Download Plugin from Optitrack Website [[http://optitrack.com/downloads/plugins.html]] or from the [[filer|Innovationlab Filer]]: Path 01_assets/06_plugins/Optitrack/
-  - Install the Plugin in your unity project by doubleclicking the on the Plugin file+  - Install the Plugin in your unity project by doubleclicking the on the Plugin file or go to Asset > Import Pacakge > Import Custom Package... and select the Plugin package.
  
-{{::unity-install-plugin.png?300|}}+{{::unity-filer-optitrack-plugin.png?600|}} 
 + 
 + 
 +{{::unity-install-plugin.png?350|}}
 {{::unity-plugin-project.png?500|}} {{::unity-plugin-project.png?500|}}
  
-===== Add OptiTrack Client ===== 
  
-  - Open+===== Add OptiTrack Client to Scene =====
  
 +  - Open Asset Folder OptiTrack/Prefabs/
 +  - Drag & Drop //Client - OptiTrack// to the scene Hierarchy
 +  - Select //Client - OptiTrack// in Hierarchy and open Inspector window
 +  - Check oarameters of the //Optitrack Streaming Client (Script)// Component
  
-===== Useful Shortcuts =====+{{:unity-client-hierarchy.png?300|}}
  
-  Q           Pan +=== Parameters (Motive & Unity on same PC) ===  
-  W           Move +  Connection Type      Multicast 
-  E           Rotate +  Local Address        127.0.0.1 
-  R           Scale +  Server Address       127.0.0.1 
-  F           Focus on active selection +  Server Command Port  1510 
-  Ctrl+Alt+F  Move to view+  Server Data Port     1510 
 +  Bone Naming Conv.    Motive 
 +   
 +Stream the data to Local Interface Loopback Address if Unity is running on same PC as Motive.
  
-===== Animation =====+{{:unity-client-inspector-localhost.png?400|}} 
 +{{::motive-streaming-loopback.png?400|}} 
 +   
 +=== Parameters (Motive on Mocap PC & Unity on Beamer PC) ===
  
-Open Window > Animation +  Connection Type      Multicast 
-Add Property to Animate +  Local Address        10.128.96.102 
-Press record +  Server Address       10.128.96.103 
-Change values to animate > a keyframe will be added +  Server Command Port  1510 
-Scrub in Timeline and change values again+  Server Data Port     1510 
 +  Bone Naming Conv.    Motive 
 +   
 +Stream capture data in motive to Local Address if Unity is not running on the same PC as Motive. 
 +   
 +{{::unity-client-inspector-beamer.png?400|}} 
 +{{::motive-streaming-lan.png?400|}}   
 +   
 +Check [[network|Network LAN IPs]] for other configurations.
  
-===== Animator ===== 
  
-Use to create states. Each state has an animation. So there you can combine animations and connect it to conditions. +===== Add Motion Caputre Stream for a Rigid Body =====
-Window > Animator+
  
-Different Layers can be used to make different animations at the same timeThe lower the layer the higher priority it has.+To add motion capture live data to a rigid body (e.g. camera), you need to add the //Optitrack Rigid Body// Script as a Component to your object: 
 +  
 +  - Open Asset Folder //OptiTrack/Scripts/// 
 +  - Drag & Drop //OptitrackRigidBody// to an object in Scene Hierarchy to connection object with motion capture data (e.g. Main Camera) 
 +  - Open Inspector of Object and show //Optitrack Rigid Body (Script)// Component 
 +  - Click on circle symbol next to Streaming Client and select //Client - OptiTrack// client of the scene  
 +  - Set //Rigid Body Id// to StreamingID of corresponding Motive Rigid Body 
 +  - Run Play Mode
  
-===== Import Character =====+{{:unity-rigidbody-script.png?400|}} 
 +{{:unity-hierarchy-maincamera.png?200|}}
  
-Drag and Drop FBX into project window.+{{::motive-rigidbody-streamingid.png?400|}}
  
-Inspector > Rig > Animation Type set to Humanoid+{{:unity-inspector-rigidbody.png?400|}} 
 +{{:unity-optitrack-select-client.png?200|}} 
 +{{:unity-play.png?100|}}
  
-[[Unity_ImportMayaAdvancedSkeleton|Import Advanced Sceleton Charater from Maya into Unity]] 
  
 +===== Add Motion Caputre Stream for a Character =====
  
 +Make sure you have a rigged character in unity (see [[unity|Import a Character from Maya]] or Import a Character from Mixamo)
  
-===== Stream Data from Optitrack Motive =====+To add motion capture live data to a Character/Skeleton, you need to add the //OptitrackSkeletonAnimator// Script as a Component to your character: 
 +  
 +  - Drag & Drop your character into Scene Hierarchy 
 +  - Open Asset Folder //OptiTrack/Scripts/// 
 +  - Drag & Drop //OptitrackSkeletonAnimator// to an character in Scene Hierarchy to connection skeleton with motion capture data 
 +  - Open Inspector of character and show //Optitrack Skeleton Animator (Script)// Component 
 +  - Click on circle symbol next to Streaming Client and select //Client - OptiTrack// client of the scene 
 +  - Click on circle symbol next to Destination Avatar and select Avatar of the character 
 +  - Set //Skeleton Asset Name// to Asset Name of corresponding Motive Skeleton 
 +  - Run Play Mode
  
-Asset > Import Custom Package and select Optitrack packag+{{::unity-script-skeleton-animator.png?400|}} 
 +{{:unity-hierarchy-character.png?200|}}
  
-Drag the OptitrackSkeletonAnimator to from the character by remove component+{{::motive-skeleton-assetname.png?400|}}
  
-Add Client Prefab to scene+{{:unity-inspector-skeleton-script.png?400|}} 
 +{{:unity-optitrack-select-client.png?200|}} 
 +{{::unity-select-avatar.png?200|}}
  
-Set Skeleton Name to Motive Character Name+{{:unity-play.png?100|}} 
 + 
 + 
 +===== Enable Background running =====
  
 Run in Background in File > Build Settings > Player Settings activate Run in Background in File > Build Settings > Player Settings activate
 +
 +
 +===== Useful Shortcuts =====
 +
 +  Q           Pan
 +  W           Move
 +  E           Rotate
 +  R           Scale
 +  F           Focus on active selection
 +  Ctrl+Alt+F  Move to view
 +
 +
 +===== Animation =====
 +
 +  - Open Window > Animation
 +  - Add Property to Animate
 +  - Press record
 +  - Change values to animate > a keyframe will be added
 +  - Scrub in Timeline and change values again
 +
 +===== Animator =====
 +
 +Use to create states. Each state has an animation. So there you can combine animations and connect it to conditions.
 +Window > Animator
 +
 +Different Layers can be used to make different animations at the same time. The lower the layer the higher priority it has.
unity.1526237483.txt.gz · Last modified: 2018/05/13 20:51 by 85.195.237.69