Jump to content


Photo

MDLOps

mdlops tool md alpha

  • Please log in to reply
82 replies to this topic

#1 Fair Strides

Fair Strides

    Aurora Engine Operator

  • Administrators
  • 2,068 posts
  • LocationOregon, USA

Posted 14 January 2016 - 11:41 PM

Posted Image

 

File Name: MDLOps

File Submitter: Fair Strides

File Submitted: 14 Jan 2016

File Category: Modding Tools

 

-----------------------------------------------------------------
--<< mdlops v0.7 by Chuck Chargin Jr. (cchargin@comcast.net) >>--
-----------------------------------------------------------------

 

-------------------------
--<< Version history >>--
-------------------------

Spoiler

-----------------
--<< License >>--
-----------------
This script is released under the GPL, see the included
GPL.txt.

 

----------------
--<< Thanks >>--
----------------
MUCH MUCH MUCH thanks to Torlack for his NWN MDL info!
Without his info this script could not exist!

 

Thanks to my testers:
T7nowhere
Svosh
Seprithro
ChAiNz.2da

 

Thanks to all at Holowan Laboratories for your input
and support

 

file browser dialog added by tk102

 

AABB, animations, lights and emitters, and speed-up by JDNoa

 

Calculations of vertex and face normals by VP and Fair Strides

 

-----------------------
--<< What is this? >>--
-----------------------

 

This is a Perl script for converting
Star Wars Knights of the Old Republic (kotor 1 for short)
AND Star Wars Knights of the Old Republic, The Sith Lords (kotor 2 for short)
binary models to ascii and back again.

 

Binary models are converted to an ascii format compatible
with NeverWinter Nights.

 

It can also do some other operations on models,
like renaming textures and replacing meshes.

 

------------------
--<< Features >>--
------------------
-Automatic detection of binary model version
-Automatic detection of model type
-works with trimesh models
-works with dangly mesh models
-has limited support for skin mesh models (see below for more details)
-model properties supported:
-diffuse
-ambient
-shadow
-render
-alpha
-self illumination
-when reading in a binary model a text file is created
that lists all the textures the model uses.
-replacer function lets you replace 1 tri-mesh in a binary
model with another tri-mesh from an ascii model
-renamer function lets you rename textures in a binary
model

 

--------------------------
--<< Still needs work >>--
--------------------------
-exporting light sabers to binary is not fully supported
-exporting light sabers to ascii is partially supported
-exporting models with emitters will export the meshes,
not the emitters
-exporting models with animations to binary is not fully
supported (Only Position and Rotation animations will be functional)
-exporting placeables to binary is not supported
-exporting placeables to ascii will only export the mesh
and place holders for the emitters
-only one texture per mesh is supported

 

read the tutorials "KotOR_Tutorial.txt" and "Quick_tutorial.txt"
for an explanation of how to get your models into kotor

 

----------------------------
--<< Command line usage >>--
----------------------------

Spoiler

-------------------
--<< GUI usage >>--
-------------------
Spoiler

-------------------
--<< Skin mesh >>--
-------------------
Spoiler

-------------------------------------------
--<< Important texture map information >>--
-------------------------------------------
Spoiler

--------------------------------------
--<< Other software you will need >>--
--------------------------------------
NWMax (to get models in and out of Gmax or Max)
http://nwmax.dladventures.com/

 

GMax (to edit the darn models, it is free)
http://www.discreet.com/products/gmax/

 

Kotor Tool (to get the models out of kotor files)
http://kotortool.hom....net/index.html

 

----------------------------------
--<< Hosting and copying info >>--
----------------------------------
This script may only be hosted from sites that do not claim
ownership of files they host. In other words, any site that
claims "All files submitted to this site become property of
the site owner" can not host this script.

 

You are free to host this script from your website as long
as the distribution contains only the files listed below.

 

You are free to submit this script to any public download
site as long as the distribution contains only the files
listed below.

 

GPL.txt
icon.bmp
KotOR Tutorial.txt
mdlops.exe
mdlops.pl
MDLOpsM.pm
Quick_tutorial.txt
readme_mdlops0-7.txt
replacer_tutorial.txt

 

I also ask that if you do host or submit this script to a
site send me an e-mail to let me know. My e-mail address
is at the top of this file.

 

Click here to download this file


(By the way, if you ever want to ask about one of the quotes, feel free to send me a PM)

 

My personal, made-up quote: "To know is good, but to act is better."

"Words are just words, thoughts thoughts, but actions...actions are progress." - Fair Strides

"Intelligence and respect are all it takes to get along fine. Not a bad trade off, huh?" - EwigD from GameFaqs

"And regarding butchering the language, I have been to the internet. The language is well butchered regularly." - Malkior

 

"You can either live with the lies or die with the truth. Who would rather lie to live than die for telling the truth?" - Fair Strides


#2 VarsityPuppet

VarsityPuppet

    Jedi Master

  • Premium Member
  • 1,921 posts

Posted 14 January 2016 - 11:45 PM

I simply can't like this enough!!!

#3 1Leonard

1Leonard

    Jedi Knight

  • Members
  • PipPipPipPip
  • 203 posts

Posted 15 January 2016 - 03:22 PM

This is great guys, it's amazing that the kotor series gets new and updated tools more than a decade after release. Thank you both.

#4 redrob41

redrob41

    Jedi Padawan

  • RoR Staff
  • 108 posts
  • LocationEdmonton, AB

Posted 17 January 2016 - 12:07 AM

:w00t: I just used this last night on my mullet man head model, and it worked beautifully, so I've uploaded a new version of that mod. Thanks a ton.

#5 JCarter426

JCarter426

    Jedi Knight

  • M478_Staff
  • 178 posts

Posted 24 January 2016 - 05:18 PM

That's great work, guys. I can't understate the amount of mod ideas I've given up on because of smoothing issues, or the amount of time I spent looking through models in a hex editor to see if I could figure out the issue, to no avail. So this is a real boon to the community.

 

However... yes, of course there's a however...

 

However, I have a bug to report. I just edited a body model, and while the smoothing was retained very nicely, I noticed that the model's shadow is now gone, as you can see below.

 

 

There's the head's shadow, but the body's shadow is nowhere to be seen. Converting the model with version 0.6 does not result in this problem, but of course I lose the smoothing that way.

 

I've yet to determine if I can get around this using Taina's Replacer, but even so it would be nice to have it all in one package. (EDIT: Taina's Replacer did NOT work. Same problem.)

 

Since 0.6 didn't lose the shadow, I'm hoping it's just something missing from 0.7 that can be added back in.



#6 VarsityPuppet

VarsityPuppet

    Jedi Master

  • Premium Member
  • 1,921 posts

Posted 24 January 2016 - 07:22 PM

I'd have to consult with Fair Strides.

I don't think any of the shadow flags were touched, but it's possible that something was changed when he was cleaning up code? Hard to say.

#7 Fair Strides

Fair Strides

    Aurora Engine Operator

  • Administrators
  • 2,068 posts
  • LocationOregon, USA

Posted 24 January 2016 - 07:42 PM

JCarter426, could you perhaps post the first 20 or so lines of the skin Torso part of the ascii? Just the part up to the verts section. I'm thinking you might try changing the Shadow flag on the ascii if it's 0, but if that doesn't fix it, I could take a look at the source code again...


(By the way, if you ever want to ask about one of the quotes, feel free to send me a PM)

 

My personal, made-up quote: "To know is good, but to act is better."

"Words are just words, thoughts thoughts, but actions...actions are progress." - Fair Strides

"Intelligence and respect are all it takes to get along fine. Not a bad trade off, huh?" - EwigD from GameFaqs

"And regarding butchering the language, I have been to the internet. The language is well butchered regularly." - Malkior

 

"You can either live with the lies or die with the truth. Who would rather lie to live than die for telling the truth?" - Fair Strides


#8 JCarter426

JCarter426

    Jedi Knight

  • M478_Staff
  • 178 posts

Posted 24 January 2016 - 07:57 PM

Sure:

node skin Torso

  parent JC_HandA

  position 0.0 0.0 1.11

  orientation 1.0 0.0 0.0 0.0

  wirecolor 1.0 1.0 1.0

  alpha 1.0

  ambient 1.0 1.0 1.0

  diffuse 1.0 1.0 1.0

  specular 0.0 0.0 0.0

  shininess 0.0

  bitmap JC_HandA

  verts 564


#9 Fair Strides

Fair Strides

    Aurora Engine Operator

  • Administrators
  • 2,068 posts
  • LocationOregon, USA

Posted 24 January 2016 - 08:00 PM

Trying adding the "shadow 1" after the the alpha, and if that doesn't work, try "Shadow 1" instead.


(By the way, if you ever want to ask about one of the quotes, feel free to send me a PM)

 

My personal, made-up quote: "To know is good, but to act is better."

"Words are just words, thoughts thoughts, but actions...actions are progress." - Fair Strides

"Intelligence and respect are all it takes to get along fine. Not a bad trade off, huh?" - EwigD from GameFaqs

"And regarding butchering the language, I have been to the internet. The language is well butchered regularly." - Malkior

 

"You can either live with the lies or die with the truth. Who would rather lie to live than die for telling the truth?" - Fair Strides


#10 JCarter426

JCarter426

    Jedi Knight

  • M478_Staff
  • 178 posts

Posted 24 January 2016 - 08:06 PM

Nope, neither of those worked.

 

And I just tested again to be sure... converting with MDLOps 0.6 does produce shadows without editing the ASCII at all.



#11 VarsityPuppet

VarsityPuppet

    Jedi Master

  • Premium Member
  • 1,921 posts

Posted 24 January 2016 - 08:08 PM

Could you actually just post the entire ascii for the model?

#12 JCarter426

JCarter426

    Jedi Knight

  • M478_Staff
  • 178 posts

Posted 24 January 2016 - 08:10 PM

All right... it's still a WIP though, so don't judge. :P

 

https://www.dropbox....-ascii.mdl?dl=0



#13 Fair Strides

Fair Strides

    Aurora Engine Operator

  • Administrators
  • 2,068 posts
  • LocationOregon, USA

Posted 24 January 2016 - 08:30 PM

All right... it's still a WIP though, so don't judge. :P

 

https://www.dropbox....-ascii.mdl?dl=0

If you've done a retexture, could we see that and the original .mdl and .mdx files? (Can't compile it right now)


(By the way, if you ever want to ask about one of the quotes, feel free to send me a PM)

 

My personal, made-up quote: "To know is good, but to act is better."

"Words are just words, thoughts thoughts, but actions...actions are progress." - Fair Strides

"Intelligence and respect are all it takes to get along fine. Not a bad trade off, huh?" - EwigD from GameFaqs

"And regarding butchering the language, I have been to the internet. The language is well butchered regularly." - Malkior

 

"You can either live with the lies or die with the truth. Who would rather lie to live than die for telling the truth?" - Fair Strides


#14 JCarter426

JCarter426

    Jedi Knight

  • M478_Staff
  • 178 posts

Posted 24 January 2016 - 10:45 PM

Hadn't done the retexture yet... but the original model was PFBAM (in K2). The texture mapping is more or less the same, just the feet and the neck different.



#15 VarsityPuppet

VarsityPuppet

    Jedi Master

  • Premium Member
  • 1,921 posts

Posted 24 January 2016 - 10:54 PM

Checked the ascii. The shadow flag is set to 1 on all of the trimeshes it makes sense to render a shadow for.

See, the bones are used to render shadows instead of the skin meshes. Not sure why really, but it might have to do with being being easier to compute.

I wonder if it's possible that messing with the vertex weights on the bone meshes could impact the way shadows are rendered..? ¯\_(ツ)_/¯

#16 JCarter426

JCarter426

    Jedi Knight

  • M478_Staff
  • 178 posts

Posted 24 January 2016 - 11:08 PM

Yeah, I noticed the shadows were coming from the bones. I was wondering about that. Like I said, though, I was still getting shadows with 0.6. And I've done it before without ever losing shadows. So I don't think it's a result of my messing... or not exclusively my messing, at any rate.

 

I hadn't touched the bones when I tried running it through Taina's Replacer, so I could try that later. Might not have access to the files for the rest of the night though.



#17 Fair Strides

Fair Strides

    Aurora Engine Operator

  • Administrators
  • 2,068 posts
  • LocationOregon, USA

Posted 25 January 2016 - 12:48 AM

We've fixed the issue (either the face normals or plane distances) and uploaded a fixed version (now it's MDLOps 0.7 Alpha 2).


(By the way, if you ever want to ask about one of the quotes, feel free to send me a PM)

 

My personal, made-up quote: "To know is good, but to act is better."

"Words are just words, thoughts thoughts, but actions...actions are progress." - Fair Strides

"Intelligence and respect are all it takes to get along fine. Not a bad trade off, huh?" - EwigD from GameFaqs

"And regarding butchering the language, I have been to the internet. The language is well butchered regularly." - Malkior

 

"You can either live with the lies or die with the truth. Who would rather lie to live than die for telling the truth?" - Fair Strides


#18 DarthParametric

DarthParametric

    Dark Lord of the Sith

  • Members
  • PipPipPipPipPip
  • 720 posts
  • LocationOz

Posted 25 January 2016 - 03:06 AM

bones are used to render shadows instead of the skin meshes. Not sure why really, but it might have to do with being being easier to compute.


Yes, it's to reduce overhead for the Xbox1 the game was designed to run on. Still, even on modern PCs the game will sometimes crash if you try to force shadows on a mesh with too many polys.

#19 VarsityPuppet

VarsityPuppet

    Jedi Master

  • Premium Member
  • 1,921 posts

Posted 25 January 2016 - 04:23 AM

Yes, it's to reduce overhead for the Xbox1 the game was designed to run on. Still, even on modern PCs the game will sometimes crash if you try to force shadows on a mesh with too many polys.


Yikes! Yeah, that totally makes sense. I think I remember trying that on some skin meshes back in the day, with varying results.

Anyways, Fair Strides fixed it and it seems that face normals are part of what help determine shadows... ¯\_(ツ)_/¯

Also, too bad we never have figured out how to get the models to work on the xbox :/

#20 Fair Strides

Fair Strides

    Aurora Engine Operator

  • Administrators
  • 2,068 posts
  • LocationOregon, USA

Posted 25 January 2016 - 04:30 AM

Yikes! Yeah, that totally makes sense. I think I remember trying that on some skin meshes back in the day, with varying results.

Anyways, Fair Strides fixed it and it seems that face normals are part of what help determine shadows... ¯\_(ツ)_/¯

Also, too bad we never have figured out how to get the models to work on the xbox :/

 

Makes even more sense considering how blocky the "bones" are would help with giving the shadows shape while conserving polies.

 

Also, it was either the Face Normals (which I doubt) or the Plane Distance on the faces, which it looks like I might have zeroed out by accident.

 

As for the XBox models, did anyone ever do a filedump and check the .mdl files? I know that K1 and K2 both have different seemingly-random numbers taking up the first twelve bytes of a .mdl file, so it could be that these numbers differ between the PC and Xbox versions...


(By the way, if you ever want to ask about one of the quotes, feel free to send me a PM)

 

My personal, made-up quote: "To know is good, but to act is better."

"Words are just words, thoughts thoughts, but actions...actions are progress." - Fair Strides

"Intelligence and respect are all it takes to get along fine. Not a bad trade off, huh?" - EwigD from GameFaqs

"And regarding butchering the language, I have been to the internet. The language is well butchered regularly." - Malkior

 

"You can either live with the lies or die with the truth. Who would rather lie to live than die for telling the truth?" - Fair Strides






Also tagged with one or more of these keywords: mdlops, tool, md, alpha

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users