miércoles, 31 de diciembre de 2014

Morning of pencil and paper!!

Some friend of mine critized me because my blog is called "Art & Tech" and so far there has been a lot of "Tech" and practically no "Art". And I think she's right, (God save me from disagreeing with a woman!!)

I tend to load the Tech truck more because it's interesting for me but also because I believe it's harder to master, or at least the logical part of your brain is not as involved in Art as it is in this. Those of you who know me get the idea that I don't pretend to belittle Arts. In fact I find it indispensable for my life, it's just that there are moments and moments for each and since i come from a technical background I tend to lie more often there. But I'm aware that I need to boost my art skills so here I
am!!

This morning of 31st December is a wonderful morning for drawing a little bit. I already have around 10 hours of english study with Bai & By, going in 1-2 hours of study per day rhythm I think it's ok if I'm able to sustain it through the rest of the course.

The other "homework" i had was to search for references for my models in order to do my demo reel. As of now, I'm pretty well with the results and ideas i have, though it's true I could do some more just to cover my back.

Ladies and gentlemen with great honour I present you: Anna Nicole Smith!! God bless her, life wasn't easy for her.



domingo, 28 de diciembre de 2014

Learning Maya: first polygon modeling exercise

Enough of computer science for a while here, i will be posting a modeling exercise we did in class before christmas.

I've been practising to gain speed but each time I repeated the exercise I bumped into new problems, I guess that's part of the higher learning. My teacher is quite convinced this is good, moreover he deals with the exercises in class in such a way that we will find "unexpected" problems.

From my point of view I think it's cool because it enriches the class. The easy way to go for him would be to do things straightforward but then little we would learn!

3D requires a constant practising effort because one always runs into problems we need to solve to get the job done and often there are several ways to do the same thing but not all of them are quick and when you find yourself in a rush it's fairly good to know the best way.

The exercise consists of a hard surface using Maya polygon modeling tools. It's the first and the last we have done of its genre because we needed to begin with animation and so the modeling classes were interrupted.

It's a hamster wheel done in approximately 1 h 30 min. This includes importing the image plane references and adjusting sizes to make sure the images match from the three cameras. I had a little trouble with some unexpected behaviour when converting NURBS surface to polygon when doing the "feet" that sustain the wheel. Hopefully I will get faster with practice.

Here is the image reference:


And here is the turntable i did with playblast.



By the way, I'm gathering ideas aimed at my demo reel. I have some things in mind but i need to check up on them with my teacher, as I suspect there might be any not suitable at all.

domingo, 7 de diciembre de 2014

Learning Python: Objects, Bindings And Names

As you all know, i'm currently following a course on Maya in order to become CG Generalist one day (hopefully on April/May 2015 i will land a job in the games/film industry).

Having a programming background i can't help myself learning Python to complement my skills in Maya and so, i started a couple of weeks ago to mess around with the Maya Python Command Engine and PyQt for GUIs.

Well, this last friday i received Maya Python for Games and Film which has revealed to be quite instructive. The first chapters telling the basics, one can still learn something new specially if you come from another more traditional language such as C/C++ like me.

Each time we learn a new programming language we try to find the same mechanics we found on the ones we already know as well as the new features, those that sustain the raison d'être of this new language.

Well, taking the first steps in Python that's what happened to me: as i am used to in C++ i try to figure out whether a variable in Python is a reference (&), a copy( new object) or a pointer (*).

The truth is this way of thinking does not fit well into Python. In Python one cannot think any more about "variables" but rather "names" and references and pointers become "bindings". It will make you do less errors and get less unwanted surprises when coding. I've found the following example in the web:

1
2
3
4
5
6
7
8
9
>>> dict = {'a':1,'b':2}
>>> list = dict.values()
>>> list
[1, 2]
>>> dict['a']=3
>>> list
[1, 2]
>>> dict
{'a': 3, 'b': 2}

If you store the result of dict.values(), and change the dictionary afterwards, the previously stored result remains untouched. However, if a dictionary has lists as value entries, the behavior is not the same: If you change the dict, the list you previously created via dict.values() gets automagically updated.

1
2
3
4
5
6
7
8
9
>>> dict = {'a':[1],'b':[2]}
>>> list = dict.values()
>>> list
[[1], [2]]
>>> dict['a'].append(3)
>>> dict
{'a': [1, 3], 'b': [2]}
>>> list
[[1, 3], [2]]

One would think that the same method dict.values() has different behaviour depending on the values of the dictionary. In the first case it would return a copy of the values in a list and in the second case it would return a reference/pointer. Well dismiss references, pointers and variables and think of names, bindings and objects.

EXPLANATION

I find the graphical answer explaining this on the web by Michael Hudson very illustrative and self-explanatory so i will "echo" it here in my blog just as a reminder.

Case 1. "Copy"
1
>>> dict = {'a':1,'b':2}

The above line could be illustrated as follows:

    ,------.       +-------+
    | dict |------>|+-----+|     +---+
    `------'       || "a" |+---->| 1 |
                   |+-----+|     +---+
                   |+-----+|     +---+
                   || "b" |+---->| 2 |
                   |+-----+|     +---+
                   +-------+

where "dict" is a name, all the others surrounded by +---+ are objects and ------> are bindings.

>>> list = dict.values()

    ,------.       +-------+
    | dict |------>|+-----+|             +---+
    `------'       || "a" |+------------>| 1 |
                   |+-----+|             +---+
                   |+-----+|              /\
                   || "b" |+-----.    ,---'
                   |+-----+|     |    |
                   +-------+     `----+----.
                                      |    |
    ,------.       +-----+            |    \/
    | list |------>| [0]-+------------'   +---+
    `------'       | [1]-+--------------->| 2 |
                   +-----+                +---+
Now,  this:

>>> dict['a']=3

    ,------.       +-------+
    | dict |------>|+-----+|             +---+
    `------'       || "a" |+-.           | 1 |
                   |+-----+| |           +---+
                   |+-----+| |            /\
                   || "b" |+-+---.    ,---'
                   |+-----+| |   |    |
                   +-------+ |   `----+----.
                             |        |    |
    ,------.       +-----+   |        |    \/
    | list |------>| [0]-+---+--------'   +---+
    `------'       | [1]-+---+----------->| 2 |
                   +-----+   |            +---+
                             |            +---+
                             `----------->| 3 |
                                          +---+

So list and dict yield the no surprise result:

>>> list
> [1, 2]
> >>> dict
> {'a': 3, 'b': 2}

which is fine.

Case 2. "Reference"


>>> dict = {'a':[1],'b':[2]}
    ,------.       +-------+
    | dict |------>|+-----+|     +-----+   +---+
    `------'       || "a" |+---->| [0]-+-->| 1 |
                   |+-----+|     +-----+   +---+
                   |+-----+|     +-----+   +---+
                   || "b" |+---->| [0]-+-->| 2 |
                   |+-----+|     +-----+   +---+
                   +-------+

>>> list = dict.values()
    ,------.       +-------+
    | dict |------>|+-----+|             +-----+   +---+
    `------'       || "a" |+------------>| [0]-+-->| 1 |
                   |+-----+|             +-----+   +---+
                   |+-----+|               /\
                   || "b" |+-----.    ,----'
                   |+-----+|     |    |
                   +-------+     `----+-----.
                                      |     |
    ,------.       +-----+            |     \/
    | list |------>| [0]-+------------'   +-----+   +---+
    `------'       | [1]-+--------------->| [0]-+-->| 2 |
                   +-----+                +-----+   +---+


>>> dict['a'].append(3)

                                                    +---+
    ,------.       +-------+                     ,->| 1 |
    | dict |------>|+-----+|             +-----+ |  +---+
    `------'       || "a" |+------------>| [0]-+-'
                   |+-----+|             | [1]-+-.
                   |+-----+|             +-----+ |  +---+
                   || "b" |+-----.         /\    `->| 3 |
                   |+-----+|     |    ,----'        +---+
                   +-------+     |    |
                                 `----+-----.
    ,------.       +-----+            |     \/
    | list |------>| [0]-+------------'   +-----+   +---+
    `------'       | [1]-+--------------->| [0]-+-->| 2 |
                   +-----+                +-----+   +---+

Since the list binded by the object "a" is the same binded by the first position object of "list" the above statement is changing the same "referenced" object. So we have the following correct either:


> >>> dict
> {'a': [1, 3], 'b': [2]}
> >>> list
> [[1, 3], [2]]

CONCLUSION

In a nutshell i think that python tries to avoid copying objects whenever possible and it has a reason because copying is always expensive, not to mention deep copying!! So whenever we need a copy of an object we have to explicitly request it via copy.copy().

jueves, 4 de diciembre de 2014

Different Frames In Animation And Their Mission

It's been a couple of days since we left the polygon modeling classes aside to start off the module of animation. I'm talking about the classes i'm following at CICE here in Madrid.

The teacher immediately recommended us to have a look at the known by many as the bible of animation, the book by Richard Williams "The Animator's Survival Kit". It didn't surprise me at all because it's been a long time since i've heard people talking marvellous things about that book.  In fact a couple of years ago i decided to buy it from Amazon in english. I knew there were some videos accompanying the book but couldnt find them so i decided to download them from a torrent.... Turned out to be priceless.

So here i am now, taking a look again at the book, reading the first chapters in what most closely concerns me and the classes i'm following and as i was reading how the animation process was set in the 1940s i was thinking that it might be a good idea to write a post to establish the basics and what is for me a good approach to deal with my first animation exercises and not get lost in the process. I don't know what my teacher would think of this, but since i brought it out of Williams' book i dont think this will bother him.

What ill be talking is about the different keys that exists and their importance when organizing an animation.

KEYS, EXTREMES, BREAKDOWNS & INBETWEENS

1. What is a key?

The 'key frames' are the storytelling drawings or poses (3D). The drawing or drawings that show what's happening in the shot. They are the indispensable drawings that can make the story understandable. Cut one out and the storytelling is incomplete. The keys are the first drawings to be made, they guide the action. In traditional hand-drawn animation, animators tend to put a circle around the key number to emphasize their importance.

2. Extremes

The extremes are the main drawings. The ones where there is a change in direction - the ends of the action where the direction changes. For example an arm swinging when walking or a pendulum. They usually indicate both ends of an arc.

3. Breakdowns or  passing position

It's the drawing right in the middle of two extremes. Some animators underline the breakdown or passing position because it's so important to the action. It marks the zenith of the arc and gives volume.

4. Inbetweens

Finally these are the less important drawings. They are the interpolation between extreme poses. In computer animation these frames are calculated by the computer. In traditional hand-drawn animation these are the drawings left for the assistants and junior animators because once all the keys and extremes are set it's very difficult to screw it up.

Here is a self explanatory video based on Williams' book examples: