Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
import bpy
import math
# 最も原点からの距離が遠いobjの要素番号を抽出
max_distance_index = distance_lists.index(max(distance_lists))
for obj in bpy.context.view_layer.objects:
# 最も原点からの距離が遠いobjのxとyの座標分だけ、引き算する。これで原点に近づける
if obj.type == 'MESH':
obj.location.x = obj.location.x - pos_lists[max_distance_index][0]
obj.location.y = obj.location.y - pos_lists[max_distance_index][1]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment