Skip to content
Snippets Groups Projects
Commit d0a22bcf authored by Florian Meyer's avatar Florian Meyer
Browse files

update for changes to python 3.2

parent 6fb871e1
No related branches found
No related tags found
No related merge requests found
...@@ -60,14 +60,14 @@ def do_export(context, props, filepath): ...@@ -60,14 +60,14 @@ def do_export(context, props, filepath):
end = props.range_end end = props.range_end
sampling = float(props.sampling) sampling = float(props.sampling)
apply_modifiers = props.apply_modifiers apply_modifiers = props.apply_modifiers
me = ob.to_mesh(sc, apply_modifiers, 'PREVIEW') me = ob.create_mesh(sc, apply_modifiers, 'PREVIEW')
vertCount = len(me.vertices) vertCount = len(me.vertices)
sampletimes = getSampling(start, end, sampling) sampletimes = getSampling(start, end, sampling)
sampleCount = len(sampletimes) sampleCount = len(sampletimes)
# Create the header # Create the header
headerFormat='<12ciiffi' headerFormat='<12siiffi'
headerStr = struct.pack(headerFormat, 'P','O','I','N','T','C','A','C','H','E','2','\0', headerStr = struct.pack(headerFormat, b'POINTCACHE2\0',
1, vertCount, start, sampling, sampleCount) 1, vertCount, start, sampling, sampleCount)
file = open(filepath, "wb") file = open(filepath, "wb")
...@@ -75,7 +75,7 @@ def do_export(context, props, filepath): ...@@ -75,7 +75,7 @@ def do_export(context, props, filepath):
for frame in sampletimes: for frame in sampletimes:
sc.frame_set(frame) sc.frame_set(frame)
me = ob.to_mesh(sc, apply_modifiers, 'PREVIEW') me = ob.create_mesh(sc, apply_modifiers, 'PREVIEW')
if len(me.vertices) != vertCount: if len(me.vertices) != vertCount:
file.close() file.close()
...@@ -200,4 +200,4 @@ def unregister(): ...@@ -200,4 +200,4 @@ def unregister():
#bpy.types.VIEW3D_PT_tools_objectmode.remove(menu_func) #bpy.types.VIEW3D_PT_tools_objectmode.remove(menu_func)
if __name__ == "__main__": if __name__ == "__main__":
register() register()
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment