mirror of
https://github.com/H-uru/korman.git
synced 2025-07-15 10:54:18 +00:00
Remove utils.vector3
It's better use the built-in tuple unpacking
This commit is contained in:
@ -221,8 +221,8 @@ class MeshConverter:
|
|||||||
if coluv not in data.blender2gs[vertex]:
|
if coluv not in data.blender2gs[vertex]:
|
||||||
source = mesh.vertices[vertex]
|
source = mesh.vertices[vertex]
|
||||||
geoVertex = plGeometrySpan.TempVertex()
|
geoVertex = plGeometrySpan.TempVertex()
|
||||||
geoVertex.position = utils.vector3(source.co)
|
geoVertex.position = hsVector3(*source.co)
|
||||||
geoVertex.normal = utils.vector3(source.normal)
|
geoVertex.normal = hsVector3(*source.normal)
|
||||||
geoVertex.color = hsColor32(*vertex_color)
|
geoVertex.color = hsColor32(*vertex_color)
|
||||||
geoVertex.uvs = [hsVector3(uv[0], uv[1], 0.0) for uv in uvws]
|
geoVertex.uvs = [hsVector3(uv[0], uv[1], 0.0) for uv in uvws]
|
||||||
data.blender2gs[vertex][coluv] = len(data.vertices)
|
data.blender2gs[vertex][coluv] = len(data.vertices)
|
||||||
|
@ -33,7 +33,7 @@ class PhysicsConverter:
|
|||||||
# We can only use the plPhysical xforms if there is a CI...
|
# We can only use the plPhysical xforms if there is a CI...
|
||||||
if self._exporter().has_coordiface(bo):
|
if self._exporter().has_coordiface(bo):
|
||||||
mesh.update(calc_tessface=indices)
|
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())
|
physical.rot = utils.quaternion(mat.to_quaternion())
|
||||||
|
|
||||||
# Physicals can't have scale...
|
# Physicals can't have scale...
|
||||||
|
@ -32,7 +32,3 @@ def matrix44(blmat):
|
|||||||
def quaternion(blquat):
|
def quaternion(blquat):
|
||||||
"""Converts a mathutils.Quaternion to an hsQuat"""
|
"""Converts a mathutils.Quaternion to an hsQuat"""
|
||||||
return hsQuat(blquat.x, blquat.y, blquat.z, blquat.w)
|
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)
|
|
||||||
|
@ -112,8 +112,8 @@ class PlasmaAnimationModifier(PlasmaModifierProperties):
|
|||||||
# Decompose the matrix into the 90s-era 3ds max affine parts sillyness
|
# 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...
|
# All that's missing now is something like "(c) 1998 HeadSpin" oh wait...
|
||||||
affine = hsAffineParts()
|
affine = hsAffineParts()
|
||||||
affine.T = utils.vector3(matrix.to_translation())
|
affine.T = hsVector3(*matrix.to_translation())
|
||||||
affine.K = utils.vector3(matrix.to_scale())
|
affine.K = hsVector3(*matrix.to_scale())
|
||||||
affine.F = -1.0 if matrix.determinant() < 0.0 else 1.0
|
affine.F = -1.0 if matrix.determinant() < 0.0 else 1.0
|
||||||
rot = matrix.to_quaternion()
|
rot = matrix.to_quaternion()
|
||||||
affine.Q = utils.quaternion(rot)
|
affine.Q = utils.quaternion(rot)
|
||||||
|
Reference in New Issue
Block a user