[Blender x Python] Let's get started with Blender Python !!

table of contents

  1. What is Python?
  2. How to get started with Blender Python
  3. Run the program
  4. How to save Finally

0. What is Python?

Python is one of the programming languages. It has the feature of ** simple and easy to read ** compared to other languages. Computational and rich in available ** libraries **.


Point: ** Library ** A useful ** code collection ** that someone has put together

Point: ** Code ** ** Instructions ** to a computer


1. How to get started with Blender Python

1-0. Blender version

◯ ** Version 2.91.0 ** will be used for explanation.


1-1. Get ready to write code

1-1-0. Open Blender. 1-1-1. Click ** Scripting **. スクリーンショット 2020-11-09 18.53.58.png

1-1-2. Click the "+ New" button. スクリーンショット 2020-11-09 18.24.29.png

1-1-3. Click "Text" to change it to ~ .py. スクリーンショット 2020-11-09 18.56.33.png

スクリーンショット 2020-11-09 18.58.05.png

Now you're ready to write code in a text editor!


1-2. About layout

● 3D Viewport: Where to edit in 3D ● Python Console: A place to test short code ● Info: Where to display what you have done ● Text Editor: Where to edit the code

スクリーンショット 2020-11-09 19.06.09.png


2. Run the program

2-0. Use Text Editor

◯ Use the Text Editor to add the monkey to the (0,0,5) point of the 3D Viewport.


2-0-0: ** @ 3D Viewport **: Delete the default cube with the X key. 2-0-1: ** @ 3D Viewport **: Select shift + A key → Mesh → monkey. 2-0-2: ** @ Info **: The code for adding monkey is displayed. Right-click and copy it. スクリーンショット 2020-11-09 19.35.11.png

2-0-3: ** @ Text Editor **: Right-click or command + V to paste. 2-0-4: ** @ Text Editor **: Change the appearance coordinates of monkey.

スクリーンショット 2020-11-09 19.50.39.png

2-0-5: ** @ Text Editor **: Write import bpy on the first line.

スクリーンショット 2020-11-09 19.42.20.png

2-0-6: ** @ Text Editor **: Press the play button to execute the code.

スクリーンショット 2020-11-09 19.42.20.png

2-0-7: ** @ 3D Viewport **: Check if the monkey appears at the specified position.

スクリーンショット 2020-11-09 19.55.56.png


2-1. Use Python Console

◯ Use the Python Console to add a large monkey to the (0,5,0) point in the 3D Viewport.


2-1-0: ** @ Text Editor **: Change size to 5 and location to (0,5,0) and copy the code.

スクリーンショット 2020-11-09 20.40.00.png

2-1-1: ** @ Python Console **: Paste the code and press Enter.

スクリーンショット 2020-11-09 20.45.34.png

2-1-2: ** @ 3D Viewport **: Check if a large monkey appears. スクリーンショット 2020-11-09 20.47.15.png


3. How to save

3-0. Save the whole

File → Save As → Save as ~ .blend


3-1. Save only the code

3-1-0: Click Text → Save As.

スクリーンショット 2020-11-09 20.08.11.png

3-1-1: Select the location (folder) you want to save and press Sava As to save.

スクリーンショット 2020-11-09 20.10.17.png

Finally

The details of the code will be explained in the next article. All operations are displayed as code in ** Info **, so please try various things !!

I want to make a good article, so I would be grateful if you could give me a lot of opinions on twitter etc. Thank you!!

Recommended Posts

[Blender x Python] Let's get started with Blender Python !!
Get started with Python in Blender
Get started with Python! ~ ② Grammar ~
I tried to get started with blender python script_Part 01
I tried to get started with blender python script_Part 02
Get started with Python! ~ ① Environment construction ~
Link to get started with python
How to get started with Python
[Blender x Python] Let's master rotation !!
Let's get started with Python ~ Building an environment on Windows 10 ~
[Blender x Python] Let's master the material !!
Get Started with TopCoder in Python (2020 Edition)
How Python beginners get started with Python with Progete
Let's get along with Python # 0 (Environment construction)
Get started with the Python framework Django on Mac OS X
Django 1.11 started with Python3.6
1.1 Getting Started with Python
Getting Started with Python
Run Blender with python
Get started with MicroPython
Get date with python
Getting Started with Python
[Blender x Python] Blender Python tips (11/100)
Get started with Python on macOS Big Sur
A layman wants to get started with Python
[Blender x Python] Think of code with symbols
[Cloud102] # 1 Let's get started with Python (Part 2 Jupyter Notebook Construction AWS Edition)
Get country code with python
x86 compiler self-made with python
Getting Started with Python Functions
Get started with Django! ~ Tutorial ⑤ ~
Get Twitter timeline with python
Get started with influxDB + Grafana
Let's run Excel with Python
Get Youtube data with python
Getting Started with Python Django (1)
Getting Started with Python Django (4)
Getting Started with Python Django (3)
Get started with Django! ~ Tutorial ⑥ ~
Let's write python with cinema4d.
Get thread ID with python
Getting Started with Python Django (6)
Get stock price with Python
Get home directory with python
Get keyboard events with python
IfcOpenShell python bindings get started
Python3 | Getting Started with numpy
Getting Started with Python Django (5)
Get Alembic information with Python
❤️ Bloggers ❤️ "Beloved BI" ❤️ Let's get started ❤️ (For those who can make charts with Python)
Minimum knowledge to get started with the Python logging module
[Python x Zapier] Get alert information and notify with Slack
Install Python 2.7.9 and Python 3.4.x with pip.
Get reviews with python googlemap api
Let's make a GUI with python.
Get started with MicroPython (on macOS)
Run mruby with Python or Blender
Getting Started with Python for PHPer-Classes
Get web screen capture with python
Get the weather with Python requests 2
[Python] Get economic data with DataReader