Created
July 25, 2021 11:40
-
-
Save flushpot1125/e90fa1e2f31f6fad30ca2ce87279335f to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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