Previous Thread  Next Thread

chat icon use of 3rd party APIs through blender's python implementatio

ashinms

Posted: Sun Nov 04, 2012 2:16 am
Joined: 15 Mar 2012
Posts: 3
Subject pretty much says it all. Is there anything special I would need to do to get PyOpencl, numpy, things of that nature, working properly in blender. I've also been reading up on using higher performance languages from within python such as C in the more performance critical sections of code. Would there be any abnormal challenges associated with this? Finally, how much trouble would it be to completely replace the standard python interpreter with a completely different one, such as JPython?
Reply with quote


INeedMySpace

Posted: Wed Nov 07, 2012 9:37 pm
Joined: 15 Oct 2011
Posts: 4
Hi! There is no problem at all to use numpy in your Blender plugin. Place it in scripts/addons/modules and then type "import numpy" in Blender python console. It should be the same bit version (32 or 64) as your Blender installation. You can write your own python module that uses external C lib. Can say nothing about replacing standart python with jpython.
Reply with quote


stiv

Posted: Wed Nov 07, 2012 11:12 pm
Joined: 05 Aug 2003
Posts: 3493
The only catch for using external py modules is they must be Python 3. As long as they are in your PYTHONPATH (or sys.path), they can be imported.

One of the nice things about Python is that you can easily extend it with C/C++ modules to do the heavy lifting. Numpy is a fine example of this. So is Blender!

Replacing Blender's embedded Python interpreter with something can be done, but it would be "non-trivial", if you get my meaning.
Reply with quote


 
Jump to:  
Powered by phpBB © 2001, 2005 phpBB Group