Blender 2.9 Python Extrude extrude

Today's challenge is the extrusion function. Even if I search for "extrude blender 2.8 python" etc., it seems that there are few codes using extrude in blender 2.8 (2.9) in both English and Japanese. One of the few materials is the suzulang material "Making arrows with Blender 2.8 python". Read this carefully. Interpret that if you enter a number like step 1 oshidashi part in "Blender 2.8 Make an arrow with python" extrude_region_move (TRANSFORM_OT_translate = {"value": [1.0, 0.0, 3.0]}) , I managed to do it by trial and error from there I succeeded in extruding one side of the Cube and repeating it. bpy_extrude1.png

import bpy
import math
import bmesh
bpy.ops.mesh.primitive_cube_add(location=(1,0,3), size = 2) # === create a cube
#Switch to edit mode.
bpy.ops.object.mode_set(mode='EDIT')
#Deselect all meshes.
bpy.ops.mesh.select_all(action='DESELECT')
'''Switch to face mode,One side...oshidashi '''
#Set to face mode.
bpy.ops.mesh.select_mode(type="FACE")

#Instantiation of bmesh object.
b_mesh = bmesh.from_edit_mesh(bpy.context.object.data)
b_mesh.faces.ensure_lookup_table()
b_mesh.faces[3].select = True # ===  face number (3) south face 

bpy.ops.mesh.extrude_region_move(TRANSFORM_OT_translate={"value":[ -0.5 , -1.0 , 0.5]} )
bpy.ops.mesh.extrude_region_move(TRANSFORM_OT_translate={"value":[ -0.5 , -1.0 , -0.5]} )
bpy.ops.mesh.extrude_region_move(TRANSFORM_OT_translate={"value":[ -0.5 , -1.0 , 0.5]} )
bpy.ops.mesh.extrude_region_move(TRANSFORM_OT_translate={"value":[ -0.5 , -1.0 , -0.5]} )

Recommended Posts

Blender 2.9 Python Extrude extrude
blender, python, spiral staircase
Run Blender with python
blender, python, sphere behavior
Blender 2.8, Python Cube Scaling
Operate Blender with Python
[Blender x Python] Blender Python tips (11/100)
Python
blender, python, spiral staircase, color
Blender 2.9, Python Odd Even Building
Blender 2.9, Python, hexadecimal color specification
Blender 2.8, Python, light Spot lighting
Blender Python API in Houdini (Python 3)
Generate 8 * 8 (64) cubes in Blender Python
Draw Sine Waves in Blender Python
Blender 2.8, Python Cube, Lighting, Camera Circumference
Run mruby with Python or Blender
Install Pytorch on Blender 2.90 python on Windows
[Blender x Python] Particle Animation (Part 1)
Use blender as a python module
[Blender x Python] Let's master random !!
[Blender x Python] Let's master rotation !!
Access Blender Shader Nodes from Python
Easy modeling with Blender and Python
Get started with Python in Blender
Blender 2.9, Python background light color test
kafka python
Python Summary
Built-in python
Python comprehension
Python technique
Studying python
Build an environment for Blender built-in Python
Python 2.7 Countdown
Python FlowFishMaster
Python service
python tips
[Blender x Python] Let's master the material !!
python function ①
Python basics
Python memo
ufo-> python (3)
Python comprehension
install python
Python basics ④
Python Memorandum 2
python memo
Python Jinja2
Python increment
atCoder 173 Python
[Python] function
Python installation
python tips
Installing Python 3.4.3.
Python memo
Python iterative
Python algorithm
Python2 + word2vec
[Python] Variables
Python functions
Python sys.intern ()