time to learn python

no matter which 3d package you’re working with – it’s high time to get your hands dirty with python. while packages like blender, xsi and maya support this language natively, i’m pretty sure 3ds max will follow very soon, especially when it comes down interconnecting different packages. if you already want to start using python in 3ds max, read the following cg-talk thread, or check out this topic on area. adam pletchers comment sums it up:

  • python is a mature, full-featured language and provides a lot of useful functionality that’s simply not there in maxscript.
  • python isn’t bound to a specific 3d application. this allows us to create tools that have very little app-specific code, making them much easier to deploy for multiple 3d applications (max, maya, etc.).
  • we’re using python as the embedded tools scripting language in our next-gen editor tools.
  • python is just fast and fun to program with.

so, let’s have some fun! :-)

Posted in General | Tagged | 2 Comments

automatic script sourcing on maya launch

if you have extended your maya with several mel scripts (if not, you certainly will one day!), it’s useful to source those automatically when launching maya, so you can access them right ahead instead of manually sourcing them whenever you need one or the other.

the best way to do this is by creating an empty text file called userSetup.mel within your personal scripts folder (usually c:\users\[yourusername]\documents\maya\2008\prefs\scripts) and add this:

source "nicescript.mel" ;

just copy the line and add further script file names to it and next time you start maya, all those scripts are ready to go!

Posted in Maya, Plug-ins & Scripts, Tricks | Tagged , | 2 Comments

Target Weld Function In Maya

I was pretty surprised that Maya doesn’t offer the target weld function I was used to in 3ds Max, since this is a pretty basic feature for modelling. Luckily there’s a fine script extending Maya with exactly this functionality. It took me a minute to figure out how to use it:

Go to component mode of your object, select a vertex and type in targetWeld in the MEL command line, select your destination vertex, done. You certainly want to add this script to a hotkey to speed up your modelling workflow.

Posted in Maya, Tricks | Tagged , | 3 Comments

base your pivot

another little script that extends my personal collection of mel scripts i have permanently installed: base pivot. it centers and drops the pivot point of the selected object(s) to the bottom. works perfectly stable; worth adding to a hotkey or the shelf as i’m going to use this function on a daily base! or you can just call it by entering basePivot in the mel command line.

Posted in Maya, Plug-ins & Scripts | Tagged , | Leave a comment

openexr rocks!

since i’ve tested some workflows for the post production of my upcoming short “border”, i came across the awesome openexr format. you can just save all your passes right into this image format and access them in post, if your software supports it. i experimented a little using photoshop and after effects in combination with the fabulous proexr plug-in, which also offers a nice add-on to automate the creation of the composition layers in after effects. check out the manufacturer’s manual, it’s worth reading it; also to learn more about this image file format in more depth.

Posted in Post Production | Tagged | Leave a comment

renderman and the command line

i had to collect the renderman attributes i can access through the maya command line renderer in order to automate my rendering process using a batch file; it was like putting the pieces of a puzzle together, since the documentation doesn’t cover this topic in much detail. it was a little bit frustrating that some global attributes are access in a standard way and some not: a good example is the width and height of the output file. well, here is what i put together:

  • usually you set -x [width in pixels] and -y [height in pixels], but if you use renderman (-r rman) you have to set the output dimensions with -setAttribute Format:resolution “[width] [height]”.
  • motion blur can be turned on/ off with -setAttr motionBlur 1.
  • set the pixels samples with -setAttr PixelSamples “[value 1] [value 2]”.
  • the shading rate is set by using -setAttr ShadingRate [value].
  • the possible output formats (-of) are: Alias, Cineon, It, MayaIFF, OpenEXR, SGI8, SGI16, SoftImage, Targa, Tiff8, Tiff16, Tiff32.

these are the most important ones, i’ll edit this article as soon as i discover more interesting attributes that can be set through the command line (which are not already covered by the standard parameters). i dream of having all renderman attributes covered one day.

Posted in Maya, Rendering, Tricks | Tagged , , , | Leave a comment

occlusion pass with renderman

i was struggeling lately with renderman to get a nice occlusion pass rendered out separately. here are my exploration’s notes:

  • the most recent version (2.0.1) can not render out a separate pass without generating the final render pass at the same time. let’s hope this feature will be added to the next version, as this could save a lot of render time.
  • the -rp (render pass) option is not supported in command line rendering yet. you have to set that in your maya scene directly. another thing that i’d love to see in the next version…
  • you can render out a pass called occlusiondirect‘ which has to be inverted in post.
  • you must have the object’s reflection turned on (attributes > render stats > visible in reflection) it will not occlude itself. you’ll end up with a pass that looks very bright and with nearly no occlusion.
  • if you want to have a shader-based ambient occlusion without the env light, you must write your own ambient occlusion shader. an employee at pixar created one and offers it in the support forums. there’s also one great tutorial written by michael fessenden how to write and use an occlusion shader.
  • you can fake ambient occlusion by creating a white lambert shader and diffusion set to 1. in combination with a renderlayer and a material override results can be good.
  • point-based ambient occlusion offers the best quality (goodbye to grainy shadows); you can get this one by going to the bake entry field in the env light settings, right-click and select create renderradiosity.

i like the shader-based approach most because it renders fast and can be used in combination with a render layer thus can be accessed through command line rendering.

Posted in Maya, Rendering | Tagged , , | Leave a comment

animator’s survival kit

i don’t have many books on my shelf that can stay there for a long time because they’re usually outdated very quickly as 3d software update cycle speeds are increasing more and more. but there are exceptions, one book that accompanied me during my digital character animation studies here at the vancouver film school: animator’s survival kit. simply said it’s the book to buy if you start your animator’s career and you’ll open the book all the time while working. it doesn’t go into any software or 3d animation at all, but the major part of the principles explained in 2d can be easily transferred to 3d. that said, the reading is fun, too and all the examples are inspiring. the author of the book is triple oscar winner richard williams who worked on ‘who framed roger rabbit’ as director of animation. i recently discovered that you can now buy a dvd version of the book with all the samples animated, wow!

Posted in Books, General | Tagged , | Leave a comment

versatile maya outliner

some love the hypergraph, some the outliner in maya to access nodes, objects etc. i think both have their specific use and after using hypergraph for the longest time to do just everything, i recently discovered two neat features which made me open up the outliner window much more often when i got more used to maya (6 months of experience now). the first one is that if you select an object in the viewport, switch to the outliner window and hit ‘f’, the outliner will set its focus to the object, opening up the tree structure. the second fine thing is that you can drag the bar located at the bottom of the window up and you’ll have a split window with 2 independent tree structures. very useful when you have a deeply nested structure and want to to keep two locations open at the same time.

Posted in Maya, Tricks | Tagged , | 1 Comment

compile your shader for renderman

i’m digging deeper into renderman and i started to create my own little shaders, first i had to get the shader compiler running, before i develop my own creations. this post will explain you how to easily compile a shader for renderman and use it within maya, since the documentation doesn’t offer a clear step-by-step tutorial.

to create a renderman shader you don’t need anything fancy, just notepad and renderman installed on your system. instead of notepad, you may also give cutter a try, which allows you to write renderman shaders in a more convenient way. but let’s stick to the standard stuff for now.

first, you need to set some path variables, so the shader compiler command “shader” will run from your command prompt: access the system environment variables (on vista: right-click on the desktop icon ‘computer’ > properties, advanced system settings > advanced > environment variables…). here, scroll down to path in the system variables listing end click on edit…, scroll to the end of the line and add:

C:\Program Files\Pixar\RenderManForMaya2008-2.0.1\rmantree\bin;C:\Program Files\Pixar\RenderManForMaya2008-2.0.1\etc;

change the path or version according to your setup, assure that the entry is enclosed by semicolons. you now can create whatever shader you want in notepad, save it with a .sl suffix and compile it within the command prompt (run… > cmd):

shader myshader.sl

this will create a file called myshader.slo in the same folder which you can load when you create a renderman shader in maya and point to this slo file. one little trick is that you can create a shortcut of the command prompt within your shader folder, so when you double-click it, the command prompt will start within this directory, so you don’t have to point to the .sl file’s directory any more; very useful.

i’d love to try out slim, which allows you create shaders in a visual way without any line of code and is tightly integrated into maya, but it’s only part of the ‘pro’ version of pixar’s renderman for maya, maybe i’ll have to check my budget again (good news, they finally have educational pricing for students available now!).

Posted in Maya, Rendering | Tagged , , , , , | 1 Comment