Thursday, February 20, 2014

Vertex CHameleon Demo



Yo I did this demo on a plugin called VERTEX CHAMELEON by Renderheads which is now free to download (didn't used to be)

I did this lecture in a second year calarts CG foundation class.

Sunday, January 6, 2013

Basics of Local Rotation Axis in Modeling

Freezing Transformations: When? Why? ect...

When you freeze an objects transformations in maya, you are essentially creating a new start point for that object, replacing all of its translation and rotation values with zero. At face value, the concept is pretty easy to swallow. 

However, there are times when this feature is helpful, and there are times when using it is a really bad idea. Learning the importance of maintaining coherent object orientation really sped up my workflow, especially in set modeling. 

BASICS OF OBJECT ORIENTATION

1. If you maintain rotations that make sense, that object will be much easier to modify later, if needed.

Lets say you have a box. 



You place this box at a random angle, and freeze its transformations. It automatically reassigns Z as forward in world space. Z no longer represents the front of the box.




Now you decide the box needs to be longer so you scale it along its Z axis... its not a box anymore. 




Since the Z axis has nothing to do with the front of the box, you can no longer simply scale the object along its axis without distorting it. In addition, sliding edge-loops, extruding, and countless other modeling techniques are much more difficult with poor orientation.

In order to fix this problem without pressing undo (you trickster), one could realign the object in top and side view to the grid and then freeze its transformations again.  More often than not, I use FT to fix an object with a weird local rotation axis.

The first, and most important thing to keep in mind in regards to your object's axis is to making sure that it agrees with the objects actual shape. That way to scale along Z, you can do so by setting your move tool to object mode, regardless of its rotation.

2. Freeze transform can be used as a "home base" for an object, so it can be pulled out of a section and worked on more easily.

If your objects placement in the scene happens to line up perfectly with the grid, it's fine to freeze its rotations. Then you can grab that object (or group) and move it elsewhere for modeling or making a quick change. Once you are done, you go into the objects translations and zero them out, it will go perfectly back into place. Its like the old school way to "isolate selected".

Even cooler though, is in the option box for FT. Often I turn off its ability to freeze my rotations. In doing so, you get the ability to freeze transformations, creating a new "home base" for that object, even if it is askew. You can pull it out and work on it elsewhere, and zero it out to send it back.

3. You can lose or fix an objects local rotation axis by modifying it on a vertex level

Often a coherent axis is lost because the shape that is being modeled is organic, and in the heat of modeling, it gets skewed on a vertex level. Keep in mind that if all verts are selected and the object is rotated, its local rotation axis will not move.

Likewise you can fix the rotation axis of an object by moving its verts in the same way.


Friday, January 4, 2013

HEAT MAP skin bind (why aren't you doing this already?!)

When binding a mesh to a rig, we used to use this thing called "heat weights" to improve the default smooth bind in maya. Its a script.

However, Maya integrated this feature into 2013, so the script is no longer needed! They call it "heat map"




Simply put, is better than the default setting in every conceivable way. It creates better deformations and is far less likely to bind to unnecessary parts of the mesh.

Turn it on and BAM! you get out of the box deformations that are often pretty decent.

here are my settings for my smooth bind on my character this year:



The boxed in area is the heat maps tab.

1. I like "dual qaurternion" skinning for my character, because he is sort of skinny. The "dual quarternion" algorithm maintains volume better than the "classic linear" method. Both methods can be useful, depending on the character. 


2. Interactive weights are a must for manageable skinning after the bind.


3. Heatmap falloff is a new attribute which appears when you select heat map. It can be tweaked for varying results. I recommend keeping the value at default, or very low for crisper deformations. 

If you dont have maya 2013, I highly recommend downloading the aforementioned script. I dont use many scripts, but I found this one to be awesome and it has saved me a ton of time.

Wednesday, January 2, 2013

LINEAR IMAGE OUTPUT (the easy way) [Rendering]

Last summer I worked at an advertising company called PETROL. They specialized in print work for video games. Almost every day I would render assets for the illustration department to paint over. They ALWAYS wanted their images to be linear, so they would have the maximum potential color and  value information to play with.

(if you arent sure what linear images are, there are some great breakdowns for linear workflow here. Basically linear workflow provides the maximum amount of RGB info, by showing a full spectrum of the color and value range, rather than "crushing" the blacks or the whites in the image.)



default diffuse pass


linearized




My supervisor showed me the quickest way to output linear images from maya for that purpose. There are other ways, but I found this way to be the easiest.

How to output a linear image from maya quickly and easily:

Once you have your lighting set up the way you want, and you have a final image in maya that you would like to output, there are 2 steps:

Step 1

In your rendering globals, under the "common" tab, check the box "enable color management"


Step 2

Open the attribute editor for the camera you are rendering with. In the "mental ray" tab, add a lens shader by clicking the checkered box next to "lens shader". I personally tend to handle image correction in post, so I use, "mia_exposure_simple", because it does everything I need, with no unnecessary attributes.



Ok, what did we just do?

We told maya to manage our color output linearly, and applied a standard gamma correction of 2.2 to the camera in order to compensate for the gamma correction maya does automatically. The image you produce will look much brighter, don't worry about that. The information for the dark image produced before gamma correction still exists. This new, brighter image has more color information and can be tweaked more dramatically in post than it could have previously.


Keep in mind that if there are textures in the scene, they will have to be gamma corrected individually. (More info here:  http://kakes3d.wordpress.com/2010/10/23/gamma-correction-for-physical-sun-and-sky/)

Monday, December 24, 2012

Pan Zoom Script [Animation]

Wouldn't it be nice if we could just zoom in and pan around in our shot cam without disturbing the camera?

One solution you might know about is Maya's Pan Zoom function:





In which case, you also know that this function sucks hard. Right. But we can build off this!


My script has two parts - in the first part, you will set a button to pan your camera view like you were holding down the spacebar in Photoshop or Flash. You need to set two different hotkey scripts to the same button, one for when the button is first pressed and one for when it's released.














The code for when it's pressed:

    global string $currentTool;
    $currentTool = `currentCtx`;
    PanZoomTool;

And when it's released:

    setToolTo $currentTool;

With this, you can hold down your hotkey and drag the mouse to around your camera view. When released, Maya automatically back to whatever tool you were using before you toggled the script.

We also want to be able to easily zoom in and out.

To zoom in, put this code on a hotkey (I used F1):

    panZoom -zoomRatio 0.9;

To zoom out, use this (I used F2):

    panZoom -zoomRatio 1.1;

To engage and disengage this function completely, all you have to do is toggle the Pan Zoom magnifying glass you see in the first image of this post.

Thursday, December 20, 2012

Copy Key Script [Animation]

This simple script I made copies your current key and pastes it onto the next key on the timeline. It replicates the 'middle mouse + drag + S' process we all hate. 



I'd recommend assigning it to an easily reached hotkey (I use 'Y').

Here's the code:

timeSliderCopyKey; //copies key
currentTime `findKeyframe -ts`; //finds next frame
timeSliderPasteKey false; //pastes onto frame

I use this script constantly when I animate. Many workflows, especially ones that involve keeping your shot in spline for most of the process, involve extensive use of copying and pasting keys to 'bookend' your pose as if it were in stepped tangents. To me, this process is too laborious to allow for the experimentation you want be doing during blocking. But with this script on a hotkey, this workflow is fast and adaptable - especially when combined with your 'select all' hotkey. And if that's not a workflow that appeals to you, this script will  probably stillprove worthy of your keyboard real estate.


If you want the code to copy a key to the previous key, here's that too:

timeSliderCopyKey;
PreviousKey;
timeSliderPasteKey false

Back to Basics: Hotkeys

Hotkeys are old news for most, but we're going to be posting a lot of scripts so you should know how to use them.


The most basic way to run a script is to copy it into your script editor and press enter:





This is okay, but often you'll want to assign a script to a hotkey on your keyboard so you can easily repeat it. Access the hotkey editor through Window > Settings/Preferences > Hotkey Editor:

 

Once you have the Hotkey Editor open, follow the following instructions to make your hotkey:




1. Scroll down to the 'User' category in the leftmost pane.
2. Click the 'New' button on the far right to make your command. Note that you don't have to assign it to a hotkey immediately.
3. Give it a good name. Or a bad one
4. Copy your command into the command field.
5. Click the accept button.
6. Assign a hotkey to your command. Type the key in the 'Key" field, choose any Control/Option/Command modifier you want, and press Assign. It will overwrite any existing hotkey applied to that key.
7. Click 'Save' on the bottom of the window.

You can also middle mouse drag the actual mel/python code of a script up to a shelf to make a little shelf button.

This stuff is dull and setting it all up at first can be intimidating. But really it's not too tricky and will be well worth your time to figure out.