Freecad 0.19 python3.7

This subforum is specifically to discuss packaging issues on different platforms (windows, mac, linux), and using different packaging systems (conda, etc...)
Post Reply
maebaq
Posts: 23
Joined: Fri Jan 31, 2020 11:01 am

Freecad 0.19 python3.7

Post by maebaq »

Hello forum :D I'm using Freecad 0.19 with python3.7...,I'm having a problem getting blender to use Freecad.pyd in the add-on preference for blender. I won't lie I located the file which is" D:\New folder\Library\bin\FreeCAD.pyd"
But when I import a Freecad model it says "unable to import Freecad"thanks in advanced
User avatar
sgrogan
Veteran
Posts: 6499
Joined: Wed Oct 22, 2014 5:02 pm

Re: Freecad 0.19 python3.7

Post by sgrogan »

maebaq wrote: Wed Apr 22, 2020 10:48 am I'm using Freecad 0.19 with python3.7
I think you have the same problem as here:https://forum.freecadweb.org/viewtopic.php?t=30465
i.e. Freecad's and Blender's Python don't match.
I think the easiest option now is to use FreeCAD 0.18.4 because its built with Python 3.6
"fight the good fight"
Syres
Veteran
Posts: 2899
Joined: Thu Aug 09, 2018 11:14 am

Re: Freecad 0.19 python3.7

Post by Syres »

For me, the exact Blender and it's Python version number are not quoted. So to assist here's my working config with recent alpha Blender, note you don't put the FreeCAD.pyd in the Blender FreeCAD Importer AddOn config, just the folder:

Blender v2.83.11
Python 3.7.4

FreeCAD Importer Addon Locator
C:\Program Files\FreeCAD\bin\


OS: Windows 7 SP 1 (6.1)
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.19.18533 (Git)
Build type: Release
Branch: master
Hash: a785660f596616ec058fc0efccf5be737e8abaaf
Python version: 3.7.3
Qt version: 5.12.1
Coin version: 4.0.0a
OCC version: 7.3.0
Locale: English/United Kingdom (en_GB)
maebaq
Posts: 23
Joined: Fri Jan 31, 2020 11:01 am

Re: Freecad 0.19 python3.7

Post by maebaq »

sgrogan wrote: Wed Apr 22, 2020 10:58 am
maebaq wrote: Wed Apr 22, 2020 10:48 am I'm using Freecad 0.19 with python3.7
I think you have the same problem as here:https://forum.freecadweb.org/viewtopic.php?t=30465
i.e. Freecad's and Blender's Python don't match.
I think the easiest option now is to use FreeCAD 0.18.4 because its built with Python 3.6
Thank for the reply
I'm using blended 2.80 and it has python 3.7
And My Freecad has python 3.7
I've tried yorik methods and still I have no progress
In blender python console
>import sys
>sys.path.append.(D:\New folder\Library\bin\FrreeCAD.pyd")

File"<blender_console>", line 1
SyntaxError:(Unicode error) 'unicodeescape' codec can't decode bytes in position 2-3:malformed \N character escape
>import FeeeCAD
Trackback(most recent call last):
File"<blender_console>",Line 1 ,in <module>
ImportError:DLL load failed : %1 is not a valid Win32 application
That what I get when do so on the blender console
maebaq
Posts: 23
Joined: Fri Jan 31, 2020 11:01 am

Re: Freecad 0.19 python3.7

Post by maebaq »

Syres wrote: Wed Apr 22, 2020 11:23 am For me, the exact Blender and it's Python version number are not quoted. So to assist here's my working config with recent alpha Blender, note you don't put the FreeCAD.pyd in the Blender FreeCAD Importer AddOn config, just the folder:

Blender v2.83.11
Python 3.7.4

FreeCAD Importer Addon Locator
C:\Program Files\FreeCAD\bin\


OS: Windows 7 SP 1 (6.1)
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.19.18533 (Git)
Build type: Release
Branch: master
Hash: a785660f596616ec058fc0efccf5be737e8abaaf
Python version: 3.7.3
Qt version: 5.12.1
Coin version: 4.0.0a
OCC version: 7.3.0
Locale: English/United Kingdom (en_GB)
Thanks for the reply
Is that the latest blender version?
User avatar
sgrogan
Veteran
Posts: 6499
Joined: Wed Oct 22, 2014 5:02 pm

Re: Freecad 0.19 python3.7

Post by sgrogan »

maebaq wrote: Wed Apr 22, 2020 10:35 pm >sys.path.append.(D:\New folder\Library\bin\FrreeCAD.pyd")
missing quote?
>sys.path.append.("D:\New folder\Library\bin\FrreeCAD.pyd")
"fight the good fight"
maebaq
Posts: 23
Joined: Fri Jan 31, 2020 11:01 am

Re: Freecad 0.19 python3.7

Post by maebaq »

sgrogan wrote: Wed Apr 22, 2020 10:41 pm
maebaq wrote: Wed Apr 22, 2020 10:35 pm >sys.path.append.(D:\New folder\Library\bin\FrreeCAD.pyd")
missing quote?
>sys.path.append.("D:\New folder\Library\bin\FrreeCAD.pyd")
Never noticed that I skip it when I was typing to you ..besides that I did it with the quote in the blender console but it gave me those errors

>import sys
>sys.path.append.("D:\New folder\Library\bin\FreeCAD.pyd")
SyntaxError: invalid syntax
Syres
Veteran
Posts: 2899
Joined: Thu Aug 09, 2018 11:14 am

Re: Freecad 0.19 python3.7

Post by Syres »

maebaq wrote: Wed Apr 22, 2020 10:37 pm Is that the latest blender version?
2.83 is the latest Beta but 2.90 is the new Alpha. Below is the exact procedure I followed to move up to a new version, I don't have any path modifications to 'hack' the locator setting and there should be no need for it.



1) Browse to https://builder.blender.org/download/

I would recommend downloading 2.83 Beta - it's very stable (1200 bugs fixed in the past few months) and has some excellent features such as the Intel Denoiser in the Compositor and big sculpting improvements. Demonstration of the Intel Denoiser available here https://www.youtube.com/watch?v=wbpMNr0 ... e=emb_logo

2) Extract the zip file to a location of your choice, you'll ned to make a shortcut on your Desktop manually as it's just a portable build.

3) Download a current FreeCAD Importer, I personally use @s-light's which was forked from @yorik's last year

Browse to https://github.com/s-light/io_import_fcstd
from the Clone or Download, Download ZIP but do not extract it

4) Start Blender 2.83
You'll get a one-off Start screen and click Load 2.80 Settings which will bring everything across

5) Click Edit Menu > Preferences, AddOns button/tab
At this point I would recommend removing the existing FreeCAD importer by expanding it in the list of AddOns and clicking the Remove button and click OK

6) Close the Preferences Window, close without saving and restart Blender 2.83
Click Edit Menu > Preferences, AddOns button/tab, click the Install button and navigate to the zip file of the importer downloaded earlier
click Install AddOn button
Tick the Active checkbox and expand the FreeCAD Importer properties
Copy and Paste the folder as below into the Path to FreeCAD lib text box

Code: Select all

D:\New folder\Library\bin\
7) Close the Preferences Window

8) Try importing a simple FreeCAD file, the settings I use with Millimetres set as my default Units is:
FreeCADImporterSettings.jpg
FreeCADImporterSettings.jpg (17.28 KiB) Viewed 3801 times


Good luck
maebaq
Posts: 23
Joined: Fri Jan 31, 2020 11:01 am

Re: Freecad 0.19 python3.7

Post by maebaq »

Syres wrote: Thu Apr 23, 2020 11:48 am
maebaq wrote: Wed Apr 22, 2020 10:37 pm Is that the latest blender version?
2.83 is the latest Beta but 2.90 is the new Alpha. Below is the exact procedure I followed to move up to a new version, I don't have any path modifications to 'hack' the locator setting and there should be no need for it.



1) Browse to https://builder.blender.org/download/

I would recommend downloading 2.83 Beta - it's very stable (1200 bugs fixed in the past few months) and has some excellent features such as the Intel Denoiser in the Compositor and big sculpting improvements. Demonstration of the Intel Denoiser available here https://www.youtube.com/watch?v=wbpMNr0 ... e=emb_logo

2) Extract the zip file to a location of your choice, you'll ned to make a shortcut on your Desktop manually as it's just a portable build.

3) Download a current FreeCAD Importer, I personally use @s-light's which was forked from @yorik's last year

Browse to https://github.com/s-light/io_import_fcstd
from the Clone or Download, Download ZIP but do not extract it

4) Start Blender 2.83
You'll get a one-off Start screen and click Load 2.80 Settings which will bring everything across

5) Click Edit Menu > Preferences, AddOns button/tab
At this point I would recommend removing the existing FreeCAD importer by expanding it in the list of AddOns and clicking the Remove button and click OK

6) Close the Preferences Window, close without saving and restart Blender 2.83
Click Edit Menu > Preferences, AddOns button/tab, click the Install button and navigate to the zip file of the importer downloaded earlier
click Install AddOn button
Tick the Active checkbox and expand the FreeCAD Importer properties
Copy and Paste the folder as below into the Path to FreeCAD lib text box

Code: Select all

D:\New folder\Library\bin\
7) Close the Preferences Window

8) Try importing a simple FreeCAD file, the settings I use with Millimetres set as my default Units is:

FreeCADImporterSettings.

Good luck
Thanks for the reply again Syres
I will noify you later on the progress
maebaq
Posts: 23
Joined: Fri Jan 31, 2020 11:01 am

Re: Freecad 0.19 python3.7

Post by maebaq »

Thanks syres i successfully completed the task Iam able to import freecad project into blender 2.83 ,thanks to your knowledge
I really aprieciate it . :D :D :D
Post Reply