Notifications
Clear all

[Closed] Huge array cause 3dsmax freeze

Hi
Does anyone have the same issue like me?I have a project need to import a huge array,then execute them to translate into 3dsmax,I am sure codes is no problem ,but the 3dsmax sometimes to freezing when executing(importing…) few times works fine.the codes like below:

Fn reading_data=
(
...import data
)
get_import_data=#() --store data to array
get_import_data=reading_data()
for i=1 to get_import_data.count do (execute get_import_data[i])

I don’t know how to avoid it ,it took me several weeks and no solutions,does anybody give me a suggestion?
BTW,I tested it’s may the fast way to import data to 3dsmax,so I choose array to handle.

6 Replies

what is the type of data file?

what is the type of data storing in an array?

probably you can execute imported data directly from the stream.

1 Reply
(@momo2012)
Joined: 11 months ago

Posts: 0

The data has long strings like rollout or functions:
array[1]=

rollout test “”
(
label test “you are master”
button test_button “”
)

array[2]=

Fn Heros=
(
a=1
b=2
c=3
)

I just searched google:

Execute
Tests whether it is faster to convert a string to a maxscript value via execute, or other ways. 300,000 iterations.
2740 ms for execute “#{1…10}”
2530 ms for readvalue (“#{1…10}” as stringstream)
4230 ms for execute ((“[1.000000000,1.000000000,1.000000000,1.000000000]”))
3937 ms for readvalue (“[1.000000000,1.000000000,1.000000000,1.000000000]” as stringstream)
So it turns out the conversion to stringstream with readvalue is faster than using execute. Longer strings/expressions will need to be tested as well, such as a rollout.

I need to test stream whether or not a solution,thanks for your suggetion,denisT

i still don’t understand what you read from file and how you use it.

1 Reply
(@momo2012)
Joined: 11 months ago

Posts: 0

Just read data from another format,like .vbs,the vbs inculdes funtions and rollout,but not using maxscript wrote,so I need to import them into maxscript via this way,the array execute almost the last step,before it ,all translation work have done except Freezing Step.

it seems to me that you doing something wrong. but the issue might be a memory limit.

try to add initially allocated by the system MXS memory.
(Initial heap allocation in preference settings). make it 200Mbytes for example.

1 Reply
(@momo2012)
Joined: 11 months ago

Posts: 0

Hi,denisT,thanks too much for your kindly help,you’re correct,after I added the heapsize, it works fine!!!
:bowdown: