SAFINA3D

Create your first C4D plugin

The main purpose of this tutorial is to explain the process of creating Cinema 4D plugins. Object generator plugins (ObjectData) are a good starting point, as they are easy to understand and develop. This tutorial will show you how to create a 3D Torus Knot generator from scratch using Python.

It's important to note that in real-world projects, plugin creation is not always straightforward. We often go through a prototyping phase by doing a POC (proof of concept) to check the feasibility of our idea. This allows us to quickly test and only after that, we can begin developing the plugin.


The TorusKnot plugin for Cinema 4D allows you to generate splines in the shape of a torus knot. It uses the following mathematical properties to calculate the points of the spline:

  • The variable t, which defines the position of each point on the spline. This variable can range from MIN_T to MAX_T, with a T_STEP interval between each value used.
  • The radii R and r, which determine the general shape of the torus knot. R corresponds to KNOT_PARAM_R0, and r corresponds to KNOT_PARAM_R1.
  • The parameter n, which determines the number of turns of the spline. The higher this number is, the more turns the spline will have.

By using these parameters, the TorusKnot plugin allows you to generate splines in the shape of a torus knot in a simple and fast way, offering many possibilities for creating complex 3D shapes in Cinema 4D.



Some useful links