選択したオブジェクトの指定位置 移動スクリプト 20240324

 

 

 

このスクリプトは、選択されている全てのオブジェクトの中心位置を指定位置 (0, 1, 0) に移動します。

 

 

import bpy

# 移動先の座標を指定
target_location = (0, 1, 0)

# 選択されているオブジェクトのリストを取得
selected_objects = bpy.context.selected_objects

# 各選択オブジェクトの中心位置を指定位置に移動する
for obj in selected_objects:
    obj.location = target_location