1
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

Rickyアドカレ2024Advent Calendar 2024

Day 20

Blenderのアドオンの作り方解説

Last updated at Posted at 2024-12-24

目的
・pythonから機能を持った処理を実行する
・アドオンとしてメニューに表示する

環境
Blender 3.3.4
Windows11

BlenderのScriptingを選択
TemplatesからPython、BmeshSimpleEditmodeを選択
image.png

テンプレートが表示されるので適当なメッシュを選択した状態で実行するとメッシュが移動するのが確認できる。

# This example assumes we have a mesh object in edit-mode

import bpy
import bmesh

# Get the active mesh
obj = bpy.context.edit_object
me = obj.data


# Get a BMesh representation
bm = bmesh.from_edit_mesh(me)

bm.faces.active = None

# Modify the BMesh, can do anything here...
for v in bm.verts:
    v.co.x += 1.0


# Show the updates in the viewport
# and recalculate n-gon tessellation.
bmesh.update_edit_mesh(me, loop_triangles=True)

この記事ではBlenderのアドオンの作り方について解説しました

1
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?