Quantcast
Channel: Project Reality Forums - PR:BF2 Community Modding
Viewing all articles
Browse latest Browse all 924

Experimental updated 3dsMax Tools. Newer Max versions support and more.

$
0
0
Hey all,

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: 3dsMaxBF2Tools045b.zip

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:


    This Tool is an extension of the existing Animation Import.
    In addition to importing the .baf it loads it straight into a hand/body scene, and additionally imports the requested handheld weapon mesh and aligns it to the .baf

    The following steps make up the import process:

    1. Click on the uppermost "Get" and navigate to the animation you want to import. (Both 1P and 3P are possible)
      In this example I'll be importing a crouch movement animation for the Lee-Enfield No4.


    2. (Only applicable for 3P Animations)
      Since most 3P animations are split into upper body (specific for each weapon) and lower body animation (shared among all weapons), it may be helpful to also import the corresponding lower body animation.
      If a 3P animation was selected in the first step, the tool tries to find the corresponding lower body animation. If you want a different one, or it didn't find the correct one, you can still change it by clicking on the 2nd "Get".
      In the example, it correctly picked the lower body baf, so I won't touch it.



    3. After having selected an animation in step 1, the tool will look for what it thinks is the corresponding the weapon mesh.
      If you want a different one, or it didn't find the correct one, you can still change it by clicking on the 3rd "Get".
      In the example, I'll want to confirm if the No4 animations work fine for the No1 SMLE (since they share the same animations), so I'll change the automatically found No4 to the SMLE.



    4. Click on import and a scene with all items will load. The scene is currently a bare-bones (no pun intended) animation setup, with none of the tools and controllers that are actually used during animating.
      Before we can actually with an animation, we need those setup. This is usually the first step in creating any animation.
      Luckily the tool can also take care of that for us. After importing, there will be a Message, asking whether we want to Setup Animation controllers.
      This leads to the next step:



    5. After clicking yes, we can setup animation hierarchies in the way we prefer. This is usually up to the animator's choice.
      In the example, I'll want all weapon meshes, as well as the hand controllers (which the tool created after clicking on "Yes") to be parented under the main weapon mesh.
      The hierarchies here can also be time-dependent, i.e. controlled through Link Constraints (Link Params Section in the Hierarchy Tab), e.g. for Reload Animations.
      Note that until the hierarchies setup is complete, the hands movement might differ from the final animation.



      Once the hierarchies are all setup, after clicking on "Continue" in the FH2 Animation Tools Dialog, we'll end up with the correct animation, as well as hand controllers (IK chains parented under hexagons, FH2-style).



    There is of course still the issue that exported animations have keys on every frame. Unfortunately there's no magic solution to get the original keys back.
    So you'll still have to reduce those manually (e.g. in trackview) to be able to change complex movements.
    Alternatively you can try to use Soft Selection in the track view, or to superimpose new movements using dummies in the hiearchy.





    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.

    Spoiler for Image of OG object automatically imported (with alpha and two-sided) for LMing:



    Sorting out your Statics for Lightmapping
    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.
    Small tutorial to follow

Feedback, questions, bug reports and comments are always welcome!

Viewing all articles
Browse latest Browse all 924