connectNodeToAttrOverride for mia_material_x

david | dj mod, mel script, mentalray | Thursday, November 12th, 2009

When building shader networks in the hypershade window it is common to drag-and-drop one node onto some attribute of another. When you do this maya attempts to guess the type of connection you are making. If you drag a texture or a material onto a color attribute then maya will automatically connect either the .outColor or the .outValue, depending on the node type. There are other default connections for other types of attributes but if maya can't figure out what to do it opens the connection editor and leaves it for you to make the connection manually.

There is one notable case that seems to confuse people - mia_material_x and mia_material_x_passes. For example say you want to layer mia_material_x over another shader using mib_color_mix or mix8layers. If you drag-and-drop the mia_material_x onto one of the color inputs instead of connecting as you might expect, up pops the connection editor. If you've done this before then you probably know that you simply need to connect mia_material_x.result, but wouldn't it be great if maya was able to do that automatically, and skip the connection editor?

If you said "yes, that would be great" then you'll like the next bit. Back around the turn of the century, the thoughtful folks at alias provided a mel script called connectNodeToAttrOverride.mel which states

//        This procedure is provided as a hook for customers to allow
//        you to redefine the behaviour of drag and drop.

Well that's what I've done. Three lines of code was all it took! Now dragging mia_material_x and mia_material_x_passes works just like the other materials.

You can download my modified connectNodeToAttrOverride.mel from my downloads page.

djRivet.mel – added support for multi uv sets

david | animation, mel script | Tuesday, November 3rd, 2009

Several years ago I wrote a mel script called djRivet.mel that makes it easy to constrain things to deforming surfaces using follicles. Matt Oldfield, one of the TD’s at Disney Interactive, suggested that I update it to include support for multiple uv sets. It was pretty cool to hear that someone other than me finds this script useful, and being able to specify different uv sets for the textures and the follicles makes perfect sense.

You can download the update here.

maya 2010 mia_material_x bump bug fix

david | dj mod, mel script, mentalray, rendering | Thursday, October 15th, 2009

In maya 2010, if you connect a bump map to a mia_material_x shader and later change your mind and delete the bump map or break the connection, the shader will no longer render as you expect and the hypershade swatch will turn black. (more...)

poseDeformer walk-through

david | animation, mel script, tutorials | Friday, October 2nd, 2009

I was asked to write a simple getting started guide for using Michael Comet's poseDeformer, so here it is. (more...)

poseDeformer plugin compiled for maya2010-x64 win

david | animation, dj mod, mel script | Saturday, August 15th, 2009

We upgraded to maya 2010 this week so I have recompiled my 2nd favourite plugin - Michael Comet's poseDeformer. This is the windows x64 version. (x86 coming soon)

I added it to poseDeformer.rar on the Downloads Page.

Update 2 Oct 2009: Added maya2010 win32 (x86) compile to the download.

zooAttrScroller.mel Virtual Sliders

david | animation, dj mod, mel script | Tuesday, August 11th, 2009

I was rummaging around Hamish McKenzie's zooToolbox the other night and uncovered the intriguingly named zooAttrScroller.mel

I'd never noticed this one before so I opened it up in my favourite code editor, notepad++, to see what it did, and soon worked out that you use it to create a virtual slider in the viewport so that you can change selected attributes by dragging left or right with the mouse.

Yes, I know, you can already do that by selecting the attributes in the channel box and dragging in the viewport. So, whats the difference? (more...)

djFileSwitchRamp.mel & djPopulateSingleSwitch.mel

david | mel script, rendering | Sunday, June 7th, 2009

I wrote these two scripts for a job I did recently where I needed an efficient way of dynamically assigning many different fileTextures to large numbers of objects.

By "dynamically assigning" I mean that the texture assignment needed to be animateable. Initially I thought of assembling my images into a numbered file sequence and manually keyframing the image number in the fileTexture attributes so each object would get the desired image at the desired time. But each object would need to be independent in terms of  image timing and order and I could see the task of managing these image sequences would be difficult. To complicate matters further, some images were to be static while others were to be 25 fps sequences.

(more...)

miFinalGatherHide

david | mel script, mentalray, rendering | Wednesday, March 4th, 2009

About 6 months ago I wrote about using mib_continue and mip_rayswitch to stop a surface blocking final gather rays. I used this technique regularly yet often wished there was an easier way to do the same thing - and there is!

Alessandro Prodan posted a solution on cgtalk that uses a new attribute called miFinalGatherHide to control whether a surface should block final gather rays.

(more...)

djParentShape.mel

david | animation, mel script | Sunday, July 6th, 2008

I've been doing a fair amount of rigging where I use joints and empty groups as controllers. I try to minimize the need for going to the outliner to select things by adding shapeNodes to these controllers so that they can be selected directly in the viewport.

To parent a shapeNode to a different transform you need to use the command

parent -r -shape;

but often you'll get the shape jumping to a new location when it adjusts to its new parent. If that happens you can select the cv's or verts and move them to where you want them, but if you are doing this alot it can get messy and becomes time consuming. And that was the motivation for writing djParentShape.mel

With djParentShape you select the new controller object, shift-select the joint and run the script. It has two modes of operation: move to position or preserve position so you simply choose the one you need.

Download from here.

Keep reading for details... (more...)

toggle hypershade thumbnail updates

david | dj mod, mel script | Friday, July 4th, 2008

A few weeks ago I saw this thread on cgtalk where Matt Estela offered a workaround for the slowness that we experience when using the hypershade when complex shaders or shaders with large file textures are involved. The update lag seems worse if some of the new mia shaders are involved. Matt's workaround is to simply disable the thumbnail updates while you are changing attribute values and to re-enable the updates again later when its more convenient.

I spent some time modifying a maya2008 sp1 mel script called hyperShadePanel.mel to add Matt's suggested workaround to a new button. Its the one with the little green shader ball icon in the center collumn as shown here

thumbnailUpdatesToggleButton.jpg

You can use it to toggle thumbnail updates on and off. You'll get one of those purple warnings in the info window to tell you the update state has changed.

warningMessage.jpg

You can download my modified version with the button icons from my downloads page. Put hyperShadePanel.mel in your local scripts folder and the xpm files in your icons folder and you'll get the new button when you restart maya.

Download here.

I previously uploaded an earlier mod version soon after reading the cgtalk post, but the button behavior was slightly awkward. This has been corrected now, so this note is for anybody who tried it before - its better now.

Next Page »

Powered by WordPress | Based on a theme by Roy Tanck