Notifications
Clear all

[Closed] transform matrix problem

It is an ASCII file format and python is much faster, try a litle test 1 mill iteration (50MB) takes 80 sec with maxscript and takes about 0.5 sec with python.

objfile = creteatefile…
for i=1 to 1 mill do (
format “jldbhjdbd” to:objfile
)
close objfile

py version is the same with
objfile = open(…)
for k in range(1,1 mill):
objfile.write(…)
objfile.close

I don’t have python to give it a go, but why do you access the file for every loop?!
Save everything in memory and write the file at once.

for examples:


stringVar = ""
for i=1 to 1 mill do (
      stringVar += "jldbhjdbd"
)
objfile = creteatefile...
format "jldbhjdbd" to:objfile
close objfile

Page 2 / 2