It is currently Thu May 17, 2012 12:14 am

All times are UTC



Welcome
Welcome to sadxforum

You are currently viewing our boards as a guest, which gives you limited access to view most discussions and access our other features. By joining our free community, you will have access to post topics, communicate privately with other members (PM), respond to polls, upload content, and access many other special features. Registration is fast, simple, and absolutely free, so please, join our community today!

The site administrators are GohanSN and Fiamonder10.





 Page 1 of 2 [ 16 posts ]  Go to page 1, 2  Next
Author Message
 Post subject: Dude's tools 1.4 (Model exporting tutorial)
Posted: Thu May 27, 2010 5:03 pm 
Site Admin
Site Admin
User avatar

Joined: Sat Feb 06, 2010 12:21 am
Posts: 234
Directly copied off Dude's website, or in this case forum, X-hax. So all credit goes to Dude.

----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Well after a long time working, I'm ready to release my latest set of hacking tools. This release has all of the old stuff, plus 2 big things that I'm sure people will love.

New features:
- An almost perfect maxscript model exporter that exports split model data. The exported data can be re-compiled by hand with notepad and a hex editor.
- A new program called sadxmdl_porter.exe. This program takes a model chunk (everything from material data to the end of the attach data) and a base address in sonic.exe where you want to insert it, and fixes all of the pointers so you can paste the file into sonic.exe

Image

download


How to use the exporter
If you are exporting a single mesh model:
1. open 3dsmax, load your scene with the model in question. Select the model piece you want to export and make sure the pivot point is centered to the model. In the toolbar on the right hand side of the screen, go to the "utilities" tab and click the MaxScript button. Then press "Run script" and locate the exporter script. The rollout should show up. Check all of the boxes, pick the export directory and press "Export Data"

2. Now that you have your split model data you can start putting them together. Open Hex workshop and Notepad. You'll need to grab a material struct, either premade from sonic.exe/chrmodels or construct it yourself. Paste the material struct into a new file in Hex Workshop. Save the file as "Model.nj"

3. Go to the end of "Model.nj" and write down the address in notepad as "Mesh 1; poly". Open out.ply and paste it at the end of the material data and write the new file end address as "Mesh1; uv". Open out.uv and paste its contents into model.nj.

4. Write down the new end address in your log file as "meshes". Go back to model.nj in hex workshop and insert 0x1c bytes. The first byte is the material ID, which will need to be 00, but increments with each mesh we add. The second byte will need to be 0x00 also, this means the model is using trilists. The next 2 bytes are a short int for how many polygons are in the mesh. Get this number from 3dsmax by selecing the model, going into triangle mode and doing "Select All". Max will report the number of tris in the sidebar on the right. The next 4 bytes are the pointer to the poly data, which we wrote down in step 3. Skip ahead 0xc bytes. The next 4 bytes will be a pointer to the UV data, which we also wrote down in step 3. The next 4 bytes are padding and then we should be at the end of the file.

5. Go to the end of the file, write down the address as "vertex data". Open out.vt and paste the data at the end of model.nj

6. Go to the end of the file, write down the address as "vertex normals". Open out.vn and paste the data at the end of model.nj You've now added all of the model data. Only one last thing to process.

7. Insert 0x2c bytes. This will be our ATTACH data. The first 4 bytes are the pointer to the vertex data (step 5). The second 4 are pointer to the normal data (step 6). The next 4 are the number of verticies in the model (retrieved the same was as the poly total was). The next 4 is the pointer to the mesh data (step 4). The next 4 is the pointer to the material data (should be 0 in this case). The next 2 bytes are the mesh count, then the next 2 are the material count (both 1 in this tutorial). The next 0xc bytes are the relative coordinates for the center of the model in floats (should also be 0 because we centered the pivot in step 1), and the next float is the radius of the model, and the last 4 bytes are padding. Save Model.nj and make a backup of it.

8. Run sadxmdl_porter.exe. Tell it the name of the nj file you made earlier, then give it the address you plan on putting the model in sonic.exe. The program is verbose sometimes, this is normal. It will also generate an out.log. This is useful for debugging but you shouldn't need it unless something went wrong.

9. congrats, model.nj is now ready to be put in sonic.exe. You'll still need to give it a seg, and a COL if you're using it for levels but the model data is done.

I'll make the tutorial for doing multiple mesh models later.
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
NOTE: He's talking about exporting models in the .exe, but you can also use it for your CHRMODELS.DLL.

Again, credits goes to Dude for making this amazing script to have the ability to export custom models in SADX.


Offline
 Profile  
 
 Post subject: Re: Dude's tools 1.4 (Model exporting tutorial)
Posted: Fri May 28, 2010 1:00 am 
Member
Member
User avatar

Joined: Wed Apr 28, 2010 3:25 am
Posts: 345
Location: Western United States
Any idea how I do this with Misfit Model 3D? I don't use Autodesk 3DS Max.



_________________
Image
Image
Offline
 Profile  
 
 Post subject: Re: Dude's tools 1.4 (Model exporting tutorial)
Posted: Fri May 28, 2010 3:25 pm 
Site Admin
Site Admin
User avatar

Joined: Sat Feb 06, 2010 12:21 am
Posts: 234
Rias wrote:
Any idea how I do this with Misfit Model 3D? I don't use Autodesk 3DS Max.


You can't, it's only for 3DS Max.


Offline
 Profile  
 
 Post subject: Re: Dude's tools 1.4 (Model exporting tutorial)
Posted: Fri May 28, 2010 6:23 pm 
Member
Member
User avatar

Joined: Wed Apr 28, 2010 3:25 am
Posts: 345
Location: Western United States
Dang it. That sucks.



_________________
Image
Image
Offline
 Profile  
 
 Post subject: Re: Dude's tools 1.4 (Model exporting tutorial)
Posted: Fri May 28, 2010 11:44 pm 
Member
Member
User avatar

Joined: Sun Feb 07, 2010 10:09 pm
Posts: 184
hang on, does this work to make 100% custom models for chrmodels.dll?



_________________
success is a journey not a destination
Image
Offline
 Profile  
 
 Post subject: Re: Dude's tools 1.4 (Model exporting tutorial)
Posted: Sat May 29, 2010 8:28 pm 
User avatar

Joined: Tue Feb 02, 2010 12:34 am
Posts: 327
Location: Fincastle, Virginia
Yes. It's made for level models and character models.



_________________
My youtube account: http://www.youtube.com/user/darkspinessonic35
My little update blog: http://itseasyactually.blogspot.com

Keep it clean, or I will.
Offline
 Profile  
 
 Post subject: Re: Dude's tools 1.4 (Model exporting tutorial)
Posted: Sat May 29, 2010 9:25 pm 
Site Admin
Site Admin
User avatar

Joined: Sat Feb 06, 2010 12:21 am
Posts: 234
chaosonic1 wrote:
hang on, does this work to make 100% custom models for chrmodels.dll?


Yes it does. You'll have to expand the DLL if you're about to import high poly models though.


Offline
 Profile  
 
 Post subject: Re: Dude's tools 1.4 (Model exporting tutorial)
Posted: Sun May 30, 2010 11:54 am 
Member
Member
User avatar

Joined: Sun Feb 07, 2010 10:09 pm
Posts: 184
uhh.... I don't know how to da any of that, so I'll just leave it to thhe pros



_________________
success is a journey not a destination
Image
Offline
 Profile  
 
 Post subject: Re: Dude's tools 1.4 (Model exporting tutorial)
Posted: Sun May 30, 2010 3:55 pm 
User avatar

Joined: Tue Feb 02, 2010 12:34 am
Posts: 327
Location: Fincastle, Virginia
A guide will be written someday, hopefully today. I can't guarantee anything though...



_________________
My youtube account: http://www.youtube.com/user/darkspinessonic35
My little update blog: http://itseasyactually.blogspot.com

Keep it clean, or I will.
Offline
 Profile  
 
 Post subject: Re: Dude's tools 1.4 (Model exporting tutorial)
Posted: Mon May 31, 2010 6:13 pm 
Member
Member
User avatar

Joined: Sat May 15, 2010 6:27 pm
Posts: 102
Nice useful tools.


Offline
 Profile  
 
Display posts from previous:  Sort by  
 Page 1 of 2 [ 16 posts ]  Go to page 1, 2  Next

All times are UTC


Who is online

Users browsing this forum: No registered users and 0 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  

cron

suspicion-preferred