forked from bartvdbraak/blender
remove xreadline, some other small updates (testing new svn)
This commit is contained in:
parent
0059e5118d
commit
9fec189e7a
@ -1,7 +1,7 @@
|
|||||||
#!BPY
|
#!BPY
|
||||||
|
|
||||||
"""
|
"""
|
||||||
Name: 'Save Mesh as MDD'
|
Name: 'Vertex Keyframe Animation (.mdd)...'
|
||||||
Blender: 242
|
Blender: 242
|
||||||
Group: 'Export'
|
Group: 'Export'
|
||||||
Tooltip: 'Animated mesh to MDD vertex keyframe file.'
|
Tooltip: 'Animated mesh to MDD vertex keyframe file.'
|
||||||
@ -36,7 +36,7 @@ Be sure not to use modifiers that change the number or order of verts in the mes
|
|||||||
#
|
#
|
||||||
# ***** END GPL LICENCE BLOCK *****
|
# ***** END GPL LICENCE BLOCK *****
|
||||||
|
|
||||||
|
import bpy
|
||||||
import Blender
|
import Blender
|
||||||
from Blender import *
|
from Blender import *
|
||||||
import BPyMessages
|
import BPyMessages
|
||||||
@ -118,7 +118,7 @@ def mdd_export_ui(filepath):
|
|||||||
if not BPyMessages.Warning_SaveOver(filepath):
|
if not BPyMessages.Warning_SaveOver(filepath):
|
||||||
return
|
return
|
||||||
|
|
||||||
scn= Scene.GetCurrent()
|
scn= bpy.data.scenes.active
|
||||||
ob_act= scn.objects.active
|
ob_act= scn.objects.active
|
||||||
if not ob_act or ob_act.type != 'Mesh':
|
if not ob_act or ob_act.type != 'Mesh':
|
||||||
BPyMessages.Error_NoMeshActive()
|
BPyMessages.Error_NoMeshActive()
|
||||||
|
@ -183,7 +183,7 @@ def create_materials(filepath, material_libs, unique_materials, unique_material_
|
|||||||
#print '\t\tloading mtl: "%s"' % mtlpath
|
#print '\t\tloading mtl: "%s"' % mtlpath
|
||||||
context_material= None
|
context_material= None
|
||||||
mtl= open(mtlpath)
|
mtl= open(mtlpath)
|
||||||
for line in mtl.xreadlines():
|
for line in mtl: #.xreadlines():
|
||||||
if line.startswith('newmtl'):
|
if line.startswith('newmtl'):
|
||||||
context_material_name= line_value(line.split())
|
context_material_name= line_value(line.split())
|
||||||
if unique_materials.has_key(context_material_name):
|
if unique_materials.has_key(context_material_name):
|
||||||
@ -536,7 +536,7 @@ def get_float_func(filepath):
|
|||||||
- weather to replace commas or not
|
- weather to replace commas or not
|
||||||
'''
|
'''
|
||||||
file= open(filepath, 'r')
|
file= open(filepath, 'r')
|
||||||
for line in file.xreadlines():
|
for line in file: #.xreadlines():
|
||||||
if line.startswith('v'): # vn vt v
|
if line.startswith('v'): # vn vt v
|
||||||
if ',' in line:
|
if ',' in line:
|
||||||
return lambda f: float(f.replace(',', '.'))
|
return lambda f: float(f.replace(',', '.'))
|
||||||
@ -586,7 +586,7 @@ def load_obj(filepath, CLAMP_SIZE= 0.0, CREATE_FGONS= True, CREATE_SMOOTH_GROUPS
|
|||||||
print '\tpassing obj file "%s"...' % filepath,
|
print '\tpassing obj file "%s"...' % filepath,
|
||||||
time_sub= sys.time()
|
time_sub= sys.time()
|
||||||
file= open(filepath, 'r')
|
file= open(filepath, 'r')
|
||||||
for line in file.xreadlines():
|
for line in file: #.xreadlines():
|
||||||
|
|
||||||
if line.startswith('v '):
|
if line.startswith('v '):
|
||||||
line_split= line.split()
|
line_split= line.split()
|
||||||
|
@ -68,7 +68,7 @@ def read(filename):
|
|||||||
file = open(filename, "rb")
|
file = open(filename, "rb")
|
||||||
|
|
||||||
raw = []
|
raw = []
|
||||||
for line in file.xreadlines():
|
for line in file: #.xreadlines():
|
||||||
data = line.split()
|
data = line.split()
|
||||||
if data[0] == "vertex":
|
if data[0] == "vertex":
|
||||||
vert = map(float, data[1:])
|
vert = map(float, data[1:])
|
||||||
|
Loading…
Reference in New Issue
Block a user