Created
July 25, 2021 11:37
-
-
Save flushpot1125/4d9adb72233f2d6a643104884372a286 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 | |
# それぞれの建物メッシュの原点からの距離を計算した結果を格納する | |
distance_lists =[] | |
# 各メッシュのx,y座標 | |
pos_lists =[] | |
# Blenderに表示されている全てのメッシュxとy座標を取得して、distanceを計算して配列に格納する | |
for obj in bpy.context.view_layer.objects: | |
if obj.type == 'MESH': | |
pos_lists.append([obj.location.x,obj.location.y]) | |
distance = obj.location.x * obj.location.x + obj.location.y * obj.location.y | |
distance_lists.append(math.sqrt(distance)) | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment