nortikin / sverchok

Sverchok
http://nortikin.github.io/sverchok/
GNU General Public License v3.0
2.23k stars 232 forks source link

Interesting external dependencies to play with (discussion) #2152

Closed portnov closed 4 years ago

portnov commented 6 years ago

Here I propose to collect and discuss a list of python or C++ libraries that are interesting to play within Sverchok. These things cannot be integrated into core sverchok distribution, but they can be used by script nodes or by sverchok extension addons.

nortikin commented 6 years ago

opinion. If we can handle code inside sverchok to avoid user install other programms, than it good idea to have. My attempts to install AI in my linux not ok. Predict users will fail too. Or to have mechanism to automatically install additions from Internet.

portnov commented 6 years ago

@nortikin I was thinking, that some day there might appear one or several Sverchok addons with specific dependencies. I.e. we (or somebody else) could develop separate blender addons, which would import sverchok and define their own nodes. Such separate addons may have a lot more freedom about dependencies. For example, there could be an addon with nodes that use shapely, another addon with nodes that use mcubes, and so on.

vicdoval commented 6 years ago

I was also thinking about this concepts, there could be addons for sverchok with specific dependencies. I'm not sure how would it be used but I think it would be nice to be able to play with this genetic stuff https://github.com/deap/deap and Sverchok as stated here https://github.com/nortikin/sverchok/issues/747 :D

kalwalt commented 5 years ago

with ./python -m ensurepip is super friendly install pip and after a external python package: ./python pip install the_package_wanted ./pyhton executable of course must reside in the pyhton blender folder and should be something like pyhton3.5m or python3.7m .... I think with a simple script should be easy to make an easy automated installation. i think this for 2.80 version. What do you think @portnov @nortikin @vicdoval @zeffii ?

vicdoval commented 5 years ago

It could be great but I don't know how it should be integrated... Probably at some point this will could be the standard but maybe by now it could be useful to have it as a included file or a script node...

kalwalt commented 5 years ago

I think if we are really interested we should go step by step:

  1. developing some script node and a sort of automated installation of the lib/packages
  2. after this, maybe developing some nodes in a separate branch for testing (?)
  3. when we found a valid method to integrate the lib/package the node will be in the master branch
portnov commented 5 years ago

I'd still suggest that any features that may require additional dependencies, or require user to build something, would go to separate addon. Sverchok setup should remain as simple as "download and enable". But there can exist "Sverchok-Extra" or "Sverchok-Speedup" or whatever, that contains additional features and have more dependencies.

zeffii commented 5 years ago

features that may require additional dependencies, or require user to build something, would go to separate addon.

agreed. or a 'extending sverchok' section in user preference. With links to resources for further reading and even 'install feature x' buttons (as separate add-ons). The problem, and the reason we avoided this for a very long time, is the variability of the user-system, filepaths, OS, etc. Not to mention the issue of system python vs Blender's Python binary and calling libraries built with different versions of Python.

As soon as people want features outside of "vanilla sverchok", then we should be able to expect them to invest time in a bit of reading, rather than giving the illusion that we can offer a failsafe solution.

zeffii commented 5 years ago

A nice example of a python module that is potentially tricky to install, but can be used to bring a lot of new speed-features is CFFI.

For Blender 2.80 version of Sv, @scorpion81 already made a tentative "CFFI-based" Script Node that can execute C/C++ by first compiling it, storing it for reuse, and then calling it in the node's process function. The user will need a compatible compiler already installed ( Windows users would need MSVC* current, which is a 4 gb download and a long install, and a reboot )

CFF! is a module we could write detailed instructions for installing, and might be an interesting starting point to start converting some slower pythonbased nodes.

nortikin commented 5 years ago

It was my dream to install on fly some libs or addons even.

nortikin commented 5 years ago

maybe i doing some brutal coding, but as i see it:

import bpy
import os

additionname = 'scipy'

os.chdir(os.path.split(bpy.app.binary_path_python)[0])
cd = os.path.abspath(os.curdir)
pythname = [i for i in os.listdir() if 'python' in i][0]
pipname = [i for i in os.listdir() if 'pip' in i][0]
if not pipname:
    os.system(str('./'+pythname + ' -m ensurepip'))
pipname = [i for i in os.listdir() if 'pip' in i][0]
addname = [i for i in os.listdir('../lib/'+os.listdir('../lib/')[0]) if additionname in i]
if not additionname in cd:
    os.system(pythname+' '+pipname+' install '+ additionname)

having pip3 and pip3.5 both in one folder, making me confusing

nortikin commented 4 years ago

i'm preparing to manage GA without dependencies https://github.com/nortikin/sverchok/issues/3160

vicdoval commented 3 years ago

Numpy parallelisation https://github.com/pydata/numexpr

vicdoval commented 3 years ago

Open3d (could replace bmesh in many scenarios and has many interesting features) http://www.open3d.org/docs/release/tutorial/geometry/index.html