Wednesday, September 24, 2014

DAS Tree Creator Maxscript

Progress continues on the DAS Tree Creator Maxscript for creating fully 3-dimensional trees using opacity/cutout mapped "Branchlets" or "Fronds" for the primary leaf regions. The script is very robust yet easy to use, giving the artist control over the structure of the tree, the level of detail and mapping, plus the ability to edit the tree as a mesh object. Below is a capture of the current UI from the script:



The script is intended to make good looking trees for real-time applications, not to try and replace existing programs like Onyx Tree Storm, Laubwerk, or X-Frog trees which make photo-realistic trees for pre-rendered applications. Trees generated from the script can look very good with as few as 1500 poly's but the user can control the level of detail and create better looking trees at the expense of poly counts.The user has control over the shape, size and detail of the trunk as well as the number, shape, size and detail of branches. Using your own created "Branchlets" (several examples will be included with the script) you can customize the canopy shape and density. The script has the ability to make conifers as well as deciduous trees and even bushes. Below is a screen capture of a test making a Birch tree. The total number of polys is less than 1700 (the viewport stats include a few hidden entities).


Though most rendering engines have gone away from opacity mapped trees, it is still needed in the real-time applications where millions of polys for foliage is unacceptable.
A release date is not set but it is my intention to make this a commercial script.

FBX exporter Maxscript for UE4 by Tom Shannon

Tom Shannon http://www.tomshannon3d.com/ has written a Maxscript to assist with the tedious process of exporting scene objects to FBX for use in Unreal Engine 4. I came across Tom's script while doing some research online, but haven't had a chance to try it out yet.You can find info and a download link here:
http://www.tomshannon3d.com/2014/07/tstools-first-release-ue4-mass-fbx.html

There are several youtube video links posted as well.
Thanks Tom!

UVW Unwrap for Unreal Engine 4

Users of Epic's Unreal Engine 4 will know that you need a UVW layout with no overlapping faces for static mesh shadow computations. By default this is UVW channel 2 but you can change it to whatever channel you want inside UE4, especially if you have some complex mapping using several channels already. It couldn't be easier to setup in Max. First, just apply a new UVW Unwrap Modifier to your object and change the Map Channel to the last unused number. Then open the UVW Editor and under the "Mapping" menu item choose "Flatten Mapping..." Typically you can accept the default settings and your done! Below is the result with a Standard Max Teapot Primitive:


If you're not happy with the results you can try "Unfold Mapping..." and/or the "Pack UV's.." option from the "Tools" menu. The integrity of the layout doesn't really matter since it's just being used for shadow casting. It's not really important that these UV's be packed efficiently. The only critical issue is that none of the UV's can overlap or the shadow casting algorithm will fail, you'll get a warning from Unreal and there will be no shadows computed for that mesh.

Monday, May 19, 2014

beware "Plugin.UserSettings.ini

Years ago, Max had a single "plugin.ini" in the root directory of the software. Adding a custom path in this ini would allow you to put plugins in a central location on your network rather than inside each installation itself. Now this "plugin.ini" is placed in each user's installation directory:
"C:\Users\*user*\AppData\Local\Autodesk\3dsMaxDesign\20XX - 64bit\ENU" and called "Plugin.UserSettings.ini
If you try creating a custom "plugin.ini" and placing it in the install directory like the good ol days, Max will ignore it.
If you want to set custom paths to plugin locations, it is done by editing this file, but beware, the first time you render with max under that user, max will re-write this file to it's default. Once this initial rendering, right after install, is done, then you can configure this ini as desired.

As for network rendering, make sure you know under which user's configuration the software is choosing to get it's settings from. Typically the user who installed it originally.

How to fix missing plugcfg "ini" files

This has been an issue noted over the years and asked about a lot on the forums. A common problem users run into after installing the software is missing ini files, specifically for Mental Ray Global Illumination "Presets" in the Render Dialog as well as Arch & Design Material "Presets" (located in the drop-down at the top of the A&D Material's Dialog). These are stored in .ini files located in the plugcfg directories. However, since Autodesk went to a system of installation that can be customized for individual users on the same machine, some users find that these presets are missing for them. These files can be found on the computer and copied to another plugcfg folder (there are actually several since max 2013). See the image below to see the .ini files, located in the language-based sub-directories of the particular user's Max installation (in this case "en-US") where they can be copied and then pasted into the alternative "plugcfg _ln" folder highlighted below. Once pasted into this folder they will now show up for that particular user when he/she starts max. I usually copy all the .ini files and paste them in, ignoring any duplicates upon paste.
I don't find this issue when a single user installs the software and then uses it, but when multiple users are using Max on the same computer under their own different logins.


The above directories are located in the user's software installation:
"C:\Users\*user*\AppData\Local\Autodesk\3dsMaxDesign\20XX - 64bit\ENU"
Copy the .ini files from:
"C:\Users\*user*\AppData\Local\Autodesk\3dsMaxDesign\20XX - 64bit\ENU\en-US\plugcfg"
to
"C:\Users\*user*\AppData\Local\Autodesk\3dsMaxDesign\20XX - 64bit\ENU\plugcfg_ln"

Another solution I have not tried is copying these .ini files into the actual Max "Program Files" installation sub-directory also labeled "plugcfg_ln". This might be a global solution for all users.

Sunday, May 18, 2014

3ds max 2015 Local Maxscript Help File

If you're looking for a downloadable copy of the MaxScript Help for 2015 it can be found here:
3ds max 2015 Help
One of the new features of the 2015 online help is that all the help files are combined into one so if you search for something that you want to know more about for scripting purposes, you often get just the max general help for that topic. As if it wasn't hard enough in the old, separate MaxScript help to find the specific topic you wanted. It's especially difficult if you don't know the exact scripting phrase you're looking for (that's usually me).
Once you unzip the link from above, if you chose the .chm version (I still like that) you may find it doesn't display. Here are the instructions from the .zip to get Windows to "unblock" the file:
If your .CHM file does not load any help pages into the main content
panel, you may need to unblock it.

To unblock your .CHM file:
1. Find the file in Windows Explorer.
2. Right-click the file and select "Properties" from the contextual
 menu.
3. On the General tab, click the "Unblock" button.
4. Re-open the file.

If the "Unblock" button does not appear, or if the file still does not
show any content:

- Ensure that there are no special characters anywhere in the path
 and file name of the .CHM file. The # and . characters are known
 to prevent CHM files from displaying correctly
- Ensure that you are not trying to open the file from a network
 location or shared folder. Move it to a location on your computer.


Happy Scripting

Friday, May 16, 2014

Rendering with IBL

Just a quick note that since 3ds max 2014, IBL is checked as the default for "Skylight Illumination" in the "Global Illumination" rollout of the Render Dialog for Mental Ray. If you are NOT using IBL (for example, you are using a standard "Daylight System") your render times will nearly double trying to render with the IBL radio button chosen instead of  "Final Gather". Make sure you have the right option chosen for your lighting scenario.