An even tinier update

Well, this place sure has been quiet for the last few months. Might have something to do with having a 14 month old son coupled with working on Thor.

Recently I’ve mostly been making some handy tools for Maya. One thing I learned is that if you playblast from maya using the x264 codec you simply need to remux the file and package it in an mp4 container and then you got yourself a nice quicktime-playing h264 playblast. Very handy stuff.

Busy times. Who knows when i’ll post something again. The supsense is probably unbearable.

As always you can catch my slighly more frequent posts on twitter.

Add 360 to keyframe values

Here’s a little mel snippet that I found occasionally useful while animating, all these commands do is add (or subtract) 360 from a keyframe value – which is perfect for those rotational values that need to come down (or go up).

Anyway, to add 360 degrees:

keyframe -e -r -vc 360;

Subtract 360 degrees:

keyframe -e -r -vc -360;

I’ve found this useful in certain cases (gimbal lock?). And hopefully someone can find this useful as well.

Maya scripts

While I was making friends? I wrote some useful maya scripts that did all sorts of tedious things (like creating 100 bend deformers and controlling them with one control and a dash of randomness). I’ve decided to put some of those scripts online and you can find them on the new Maya scripts page ( there only two there right now ).

Some of those scripts are written in Python, some in Mel, although I do like Python way more then Mel (somehow using backticks as an integral part of a programming language doesn’t strike me as a good idea).

Maya’s built-in calculator (sort of)

Just a little Maya tip here if you have Maya 8.5 or later.

If you need to make some calculations and don’t want to go find your calculator of choice you can use Maya to calculate stuff for you. First, make sure you have python active in the command line (bottom left text field).



If it says MEL, just click it and it should switch to Python



Then you just type in what you want calculated, for example if you type in “4+4″ and then hit control-enter, then the results pops up in the command response window. Easy.

 

IMPORTANT NOTE
To use Python as your calculator you have to remember that if you are using division remember to type the number you want to divide as a decimal number (like 5.0 instead of 5) otherwise you’ll get a rounded down result. 5/2 gives you 2 and 5.0/2 gives you 2.5. This obviously doesn’t matter if you are adding, multiplying or subtracting.

sjtNotes v1

Well, it’s been pretty quiet around here for the last couple of weeks (months?) but now something happens; a new mel script.

sjtNotes is a supersimple script that simply allows you to have some notes inside your scene that are saved along with your scene file. The script is ridiculously simple and opens this window:

sjtNotes

Then you type your notes and hit “Save & close” and then run the script again and edit those notes and again save and close. You get the drift …

Anyway, here’s the link to this awesome script:

sjtNotes v1

If there is anything wrong with this script or you actually can use this then please let me know.

In other news I’m just busy working on my demo reel at VFS mostly spending my time rigging and learning stuff about maya that I didn’t know, like the deformation order, which I like a lot and has saved my ass on one occasion. Oh, and I’m dabbling with RenderMan, it. is. awesome. (so far at least).

Match translation “tool” for Maya

For those who have used XSI for anything have most likely encountered the very useful “Match translation” tool (and it’s variants). This tool exists in Maya but according to some it doesn’t work very well especially when within a hierarchy. So a solution was to constrain the object you want to move to the object that we want to match the translation to and then, in the outliner, delete the constraint.

This obviously is very tedious especially if you want to this many times. So I decided to try creating my first mel scripts and created a set of scripts in a custom shelf that do this automatically. Here is the “Match translation” script:

string $nodes[];
$nodes = `selectedNodes`;
pointConstraint -name tmpconstraint -offset 0 0 0 -weight 1;
select -r tmpconstraint;
delete;
select $nodes[size($nodes)-1];

 

This script simply automates the steps listed above and the other variants (translation+orientation, orientation, scale) all work in almost the same way.

These scripts work like this: you first pick the object that you want to match the translation to and second select the object you want to move and then hit one of the shelf buttons. Simple right?

I like to use these script as marking menus and on that note I was thinking about creating a tutorial that shows how to add custom marking menus, since I guess that some people simply don’t know how to do that (but many of you do). That tutorial will hopefully be up soon.

Anyway, you can find the script here and to install it you simply place it in
 
/Users//Library/Preferences/Autodesk/maya/8.5/prefs/shelves (on a mac)
 
and I can’t remember where to place it on other platforms.

©2007, Sveinbjörn J. Tryggvason | RSS | Comments-RSS