created February 10, 2003

<== Alle Maya-Befehle in diesem Buch - Alle! In Deutsch!

Basic things you should know (and maybe never dared asking).

Grundsätzliches, was Sie wissen sollten (aber vielleicht nie zu fragen wagten)

My First Expression

Meine erste Expression

Expressions in Maya are mathematical equations. They can be used in very sophisticated ways just like in real programming. Or very simply, with amazing results.

Expressions ("Ausdrücke") sind mathematische Gleichungen. In Maya kann das Schreiben solcher Expressions in harte Programmierarbeit ausarten. Aber auch winzige Expressions machen Spaß und bringen viel.

You can access the Expression Editor where you write your equations via the Window menu. However, in most cases you'll just right-mouse-click on the attribute you actually want to write an expression for.

Sie erreichen das Fenster, in dem Sie Expressions schreiben, über das Window-Menü. In den meisten Fällen werden Sie aber direkt von dem Gegenstand, den Sie mit einer Expression aufmischen wollen, in den Editor gelangen.

In our example we'll animate a simple nurbs sphere with an expression.

In the sphere's Channel Box mark the Translate X channel and click and hold the right mouse button. This opens the context menu where you find your way to the Expressions.

In unserem Beispiel animieren wir eine Nurbs-Kugel mit einer einfachen Gleichung.

Sehen Sie sich die Channel Box der Kugel an. Markieren Sie den Translate X-Kanal. Drücken Sie nun die rechte Maustaste: Das Kontextmenü zeigt Ihnen den Weg zu den Expressions.

Don't get demotivated when seeing this window popping up! The Expression Editor is easy to use.

In its middle section you see the attribute you want to create the expression for. Drag it down to the empty Expression field.

Lassen Sie sich vom Expression Editor-Fenster, das jetzt aufspringt, nicht abschrecken. Es ist einfach zu bedienen.

In der Mitte sehen Sie das Attribut, das Sie mit einer Gleichung animieren wollen. Ziehen Sie ihn, z.B. mit der mittleren Maustaste nach unten in das noch leere Expressions-Feld.

All you need to type now is

= frame

The equation tells Maya to move the sphere to the right: At frame 0 it's sitting in the origin. At frame 25 (which is one second in PAL) it's wandered 25 units to the right.

Click the Create button to activate the expression.

Ergänzen Sie den Ausdruck durch

= frame

Die Gleichung sagt Maya, dass die Kugel nach rechts bewegt werden soll, und zwar so, dass sie bei Frame 0 im Ursprung sitzt und bei Frame 25 (das ist nach einer Sekunde in PAL) 25 Einheiten nach rechts gewandert sein soll, usw.

Der Klick auf die Schaltfläche Create ("erzeugen") macht die Expression aktiv.

Playing back the animation you see the sphere move from left to right without having set a single keyframe!

Spielen Sie die Animation ab, so sehen Sie, wie die Kugel sich schön gleichmäßig nach rechts bewegt - ohne einen einzigen Keyframe!

This was your first expression in Maya. You want a second one?

Well, reopen the Expression Editor via the Channel Box and change the equation. For example you might want to do a real math thing and use the sine and cosine functions?

The first line in the expression below tells the sphere to swing endlessly to the right and to the left. The second expression tells it to swing up and down. Using "time" instead of "frame" slows the animation down. "time" counts in seconds.

Don't forget to end each line with a semicolon.

Gut, das war Ihre erste Expression.

Wenn Sie noch eine ausprobieren wollen, rufen Sie - wie zuvor - über die Channel Box den Expression Editor auf und ändern die Gleichung. Wie wär's mit bisschen richtiger Mathematik, einer Sinus- und Kosinusfunktion?

Die erste Zeile in der Abbildung unten sagt der Kugel, dass sie schön langsam ("time" zählt die Sekunden, während "frame" die Einzelbilder zählt) nach rechts und links schwingen soll. Die zweite Zeile sagt ihr, dass sie ebenso langsam nach oben und unten schwingen soll. Endlos.

Vergessen Sie nicht das Semikolon am Ende jeder Zeile.

At the bottom of the Expression Editor press Edit. Then play back the animation and enjoy the sphere circling around the origin!

You may want to change the expression one more time by multiplying the result of sin (time) by 10 and cos (time) by 2.

Klicken Sie am unteren Rand des Expression Editors den Edit-Knopf und spielen Sie die Animation ab: Die Kugel kreist nun um den Ursprung.

Wenn Sie Lust haben, multiplizieren Sie den Sinus um 10 und den Kosiuns um 2.

This widens the circle in both dimensions. But since it widens it much more in the X-direction, you'll get an elliptical movement.

Die Muliplikationen vergrößern die Umlaufbahn. Sie weiten sie jedoch stärker in Y- als in X-Richtung. Damit bewegt sich die Kugel jetzt auf einer elliptischen Bahn.


Final Note.

If you want to know more about Expressions in Maya, read the manual. It's nicely written and gives lots of examples.

A couple of years ago people were so happy about expressions that they even used them extensively in character animation. Nowadays these things are being keyframed again.

Abschlussbemerkung.

Wenn Sie mehr über Expressions wissen wollen, nutzen Sie das Handbuch (unter F1, Hilfe). Auch wenn Sie nicht sehr fit im Englischen sind, werden Ihnen die vielen Beispiele gut weiterhelfen.

Vor einigen Jahren war es schick, Expressions selbst in der Charakteranimation massiv einzusetzen. Das hat sich heute etwas gelegt. Dort sind wieder Keyframes angesagt.