Note, we have some example Python tests here: https://developer.blender.org/diffusion/B/browse/master/tests/python/
eg: https://developer.blender.org/diffusion/B/browse/master/tests/python/bl_pyapi_mathutils.py I've been using Python unittest module recently and its quite useful, however this does rely on you being able to automate your script so interface, cursor-events etc can be bypassed. On Wed, Dec 3, 2014 at 10:19 PM, Sybren A. Stüvel <[email protected]> wrote: > On Wed, Dec 03, 2014 at 12:53:33PM -0700, Dan Eicher wrote: >>> Secondly, when I open a script in the Blender Text Editor to run, and I'm >>> using an external module or package, how do I add that module / package to >>> the path? Right now, in my script, `import foo` just gets me `No module >>> named foo`. > > This is due to the current working directory being set to Blender's > directory, and not the directory of the .blend file. > >> I tend to use sys.path.append() a lot since fedora doesn't have >> /usr/local/lib in python's default path but you can also drop the >> module in blender's addon module directory too. Not really sure how >> it works when python is bundled with blender though... > > Loading your script as an add-on gives the added advantage that you > can press F8 to reload it. However, usually I want to put my .blend > file and Python scripts in the same directory. If you want to do that > too, take a look at the approach I describe at > http://stuvel.eu/blog/203/reloading-your-code-in-blender This gives > you a setup that allows you to load modules from the same directory as > your .blend file, and easily reload your code. The reloading isn't > flawless, but it works most of the time ;-) > > > -- > Sybren A. Stüvel > > http://stuvelfoto.nl/ > http://stuvel.eu/ > > _______________________________________________ > Bf-python mailing list > [email protected] > http://lists.blender.org/mailman/listinfo/bf-python > -- - Campbell _______________________________________________ Bf-python mailing list [email protected] http://lists.blender.org/mailman/listinfo/bf-python
