Editing Orgins On A Model...
Haze
O RLY? Join Date: 2003-07-07 Member: 18018Members, Constellation
<div class="IPBDescription">How do you do it?</div> How do you edit orgins on a model? I've always wanted to edit the orgins on some models, like the orginal NS pistol to make it have <a href='http://www.unknownworlds.com/forums/index.php?act=ST&f=19&t=56716' target='_blank'>these</a> orgins.
Is it simple? Does it require anything that you have to pay money for?
Is it simple? Does it require anything that you have to pay money for?
Comments
there are tools to Compile/Decompile a model (available free somewhere... but i use the ones built into milkshape)
once you've decompiled the model, your left with a folder (hopefully you put it in a folder before decompile) full of random files...
one of these files has the extention .QC, this file can be opened using any low-level text editor... i prefer wordpad over notepad, but both work.
Inside of this QC file, you'll find the line that starts with
$eyeposition
then had 3 numbers after it, for example, the fixed version of Drakes Custom shotgun uses this:
$eyeposition 0.500000 0.000000 1.000000
this is given in X Y Z coordinates... when you compile a model, you can use Jed's HLMV hack to look at the model FROM the orgin it says... note, if in the QC, that won't showup in Jed's HLMV... so <b>beware</b>, drakes shotty still looks like the orgin is 0 0 0, even though it's not.
anyway, moving on... you can use Jed's HLMV to mess around with the orgins, and not have to compile a new version everytime, like you used to have to do. Once you've found the orgins you like, edit the QC file, and re-compile...
and there you have it, a model with new orgins, without having to know TONS about modeling.
Dela - Jeds Model Viewer supports studiomdl and Kriasto's Decompiler 1.2, so you don't have to bother with milkshape.
Dela - Jeds Model Viewer supports studiomdl and Kriasto's Decompiler 1.2, so you don't have to bother with milkshape. <!--QuoteEnd--> </td></tr></table><span class='postcolor'> <!--QuoteEEnd-->
...but they don't come with it... so you still have to find them somewhere...
Go to Tools>Configure Tools to configure them.
For what tool im talking about,
<a href='http://collective.valve-erc.com/index.php?news=1062537584-80576300' target='_blank'>http://collective.valve-erc.com/index.php?...537584-80576300</a>
Hope that helps <!--emo&:)--><img src='http://www.unknownworlds.com/forums/html/emoticons/smile.gif' border='0' style='vertical-align:middle' alt='smile.gif'><!--endemo-->.
edit: Here we go...
$rotate <# degrees>
Rotates the animation sequence around the Z (vertical) axis by the specified number of degrees. Rotate 90 would turn an animation facing forward into one facing left, for example.
I just tried to compile it with $rotate and it said bad command...
the discussion about rotation was in response to my question right below your post about rotating models. so dont worry about that <!--emo&:)--><img src='http://www.unknownworlds.com/forums/html/emoticons/smile.gif' border='0' style='vertical-align:middle' alt='smile.gif'><!--endemo-->
btw I am using studiomdl <!--emo&:(--><img src='http://www.unknownworlds.com/forums/html/emoticons/sad.gif' border='0' style='vertical-align:middle' alt='sad.gif'><!--endemo-->
<!--QuoteBegin--></span><table border='0' align='center' width='95%' cellpadding='3' cellspacing='1'><tr><td><b>QUOTE</b> </td></tr><tr><td id='QUOTE'><!--QuoteEBegin-->De-Compiling Models
Before you can edit anything, you're going to need to decompile the models.
Milkshape has a built-in decompiler, but it is far from perfect. Recent versions have started using Kratisto's Decompiler, which is far superior. For those who have been around for a while, weapons don't have to be re-origined if done with Kratisto's decompiler. The nice thing about Kratisto's Decompiler is he has released it in EXE format, so decompiling is no longer tied to Milkshape alone (MAX users rejoice). Mdldec.exe is a DOS program. If you click it in windows, nothing will happen (until you set it up, see below). I suggest placing this (and other related tools) in a \bin directory in your half-life folder. For the clueless, thats C:\Sierra\Half-life\bin
---
The Decompiler and Compiler are attached to this post. If anyone wants to mirror them please do, because I don't know how long the forum keeps attachments.
Steps to take so you can right-click MDL files to decompile them:
1. Create a .BAT file in the same directory as mdldec.exe. For convenience, call it mdldec.bat. I will use example paths throughout this tutorial, you MUST make sure your paths point to where ever you put the files. You can create BAT files with notepad. Your BAT must contain these commands:
CODE
C:\Sierra\Half-life\bin\mdldec.exe %1
pause
-if you put the decompiler exe in a different location, simply point this command there instead
2. In explorer, select Tools->Folder Options, File Types tab. Scroll down to the MDL entry, which should say "Opens with HLMV" by now.
3. Click "Edit..."
4. Click "New..."
5. Action: Decompile Application: C:\Sierra\Half-life\bin\mdldec.bat
6. "OK" "OK" "OK"
7. Right-click MDL files and select Decompile to decompile them. Its a good idea to stick them in an empty subdirectory when doing this, as it can generate a LOT of files (especially player models).<!--QuoteEnd--></td></tr></table><span class='postcolor'><!--QuoteEEnd-->
You will find a .qc file in there somewhere. Open it with notepad and <!--QuoteBegin--></span><table border='0' align='center' width='95%' cellpadding='3' cellspacing='1'><tr><td><b>QUOTE</b> </td></tr><tr><td id='QUOTE'><!--QuoteEBegin-->Q: How do I create ironsights, shoulder views, or other-wise reposition a v_model?
A: This is done by using $origin in your QC file at compile time. Place it near the top of your QC file, before the $sequences.
FORMAT: $origin X Y Z
X is left/right. Positive values move to the right.
Y is in/out. Positive values move out, away from you.
Z is up/down. Positive values move down.<!--QuoteEnd--></td></tr></table><span class='postcolor'><!--QuoteEEnd-->
in other words, write a new line at the top of the qc file called $origin.
and then
<!--QuoteBegin--></span><table border='0' align='center' width='95%' cellpadding='3' cellspacing='1'><tr><td><b>QUOTE</b> </td></tr><tr><td id='QUOTE'><!--QuoteEBegin-->Compiling Models
So you've got a shiny new model. Now you have to compile it into an MDL so you can share your creation with the rest of us. If you've got this far, I hope you've read Valve's manual, cuz I'm not gonna tell you what needs to go into a model. I will tell you how to get it compiled though.
---
Models are compiled with a program called Studiomdl.exe. Milkshape has a built-in version, but it will NOT always compile player models (they can have too many animations, though NS models are fine ... for now). Studiomdl.exe, another DOS program, is better than Milkshape so we'll go through the setup process again.
Steps to compile by right-clicking QC files:
1. Create a .BAT file in the same directory as studiomdl.exe. Studiomdl.bat works nice. Put these commands in your BAT:
CODE
C:\Sierra\Half-life\bin\studiomdl.exe %1
pause
-if you put the compiler exe in a different location, simply point this command there instead
2. In explorer, select Tools->Folder Options, File Types tab. Scroll down to the QC entry, which should say "Opens with Notepad" by now. If you don't have QC's in there yet, double click one and associate it with notepad.
3. Click "Edit..."
4. Click "New..."
5. Action: Compile Application: C:\Sierra\Half-life\bin\studiomdl.bat
6. "OK" "OK" "OK"
7. When ready to compile, simply right-click your QC in explorer.<!--QuoteEnd--></td></tr></table><span class='postcolor'><!--QuoteEEnd-->
<img src='http://mitglied.lycos.de/estaransrealm/pics/drake-hg.gif' border='0' alt='user posted image'>
nothing major though
nothing major though <!--QuoteEnd--> </td></tr></table><span class='postcolor'> <!--QuoteEEnd-->
sure it does save the origin... just resave the model... <!--emo&;)--><img src='http://www.unknownworlds.com/forums/html/emoticons/wink.gif' border='0' style='vertical-align:middle' alt='wink.gif'><!--endemo-->
IE too far forward, back, up, down, etc.
nothing major though <!--QuoteEnd--></td></tr></table><span class='postcolor'><!--QuoteEEnd-->
sure it does save the origin... just resave the model... <!--emo&;)--><img src='http://www.unknownworlds.com/forums/html/emoticons/wink.gif' border='0' style='vertical-align:middle' alt='wink.gif'><!--endemo--> <!--QuoteEnd--> </td></tr></table><span class='postcolor'> <!--QuoteEEnd-->
Wich version are you using? I am using v1.25
Follow the quoted instructions about running the decompiler and then decompile your MDL file to a bunch of text ones. Open up the whatever.qc file and change the origin there. Then save it, and run the compiler, and bish bash bosh you'll have a reorigined model.
Shouldn't take more than 20 minutes, no milkshape.
be careful with putting the origins too far inward, though; the animations can often clip into your own face and you'll get ugly, ugly clipping all over the place.
Did you try 'File>Save Model As...'? <!--emo&;)--><img src='http://www.unknownworlds.com/forums/html/emoticons/wink.gif' border='0' style='vertical-align:middle' alt='wink.gif'><!--endemo-->