Topics by tag:
Recently published articles by Dave G:
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.
3 notes | Permalink
The latest version of V-Ray Tuner is out now. 3.5 includes some
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.
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
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
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
I just make a quick MEL script to export all separate selected meshes from Maya to individual OBJs so I could use them for sketches in Meshlab on my iPad. I thought I’d share it. Just change the path “/Users/beige/Desktop/objs/” to a preexisting path on your machine and it will create a numbered sequence of files. Here’s a link to the script.
2 notes | Permalink
If you want to run another instance of any program on OS X, you have to do it from the terminal with the “open -n” command. I have an alias in .bashrc that will do this for Maya 2014:
alias 2014=’open -n /Applications/Autodesk/maya2014/Maya.app’
So, when I type “2014” in the terminal, it opens another instance if Maya is already running. But, since I tend to run both older versions on occasion alongside betas, I thought I’d make something a little more flexible with an input launch whatever version. So I made an Automator service to launch another instance with a prompt for the version you want to launch:
Download the Automator Service here. If you want to change the default version in the text input field, just open it in Automator and change it yourself. Future proof.
I like incremental saves but one thing I don’t like about Maya’s incremental save is that your renders still comes out with the basename of the original file. Instead of file01.exr, you get file.exr for all increments. I like to keep my older renders around to see the progress or potentially roll back to a previous iteration so I wrote a new incremental save that increases the end number by 1 and saves that new file. Download this script and use it any time you want a new incremental save with a higher number and any new renders will have the number appended to the name.
Important: the script assumes that your file name has no extra periods in it and that the two end numbers are the only numerals in the name – for example: dabbiedoobie03.ma or Gabbie_Googoo_24.mb are fine.
2 notes | Permalink
I am just moving my work to a new Lacie 2big Thunderbolt enclosure and wanted to save myself annoying task of migrating all my existing work to link to the new disk in place of my old one. There are nice utilities like FileTextureManager for Maya and Nuke has a find/replace that do this on a per-scene basis but this seemed slow since I would be doing the exact same replacement for all future files.
So I made an Automator workflow that reads plain text files and substitutes my “dullard/WORK_mbp” path in the file with “lackey/WORK” and then creates a new file next to the old one so nothing is clobbered. Since Maya ASCII and Nuke files are plain text, the script can use the Unix utils awk and sed as if it were just working on a big (and quite boring) essay.
See it in action:
Grab the Automator workflow here. Obviously, you’ll need to edit the workflow in Automator to substitute your paths instead of mine:
The text between the % are the find and replace terms. The script doesn’t overwrite any files but just for the sake of legalese, it comes with no guarantees.
0 notes | Permalink