Model / TMdl Editing

Technical discussion of development of third-party apps.
trey31
Hall of Fame
Posts: 1713
Joined: Mon Oct 06, 2014 1:48 pm
Contact:

Re: Model / TMdl Editing

Postby trey31 » Wed Mar 01, 2017 9:12 pm

How is MoRE translating the data in the .tmdl file into geometry data?

For instance, your screenshot of rotate.tmdl has tons of geometry data when open in MoRE, but when I view it in Hex or Notepad or Notepad++, there is no discernable geometry data?

Spoiler:
Image
My M08 mod work is all open-source to anyone who wants to use it in any way, no restrictions or permissions necessary.

Re: Model / TMdl Editing

Sponsor

Sponsor
 

User avatar
StingRay68
Hall of Fame
Posts: 1073
Joined: Mon Jan 09, 2012 7:23 pm

Re: Model / TMdl Editing

Postby StingRay68 » Thu Mar 02, 2017 7:33 am

Most everything stored in dats is all binary. The tmdl geometry is stored as 32bit floats. You're not going to be able to those files correctly with notepad.

trey31
Hall of Fame
Posts: 1713
Joined: Mon Oct 06, 2014 1:48 pm
Contact:

Re: Model / TMdl Editing

Postby trey31 » Thu Mar 02, 2017 8:12 am

StingRay68 wrote:Most everything stored in dats is all binary. The tmdl geometry is stored as 32bit floats. You're not going to be able to those files correctly with notepad.


What program do I want to use to view the binary 32-bit floats?
My M08 mod work is all open-source to anyone who wants to use it in any way, no restrictions or permissions necessary.

trey31
Hall of Fame
Posts: 1713
Joined: Mon Oct 06, 2014 1:48 pm
Contact:

Re: Model / TMdl Editing

Postby trey31 » Thu Mar 02, 2017 8:18 am

trey31 wrote:
StingRay68 wrote:Most everything stored in dats is all binary. The tmdl geometry is stored as 32bit floats. You're not going to be able to those files correctly with notepad.


What program do I want to use to view the binary 32-bit floats?


Image

So MoRE sees this and displays the binary32 code as a number with a decimal value?
My M08 mod work is all open-source to anyone who wants to use it in any way, no restrictions or permissions necessary.

User avatar
StingRay68
Hall of Fame
Posts: 1073
Joined: Mon Jan 09, 2012 7:23 pm

Re: Model / TMdl Editing

Postby StingRay68 » Thu Mar 02, 2017 8:35 am

1 - all the data in the tmdl files is laid out according to a certain structure, without understanding that you would have a hard time finding the specific information you are looking for.

You can use a hex editor, to view the files, that gives you the greatest access and modification possibilities.
Honestly, if you're able to run it, you're better off looking at the values with MoRE as the work has already been done to display the values.

trey31
Hall of Fame
Posts: 1713
Joined: Mon Oct 06, 2014 1:48 pm
Contact:

Re: Model / TMdl Editing

Postby trey31 » Thu Mar 02, 2017 8:48 am

StingRay68 wrote:1 - all the data in the tmdl files is laid out according to a certain structure, without understanding that you would have a hard time finding the specific information you are looking for.

You can use a hex editor, to view the files, that gives you the greatest access and modification possibilities.
Honestly, if you're able to run it, you're better off looking at the values with MoRE as the work has already been done to display the values.


MoRE is great at viewing the values. I'm really trying to extract the values from .tmdl and build .obj files out of them.

Obj files are pretty much just vertex data containers, not much else. They can be viewed and edited with almost any 3D editing software, even 3D Builder that comes packaged with Windows allows simple editing of .obj files.

I'm hoping to get the vertex data out of the .tmdl files, build .obj files with it, and at the very least view the data in 3D. Maybe even edit the .obj and then replace the .tmdl data that was extracted with the new edited data from the .obj file.

Code: Select all

# Blender v2.78 (sub 0) OBJ File: ''
# www.blender.org
mtllib Tom Brady_arms.mtl
o DrawCall_4_DrawCall_4.001
v 3.158769 0.640770 -2.015343
v 3.083574 0.628624 -2.037926
v 3.126000 0.571618 -2.031823
v 2.832163 0.148278 -2.111107

^ That's pretty much all there is to .obj files.
My M08 mod work is all open-source to anyone who wants to use it in any way, no restrictions or permissions necessary.

User avatar
StingRay68
Hall of Fame
Posts: 1073
Joined: Mon Jan 09, 2012 7:23 pm

Re: Model / TMdl Editing

Postby StingRay68 » Thu Mar 02, 2017 5:16 pm

I understand. When I have more free time I will see about making an export function for the geometry values, but thats probably not going to happen until April at the earliest.

trey31
Hall of Fame
Posts: 1713
Joined: Mon Oct 06, 2014 1:48 pm
Contact:

Re: Model / TMdl Editing

Postby trey31 » Thu Mar 02, 2017 5:22 pm

StingRay68 wrote:I understand. When I have more free time I will see about making an export function for the geometry values, but thats probably not going to happen until April at the earliest.


Completely understandable. I'd love to see what I can do with them. Thanks a million in advance.
My M08 mod work is all open-source to anyone who wants to use it in any way, no restrictions or permissions necessary.

trey31
Hall of Fame
Posts: 1713
Joined: Mon Oct 06, 2014 1:48 pm
Contact:

Re: Model / TMdl Editing

Postby trey31 » Sun Mar 05, 2017 9:51 am

Image
^ Binary Viewer.

Image
^ 00000-UIS_LIB_GAMEMODEL.dat.File00000.tmdl open in MoRE app.

GAMEMODEL.dat file observations:
    00000 = Helmet (0.01-0.2 geometry range)
    00001 = Star? Global or Large object (2-3107) ? Unhandled exception - Index was out of range.
    00002 = Ring? Small object (0-1 geometry range) Instant Replay camera ring?
    00003 = Wind arrow? Global or Large object ? (0-42 geometry range) Unhandled exception - Index was out of range.
    00004 = Binder ring? Global or Large object (0.00-78 geometry range) ?
    00005 = Binder page? Global or Large object (0.00-32 geometry range) ?
    00006 - 3D_ring.ea3 / ring_mad2002 / ring_gradient ? Global or Large object (0-65 geometry range) ?

Just thought I'd share this here.

MoRE is awesome! StingRay68, you are a king among men.
My M08 mod work is all open-source to anyone who wants to use it in any way, no restrictions or permissions necessary.

User avatar
StingRay68
Hall of Fame
Posts: 1073
Joined: Mon Jan 09, 2012 7:23 pm

Re: Model / TMdl Editing

Postby StingRay68 » Wed Mar 08, 2017 2:14 pm

v1.01

Updated main code to be able to read the player models. More work needs to be done on that to be viable for editing though...they're complicated.
[and yes, there are submodels in the player model that have 0 geometry points, that isn't a bug]

Added Extract all geometry points to csv, that may or may not work correctly with player models.


Return to “Development”

Who is online

Users browsing this forum: No registered users and 3 guests