Difference between revisions of "Deriving new character from template character"

From XStoryPlayer Wiki
Jump to: navigation, search
m
 
(34 intermediate revisions by one other user not shown)
Line 1: Line 1:
 
In this tutorial we will be replacing the character template parts with a new character.
 
In this tutorial we will be replacing the character template parts with a new character.
After this tutorial you will know how to create a new character for [[XStoryPlayer]]
+
After this tutorial you will know how to create a new character for [[XStoryPlayer]]<br>
 
+
<br>
<ol>
+
We assume that you have finished the '[[Installing template character]]' tutorial successfully.<br>
<li>We assume that you have finished the '[[Installing template character]]' tutorial successfully.<br>
+
 
- So you have the <code>pack_character</code> pack installed.<br>
 
- So you have the <code>pack_character</code> pack installed.<br>
 
- You have the testing shortcut, for testing the character.<br>
 
- You have the testing shortcut, for testing the character.<br>
- Also your Maya project path is set to the <code>pack_character</code></li>
+
- Also your Maya project path is set to the <code>pack_character/sources</code>
 +
<br>
 +
<br>
 +
'''IMPORTANT NOTES:'''<br>
 +
'''- Make sure you have downloaded latest Beta-patch (redownload just in case) !'''<br>
 +
'''- Make sure you have downloaded latest '[[Tutorial resource pack]]' !'''<br>
 +
'''- Make backup of your sources before installing patch and/or packs (just in case) !'''<br>
 +
'''- If you have successfully finished or have issues with this tutorial let me know at admin(AT)xmoonproductions(DOT)com, so we know people find this tutorial usefull !<br>
 +
<br>
 +
<ol>
 
<li>Open the <code>./pack/pack_character/sources/scenes/char_template/body.ma</code> file in Maya.<br>
 
<li>Open the <code>./pack/pack_character/sources/scenes/char_template/body.ma</code> file in Maya.<br>
Import the <code>model/body.ma</code> from the '[[Tutorial resource pack]]' into your scene. This is the new (rigged) model you will use to replace the template character.<br>
+
Cleanup the scene. Remove the body, the hair, the body collider until only the character, the skeleton (with bone colliders), the particles, the eyes and the teeth are left.<br>
 +
Also remove the shaders that are not used.<br>
 
Save the new scene to <code>./pack/pack_character/sources/scenes/char_new/body.ma</code>.<br>
 
Save the new scene to <code>./pack/pack_character/sources/scenes/char_new/body.ma</code>.<br>
Your end result should look like the <code>Step 1 Char_new/body.ma</code> file.<br>
+
Your end result should look like the <code>char_new Step 1/body.ma</code> file.<br>
 +
[[file:new_char_step0.jpg|400px]]</li>
 +
<li>Now copy the <code>model/body.ma</code> from the '[[Tutorial resource pack]]' to the <code>sources/scenes</code> directory.<br>
 +
Also copy the <code>textures/model</code> files from the '[[Tutorial resource pack]]' to the <code>sources/scenes/textures/char_new</code> directory.<br>
 +
Import the <code>model/body.ma</code> from the '[[Tutorial resource pack]]' into your scene. This is the new (rigged) model you will use to replace the template character.<br>
 +
Save the new scene again. (<code>./pack/pack_character/sources/scenes/char_new/body.ma</code>).<br>
 +
Your end result should look like the <code>char_new Step 2/body.ma</code> file.<br>
 
[[file:new_char_step1.jpg|400px]]</li>
 
[[file:new_char_step1.jpg|400px]]</li>
<li>Copy the <code>Step 1 Char_new/body.ini</code> into your <code>char_new</code> directory as well.<br>
+
<li>Copy the <code>char_new Step 2/body.ini</code> into your <code>char_new</code> directory.<br>
This is the template ini file, but most elements are commented out so they do not have to created at first.</li>
+
This is the template ini file, but most elements are commented out so they do not have to created at first in our scene.<br>
<li>Remove the hair, the collider, the old body etc to cleanup the scene.<br>
+
Make a duplicate of the model body (that is not rigged). Name it <code>body</code>. Make sure its <code>bodyShapeOrig</code> is deleted (see image).<br>
Make sure there are no meshes binded to the <code>root_joint</code> hierarchy.<br>
+
Hide the rigged model body and its skeleton.<br>
Also make a copy of the new model body that is not rigged. Hide the rigged model body and the rig itself.<br>
+
Your end result should look like the <code>Step 3 Char_new/body.ma</code> file.<br>
Your end result should look exactly like the <code>Step 2 Char_new/body.ma</code> file.<br>
+
 
[[file:new_char_step2.jpg|400px]]</li>
 
[[file:new_char_step2.jpg|400px]]</li>
<li>Now that there are not meshes binded to the <code>root_joint</code> hierarchy we can move/rotate the joints so the new model has correct joints.<br>
+
<li>Now we can rotate/move the joints so the new model has correct joints.<br>
Make sure you do not translate the joints too much. Better is to use the joint orient to position them.<br>
+
Make sure you do not translate the joints when they can be rotated. Rotate the joints instead. Or use the joint orient to rotate them (if the rotation is locked).<br>
 +
Only translate them to make the joints longer.<br>
 
Use 'X-Ray Joints' to view them better through the body. Use different views (top,front,side) to get a good view of the joint positions.<br>
 
Use 'X-Ray Joints' to view them better through the body. Use different views (top,front,side) to get a good view of the joint positions.<br>
 
Use the original model joint hierarchy for reference on where to position the joints.<br>
 
Use the original model joint hierarchy for reference on where to position the joints.<br>
 
Do not rotate or move the root_joint! Move the body instead.<br>
 
Do not rotate or move the root_joint! Move the body instead.<br>
Adjust the joints and make the end result look like the <code>Step 3 Char_new/body.ma</code> file.<br>
+
Adjust the joints and make the end result look like the <code>char_new Step 4/body.ma</code> file.<br>
 
[[file:new_char_step3.jpg|400px]]</li>
 
[[file:new_char_step3.jpg|400px]]</li>
 
<li>Now bind the model body mesh to the root_joint hierarchy. Rotate the joints to check that the body is binded.<br>
 
<li>Now bind the model body mesh to the root_joint hierarchy. Rotate the joints to check that the body is binded.<br>
Now we have to fix the skinning by mapping the old model rig onto the new one. We can use the [[Filemaker]] for that.<br>
+
We have to fix the skinning by mapping the old model rig onto the new one. Luckily we can use the [[Filemaker]] for that.<br>
Run the <code>Step 4 Char_new/filemaker/start.ini</code> using the [[Filemaker]], it will map the weights onto the new model.<br>
+
Run the <code>char_new Step 5/filemaker/start.ini</code> using the [[Filemaker]], it will map the weights onto the new model.<br>
 
After running an <code>export.txt</code> file is created. Open the <code>body.ma</code> file in an text editor and replace the weights of the body with the exported weights.<br>
 
After running an <code>export.txt</code> file is created. Open the <code>body.ma</code> file in an text editor and replace the weights of the body with the exported weights.<br>
To find where the weights in the <code>body.ma</code> file are located, search for the skin cluster of the bodyShape e.g. <code>skinCluster8</code>.<br>
+
To find where the weights in the <code>body.ma</code> file are located, search for the skin cluster of the bodyShape e.g. <code>skinCluster1</code>.<br>
 
A good text editor for editing large files is: [http://www.textpad.com TextPad].<br>
 
A good text editor for editing large files is: [http://www.textpad.com TextPad].<br>
Reopen the <code>body.ma</code> file in Maya. The weights should now be correct.</li>
+
Reopen the <code>body.ma</code> file in Maya. The weights should now be correct.<br>
 +
You can now delete the model body and its joints.<br>
 +
The end result look like the <code>char_new Step 5/body.ma</code> file.</li>
 +
<li>Position the eyes. They are constrained, so the way to move them is by adjusting the pivot. Press [INSERT] (go into pivot mode) and then move them (using translate tool).<br>
 +
All constrained objects like the eyes and the bone colliders can be moved this way.<br>
 +
Also adjust the teeth. They are not constrained so you can use the translation tool directly to move them.<br>
 +
The end result look like the <code>char_new Step 6/body.ma</code> file.</li>
 +
<li>Now use the [[Filemaker]] to create the character. This will create the <code>characterShape.obj</code> file.<br>
 +
When created successfully we can test the character in test mode (See previous tutorial).<br>
 +
Set the <code>name_obj</code> in the <code>./testini/run_char.ini</code> file to <code>"scenes/char_new"</code>.<br>
 +
Make sure you have copied the <code>pack_character/scenes/capture/char_new</code> from the '[[Tutorial resource pack]]' beforehand.<br>
 +
[[file:new_char_step6.jpg|400px]]
 +
</li>
 +
<li>In the next tutorial we will add the collider and the hair and animations to the character.</li>
 
</ol>
 
</ol>

Latest revision as of 10:19, 5 January 2016

In this tutorial we will be replacing the character template parts with a new character. After this tutorial you will know how to create a new character for XStoryPlayer

We assume that you have finished the 'Installing template character' tutorial successfully.
- So you have the pack_character pack installed.
- You have the testing shortcut, for testing the character.
- Also your Maya project path is set to the pack_character/sources

IMPORTANT NOTES:
- Make sure you have downloaded latest Beta-patch (redownload just in case) !
- Make sure you have downloaded latest 'Tutorial resource pack' !
- Make backup of your sources before installing patch and/or packs (just in case) !
- If you have successfully finished or have issues with this tutorial let me know at admin(AT)xmoonproductions(DOT)com, so we know people find this tutorial usefull !

  1. Open the ./pack/pack_character/sources/scenes/char_template/body.ma file in Maya.
    Cleanup the scene. Remove the body, the hair, the body collider until only the character, the skeleton (with bone colliders), the particles, the eyes and the teeth are left.
    Also remove the shaders that are not used.
    Save the new scene to ./pack/pack_character/sources/scenes/char_new/body.ma.
    Your end result should look like the char_new Step 1/body.ma file.
    New char step0.jpg
  2. Now copy the model/body.ma from the 'Tutorial resource pack' to the sources/scenes directory.
    Also copy the textures/model files from the 'Tutorial resource pack' to the sources/scenes/textures/char_new directory.
    Import the model/body.ma from the 'Tutorial resource pack' into your scene. This is the new (rigged) model you will use to replace the template character.
    Save the new scene again. (./pack/pack_character/sources/scenes/char_new/body.ma).
    Your end result should look like the char_new Step 2/body.ma file.
    New char step1.jpg
  3. Copy the char_new Step 2/body.ini into your char_new directory.
    This is the template ini file, but most elements are commented out so they do not have to created at first in our scene.
    Make a duplicate of the model body (that is not rigged). Name it body. Make sure its bodyShapeOrig is deleted (see image).
    Hide the rigged model body and its skeleton.
    Your end result should look like the Step 3 Char_new/body.ma file.
    New char step2.jpg
  4. Now we can rotate/move the joints so the new model has correct joints.
    Make sure you do not translate the joints when they can be rotated. Rotate the joints instead. Or use the joint orient to rotate them (if the rotation is locked).
    Only translate them to make the joints longer.
    Use 'X-Ray Joints' to view them better through the body. Use different views (top,front,side) to get a good view of the joint positions.
    Use the original model joint hierarchy for reference on where to position the joints.
    Do not rotate or move the root_joint! Move the body instead.
    Adjust the joints and make the end result look like the char_new Step 4/body.ma file.
    New char step3.jpg
  5. Now bind the model body mesh to the root_joint hierarchy. Rotate the joints to check that the body is binded.
    We have to fix the skinning by mapping the old model rig onto the new one. Luckily we can use the Filemaker for that.
    Run the char_new Step 5/filemaker/start.ini using the Filemaker, it will map the weights onto the new model.
    After running an export.txt file is created. Open the body.ma file in an text editor and replace the weights of the body with the exported weights.
    To find where the weights in the body.ma file are located, search for the skin cluster of the bodyShape e.g. skinCluster1.
    A good text editor for editing large files is: TextPad.
    Reopen the body.ma file in Maya. The weights should now be correct.
    You can now delete the model body and its joints.
    The end result look like the char_new Step 5/body.ma file.
  6. Position the eyes. They are constrained, so the way to move them is by adjusting the pivot. Press [INSERT] (go into pivot mode) and then move them (using translate tool).
    All constrained objects like the eyes and the bone colliders can be moved this way.
    Also adjust the teeth. They are not constrained so you can use the translation tool directly to move them.
    The end result look like the char_new Step 6/body.ma file.
  7. Now use the Filemaker to create the character. This will create the characterShape.obj file.
    When created successfully we can test the character in test mode (See previous tutorial).
    Set the name_obj in the ./testini/run_char.ini file to "scenes/char_new".
    Make sure you have copied the pack_character/scenes/capture/char_new from the 'Tutorial resource pack' beforehand.
    New char step6.jpg
  8. In the next tutorial we will add the collider and the hair and animations to the character.