PDA

View Full Version : array limits?


chrrox
01-21-2010, 12:34 AM
Hi I am trying to import a lot of files at one time but I am having max run out of memory (i think)
this is what i have for a command

Mydirectory ="E:\bg\0001"
filesarray = getfiles ( Mydirectory+ "\\*.obj" )
for file in filesarray do
(
f = fopen file "rb" --open file in read only format
p = getFilenamePath file

Do import here (

)
fclose f
)
i seem to be able to import around 50 objects at a time like this but if i don't do any importing max can list the files no problem

PEN
01-21-2010, 01:10 AM
Have you tried a gc() after each or after a set number of imports?

chrrox
01-21-2010, 01:46 AM
Thanks that helped me a lot :)
is there an easy way to get the variable of a folder so the user can select a folder and its stored as a variable?
Also is it possible to recursively search in sub folders also?

PEN
01-21-2010, 02:31 AM
Looks up external files in the help.

You will need a recursive function to get files from all sub folders.

CGTalk Moderation
01-21-2010, 02:31 AM
This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.