1 | <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> |
---|
2 | <html> |
---|
3 | <head> |
---|
4 | <meta http-equiv="content-type" |
---|
5 | content="text/html; charset=ISO-8859-1"> |
---|
6 | <title>OGRE maxscripts</title> |
---|
7 | </head> |
---|
8 | <body> |
---|
9 | <h2 align="center">3dsmax skeleton and mesh export </h2> |
---|
10 | Here are 3dsmax4/5 scripts which export meshes and skeletons.<br> |
---|
11 | <br> |
---|
12 | <h3>Tutorials</h3> |
---|
13 | <ul> |
---|
14 | <li> <b>you can find a mesh tutorial <a |
---|
15 | href="tutorials/skateboard/index.html">here</a>.</b></li> |
---|
16 | <li> <b>you can find a skeleton tutorial <a |
---|
17 | href="tutorials/skeleton/index.html">here</a>.</b></li> |
---|
18 | </ul> |
---|
19 | <h3>XMLConverter (OgreXMLConverter)</h3> |
---|
20 | 3ds scripts write .xml files. So, in order to have .mesh and .skeleton |
---|
21 | files, XMLConverter.exe should be used. |
---|
22 | It's in Tools/XMLConverter/bin/debug directory. |
---|
23 | <h4>Issues</h4> |
---|
24 | XMLConverter doesn't find the skeleton file when you try to convert |
---|
25 | your mesh file even if it has been created. So there is |
---|
26 | an eror message, but don't care: it works well when an OGRE application |
---|
27 | uses it. |
---|
28 | <h3>Scripts Features</h3> |
---|
29 | <ul> |
---|
30 | <li> exports meshes.</li> |
---|
31 | <li> exports bones, vertex assignements and bones animation, using |
---|
32 | the skin modifier.</li> |
---|
33 | <li> deals with Physique modifier and Biped.</li> |
---|
34 | <li> exports multi-sub object and Standard materials.</li> |
---|
35 | </ul> |
---|
36 | <h3>How to use the script</h3> |
---|
37 | <ul> |
---|
38 | <li> <u>Exporting Meshes:</u> |
---|
39 | <ul> |
---|
40 | <li> You can choose to export colour information and/or texture |
---|
41 | information. <br> |
---|
42 | <b>CAUTION: </b>Colour information is not complete. This |
---|
43 | information is not used during rendering and values exported are just |
---|
44 | RGBA (25500255 = 255 0 0 255)</li> |
---|
45 | <li> You are able to export meshes which are made up of several |
---|
46 | submeshes. Behaviour is unknown if different submeshes are linked to a |
---|
47 | skeleton (it has not been tested but should works). </li> |
---|
48 | </ul> |
---|
49 | </li> |
---|
50 | <li> <u>Exporting skeletons:</u> |
---|
51 | <ul> |
---|
52 | <li> There is sometimes a problem with mapping. Try to had a UVW |
---|
53 | map modifier.<br> |
---|
54 | </li> |
---|
55 | <li> <b>CAUTION:</b> Always create new bones as children of |
---|
56 | another AND don't unlink and re-link a bone. For example, if you have |
---|
57 | created a leg, copy all the bones and then use position controller in a |
---|
58 | track view to move it and so get the other leg. </li> |
---|
59 | <li> <b>AND</b> : Don't use mirror when you create your bones |
---|
60 | because results are strange. </li> |
---|
61 | <li> <b>Biped</b> If you move or rotate the biped rootObject |
---|
62 | during your animation, add keys to the pelvis too at the same frames</li> |
---|
63 | </ul> |
---|
64 | </li> |
---|
65 | <li> <u>Exporting materials:</u> |
---|
66 | <ul> |
---|
67 | <li> Only Multi-Sub Object materials can be exported. </li> |
---|
68 | <li> Press the pick button, choose your material (for example |
---|
69 | from mtlEditor section), and choose "Instance" in order to avoid |
---|
70 | garabages. </li> |
---|
71 | </ul> |
---|
72 | </li> |
---|
73 | <br> |
---|
74 | </ul> |
---|
75 | <h3>Troubleshooting</h3> |
---|
76 | [Thanks to gfactor for these tips]<br> |
---|
77 | <ol> |
---|
78 | <li><span class="postbody">If the XML converter complains about |
---|
79 | missing bones, then the bones |
---|
80 | probably do not have any vertices assiged to it, and the converter |
---|
81 | 'optimises' it by simply not exporting them. So make sure all bones |
---|
82 | have at least one vertex weight.</span></li> |
---|
83 | <li>If the XML converter complains about Bip01 missing, then you |
---|
84 | will probably need to convert your Physiqued biped to a Skinned biped. |
---|
85 | Don't ask me why but once we did this our models exported without |
---|
86 | problems. The really weird thing is that one of our models exported |
---|
87 | fine about 2 months ago (physiqued) but then failed to work again until |
---|
88 | we converted it to skinnned... weird. The good news is that there is a |
---|
89 | max plugin that does this, which can be found at <a |
---|
90 | href="http://sparks.discreet.com/downloads/" target="_blank">http://sparks.discreet.com/downloads/</a> </li> |
---|
91 | <li>If you have a mesh with multiple animations, all the animations |
---|
92 | MUST be based on the same pose because all Ogre does when animating is |
---|
93 | rotate the bones based on the binding pose (does not store positions). |
---|
94 | The easiest way we've managed to do this is to simply export say... an |
---|
95 | idle animation as our first animation (using that pose as the base |
---|
96 | skeleton file), then for each additional animation we import frame 0 of |
---|
97 | Idle into max and start animating our actual animation from frame 1 |
---|
98 | onwards. When you export the animation.... export from frame 1 onwards |
---|
99 | (do not export frame 0). This ensures that all animations will be |
---|
100 | rotated from the same reference pose. Then simply edit the XML files |
---|
101 | and cut / paste all additional animations into the idle.skeleton |
---|
102 | file </li> |
---|
103 | <li>Animations can do weird things unless you |
---|
104 | flatten the footsteps (creating a key frame for every frame) </li> |
---|
105 | <li>If the XML converter says that it cannot find the *.skeleton |
---|
106 | file you are trying to convert (despite well.... the skeleton file |
---|
107 | being there) then the XML file is corrupt. One of our programmers |
---|
108 | looked through the XML file and found multiple <animations> tags |
---|
109 | (note: not <animation>) which of course is bad. </li> |
---|
110 | <li>If you get a weird error that actually breaks in the comments of |
---|
111 | the Max Script when exporting... |
---|
112 | <br> |
---|
113 | <pre>" Type error: Call needs function or class, got: undefined " |
---|
114 | </pre> |
---|
115 | then the object you are exporting (the body...not the bones) has |
---|
116 | spaces in its name. For example.... enemy_NPC will export... but enemy |
---|
117 | NPC will cause the above error. As far as I can tell... bone names with |
---|
118 | spaces are fine... but the actual mesh must NOT have spaces in it. |
---|
119 | <br> |
---|
120 | </li> |
---|
121 | </ol> |
---|
122 | <span class="postbody"></span><br> |
---|
123 | <ul> |
---|
124 | </ul> |
---|
125 | If you want to know a little more about <a href="dev.html">how scripts |
---|
126 | have been written...</a> <br> |
---|
127 | </body> |
---|
128 | </html> |
---|