Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Installing Blender2.93+ compatible FreeCAD #4131

Open
rendetto opened this issue May 27, 2021 · 5 comments
Open

Installing Blender2.93+ compatible FreeCAD #4131

rendetto opened this issue May 27, 2021 · 5 comments

Comments

@rendetto
Copy link
Contributor

rendetto commented May 27, 2021

Since I already did it several times, I guess I can share my experience. It's not optimal, also it needs a lot of space (nearly 11GB), but it works and for sure can be optimized.
Currently I work under win10, and can not test it under linux or others. Hopefully someone could try and report how it goes on the other OS.
There are up to date py3.9 builds of FreeCAD here:
https://anaconda.org/freecad/freecad/files?page=1
I don't know how to use those directly but there is a conda script that installs a whole bundle that works perfectly with latest Blender:
https://github.com/FreeCAD/FreeCAD-Bundle/blob/095bbb2ec9bdbf59d2afbf341ff70d0926bd47c2/conda/win/create_bundle.bat#L6L17
What you need is to edit this script so that it points to python3.9.
On line 8 just change python=3.8 to python=3.9.

Here are detailed steps how to install the whole thing:

  1. Download and edit the .bat file, as described above. (For convenience I moved it to my user folder, where miniconda will be installed)
  2. Download and install an appropriate Miniconda version (I used py3.9 64-bit one): https://docs.conda.io/en/latest/miniconda.html
  3. Start the miniconda prompt and from it execute the .bat file:
    create_bundle.bat
    It will automatically download and install a lot of packages that will be needed. Also it will create two folders under your user folder - fc_env and FreeCAD_Conda_Build
  4. After the install process is complete, in the prompt activate the environment by executing the following command:
    conda activate C:\Users\XXXXX\fc_env
    (replace XXXXX with the name of your user folder)
  5. Test that FreeCAD works by executing in the prompt:
    FreeCAD
    If FreeCAD starts, you're good to go.
  6. Download and install Blender2.93 (or higher) or extract it (under win I'm using the zip version, not the installer).
  7. Download the latest Sverchok master and extract it to the win user folder (C:\Users\XXXXX\AppData\Roaming\Blender Foundation\Blender\2.93\scripts\addons\sverchok-master). If the folder structure does not exist you need to create it manually.
  8. Open Blender and enable Sverchok.
  9. In the properties of the Sverchok addon click on the Extra Nodes button and scroll to the bottom until you find the "FreeCAD python 3.7 folder" input field. There you need to set the full path to the conda FreeCAD bin folder e.g. C:\Users\XXXXX\fc_env\Library\bin
  10. Close Blender then reopen it and you should find all the FreeCAD nodes under the Solids submenu. If the nodes are not there browse and set the correct path and restart Blender again. (for some reason the path is not visualized in the field, but you should get "FreeCAD package is available" if everything goes ok)

As I mentioned before this is a new FreeCAD version, that (possibly) have changes to it's python API. I already checked and there are things that are not working anymore.
Can we start reporting those problems? I guess fixes could be done in a PR, for those of us who want to experiment with the latest FC and Blender builds.

@ht55ght55
Copy link

That's some nice work but I think it's for windows x86_64, right? Any idea how I would adapt this for Apple Silicon?

@acui
Copy link

acui commented Oct 14, 2021

I tried it today and found that you don't need the create_bundle.bat for that.
Just replace step 2 with this command:
conda create -p fc_env freecad python=3.9 --copy -y -c freecad/label/dev -c conda-forge
Disk usage will drop to roughly 2.5GB.

BTW: there is a bug in the 0.19.x series of FreeCAD on conda-forge that causes MeshPart failing to load. So we have to use the unstable 0.20.x branch on the "freecad/label/dev" channel. For blender 2.92, you could use this command to get a stable FreeCAD that works with python3.7:
conda create -p fc_env_py37 freecad=0.18.4 python=3.7 --copy -y -c conda-forge

@rendetto
Copy link
Contributor Author

rendetto commented Jan 1, 2022

Just replace step 2 with this command:
conda create -p fc_env freecad python=3.9 --copy -y -c freecad/label/dev -c conda-forge

Thank you @acui it works!

@rendetto
Copy link
Contributor Author

Good news!
There is an official conda package of FreeCAD-0.20 compiled against Python-3.10.
So we can now use Blender 3.1x, 3.2x and all those that will come with py3.10 support.

use:
conda create -p fc_env freecad python=3.10 --copy -y -c freecad/label/dev -c conda-forge

Cheers

@luzpaz
Copy link
Contributor

luzpaz commented Jul 11, 2022

Just giving a heads up to @looooo who is the FreeCAD conda packager. looooo, JIC you encounter any sverchok related questions in the context of FreeCAD.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants