FreeCAD Logo FreeCAD 1.0
  • English Afrikaans Arabic Belarusian Catalan Czech German Greek Spanish Spanish Basque Finnish Filipino French Galician Croatian Hungarian Indonesian Italian Japanese Kabyle Korean Lithuanian Dutch Norwegian Bokmal Polish Portuguese Portuguese Romanian Russian Slovak Slovenian Serbian Swedish Turkish Ukrainian Valencian Vietnamese Chinese Chinese
  • Features
  • Download
  • Blog
  • Documentation
    Documentation index Getting started Users documentation The FreeCAD manual Workbenches documentation Python coding documentation C++ coding documentation Tutorials Frequently asked questions Privacy policy About FreeCAD
  • Contribute
    How to help Sponsor Report a bug Make a pull request Jobs and funding Contribution guidelines Developers handbook Translations
  • Community
    Code of conduct Forum The FPA GitHub GitLab Codeberg Mastodon Matrix IRC IRC via Webchat Gitter Discord Reddit Twitter Facebook LinkedIn Calendar
  • ♥ Donate

Donate

$
SEPA Information
Please set up your SEPA bank transfer to:
Beneficiary: The FreeCAD project association
IBAN: BE04 0019 2896 4531
BIC/SWIFT: GEBABEBBXXX
Bank agency: BNP Paribas Fortis
Address: Rue de la Station 64, 1360 Perwez, Belgium

While Stripe doesn't support monthly donations, you can still become a sponsor! Simply make a one-time donation equivalent to 12 months of support, and you'll gain access to the corresponding sponsoring tier. It's an easy and flexible way to contribute.

If you are not sure or not able to commit to a regular donation, but still want to help the project, you can do a one-time donation, of any amount.

Choose freely the amount you wish to donate one time only.

You can support FreeCAD by sponsoring it as an individual or organization through various platforms. Sponsorship provides a steady income for developers, allowing the FPA to plan ahead and enabling greater investment in FreeCAD. To encourage sponsorship, we offer different tiers, and unless you choose to remain anonymous, your name or company logo will be featured on our website accordingly.

from 1 USD / 1 EUR per month. You will not have your name displayed here, but you will have helped the project a lot anyway. Together, normal sponsors maintain the project on its feet as much as the bigger sponsors.

from 25 USD / 25 EUR per month. Your name or company name is displayed on this page.

from 100 USD / 100 EUR per month. Your name or company name is displayed on this page, with a link to your website, and a one-line description text.

from 200 USD / 200 EUR per month. Your name or company name and logo displayed on this page, with a link to your website and a custom description text. Companies that have helped FreeCAD early on also appear under Gold sponsors.

Instead of donating each month, you might find it more comfortable to make a one-time donation that, when divided by twelve, would give you right to enter a sponsoring tier. Don't hesitate to do so!

Choose freely the amount you wish to donate each month.

Please inform your forum name or twitter handle as a notein your transfer, or reach to us, so we can give you proper credits!

Blender Sverchok Addon Setup

These notes are a work in progress.

Introduction

The Sverchok addon for Blender allows direct read and write of FreeCAD FCStd files.

There are some requirements to configure the Sverchok addon to get it working.

Generally, both Blender and FreeCAD must be using the same major.minor version of Python. So, for example if Blender is using Python 3.9, then FreeCAD must be as well. When configuring the Sverchok addon in Blender, the Blender addon must display a checkmark and FreeCAD package is available in the FreeCAD setup area at the bottom of the addon setting in Blender preferences.

Both Blender and FreeCAD versions continue to change and may be different on any given PC. The versions mentioned below were used when writing these notes.

Debian 11

(Note: on this machine I build multiple flavors of FreeCAD. Here I discuss my install/build of FreeCAD source retrieved and built from github daily. I run FreeCAD from the build directory and do not install, i.e. I never run 'make install' .)

This PC has Python 3.9.2.

Blender is at 2.93.3. In the Addons section sverchok nodes (1.0.1) are installed in the usual way. But, there is no path specified for FreeCAD python. On the Addons Blender/sverchok setup line for FreeCAD it says 'FreeCAD package is available'.

At the Python console in Blender (Shift-F4) the following commands produce:

import PartDesign; PartDesign.__file__
'~/fc-daily-build-occt77/Mod/PartDesign/__init__.py'

 import freecad; freecad.__file__
'~/fc-daily-build-occt77/Ext/freecad/__init__.py'

import Part; Part.__file__
'~/fc-daily-build-occt77/Mod/Part/Part.so'

(Note: the tilde represents the users home directory)

(Note: so the modules that Python finds are in the build folder in my home directory.) (Note: Modules PartDesign and freecad don\'t have .so files, but, Part does.)

If python sys.path is used to see the path it searches:

(Note: in this particular case, it works with nothing specified in the Blender Preferences Sverchok addons FreeCAD path. This happens on this particular PC because the Python path includes the required FreeCAD modules.)

import sys
>>> print(sys.path)
['/home/mac/.local/share/FreeCAD/Mod/lattice2/./', '/home/mac/.local/share/FreeCAD/Mod/lattice2', '/home/mac/.local/share/FreeCAD/Mod/Curves/./', '/home/mac/.local/share/FreeCAD/Mod/Curves', '/home/mac/.local/share/FreeCAD/Mod/CurvedShapes/./', '/home/mac/.local/share/FreeCAD/Mod/CurvedShapes', '/home/mac/.local/share/FreeCAD/Mod/A2plus/./', '/home/mac/.local/share/FreeCAD/Mod/A2plus', '/home/mac/.local/share/FreeCAD/Mod/sheetmetal/./', 
<a long list that includes>
~/<build dir>/Mod/PartDesign
~/<build dir>/Mod
~/<build dir>/Ext
…
...

So, in this case Blender/sverchok has found the FreeCAD modules, the Python versions match, and the nodes work.

Manjaro

On this PC Blender 3.1.2 and FreeeCAD AUR is installed. The latter means FreeCAD is built from the latest github source and is installed.

Installed, should imply that things are pretty much the same, but, there is a wrinkle thanks to the way the AUR package is installed. (I don't know if it is a bug in the AUR script or it is a glitch thanks to the fact that Arch/Manjaro updated to Python 3.10.)

Most of the previous discussion is the same. Except that none of the places that Python searches has a directory called PartDesign, the Blender/sverchok can't find PartDesign/__init__py.

The solution is to use a BASH shellscript to launch Blender that uses the python path and Linux export to add the needed path to the Python search path. Save the following (adjusted for paths and such on the target PC) in a file with the extension .sh:

{{Code|lang=bash|code= PYTHONPATH=/usr/lib/freecad/Mod #define PYTHONPATH export PYTHONPATH #export PYTHONPATH blender #launch blender }}

Linux Appimage

This process was determined under Ubuntu 22.04 with Blender 3.4.1 and the Appimage of FreeCAD 0.21. (Both using Python 3.10.x)

When the FreeCAD appimage is started it creates a temporary FreeCAD installation in the /tmp directory. The name is different each time FreeCAD is started. It is in the following form where the last 6 letters are a random string:

/tmp/.mount_FreeCAwoAlTz

This directory is only available while FreeCAD is running. This means that the setting under Blender Preferences Add-ons for Sverchok can\'t be set permanently and must be discoverable by Sverchok. Sverchok need to know where the FreeCAD Modules reside. The complete is as follows:

/tmp/.mount_FreeCAwoAlTz/usr/lib

The solution is to use a BASH shellscript to launch Blender that uses the python path and Linux export to add the needed path to the Python search path. Save the following (adjusted for paths and such on the target PC) in a file with the extension .sh:

{{Code|lang=bash|code= PYTHONPATH=$(find /tmp -type d -iname 'mount_FreeCA' 2>/dev/null)"/usr/lib" #define PYTHONPATH export PYTHONPATH #export PYTHONPATH blender #launch blender }}

FreeCAD must be running before this script executes and remain running while Blender/Sverchok is in use. As script similar to the following would only launch Blender if FreeCAD is running.

{{Code|lang=bash|code=

!/bin/bash

APP="FreeCAD.appimag" if pgrep "$APP" >/dev/null #Is FreeCAD running? then echo "$APP is running! Starting Blender" #launch blender

PYTHONPATH=$(find  /tmp -type d -iname '*mount_FreeCA*' 2>/dev/null)"/usr/lib"
echo "PYTHONPATH: $PYTHONPATH"

cd ~/blender
./blender

else echo "$APP is not running, exiting!" fi
}}

Miscellaneous

  • Notes on other operating systems need to be added.
  • The initial Arch/Majaro AUR install of FreeCAD has been addressed as this writing (6/16/2022). Specifics mentioned above may be different or not required.
  • In some cases, the Sverchok addon setup just finds FreeCAD and no additional path setting is required.

⏵ documentation index > Blender Sverchok Addon Setup

This page is retrieved from https://github.com/FreeCAD/FreeCAD-documentation/blob/main/wiki/Blender_Sverchok_Addon_Setup.md

Get in touch!
Forum GitHub Mastodon Matrix IRC Gitter.im Discord Reddit Twitter Facebook LinkedIn

© The FreeCAD Team. Homepage image credits (top to bottom): ppemawm, r-frank, epileftric, regis, rider_mortagnais, bejant.

This project is supported by: , KiCad Services Corp. and other sponsors

GitHubImprove this page on GitHub