Importum Transfunctioner

The Importum Transfunctioner, is a very simple and powerful script that will help you separate script development from script usage inside Blender. This way you can manage your pipeline more efficiently and help the collaboration between art and development departments.

How this works is that you simply provide directory paths where scripts are located and also script filenames you want to import as modules. The imported modules can be reused anywhere in Blender, plus optionally call their default function (named main) to automatically invoke any code.

Advantages

  • Use your favorite IDE for increased productivity (e.g. Ninja IDE)
  • Use a versioning system for tracking progress and collaboration
  • Keep all of your scripts centralized and organized in one place
  • Better reusability, you will avoid using duplicates of same scripts over and over again
  • No maintenance, Blender will load your scripts on the fly and they will be always up to date
  • No fear of loosing your script work if Blender crashes

Disadvantages

  • You will have to bring all of your scripts outside Blender (see for yourself what it suits your style).
  • You will have to switch between your IDE and Blender to try scripts.
  • Perhaps no good for deployment (not as useful as Add-ons).

Features

Dynamic Variables
When you define inclusion paths in Importum Transfunctioner, you can add special dynamic variables inside bracket characters {…}, this will result to string replacement operations.
Currently supported variables:
CWD - Is the full path of the .blend file currently open.Example, let’s say the location of the blend file isC:/MyProjects/AlphaProject/test.blend
‘{CWD}’ will give C:/MyProjects/AlphaProject
‘{CWD}/…’
will give C:/MyProjects

‘{CWD}/scripts’ will give C:/MyProjects/AlphaProject/scripts

Download Python Script
https://docs.google.com/file/d/0B0YtvOk65FM1b1hzMFlJX1Uya2s/edit?usp=sharing
Download Examples
https://docs.google.com/file/d/0B0YtvOk65FM1MTlWRl9LTXVjaTQ/edit?usp=sharing

Feel free to provide recommendations, feedback is always welcomed.

Log:
5 Aug 2013: Minor changes, updated documentation, and examples merged into a single archive.
8 Aug 2013: Added search tags to this page

Search Tags: python load module from path, python load module dynamically, python dynamic module import

  • Message removed -