Jump to content

Home

Model viewer for KotOR?


Adinos

Recommended Posts

Well, as it seems there is no stand-alone model viewer, I just wrote one myself.

 

Here are a few sample images - just picked some random models from KotOR and KotOR2.

 

kotor_samples.jpg

 

The viewer is not 100% ready - there is a handful of models that do not look right, and there are some things I would like to add, but I need information from BioWare for that.

 

I really wish I had a PC Now :( Also I couldn't help but notice the two droids in the first row, are they by any chance the concept droids for the Peragus Mining Facility or M4-78?

Link to comment
Share on other sites

  • Replies 58
  • Created
  • Last Reply
Let me know about any issues you find.

 

Well, it seems 90% my placeables and items I made and then compiled to the Binary code (mdl&mdx) with MDLops turn out black.

 

Just a few of them turn out ok.

 

It might be MDLops though, no idea really.

Link to comment
Share on other sites

  • 2 weeks later...

It seems that a few of the people who requested the beta did not receive it - in some cases because they were blocked from receiving zipped executable files.

 

Anyhow, I got some useful feedback, and am working on a version with three updated features.

 

1) The mouse scroll button now allows you to zoom.

 

2) The "black" model issue was, as suspected, caused by inverted normals (where the normal points "in" instead of "out". It seems the game does not care about those, but my DirectX code does. This problem has now been solved.

 

3) I am adding a "Save As..." feature to allow saving of retextured models.

 

I am also improving the documentation, so I should have the full (non-beta) version ready soon. but I am leaving on a small business trip tomorrow, so I will not be able to finish this until after I return next week.

Link to comment
Share on other sites

I have a question: Is one able to show the animations of the models in the viewer also? In other words the animation for speech, for walking, and such?

 

Edit: Also! Is one able to add weapons to the models? Lightsabers and such?

Link to comment
Share on other sites

  • 2 weeks later...
I was wondering if anyone has ever written a model viewer for KotOR, or if not, whether information on the model file format is available, so I could more easily write it myself.

 

I'd rather not spend my time reverse-engineering the format if someone else has done it already.

_________________

Hi Adinos,

 

as it seems that you got the information you were looking for would you be willing to share your knowledge about the mdl file format with us?:)

 

greets,

shak-otay

 

edit: what I found is this but the pages are not easy to survey. Is this is the Kotor binary MDL format?

(The MDL/MDX seeem not to be the same as this!)

Link to comment
Share on other sites

I have now uploaded a new version of the model viewer to NWVault (as I mentioned, it supports NWN2 as well as KotOR and KotOR2) http://nwvault.ign.com/View.php?view=NWN2Tools.Detail&id=6422&id=79

 

The issues found during the beta test should have been fixed (thanks for the help and suggestions, guys) and I added the "zoom" feature, using the mouse wheel, as suggested.

Link to comment
Share on other sites

Interesting. Just tried it out with some weapon models of mine that have been compiled as game meshes. The blasters displayed fine, but I got an error when trying a lightsaber. It asked for the blade texture, so I browsed to a different directory than the mesh for it and got the following:

 

Show spoiler
(hidden content - requires Javascript to show)
See the end of this message for details on invoking 
just-in-time (JIT) debugging instead of this dialog box.

************** Exception Text **************
System.ArgumentOutOfRangeException: Index was out of range. Must be non-negative and less than the size of the collection.
Parameter name: startIndex
  at System.ThrowHelper.ThrowArgumentOutOfRangeException(ExceptionArgument argument, ExceptionResource resource)
  at System.BitConverter.ToInt32(Byte[] value, Int32 startIndex)
  at Model_Viewer.Model3D.readXYZ(Byte[] Data, Int32 pos, String s, Single& x, Single& y, Single& z)
  at Model_Viewer.ModelKotOR.KOprocess_node_and_child_nodes(UInt32 nodestart, Byte[] Data, Byte[] MDX, Boolean process, String modeldir, UInt16 parent, Boolean KotOR2)
  at Model_Viewer.ModelKotOR.KOprocess_node_and_child_nodes(UInt32 nodestart, Byte[] Data, Byte[] MDX, Boolean process, String modeldir, UInt16 parent, Boolean KotOR2)
  at Model_Viewer.ModelKotOR.KOprocess_node_and_child_nodes(UInt32 nodestart, Byte[] Data, Byte[] MDX, Boolean process, String modeldir, UInt16 parent, Boolean KotOR2)
  at Model_Viewer.ModelKotOR.KOprocess_node_and_child_nodes(UInt32 nodestart, Byte[] Data, Byte[] MDX, Boolean process, String modeldir, UInt16 parent, Boolean KotOR2)
  at Model_Viewer.ModelKotOR..ctor(Byte[] Data, Byte[] MDX, String modeldir, String tex1, String tex2, Boolean KotOR2, String filter)
  at Model_Viewer.frmMain.openToolStripMenuItem_Click(Object sender, EventArgs e)
  at System.Windows.Forms.ToolStripItem.RaiseEvent(Object key, EventArgs e)
  at System.Windows.Forms.ToolStripMenuItem.OnClick(EventArgs e)
  at System.Windows.Forms.ToolStripItem.HandleClick(EventArgs e)
  at System.Windows.Forms.ToolStripItem.HandleMouseUp(MouseEventArgs e)
  at System.Windows.Forms.ToolStripItem.FireEventInteractive(EventArgs e, ToolStripItemEventType met)
  at System.Windows.Forms.ToolStripItem.FireEvent(EventArgs e, ToolStripItemEventType met)
  at System.Windows.Forms.ToolStrip.OnMouseUp(MouseEventArgs mea)
  at System.Windows.Forms.ToolStripDropDown.OnMouseUp(MouseEventArgs mea)
  at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks)
  at System.Windows.Forms.Control.WndProc(Message& m)
  at System.Windows.Forms.ScrollableControl.WndProc(Message& m)
  at System.Windows.Forms.ToolStrip.WndProc(Message& m)
  at System.Windows.Forms.ToolStripDropDown.WndProc(Message& m)
  at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
  at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
  at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)


************** Loaded Assemblies **************
mscorlib
   Assembly Version: 2.0.0.0
   Win32 Version: 2.0.50727.3082 (QFE.050727-3000)
   CodeBase: file:///C:/WINDOWS/Microsoft.NET/Framework/v2.0.50727/mscorlib.dll
----------------------------------------
Model Viewer
   Assembly Version: 1.0.0.0
   Win32 Version: 1.0.0.0
   CodeBase: file:///E:/Star%20Wars%20Knights%20of%20the%20Old%20Republic/-=TOOLS=-/Model%20Viewer/Model%20Viewer.exe
----------------------------------------
System.Windows.Forms
   Assembly Version: 2.0.0.0
   Win32 Version: 2.0.50727.3053 (netfxsp.050727-3000)
   CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/System.Windows.Forms/2.0.0.0__b77a5c561934e089/System.Windows.Forms.dll
----------------------------------------
System
   Assembly Version: 2.0.0.0
   Win32 Version: 2.0.50727.3053 (netfxsp.050727-3000)
   CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/System/2.0.0.0__b77a5c561934e089/System.dll
----------------------------------------
System.Drawing
   Assembly Version: 2.0.0.0
   Win32 Version: 2.0.50727.3053 (netfxsp.050727-3000)
   CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/System.Drawing/2.0.0.0__b03f5f7f11d50a3a/System.Drawing.dll
----------------------------------------
Microsoft.DirectX.Direct3D
   Assembly Version: 1.0.2902.0
   Win32 Version: 9.05.132.0000
   CodeBase: file:///C:/WINDOWS/assembly/GAC/Microsoft.DirectX.Direct3D/1.0.2902.0__31bf3856ad364e35/Microsoft.DirectX.Direct3D.dll
----------------------------------------
Microsoft.DirectX
   Assembly Version: 1.0.2902.0
   Win32 Version: 5.04.00.2904
   CodeBase: file:///C:/WINDOWS/assembly/GAC/Microsoft.DirectX/1.0.2902.0__31bf3856ad364e35/Microsoft.DirectX.dll
----------------------------------------
Microsoft.DirectX.Direct3DX
   Assembly Version: 1.0.2911.0
   Win32 Version: 9.12.589.0000
   CodeBase: file:///C:/WINDOWS/assembly/GAC/Microsoft.DirectX.Direct3DX/1.0.2911.0__31bf3856ad364e35/Microsoft.DirectX.Direct3DX.dll
----------------------------------------
System.Configuration
   Assembly Version: 2.0.0.0
   Win32 Version: 2.0.50727.3053 (netfxsp.050727-3000)
   CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/System.Configuration/2.0.0.0__b03f5f7f11d50a3a/System.Configuration.dll
----------------------------------------
System.Xml
   Assembly Version: 2.0.0.0
   Win32 Version: 2.0.50727.3082 (QFE.050727-3000)
   CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/System.Xml/2.0.0.0__b77a5c561934e089/System.Xml.dll
----------------------------------------

************** JIT Debugging **************
To enable just-in-time (JIT) debugging, the .config file for this
application or computer (machine.config) must have the
jitDebugging value set in the system.windows.forms section.
The application must also be compiled with debugging
enabled.

For example:

<configuration>
   <system.windows.forms jitDebugging="true" />
</configuration>

When JIT debugging is enabled, any unhandled exception
will be sent to the JIT debugger registered on the computer
rather than be handled by this dialog box.

I gather that the error is related to the mesh itself rather than the act of loading an external texture. It wouldn't surprise me, as MDLOps seems to do some screwy things to sabers.

 

As far as suggestions go, manual control of rotation/manipulation would be the most logical thing to request in a model viewer.

Link to comment
Share on other sites

I have a Problem with this, it give´s an error by me before he unpacked.

 

Hmm, perhaps something went wrong while it downloaded?

 

The program works great on my PC, though what DP suggested would be handy :p

 

To be able to "fly" around with the camera, perhaps assign a key to move forward and then use the mouse to direct the heading... euh course.

Link to comment
Share on other sites

Nice program!:thmbup1:

 

The ASCII dump feature even nicer.:)

 

Two questions do I have: when dumping the C_Goblin_CL_BODY01.MDB

the ASCII dump ends like this:

1209: 974 975 969
Unable to handle block..

 

Can this be ignored when using your ASCII dump for ex-/importing?

 

2nd q.: Is there any 3D program that can import this ASCII format directly?

 

It seems to be very similar to the Wavefront obj format; exp.:

 

Show spoiler
(hidden content - requires Javascript to show)
# Max2Obj Version 4.0 Mar 10th, 2001

#

# object wozek01 to come ...

#

v 32.118301 15.749300 28.802399

v 27.051800 8.244300 28.774601

...

v -28.960499 30.216301 37.189499

# 1929 vertices

 

vt 0.545261 -0.991171 0.000000

...

vt 0.702664 -0.403379 0.000000

# 1929 texture vertices

 

vn 0.828917 -0.559355 0.004320

...

vn 0.634597 0.009950 0.772779

# 1929 vertex normals

 

g wozek01

s 1

f 1/1/1 2/2/2 3/3/3

...

f 1919/1919/1919 1918/1918/1918 1929/1929/1929

# 1652 faces

 

g

# object shadowbone01 to come ...

#

v -54.162701 56.407200 -28.854797

...

v -74.113899 31.602299 35.161900

# 602 vertices

 

vt 0.626660 -0.491801 0.000000

...

vt 0.019469 -0.408086 0.000000

# 602 texture vertices

 

vn -0.015553 -0.007923 0.999848

...

vn -0.658603 -0.337494 0.672563

# 602 vertex normals

 

g shadowbone01

s 1

f 1930/1930/1930 1931/1931/1931 1932/1932/1932

...

f 2171/2171/2171 2174/2174/2174 2172/2172/2172

# 1152 faces

 

g

Link to comment
Share on other sites

  • 9 months later...

The aforementioned model viewer from Adinos not work for me. I do not know why, you have a tip for me?

 

Here is the picture of the errors. The viewer can not be opened even though the thing is installed.

 

http://img710.imageshack.us/i/unbenanntwgp.jpg/

 

Translate in English:

 

Model Viewer has encountered a problem and must be ended.

If you have not saved their work on might be lost.

 

 

This error occurs immediately after I want to start it. Then, I wonder where this is the problem. Odd

Link to comment
Share on other sites

  • 1 month later...

I´ve installed 3ds max, but it doesn`t solve my problem.

Is there anyone else with a 64-version of Windows, who tried to use this program? Is it working?

I tried to run the program on the Windows XP Mode (Virtual PC...), but the same error has occured. Can it be true that the model viewer.exe only work with a geforce graphiccard, or something like that?

(I apologize for my bad english.)

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.


×
×
  • Create New...