User Tools

Site Tools


Differences

This shows you the differences between two versions of the page.

Link to this comparison view

impmax [2018/10/16 14:34]
impmax [2021/04/27 09:19] (current)
Line 1: Line 1:
 +======Importing to 3ds Max======
 +
 +After [[ExpStaticMesh|exporting]] a mesh from the SpeedTree Modeler, you can use the included MAXScript to load it into Max and recreate the materials as closely as possible.
 +
 +To install it, go to the Utilities tab and select //MAXScript". Select "Run Script// from the ensuing rollout and browse to the script, which can be found at //<apps install>/scripts/3ds Max/SpeedTreeImporter.ms//.
 +
 +
 +=====Importing=====
 +
 +Once the MAXscript has been run, you will have a new rollout with buttons for "Import", "Import for V-Ray", "Import for Mental Ray", "Import for Redshift", and "Import for Arnold".
 +
 +When one of these buttons is clicked, it will ask to load a SpeedTree Material (.stmat) file. You don't need to worry about the format of the actual mesh exported from the SpeedTree Modeler, as that information is stored in the ".stmat" file. The only difference between the three importers is the type of materials made after the mesh itself is imported.
 +
 +
 +=====Interface=====
 +
 +Each of the importers has also been declared a macroScript, enabling you to attach the importer(s) to a button in the toolbar, a menu item, or a keyboard shortcut in the Customize User Interface dialog of 3ds Max. Please see the 3ds Max [[https://knowledge.autodesk.com/support/3ds-max/learn-explore/caas/CloudHelp/cloudhelp/2019/ENU/3DSMax-Getting-Started/files/GUID-FE40F021-5444-4709-BF08-DF1F1F0960C3-htm.html|documentation on macroScripts]] for more information.
 +
 +
 +=====Extending the Script=====
 +
 +If you wish to change how the materials are created, or add completely new material types, the MAXScript has been designed to be easily extensible in this manner. 
 +
 +You will need to make a MAXScript function that creates and returns a material (StandardMaterial, VRayMtl, etc.) based on the information stored in the passed-in STMaterial struct. Hooking the material up in the correct place on the mesh is handled for you elsewhere. You will also need to make a button in the utility rollout at the very bottom of the MAXScript, and you can add a macroScript declaration as well. 
 +
 +
 +For examples, please see the MakeSpeedTreeMaterial, MakeSpeedTreeMaterialVray, MakeSpeedTreeMaterialMentalRay, MakeSpeedTreeMaterialRedshift, MakeSpeedTreeMaterialArnold functions in SpeedTreeImporter.ms.