Python Binaries for Cinema 4D

You can find a bunch of binary distributions of popular Python modules on my public folder. These are compiled to be working with Cinema 4D. Keep in mind that Cinema 4D R17+ embeds CPython 2.7 so you’ll need py2.7 named binaries instead of py2.6. The packages can be installed to your Cinema 4D preferences under library/python/packages/{os}.

Download: https://public.niklasrosenstein.com/cinema4d/python/modules/

Disclaimer

The binary packages are provided as-is. There might be missing distributions for specific versions or platforms. Topics on the PluginCafe that might interest you regarding third party modules:

Updates

  • 2017-01-19 — Update link to https://public.niklasrosenstein.com/software/python-prebuilt-modules/
  • 2016-03-26 — Update link to https://public.niklasrosenstein.com/PythonBinaries
  • 2016-01-22 — Add numpy-1.10.4/numpy-1.10.4-py2.7-win-vs090.zip
  • 2015-05-02 — Add numpy 1.9.1/19.2 py2.6 for Mac OS
  • 2015-05-22 — Add numpy 1.9.2-py2.6 for Windows
  • 2015-05-22 — Removed .pyc files from numpy 1.9.1-py2.7 Windows archive
  • 2015-05-22 — Added scipy 0.15.1-py.26 for Mac OS (couldn’t get it compiled on Windows)
  • 2015-05-22 — Added Cython 0.22-py.26 for Windows and Mac OS
  • 2015-04-27 — Added numpy 1.9.1-py2.6 for Windows

Example

Here’s a quick getting started snippet for NumPy and Cinema 4D.

import c4d
import numpy

def vector2numpy(v):
    return numpy.array([v.x, v.y, v.z])

def numpy2vector(a):
    if len(a) != 3:
        raise ValueError('not a 3x1 array')
    return c4d.Vector(a[0], a[1], a[2])

def matrix2numpy(m):
    v0, v1, v2, v3 = m.off, m.v1, m.v2, m.v3
    return numpy.array([
        [1, 0, 0, 0],
        [v0.x, v1.x, v2.x, v3.x],
        [v0.z, v1.y, v2.y, v3.y],
        [v0.y, v1.z, v2.z, v3.z],
    ])

def numpy2matrix(a):
    if len(a) != 4 or len(a[0]) != 4:
        raise ValueError('not a 4x4 array')
    return c4d.Matrix(
        c4d.Vector(a[1][0], a[2][0], a[3][0]),
        c4d.Vector(a[1][1], a[2][1], a[3][1]),
        c4d.Vector(a[1][2], a[2][2], a[3][2]),
        c4d.Vector(a[1][3], a[2][3], a[3][3]),
    )

3 thoughts on “Python Binaries for Cinema 4D

  1. Hello Niklas
    Thank you for compiled modules, py2.6

    Have you try to compile scipy scipy-0.16.0 for py2.7(based at vc11) and vs2012?
    I tried, got several fatals errors

    Thanks
    Ilay

    • Hi Ilay, no I haven’t tried to compile any of these packages for Python 2.7 yet. I couldn’t even get SciPy compiled for Windows and Python 2.6. 🙁

  2. Yeah, some steps from maxon broke work-flow, let’s live with it.
    I compile numpy(without mkl) with errors and it still works. And several cython extensions also work.
    I will try to ask my friend, he works at university and have access to many tools for compillation.

Leave a Comment