Pages

Monday 11 October 2010

Erosion! First Try

For my major project I decided to make some VFX shots, since that's the stuff I eventually want to do. I teamed up with Oddne again for the animation and modelling and we came up with a (pretty lame) story, of a chess game (told you! Pretty lame). Well, it has been done quite a few times, so the first question we got was: "What makes yours different?" Answer: "F*** knows!" I don't really care for narrative or story(not for my kind of work anyway). I just wanna make cool effects. So rather than trying to tell some sort of story, I'm just gonna concentrate on doing exactly that.
The main idea was that the chess pieces actually come to life and then destroy the other pieces. By 'come to life' I literally mean come to life, as in real-life actors shot on green screen. So now I have to figure out how the transformation from 3D chess piece to real life actor is going to work. Morphing has been done so many times as well, so I try to make something different here.
Erosion, seems like cool idea. The chess pieces erode into the shape of the actor.
TESTING!!! There isn't much to find, internet-wise, on that topic, so I have to come up with something on my own.
I first thought of booleans but that would've been a bit overkill. Displacement maps, I thought would be bit tedious, since I'd have to render everytime I wanted to check. But still It seemed worth a test... and HEY! That actually isn't that bad! Putting the map on a Nurbs plane and checking with MentalRay IPR, makes this a doable job. After playing around with different kinds of noise an turbulence materials and their settings, I found what I wanted.
This is the first test.
The plane next to it is for checking where the displacement map is taking the plane in y axis .

Now it's time to put it action.

Okay, that is kid of what I want. But there are obviously some issues. First: After a certain amount of erosion the object just morphs into a smaller version of itself. Second: How am I gonna integrate the real life footage into the eroded piece? I'm sure I could think of more, but I really don't want to.
Alright then... gotta figure some stuff out.
Laters!

Sunday 10 October 2010

My first Python script!

I'm really quite proud of myself here... ok it's only 6 lines of code, but I only started learning Python yesterday. After playing around in Maya, Houdini and RealFlow I figured I should start learning Python, since all of these programs have it embedded.
After hours of reading and playing (mainly with profanity written in script form), I thought I could start with something productive. The shatter effect in Maya is really annoying me for ages now, especially the things you have to do before you can run it. Freeze transformation, delete History by type, making sure it's not assigned to a weird shader, that doesn't sound a lot, but when you're in testing mode and Maya crashes all the time, it can become a real drag. So my idea was to just take whatever object and just click a little shelf button, that would prepare the object for the shatter effect. And here it is:

import maya.cmds as cmds

if len(cmds.ls(selection=True))<1:
cmds.confirmDialog(message='Please select an object', button='OK')

cmds.makeIdentity(apply=True)
cmds.DeleteHistory()
cmds.sets(e=True, forceElement='initialShadingGroup')

The first line loads the standard Maya commands into Python.
The second line checks whether there is an object selected, and if there isn't...
the third line brings up a dialog box that says "Please select an object".
The fourth line freezes the transformation, the fifth deletes the history and the sixth assigns the intialShaderGroup to the object.
Once the script is done and tested I copied it to the shelf, next to the Create Shatter button.

I know that the entire script is written with MEL commands, and it would've been just as easy (probably even easier) to just write it MEL, but the reason I want to learn Python is that I can use it in other software packages. I believe that if I learn Python in Maya, I automatically become better in MEL, but that wouldn't be the other way around.

That is quite an entry for a 6 line script, but it's 6:10 am and I'm full of caffeine, with literally nothing else to do.
Although I could write another script... make it 7 lines this time...