0
$\begingroup$

Where would I need to start? I am just about able to code genetic algorithms and neural networks using Python, C# etc so that is not primarily the problem.

Is it just a case of importing modules into the blender script? Does anyone know and is able to explain in rough detail how GAs/NN would be implemented in blender?

If you can, many thanks. I've seen someone do it before, but I suppose they're too busy to give feedback.

Edit: Due apologies if my English is bad, it is not my native tongue.

$\endgroup$
1
$\begingroup$

Seems like what you need is simply to import python machine learning libraries to Blender. Blender has its own python, but you can enable importing machine learning libraries to Blender in two ways:

  1. Install these libraries on Blender's python, hopefully using pip.
  2. Make blender use the system's python (has to be the same Python version as the bundled python installed with Blender).

If you're not sure where to find Blender's bundled python, type this in Blender's interactive python console:

import sys
sys.path

This will show you all the included libraries available to scripts running in Blender, and among them Blender's python directory. Here's the output of this line on my machine:

['C:\\Program Files\\Blender Foundation\\Blender\\2.78\\scripts\\addons_contrib', 'C:\\Users\\tfc64\\AppData\\Roaming\\Blender Foundation\\Blender\\2.78\\scripts\\addons', 'C:\\Program Files\\Blender Foundation\\Blender\\2.78\\scripts\\addons', 'C:\\Program Files\\Blender Foundation\\Blender\\2.78\\scripts\\startup', 'C:\\Program Files\\Blender Foundation\\Blender\\2.78\\scripts\\modules', 'C:\\Program Files\\Blender Foundation\\Blender\\python35.zip', 'C:\\Users\\tfc64\\Anaconda3\\Lib', 'C:\\Users\\tfc64\\Anaconda3\\DLLs', 'C:\\Program Files\\Blender Foundation\\Blender', 'C:\\Users\\tfc64\\Anaconda3', 'C:\\Users\\tfc64\\Anaconda3\\lib\\site-packages', 'C:\\Users\\tfc64\\Anaconda3\\lib\\site-packages\\Sphinx-1.4.1-py3.5.egg', 'C:\\Users\\tfc64\\Anaconda3\\lib\\site-packages\\win32', 'C:\\Users\\tfc64\\Anaconda3\\lib\\site-packages\\win32\\lib', 'C:\\Users\\tfc64\\Anaconda3\\lib\\site-packages\\Pythonwin', 'C:\\Users\\tfc64\\Anaconda3\\lib\\site-packages\\setuptools-23.0.0-py3.5.egg', 'C:\\Program Files\\Blender Foundation\\Blender\\2.78\\scripts\\freestyle\\modules', 'C:\\Program Files\\Blender Foundation\\Blender\\2.78\\scripts\\addons\\modules', 'C:\\Users\\tfc64\\AppData\\Roaming\\Blender Foundation\\Blender\\2.78\\scripts\\addons\\modules']
$\endgroup$
  • $\begingroup$ Glorious, thank you. This is the answer I was looking for. $\endgroup$ – Ben Simione Oct 22 '16 at 14:05

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.