User Tools

Site Tools


democap:blender_democaptools

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
democap:blender_democaptools [2022/04/18 20:46] dragonlorddemocap:blender_democaptools [2022/07/11 20:06] (current) – [Import Object Rig] dragonlord
Line 1: Line 1:
-{{tag>motioncapture democap}}+{{tag>motioncapture democap blender}}
 <WRAP youarehere> <WRAP youarehere>
 [[:start|Start Page]] >> [[main|DEMoCap: Drag[en]gine Motion Capture]] >> **Blender DEMoCap Tools Addon** [[:start|Start Page]] >> [[main|DEMoCap: Drag[en]gine Motion Capture]] >> **Blender DEMoCap Tools Addon**
Line 14: Line 14:
 The addon scripts can be installed using the typical Blender3D workflow for [[https://docs.blender.org/manual/en/latest/editors/preferences/addons.html|installing addons]].  The addon scripts can be installed using the typical Blender3D workflow for [[https://docs.blender.org/manual/en/latest/editors/preferences/addons.html|installing addons]]. 
  
-You can download the zip file from: [[https://github.com/LordOfDragons/democap/releases/latest]], file **democap-tools-*.zip** where * is the version number.+You can download the zip file from: [[https://github.com/LordOfDragons/democap/releases/latest]], file <wrap em>blender-democap-tools-*.zip</wrap> where * is the version number.
  
 Click the "Install" button and select the plugin zip file. Click the "Install" button and select the plugin zip file.
Line 21: Line 21:
  
 Now a new toolbox panel is added with the title "DEMoCap Tools". Now a new toolbox panel is added with the title "DEMoCap Tools".
 +
  
 ====== DEMCA Browser ====== ====== DEMCA Browser ======
  
-<WRAP box right :en 310px>+<WRAP box right :en >
 {{ :democap:blender_democaptools1.png?direct|DEMCA Browser Panel}} {{ :democap:blender_democaptools1.png?direct|DEMCA Browser Panel}}
 +\\
 +{{ :democap:blender_democaptools2.png?direct|DEMCA Browser Panel}}
 </WRAP> </WRAP>
  
-DEMoCap saves captures using multiple files as outline in [[democap:uipanelproject#export|UI Panel Project -> Export]]. The *.deanim files can be imported directly. Besides these files a *.demca files is stored. This file contains informations about the capture session that produced this captured animation file. The *.demca file is an XML file and contains information like:+DEMoCap saves captures using multiple files as outline in [[democap:uipanelproject#export|UI Panel Project -> Export]]. The <wrap em>*.deanim</wrap> files can be imported directly. Besides these files a <wrap em>*.demca</wrap> files is stored. This file contains informations about the capture session that produced this captured animation file. The *.demca file is an XML file and contains information like:
   * Timestamp when capture has been done   * Timestamp when capture has been done
   * Name of [[democap:tutorialcreateactor|Actor Profile]], [[democap:preparecharacter|Character Profile]] and [[democap:preparecharacter|Character Configuration]] used for the motion capture.   * Name of [[democap:tutorialcreateactor|Actor Profile]], [[democap:preparecharacter|Character Profile]] and [[democap:preparecharacter|Character Configuration]] used for the motion capture.
Line 36: Line 39:
   * Optional *.deanim and *.derig file for VR device captures if present   * Optional *.deanim and *.derig file for VR device captures if present
  
-The DEMCA browser panel provides support to read those *.demca files and to import the contained resources easily.+The <wrap em>DEMCA browser panel</wrap> provides support to read those *.demca files and to import the contained resources easily.
  
-The panel contains a file listing showing directories and *.demca files found in the current directory. After starting Blender or if you changed files on disk you have to press the "Scan Filesbutton to update the file listing. To switch directories press the left or right arrow button next to the directory list entry. To show information about a *.demca capture file select the file entry in the listing. The file information is read and displayed in the file information panel below. Use this panel to check if the motion capture contains the animation you would like to import. Use the buttons below the file information panel to import animations.+The panel contains a <wrap em>file listing</wrap> showing directories and *.demca files found in the current directory. After starting Blender or if you changed files on disk you have to press the <wrap em>Scan Files</wrap> button to update the file listing. To switch directories press the <wrap em>left or right arrow</wrap> button next to the directory list entry. To show information about a *.demca capture file select the file entry in the listing. The file information is read and displayed in the <wrap em>file information panel</wrap> below. Use this panel to check if the motion capture contains the animation you would like to import. 
 + 
 +Above the file listing are two buttons to jump to important directories. 
 + 
 +The <wrap em>Captured</wrap> button jumps to the captured animations directory in the DEMoCap capture directory. <wrap em>Free animations</wrap> are stored into this directory. Free animations are captured if no [[democap:ocls_capturedcharacter|Captured Character]] is selected while doing a motion capture. This is useful for doing quick captures like testing character configuration or doing motion captures that are not required to fit precisely into an existing environment. The directory is located here: 
 +  * Linux: ~/config/delauncher/games/e31f1c11-3ca6-c66b-adca-95484bedfc1f/capture/animations 
 +  * Windows: %AppData%\DELaunchers\Config\games\e31f1c11-3ca6-c66b-adca-95484bedfc1f\capture\animations 
 + 
 +The <wrap em>Project</wrap> button jumps to the project save directory in the DEMoCap config directory. <wrap em>Project files</wrap> are stored in this directory or child directories thereof. This allows to manage project specific motion captures. For a project named <wrap em>{project}.demcp</wrap> the project data is stored in a child directory named <wrap em>{project}-data</wrap>. The *.demca files inside store path relative to this project data directory. This allows to import these files even after moving the project files. Exporting animations (including auto-exporting) stores files inside the project data directory. The directory is located here: 
 +  * Linux: ~/config/delauncher/games/e31f1c11-3ca6-c66b-adca-95484bedfc1f/config/projects 
 +  * Windows: %AppData%\DELaunchers\Config\games\e31f1c11-3ca6-c66b-adca-95484bedfc1f\config\projects 
 + 
 +If you have a *.demca file entry select you can use the buttons below the file information panel to import animations.
  
 ===== Import Animation ===== ===== Import Animation =====
Line 54: Line 69:
 This button can be used if the motion capture contains VR device capture information. Select the Armature imported by "Import Devices Rig" button. Depending on the playtime of the motion capture the importing can take a longer time to finish. Once the button is no more highlighted the import finished. This button can be used if the motion capture contains VR device capture information. Select the Armature imported by "Import Devices Rig" button. Depending on the playtime of the motion capture the importing can take a longer time to finish. Once the button is no more highlighted the import finished.
  
 +===== Import Object Rig =====
 +
 +This button can be used if the motion capture contains object position and orientation information. Press this button to import the rig used by the motion capture to store the object parameters. The rig contains these bones:
 +  * <wrap em>object</wrap>: Represents the position and orientation of the object relative to the game world. You typically use a "Child of" constraint to attach the motion captured objects. Since Blender3D uses negative Y axis as forward direction for bones you have to set the Z Rotation of the attached object to 180 degrees to get the correct result.
 +  * <wrap em>attach</wrap>: Determines if the object is attached/grabbed at specific points in time. Only the local Y position is used. A local Y position of 0 represents not attached and 0.1 represents attached. As of DEMoCap 0.7 this value is not used yet.
 +This import is quick and produces an Armature.
 +
 +If multiple captures use object position and orientation you can use the same rig layout but you have to duplicate the object since each attached object needs a unique parent.
 +
 +===== Import Object Animation =====
 +
 +This button can be used if the motion capture contains object position and orientation information. Select the Armature imported by "Import Object Rig" button. Depending on the playtime of the motion capture the importing can take a longer time to finish. Once the button is no more highlighted the import finished.
 <WRAP clear/> <WRAP clear/>
  
 +====== Correction Bones ======
 +<WRAP box right :en >{{ :democap:blender_democaptools3.png?direct|}}</WRAP>
 +
 +The <wrap em>Correction Bones</wrap> tools allows to post process motion capture data in a non-destructive way. Correcting bones has various uses, for example (including others):
 +  * Correct actor poses to remove unwanted arching and rotating
 +  * Fit motion capture pose to existing animations they are overlaying to get better looking blending
 +  * Exaggerate or tone down motions
 +  * Create variations of motions
 +
 +===== Add Correction Bones =====
 +
 +To use correction bones you have to first add them to your armature. Enter <wrap em>Pose Mode</wrap> and select the bones to add correction support to then press the <wrap em>Add Rot</wrap> or <wrap em>Add Rot+Loc</wrap> button.
 +
 +Correction bones are added directly to your armature to allow saving them into the actions as well as allowing them to be animated for fine control. The added bones are named <wrap em>"ik.mocap.{name}"</wrap> where <wrap em>"{name}"</wrap> is the name of the bone the correction applies to. To help organize bones the added correction bones are added to a bone group named <wrap em>"DEMoCap Correction"</wrap>. The bone group is assigned the next unused color theme. The correction bones are assigned the same parent and transformation but are shortened in length to 65% of the original bone.
 +
 +For each corrected bone a bone constraint is added using the respective correction bone as input.
 +
 +If the <wrap em>Add Rot</wrap> button has been used a <wrap em>Copy Rotation</wrap> bone constraint is added. The bone constraint is set to superimpose the local rotation of the correction bone onto the original bone in local bone space. This means you can rotate the correction bones to rotationally offset the motion captured animation. Use this for all bones which require only rotation to be modified. This is the majority of bones.
 +
 +If the <wrap em>Add Rot+Loc</wrap> button has been used a <wrap em>Copy Transforms</wrap> bone constraint is added. The bone constraint is set to superimpose the local rotation and translation of the correction bone onto the original bone in local bone space. This means you can rotate and mvoe the correction bones to rotationally and translationally offset the motion captured animation. Use this for all bones which require rotation and translation to be modified. This is typically used for location bones like the hip or origin bone where the location of the bone is important.
 +
 +The image below shows the process of adding bones to the Dragonroo example character.
 +{{ :democap:blender_democaptools4.png?direct&600 |}}
 +
 +The image below shows how rotating spine correction bones offsets the animation without destroying it.
 +{{ :democap:blender_democaptools5.png?direct&400 |}}
 +
 +===== Align Correction Bones =====
 +
 +If the motion captured animation is used by blending over an existing animation (for example an idle animation) then it is useful to align the animation to match as closely as possible the base animation at the beginning and end. This allows to blend into the motion captured animation with the highest quality.
 +
 +To align correction bones activate the action and frame number to use as animation frame to match against. Select the correction bones to copy the original bone world space transforms for. It is also possible to select the respective original bones instead but selecting the correction bones is a faster workflow. With the bones selected click the <wrap em>Copy Bone Matrices</wrap> button. The states are now stored in memory. Select now the motion capture action and go to the first frame to use. Select all correction bones you want to align. This is not required to be all the copied bones so you can apply the corrections in batches if you like. With the bones selected press the <wrap em>Align Correction Bones</wrap> button. The correction bones are not rotated and optionally moved (if they have been added using Add Rot+Loc). After aligning the original bones match the rotation (and optionally location) of the copied world bone states. You can now add keyframes for the bones to the action.
 +
 +The typical workflow to create overlay motion capture animations is to align the first and last frame to the base animation. Optionally add keyframes at 0.5-1s after the begin and before the end with the rotation and location cleared. This way the corrections ensure the animation fits well over the base animation when blended into while the clearing ensures the animation playes unmodified after being fully blended in.
 +
 +It is also possible to the aligning to match specific time positions inside the animation to an existing animation.
 +
 +The video below shows how this works. The imported animation is aligned to a base animation. Blending into the animation would produce good results like this. As an of altering the motion captured animation the spine is bend over causing the character to play the motion captured animation in a hunched over pose instead of the upright one as performed by the actor.
 +{{ youtube>tlp5mZsl66Y?800x473 }}
democap/blender_democaptools.1650314773.txt.gz · Last modified: 2022/04/18 20:46 by dragonlord