Browse Source

Merge pull request #243 from Jrius/layer_offset_fix

Convert layer offsets to Plasma's space
pull/249/head
Adam Johnson 3 years ago committed by GitHub
parent
commit
32147354fc
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 5
      korman/exporter/animation.py
  2. 5
      korman/exporter/material.py

5
korman/exporter/animation.py

@ -427,8 +427,11 @@ class AnimationConverter:
pos = kwargs[pos_path]
scale = kwargs[scale_path]
translation = hsVector3(pos[0] - (scale[0] - 1.0) / 2.0,
-pos[1] - (scale[1] - 1.0) / 2.0,
pos[2] - (scale[2] - 1.0) / 2.0)
matrix = hsMatrix44()
matrix.setTranslate(hsVector3(*pos))
matrix.setTranslate(translation)
matrix.setScale(hsVector3(*scale))
return matrix

5
korman/exporter/material.py

@ -425,7 +425,10 @@ class MaterialConverter:
# Transform
xform = hsMatrix44()
xform.setTranslate(hsVector3(*slot.offset))
translation = hsVector3(slot.offset.x - (slot.scale.x - 1.0) / 2.0,
-slot.offset.y - (slot.scale.y - 1.0) / 2.0,
slot.offset.z - (slot.scale.z - 1.0) / 2.0)
xform.setTranslate(translation)
xform.setScale(hsVector3(*slot.scale))
layer.transform = xform

Loading…
Cancel
Save