mirror of
https://git.code.sf.net/p/quake/quakeforge
synced 2025-03-05 08:50:52 +00:00
Make the importer work in both 2.58 and svn blender.
This commit is contained in:
parent
67ba9129ed
commit
b00e865d4c
1 changed files with 14 additions and 5 deletions
|
@ -203,8 +203,10 @@ def make_verts(mdl, framenum, subframenum=0):
|
||||||
( 0, 0,s.z, 0),
|
( 0, 0,s.z, 0),
|
||||||
(o.x,o.y,o.z, 1)))
|
(o.x,o.y,o.z, 1)))
|
||||||
for v in frame.verts:
|
for v in frame.verts:
|
||||||
verts.append(Vector(v.r) * m)
|
try: #FIXME
|
||||||
#verts.append(m * Vector(v.r))
|
verts.append(Vector(v.r) * m)
|
||||||
|
except ValueError:
|
||||||
|
verts.append(m * Vector(v.r))
|
||||||
return verts
|
return verts
|
||||||
|
|
||||||
def make_faces(mdl):
|
def make_faces(mdl):
|
||||||
|
@ -245,7 +247,8 @@ def load_skins(mdl):
|
||||||
p[l + 2] = c[2] / 255.0
|
p[l + 2] = c[2] / 255.0
|
||||||
p[l + 3] = 1.0
|
p[l + 3] = 1.0
|
||||||
img.pixels[:] = p[:]
|
img.pixels[:] = p[:]
|
||||||
#img.pack(True)
|
if hasattr(img, "pack"):
|
||||||
|
img.pack(True)
|
||||||
|
|
||||||
mdl.images=[]
|
mdl.images=[]
|
||||||
for i, skin in enumerate(mdl.skins):
|
for i, skin in enumerate(mdl.skins):
|
||||||
|
@ -299,8 +302,10 @@ def make_shape_key(mdl, framenum, subframenum=0):
|
||||||
( 0, 0,s.z, 0),
|
( 0, 0,s.z, 0),
|
||||||
(o.x,o.y,o.z, 1)))
|
(o.x,o.y,o.z, 1)))
|
||||||
for i, v in enumerate(frame.verts):
|
for i, v in enumerate(frame.verts):
|
||||||
frame.key.data[i].co = Vector(v.r) * m
|
try: #FIXME
|
||||||
#frame.key.data[i].co = m * Vector(v.r)
|
frame.key.data[i].co = Vector(v.r) * m
|
||||||
|
except ValueError:
|
||||||
|
frame.key.data[i].co = m * Vector(v.r)
|
||||||
|
|
||||||
def build_shape_keys(mdl):
|
def build_shape_keys(mdl):
|
||||||
mdl.keys = []
|
mdl.keys = []
|
||||||
|
@ -404,6 +409,10 @@ def import_mdl(operator, context, filepath):
|
||||||
bpy.context.scene.objects.active = mdl.obj
|
bpy.context.scene.objects.active = mdl.obj
|
||||||
mdl.obj.select = True
|
mdl.obj.select = True
|
||||||
setup_skins (mdl, uvs)
|
setup_skins (mdl, uvs)
|
||||||
|
if mdl.images and not hasattr(mdl.images[0], "pack"):
|
||||||
|
operator.report({'WARNING'},
|
||||||
|
"Unable to pack skins. They must be packed by hand."
|
||||||
|
+" Some may have been lost")
|
||||||
if len(mdl.frames) > 1 or mdl.frames[0].type:
|
if len(mdl.frames) > 1 or mdl.frames[0].type:
|
||||||
build_shape_keys(mdl)
|
build_shape_keys(mdl)
|
||||||
merge_frames(mdl)
|
merge_frames(mdl)
|
||||||
|
|
Loading…
Reference in a new issue