Hi,
Small free tool, for my own testing actually,
so it takes a bit of work to install setup…
If you get it to work, let me know any ideas/suggestions for extra stuff.
(There is not much error checking done, so dont try anything funny…)
mTerrain
Intro
- 3DS Maxscript, that exports mesh to Unity “terrain heights”
- Whats nice, you a have full control of the terrain mesh in 3DS Max
ie. edit as much as you like, stack modifiers, precisely edit few/single vertices etc…then easy export to Unity - This plugin doesnt create any terrains, use 3DS Max or external software to do that (this is for export/import only)
- Good way to start, create plane, add displacement modifier, add some maps or bitmaps as displacement…
Requirements
- 3ds Max 2008+
- Unity 3.x
Download
Donation
- Feel free to donate : )
(bonus. Those who donate any amount, get the MaxScript source : )…which is nothing special, it just exports vertices to a file…)
Licence
- mTerrain is licensed under a Creative Commons Attribution-ShareAlike 3.0 Unported License
Deed - Attribution-ShareAlike 3.0 Unported - Creative Commons
Installation
3ds Max Script Installation
- Copy “mTerrainFunctions.mse” to your 3ds Max scripts-folder (usually c:/program files/autodesk/3ds max 20xx/scripts/)
- Copy “mTerrainv10.ms” to your 3ds Max scripts-folder (usually c:/program files/autodesk/3ds max 20xx/scripts/)
- Run the script from 3DSMax menu: Maxscript / Run script… browse for the script, select “mTerrainv10.ms” and run it
- Now go to menu:
- Customize / Customise user interface
- Go to “Toolbars” tab
- Group: Main UI, Category: mTerrain
- Drag the script from the cction list named “mTerrain” to your toolbar (existing or create new)
3ds Max Script Setup - First Run
- Click the mTerrain button without any objects selected
- This will open mTerrain Setup Window, fill in the values (You can see the values in Unity, from menu: Terrain / Set resolution )
- Unity Heightmap resolution: ___
- Unity Terrain height: ___
- Unity project asset folder: ____ (this is the folder where your mterrain-textdata-asset will be saved)
- Click “Save settings”
- Done
Unity Script Installation
- Import mTerrainV10.package
- Inside the package you get 2 scripts (+1 sample terrain data asset)
- mTerrainObject.js (can be anywhere in the project tree)
- mTerrainEditor.js (its in editor/ folder)
Usage / Tutorial #1
Unity
- Start new project or use your old one
- Add unity terrain to your scene
- Check Terrain / Set resolution… settings (they must match the values you have used in 3DS Max)
- Add mTerrainObject.js script to your terrain (drag drop the script to terrain)
3ds Max : Creating terrain
- Create plane
- 2000x2000 (same size as your Unity terrain)
- 512x512 segs (Important. 512 in Max is 513 in Unity, so its minus 1, if you use different resolutions)
- Modify your plane to make terrain (for example, add a wave modifier)
- Or use any displacement map with displacement modifier
- Select the plane
- Press “mTerrain” button
- Wait…(progressbar is shown)
- Done, go to Unity…
Unity : Getting 3DS Max terrain
- Select your terrain (which has “mTerrain.js” attached)
- Drag mTerrainAsset to mTerrainAsset in inspector window (under mTerrain script, its the terrain height values)
- Note. You can rename “mTerrainAsset” to keep it, new imports are saved again as “mTerrainAsset”
- Press “Update mTerrain”
- Wait…
- Done (your terrain should look like the one in 3DS Max)
After that you can keep modifying the 3ds Max plane and update it in Unity when needed
Go back to 3ds Max
- Modify your plane
- For example: add noise modifier
- Press “mTerrain” button (1 object must be selected when exporting, if nothing is selected, setup window is shown)
Go back to Unity
- Select your terrain
- Press “Update mTerrain” in the inspector
- Note. You need to click “apply materials” in TerrainTools, to get the correct textures in slopes etc.
Screenshots
Setup screen
Mesh in Max
Terrain in Unity (Terraintools used for texturing)