-
Notifications
You must be signed in to change notification settings - Fork 124
blendercam blender 3.3.0 opencamlib linux install
Download portable version for linux64 3.3 from a command line as user to download and extract blender
$ cd ~/
$ mkdir Apps
$ cd Apps
$ wget https://ftp.nluug.nl/pub/graphics/blender/release/Blender3.3/blender-3.3.0-linux-x64.tar.xz
$ tar xf blender-3.3.0-linux-x64.tar.xz
$ cd blender-3.3.0-linux-x64/3.3/python/bin
$ ./python3.10 -m ensurepip
$ ./python3.10 -m pip install --upgrade pip
$ ./python3.10 -m pip install shapely
$ ./python3.10 -m pip install Equation
$ sudo apt-get install libgeos-c1v5
installing CXX compiler
$ sudo apt-get install g++
installing python and libboost-python headers
$ sudo apt install python3-dev libboost-python-dev
get the latest aewallin opencamlib sources
$ cd ~/Apps
$ git clone https://github.com/aewallin/opencamlib.git
$ cd opencamlib
$ cmake -B build -S . -DBUILD_PY_LIB=ON -DBUILD_CXX_LIB=ON -DUSE_PY_3=ON
$ cmake --build build
this is optional
$ cd build
$ sudo make install
at this point opencamlib is compiled
if you ran sudo make install
the terminal may show messages similar to this
[0/1] Install the project...
-- Install configuration: ""
-- Installing: /usr/lib/python3.9/site-packages/ocl.so
-- Up-to-date: /usr/lib/python3.9/site-packages
-- Up-to-date: /usr/lib/python3.9/site-packages/STLTools.py
-- Up-to-date: /usr/lib/python3.9/site-packages/procmemory.py
-- Up-to-date: /usr/lib/python3.9/site-packages/camvtk.py
-- Up-to-date: /usr/lib/python3.9/site-packages/pyocl.py
the python 3 version may depend on your system
now we need to link or copy some files to the blender python3.9 interpreter
Depending on your base system python files may be in other place or other
from system if you ran sudo make install
files should be here
/usr/lib/python3/dist-packages/ocl.so
or from opencamlib sources directory
opencamlib/build/src/ocl.so
opencamlib/src/lib/STLTools.py
opencamlib/src/lib/procmemory.py
opencamlib/src/lib/camvtk.py
opencamlib/src/lib/pyocl.py
please change the following instructions to match your path
$ ln -s /usr/lib/python3/dist-packages/ocl.so ~/Apps/blender-3.3.0-linux-x64/3.3/python/lib/python3.10/site-packages/
$ ln -s /usr/lib/python3/dist-packages/STLTools.py ~/Apps/blender-3.3.0-linux-x64/3.3/python/lib/python3.10/site-packages/
$ ln -s /usr/lib/python3/dist-packages/procmemory.py ~/Apps/blender-3.3.0-linux-x64/3.3/python/lib/python3.10/site-packages/
$ ln -s /usr/lib/python3/dist-packages/camvtk.py ~/Apps/blender-3.3.0-linux-x64/3.3/python/lib/python3.10/site-packages/
$ ln -s /usr/lib/python3/dist-packages/pyocl.py ~/Apps/blender-3.3.0-linux-x64/3.3/python/lib/python3.10/site-packages/
or
$ ln -s /home/yourusername/Apps/opencamlib/build/src/ocl.so ~/Apps/blender-3.3.0-linux-x64/3.3/python/lib/python3.10/site-packages/
$ ln -s /home/yourusername/Apps/opencamlib/src/lib/STLTools.py ~/Apps/blender-3.3.0-linux-x64/3.3/python/lib/python3.10/site-packages/
$ ln -s /home/yourusername/Apps/opencamlib/src/lib/procmemory.py ~/Apps/blender-3.3.0-linux-x64/3.3/python/lib/python3.10/site-packages/
$ ln -s /home/yourusername/Apps/opencamlib/src/lib/camvtk.py ~/Apps/blender-3.3.0-linux-x64/3.3/python/lib/python3.10/site-packages/
$ ln -s /home/yourusername/Apps/opencamlib/src/lib/pyocl.py ~/Apps/blender-3.3.0-linux-x64/3.3/python/lib/python3.10/site-packages/
https://github.com/vilemduha/blendercam/wiki/Using-Blendercam-from-github
I got an python error, because print was used without () in the cmake file. I changed in the file ~/Apps/opencamlib/src/pythonlib/pythonlib.cmake in line 51 and 57 the python print command:
- old line 51 and 57
COMMAND ${PYTHON_EXECUTABLE} -c "from distutils.sysconfig import get_python_lib; print get_python_lib(0,0,\"/usr/local\")"
..
COMMAND ${PYTHON_EXECUTABLE} -c "from distutils.sysconfig import get_python_lib; print get_python_lib(plat_specific=1,standard_lib=0,prefix=\"/usr/local\")"
- new
COMMAND ${PYTHON_EXECUTABLE} -c "from distutils.sysconfig import get_python_lib; print( get_python_lib(0,0,\"/usr/local\"))"
..
COMMAND ${PYTHON_EXECUTABLE} -c "from distutils.sysconfig import get_python_lib; print( get_python_lib(plat_specific=1,standard_lib=0,prefix=\"/usr/local\"))"
Install from AUR opencamlib-git and blendercam-git:
sudo pamac install opencamlib-git blendercam-git
Make opencamlib visible for Blender. Link the main files from opencamlib in the python site-packages folder. Please adapt the target path (python folder). In this example python3.11 is used by Blender. If you upgrade to a new python release, you need to run this command accordingly:
sudo ln -s /usr/opencamlib/ocl.so /usr/opencamlib/procmemory.py /usr/opencamlib/pyocl.py /usr/opencamlib/STLTools.py /usr/opencamlib/camvtk.py /usr/lib/python3.11/site-packages/
With a new Blender version you may be need to build again blendercam-git:
sudo pamac install blendercam-git