sometime last year I started playing around with the 3ds Max tools code to accelerate my workflows.
This somehow escalated into much more than just little tinkering and might now be useful to other modders out there as well.
You can download the full install here: BF2-3dsMax-Tools.zip (you can also check the code repository directly)
Thanks to Worldlife, Mats, Remdul who wrote some of the scripts used in these additions.
And of course to the devs and modders testing, reporting bugs and giving feedback!
To install, extract the contents of this folder into your "\Autodesk\3ds Max 9" folder, overwriting anything you have there already in that folder and restart max.
If you want to use the tools is a different max version, you can just extract the contents into the appropriate folder as well.
However I recommend (and prefer for myself as well) to instead create symbolic links for /plugins/bf2_mat_staticmesh2.ms and the entire /scripts/bf2/ folder (will add how to do this here later).
This way settings will be carried over between max versions, and you don't need to worry about updating both independently.
Some of the changes require tutorials of their own (being worked on, will post them as soon as they're ready), but for now I can give a brief summary of the changes and additions:
- Support for other Max version newer than Max 9 (Tested so far with max15 and max16, anything in between 9 and 16 and probably also newer ones should also work)
- New Importer (for all other versions, selectable for Max 9)
Correct material import: Setup BundledMesh/StaticMesh Materials
- Only relative texture paths (-> Setup places mods folder in User External Paths)
- Alpha displayed after import (also for LMing)
- OG Import: Twosided and transparency for all materials with only base texture (also for LMing)
- Downside, however is that the new exporter (entirely in maxscript) is somewhat slower than the original importer (written in max SDK). However maxscript is compatible between almost all max versions, and is easily changed, while max SDK is compiled and therefore inaccessible.
Spoiler for Image of imported Static (directly after import, no manual material changes): - Alpha Selection in BF2 Materials
Alpha Transparency Modes (No Alpha, Alpha Blend and Alpha Test) can now be selected for each BF2 Material (BundledMesh and StaticMesh Materials).
The Material name is automatically appended with the correct prefix, and the transparency is displayed in the viewport. - Changes to the Exporter:
Checkbox to not create a new directory during exports of bundledmeshes, staticmeshes (i.e. export directly into the current directory, as is default e.g. with animations)
Remove Root Bone Checkbox now stays saved for each scene. (Important during 3P animation export)
Lightmap Sample Generation: By default, Lightmap samples are now generated à la BfMeshView (by a small console app that contains BfMeshView's Sample generation code). Which Generator is used (BfMeshView or Original) can be selected in the Setup Menu.
With BfMeshView it's possible to generate custom sample sizes (e.g. 128*64) straight from the max scene, as well generate custom-defined different sizes for each LOD using the "User" option. In this case each LOD node has to be suffixed with the desired size (e.g. lod0_256 or lod2_64*32). - Animating (FH2 Animation Tools in Utilities):
Easier Handheld Animation Import:
Pick Animation, (for 3P only: also lower body animation if required) and weapon mesh
-> Imports everything into one scene correctly aligned and animated
-> Also option to automatically set up IK chains and controllers (FH2-Style)
Spoiler for Short Tutorial for 1P/3P Animation Import and Setup:
Automation System for 3P animating:
Derive Animation Systems from templates (e.g. one template for all handheld weapons)
Basic Idea: General movements stay the same for almost all anims. Anims differ only in relative weapon position (to body), and hands and fingers on the weapon.
-> Pick Template, define Still Weapon position, hand and finger positions. Tools then transfer those to an existing 3P Animation set exports and saves everything.
Reload and zoom might (most probably) need manual correction, but over 90% of animations already done!
(Tutorial also underway)
Plus some one-click buttons for common (in my workflow at least) operations during animating.
Spoiler for Image of new FH2 Animation Tools Dialog: - Lightmapping:
Disclaimer: I don't have a mapping background and mostly stick to coding/modelling, so if somebody wants to weigh in on this process with requests or recommendations, they're more than welcome!
Following Rhino's excellent tutorial, the lightmap process is now a bit more streamlined.
An updated tutorial, taking into account the new changes is in work, but for now the major changes:
Converting your Overgrowth to Static
This step is no longer necessary, use the Load Overgrowth Button, then find Overgrowth/OvergrowthCollision.con to import OG straightaway.
3DsMax LMing Scene Setup
The recommended unit setup is now set automatically when opening the LM dialog.
Importing Your Terrain into 3DsMax
If a minimap exists, it is now automatically applied to the terrain.
Note that a 2nd terrain is loaded and hidden in which the sealevel is applied automatically (which is needed later on).
Importing Your Statics into 3DsMax
Static children are now loaded as well. Also, when using the alternate importer alpha textures are applied correctly automatically.
There's also a bunch of new settings in _Settings/StaticObjects_Import.con which can be used to further the streamline the process
(E.g. automatically create point light sources for specific object templates)
DestroyableObjects are now loaded and lightmapped automatically as well.
Cleaning Up Your Objects
OG and other objects that only cast but dont receive shadows are automatically stripped of their hierachies.
BundledMeshes should now import correctly as well (and remain only with their lod0)
Creating Reference, Shadow Casting Objects and Replacing Objects with Reference Objects
This should all be managed automatically with alternate import, so no need to manually apply alpha and instantiate objects anymore.
OG leafs are imported with a two-sided material, meaning that cloning, detaching and inverting the faces is no longer necessary.
Sorting out your Statics for LightmappingSpoiler for Image of OG object automatically imported (with alpha and two-sided) for LMing:
Upon Importing of StaticObjects, Lightmap sizes are now automatically assigned (if samples for each object are present).
Objects which have "GeometryTemplate.doNotGenerateLightmaps 1" set in their tweak file will automatically be prevented from lightmapping.
DestroyableObjects now also have their Geom1 displayed in the Lightmap size file. Geoms are separated by a "|".
Note that the tweak files are only read for those objects that are being imported. If the "Build Sizes File From:" button is used (which collects ALL sample files in the entire mod directory), .tweak files are not read and "GeometryTemplate.doNotGenerateLightmaps 1" is not handled.
Importing your Sun & Preparing your Lights
Sunlight, Skylight and Ambient Fill Lights are now loaded all at once, all with their colors already setup for simultaneous lightmap rendering.
Sunlight is fit according to the mapsize. Intensity parameters are estimated, however this should still be checked and determined by the user in most cases.
Note that a WaterLight (needed later) is also created and hidden.
Terrain Sun & Sky Lightmaps and Terrain Sea Water Depth/Transparency Lightmap
The "Render Terrain" Button now automatically creates a complete lightmap in the specified /terrain/ folder.
The generated .tga lightmap can then be split and converted into the terrain patches required for bf2 by using the "Split Terrain File" Button.
If uniform patches (i.e. no discernible differences over the entire image, e.g. for maps with lots of ocean floor) are found, they are automatically reduced to 8x8 textures. - Overgrowth Lod Creator:
A small and lightweight tool to automatically create flat plane lods for overgrowth meshes.
UV layout is automatic as well though, which is often not very efficient.Spoiler for Small tutorial for Overgrowth Lod creator: