So, you want to learn to do motion graphics scripting/coding and you don’t know where to start?

You’re in luck because I’m going to take the hard part out of your hands. I’ve complied a list of resources to help you get started in scripting for a variety of motion graphics applications like Cinema 4D, Maya, and After Effects.

This isn’t a tutorial, but I will be going over some basics as to what scripting/programming language each program uses, along with pointing you off into the right direction to get started so that you can create the next great plugin for your application of choice.

Let’s get started. So, what is scripting? The simple answer, is that scripting is writing code, a set of instructions, to automate a process (not make the process run), that is executed at run-time. Holy crap that’s scary! Not really… All it means is that when you write your bits of code, they work right away… or, they don’t work if you make a mistake, but hey, we are all perfect!

 

Common Scripting/Programming Languages used by 3D and 2D applications

First, let’s take a look at some of the common languages you will see when you start scripting that next great plugin. These will be related to the CORE of the language, and not applications specific; that comes next, but the basics always come first.

 

JavaScript:

JavaScript is dynamic prototype-based scripting language that is most known for being used for web browsers. There probably isn’t a website you visit that doesn’t have some sort of javascript running. Most people probably don’t even realize you can use it outside of a webpage… how sad.

Lets take a look at a quick example of some javascript

function myFunction() {
  console.log("Hello, World!");
  return true;
}
myFunction();

In this example, you get ‘Hello, World!” printed out to a console.

Javascript is the primary language for scripting in Adobe After Effects, so if you are planning on making that next great plugin for After Effects, you should learn as much as you can about it.

Here are some resources to help get you started:

Just a quick note, pretty much any tutorial you find on javascript will be related to doing websites… do them anyway. The information will translate over to After Effects, and its invaluable to learn. Swallow your pride, and do the tutorials.

 

C++ or cpp:

C++ is a vernal purpose language with imperative, object-oriented, and generic programming features. C++ is a compiled language and not a script. That means, you have to do the code, then build the code into an application container, then run it.  You can read all about it on the wiki which is linked below.

Lets take a look at a quick example of some C++

include <iostream>
int main() {
  std::count << "Hello, World!\n";
}

In this example, you get ‘Hello, World!” printed out, and then a new line is created.

C++ is used for creating plugins in Cinema 4D. I’m not sure if any other applications use it, but I would not be surprised if they did.

 

Python:

If any of you reading this know me, then you know that this is my personal favorite for doing scripting and plugins in Cinema 4D. Python is a general purpose high-level language that has a structure closer to real english, making it very easy to learn. As well as being a scripting language, it can also become a compiled language with the right modules.

Lets take a look at a quick example of some Python

say_hello = 1
if say_hello:
  print "Hello!"

Now that is a lot cleaner, and it prints “Hello!” in cause you were wondering.

Python is used by Cinema 4D, Maya, Blender, and probably other apps that I have not researched.

 

Application Specific Languages and resources

Cinema 4D:

Cinema 4D uses 3 different types of scripting languages: Python, C++, and COFFEE.

 

COFFEE:

COFFEE Script is basically a Java and JavaScript hybrid. It’s your typical object oriented curly bracket language. The wiki article says that the name  doesn’t really stand for anything and that it probably is a comic reference to Java. My thoughts? Nope. I think it refers to caffeine, and caffeine makes you crazy, and using COFFEE script makes you go crazy and want to break anything within arms reach.. at least, thats my experience with it.

Lets take a look at a quick example of some COFFEE

var a = new(array,1,1);
var b = a;
b[0] = 2;
println( "a[0] =", a[0] ); // prints "2" to the console window

Here are some resources to help get you started:

 

C++ or cpp:

C++ has been the primary language for writing plugins for who knows how long; probably since Michelangelo painted naked dudes on that ceiling. Similar to what I’m going to say about python, with c++ it’s all about using the API. Download it, study it, build a shrine to it, and whisper sweet nothings onto it.

Here are some resources for you to get started with c++ in Cinema 4D:

 

Python:

Python is the up-and-comer for plugins in Cinema 4D. I say that, but really, Python has been around since version 12 of the software. It’s not that new. It started out as a plugin but Maxon saw the potential and quickly adopted it into the application. Just like C++, this is all about learning the Cinema 4D API and studying the Python SDK. Now, I love Maxon, and I love Cinema 4D, but I have to warn you on this… The SDK for Python in Cinema 4D sucks so bad! It’s horribly documented and for a person with no coding experience it’s like trying to read rocket science papers. The good thing though, is there are more resources and more tutorials for Python in Cinema 4D than all the other languages it uses, so making sense of this is super easy.

Here are some to help you get started with Python in Cinema 4D:

 

All Languages:

Here are some resources pertaining to all the languages Cinema 4D uses:

 

 

Maya:

Maya uses two languages, Python and its proprietary MEL script.

 

MEL:

 

Python:

 

 

3D Studio Max MAXscript

3D Studio Max uses something called MAXscript for its scripting language. From what I know, it needs to die in a fire, but it is what it is. If you love using 3DSMAX then these resources are you. I’ve looked at some code examples, and it doesn’t seem too difficult to grasp, so you should lots of fun with it.

 

 

Blender

Blender is a free open-source 3D application. Being a Cinema 4D user, I never got into blender, but I have always wanted to give it a try. I mean, who doesn’t like free stuff right! One of the best parts about Blender being free and open-source is that there are a TON of awesome resources for it. I started learning Python by dissecting some of the open-source Blender scripts, so do not under estimate this software. There is a huge community around Blender, and you should take full advantage of that when trying to learn Python for Blender. The only thing Blender doesn’t do is make tasty smoothies, which is a bit disappointing for me.

Here are some to help you get started with Python in Blender:

 

 

Adobe After Effects

After Effects is a little different in terms of scripting/expressions. Here, you are dealing with Javascript. As mentioned in the start of this article, most of the tutorials you are going to find for JavaScript are going to be dealing with creating things for web pages, but you should do those tutorial the best you can because the javascript knowledge is transferable to AE. My best advice here, is to print out The After Effects Object Model and tape it to the wall directly in front of you; it’s invaluable.

One thing I will touch on here is the difference between After Effects scripting and After Effects expressions. Now, this is my take on the two, and is probably not the official definition of the difference, but a script is called and runs 1 time (or however many times the script is written to run) and an expression is something that is in your timeline and runs all the time. So, script is an outside file, expression is in your timeline. Dylan Winter, who will be linked to shortly, had a great definition, “Expressions will make you a king of your workflow, scripts will make you a god.” Bingo to that my friend.

Here are some to help you get started with Expressions in After Effects:

Here are some to help you get started with Scripting in After Effects:

 

 

 

General Resources and places to find help

Twitter

The motion graphics community is a great place to get help, and twitter is where you will get it the fastest (in my opinion)

You should seek these people out if you need some guidance!

 

Search Engines and video sites!

Nothing beats a good old fashioned search query.