I installed Blender 2.6 and I'm trying to run a script called drawcar.py (Which uses PyOpenGL)
I looked around the documentation for importing a script and could only access Blender's python console.
How do I run drawcar.py from the Linux terminal with Blender?
Most areas of Blender can be scripted, including animation, rendering, import and export, object creation and automating repetitive tasks. To interact with Blender, scripts can make use of the tightly integrated API .
Accessing Built-in Python ConsoleBy pressing Shift-F4 in any Blender Editor type (3D View, Timeline etc.,) you can change it to a Console Editor. From the screenshot above, you will notice that apart from the usual hot keys that are used to navigate, by pressing Ctrl-Spacebar you can enable Auto-complete feature.
You can also execute the following code in the python console to execute an external script without opening it up in the text editor:
filename = "/full/path/to/myscript.py" exec(compile(open(filename).read(), filename, 'exec'))
The above code comes from the following link:
Blender - Tips and Tricks
P.s. Instead of opening a file in step 2, you can also hit the "+ New" button and create a new script instead.
Note : In newer versions the Run Script button label has been replaced with a Play icon :
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With