![]() ![]() The obvious way, import some_module command from the text editor or interactive console. Typed or pasted into the interactive console.Įxecute a Python file from the command line with Blender, e.g: Loaded in the text editor and press Run Script. Here are some ways to run scripts directly in Blender: Inside the module and can be accessed later on by importing that module again.įor this reason it is preferable to avoid directly executing scripts that extend Blender by registering classes. When a script is imported as a module, its class instances will remain (to unregister them for example) more difficult compared to importing the scripts as modules. Using scripts this way makes future access to their classes ![]() Remain available inside Blender after the script finishes execution. This may seem obvious, but it is important to note the difference betweenĮxecuting a script directly and importing a script as a module.Įxtending Blender by executing a script directly means the classes that the script defines The exact location of this directory depends on your installation. On startup Blender scans the scripts/startup/ directory for Python modules and imports them. Scene manipulation, automation, defining your own tool set and customization. Typical usage for scripts include: user interface, import/export, Many Python scripts come bundled with Blender and can be used as a referenceīecause they use the same API that script authors write tools in. When developing your own scripts it may help to understand how Blender sets up its Python environment. When you run this in the interactive console you will see the 3D Viewport update. This modifies Blender’s internal data directly. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |