
Introduction: Many 3D artists and motion designers rely on Cinema 4D for its robust toolkit. Sometimes, you need a quick way to generate a spline with a precise shape—like a clean semi-circle—between two specific points in your scene. This short Python tag script does exactly that, automatically creating a perfectly arched spline between two Null objects named “Start_Point” and “End_Point.”
What the Script Does:
- Searches your Cinema 4D scene for two Null objects named “Start_Point” and “End_Point.”
- Calculates the midpoint and radius needed to form a perfect semi-circle that spans between these two points.
- Generates a set of points that form the semi-circle, then assigns them to the spline object that the Python Tag is attached to.
Key Highlights of the Code: • The “create_circle_spline” function:
- Calculates a crowned arc between the start and end vectors.
- Uses basic trigonometry (a square root operation) to place each vertex of the semi-circle.
- Ensures the very first and last points line up exactly with the two Null objects.
• The “main” function:
- Retrieves your active Cinema 4D document and finds the objects “Start_Point” and “End_Point.”
- Transforms their world positions into local positions relative to the spline object (the one with the Python Tag).
- Passes these positions to “create_circle_spline” to build the list of points.
- Updates the spline object’s geometry.
• The “Execute” function:
- Calls “main” each time the Python Tag is evaluated, making sure your spline updates whenever you change the scene.

Code Overview: Below is the entire script, ready to be placed in a Python Tag within your Cinema 4D project. To try it yourself, create a Spline object (e.g., a spline with no points or just a single point), add a Python Tag, then paste this code inside:
import c4d
import math
def create_circle_spline(start, end, points_count=50):
"""
Creates a single perfect semi-circle spline between two points
"""
points = []
# Calculate midpoint and get distance
midpoint = (start + end) * 0.5
direction = end - start
distance = direction.GetLength()
radius = distance * 0.5
# Create coordinate system
dir_normalized = direction.GetNormalized()
temp_up = c4d.Vector(0, 1, 0)
# Handle case where direction is parallel to up vector
if abs(dir_normalized.y) > 0.99:
temp_up = c4d.Vector(1, 0, 0)
# Create perpendicular vector for height
right = direction.Cross(temp_up).GetNormalized()
up = right.Cross(direction).GetNormalized()
for i in range(points_count):
# Create parametric value from 0 to 1
t = i / float(points_count - 1)
# Calculate horizontal position
x = -radius + (distance * t)
# Calculate vertical position (height)
y = math.sqrt(radius * radius - x * x)
# Create point
offset_x = x * dir_normalized
offset_y = y * up
point = midpoint + offset_x + offset_y
# Ensure exact start/end positions
if i == 0:
point = start
elif i == points_count - 1:
point = end
points.append(point)
return points
def main():
spline = op.GetObject()
if not spline:
return
doc = c4d.documents.GetActiveDocument()
start_null = doc.SearchObject("Start_Point")
end_null = doc.SearchObject("End_Point")
if not start_null or not end_null:
return
# Get positions in spline's local space
spline_mg = spline.GetMg()
spline_inv = ~spline_mg
start_pos = spline_inv * start_null.GetMg().off
end_pos = spline_inv * end_null.GetMg().off
# Generate points
points = create_circle_spline(start_pos, end_pos)
# Update spline
spline.ResizeObject(len(points))
spline.SetAllPoints(points)
spline.Message(c4d.MSG_UPDATE)
def Execute(tag):
main()
return True
How to Use:
- Create two Null objects and name them “Start_Point” and “End_Point.” Position them where you want your semi-circle to begin and end.
- Create or select a Spline object (preferably empty or with minimal points) in the Object Manager.
- Add a Python Tag to the Spline object.
- Paste the script above into the Python Tag.
- When you move “Start_Point” or “End_Point,” the Spline will automatically update to reflect a perfect semi-circle between these two markers.
Customization: • Points_Count (50 by default) in “create_circle_spline” can be lowered or increased to control the spline resolution.
• You can adapt the script to support different shapes by adjusting the way “x” and “y” are calculated inside the loop.
Conclusion: This script provides a neat and efficient approach to generating a perfect semi-circle spline in Cinema 4D using a Python Tag. It’s a straightforward example of combining 3D vector math with Cinema 4D’s scripting API. Have fun experimenting with the code to create more advanced shapes or to integrate it into your motion graphics pipeline!