Friday, 18 January 2013

It's amazing what you can access in the hypershade

Not found a use for this yet but someone might......

Found a way to access the tangent of the curve at a given edit point. I'm sure there might be another way but it goes to show that it is possible to access all kinds of things and by having a little play and looking at how things connect.

Draw a CV curve (quadratic)
Get a locator

Open either the node editor or the hypershade (I'll be using the node editor)

In the attribute editor turn on the Disp EP in the component display so that you can see the edit points.

If you expand the curve shape in the node editor you will only see one edit point, this is a glitch in maya. To be able to access other edit points all you need to do is connect the output of the edit point to something (such as the translate of the locator) and another one will appear. Bear in mind it will add access to another edit point each time you connect the last available edit point, even if there are not any more edit points on the curve. e.g. I have 4 edit points but when I connect something to edit point [3]; the last one. I get access to edit point [4] which doesn't exist on the curve, another glitch.

Connect the curve shape -edit point[1] to the transform of the locator. In the viewport you will see the locator is now snapped to the edit point.

Now to access the tangent at that point we need another node. In the mel script box (bottom left) type
createNode motionPath
This is the same node created if you are animating an object along a path.

 You'll need the connection editor for the next bit as the connections you need are not in the node editor.
Connect the world space of the curve shape to the geometry path of the motion path node.

Then to apply the tangent to the locator, connect the rotate from the motion path to the rotate of the locator.

In the attribute editor have a look at the motion path node.
The u-value lets you decide the tangent that you want (each edit point has a whole number value starting at 0) in my case I have my locator tied to the second edit point so I set the u value to 1. You can also use these attributes to decide which axis to point down the tangent.
If you want more than one tangent you will need a  motion path node for each one.

As I say not got a use for this but when I do I will have forgotten how I did it so thought I would throw it up here.
Final setup.

Size matters

Quick little tip to get your maya scenes to be the right size. This is particularly important if you are working between multiple software packages (such as mudbox / motion builder etc) or if you are doing dynamics.

Did you realise that the standard grid in Maya is only 12cm x 12cm. Most people seem to model with this grid and then find that when they transfer to for example mudbox that the model is tiny.

In Maya goto Display - Grid and bring up the properties.
Length and width sets how many units you will cover in the 3D viewport grid. (in your main settings you set the unit, default is cm). Increase this to 150 (i.e. 1.5m)
Set Grid lines to 50 (gives you a main division of 50cm)
Subdivisions of 5 (this divides every grid line into 10cm squares)
I also like to have the numbers on the grid.

Now when you model is it easy to work without the grid becoming tiny, so your average humanoid would be about 18 gridlines high (180cm)

Thursday, 9 February 2012

disabling mouse wheel in maya

short little tip for today. The mouse wheel to zoom/dolly in Maya is a pain in the butt. To turn it off is really simple. Just go to your preferences (bottom right corner above the script editor button) and go to
interface and down at the bottom is a little switch to turn off the mouse wheel.

or if like me you love a little MEL script the command is or:
mouse -enableScrollWheel false;

or to turn it back on:
mouse -enableScrollWheel true;

Sunday, 29 January 2012

rendering from the command prompt

The best way to render is not to have maya open at all. The problem however is that the uni machines have not been set-up for command line rendering and when you log into multiple machines maya can not find your preferences.

To sort this out we are going to create a file that runs a load of commands and then renders our scenes nice and quick.

We are using batch files (a simple text document saved with .bat or .cmd as a file type)

Copy below into a text document and save it to the x drive as myrender.cmd


REM gets all the maya commands

PATH=%PATH%;C:\Program Files\Autodesk\Maya2012\bin;

set MAYA_APP_DIR=x:\maya_temp_pref

set MAYA_PROJECT=X:\DATA\bouncing_ball

set TMPDIR=x:\temp

REM example render command (see manual for commands)

render -r mr -v 5

REM renders the next scene file (add another set MAYA_PROJECT if your other scenes are in a different project

render -r mr -v 5

Explanation of various bits:

@ECHO OFF - This stops it printing out all the commands to the console

REM - these are just comments and are ignored by the console

 PATH=... - This adds all the maya commands to the system path allowing access to them from the console
set MAYA_APP_DIR - This sets a local maya preferences (best to copy your ones from the server)
set MAYA_PROJECT - This sets the maya project you are working from
set TMPDIR=x:\temp - This sets maya's temp directory to be local rather than on the server
 render..... - This starts the render command, look it up in the help under Command line rendering to see all the options. You have access to more options than you do if you are rendering from Maya (this is a good thing)

Ok so now what??

Well to run this you need to open a command prompt. Windowskey + R then type cmd and press enter

You should be faced with a command prompt. Navigate to where you have saved your myrender.cmd file. (look up how to navigate in DOS if you don't know)

Once in the folder type .\myrender.cmd and all being well it will start.

Make sure you change the project directory to one of your project directories and the scene name to a scene you have. The really good thing about this is that you can get it to render more than one scene, as in the example above just have a second (or as many as you like) render line and once it has finished one render it will move on and do another. If the scene is in a different project you will need to set the project to the new one before the render line

This is great for setting going over night (or over a weekend).

Friday, 25 March 2011

Friday, 4 February 2011

show reels

Since I know that the third years are starting to think about showreels this one is worth a look

Ok, it is very funny and if you look at his other videos he clearly knows what he is doing but this has gone massively viral around the VFX communitiy, I have been mailed it by about 15 people. If he doesn't already have one it would not surprise me to hear he gets a job off this. Nice way to do something different