FreeCAD .FCStd importer for Blender 2.80

Need help, or want to share a macro? Post here!
Forum rules
Be nice to others! Respect the FreeCAD code of conduct!
drmacro
Veteran
Posts: 9001
Joined: Sun Mar 02, 2014 4:35 pm

Re: FreeCAD .FCStd importer for Blender 2.80

Post by drmacro »

Star Trek II: The Wrath of Khan: Spock: "...His pattern indicates two-dimensional thinking."
User avatar
s-light
Posts: 119
Joined: Thu Feb 12, 2015 11:39 am
Location: Germany, Hofheim am Taunus
Contact:

Re: FreeCAD .FCStd importer for Blender 2.80

Post by s-light »

i currently use:

blender

Code: Select all

$ ~/mydata/tools/blender/blender-2.93.1-linux-x64/blender --version
Blender 2.93.1
        build date: 2021-06-22
        build time: 23:38:50
        build commit date: 2021-06-22
        build commit time: 05:57
        build hash: 1b8d33b18c2f
        build platform: Linux
        build type: release
        build c flags:  -Wall -Wcast-align -Werror=implicit-function-declaration -Werror=return-type -Werror=vla -Wstrict-prototypes -Wmissing-prototypes -Wno-char-subscripts -Wno-unknown-pragmas -Wpointer-arith -Wunused-parameter -Wwrite-strings -Wlogical-op -Wundef -Winit-self -Wmissing-include-dirs -Wno-div-by-zero -Wtype-limits -Wformat-signedness -Wrestrict -Wnonnull -Wabsolute-value -Wuninitialized -Wredundant-decls -Wshadow -Wno-error=unused-but-set-variable -Wimplicit-fallthrough=5  -fuse-ld=gold -std=gnu11 -msse -pipe -fPIC -funsigned-char -fno-strict-aliasing -ffp-contract=off -msse2 -D_GLIBCXX_USE_CXX11_ABI=0  
        build c++ flags:  -Wuninitialized -Wredundant-decls -Wall -Wno-invalid-offsetof -Wno-sign-compare -Wlogical-op -Winit-self -Wmissing-include-dirs -Wno-div-by-zero -Wtype-limits -Werror=return-type -Wno-char-subscripts -Wno-unknown-pragmas -Wpointer-arith -Wunused-parameter -Wwrite-strings -Wundef -Wformat-signedness -Wrestrict -Wno-suggest-override -Wuninitialized -Wundef -Wmissing-declarations -Wimplicit-fallthrough=5  -fuse-ld=gold -std=c++17 -msse -pipe -fPIC -funsigned-char -fno-strict-aliasing -ffp-contract=off -msse2 -D_GLIBCXX_USE_CXX11_ABI=0  
        build link flags:  -Wl,--version-script='/home/blender/git/blender-v293/blender.git/source/creator/blender.map'
        build system: CMake
        
-----------
blender console window:
#~ PYTHON INTERACTIVE CONSOLE 3.9.2 (default, Feb 25 2021, 12:19:39)  [GCC 9.3.1 20200408 (Red Hat 9.3.1-2)]
#~ 
#~ Builtin Modules:       bpy, bpy.data, bpy.ops, bpy.props, bpy.types, bpy.context, bpy.utils, bgl, blf, mathutils
#~ Convenience Imports:   from mathutils import *; from math import *
#~ Convenience Variables: C = bpy.context, D = bpy.data
#~ 
FreeCAD

Code: Select all

OS: Ubuntu 20.04.3 LTS (KDE/plasma)
Word size of FreeCAD: 64-bit
Version: 0.20.
Build type: Release
Branch: unknown
Hash: 582c26ea8b5f9d85957a6cb1bf798839fa2ce94c
Python version: 3.8.10
Qt version: 5.12.8
Coin version: 4.0.0
OCC version: 7.5.2
Locale: English/United States (en_US)
system python

Code: Select all

$ python3 --version
Python 3.8.10
and the paths in blender addon-preferences:

Code: Select all

path to FreeCAD lib: /usr/lib/freecad-daily-python3/lib/FreeCAD.so
path to system python modules: /usr/lib/python3/dist-packages/
and as fare as i can tel it works :-)
swathi
Posts: 7
Joined: Sun Feb 02, 2020 11:41 am

Re: FreeCAD .FCStd importer for Blender 2.80

Post by swathi »

Actually I surprised why blender and freecad never match in python. I am on windows 10 and never able to export or import
drmacro
Veteran
Posts: 9001
Joined: Sun Mar 02, 2014 4:35 pm

Re: FreeCAD .FCStd importer for Blender 2.80

Post by drmacro »

I know this is a necro bump... :oops:

Just curious as to the status of this.

Not much activity on the github for it.

Was the Python mismatch issue ever resolver for new Blender versions?
Star Trek II: The Wrath of Khan: Spock: "...His pattern indicates two-dimensional thinking."
User avatar
Kunda1
Veteran
Posts: 13434
Joined: Thu Jan 05, 2017 9:03 pm

Re: FreeCAD .FCStd importer for Blender 2.80

Post by Kunda1 »

Hey yorik, maybe this could also be a GSoC project?! :idea:
Alone you go faster. Together we go farther
Please mark thread [Solved]
Want to contribute back to FC? Checkout:
'good first issues' | Open TODOs and FIXMEs | How to Help FreeCAD | How to report Bugs
User avatar
yorik
Founder
Posts: 13665
Joined: Tue Feb 17, 2009 9:16 pm
Location: Brussels
Contact:

Re: FreeCAD .FCStd importer for Blender 2.80

Post by yorik »

it still works fine, i use it all the time, but the python version issue, i'm afraid it's unsolvable...
you cannot import a python module that was compiled with another python version. that's how python works.

the only way to work around this would be to make the two processes independant, to separate them completely and communicate through some sort of socket.. bu. that would be so overkill and bring so many other issues

it's mostly a packaging issue.. we shoud have more packages available of both apps with different python versions. there is the additional difficulty that blender packages python entirely and doesn't rely on the system one. note that for ex if you use a linux distro that has both apps, and use distro-provided packages, you won't have problems.

about a gsoc, why not, but i don't see a possible solution here...
User avatar
s-light
Posts: 119
Joined: Thu Feb 12, 2015 11:39 am
Location: Germany, Hofheim am Taunus
Contact:

Re: FreeCAD .FCStd importer for Blender 3.1.0

Post by s-light »

I just tried the current blender official `3.1.0` and FreeCAD release and a (older) daily:


Free-CAD daily 0.20

Code: Select all

OS: Ubuntu 21.04 (KDE/plasma)
Word size of FreeCAD: 64-bit
Version: 0.20.
Build type: Release
Branch: unknown
Hash: 4acef3f14fe694f28f7935108d36341b8df83a39
Python version: 3.9.5
Qt version: 5.15.2
Coin version: 4.0.0
OCC version: 7.5.2
Locale: English/United States (en_US)

build in python console:
Python 3.9.5 (default, Nov 18 2021, 16:00:48) 
[GCC 10.3.0] on linux
>>> App.Version()[4]
'2022/01/26 04:18:00'
Free-CAD 0.19

Code: Select all

OS: Ubuntu 21.04 (KDE/plasma)
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.19.
Build type: Release
Branch: unknown
Hash: 0d9536ed3e8c7f40197b5606e1b7873625e1d6fe
Python version: 3.9.5
Qt version: 5.15.2
Coin version: 4.0.0
OCC version: 7.5.2
Locale: English/United States (en_US)


# build in python console:
Python 3.9.5 (default, Nov 18 2021, 16:00:48) 
[GCC 10.3.0] on linux
Type 'help', 'copyright', 'credits' or 'license' for more information.
>>> App.Version()[4]
'2021/07/21 08:10:00'
Blender

Code: Select all

Blender:
====================================

version: 3.1.0, branch: master, commit date: 2022-03-08 18:16, hash: c77597cd0e15, type: release
build date: 2022-03-09, 00:34:48
platform: 'Linux-5.11.0-50-generic-x86_64-with-glibc2.33'


Python:
====================================

version: 3.10.2 (main, Jan 27 2022, 14:00:16) [GCC 9.3.1 20200408 (Red Hat 9.3.1-2)]

and both freecad versions are working :-)
i can only test on linux - so do not now if the situation on windows or macos is different...

@yorik great it is working for you :-)

if anyone needs a feature that is not working please leave a issue and let me know - or in best case write a pull request ;-)
as i only sometimes use this i only will do new things as i need them... :lol: time is flying... and so much things i like to do :-)
if there is a actual need i try my best to help :-)

some of the open issues would need a good rethinking what is really helpful / needed...
some only need some testcases or simple isolation of the phenomena so its easier to fix..
@drmacro feel free suport it!
i just went through the issues and tried to add the correct labels...

i think i have to clean up there a bit - and again - help is welcome :-)

sunny greetings
stefan
poddat'sky
Posts: 1
Joined: Mon Nov 21, 2022 11:16 pm

Re: FreeCAD .FCStd importer for Blender 2.80

Post by poddat'sky »

I have are problem:

Code: Select all

import FreeCAD
Traceback (most recent call last):
  File "<blender_console>", line 1, in <module>
ImportError: /opt/blender/3.3/scripts/addons/././libboost_regex.so.1.74.0: undefined symbol: _ZN6icu_706LocaleC1ERKS0_
OS

Code: Select all

OS: Gentoo Base System release 2.7 x86_64 
 Kernel: 4.19.94 
 Shell: bash 5.0.18 
 Resolution: 1680x1050 
 WM: IceWM 3.1.0 (linux-gnu/x86_64) 
 WM Theme: erizo 
 Theme: Adwaita-dark [GTK2/3] 
 Icons: ePapirus [GTK2/3] 
 Terminal: tilda 
 CPU: Intel i3 540 (4) @ 3.0GHz [45.0°on] 
 GPU: AMD ATI Radeon HD 5550/5570/5630/6390/6490/7570 
 GPU: Intel Core Processor 
 Memory: 2884MiB / 3619MiB (79%) 
 GPU Driver: i915 
 CPU Usage: 8% 
 Locale: ru_RU.utf8 
blender

Code: Select all

blender --version
Blender 3.3.1
	build date: 2022-10-05
	build time: 00:14:35
	build commit date: 2022-10-04
	build commit time: 18:35
	build hash: b292cfe5a936
	build platform: Linux
	build type: release
	build c flags:  -Wall -Werror=implicit-function-declaration -Werror=return-type -Werror=vla -Wstrict-prototypes -Wmissing-prototypes -Wno-char-subscripts -Wno-unknown-pragmas -Wpointer-arith -Wunused-parameter -Wwrite-strings -Wlogical-op -Wundef -Winit-self -Wmissing-include-dirs -Wno-div-by-zero -Wtype-limits -Wformat-signedness -Wrestrict -Wnonnull -Wabsolute-value -Wuninitialized -Wredundant-decls -Wshadow -Wno-error=unused-but-set-variable -Wimplicit-fallthrough=5  -std=gnu11 -msse -pipe -fPIC -funsigned-char -fno-strict-aliasing -ffp-contract=off -msse2 -D_GLIBCXX_USE_CXX11_ABI=0  
	build c++ flags:  -Wuninitialized -Wredundant-decls -Wall -Wno-invalid-offsetof -Wno-sign-compare -Wlogical-op -Winit-self -Wmissing-include-dirs -Wno-div-by-zero -Wtype-limits -Werror=return-type -Wno-char-subscripts -Wno-unknown-pragmas -Wpointer-arith -Wunused-parameter -Wwrite-strings -Wundef -Wformat-signedness -Wrestrict -Wno-suggest-override -Wuninitialized -Wundef -Wmissing-declarations -Wimplicit-fallthrough=5  -msse -pipe -fPIC -funsigned-char -fno-strict-aliasing -ffp-contract=off -msse2 -D_GLIBCXX_USE_CXX11_ABI=0  
	build link flags:  -Wl,--version-script='/home/blender/git/blender-v330/blender.git/source/creator/symbols_unix.map'
	build system: CMake
freecad

Code: Select all

FreeCAD 0.20.1 Revision: 29410 (Git)

/opt/freecad/usr/bin/python 
Python 3.10.5 | packaged by conda-forge | (main, Jun 14 2022, 07:04:59) [GCC 10.3.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import FreeCAD
Assembly4 workbench (v0.12.4) loaded
>>> print("FreeCAD version:", FreeCAD.Version())
FreeCAD version: ['0', '20', '1', '29410 (Git)', 'Unknown', '2022/08/10 11:44:09', '(HEAD detached at 0.20.1)', 'f5d13554ecc7a456fb6e970568ae5c74ba727563']
>>> 

Code: Select all

path to FreeCAD lib: /opt/freecad/usr/lib/FreeCAD.so
path to system python modules: /usr/lib/python3.10/site-packages/
Last edited by poddat'sky on Mon Nov 21, 2022 11:58 pm, edited 1 time in total.
Post Reply