Page Contents

 

Other Articles

Updates

Search

 

Scripting with Python and Xpresso

Scripting offers a way to extend Cinema 4D programmatically. Cinema 4D offers its own C.O.F.F.E.E. script language, as well as a complete Python API. C.O.F.F.E.E. is faster and supported in CINEMA 4D Lite, but the Python API is tremendously more powerful and industry standard. Most developers focus on the Python API unless C4D Lite compatibility is important. Cinema 4D also has a complete C++ API for advanced plugin development.

Quickstart

     

Cineversity offers several video tutorials and code snippets to help you get started.

  1. Add to playlist.

    Introduction to Python in C4D

    Learn the basics of scripting using Cinema 4D’s Python API, including essential syntax, object creation and adjusting object position and other attributes. 

  2. Add to playlist.

    Python Scripting

    Build a custom layout for Python scripting, create a simple script to zero an object’s coordinates, and learn how to prepare Python scripts for distribution.

  3.       Internal link.
         

    Cineversity Wiki :: Scripting

    Reference the Cineversity Wiki for focused information and script examples on many key topics related to scripting and plugin development.

 

Trade Show Presentations

     

Searching for a little inspiration? These presentations from industry pros will show you amazing visuals you can create using simple python code.

  1. Add to playlist.

    Cinema 4D Python Scripting - NAB 2015 Rewind

    In this double-shot of Cinema 4D scripting presentations Colin Sebestyen and Mike Senften show how they use the Cinema 4D Python SDK to create beautiful generative art. They cover L-Systems, the Python Effector, and ways of applying concepts from The Art of Code.

Projects

     

Now that you’ve got a basic grounding in Cinema 4D’s Python SDK and some sense of the possibilities, it’s time to start coding useful projects!

  1. Add to playlist.

    Creating a Custom Python Effector

    Use Python to build a custom MoGraph Effector, and gain an understanding of the MoGraph API as well as conditions, looping and reading UserData.

  2. Add to playlist.

    Python Export OBJ Sequence

    Learn the fundamentals of scripting with loops and animation, exporting and communicating status while creating a script to export sequenced OBJ files.

  3. Add to playlist.

    XpressoMaker

    Discover how to manipulate Xpresso through Python scripting, creating and connecting nodes for UserData and PoseMorph. This tutorial provides an in-depth look at the scripting process, the graphview (Xpresso) API, and building recursive functions.

 

Official Maxon Sources

     

Learn more at these official Maxon sources for developer information.

  1.       External link.      

    PluginCafe

    Reference and download Cinema 4D’s COFFEE, Python and C++ API documentation, ask questions and search for answers in the developer support forums and obtain plugin ids.

  2.       External link.
         

    PluginCafe GitHub Repository

    Explore Maxon’s official open-source repository for SDK samples.

 

Third-party Reference

     

Some excellent third-party sites with reference information about Cinema 4D development.

  1.       External link.      

    C4D Connect

    A complete reference of all description constants (Object, Material and Tag Attributes), with automatically generated code samples showing how to modify each attribute. 

  2.       External link.
         

    C4D Programming Blog

    A blog maintained by Cinema 4D developers addressing key plugin development topics. More geared towards C++ than Python development, but still a valuable resource.

  3.       External link.
         

    Smart-Page.net

    Provides excellent articles and best practices for developing Python plugins in Cinema 4D. 

  4.       External link.
         

    Per-Anders Third-Party Wiki

    Includes many Python and COFFEE code snippets.

 

Third-Party Tutorials

     

Video tutorials by community contributors introducing Python scripting and development.

  1.       External link.      

    Chicago C4D Intro to Python

    Jack Bransfield introduces Python scripting with a tutorial that grabs tweets via Twitter’s API and inserts them into MoText.

  2.       External link.
         

    908video The Python SDK and plugins

    Michael Auerswald introduces Python development concepts for Cinema 4D.