Dave Girard's 101 Autodesk® Maya® Tips is now available in Kindle, interactive iPad edition and DRM-free EPUB/PDF editions. Work faster, cry less. Read more about the ebook.




Follow cgbeige on Twitter

Topics by tag:



Recently published articles by Dave G:



Free downloads by Dave G:



Mac OS X-only downloads:

Note About Houdini Installs on OS X with Custom Python Version

I use Python 3.3 for my multithreaded Automator actions in OS X but I just realized that this prevents Houdini from installing properly if you’ve overwritten /usr/bin/python with anything other than Python 2.7. If you have a custom Python version installed, just copy the 2.7 binary back over /usr/bin/python, and then Houdini will install correctly.

0 notes | Permalink

Skip a Trip to Photoshop: Use the V-Ray Color Correction Node

V-Ray for Maya has some pretty handy (but slightly hidden) tools that can be added from the Create From V-Ray Plug-in menu and one of the best is the Color Correction node. It’s basically a grading dialog for textures and can do quite a bit, and it can save you trips to Photoshop to just do slight tweaks to hue, contrast, etc.:

The only thing to keep in mind is that the brightness is a gain slider, not a gamma-based correction, so it should be avoided to adjust mid-tones. Also, you can try out the other Color Correct plug-in for yourself but it’s less full-featured than the Color Correction plug-in. Why they are so similarly named is a question for the sages.

0 notes | Permalink

A Guide to Creating a V-Ray Linux Render Slave

Recently, I’ve fielded a lot of questions about setting up a Linux-based V-Ray render box and most of those queries are coming from Mac users who are in need of more oomph but don’t want to shell out for the very dated 2010 Mac Pros. So slavery is all the rage as people are discovering the merits of cheap additional labour. But Linux is the black diamond course of computing, so here is a quick rundown of what’s involved in getting a Linux slave machine up and running with a V-Ray render service.

CentOS, Chained
For my headless Linux workstations, I use CentOS 6.3 (later is fine and may be required by your newer hardware) because it is the easiest to get running with Maya. If you’re unfamiliar with Linux, you want to avoid missing dependencies that have to be installed later, and CentOS runs Maya fresh from the install. Fedora should be avoided unless you know what you’re getting into. Ubuntu is not an option because it’s a Debian-based distro and Maya (like most CG apps) require a Redhat-based distro to function. You can do a bunch of hacks to make it work but it’s just not worth it for a headless slave machine. Ubuntu is all about usability and you won’t be using this machine beyond it’s functions of sleep, wake and render. Hence it’s not-so-glorious title of slave.

Installation
So here are the instructions to get CentOS up and running. Install CentOS with the Software Development install option to ensure you have all the necessary libraries installed. It might work with others but this is a good, safe bet. During the install process, enable the network because CentOS disables it by default. If you miss this, you can do it on boot (it’s an icon in top right the GNOME menu bar).

Maya and V-Ray Installation
Install Maya with your serial number – there is no demo option on Linux. You have to use the terminal to run the Maya installation. Open it and cd to the uncompressed Maya installation folder and then type “su” to switch to the root user. Then type “./setup” (all this is without the quotes) – if you just enter the full path to the setup file without cd’ing first, it won’t be able to find anything for the install. That stumped me for a while when I first installed Maya on Linux. Once it’s done installing, don’t run Maya because you’ll be asked to activate it. You don’t need an activated Maya install for use as a slave so skip running the application itself and move on to V-Ray installation.

V-Ray Slave Service Installation
Before you install any old V-Ray version, make sure you get a build of V-Ray 2.4 or later, that does automatic asset transferral so you don’t have to concern yourself with setting up finicky, matched-absolute path network sharing. Currently (2013-04-18), that’s only available in nightly builds so contact Chaos Group to get access to nightlies and you have a non-EDU license. During command-line installation, make sure you register it as a slave service. The slave service won’t start unless you reboot or launch it manually for the first launch. If ever you try and launch it and it fails, that means it’s already running. To ensure that the slave is seen and accessible from other machines, open the V-Ray service TCP port in the CentOS firewall settings. With 3.4 betas, the port is currently 30304.

Some things to keep in mind:
To get sudo access to do stuff like “sudo pm-suspend” to sleep the machine from the command line, you’ll need to use visudo to add your user to the sudoers list. Google that – visudo is just vim and it uses a weird list of key combinations to use it. Otherwise, just su to root and issue the command without sudo.

You’ll probably want to edit your router to reserve an IP for your machine so it doesn’t change. To get the IP and MAC address of the machine, type “ifconfig -a” in the terminal. eth0 is the ethernet connection (or eth1 if you have more than one). That will also give you the MAC network address for use with WOL (Wake on LAN). With a static local IP, you can reliably wake the machine from sleep with a utility like WakeOnMac (OS X) or Wake Me On LAN (Windows). You may need to enable WOL in your machine’s BIOS settings. You don’t have to enable it in CentOS and it’s not dumb like WOL in Windows machines that seem to wake just by looking at them.

Additional Linux and command line tips for newbs
I wrote a guide to getting command line rendering up and running for Maya users on OS X that will probably be helpful to understand Linux as well, since both use the BASH shell by default.

If you’re looking to actually run this machine as a Maya workstation, then you have more work ahead of you, as you get to do all the mind-numbing work of blacklisting nouveau (Google it) to install Nvidia’s drivers and stuff like that. Still, it’s easier and more stable than making a Hackintosh. Luke Olson’s Linux for CG and VFX Production Environments is a really good primer if you want to use Linux with CG apps. He mostly uses Houdini, which installs on Ubuntu without issue, so keep that in mind if you’re wondering why he’s recommending it alongside Fedora. I would steer clear of it personally. Do your worst, Ubuntu zealots!

1 note | Permalink

Mixing Displacement Maps in Any Maya Renderer

Someone on CGSociety asked how to mix displacement maps in Maya, so I figured I’d give him some tips and make a blog post out of it, since I’ve seen this asked a few times in the past. This process works for all renderers since it uses Maya’s utilities, nothing specific to V-Ray or mental ray. Instead of doing it with blend materials or something like that, it’s all done by connecting your greyscale textures to a Plus/Minus/Average utility and sending the output from that to the Displacement slot of your Shading Network:

So, there you can see how there are two textures that combine to make one displacement map with different influences. In the video, I went about the connections in a slightly long way, using the 3D channels (RGB) and then connecting the 3D output to an [RGB to] Luminance utility. Because the displacement utility requires a scalar (greyscale) value, you have to stick an [RGB to] Luminance utility between the 3D output of the Plus/Minus/Average utility and the displacementShader node. I could have avoided that step and attached the checker and fractal textures to the 1D inputs (1D meaning one colour channel in this context) and sent the 1D output directly to the displacementShader output:

That does the same thing. But that process has a catch. Notice how, at the start of the video, the checker doesn’t affect the displacement until I hit Alpha Is Luminance in the Color Balance pane.
If you use the 1D input/output method, you’ll have to do that for all your textures. “Alpha Is Luminance” is a bit of a misnomer or at least it’s ambiguous – it should be “RGB Luminance is Alpha Output” and it just means “take my texture brightness and send that to the alpha output.” Even though they appear greyscale, the checker and fractal used here are RGB textures so they still need to have that checked off for the 1D workflow.

In the video you’ll also notice how I adjusted the height of the checker by increasing the “value” of the HSV to above 1 for the white and below 0 for the black. If you just increase the white values, your mesh will bloat outwards, which is probably not what you want. Using an even +20 and -20 gives you a “water line” that is at 0. Also, it’s worth mentioning that I changed the Checker Attributes but I could just as easily have changed the Color Gain (white) and Color Offset (black) values to get the same result. But, like with the Alpha Offset settings, you have to set the Color Offset to -0.5 of your Color Gain value to get the proper water line.

Upping the bar: mixing UV sets with displacement
Another thing the poster on CCSociety asked about was how to mix UV sets for his different displacement maps. This can come in handy if you want to use an unwrapped UV map from ZBrush for your sculpted mesh displacement but want to use a front-projected checker for another layer of displacement relative to the Maya camera.

This process is a little less straightforward because you Maya likes to have the texture explicitly attached to your mesh to create the UV linking setup. So the workaround is to temporarily link your texture to a slot in your material. Then, with multiple UV sets on your mesh, you can connect the texture in the UV linking editor:

Disconnect your texture from your shader and Maya will remember the UV linking and apply it to your displacement texture.

1 note | Permalink

Maya for OS X Window Layering Tweak

I just got word of this tip that lets you alter the way that windows float in Maya for OS X. By default, floating palettes sit on top of the main window in Maya and this can be either helpful or annoying, depending on your preference. Luckily, you can change this behaviour to let the main window cover palettes by adding this line to your Maya.env file (~/Library/Preferences/Autodesk/maya/2013-x64/Maya.env on my machine):

MAYA_SET_PARENT_HINT=0

Restart Maya and you’re set. The command-` still cycles through windows, so you’re not going to lose any windows:

Update: Just thought I’d mention that, in OS X, you can click and manipulate (move, close, minimize) background windows by holding down the command key modifier when clicking. So you could have MAYA_SET_PARENT_HINT=0 on and still manipulate another window without bringing it forward:

It’s a good one to know. OS X has a lot of these little hidden command key and modifier features.

1 note | Permalink

iCollide – Another Amazing (and free) Maya Plug-in

Yesterday, I plugged (nyuk) iDeform, Ingo Clemens’ free Maya plug-in for real-time displacement previewing. If you look around Ingo’s blog, you’ll find a bunch of other great scripts and plug-ins and iCollide definitely warrants a mention. It’s basically L3Deformer’s collision deformer for free:

3 notes | Permalink

Some Tips on Efficiently Building and Texturing Terrains in Maya

So, I’m relatively new to the world of organic world building. I’m mostly experienced in illustration in the product-visualization vein but I’m getting into more fully-fleshed scenery and I’ve been investigating some options like Vue, Terragen, etc. But, I like to keep things in Maya if possible, so I’m going to post some helpful tips and things I’ve learned from other tutorials, along with my own texturing workflow.

I’m using the awesome iDisplace with a crater texture to build a basic height terrain to shape out some hills with a naturally-looking fractal mapping. The nice thing about doing it procedurally with iDisplace is that you can use textures and blend them or add them with texture utilities and you can increase your plane mesh resolution any time and it will propagate through the node chain nondestructively. The next thing I do is map a ramp along the vertical with a projection node:

Once you get the basics of that approach down, it’s time to think a little out of the box and use the individual ramp channels as a mask for your actual textures. If you make a ramp from pure red to pure blue and then look at the individual channels in greyscale, you can see how this can be exploited as two-channel mask. Using the Node Editor (or Connection Editor in older Maya versions), you can then connect these individual colour channels to the blend input of a V-Ray Blend Material or any similar blend material for mental ray or the Maya layered shader. That way, you use your mesh UVs for the textures and the projection node and ramps for the blending. If your terrain shape changes, your water line doesn’t move unrealistically – just hit fit to bounding box again and you’re good. So, here I am using the projection ramp as a mask for a V-Ray Blend Material to interactively mask the water line:

This is a really basic shader but you can see how this type of thing is pretty flexible and can be built on nicely. Put the 100% green point back into the ramp and you have another blend channel for more flexibility. If you don’t quite follow the video, grab the scene here and tinker around with it to see how it works (requires iDisplace and V-Ray for Maya).

You can see in the video that viewport 1 and 2 don’t yet support the texture-mapped blend but support for that should come as viewport 2 support becomes more robust. Autodesk is trying very hard to get viewport 2 up to task but you can imagine that this stuff takes a bit of time.

Tangentially related, tonight someone on CGSociety asked how to derive a height map from a terrain mesh, and the answer is straightforward, knowing what we know about the projection node and ramp texture. Assign a surface shader (that receives no specular, light, or shadow) and map a greyscale ramp along the side of your mesh. Then render it from above and you have a height map:

I can’t take credit for that cool workflow – it’s something I learned a while ago from some other CG forum.

2 notes | Permalink

While I’m Making More Hotkeys – Here’s a Context-aware Create Render Node Script

I got tired of opening the Create Render Node dialog from menus, since I use it so much, so I made another hotkey script. This will bind a material if you have an object selected (like the right-click Create Material selection) or it will just create a new node if nothing is selected, which is good for shader building in the Node Editor or Hypergraph:


global proc createNoderr()
{
if (size(`ls -sl`) > 0)
{
createAssignNewMaterialTreeLister "";
}
else
{
hyperShadePanelMenuCommand("hyperShadePanel1", "createNewNode");
}
}

Download link:

createNoderr.mel

1 note | Permalink

Updated Hotkey Script for Material Selection à la Maya Right-click Menu

So, a while ago I posted a handy hotkey script to bring up the Attribute Editor for the selected object’s material but it didn’t work properly with face-level component selections, if there were multiple materials on the mesh (this is also a problem for showShadingGroupAttrEditor). You can see the difference between the old script and the new one here (with my Venetian Snares playing in iTunes – oops):

Here’s an updated script that works well – put it in your Maya hotkeys and assign it to a key combo. The openAEWindow at the start ensures that you don’t get that weird hiccup fallback to the shape node if the AE window isn’t already open. Here’s a download link (updated to work with object and face selections):

materialEditorHotkey.mel

Put it in your scripts folder and call it from a hotkey with materialEditorHotkey; in the User hotkey text field:

imageUpdate 2: now does a select toggle for component mode, so you don’t lose your face selections when it does it’s thing.

3 notes | Permalink

Regarding Poor Windows mental ray Performance

I got a PM on CGSociety about mental ray performance on Windows and I thought I’d post it here since it’s obviously of interest to Maya users. Here it is:

I found this thread of yours [talking about mental ray in Windows performance vs. Mac OS X and Linux]: http://forums.cgsociety.org/archive/index.php/t-1058847.html I’m wondering if you were able to do anything to bring Win 7 mr rendering performance up to par with osx/linux? Basically, my studio has just built some new 24 core xeon e5 machines to replace our mac pros. By all other benchmarks these machines should be and are faster than our old mac pros, except mr rendering performance, which is actually worse. Our farm currently uses maya 2012 sp1. any ideas would be appreciated, thanks.

Here’s my response:

Unfortunately, there’s nothing you can do except switch those machines to Linux. It’s not an OS or application-level problem – it’s with the compiler used to build mental ray on Windows (MSVC) vs. the one used on OS X and Linux (gcc). I know that Autodesk is looking into it but I don’t think you’ll see this change any time soon, unfortunately.

To elaborate on this a bit, performance differences between platforms are rarely the fault of the underlying OS. It’s usually the compiler that affects speeds and, in my recent review of the HP Z820, I saw a lot of these differences due to compilers. Photoshop seems to fall into the same camp as mental ray, favouring OS X by a large margin, whereas Photozoom Pro 4 is the exact opposite:

image

I’ve been doing hardware testing and benchmarking for years, and I know what I’m doing. All the test machines were similarly configured, same scratch disks, yadda yadda.

But notice the mental ray benchmark – once you run it in Linux, the speed problems go away. V-Ray for Maya users will be happy to know that Chaos Group addressed this a while ago and switched to the Intel C++ compiler for Windows, and that performs slightly better than Linux (and presumably OS X) with their GCC-compiled V-Ray binaries. The Intel C++ compiler exists for OS X and Linux so I’m not sure what performance is like when they are all on equal footing. I’d be more interested to see how OS X performs with the clang llvm compiler, since gcc has been deprecated in OS X for a while now.

1 note | Permalink