From BlenderWiki

Jump to: navigation, search

[edit] Python, el lenguaje de scripting

Python es un lenguaje de scripting de propósito general y hay una interfaz especial para acceder a la totalidad de las funciones internas del Blender de ese idioma. La versión recomendada de Python es normalmente instalado y con la distribución, sin embargo, también puede descargar e instalar directamente desde Python, e instalar por separado. La mayoría de las funciones no se basan en Python, una excepción notable es el menú Ayuda, que abre un navegador web se refirió a una ubicación específica. Texto de ayuda no está incluido en Blender, usted debe descargar la última wiki o pdf manuales de usuario, que se encuentra aquí o en Blender.org.


Python is a general purpose scripting language and there is a special interface to access all of Blender's internal functions from that language. Scripts are written in this language that extend the functionality of Blender, without having to re-compile and link the binary distribution. These scripts are written by user-programmers. The recommended version of Python is normally included and installed with the distribution, however you may also download and install it directly from the official Python website, and install it separately. (When downloading Python separately, do pay attention to the version number, as the greater version number will need to match the version number that Blender was compiled on. The python version will be displayed in the console window when Blender starts. The supported python version for Blender as of the date for this edit will be Python 2.6) Most functions do not rely on Python; a notable exception is the Help menu which opens a web browser pointed to a specific location. Help text is not bundled into Blender; you must download the latest wiki or pdf user manuals, found here or at www.blender.org.

In general, wherever you install Python, you need to establish an operating system environment variable PYTHONPATH and point it to the Blender Scripts directory where python modules are installed, e.g. "C:\Program Files\Blender Foundation\Blender\scripts\bpymodules" for Windows machines. Environment Variables on Windows machines are set in the advanced Systems settings in the Control Panel.

When Blender starts on a machine with Blender properly installed, you will see this message in the console window:

 Compiled with Python version 2.5.
 Checking for installed Python... got it!
The above messages means that you have installed Python and have the full development and execution environment, and will be able to access, execute and run all Python scripts that are bundled or available for Blender. If you see a different message, such as:
Could not find platform independent libraries <prefix>
Could not find platform dependent libraries <exec_prefix>
Consider setting $PYTHONHOME to <prefix>[:<exec_prefix>]
'import site' failed; use -v for traceback
Checking for installed Python... No installed Python found.
Only built-in modules are available.  Some scripts may not run.
Continuing happily.
it just means that the full Python is not available. If you want full Python functionality, refer to the Python site for installation instructions.

When you install Blender, you must tell the Python module where you put the scripts. if you choose to put user data in a different location for each user, then the install will put your scripts in the

'C:\Users\<Current User>\AppData\Roaming\Blender Foundation\Blender\.blender\scripts' 

folder. If you are upgrading, you probably want to overwrite all your old scripts with the new versions, and not have several versions of the same script hanging around on your PC. The best place, if you will not be editing them, is to put them in your Program Files folder with Blender:

  1. Do a search on your machine for a file name with the words 'Scripts'.
  2. you will see the scripts folder appear after the initial search....C:\Program Files\Blender-2.46/.blender/scripts or something similar....
  3. open the script folder from the search window. you will see all the scripts. You can leave em there or put them on your desktop temporarily....
  4. Then go to program files, then to blender foundation, then blender folder, then make a new folder called scripts in the blender folder....
  5. Drag and drop or copy all the scripts from where ever you put them into this folder.
  6. Make sure to include the 2 module folders in the script file.
  7. Then, if you don't know this already, Open Blender
  8. In Blender, the top menu bar hides all the preferences. Drag it down and then you will see a button marked file paths.
  9. Once you click that File Paths button a set of path fields will be revealed.
  10. Go to the script one and drill down to the script folder you just created in blender where you put all the scripts.
  11. Then hit the button that says 'Select Script Paths'.
  12. Then go to the file menu and save as default setting so Blender will remember that the script folder is where you told it to look CtrlU
  13. Be careful though if you have already done stuff in blender at this point every time you start it it will be the default start up.