Skip to content

Instantly share code, notes, and snippets.

@flushpot1125
Created July 25, 2021 11:40
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save flushpot1125/e90fa1e2f31f6fad30ca2ce87279335f to your computer and use it in GitHub Desktop.
Save flushpot1125/e90fa1e2f31f6fad30ca2ce87279335f to your computer and use it in GitHub Desktop.
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