mirror of
https://git.code.sf.net/p/quake/quakeforge
synced 2025-01-19 07:20:50 +00:00
Correct vertex scaling for blender 2.62+
This also abandons support for older versions of blender.
This commit is contained in:
parent
bbd277cb72
commit
ab4aec47a7
1 changed files with 10 additions and 16 deletions
|
@ -33,14 +33,11 @@ def make_verts(mdl, framenum, subframenum=0):
|
||||||
verts = []
|
verts = []
|
||||||
s = Vector(mdl.scale)
|
s = Vector(mdl.scale)
|
||||||
o = Vector(mdl.scale_origin)
|
o = Vector(mdl.scale_origin)
|
||||||
m = Matrix(((s.x, 0, 0, 0),
|
m = Matrix(((s.x, 0, 0,o.x),
|
||||||
( 0,s.y, 0, 0),
|
( 0,s.y, 0,o.y),
|
||||||
( 0, 0,s.z, 0),
|
( 0, 0,s.z,o.z),
|
||||||
(o.x,o.y,o.z, 1)))
|
( 0, 0, 0, 1)))
|
||||||
for v in frame.verts:
|
for v in frame.verts:
|
||||||
try: #FIXME
|
|
||||||
verts.append(Vector(v.r) * m)
|
|
||||||
except ValueError:
|
|
||||||
verts.append(m * Vector(v.r))
|
verts.append(m * Vector(v.r))
|
||||||
return verts
|
return verts
|
||||||
|
|
||||||
|
@ -139,14 +136,11 @@ def make_shape_key(mdl, framenum, subframenum=0):
|
||||||
mdl.keys.append (frame.key)
|
mdl.keys.append (frame.key)
|
||||||
s = Vector(mdl.scale)
|
s = Vector(mdl.scale)
|
||||||
o = Vector(mdl.scale_origin)
|
o = Vector(mdl.scale_origin)
|
||||||
m = Matrix(((s.x, 0, 0, 0),
|
m = Matrix(((s.x, 0, 0,o.x),
|
||||||
( 0,s.y, 0, 0),
|
( 0,s.y, 0,o.y),
|
||||||
( 0, 0,s.z, 0),
|
( 0, 0,s.z,o.z),
|
||||||
(o.x,o.y,o.z, 1)))
|
( 0, 0, 0, 1)))
|
||||||
for i, v in enumerate(frame.verts):
|
for i, v in enumerate(frame.verts):
|
||||||
try: #FIXME
|
|
||||||
frame.key.data[i].co = Vector(v.r) * m
|
|
||||||
except ValueError:
|
|
||||||
frame.key.data[i].co = m * Vector(v.r)
|
frame.key.data[i].co = m * Vector(v.r)
|
||||||
|
|
||||||
def build_shape_keys(mdl):
|
def build_shape_keys(mdl):
|
||||||
|
|
Loading…
Reference in a new issue