id Tech Forums

id Tech 4 (Doom3/Prey/Q4) => id Tech 4 Models and Animations => Topic started by: spamclark15 on June 01, 2017, 11:19:07 PM

Title: A question about Commando scaling
Post by: spamclark15 on June 01, 2017, 11:19:07 PM
I've noticed that the chaingun commando is 90% the size of the tentacle commando, but there doesn't seem to be a simple way of modding the game to bring them to the same scale again. Is there a way this could be done programmatically in the engine or game code or a feasable way of doing this using the md5mesh and md5animations and running them through Blender?
Title: Re: A question about Commando scaling
Post by: The Happy Friar on June 02, 2017, 09:27:35 PM
I've done it in Blender by importing the md5mesh, scaling it, then reexporting it.  I forget exactly how I did it but I know if you scale it the wrong way (ie object vs bone) it doesn't work properly.

But that does work.
Title: Re: A question about Commando scaling
Post by: spamclark15 on June 02, 2017, 10:00:26 PM
Could you possibly do it again?  :o It would be a huge help as I know next to nothing about manipulating the game's meshes.
Title: Re: A question about Commando scaling
Post by: The Happy Friar on June 06, 2017, 09:31:33 AM
Figured out how to do it again.  Each animation needs to be imported & reexported too.
Anyone know if there was ever a md5mesh/anim scaler program?
Title: Re: A question about Commando scaling
Post by: spamclark15 on June 06, 2017, 12:24:16 PM
I don't think, but it would be nice right now. I can import and export them to/from Blender, but I don't know the process for scaling up the mesh and animations and saving it all out.
Title: Re: A question about Commando scaling
Post by: The Happy Friar on June 06, 2017, 01:15:22 PM
I'm using Blender 2.49b with the XReal MD5 exporter. (http://idtechforums.fuzzylogicinc.com/index.php?topic=17.0)

1) import monster & animations.
2) Unlink the bones & mesh's.  I think you select the mesh & remove it's parent, but do both just to be safe.
3) select the bones in edit mode & scale them to the desired size.  Holding CTRL while doing it goes in fixed increments.
4) Select the mesh in edit mode & scale them the same way.
5) Now export.  The XReal exporter allows you to export all the animations at once.  It has a "scale" function but not 100% sure that works all the time.  Seemed hit & miss in my tests (but could be just my tests).
Title: Re: A question about Commando scaling
Post by: spamclark15 on June 06, 2017, 05:06:03 PM
I'm pretty new to Blender. Could you go into a little more detail on each step? What import plug-in do you use?

Mostly it's the key and button controls to do the steps that I don't have experience using.
Title: Re: A question about Commando scaling
Post by: spamclark15 on June 07, 2017, 01:24:07 AM
Alright I installed Blender 2.49b, installed Python 2.6.2, downloaded the XReal MD5 exporter and der_ton's import and export scripts for 2.49 and put the scripts in a couple of places I thought it would find them, both in Blender's scripts folder inside its root directory as well as in Application Data, but all 3 scripts aren't showing up under the import and export menus. In newer versions of Blender you can configure this stuff under User Preferences, but there doesn't seem to be any such screen for 2.49b. Help?

I'm trying to get my setup to match yours so that I can follow your steps exactly.
Title: Re: A question about Commando scaling
Post by: The Happy Friar on June 07, 2017, 01:43:57 PM
Use the included zip file & unzip to your Blender 2.49b folder/.blender/scripts.  Overwrite any others.  I don't think they showed up in the menu & I had to make some small changes.
Reboot your computer after you installed Python or else it won't work with Blender.

Then they should work.
Title: Re: A question about Commando scaling
Post by: spamclark15 on June 07, 2017, 07:01:20 PM
Thanks, now both show up. Now what? I noticed the import screen has a scaling feature and so I imported the tentacle commando at 1.0 and the chaingun commando at 1.1 just to see if it scaled properly and it does. The import screen only has a button for 1 animation though.
Title: Re: A question about Commando scaling
Post by: The Happy Friar on June 07, 2017, 08:56:54 PM
You can only import one at a time.  The commando has a lot more animations then most monsters.  :)
Title: Re: A question about Commando scaling
Post by: spamclark15 on June 08, 2017, 12:39:00 AM
So how do I import each additional one?

I went ahead and imported the mesh and his idle animation with scale set to 1.1x and then exported it to test. The animation and mesh do export, but his textures are missing in-game and he can't be damaged.
Title: Re: A question about Commando scaling
Post by: The Happy Friar on June 08, 2017, 12:31:14 PM
With the skelecton object selected in blender, use the import md5 plugin again but just import a md5anim, no mesh.  It will add the imported anim to the existing skeleton.

Older blender doesn't support exporting material names to md5mesh (a max length thing) so you need to put those in the md5mesh manually.  Normally what I do is have the original & new mesh open in a text editor (I like Notepad++) & search for "numverts" in the origional mesh, see the # after it, then search for that "numverts #" in the new mesh & copy/paste the respective shader from the original to the new one.
Title: Re: A question about Commando scaling
Post by: spamclark15 on June 08, 2017, 12:57:47 PM
So once I've imported the mesh and all animations, how does the export go to get all of the animations exported too? The export screen seemed to only allow picking 1 animation. Would I use the same 1.1 import scale via the script for each of the animations?

Alright I've done some animations, and all seems good until they become a ragdoll, at which point rather than falling over dead, the physics goes completely ape. Have I missed something?
Title: Re: A question about Commando scaling
Post by: The Happy Friar on June 08, 2017, 10:03:31 PM
With the XReal exporter it should give you the option to add more animations to export.  You give the start & end frame (should be auto set) & choose the path/filename to export to.

With a scale change you'll need to change the AF for the ragdoll.  Use the built in AF editor.  That's more work & a pain.  :)
Title: Re: A question about Commando scaling
Post by: spamclark15 on June 08, 2017, 10:16:23 PM
Done with the animations. What will I need to do in the AF editor? I tried copying values that differed over from the tentacle commando AF but it didn't help much. Could you take a look at it?
Title: Re: A question about Commando scaling
Post by: The Happy Friar on June 10, 2017, 02:49:45 PM
For some reason the origin on the exported pose you did is wrong for the AF pose.  That messes up the whole AF.  It looks good in Blender, just Doom 3 has it wrong.  :?

The md5anim's look ok.  Seems to be something with the AF I can't find yet.
Title: Re: A question about Commando scaling
Post by: spamclark15 on June 10, 2017, 06:47:53 PM
Oh. Are there certains things that need to be done to the AF animation or preparation of md5 exports in general? It's perpelexing as the game plays the animations correctly but when it becomes a ragdoll it mangles the mesh.
Title: Re: A question about Commando scaling
Post by: The Happy Friar on June 10, 2017, 08:33:34 PM
The AF is used for ragdoll's, that's pretty much it (might be some other collision stuff to, not 100% sure any more).  Hence the ragdolls not working properly.
Title: Re: A question about Commando scaling
Post by: spamclark15 on June 11, 2017, 01:21:43 AM
Since it's an issue with chaingun_af_pose.md5anim I've focused my attention there, comparing the original and the one I exported. The behavior (and his size) return to normal if I just stick the original file back in, so it makes me want to start messing with the contents of it. With all the other animations being perfect by the game, I don't see why it's having an issue with this.

EDIT:

I managed to figure it out by studying documentation on the md5anim format and editing it in notepad. Replacing the hierarchy with the original gets rid of the origin problem (the table doesn't store any coordinates) and then going through the baseframe and each body has 2 sets of numbers in parenthesis, the first being where a body is X/Y/Z (which I left alone as changing the size would also change these numbers) and then replacing the second set which is the direction that each body points X/Y/Z as I noticed some of them seemed to be very close or exact to the original values but negative, so I replaced these for all 64 bodies with the originals as the directions would stay the same. This ended up fixing the problem.