Cinema 4D Python Binaries
Original entry at old.niklasrosenstein.com.
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}
.
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:
Example
import c4d
import numpy
def vector2numpy(v):
return numpy.array([v.x, v.y, v.z])
def numpy2vector(a):
if a.shape != (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 a.shape != (4, 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]),
)
Updates
- 2017-04-24 — Copy post to new blog
- 2017-04-23 — Update link to https://public.niklasrosenstein.com/cinema4d/python/modules
- 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