Browse Source

Remove utils.vector3

It's better use the built-in tuple unpacking
pull/10/head
Adam Johnson 10 years ago
parent
commit
8113be8da6
  1. 4
      korman/exporter/mesh.py
  2. 2
      korman/exporter/physics.py
  3. 4
      korman/exporter/utils.py
  4. 4
      korman/properties/modifiers/anim.py

4
korman/exporter/mesh.py

@ -221,8 +221,8 @@ class MeshConverter:
if coluv not in data.blender2gs[vertex]:
source = mesh.vertices[vertex]
geoVertex = plGeometrySpan.TempVertex()
geoVertex.position = utils.vector3(source.co)
geoVertex.normal = utils.vector3(source.normal)
geoVertex.position = hsVector3(*source.co)
geoVertex.normal = hsVector3(*source.normal)
geoVertex.color = hsColor32(*vertex_color)
geoVertex.uvs = [hsVector3(uv[0], uv[1], 0.0) for uv in uvws]
data.blender2gs[vertex][coluv] = len(data.vertices)

2
korman/exporter/physics.py

@ -33,7 +33,7 @@ class PhysicsConverter:
# We can only use the plPhysical xforms if there is a CI...
if self._exporter().has_coordiface(bo):
mesh.update(calc_tessface=indices)
physical.pos = utils.vector3(mat.to_translation())
physical.pos = hsVector3(*mat.to_translation())
physical.rot = utils.quaternion(mat.to_quaternion())
# Physicals can't have scale...

4
korman/exporter/utils.py

@ -32,7 +32,3 @@ def matrix44(blmat):
def quaternion(blquat):
"""Converts a mathutils.Quaternion to an hsQuat"""
return hsQuat(blquat.x, blquat.y, blquat.z, blquat.w)
def vector3(blvec):
"""Converts a mathutils.Vector to an hsVector3"""
return hsVector3(blvec.x, blvec.y, blvec.z)

4
korman/properties/modifiers/anim.py

@ -112,8 +112,8 @@ class PlasmaAnimationModifier(PlasmaModifierProperties):
# Decompose the matrix into the 90s-era 3ds max affine parts sillyness
# All that's missing now is something like "(c) 1998 HeadSpin" oh wait...
affine = hsAffineParts()
affine.T = utils.vector3(matrix.to_translation())
affine.K = utils.vector3(matrix.to_scale())
affine.T = hsVector3(*matrix.to_translation())
affine.K = hsVector3(*matrix.to_scale())
affine.F = -1.0 if matrix.determinant() < 0.0 else 1.0
rot = matrix.to_quaternion()
affine.Q = utils.quaternion(rot)

Loading…
Cancel
Save