Page 1 of 1

Re: Using TRAN in msh files

Posted: Fri Dec 21, 2007 12:36 am
by RepSharpshooter
If you look through a mesh file with a hex editor, there will be different MODL chunks. You can see these different MODL's in 3DOC via the scene explorer. After each MODL is a TRAN chunk. Inside the TRAN are (after the customary 4 byte long integer telling the size of the chunk) there are 10 floating point decimals. This is what they do:


Scale in X
Scale in Y
Scale in Z
Quat Rotation in X
Quat Rotation in Y
Quat Rotation in Z
Quat Rotation in W
Translation in X
Translation in Y
Translation in Z

You can use this chunk to "tweak" your models after export, if they're incorrect. What I do is import them via my importer, then move the different parts around, then type that transform value into this chunk. It's pretty simple to do actually, had a hard time, cause Riley's Mesh Reference was wrong about this whole chunk.

FYI: Refer to "Adding Cloth" in the "Everything You Need" to understand a little more how to read these numbers, where they are, and how to change them in msh files.

I put boba's cape on a magnaguard, and I needed to scale it up and move it, so this helps here. I also need it for my weapon models that are a little off-scale. This is a big time saver, hopefully.

Image


EDIT
I'm having trouble with using the scale on weapons. When I tried to scale it up, it rotated it instead. It works fine as a prop though. I can't imagine why scale would work for props and not weapons, cause they use the same mesh.

Re: Using TRAN in msh files

Posted: Fri Dec 21, 2007 9:38 pm
by Teancum
It might have to do with heirarchy, I'm not sure. The other problem might be with the fact that it's now got multiple parts. Dunno, just picking as straws here.

Re: Using TRAN in msh files

Posted: Sat Dec 22, 2007 5:14 pm
by wazmol
amazing find, thanks a lot!

Re: Using TRAN in msh files

Posted: Sun Dec 30, 2007 12:06 pm
by Caleb1117
This could help Sooooo much with addon meshes, no going back and tweaking it 50 times.

Sorry to bump, but do you mean this section:
TRAN(......?...?...?
So the changes are applied through the red sections?
What if I want to scale it down? that would require the use of more then one space.

Re: Using TRAN in msh files

Posted: Sun Dec 30, 2007 8:41 pm
by RepSharpshooter
I'm not sure what kind of hex editor you're using :?
Image

Re: Using TRAN in msh files (FAQ)

Posted: Thu Jul 08, 2010 10:58 am
by RepSharpshooter
I use Hex editor XVI32, you can find it free by googling it.

Scale in X
Scale in Y
Scale in Z
Quat Rotation in X
Quat Rotation in Y
Quat Rotation in Z
Quat Rotation in W
Translation in X
Translation in Y
Translation in Z

The "rotation in w" is what I thought was a scale, but it's actually just like some sort of quaternion rotation thing. I suppose for props though, changing this to a value other than 1 does in fact make it scale.

If you can find TRAN, then it goes like this:
T R A N 00 00 00 00 00 00 00 00 00 00 00 00 etc

The size long integer, 4 bytes long
Scale in X
Scale in Y
etc
Basically count every four bytes starting at the T in Tran. When you arrive at the one you want, just use tools > encode number, selecting a float value, overwriting at this spot (which the spot should be the first byte of the 4 bytes).

^^ this was a pm I sent to someone, clarifying this topic, I'll post it here too so that anyone that may use it in the future will be clarified as well.