And this also works?
Code: Select all
import sys
import PartDesign
PartDesign.__file__
sys.modules['_PartDesign']
sys.modules['PartDesign']
Code: Select all
import sys
import PartDesign
PartDesign.__file__
sys.modules['_PartDesign']
sys.modules['PartDesign']
wmayer wrote: ↑Sat Apr 30, 2022 1:15 pm Hmm, this is getting weird. lsof claims that _PartDesign.so is loaded but at the same time it refuses to create a PartDesign::Body.
And this also works?Code: Select all
import sys import PartDesign PartDesign.__file__ sys.modules['_PartDesign'] sys.modules['PartDesign']
Code: Select all
Traceback (most recent call last):
File "<blender_console>", line 1, in <module>
ModuleNotFoundError: No module named 'PartDesign'
Code: Select all
from collections import defaultdict
import FreeCAD as F
from pprint import pprint
fc_file = r"/home/mac/SharedData/Projects/MechMovements/Simple_assy_001.FCStd"
live_fc = F.open(fc_file)
obj_names = defaultdict(list)
for obj in F.ActiveDocument.Objects:
ID = str(obj.TypeId)
A, B = ID.split('::')
obj_names[A].append(B)
pprint(obj_names)
Code: Select all
defaultdict(<class 'list'>,
{'App': ['Origin',
'Line',
'Line',
'Line',
'Plane',
'Plane',
'Plane',
'Origin',
'Line',
'Line',
'Line',
'Plane',
'Plane',
'Plane',
'Origin',
'Line',
'Line',
'Line',
'Plane',
'Plane',
'Plane'],
OK, now it starts to make some sense. It could be a packaging bug because the above mentioned __init__.py file is missing.Import _PartDesign works
_PartDesign.__file__
Returns:
'/usr/lib/_PartDesign.so'
Code: Select all
import _PartDesign
makeFilletArc = _PartDesign.makeFilletArc
wmayer wrote: ↑Sat Apr 30, 2022 3:52 pmOK, now it starts to make some sense. It could be a packaging bug because the above mentioned __init__.py file is missing.Import _PartDesign works
_PartDesign.__file__
Returns:
'/usr/lib/_PartDesign.so'
Where is the PartDesign directory located? You can figure this out by importing PartDesignGui (which I think should work). Then check the path name of its __file__ attribute. Open this directory in a file manager and look for the __init__.py file. If it doesn't exist create it and set its content to:Now try to load the project file with Blender again.Code: Select all
import _PartDesign makeFilletArc = _PartDesign.makeFilletArc
Code: Select all
./usr/lib/python3.10/site-packages/PartDesignGui.so
./usr/lib/freecad/Mod/PartDesign/TestPartDesignGui.py
./usr/lib/PartDesignGui.so
Code: Select all
./usr/lib/python3.10/site-packages/_PartDesign.so
./usr/lib/freecad/Mod/PartDesign
./usr/lib/_PartDesign.so
My last post was a bit of "streaming thoughts".
I have had some problem in the past when a buggy AUR build has left some files around after having compiled the source and during the "put in place" phase.
Sadly not everytime the AUR maintainer is responsive, many times you have to manage to solve problem yourself.