Skip to content

Commit

Permalink
Release - v2.2.1
Browse files Browse the repository at this point in the history
  • Loading branch information
simon50keda committed Sep 24, 2021
1 parent becf03f commit 96f323d
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
2 changes: 1 addition & 1 deletion addon/io_scs_tools/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
7 changes: 4 additions & 3 deletions addon/io_scs_tools/utils/object.py
Original file line number Diff line number Diff line change
Expand Up @@ -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 "
Expand Down

0 comments on commit 96f323d

Please sign in to comment.