Skip to content
You Start with one site
Amounts in Start with one site
Mechanical Engineering & Design · Course

FreeCAD to Blender: Render and Animate Your CAD Model

Lesson 10 of 10 40 min read
Made with FreeCAD 1.1, Blender 5.3checked November 2026Newer version?
FreeCAD
Stays the same
  • Sketches, constraints and degrees of freedom
  • Design intent: spreadsheet, sketch, feature, assembly
  • Part Design features: pad, pocket, revolve, fillet
  • Drawings from the model, not drawn by hand
May look different
  • Menu and toolbar places
  • The Assembly workbench, new in 1.0 and growing fast
  • Dialog layouts and default settings

A step looks different? Hover the toolbars, or use the menu of the workbench named in the step. The command name is the part that stays.

Blender
Stays the same
  • A GLB keeps part names, colours and the assembly
  • Materials as base colour, metallic and roughness
  • A key light, a fill light and a rim light, aimed at one point
  • A loop is frames, then a video
May look different
  • Menu places and panel names
  • The Python API for actions and keyframes (Blender 5 keeps curves in layers)
  • Video output settings

A step looks different? Press F3 and type the command name; the search finds it wherever the menu has moved it.

The ideas in this lesson do not depend on the version. Where a click moved, the lesson still names the command.

Found this useful?

You have a model that works. The joints close, nothing collides, the drawing is ready. Then you show it to a client, a teacher or a buyer, and they see grey shapes on a grid. They cannot picture the machine, so they cannot say yes to it. This lesson takes the slider crank you built earlier in this course into Blender and gives it back as a clean picture and a short loop of the machine turning, true to every size in the model.

#FreeCAD #Blender #Rendering

The loop you will make: the crank turns once, the rod and the slider follow the slider-crank equations. Every part is where FreeCAD's assembly puts it.

What you will make

One still and two loops of the slider crank: crank radius 30 mm, rod 100 mm, a 60 mm stroke. The model stays in FreeCAD; Blender only shows it. You change nothing in Blender that the model does not say.

FromFreeCAD 1.1, one GLB file
ToBlender 5.3, Cycles
Parts8, names and colours kept
Still1280 × 720, 64 samples
Loops72 frames, 3 s, mp4
Motionfrom x = r cos θ + √(L² − r² sin² θ)

Coming here first?

You can do this lesson alone. It assumes three things:

What you need

  • FreeCAD 1.1 and Blender 5.3, both from their own websites, on Windows, macOS or Linux. Every script below was run in FreeCAD 1.1.4 and Blender 5.3.0 (November 2026), and the clicks are named for those versions.
  • A mouse with a wheel. A normal laptop is enough: the settings below give a frame in under 20 seconds on 4 CPU threads, and the still in about a minute.

The whole way, once

Seven steps, each with a check. Each step gives the clicks first and then the same work as a few lines of Python, so that the second machine you show takes one command.

  1. Move1 Export a GLB2 Import it
  2. Dress3 Materials4 Light, camera
  3. Show5 The still
  4. Turn6 Two loops7 The video

Step 1: export the assembly as a GLB

Blender cannot open a FreeCAD file, so the model travels in a file both can read. Choose the one that keeps what you worked for.

KeepsGLB (glTF 2.0)STL
Part namesyes, one object a partno: one nameless mesh
Coloursyesno
The assemblyyes: every part in place, under one parentonly as one lump, or one file a part
Unitsalways metresnone: the reader guesses, often 1000 times wrong
  1. Open SliderCrank.FCStd. In the tree, check that Assembly and its eight parts are shown: a hidden object is left out of the export. Select it and press Space to show it.
  2. Give each body its colour: FreeCAD 1.1 right-click the body in the tree, Appearance..., then the colour. Crank teal, rod gold, slider bronze, pins light grey, base and guide grey.
  3. Select Assembly in the tree. FreeCAD 1.1 File > Export, type glTF (*.gltf *.glb), name SliderCrank-render.glb.

The same three steps as a script: open the model, then paste export_glb.py into View > Panels > Python console. It shows the parts, sets the colours from one table and writes the GLB next to the FCStd.

COLOUR = {'Crank': (0.16, 0.55, 0.53), 'ConnectingRod': (0.80, 0.62, 0.20), 'Slider': (0.72, 0.52, 0.30), ...}
asm = doc.getObject('Assembly')
for lk in [o for o in asm.Group if o.TypeId == 'App::Link']:
    lk.Visibility = True
    lk.LinkedObject.ViewObject.ShapeColor = COLOUR[lk.LinkedObject.Name]
ImportGui.export([asm], 'SliderCrank-render.glb')
The glTF export needs the FreeCAD window. It lives in ImportGui. Run from freecad.cmd with no window, Import.export writes a GLB with no parts in it, and says nothing. To export without a screen, run the full FreeCAD on a hidden screen: QT_QPA_PLATFORM=offscreen freecad export_glb.py.

Check: the file is about 540 KB. A GLB of a few hundred bytes is empty: the parts were hidden, or the export ran without the window.

Before you open Blender, look inside the file. Below is the GLB from this step: open Parts and you should see the eight names from the assembly. Your own file opens the same way in the 3D viewer, and stays on your computer.

The exported slider crank, eight parts, in FreeCAD's colours. Drag to turn, pinch or scroll to zoom. Open in the full viewer.

Step 2: import it in Blender, and check the size

  1. Open Blender 5.3, General. Select the cube, the light and the camera of the new scene and delete them (X).
  2. Blender 5.3 File > Import > glTF 2.0 (.glb/.gltf), choose SliderCrank-render.glb, keep the default options.
  3. Press N for the sidebar, tab Item. Click the base.
The slider crank straight after import, with only the colours set in FreeCAD: a grey base and guide, a teal crank, a gold rod, a bronze slider and light grey pins, all with the same plain finish.
Straight from the GLB, with FreeCAD's colours only. Right in size and place, but every part has the same plain finish.

Check: the Outliner (top right) shows one Empty, Assembly, with eight parts under it: Base001, Guide001, PivotPin001, Crank001, CrankPin001, ConnectingRod001, Slider001, WristPin001. The base's Dimensions read 0.215 m × 0.08 m × 0.022 m: 215 × 80 × 22 mm, the size in the slider-crank lesson. The crank sits at 30°, as the model was saved.

Step 3: materials, from the item list

Do not choose a finish by taste. The slider-crank drawing has an item list that says what each part is made of; the picture must say the same. Blender's Principled BSDF needs three numbers for each: a base colour, how metallic it is (0 or 1, rarely between) and its roughness (0 is a mirror, 1 is chalk).

FinishPartsBase colour (R, G, B)MetallicRoughness
Steelthe three pins0.56, 0.57, 0.581.00.25
Bronzethe slider0.62, 0.38, 0.181.00.32
Aluminium, clear anodisedbase and guide0.55, 0.56, 0.580.90.45
Aluminium, coloured anodisedcrank and rodkeep the colour from FreeCAD0.00.40
  1. Select a part. Blender 5.3 In the Properties editor, the Material tab (red sphere). The GLB has made one material for each colour, so parts of one colour share it; press the number beside the name to give this part its own.
  2. Under Surface, set Base Color, Metallic and Roughness from the table. The colours are linear values: type them in the RGB fields, not the Hex field.

The slider-crank lesson's own pictures show a blue slider and a black crank pin. The item list says bronze CuSn8 and steel 1.4305, so that is what this render shows. A plastic part of your own: metallic 0, roughness about 0.5, and its colour.

Check: switch the 3D view to Material Preview (Z, then the sphere). The pins shine, the slider looks like bronze, and the crank and rod keep their FreeCAD colours.

Step 4: light, camera, and a pale world

Everything aims at one point, so that moving the point moves the whole set. That point is an Empty: an object with no shape, only a place.

  1. Add > Empty > Plain Axes, name it Target (F2). In the sidebar set its Location to the middle of the machine: X 0.060, Y 0, Z 0.013 m.
  2. Add > Mesh > Plane, Size 3 m, at Z 0: a floor, so the machine stands on something and casts a shadow. Give it a pale material: base colour 0.80, 0.78, 0.72, roughness 0.85.
  3. Add > Camera. Location X 0.160, Y −0.330, Z 0.243: 0.10 m right of the target, 0.33 m in front, 0.23 m above. In the Object Constraint tab, Add Object Constraint > Track To, Target Target. Then View > Cameras > Set Active Object as Camera. In the camera's data tab, Focal Length 50 mm and Clip Start 0.01 m.
  4. Three Add > Light > Area lights, each with a Track To on Target. Their places are measured from the target:
LightWhereFrom the target, mPowerSizeJob
Keyfront left, high−0.35, −0.45, 0.554 W0.35 mthe main light; it makes the shadows
Fillright, low0.55, −0.25, 0.251.5 W0.50 mlifts the dark side
Rimbehind0.10, 0.55, 0.403 W0.30 ma bright line on the far edges
  1. World tab: Color 0.90, 0.89, 0.84, Strength 0.35. A pale, warm sky that lights every side a little.
  2. Render tab, Color Management: View Transform Standard. The default, AgX, softens bright colours; Standard shows the colours you chose.
Why only 4 W? The GLB is in metres, so the scene is real size: the machine is 0.23 m long and the lights are half a metre away. Light falls off with the square of distance. Lights copied from a scene of 3 m would be ten or more times too bright, and the picture turns white.

Check: press Numpad 0 to look through the camera. The whole machine is in the frame with a little space round it. In Rendered view (Z) nothing is pure white.

Step 5: render the still

  1. Render tab: Render Engine Cycles, Device CPU. Under Sampling > Render, Max Samples 64 and Denoise ticked. Few samples leave grain; the denoiser removes it.
  2. Output tab: Resolution 1280 × 720, 100%.
  3. Render > Render Image (F12). When it is done, Image > Save As, PNG.
The finished still: the slider crank on a pale floor, seen from the front right and above. A clear anodised base and guide, a teal crank disc, a gold rod lying over it to the slider, a bronze slider in the channel, and polished steel pins with soft shadows.
The still, Cycles at 64 samples with denoise.

The script does steps 2 to 5 at once and saves the scene as SliderCrank.blend. In Blender: the Scripting tab, Text > Open render_still.py, set GLB on line 13 to your file, Run Script. Or, with no window:

blender -b -P render_still.py -- /path/SliderCrank-render.glb /path/out

Check: the picture matches the one above. Sizes and places are those of the model: the rod lies above the crank and the slider, the pins stand proud of the parts by the same amounts as in FreeCAD.

Step 6: two loops

A loop is a short animation whose last frame leads straight into its first, so it can play for ever without a jump. Both loops have 72 frames at 24 frames a second: 3 seconds, 5° a frame.

The turntable: the camera goes round

The machine stays as FreeCAD placed it; the camera turns once round it. The easy first loop, and the right one for a part that does not move.

  1. Add > Empty > Plain Axes, name it Orbit, at the same place as Target.
  2. Select the camera, then Orbit, and press Ctrl+P, Object (Keep Transform). The camera now rides on Orbit.
  3. Output tab: Frame Start 1, End 72, Frame Rate 24.
  4. At frame 1, select Orbit, Rotation Z 0°, hover over it and press I to set a key. At frame 73, Rotation Z 360°, I. Frame 73 is never rendered: it equals frame 1, so the turn closes without a repeated frame.
  5. In the Graph Editor, select all keys (A), T, Linear. Without this the turn slows down at each end and the loop stutters.
The turntable. The machine does not move; only the camera does.

The machine that moves

Now the crank turns and the rod and the slider follow. Do not move them by eye: a slider placed by hand is a few millimetres wrong in every frame, and the picture then shows a machine that was never designed. Each part's place comes from the same equation the slider-crank lesson derives.

Predict first

Crank radius 30 mm, rod 100 mm. The crank is at 90°, straight up. How far is the slider's pin from the crank's centre?

For a crank angle θ, with crank radius r and rod length L:

PartPlaceTurned by
Crankstays on its pivotθ
Crank pin(r cos θ, r sin θ)θ, with the crank
Rodits end on the crank pin−asin(r sin θ / L)
Slider and wrist pinx = r cos θ + √(L² − (r sin θ)²), on the line of strokenone

Each part's height stays as FreeCAD placed it. With SliderCrank.blend open: the Scripting tab, Text > Open render_loop.py, MODE = 'machine', Run Script, then press Space in the 3D view. The heart of it:

R, L = 0.030, 0.100                      # metres: the spreadsheet's 30 and 100 mm
def pin(t):    return R * math.cos(t), R * math.sin(t)
def slider(t): return R * math.cos(t) + math.sqrt(L * L - (R * math.sin(t)) ** 2)
def lean(t):   return -math.asin(R * math.sin(t) / L)

for k in range(1, 73):                    # frame k: the crank at 5 degrees a frame
    t = 2 * math.pi * (k - 1) / 72
    px, py = pin(t); xs = slider(t)
    moves = {'Crank': ((0, 0), t), 'CrankPin': ((px, py), t), 'ConnectingRod': ((px, py), lean(t)),
             'Slider': ((xs, 0), 0), 'WristPin': ((xs, 0), 0)}
    for n, ((x, y), a) in moves.items():
        o = P[n]; o.location = (x, y, z[n]); o.rotation_euler = (0, 0, a)
        o.keyframe_insert('location', frame=k); o.keyframe_insert('rotation_euler', frame=k)

This works because FreeCAD put each part's origin where its joint is: the crank's on the pivot, the rod's on the crank pin, the slider's on the wrist pin. Turning an object in Blender turns it about its origin, so each part turns about its own joint.

Before you trust it, check it against FreeCAD. The script prints the slider and rod at three angles; check_angles.py asks FreeCAD's assembly solver the same question.

θSlider x, equationSlider x, FreeCADRod angle, equationRod angle, FreeCAD
0°130.000 mm130.000 mm0°0°
90°95.394 mm95.394 mm−17.458°−17.458°
180°70.000 mm70.000 mm0°0°

Check: the two columns agree, and 130 − 70 = 60 mm, the designed stroke. Play the animation: at no frame does the rod leave a pin, and the slider never leaves the guide.

The honest picture. A render must show the part as it is designed. Never hide a clash with the camera, never move a part away from where the model has it, never stretch a part to look better. If a frame shows two parts touching, the fix belongs in FreeCAD: change the model, export again, render again.

Step 7: frames, then the video

  1. Output tab: Output path //frames-machine/, Media Type Image, File Format PNG. For the loops, Resolution 960 × 540 and, in the Render tab, Max Samples 24: a loop is seen moving, so it needs less than a still.
  2. Render > Render Animation (Ctrl+F12). Blender writes 0001.png to 0072.png. Frames are safe: if the power goes, render again from the last frame by changing Frame Start.
  3. Make the mp4 with ffmpeg, a free video tool for every system:
ffmpeg -framerate 24 -i frames-machine/%04d.png -c:v libx264 -pix_fmt yuv420p -crf 26 -movflags +faststart slider-crank-turn.mp4

yuv420p lets every phone and browser play it; crf 26 keeps it small; faststart lets a web page start playing before it is all loaded. Blender can also write the video itself: Media Type Video, Container MPEG-4, Video Codec H.264. Frames first is safer, because one crash does not lose the whole video.

The same render without a window, a loop at a time:

blender -b SliderCrank.blend -P render_loop.py -- machine /path/out render
blender -b SliderCrank.blend -P render_loop.py -- turntable /path/out render

Check: the mp4 plays in a loop with no jump where it starts again. Ours, at 960 × 540: about 18 seconds a frame on 4 CPU threads, 21 minutes a loop, and mp4 files of 71 KB (machine) and 197 KB (turntable).

Check yourself

Three questions. Each wrong choice is a mistake people really make, so read the note after you answer.

1. A student exports the slider crank as STL and imports it into Blender. It is 1000 times too big. Why?

2. In one frame of the loop the rod seems to cut into the crank pin's knob. What do you do?

3. The turntable plays smoothly but seems to pause for a moment each time it starts again. Why?

The files

The model is the course's slider crank, unchanged; the materials follow its item list (EN AW-6082 T6, CuSn8, steel 1.4305). The motion is checked against FreeCAD's assembly solver at 0°, 90° and 180°. Use the same steps for any machine in this course: export its assembly, take the materials from its drawing, and drive each moving part from the equation its own lesson gives.

Found this useful?

Discussion

    Comments show your name. Be kind, stay on the topic.