-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path3ds2unr.html
210 lines (204 loc) · 20 KB
/
3ds2unr.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head lang="en">
<title>UnrealWiki: 3ds2unr</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<link rel="stylesheet" type="text/css" media="screen, print"
href="shared/stylebase.structural.css">
<link rel="stylesheet" type="text/css" media="screen"
href="shared/template-default.css">
<link rel="stylesheet" type="text/css" media="screen"
href="shared/styles.chblue.css">
<link rel="stylesheet" type="text/css" media="print"
href="shared/template-default-print.css">
<!--[if IE 6]>
<style>
/* dirty hack for IE6. */
#quickbar {
position: absolute;
}
</style>
<![endif]-->
<link rel="start" href="http://wiki.beyondunreal.com/">
<link rel="glossary" href="http://wiki.beyondunreal.com/wiki/Terminology">
<link rel="help" href="http://wiki.beyondunreal.com/wiki/Using_The_Wiki">
<script type="text/javascript" src="shared/dhtml.js"></script>
<script type="text/javascript" src="shared/dhtml-menu.js"></script>
<style type="text/css">#dhtml-menu { background: #eee; padding: 5px 0px; margin-right: -20px; border: 1px solid #888; border-left: 1px solid #ccc; border-top: 1px solid #ccc; border-right: 1px solid #888; border-bottom: 1px solid #888 }
#dhtml-menu td { color: #000; font-family: Arial,Helvetica,sans-serif; font-size: 9pt; line-height: 13pt; padding: 1px 10px; cursor: default }
#dhtml-menu a { color: #000; font-family: Arial,Helvetica,sans-serif; font-size: 9pt; line-height: 13pt; text-decoration: none }
#dhtml-menu tt { font-family: monospace; font-size: 9pt }
#dhtml-menu-separator { height: 1px; background: red }
#dhtml-menu-anchor { cursor: default }
</style>
<script type="text/javascript" src="shared/expandable.js"></script>
</head>
<body onLoad="menuInit(); document.cookie='page=3ds2unr; path=/'" class="default">
<div id="scrolling"><!-- contains all except the fixed sidebar -->
<div id="topbar" class="bar">
<div class="righthalf">
<form class="inline" method="post" action="/wiki" enctype="application/x-www-form-urlencoded"><input type="text" name="search" size="20" /> <input type="submit" name="search" value="search" /></form>
</div>
<div class="lefthalf">
<script type="text/javascript"><!--
menuAlignRight = false;
//--></script>
<span><script type="text/javascript"><!--
menuWriteAnchor("Quick Navigation") //--></script></span> | <a href="(start).html">Home Page</a> | <a href="recent-changes.html">Recent Changes</a> | <a href="http://wiki.beyondunreal.com/wiki?action=editprefs">Preferences</a>
</div>
</div>
<div id="content"><!-- contains the title and article -->
<h1 class='pagetitle'><a href="http://wiki.beyondunreal.com/wiki?back=3ds2unr">3ds2unr</a></h1>
<div class="wiki"><p>This page follows on from where the <a href="3d-studio-max-weapon-modeli.html">3D Studio Max Weapon Modeling And Import</a> tutorial ends.</p>
<h3><a name="0.0.1"></a>Download</h3>
<p><a href="http://unreal.epicgames.com/Files/3ds2unr.zip">[Latest version of 3ds2unr (119)]</a></p>
<h3><a name="0.0.2"></a>HowTo</h3>
<p>Once you have the *.3ds files ready (from the above tutorial) place them all into a new empty directory. Copy the 3ds2unr.exe file into the same directory.</p>
<p>Now you need to decide on what your output file will be called. For my grenade weapon first person view I used grenadefp which is what I will continue using here.</p>
<p>The 3ds files I ended up with after animation and export were:</p>
<ul><li>sel_desel.3ds - the de-select/select animation</li>
<li>pinpull_fire.3ds - animation for pulling the pin and then throwing</li>
</ul>
<p>That was it actually. You might have more. My pin pull and fire were in the same file because at the end of the pin pull the arm is drawn back for the throw and not in the rest position so I thought it was simpler this way.</p>
<p>Open up a DOS box, cd to your new directory that contains 3ds2unr and type in the following command:</p>
<pre class="paraverbatim"> 3ds2unr.exe grenadefp sel_desel.3ds pinpull_fire.3ds</pre><p>Replacing the command arguments with your output name and input 3ds files.</p>
<p>If this is the first time you have run 3ds2unr it will prompt you for a project directory. I selected the directory in which we currently were (where 3ds2unr was). If this is not the first time you have run the util it will carry on with whatever setting it was originally given. This is OK if you know where it is but you do have the option of redefining it by typing the following command:</p>
<pre class="paraverbatim"> 3ds2unr.exe -setproj</pre><p>Assuming this is the first time the utility has been run it will create 2 sub-directories in the project directory (does it or do you have to manually create them? It was all of yesterday I did this):</p>
<ul><li>Classes</li>
<li>Models</li>
</ul>
<p>If there were no problems with the conversion you will find, after the utility has completed, a new *.uc file in the classes directory, and new *_d.3d and *_a.3d files in the Models directory. In my case I had a grenadefp.uc, grenadefp_d.3d and grenade_a.3d files.</p>
<p>You have now finished with 3ds2unr.</p>
<p>If you get an error that you don't understand or want to learn how to use transparent/two-sided object materials etc. then the easiest thing is to read the .DOC file that comes with the 3ds2unr download above. It contains a lot of good information on model/material restrictions and advice on how to achieve different effects.</p>
<h3><a name="0.0.3"></a>What Now</h3>
<p>Once you have the output files it's time to get them into the game. Since my 3ds2unr project directory was nowhere near my UT directory I manually copied the model files into the Models sub-directory of my mods package directory under UT. You will then also need to copy the texture files you used in Max into your models directory. (make sure they are 8bit colour depth and are a power of 2 in resolution - 128*128 or 128*256 or 256*256 etc)</p>
<p>Then open the generated .uc file in notepad and copied all of the #<a href="exec-directive.html">exec directive</a> statements that this contained and paste them at the top of your new weapon class.</p>
<p>The first thing you will need to change is the texture import lines. Example code:</p>
<pre class="uscript"><span class="uscript-exec">#exec TEXTURE IMPORT NAME=Jgrenade FILE=MODELS\hand.bmp GROUP=Skins FLAGS=2 // skins</span>
<span class="uscript-exec">#exec TEXTURE IMPORT NAME=Jgrenade1 FILE=MODELS\grenbody.bmp GROUP=Skins FLAGS=2 // skins</span>
<span class="uscript-exec">#exec TEXTURE IMPORT NAME=Jgrenade2 FILE=MODELS\grenarm.bmp GROUP=Skins FLAGS=2</span>
<span class="uscript-exec">#exec MESHMAP NEW MESHMAP=grenadehn MESH=grenadehn</span>
<span class="uscript-exec">#exec MESHMAP SCALE MESHMAP=grenadehn X=0.1 Y=0.1 Z=0.2</span>
<span class="uscript-exec">#exec MESHMAP SETTEXTURE MESHMAP=grenadehn NUM=1 TEXTURE=Jgrenade</span>
<span class="uscript-exec">#exec MESHMAP SETTEXTURE MESHMAP=grenadehn NUM=2 TEXTURE=Jgrenade1</span>
<span class="uscript-exec">#exec MESHMAP SETTEXTURE MESHMAP=grenadehn NUM=3 TEXTURE=Jgrenade2</span></pre><p>The TEXTURE IMPORT lines will contain texture files that dont exist. Replace the FILE setting with the correct bitmap or pcx file name.</p>
<p>Ensure that in the SETTEXTURE lines that the correct texture is set to the correct NUM value. The NUM value refers to the material ID of the polys in your scene. So for example my arm models all have material ID of 1. My grenade body and ring pull have material ID 2 and the grenade arm has a material ID of 3 (done this way to allow a 2 sided material for the grenade arm)</p>
<p>Next, you may need to change is the placement and orientation of the model. The line for this on my model ended up like this:</p>
<pre class="uscript"><span class="uscript-exec">#exec MESH ORIGIN MESH=grenadehn X=100 Y=0 Z=70 YAW=128</span></pre><p>The origin (X=100 Y=0 Z=70) tells unreal where on the screen the model will appear (X is into the screen, Y is left/right and Z is up/down). Play with the numbers until it looks right. YAW, PITCH and ROLL can also be defined to rotate the model as required (128 is equivalent to 180deg). My model was facing the wrong way initially.</p>
<p>You will also find that the model may be too small or too large on import. To modify this add (or modify) the line</p>
<pre class="uscript">PlayerViewScale<span class="uscript-operator">=</span><span class="uscript-number">0.4</span></pre><p>in the default properties of the class. A value of 1 keeps the model dimensions as they are. Smaller numbers reduce the size...</p>
<p>It can take quite some time to get the model exactly as you want it on screen.</p>
<p>One thing to be careful of is numbers used for the origin. If the model gets moved away too far from the players point of view it will start to clip into walls when you get close.</p>
<p>Next come the animation sequences.</p>
<p>My final code looked like this:</p>
<pre class="uscript"><span class="uscript-exec">#exec MESH SEQUENCE MESH=grenadehn SEQ=All STARTFRAME=0 NUMFRAMES=59</span>
<span class="uscript-exec">#exec MESH SEQUENCE MESH=grenadehn SEQ=down STARTFRAME=0 NUMFRAMES=11 rate=6</span>
<span class="uscript-exec">#exec MESH SEQUENCE MESH=grenadehn SEQ=select STARTFRAME=10 NUMFRAMES=11 rate=6</span>
<span class="uscript-exec">#exec MESH SEQUENCE MESH=grenadehn SEQ=still STARTFRAME=0 NUMFRAMES=1</span>
<span class="uscript-exec">#exec MESH SEQUENCE MESH=grenadehn SEQ=idle STARTFRAME=0 NUMFRAMES=1</span>
<span class="uscript-exec">#exec MESH SEQUENCE MESH=grenadehn SEQ=loading STARTFRAME=21 NUMFRAMES=21 rate=8</span>
<span class="uscript-exec">#exec MESH SEQUENCE MESH=grenadehn SEQ=fire STARTFRAME=41 NUMFRAMES=8</span>
<span class="uscript-exec">#exec MESH SEQUENCE MESH=grenadehn SEQ=downempty STARTFRAME=48 NUMFRAMES=11 rate=6</span></pre><p>The ALL sequence should be done for you. You will need to list out all the other animation sequences specifying the exact frame they start on and how many frames they last. The RATE keyword at the end of some of the lines allows you to speed up or slow down the animation. You will need to play with it until it feels right.</p>
<p>Finally, write the code to call the animations and make your weapon work <img alt=":)" src="emoticons/smile.gif" align="middle"></p>
<p>One last thing. The above code assumes a right handed weapon. Once you have this finished you can copy all of the #exec statements and paste them below the originals. All you have to do is change the MESH IMPORT MESH line so that it has unmirror=1 at the end. i.e.:</p>
<pre class="uscript"><span class="uscript-exec">#exec MESH IMPORT MESH=grenadehn ANIVFILE=MODELS\grenfp_a.3d DATAFILE=MODELS\grenfp_d.3d X=0 Y=0 Z=0 unmirror=1</span></pre><p>Then replace all occurances of the mesh name (grenadehn here) with a different name (I used grenadehnl). You can also remove the TEXTURE IMPORT lines since we have already imported the required textures.</p>
<p>Now for an annoying bit. After getting everything spot on for the right hand view you may find that left hand view is out. Again it is just a question of playing with the origin of the mesh and <em class="em2">also</em> the following:</p>
<pre class="uscript">PlayerViewOffset<span class="uscript-operator">=</span><span class="uscript-operator">(</span>X<span class="uscript-operator">=</span><span class="uscript-number">1.500000</span><span class="uscript-operator">,</span>Y<span class="uscript-operator">=</span><span class="uscript-operator">-</span><span class="uscript-number">1.000000</span><span class="uscript-operator">,</span>Z<span class="uscript-operator">=</span><span class="uscript-operator">-</span><span class="uscript-number">1.650000</span><span class="uscript-operator">)</span></pre><p>Which can be found (or added) to the default properties of the class.</p>
<p>This allows for a model to be mirrored for left/right hand views and be placed exactly where the author wants it. It makes for a lot of tweaking but you can always get the effect you want eventually.</p>
<hr class="thin"><p><em class="em2">Wang:</em> This could do with being a bit more detailed and is "fluffy" in a few areas. Anyone who knows more about the subject should add on/modify where necessary.</p>
<p><em class="em2">Col Kassad:</em> Very nice! <img alt=":)" src="emoticons/smile.gif" align="middle"></p>
<p><em class="em2">Wang:</em> There is something I should add to this that I found out later that only applies to this type of 2 stage firing. On the client in a network game if a weapon is not animating it will be sent to the idle state. When my animation for pulling the pin finished I held the weapon at the last frame of this animation until the user released the fire button. At this point the throw animation ran. Holding the weapon at a specific frame meant it wasn't animating so off it went out of the ClientFiring state. I had to add a 2 frame static animation that could loop in the ready to throw position.</p>
<p><em class="em2">Shuriken:</em> Hey - can anyone tell me if this and the previous tutorial are the same method still used for importing models and animations into UT2003? I've found it really hard to find tutorials about the subject for UT2003... can anyone point me to some if it uses a different method?</p>
<p><em class="em2">Chip:</em> Shuri, this method <em class="em1">can</em> be used for getting vertex animations into UT2003, but that type of animation isn't used for "modern" UT2K3 character models and weapons – they're exported/imported as skeletal meshes, using either <a href="actorx.html">ActorX</a> (for Max and <a href="maya.html">Maya</a> full apps) or with the <a href="uneditor-mll.html">unEditor</a> plug-in for Maya 4.0.1 PLE. The difference between the animation types can be seen if you've ever played the Invasion game type – all the Unreal1 monsters are vertex anims (the method used for Unreal1 characters),and their limited anims are obvious.</p>
<p>In UEd, check the Animations browser to see the extent of skeletal anims used in UT2K3 (File>Open will shows how many .ukx files are used), and the Meshes browser will show the vertex anims. Note that some objects like waving flags are still best done with vertex animation due to the complexity of the motion, or because the mesh shape changes (goop blobs).</p>
<p>So a full answer to your question means you have to define what type of <a href="animation.html">Animation</a> you're planning. Some links that might help: <span class="interwiki"><img
alt="udncontent logo"
title="udncontent"
src="shared//InterWiki-udncontent.png"> <a href="http://udn.epicgames.com/Two/ModelingTableOfContents">ModelingTableOfContents</a></span>, <span class="interwiki"><img
alt="udncontent logo"
title="udncontent"
src="shared//InterWiki-udncontent.png"> <a href="http://udn.epicgames.com/Two/ActorX">ActorX</a></span>, <span class="interwiki"><img
alt="udncontent logo"
title="udncontent"
src="shared//InterWiki-udncontent.png"> <a href="http://udn.epicgames.com/Two/UnrealVertexAnimation">UnrealVertexAnimation</a></span>, <a href="maya-ple-character-model-tu.html">Maya PLE Character Model Tutorial</a></p>
<p><em class="em2">Shuriken:</em> Wow, thanks - detailed reply <img alt=":)" src="emoticons/smile.gif" align="middle"> (this is all new to me, so I need all the help I can get...)</p>
<p>From what I've been working with today, I've realised that I'll definately need bones in the model to attach emitters to. So I assume I have to go the ActorX route (I'm working in Max btw)... but I'm confused about Skeletal Animation. Is it completely different form of animation? Or can I do the regular 'move+rotate' animation that is detailed in the first part of this tutorial.. all I need is some simple recoil effects + select/down.</p>
<p>Also, every weapon mutator I have comes with a .ukx. Is this necessary for skeletal meshes? I know with vertex animating the models you can embed it in the code, which is what I wish to do - possible for skeletal animation?</p>
<p><em class="em2">Chip:</em> Hmmm...hard to answer succinctly, but basically vertex animation & skeletal animation are significantly different methods of accomplishing the same task – animating a mesh. Vertex animation draws on more system resources (from what I've read) during game play, and can be harder to animate for some types of movement (like humanoid stuff.) For weapons, I don't know that it makes much diff, but all "stock" UT2K3 weps are .ukx files, which are skeletal mesh anims. Here's another UDN page to study – it makes the .ukx package a bit more understandable: <span class="interwiki"><img
alt="udncontent logo"
title="udncontent"
src="shared//InterWiki-udncontent.png"> <a href="http://udn.epicgames.com/Two/AnimBrowserTutorial">AnimBrowserTutorial</a></span></p>
<p>I haven't done any weapons yet, so the "embed it in the code" question I can't speak to, but just from the standpoint of ease of animation, export & import, the skeletal route seems better to me. Check out the ShockRifle_1st model & anims in Weapons.ukx (use the Animations browser) – a good recoil anim example, among others.</p>
<p><em class="em2">*Someone*:</em> Do you know if I can just clone the objects and move them into their individual frames?</p>
<hr class="thin"><p><a href="category-tutorial.html">Category Tutorial</a></p>
<script type="text/javascript"><!--
menuItemAdd("Download", "#0.0.1");
menuItemAdd("HowTo", "#0.0.2");
menuItemAdd("What Now", "#0.0.3");
menuWrite() //--></script></div>
</div>
<div id="footer" class="bar">
<p><form method="post" action="http://wiki.beyondunreal.com/wiki" enctype="application/x-www-form-urlencoded">
<a href="(start).html">Home Page</a> | <a href="recent-changes.html">Recent Changes</a> | <a href="http://wiki.beyondunreal.com/wiki?action=editprefs">Preferences</a><br>
<a href="http://wiki.beyondunreal.com/wiki?action=edit&id=3ds2unr">Edit text of this page</a> | <a href="http://wiki.beyondunreal.com/wiki?action=history&id=3ds2unr">View other revisions</a><br>Last edited November 2, 2005 16:22 <a href="http://wiki.beyondunreal.com/wiki?action=browse&diff=1&id=3ds2unr">(diff)</a><br>Search: <input type="text" name="search" size="20" /><input type="hidden" name="dosearch" value="1" /><br><br><small><a href="http://wiki.beyondunreal.com/wiki/3ds2unr">Original page</a> – copy created Sat, Jun 23, 2007</small><div></div>
</form>
</p>
<p>The three virtues of a programmer: Laziness, Impatience, and Hubris. (Larry Wall)
</p>
</div>
</div><!-- close of "scrolling" div -->
<div id="quickbar">
<div id="logo"><a href="http://wiki.beyondunreal.com/"><img src="shared/wikilogo.jpg" width="143" height="100" border="0"></a>
</div>
<div class="qbsitename">
<p>The Unreal Engine Documentation Site</p>
</div>
<div class="qbsection">
<p><a href="metatopics.html">Wiki Community</a></p>
<p><a href="category-category.html">Topic Categories</a></p>
<p><a href="/cgi-bin/imageupload.cgi/wiki-ext/imageupload.htt" target="_blank ">Image Uploads</a></p>
<p><a href="http://wiki.beyondunreal.com/wiki?action=random">Random Page</a></p>
<p><a href="recent-changes.html">Recent Changes</a></p>
<p><a href="offline-wiki.html">Offline Wiki</a></p>
</div><div class="qbsection">
<p><a href="unreal-engine.html">Unreal Engine</a></p>
<p><a href="console-commands.html">Console Commands</a></p>
<p><a href="terminology.html">Terminology</a></p>
<p><a href="category-faq.html">FAQs</a></p>
<p><a href="help-desk.html">Help Desk</a></p>
</div><div class="qbsection">
<p><a href="topics-on-mapping.html">Mapping Topics</a></p>
<p><a href="mapping-lessons.html">Mapping Lessons</a></p>
<p><a href="unrealed-3.html">UnrealEd Interface</a></p>
</div><div class="qbsection">
<p><a href="unrealscript.html">UnrealScript Topics</a></p>
<p><a href="unrealscript-lessons.html">UnrealScript Lessons</a></p>
<p><a href="making-mods.html">Making Mods</a></p>
<p><a href="class-tree.html">Class Tree</a></p>
</div><div class="qbsection">
<p><a href="topics-on-modeling.html">Modeling Topics</a></p>
</div><div class="qbsection">
<p><a href="chongqing-page.html">Chongqing Page</a></p>
<p><a href="log-in.html">Log In</a></p></div>
</div>
</body></html>