How to integrate pythonocc-core into a Blender addon #3507
-
This is not so much an issue as a question, but I hope to find an answer in this community. We are working on a research project and want to create a Blender addon built on top of BlenderBIM. Our python library uses IfcOpenShell and PythonOCC. The problem is that current versions of PythonOCC can only be installed via Anaconda, and we can't manage to integrate PythonOCC with Blender's built-in Python interpreter. The error we are getting is: We have tried:
Does anyone have any ideas on how to integrate PythonOCC correctly, or can direct me to the right place to look for more information? Any help is appreciated. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 8 replies
-
It was definitely tricky to do back in the day, but I reckon I can get it working again. Basically some dependencies come straight from Conda (e.g. https://github.com/IfcOpenShell/IfcOpenShell/blob/v0.7.0/src/blenderbim/Makefile#L55 ) so the key is to work out what the dependencies from Conda are (pretty simple, just install Conda and see what it pulls in and make a list) then the second trick is to make sure all the paths are correct and the RPATHS are appropriate for the dlls and whatnot. Conda uses an RPATH 3 of So it sounds like your option 3. Happy to screenshare and get it working with you. I'm available 9 to 5pm Sydney time. |
Beta Was this translation helpful? Give feedback.
That is indeed possible.
import OCC
itself does not actually look for the binaries yet.What OS are you on?
For windows there is https://github.com/lucasg/Dependencies which you could try to open e.g _BRep.pyd and see if it reports on any missing dll dependencies.
On linux it might help to run in
strace
and grep on things like .so or .pyd to see the various attempts of libraries being loaded.