Until you can install blender and run it with python for the time being

I want to make various 3D models using blender

However, at this time, I thought that it would be fun if I could model automatically with python to some extent, but I tried to introduce blender and python, it is a memo writing.

environment

Machine specs

blender installation

Install directly from Blender's official website below. I used 2.79 until now, but I have installed the latest version of 2.83 by overwriting it.

https://www.blender.org

Launch blender

Start blender. You can open the application as it is, but I set it to open on the terminal anyway.

If blender exists on MacOS, it will be in the following path.

/Applications/Blender.app/Contents/MacOS/Blender

I made it possible to call it at any time through the path here. By the way, other initialization files and add-ons are also included in scripts directly under Contents.

スクリーンショット 2020-06-21 23.34.14.png

A screen like this was displayed. Blender is in English by default, but you can change it to Japanese. Edit → preferences → interface → Translation → Language

python with blender

Now that blender can be started with CUI, let's run python on blender. スクリーンショット 2020-06-21 23.35.31.png

By selecting "scripting" which is one of the tabs, the console screen and the editor screen are displayed in the upper left of the model view screen.

You can operate blender with python by typing python commands into this console.

I tried to make a prototype of the sea like that with the following command.

import bpy

#Object removal
bpy.ops.object.delete(use_global=False)
#Create a new object, this is a plane(Plane)
bpy.ops.mesh.primitive_plane_add(enter_editmode=False, align='WORLD')
#Add Ocean as modifier to object
bpy.ops.object.modifier_add(type='OCEAN')

スクリーンショット 2020-06-22 01.21.28.png

With this alone, it is faster to add the modifier manually ... It seems that the future is still long.

reference

https://docs.blender.org/api/current https://qiita.com/yassyskywalker/items/18e8541079bfae2af0e7

Recommended Posts

Until you can install blender and run it with python for the time being
Run with CentOS7 + Apache2.4 + Python3.6 for the time being
Until you install Caffe and run the sample
Use logger with Python for the time being
Until you install Python with pythonbrew and run Flask on a WSGI server
Until you can install your own Python library with pip
Until you run python with apache
Until you create a machine learning environment with Python on Windows 7 and run it
Until you install and run matplotlib
Understanding the python class Struggle (1) Let's move it for the time being
Until you build the environment with ABCI and run MaskTrack RCNN
Python Master RTA for the time being
Until you can use opencv with python
Run yolov4 "for the time being" on windows
I played with Floydhub for the time being
Until you run the changefinder sample in python
Run Blender with python
[Python] Measures and displays the time required for processing
Install selenium on Mac and try it with python
Install the latest stable Python with pyenv (both 2 and 3)
I will install Arch Linux for the time being.
Install tweepy with pip and use it for API 1.1
Until you install Anaconda for data analysis on your Mac and launch the IDE
[For beginners] You can do it from scratch! Creating APIs with AWS SAM and outputting OpenAPI documentation in Python
What you can do with the Python standard library statistics
Try and learn iptables, until you can browse the web
Install CaboCha in Ubuntu environment and call it with Python.
Install Python 2.7.9 and Python 3.4.x with pip.
How to install OpenCV on Cloud9 and run it in Python
Run mruby with Python or Blender
Consider what you can do with Python from the Qiita article
Understand the probabilities and statistics that can be used for progress management with a python program
See python for the first time
Let's touch Google's Vision API from Python for the time being
[TensorFlow] If you want to run TensorBoard, install it with pip
For the time being, I want to convert files with ffmpeg !!
Install lp_solve on Mac OS X and call it with python.
Easy modeling with Blender and Python
Python | What you can do with Python
Try using FireBase Cloud Firestore in Python for the time being
For the time being, the one who creates a homepage with Django at the speed of a second and publishes it on Heroku (Windows compatible)
A memo when creating an environment that can be debugged with Lambda @ Edge for the time being
Find out with Python and Stan how old a baseball player can hit a home run the most
You can also check the communication of DB and cache with curl
[Introduction to machine learning] Until you run the sample code with chainer
[Python] [Machine learning] Beginners without any knowledge try machine learning for the time being
How to get the date and time difference in seconds with python
I set the environment variable with Docker and displayed it in Python
Get and convert the current time in the system local timezone with python
Until you can borrow VPS with Conoha and authenticate public key with SSH
Impressions and memorandums when working with VS code for the first time
You can do it with Python! Structural analysis of two-dimensional colloidal crystals
I measured the speed of list comprehension, for and while with python2.7.
Until you can read the error log
Until you install your own Python library
MongoDB for the first time in Python
[Python] Wouldn't it be the best and highest if you could grasp the characteristics of a company with nlplot?
Made good with Python and xonsh so that you can see EC2 instances just by entering the shell
Prepare the development environment for Python on AWS Cloud9 (pip install & time change)
Make a Python program a daemon and run it automatically when the OS starts
If you guys in the scope kitchen can do it with a margin ~ ♪