Editing Orgins On A Model...

HazeHaze 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?

Comments

  • WindelkronWindelkron Join Date: 2002-04-11 Member: 419Members
    while we're at it, is there anything I can use to rotate the model (counter)clockwise?
  • DelarosaDelarosa Naturally Custom Join Date: 2002-11-29 Member: 10214Members, NS1 Playtester
    yes and no to the money question.

    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.
  • MelajoMelajo Join Date: 2003-04-03 Member: 15171Members
    All you really need to know are the numbers that come before and after zero.

    Dela - Jeds Model Viewer supports studiomdl and Kriasto's Decompiler 1.2, so you don't have to bother with milkshape.
  • DelarosaDelarosa Naturally Custom Join Date: 2002-11-29 Member: 10214Members, NS1 Playtester
    <!--QuoteBegin--Sushi08023+Dec 21 2003, 10:19 PM--></span><table border='0' align='center' width='95%' cellpadding='3' cellspacing='1'><tr><td><b>QUOTE</b> (Sushi08023 @ Dec 21 2003, 10:19 PM)</td></tr><tr><td id='QUOTE'><!--QuoteEBegin--> All you really need to know are the numbers that come before and after zero.

    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...
  • MelajoMelajo Join Date: 2003-04-03 Member: 15171Members
    Here, I've included them. It includes Kriasto's Decompiler and studiomdl, as well as a nifty thingy that decompiles a bunch of models in a directory i think.

    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>
  • PFCNublarPFCNublar Join Date: 2003-04-23 Member: 15792Members
    Actually, its in one of the sticked threads. At the bottom of the "Want to make models, skins, or sprites?" thread. There is also a small tutorial in there about changing origins. At the bottom is the compiler/decompiler in a .zip.

    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-->.
  • Wolf_KahlerWolf_Kahler Join Date: 2002-11-29 Member: 10252Members
    "Kratisto" is the name of the guy who made the decompiler.
  • WindelkronWindelkron Join Date: 2002-04-11 Member: 419Members
    anything for my question?? <!--emo&:)--><img src='http://www.unknownworlds.com/forums/html/emoticons/smile.gif' border='0' style='vertical-align:middle' alt='smile.gif'><!--endemo-->
  • MelajoMelajo Join Date: 2003-04-03 Member: 15171Members
    edited December 2003
    There is a command in the QC file for that...lemme go check...

    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.
  • WindelkronWindelkron Join Date: 2002-04-11 Member: 419Members
    you sure it's the Z axis? I thought Z was the horizontal axis. I'm looking for a command that will be able to rotate the model like that (ie changing the model being held sideways to being held upright)

    I just tried to compile it with $rotate and it said bad command...
  • MelajoMelajo Join Date: 2003-04-03 Member: 15171Members
    edited December 2003
    use studiomdl...Milkshapes doesn't support that command i think.
  • HazeHaze O RLY? Join Date: 2003-07-07 Member: 18018Members, Constellation
    But is there any <u>easy</u> way to edit the orgins on a model? Without having to rotate all this stuff, do this and do that?
  • WindelkronWindelkron Join Date: 2002-04-11 Member: 419Members
    edited December 2003
    haze, origins are easy. at the beginning of the qc all you need to do is have the $origin x y z.

    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-->
  • HazeHaze O RLY? Join Date: 2003-07-07 Member: 18018Members, Constellation
    I dont know what a qc is! I dont even know how to compile things!
  • WindelkronWindelkron Join Date: 2002-04-11 Member: 419Members
    ok step by step:
    <!--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-->
  • CaptainPanakaCaptainPanaka Join Date: 2002-11-02 Member: 4718Members
    ... or just use Jed's HLMV.... I got a quite good result on that Drake handgun, just by using the re-origin feature of the HLMV:

    <img src='http://mitglied.lycos.de/estaransrealm/pics/drake-hg.gif' border='0' alt='user posted image'>
  • PanzerOxPanzerOx Join Date: 2003-04-22 Member: 15754Members
    I'm pretty sure it doesn't save that way panaka, you might have to edit in the new cooridinates into the QC file.
  • DelarosaDelarosa Naturally Custom Join Date: 2002-11-29 Member: 10214Members, NS1 Playtester
    yea, Jed's 1.0 doesn't save it... so you HAVE to edit the qc file...

    nothing major though
  • CaptainPanakaCaptainPanaka Join Date: 2002-11-02 Member: 4718Members
    <!--QuoteBegin--Delarosa+Dec 24 2003, 05:18 AM--></span><table border='0' align='center' width='95%' cellpadding='3' cellspacing='1'><tr><td><b>QUOTE</b> (Delarosa @ Dec 24 2003, 05:18 AM)</td></tr><tr><td id='QUOTE'><!--QuoteEBegin--> yea, Jed's 1.0 doesn't save it... so you HAVE to edit the qc file...

    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-->
  • HazeHaze O RLY? Join Date: 2003-07-07 Member: 18018Members, Constellation
    i resaved the model and its not working, can somone help? ( i have jeds)
  • NecrosisNecrosis The Loquacious Sage Join Date: 2003-08-03 Member: 18828Members, Constellation
    You edited the QC? Ok, so its not working "how"?

    IE too far forward, back, up, down, etc.
  • HazeHaze O RLY? Join Date: 2003-07-07 Member: 18018Members, Constellation
    guys where is this qc file at? All I have is jeds hlmv no milkshape none of that.
  • ClashenClashen Join Date: 2003-08-22 Member: 20087Members
    <!--QuoteBegin--CaptainPanaka+Dec 24 2003, 11:36 AM--></span><table border='0' align='center' width='95%' cellpadding='3' cellspacing='1'><tr><td><b>QUOTE</b> (CaptainPanaka @ Dec 24 2003, 11:36 AM)</td></tr><tr><td id='QUOTE'><!--QuoteEBegin--> <!--QuoteBegin--Delarosa+Dec 24 2003, 05:18 AM--></span><table border='0' align='center' width='95%' cellpadding='3' cellspacing='1'><tr><td><b>QUOTE</b> (Delarosa @ Dec 24 2003, 05:18 AM)</td></tr><tr><td id='QUOTE'><!--QuoteEBegin--> yea, Jed's 1.0 doesn't save it... so you HAVE to edit the qc file...

    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
  • HazeHaze O RLY? Join Date: 2003-07-07 Member: 18018Members, Constellation
    anyone know how I can save these orgins? i'm using jeds hlmv and thats *it*
  • NecrosisNecrosis The Loquacious Sage Join Date: 2003-08-03 Member: 18828Members, Constellation
    I don't think it lets you in Jed's, you'll have to decompile the model and edit the QC files in notepad.


    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.
  • BAshhBAshh Join Date: 2003-08-26 Member: 20222Members, NS1 Playtester, Contributor
    everytime i try using $eyeposition X Y Z and a possition, it compiles but never moves the orgin. I don't get it.
  • WindelkronWindelkron Join Date: 2002-04-11 Member: 419Members
    don't use $eyeposition, use $origin. when the thread says to use $eyeposition, I think it's making a mistake...

    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.
  • MalambisBZMalambisBZ Join Date: 2002-11-21 Member: 9559Members
    <!--QuoteBegin--Ha.ze+Jan 4 2004, 04:28 PM--></span><table border='0' align='center' width='95%' cellpadding='3' cellspacing='1'><tr><td><b>QUOTE</b> (Ha.ze @ Jan 4 2004, 04:28 PM)</td></tr><tr><td id='QUOTE'><!--QuoteEBegin--> anyone know how I can save these orgins? i'm using jeds hlmv and thats *it* <!--QuoteEnd--> </td></tr></table><span class='postcolor'> <!--QuoteEEnd-->
    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-->
Sign In or Register to comment.