RE-ENGINE MESH TOOL (Maxscript) v1.39 updated
Oct 11, 2019 3:02:38 GMT 10
ΛLISTΞR, EvilLord, and 14 more like this
Post by Shigu on Oct 11, 2019 3:02:38 GMT 10
RE Engine MESH Tool v1.39
[Download]
-Support for RE8 Resident Evil 8 meshes
-Some small bugfixes
older versions:
UPDATED 5/4 v1.31 - Download Here
This is a re-releasing of Maliwei777's RE engine MESH script, featuring code improvement from Mariokart64n, myself, alphaz , Crazy Potato and Che. It's use has been very streamlined and is now pretty straightforward; a tutorial is included in the interface. Now with alphaZomega's, Che's and Crazy Potato's improvements on the script, it has been taken pretty much to the finish line with its chief issue of damaged normals/tangents now out of the way! See more on their progress:
Also I have a QOL update here for RE Engine MESH tool:
RE Engine MESH Tool v1.37
older versions:
RE Engine MESH Tool v1.35a
[Download Here]
CHANGES:
Object Properties
When you import a model, it will have special user-properties added to it by the script that define what material it uses and what submesh it is. You can see these properties by right clicking on the submesh and going to its Object Properties, like this:
The submesh property is not currently used, but changing the number in the MDF_Material property will actually change what material that submesh uses. It corresponds to the same list of numbers used by the model's MDF file for its materials used on the model. UPDATE: as of v1.35a, MDF_Material will be ignored during export unless the third property, Write_MDF_Material, is set to true.
New Naming Scheme
To explain the purpose of the New Naming Scheme, I think it's best to show you a model that requires it. Here is a mesh of Jill that has her first 12 submeshes all combined onto Mainmesh_1. Normally, all of mainmesh_2 and mainmesh_3 (8 submeshes) are made invisible from the start of RE3 until Jill picks up the pistol from the dead cop. This hacked mesh combines the structures of Mainmesh_2 and Mainmesh_3 all together onto Mainmesh_1, which will never go invisible:
...but some of those submeshes use the same material, so with the old naming scheme Maliwei made for the script, there would be multiple LODGroup_1_Mainmesh_1_Submesh_2's, for example, and they would be skipped or exported to the wrong places in the file. That's why you need to use the new naming scheme. Checking the "Use New Naming Scheme" checkbox will organize the imported submeshes by their order in the file, rather than by what material they use. So Mainmesh_1 will now be populated by Submesh_1,2,3,4 etc instead of having an odd ordering like Submesh_2,3,5,6, and every other mainmesh will have its submeshes ordered numerically as well.
You can download the combined-mainmesh model here. It is a version of Jill's default costume meant for the full-game, with a head bone added. It and any mods made over it must be imported and exported using the new naming scheme.
-Import skeleton now has a "T-pose" checkbox. Check the box and import a skeleton to import it T-posed. Change the "threshold" to adjust how much of the mesh is T-posed vs how much is A-posed. Different models require different thresholds to successfully T-pose without any twisted joints. Set it to -1 to import the model 100% T-posed. Set it to 0 to import the model by its local bone transforms instead of the normal global transforms.
-You can now add un-numbered bones to the list of bones in the Skin modifier, if there is space in the hex of the MESH file to add them. Select the un-numbered bone in the skeleton, click "Add Bone" and choose the MESH file you want to add it to. When you import that MESH, the bone will be the last bone in the list
Download Here
Jill T-posed skeleton imported:
Some joints may need to be manually rotated or un-rotated by 90 degrees. From T-pose, you can save the skeleton as global positions to another mesh file for easy loading. With this, you can easily rig other T-posed characters from outside Resident Evil to RE characters without having to put them in A-pose. Just skin wrap them to the T-posed RE character, and use import skeleton to put them back to the A-pose positions and get them ready for the game.
For add-bone, here you can see I added the l_weapon bone to the bones list. I selected it in the skeleton, then clicked "Add Bone" and chose my mesh file to add it to. Then I imported that mesh file with the script, and got this:
May 25
Download here
Carlos bone positions loaded onto Jill's skeleton:
Ada's bone positions loaded onto Claire's face:
Using "Change Skeleton" to change the bone positions of Claire's face to match with Ada's bones made Claire become fully compatible with Ada's facial animations:
Thank you Shigu for uploading my modified version of your script to this thread. I know you said you don't have as much time for modding these days, and I appreciate your collaboration.
Changes with version v1.31 (download)
-The script can now export static meshes with no bones. All meshes can be imported and exported using the script.
-Added "handedness" checkbox. This option allows you to reverse the direction of light on your model, akin to inverting the green channel on the normal map. Most models for RE Engine use flipped handedness, so it is checked by default. If the handedness does not match your normal map, your model will have seams and inverted shadows.
Changes with version v1.3 (download)
-Fixed tangent space calculation. The script is now able to import and export Capcom models (and any other models) perfectly:
Changes with version v1.2
-Added Normals import
-Added weighted normals function
-Added re-import function
-Improved auto-smooth normals
-Changed spotty normals fix (this was a broken fix)
Changes with version v1.1 (download)
-Spotty normals errors have been fixed
Changes with version v1.01 by Crazy Potato (download)[/b]
- Fixed a bug with Change Bone Position that made many users unable to use the function
Changes with version v1.00 by Crazy Potato (download)
- Added "Change Bone Position" function.
Use this function to modify the position of a bone (and all its children bones in its chain) in an existing MESH file. Exporting over a MESH file with modified bone positions will give your exported MESH those modified positions too.
Changes with version v0.5e (download)
- Updated the Import function to allow import of models with no bones. The script should be able to import any regular MESH from RE2 or RE3 now
Changes with version v0.5d (download)
- Changed the script back to not use the XNA framework anymore, as Che on the REmodding Discord figured out how to make the rigging accurate without the use of XNA (thanks Che!)
- Added a behavior to automatically copy the UVs from UV channel 1 if UV channel 2 does not exist
- Enabled the export of submeshes without Edit Normals modifiers
- Corrected a logic error in the Spotty Normals Fix that was causing it to affect Submesh_1, which is immune to the normals errors and doesn't need the fix.
Changes with version v0.5c_XNA (download)
Changed the script back to use Microsoft XNA Framework in order to fix the skinning errors on export.
-Make sure you edit the script in Notepad to direct it to the location of your Microsoft.Xna.Framework.dll file (included in the zip). XNA is only required for one small function used in one part of the script, but it is critically important for getting perfectly-accurate rigging.
Corrected the "Auto-Smooth Normals" function so that it works as intended.
-The function does nothing when unchecked, and when checked it checks for a normals modifier on all submeshes. Whenever it doesn't find one, it then adds it and then averages normals to a 0.001 threshold.
Removed a behavior originally added in with the DMC5 script edits that made UV channel 1 automatically be cloned to UV channel 2.
-UV channel 2 is used for wetmasks in RE2, and some models (every Capcom model, for example) have different UVs on channel 2 than they do on channel 1. If you don't need different UVs on channel 2 because you are using a modded model with a blank wetmask, it is convenient to have it automatically copy them over from channel 1 - but you should be allowed the option of using a separate UV channel 2 should you need it. Per-face mode still retains this behavior for now.
Added a "Spotty Normals" fix that significantly reduces the appearance of normals errors on export.
-Fixing this pervasive issue was the primary reason I began looking into editing the script. Here is a comparison of the same model exported with and without the spotty normals fix:
While the spotty normals are not entirely gone, they are greatly dulled.[/quote]
Old Links and Changes:
v0.5b
v0.5c
v0.5d
Alt v0.2 by alphaZ
v0.5e
[Download]
-Support for RE8 Resident Evil 8 meshes
-Some small bugfixes
older versions:
UPDATED 5/4 v1.31 - Download Here
This is a re-releasing of Maliwei777's RE engine MESH script, featuring code improvement from Mariokart64n, myself, alphaz , Crazy Potato and Che. It's use has been very streamlined and is now pretty straightforward; a tutorial is included in the interface. Now with alphaZomega's, Che's and Crazy Potato's improvements on the script, it has been taken pretty much to the finish line with its chief issue of damaged normals/tangents now out of the way! See more on their progress:
Also I have a QOL update here for RE Engine MESH tool:
RE Engine MESH Tool v1.37
- Meshes are now imported with real bones instead of dummies
- New "Add / Remove Bone Numbers" button replaces "Generate Weighted Normals" button (which can still be found on my tool)
- Fixed an error that sometimes occurred where skin weights were undefined
- Made the importer skip importing Skin or Normals on placeholder meshes that have only 3 verts
- Removed a bunch of the outdated credits and guide stuff from the rollout
- "Use New Naming Scheme" is now checked by default
older versions:
RE Engine MESH Tool v1.35a
[Download Here]
CHANGES:
- Crash fixes for stages / static meshes and RE2 meshes
- Weapons meshes are exported correctly without ever being invisible
- Face UVs are no longer imported because they were causing UV corruption in the RE7 script, and because vertex UVs are enough anyway
- Much improved T-pose skeleton import, with less twisted bones
- "Add Bone" can now add one more bone than it could before
- Submeshes now have custom Object Properties when you right click on them, one of which is MDF_Material = . Changing this user property changes what material the submesh uses from its MDF file
- "Use New Naming Scheme" checkbox lets you import and export with submeshes numbered by order rather than by material, so every mainmesh will have submesh_1,2,3,4 etc instead of things like 2,3,6,7
Object Properties
When you import a model, it will have special user-properties added to it by the script that define what material it uses and what submesh it is. You can see these properties by right clicking on the submesh and going to its Object Properties, like this:
The submesh property is not currently used, but changing the number in the MDF_Material property will actually change what material that submesh uses. It corresponds to the same list of numbers used by the model's MDF file for its materials used on the model. UPDATE: as of v1.35a, MDF_Material will be ignored during export unless the third property, Write_MDF_Material, is set to true.
New Naming Scheme
To explain the purpose of the New Naming Scheme, I think it's best to show you a model that requires it. Here is a mesh of Jill that has her first 12 submeshes all combined onto Mainmesh_1. Normally, all of mainmesh_2 and mainmesh_3 (8 submeshes) are made invisible from the start of RE3 until Jill picks up the pistol from the dead cop. This hacked mesh combines the structures of Mainmesh_2 and Mainmesh_3 all together onto Mainmesh_1, which will never go invisible:
...but some of those submeshes use the same material, so with the old naming scheme Maliwei made for the script, there would be multiple LODGroup_1_Mainmesh_1_Submesh_2's, for example, and they would be skipped or exported to the wrong places in the file. That's why you need to use the new naming scheme. Checking the "Use New Naming Scheme" checkbox will organize the imported submeshes by their order in the file, rather than by what material they use. So Mainmesh_1 will now be populated by Submesh_1,2,3,4 etc instead of having an odd ordering like Submesh_2,3,5,6, and every other mainmesh will have its submeshes ordered numerically as well.
You can download the combined-mainmesh model here. It is a version of Jill's default costume meant for the full-game, with a head bone added. It and any mods made over it must be imported and exported using the new naming scheme.
^fully equipped Jill at the start of RE3
RE Engine MESH TOOL v1.34
-Import skeleton now has a "T-pose" checkbox. Check the box and import a skeleton to import it T-posed. Change the "threshold" to adjust how much of the mesh is T-posed vs how much is A-posed. Different models require different thresholds to successfully T-pose without any twisted joints. Set it to -1 to import the model 100% T-posed. Set it to 0 to import the model by its local bone transforms instead of the normal global transforms.
-You can now add un-numbered bones to the list of bones in the Skin modifier, if there is space in the hex of the MESH file to add them. Select the un-numbered bone in the skeleton, click "Add Bone" and choose the MESH file you want to add it to. When you import that MESH, the bone will be the last bone in the list
Download Here
Jill T-posed skeleton imported:
Some joints may need to be manually rotated or un-rotated by 90 degrees. From T-pose, you can save the skeleton as global positions to another mesh file for easy loading. With this, you can easily rig other T-posed characters from outside Resident Evil to RE characters without having to put them in A-pose. Just skin wrap them to the T-posed RE character, and use import skeleton to put them back to the A-pose positions and get them ready for the game.
For add-bone, here you can see I added the l_weapon bone to the bones list. I selected it in the skeleton, then clicked "Add Bone" and chose my mesh file to add it to. Then I imported that mesh file with the script, and got this:
RE Engine MESH tool v1.33
May 25
- Change bone position is now called "Change Skeleton". Now works better, and works on all selected bones and their children, including the root bone
- "Import Skeleton" function added to the import menu. Allows you to import the positions of all bones in a mesh file that share names with your selected bones and their children
- "unchangeBoneMapName" is now "Un-Numbered Bones"
- Re-import submesh function now more reliable
- Submesh Number (order in the MESH file) and the MDF Material number used by the submesh are now saved in the Object Properties of every imported submesh
Download here
Carlos bone positions loaded onto Jill's skeleton:
Ada's bone positions loaded onto Claire's face:
Using "Change Skeleton" to change the bone positions of Claire's face to match with Ada's bones made Claire become fully compatible with Ada's facial animations:
Thank you Shigu for uploading my modified version of your script to this thread. I know you said you don't have as much time for modding these days, and I appreciate your collaboration.
Changes with version v1.31 (download)
-The script can now export static meshes with no bones. All meshes can be imported and exported using the script.
-Added "handedness" checkbox. This option allows you to reverse the direction of light on your model, akin to inverting the green channel on the normal map. Most models for RE Engine use flipped handedness, so it is checked by default. If the handedness does not match your normal map, your model will have seams and inverted shadows.
Changes with version v1.3 (download)
-Fixed tangent space calculation. The script is now able to import and export Capcom models (and any other models) perfectly:
Changes with version v1.2
-Added Normals import
-Added weighted normals function
-Added re-import function
-Improved auto-smooth normals
-Changed spotty normals fix (this was a broken fix)
Changes with version v1.1 (download)
-Spotty normals errors have been fixed
Changes with version v1.01 by Crazy Potato (download)
- Fixed a bug with Change Bone Position that made many users unable to use the function
Changes with version v1.00 by Crazy Potato (download)
- Added "Change Bone Position" function.
Use this function to modify the position of a bone (and all its children bones in its chain) in an existing MESH file. Exporting over a MESH file with modified bone positions will give your exported MESH those modified positions too.
Changes with version v0.5e (download)
- Updated the Import function to allow import of models with no bones. The script should be able to import any regular MESH from RE2 or RE3 now
Changes with version v0.5d (download)
- Changed the script back to not use the XNA framework anymore, as Che on the REmodding Discord figured out how to make the rigging accurate without the use of XNA (thanks Che!)
- Added a behavior to automatically copy the UVs from UV channel 1 if UV channel 2 does not exist
- Enabled the export of submeshes without Edit Normals modifiers
- Corrected a logic error in the Spotty Normals Fix that was causing it to affect Submesh_1, which is immune to the normals errors and doesn't need the fix.
Changes with version v0.5c_XNA (download)
Changed the script back to use Microsoft XNA Framework in order to fix the skinning errors on export.
-Make sure you edit the script in Notepad to direct it to the location of your Microsoft.Xna.Framework.dll file (included in the zip). XNA is only required for one small function used in one part of the script, but it is critically important for getting perfectly-accurate rigging.
Corrected the "Auto-Smooth Normals" function so that it works as intended.
-The function does nothing when unchecked, and when checked it checks for a normals modifier on all submeshes. Whenever it doesn't find one, it then adds it and then averages normals to a 0.001 threshold.
Removed a behavior originally added in with the DMC5 script edits that made UV channel 1 automatically be cloned to UV channel 2.
-UV channel 2 is used for wetmasks in RE2, and some models (every Capcom model, for example) have different UVs on channel 2 than they do on channel 1. If you don't need different UVs on channel 2 because you are using a modded model with a blank wetmask, it is convenient to have it automatically copy them over from channel 1 - but you should be allowed the option of using a separate UV channel 2 should you need it. Per-face mode still retains this behavior for now.
Added a "Spotty Normals" fix that significantly reduces the appearance of normals errors on export.
-Fixing this pervasive issue was the primary reason I began looking into editing the script. Here is a comparison of the same model exported with and without the spotty normals fix:
While the spotty normals are not entirely gone, they are greatly dulled.[/quote]
Old Links and Changes:
v0.5b
v0.5c
v0.5d
Alt v0.2 by alphaZ
v0.5e
v0.5 (Shigu)
v0.5b (Shigu)
- Quick fix on the remove spots hack.
v0.5c (alphaz / alphaZomega)
- Fixes skinning and the auto-smooth function
v0.5d (alphaz / alphaZomega)
- Changed the script back to not use the XNA framework anymore, as Che on the REmodding Discord figured out how to make the rigging accurate without the use of XNA (thanks Che!)
- Added a behavior to automatically copy the UVs from UV channel 1 if UV channel 2 does not exist
- Enabled the export of submeshes without Edit Normals modifiers
- Corrected a logic error in the Spotty Normals Fix that was causing it to affect Submesh_1, which is immune to the normals errors and doesn't need the fix.
v0.5e (alphaz / alphaZomega)
- Added the ability to import meshes with no bones when unchecking "Import Skin". The script should be able to import almost all meshes now.