FreeCAD to Blender: Render and Animate Your CAD Model
Made with FreeCAD 1.1, Blender 5.3checked November 2026Newer version?
- 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
- 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.
- 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
- 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.
On this page
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.
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.
Coming here first?
You can do this lesson alone. It assumes three things:
- A FreeCAD model with an assembly: the slider-crank lesson makes this one, in Part 8: Assembly. Or download
SliderCrank.FCStdbelow and start at step 1. - You can paste a script into FreeCAD's Python console: Python scripting, Part 1. Each script step also has the clicks.
- What the slider crank does: the slider crank, Mechanism fundamentals. Step 6 uses its one equation.
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.
- Move1 Export a GLB2 Import it
- Dress3 Materials4 Light, camera
- Show5 The still
- 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.
| Keeps | GLB (glTF 2.0) | STL |
|---|---|---|
| Part names | yes, one object a part | no: one nameless mesh |
| Colours | yes | no |
| The assembly | yes: every part in place, under one parent | only as one lump, or one file a part |
| Units | always metres | none: the reader guesses, often 1000 times wrong |
- Open
SliderCrank.FCStd. In the tree, check thatAssemblyand its eight parts are shown: a hidden object is left out of the export. Select it and press Space to show it. - 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.
- Select
Assemblyin the tree. FreeCAD 1.1 File > Export, type glTF (*.gltf *.glb), nameSliderCrank-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') 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.
Step 2: import it in Blender, and check the size
- Open Blender 5.3, General. Select the cube, the light and the camera of the new scene and delete them (X).
- Blender 5.3 File > Import > glTF 2.0 (.glb/.gltf), choose
SliderCrank-render.glb, keep the default options. - Press N for the sidebar, tab Item. Click the base.
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).
| Finish | Parts | Base colour (R, G, B) | Metallic | Roughness |
|---|---|---|---|---|
| Steel | the three pins | 0.56, 0.57, 0.58 | 1.0 | 0.25 |
| Bronze | the slider | 0.62, 0.38, 0.18 | 1.0 | 0.32 |
| Aluminium, clear anodised | base and guide | 0.55, 0.56, 0.58 | 0.9 | 0.45 |
| Aluminium, coloured anodised | crank and rod | keep the colour from FreeCAD | 0.0 | 0.40 |
- 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.
- 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.
- 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. - 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.
- 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. - Three Add > Light > Area lights, each with a Track To on
Target. Their places are measured from the target:
| Light | Where | From the target, m | Power | Size | Job |
|---|---|---|---|---|---|
| Key | front left, high | −0.35, −0.45, 0.55 | 4 W | 0.35 m | the main light; it makes the shadows |
| Fill | right, low | 0.55, −0.25, 0.25 | 1.5 W | 0.50 m | lifts the dark side |
| Rim | behind | 0.10, 0.55, 0.40 | 3 W | 0.30 m | a bright line on the far edges |
- World tab: Color 0.90, 0.89, 0.84, Strength 0.35. A pale, warm sky that lights every side a little.
- Render tab, Color Management: View Transform Standard. The default, AgX, softens bright colours; Standard shows the colours you chose.
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
- Render tab: Render Engine Cycles, Device CPU. Under Sampling > Render, Max Samples 64 and Denoise ticked. Few samples leave grain; the denoiser removes it.
- Output tab: Resolution 1280 × 720, 100%.
- Render > Render Image (F12). When it is done, Image > Save As, PNG.
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.
- Add > Empty > Plain Axes, name it
Orbit, at the same place asTarget. - Select the camera, then
Orbit, and press Ctrl+P, Object (Keep Transform). The camera now rides onOrbit. - Output tab: Frame Start 1, End 72, Frame Rate 24.
- 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. - In the Graph Editor, select all keys (A), T, Linear. Without this the turn slows down at each end and the loop stutters.
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.
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:
| Part | Place | Turned by |
|---|---|---|
| Crank | stays on its pivot | θ |
| Crank pin | (r cos θ, r sin θ) | θ, with the crank |
| Rod | its end on the crank pin | −asin(r sin θ / L) |
| Slider and wrist pin | x = r cos θ + √(L² − (r sin θ)²), on the line of stroke | none |
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, equation | Slider x, FreeCAD | Rod angle, equation | Rod angle, FreeCAD |
|---|---|---|---|---|
| 0° | 130.000 mm | 130.000 mm | 0° | 0° |
| 90° | 95.394 mm | 95.394 mm | −17.458° | −17.458° |
| 180° | 70.000 mm | 70.000 mm | 0° | 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.
Step 7: frames, then the video
- 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. - Render > Render Animation (Ctrl+F12). Blender writes
0001.pngto0072.png. Frames are safe: if the power goes, render again from the last frame by changing Frame Start. - 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.
Discussion
No comments yet. Questions, results from your own build, a better way to explain it: all welcome.
My notes on this page
Kept on this device only. Nothing is sent anywhere.
Tip: select words in the lesson, or tap a figure or an equation, to put a note right there.
Notes on earlier wording
The lesson has changed and these words are no longer in it. Your notes are kept, with the words you chose.