From 96f323d3bdf2d8cb8ed7f882dcdf036277a802dd Mon Sep 17 00:00:00 2001 From: Simon Lusenc Date: Fri, 24 Sep 2021 14:01:37 +0200 Subject: [PATCH] Release - v2.2.1 --- addon/io_scs_tools/__init__.py | 2 +- addon/io_scs_tools/utils/object.py | 7 ++++--- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/addon/io_scs_tools/__init__.py b/addon/io_scs_tools/__init__.py index a87e620..bdce9ec 100644 --- a/addon/io_scs_tools/__init__.py +++ b/addon/io_scs_tools/__init__.py @@ -22,7 +22,7 @@ "name": "SCS Tools", "description": "Setup models, Import-Export SCS data format", "author": "Simon Lusenc (50keda), Milos Zajic (4museman)", - "version": (2, 2, "696fffa5"), + "version": (2, 2, "a3b485be"), "blender": (2, 90, 0), "location": "File > Import-Export", "wiki_url": "http://modding.scssoft.com/wiki/Documentation/Tools/SCS_Blender_Tools", diff --git a/addon/io_scs_tools/utils/object.py b/addon/io_scs_tools/utils/object.py index 3a85da8..a37d52b 100644 --- a/addon/io_scs_tools/utils/object.py +++ b/addon/io_scs_tools/utils/object.py @@ -870,10 +870,11 @@ def get_hookup_payload_string(locator): # calculate dot product between down and lamp direction, # to be able to calculate target distance to the ground based on given height. - lamp_q = loc_q.rotation_difference(root_q) - down_q = Quaternion((1, 0, 0), math.pi / 2) + lamp_q = root_q.rotation_difference(loc_q) + lamp_dir = lamp_q @ Vector((0.0, 1.0, 0.0)) # Y axis on locator is our forward direction + down_dir = Vector((0.0, 0.0, -1.0)) # -Z axis is our model down direction - lamp_down_dot = lamp_q.dot(down_q) + lamp_down_dot = lamp_dir.dot(down_dir) if lamp_down_dot < math.cos(math.radians(25)): lprint("E Lamp hookup payload for %r can not be exported.\n\t "