REEM Noesis CMD (MaxScript) and custom physics guide
Aug 17, 2021 15:40:37 GMT 10
LostField, Scott Kennedy, and 3 more like this
Post by alphaz on Aug 17, 2021 15:40:37 GMT 10
REEM Noesis CMD
REEM Noesis CMD (RE Engine MESH Noesis CommandLine) is a graphical Script for 3D Studio Max that can remote-control features of the Noesis MESH Plugin in a fast, easy, and automatic way, allowing for easy import and export of 3d models from all RE Engine Games directly from 3dsmax.REEM supports meshes from all RE Engine games, now including RE7. It was originally made as a kind of experiment by mariokart64n, and I have since updated it and adapted it to be more useful and to be a much faster replacement for the RE Engine MESH Tool Maxscript. Because it uses the Noesis plugin, it can import and export meshes from any RE Engine game. This also means that everything REEM can do, you can also do manually with Noesis alone (so you don't need 3dsmax to do any of this)
The tool and its workflow have been optimized enough that is has become the main way in which I mod meshes, since it is so much faster and less finicky than the old native-Maxscript tool. All the objects imported into your scene from the FBX are colored and modified by the script exactly to feel like how it imports them when using RE Engine MESH Tool (though this can be disabled and the objects can be imported as basic gray FBX meshes with varying bone counts per-submesh if you uncheck "Use Bone Numbers")
Installation:
1. Take the "REEM Noesis CMD.ms" file that is included with the main download for the Noesis plugin and put it in your 3dsmax scripts folder.
2. You must edit the .ms file in a text editor to point it to the location of your Noesis.exe file, which should already be functional for previewing RE Engine meshes and textures.
Change this line at the top of the file to point to Noesis.exe
3. Make sure your 3dsmax units setup in Customize -> Units Setup -> System Units Setup is set to Centimeters and not Inches. Noesis only expects CM
4. Make sure your FBX import and export options have "Deformations" checked and that you are not using Legacy FBX if you want to successfully import mesh normals. If you need to use Legacy FBX though, you can do it with the "Use Legacy FBX" option. These are my current FBX import and export settings for 3dsmax:
{Click Here to View My Working FBX Import/Export Settings}
Some working FBX settings for the tool (ignore the Inches scaling -- just set that to "Automatic")
Some working FBX settings for the tool (ignore the Inches scaling -- just set that to "Automatic")
5. To use the script in 3dsmax, open it using Scripts -> Run Script
Modifying Skeletons with Noesis:
You can completely rewrite your model's skeleton to have whatever bones you want with the "Write Skeleton" checkbox checked (it is same as using "-bones" in Noesis alone). You can rewrite a hat mesh to have the skeleton of Mr X's body, and the game will animate that Mr X skeleton if you file swap it onto a mesh that is loading animations named with those new body bones. The motlist tool can then rewrite animations, meaning you can make custom models with custom bones moved by with custom animations, if you want.
Each meshfile has a "skin bone map" containing all the riggable bones; it only goes up to 256 bones maximum, because their bone indices are stored as single bytes and a byte cant count any higher than 256. Bones in the Skin Bone Map are the special bones that will have numbers in their names when you import with "Bone Numbers" checked ("-bonenumbers" in Noesis), that will actually have vertex weights associated with them and will influence the mesh. Other, "passive" bones can exist and be animated by the animations, but they can only influence the mesh by carrying around their children that are in the skin bone map and have weights.
If your model is like Vergil in DMC5 and has more than 400 bones but you want to write a new skeleton, you can specify which of those 400 bones you want to be in your new skin bone map by putting a colon ":" in front of the name of any bone you want to activate. For example, to activate the "Head" bone, you can rename it to ":Head" and export it from REEM Noesis CMD with Write Skeleton and Bone Numbers checked (or just as FBX with -bones and -bonenumbers in Noesis alone). The actual "b001" numbers in the names don't really matter anymore, only the colon matters. If you export with "Write Skeleton" but not with "Bone Numbers", Noesis will add every bone to the Skin Bone Map until it reaches the maximum of 256. Any weights for those bones not in the Skin Bone Map will be given to nearby active bones instead.
Adding Custom Physics:
The game animates physics bones using special "chain" files, which are like settings for specific chains of bones for how they should move, jiggle and collide. A chain file detects a bone inside a mesh's skeleton by looking for its name, and then moves the bone with special physics (that are set up in the chain file) if it is detected. So using REEM Noesis CMD with the "Write Skeleton" checkbox checked, you can combine say the bones of, say, Nemesis's trenchcoat onto Jill's body by parenting them to her Spine and shrinking them to her size. Then you can transfer the rigged meshes of his coat flaps onto the new combined skeleton on Jill's body using a utility like Transfer Skeleton in my Tool (the new Nemesis bones must be added to the skin modifier of the 2nd mesh selected in the transfer) and export it.
Then, you can actually animate those new chain bones right away by swapping in Nemesis's chain file over Jill's so it looks for those new coat bones in her model. This will of course freeze up her original body / breast physics, because they are not inside Nemesis's chain file.
However, you can add those physics back into Nemesis's chain file by editing his chain file using my chain template, REE_Chain.bt (it is a binary template for use with 010 Editor). Using the two 1sc scripts that come with the download, you can insert new "Chain Settings Groups" with REE_Chain_InsertStruct.1sc (select some struct in the template results and run the script to add a new one of those structs you have selected).
Then insert new bone chains for the Jill Body physics using the REE_Chain_addChainGroup.1sc script. It will make you a copy of another bone chain (you can make it be a specific length by editing the copied chain's node count + refreshing first), which you can then edit to have the same properties of Jill's original chain files by copying and pasting over the hex of the original versions of those "node" structs from the original Chain file you are merging in (select the hex of the structs and use CTRL+SHIFT+C and CTRL+SHIFT+V to copy/paste in 010). The settings of her Chain Settings Groups should be carried over as well, so her body physics bones do not move like Nemesis's coat. What settings group that a bone chain (chainGroup) uses is set inside the Chain Group.
The chain template can convert chain files between different games by changing the value at the top that says "Chain Version (Change Version Here)", when you type in the chain file extension of the game you want to convert to. For example, change it from "39" to "21" to convert a chain file from RE8 so it will work in RE2:
REE_Chain.bt
Animating Custom Bones
Check out and read through the whole motlist tool thread to see how you can create your own animations that have the correct names to animate the custom-named bones of any mesh that you've created with Noesis Write Skeleton. This has been used in many mods to do things like add bones for carrying or holstering weapons to NPCs who are usually unarmed. For example, it was used for swapped third person player model mods in RE8 in order to add a "Cam" bone, so that the player's camera would find a place in which to actually attach to the player model and not be on the ground.
Some tips for using REEM Noesis CMD:
- Meshes imported with REEM Noesis CMD and ones imported with RE Engine MESH Tool v1.38+ should be compatible with eachother, and each tool can export meshes that the other one imported
- You can export meshes from REEM that you would otherwise need to "Re-import" if you used RE Engine MESH Tool. For example, you can weld all your vertices together to make Skinning easier, and then you can export that welded model straight into the game using REEM. Noesis will quickly rebuild everything inside your FBX in a way similar to ResetMesh when it optimizes it as it loads it up. In RE Engine MESH Tool, this would cause errors in the normals and UV maps, or would make the export fail.
- The Re-import Noesis FBX button is for repairing a broken mesh, much like the "Re-Import Submesh" button in RE Engine MESH Tool. There is not much need for it though because of what I explained just above, except to repair meshes for use with the old Maxscript
- Clicking on a submesh and clicking the "xScale" button will multiply the scale of that selected mesh by the number in the field (using its root bone)
- You can right click on the xScale button to quickly go between the multipliers for converting centimeters to inches, and click it with the scale as 1.0 to always return to original scaling
- Normally, REEM will delete the "middleman" FBX file it makes when importing or exporting, but you can uncheck "Delete FBX Files" if you want to inspect the FBX. This is especially useful for troubleshooting when the exporter is producing broken mesh files.
- The "-fbxmeshmerge" checkbox will make sure Noesis does not split the model apart during its conversion, which it is liable to do if the original meshfile has more than 60,000 vertices on any submesh.
- The "Add / Remove Bone Numbers" button will automatically remove all the bone numbers from the skeleton of the selected mesh. If the selected mesh already had bone numbers and they were removed before, click this button will bring those bone numbers back.
- The "Export FBX Animation" button will export the selected bones as a FBX animation that is ready to use in Blender and other 3d programs. It is useful for anyone importing animations with RevilMax but not wanting to use 3dsmax to edit them. The button exports them with a "dummy" mesh included, so Noesis will show it in the preview and its bones wont be broken dummies in Blender.
- The "DirectX Handedness" checkbox will write models with their tangent space in the DirectX way. Unchecking this has the same effect as inverting the green channel of your model's normal map.
Rapid-Testing Mesh Exports:
You can set up your workflow so that you create "pl1000.mesh.1902042334" when you export over "pl1000.ORIG.mesh.1902042334" using REEM Noesis CMD. The script will specially recognize the ".ORIG.mesh" in the filename and will create the new exported file named as "pl1000.mesh" instead of the expected "pl1000.ORIG.NEW.mesh" that REEM would normally create. So the original reference file to use for making the meshes is named ORIG, and the new outputted file is just named "pl1000" -- meaning it is immediately ready to replace that file and be used in-game.
This can be very useful for when you are exporting multiple versions of your model and swapping them quickly into the game, for testing. Changing the files that fluffy installs inside the "natives" folder (in your game directory) while the game is minimized to the taskbar will refresh your mod in-game in a matter of moments. Just re-load the area to refresh the meshfile (or simply change models back and forth if it is viewed in the model gallery). This works with almost all files, not just meshes.
Using this ORIG.mesh feature (which is also available in the motlist tool) allows you to export without having to rename-away the ".NEW" from the exported filename and without overwriting the original file.
Folder Import:
REEM Noesis CMD has recently been updated with the ability to import all meshes from within the same folder. If you do this with all the environment meshes, you can import the whole game all at once.
Check the checkbox "Import Folder" to automatically have it import each mesh from one folder to your scene. By collecting all the meshes in into one folder, I was able to import the entire game world of Resident Evil 3. It took around 30 minutes to load it all.
{More screenshots}
However, many of the buildings in RE2 and RE3 seem to be missing from the files. I don't see them anywhere except in-game. Like this empty space in the middle:
This is the "sewers office" save room in RE3:
With backfaces disabled:
I also loaded up all the locations in RE2:
RE2's map takes up a lot of space:
Here are the DMC5 locations as well:
This map is very large and disjointed compared to the ones in RE2 and RE3:
Here's that little place at the bottom of the first DMC5 screenshot:
I also imported the ground terrain from RE8 (meshes named like xz123145.mesh). No buildings were included, just ground
Very interesting stuff, and it's very helpful as a reference for to anyone trying to make stage / environment mods, because the coordinates that you see in 3dsmax will be the same (or the same but 100x larger) than the coordinates that the game uses inside SCN and PFB files (which you can open with the RSZ template)
However, many of the buildings in RE2 and RE3 seem to be missing from the files. I don't see them anywhere except in-game. Like this empty space in the middle:
This is the "sewers office" save room in RE3:
With backfaces disabled:
I also loaded up all the locations in RE2:
RE2's map takes up a lot of space:
Here are the DMC5 locations as well:
This map is very large and disjointed compared to the ones in RE2 and RE3:
Here's that little place at the bottom of the first DMC5 screenshot:
I also imported the ground terrain from RE8 (meshes named like xz123145.mesh). No buildings were included, just ground
Very interesting stuff, and it's very helpful as a reference for to anyone trying to make stage / environment mods, because the coordinates that you see in 3dsmax will be the same (or the same but 100x larger) than the coordinates that the game uses inside SCN and PFB files (which you can open with the RSZ template)