end0tknr's kipple - web写経開発

太宰府天満宮の狛犬って、妙にカワイイ

2022-10-21から1日間の記事一覧

blender python による objectの交錯判定は mathutils.bvhtree の overlap()

で、できるみたい。 そのうち試すかもしれないので、メモ https://www.kabuku.co.jp/developers/blender2minecraft-by-python https://blender.stackexchange.com/questions/253355/collision-detection

blender python で、Boolean モディファイア による objectの差分作成

import bpy import copy import math import bmesh import sys from mathutils import Vector def main(): #全object削除 remove_all_obj() bpy.ops.mesh.primitive_cube_add() bpy.ops.mesh.primitive_cube_add(location = (1,1,1)) boolean("Cube") def bo…

blender python で、meshにmirror modifier適用

import bpy import copy import math import bmesh import sys from mathutils import Vector def main(): #全object削除 remove_all_obj() #球追加 new_obj = add_sphere() # mirror適用 set_mirror_modifier( new_obj.name ) def set_mirror_modifier( obj…

blender python で、meshの縁のedgeを選択

import bpy import copy import math import bmesh import sys from mathutils import Vector def main(): select_end_edge( "Cube" ) # 縁の辺を選択 def select_end_edge( obj_name ) -> bool: # 一旦、全てを選択解除 for ob in bpy.context.scene.object…

blender python で、meshにある穴を補完 (面貼り)

import bpy import copy import math import bmesh import sys from mathutils import Vector def main(): touchup_mesh_object( "Cube" ) def touchup_mesh_object( obj_name ): for ob in bpy.context.scene.objects: # 一旦、全選択を解除 ob.select_set(…

blender python で いろいろ処理

詳細は、script内のcommentの通り 以下のurlも参考になります BlenderをPythonで操作する - Qiita Blender PythonのMeshデータアクセスのチートシート - Qiita Blender bpy でvertexとfaceとedgeを追加 | ぬの部屋(仮) import bpy import copy import math…

blender python で 原点変更や objectのsize変更やmeshの結合

import bpy import copy import math import bmesh import sys from mathutils import Vector def main(): #全object削除 remove_all_obj() #cube 追加 new_obj_1 = add_cube_1() new_obj_2 = add_cube_2() # objectの原点位置を変更 (object自体は移動しま…

blender python による meshの自動追加 2種類

import bpy import math import bmesh import sys from mathutils import Vector def main(): #全object削除 remove_all_obj() #cube 追加 add_cube_1() add_cube_2() def add_cube_1(): bpy.ops.mesh.primitive_cube_add( size=1.0, align='WORLD', locatio…