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:

ZBrush Size Adjustor Plug-in Gives ZBrush a Photoshop Style Brush Size/Hardness Modifier

I was looking for a plug-in or script to overwrite ZBrush saves without prompt (still haven’t found one) and found this pretty sweet plug-in that lets you hold a single modifier to change the hardness and the brush width for brushes, Photoshop style:

Pretty great.

1 note | Permalink

Mari Me 1.1 Fixes Windows Texture Paths Issue and Adds New Stuff

Aside from the texture path bug for Windows machines that’s been fixed, I’ve been steadily adding things to Mari Me (Download) that I think will be welcome additions:

From the changelog:

  • Added ability to make scalar channels for new scenes. Extisting textures sent from Maya are always sent as gamma-correct RGB though, so if you want to change those, you’ll have to do it from Mari once it’s sent
  • Added bit depth option for channels
  • Added ability to send stuff to remote Mari host. Change the IP in the MEL file to your machine – it’s set to one of my Linux machines’ local IP. This requires that the paths be the same, so if you are sharing a Mac folder to Linux Mari host, you’ll need to mount shares to /Volumes/etc/ to mimic the paths on the Mac. It’s for this reason that there is no way to send to Windows machine from Linux or Mac because they don’t have a Unix style path structure. You could send from Win to Win but your shares would similarly have to be exactly the same path, which isn’t likely given drive letters. Microsoft needs to put a bullet in the head of those things because they are a constant issue when trying to make scripts for Windows
  • Added custom name option for created channels
  • Added Rename file nodes with filename script so it’s easier to navigate File Nodes list
  • Resized buttons because they were XBone huge
  • Fixed Windows paths for textures

Also, I’ve added a Utilities menu where I’ll start to add things that you’ll want to do inside of Maya for a workflow that involves Mari. Stuff like this UV Tile GUI to move and maximize UV shell space across UDIMs:

and I have put my AutoTileMe script in the Utils menu as well:

It now graphs the File node network at the end so you can see the structure and clearly know which to connect to your shader (the top one in the hierarchy).

Lastly, the Just Save OBJs script in the Utilities menu saves out an OBJ for selected objects to a project/GoZ folder for use with Mari (or ZBrush) with nothing sent to Mari. I’ll eventually update that to work with the smoothing and displacement options.

1 note | Permalink

Mari Me 1.0 – A Send to Mari Script for Maya

So, after tiring of Mari’s new project panel and its non-OS version of its open dialog, I decided to make a script (Download here) that sends the selected mesh from Maya to Mari for painting. It has some nice options that I think will be welcome:

The features are shown in the video here:

If you don’t choose to send an existing texture, it will create a 50% grey “color” channel that is set to the resolution of the slider, which snaps to Mari’s supported resolutions.

I added the ability to send a tessellated and displaced mesh even though I know that Mari does displacement previews but these don’t use your actual values from your existing Maya model so this script creates a mesh that is closer to what will render. It’s not the best solution since the geometry can be really jaggy but it’s better than nothing. Just make sure you only run this displacement script on cage-type geometry because it smooths the mesh and then tessellates so it will extremely slow if it’s a already high-ish res mesh.

As you can see from the video, I originally made this script to send Python to the clipboard since I didn’t see any documentation for the command port that is used by Nuke to talk to Mari but there was an example script that showed that it receives straight Python. So my script does all the gross code escaping and wraps the Python commands in a single line and passes it to Mari.

To get the script to speak to Mari, you need to make sure that Mari’s command port is open to the default port of 6100. This is in the Scripts portion of the Mari preferences.

The only limitations to the script right now are that it needs to have a relatively simple material applied to the selected mesh – it will simply fail if you have a V-Ray Blend Mat applied to it, for example – a fix for this will come soonish. You also have to have a mesh selected when you run it. Also, textures are currently sent only as RGB, with no scalar option. This will come later and I’d like to add an auto-detect for the applied texture res for the slider. Tiled mats are not supported – obviously that is a dealbreaker for many but hopefully I can get that working some time in the future. I haven’t tested it in Windows or Linux but it should work fine. The exported meshes are stored in a project_path/GoZ/ folder because I didn’t want to create a different folder for OBJs that I use with my ZBrush meshes.

Enjoy.

1 note | Permalink

V-Ray Tuner 3.6 Posted for Download

Slowly getting my brain to function after the loss of my dad and put up new V-Ray Tuner version with some features:

  • Reload All Textures: reloads all…..wait for it….. textures.
  • Polygonal Displacement Preview added to material menu.
  • Toggle Displace As Diffuse script added to Materials menu.
  • Increase viewport2 preview texture size script added to Materials menu.
  • Lowered physical camera F-stop slider min to 0.01
  • Fixed Material Swapper script. It could fail if you didn’t have displacement attached to the original material.
  • Added the ability to reapply original material to V-Ray/Maya Material Swapper script.
  • Dock Maya Render window script added to Render menu. This prevents it from popping up every time you want to just render using the VFB.
  • Apply any object’s subtexture as diffuse toggle - script added to Materials menu. This is similar to the apply displace as diffuse but populates a list from the files attached to the mesh’s shader:
I’m working on getting it to work with V-Ray Blend mats as well. Thanks go out to Andrew Hazelden for the list population code. That saved me tons of work.
  • Initial V-Ray Tuner/Refresh info that is shown in the command line feedback now includes your scene’s preview resolution.
If you enjoy using V-Ray Tuner, call your parents and tell them you love them.

5 notes | Permalink

A Script to Toggle Displacement as a Surface Shader Diffuse in Maya

If you tweak cage meshes in Maya that are to be subdivided and displaced, you end up worried about a couple things: what will happen to your seams when you do that tweak and what is the displacement going to do when applied to your tweak? As I mentioned in an earlier post, you can do a polygonal displacement preview but sometimes it is sufficient to just preview the displacement on your cage mesh in Maya. So I wrote a script that will be part of the next version of V-Ray Tuner that makes a temporary surface shader and applies the displacement map for the currently selected mesh as the diffuse colour. If you run it again, it switches back to the original shader and deletes the temp surface shader – no crap left around.

One nice feature of this script is that it uses the same file node as your material so even if you change the link to a new file you might have touched up, it will update the original shader’s displacement file node even though you are previewing the surface shader. I hope you find it useful.

Grab the script here. It works with all renderers.

5 notes | Permalink

V-Ray Tuner 3.5 Posted for Download

The latest version of V-Ray Tuner is out now. 3.5 includes some

  • Optimize button’s V-Ray dynamic memory adjustment now works automatically with versions 2014 and over. No more manual setting of RAM amount needed.
  • Added an SSS Prepass Rate Switch script to Materials menu. This dialog prompt lets you set the prepass rate for all SSS materials at once so you can dial it down to something like -1 for draft renders and then put it back up to 1 or something like that for final renders. Can save a lot of time. Just enter the negative or positive integer value and the script sets all V-Ray SSS mats at once.
  • Removed Disable Texture Filtering script from Materials menu. It turns out that disabling texture filtering will load the full resolution textures (no matter how small it is in the scene) so it can use a lot of memory needlessly.
  • Per-light exposure tweak fixed for non-VRay lights.
  • Select Z-Depth RE added to Utilities. Saves digging into render settings to adjust Z-Depth parameters.
  • Select V-Ray Sky added to Utilities. Same as above but for sky node.
  • Start/Stop IPR Render menu items added to RT menu so you can start V-Ray RT from there.
  • Render log/console script in Utilities menu now opens the vray4maya_renderlog.txt in OS X’s Console.app
  • Make Frustum script added to Utils menu. It makes a Nuke style 3D frustum for selected cameras and parents it under your camera node:
  • Split Utilities and put render stuff into a Render menu because there was too much stuff in the Utilities menu before
  • Replaced “D” displacement toggle checkbox with “PL” for prefilter light cache since it’s more commonly used.
  • Per-light render script now has a simple interface and toggle for VFB curves and levels. The “Proceed to next light” option is used to cancel renders. If you uncheck it and hit escape, it won’t proceed to the next light. This prevents hammering cancel to stop it from rendering all your lights if you want to stop the operation.

1 note | Permalink

Spotlight Relinker: A MEL Script That Uses OS X’s Search Capabilities to Relink Missing Files

A lot of people wonder why I use a Mac to do 3D. There are more 3D apps for Windows, Linux has faster OpenGL speeds than both other the OSes that Maya runs on and the hardware choices are more limited. Well, this script sums up a lot of why I use it: incredible scriptability and a bridge between GUI tools like Spotlight search and the command line. If you read my article Creating the Ultimate Creative User OS, then you know what I’m talking about. OS X has all the command line goodies of Linux but it also has its own great tools like Spotlight that has a command line equivalent built into OS X (it’s called mdfind) and it is infinitely faster than the find command in Linux distros and OS X. So, after getting tired of hunting down linked media in an old Maya scene that had links to old hard drives, moved stock image folders, etc., I made a script that uses mdfind to quickly track down the media by name, take the first result and make a MEL command file that you then drag into the Script Editor to do your relinking:

The script obviously assumes that your files are intelligently named. You’re not going to want to use this if you have a ton of different textures are all named “file.tif” but if you have unique names, this should save you a ton of time if you’re on OS X.

Anyway, without further ado, here is the script.

1 note | Permalink

MakeFrustum: a Nuke-Style Frustum Preview for Maya

Update: If you tried the script and it failed, grab it again because the previous one had a call to a “MergeVerts” function which is just a personal alias to MergeToCenter.

So, after years of having a hard time finding cameras and knowing where they are pointing, I decided to make a script that would give Maya a Nuke-style 3D camera frustum preview that is parented to the camera. It will accurately reflect what is shown in the camera according to it’s FOV/viewing angle. I’m pretty pleased with the result and I had to dig up some old trigonometry that I haven’t done in ages to calculate the face side lengths. Most of my other scripts are just tasks and variables, so to all you proper engineers – fear my grade 7 math!:

Anyway, grab the script here and run “makeFrustum;”, select a camera and go nuts. The only caveats are that it doesn’t work with vertical fitting, only the default horizontal. If you want to delete the frustum, it’s just under the object in the Outliner:

It’s templated, so that’s why it’s orange and it won’t show up in renders. In the future, I may look into making it update live but that would likely involve API stuff and Python.

0 notes | Permalink

Auto UV Tiling Script for Maya and Mari Textures

Updated: now supports vertical UDIM tiling and textures from Mudbox.

I’ve been avoiding using multiple UV tiles for a long time since the workflow can be pretty annoying and there is a lot of room for human error but, with the coming of Mari on the Mac, I have been using them finally and developed a script to handle the creation of multi-UDIM tiled textures in Maya:

Grab the script here. The hooking up of the textures is based on this post on CGSociety, where it’s shown how you can completely avoid the layered texture workflow by just daisy-chaining the out colour of one texture into the default colour slot of the next. My script then reads the filename of the texture and guesses its frame offset (U/horizontal only for now) by the number before the file extension – if it’s colordust.1003.tif, then it’s assumed it’s offset by two U tiles. It also disables UV wrapping on the 2D texture nodes. When the connections are done, the top-level texture (that needs to be connected to your shader) is selected. This workflow works with any renderer. I’ve also updated it to support vertical UDIMs:

Important: the script relies on these two standard naming conventions: filename.1031.tif (name, dot, number, dot, extension) for Mari and Material1_Flattened_Diffuse_u2_v1 (name and then tiles appended to end) for Mudbox. These are the defaults so you shouldn’t have any problems but the script won’t work if you change the dots in the Mari name or the underscores in the Mudbox one.

Just a note that renderers like V-Ray and Arnold support UDIM and Mudbox-style tiles – see V-Ray docs here but those only appear at render time. You don’t get a preview in Maya since it doesn’t recognize the filename.UDIM.tif format. Thanks to Roman Lapaev for pointing this out though.

4 notes | Permalink

My GoZ Replacement Script for Maya 2014 and beyond

Every time a new Maya version comes out, it seems that ZBrush’s GoZ script gets broken and Pixologic hasn’t released a fix for GoZ and Maya 2014. So I made a sort of GoZ-ish script that isn’t as fully-functional as the Pixologic one – it doesn’t handle creases, for example – but at least it lets you work seamlessly between 2014 and ZBrush again. Grab it here. The script works by saving out an OBJ file to your current projects folder/GoZ folder (it makes this directory for your) and then using the OS to open that file with ZBrush. Fortunately, sending from ZBrush to Maya 2014 works the same as in older versions, so this can be used for round-tripping between the two apps on OS X:


and on Windows:

On Windows, you’ll need to configure OBJ files to open with ZBrush but on the Mac it’s handled by the script so you don’t need to do this—BUT Mac users do need to set the correct version of ZBrush in the script since it’s hard-wired to ZBrush 4R6. I did this because I use GoP, my send-to-Photoshop script and that depends on OBJ ownership. In the future I might make the ZBrush version variables with a dropdown menu or do an auto-detect.

To run the script, install it in your script folder run “GoZ_2014;” – put this command for your shelf for easy access. This is what you will use from now on instead of Pixologic’s GoZ script until they fix it for 2014. But you will likely need this script again when 2015/2016/etc. breaks GoZ yet again, since GoZ actually uses the Maya ASCII format as the go-between. This solution is future proof since OBJ isn’t going anywhere and the spec isn’t going to change.

Important note: ZBrush still sends meshes back to Maya with “Visible in Reflections/Visible in Refractions” off in the mesh shape’s properties. Remember to turn these on for proper rendering. Both my V-Ray Tuner and Facer scripts have this “objFix” script in them but here it is if you want it solo.

Mac users might notice that I’m running the Mavericks GM on my OS X machine. I’ll be doing a “what works and what doesn’t” style post for 3D people looking to upgrade when it launches. And I’ll be doing a full review of the coming Mac Pro for Ars Technica, which ships with Mavericks pre-installed.

4 notes | Permalink