0
$\begingroup$

I am new to Python and Blender and would like to know:

  1. How to convert Blender scripts (bpy) to Python scripts (py)?
  2. What is the difference between Blender scripts and Python scripts?
$\endgroup$
1
  • 1
    $\begingroup$ Hi and welcome! I did revert your edit because the context got lost for future visitors. How this site works: blender.stackexchange.com/tour. If you have another question, please ask a new one, Thanks. $\endgroup$ – brockmann Oct 15 '20 at 14:54
2
$\begingroup$

Scripts written for Blender are Python scripts (*.py). The difference is that they may use Blender's API through import bpy which is not available to a regular Python interpreter out of the box. If the script is using anything from the bpy namespace it can't be executed outside of Blender, that is unless you build and install Blender as a Python module. In this case you get (limited) access to Blender's Python API to functionality that does not require a UI. As long as a Python script does not use Blender's API, then it can be executed by a regular Python interpreter without any modifications.


How to convert Blender scripts to Python scripts?

You don't. If it uses Blender's API you can either execute it in Blender or you have to install Blender as Python module for your Python interpreter.

What is the difference between Blender scripts and Python scripts?

The use of Blender's API is the difference. Other than that they are just regular Python scripts, the programming language is the same.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.